Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Svelte: Improve argTypes inference with svelte2tsx - support runes #29423

Merged
merged 26 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
c7a619d
svelte: autodocs with svelte2tsx
ciscorn Jul 9, 2024
ad9429b
rename: ts2doc -> generateDocgen
ciscorn Jul 10, 2024
e38d5c0
svelte2tsx + babel/parser (remove typescript dep)
ciscorn Jul 11, 2024
a4f4a6a
Merge remote-tracking branch 'upstream/next' into svelte-autodoc-ts
ciscorn Jul 11, 2024
43bc7d5
svelte docgen: enrich stories
ciscorn Jul 12, 2024
b574f80
Migrate to TypeScript for parsing and type inference
ciscorn Jul 15, 2024
436bab1
Merge branch 'storybookjs:next' into svelte-autodoc-ts
ciscorn Jul 15, 2024
8c987f7
yarn check
ciscorn Jul 16, 2024
46a70df
JSDoc @type comment
ciscorn Jul 18, 2024
789c232
ignore HTMLAttributes, etc.
ciscorn Jul 18, 2024
08c9bca
some fixes
ciscorn Jul 23, 2024
0d68f6a
svelte autodoc: extensive prop examples
ciscorn Jul 27, 2024
82379df
svelte autodocs: symbol, enum
ciscorn Jul 27, 2024
38a16a5
svelte autodoc: improve jsdoc support
ciscorn Jul 27, 2024
2b7694d
svelte docgen: improve caching
ciscorn Jul 29, 2024
7e2d0f8
svelte docgen: fix for e2e test
ciscorn Jul 29, 2024
5781385
non-string union into radio
ciscorn Sep 6, 2024
ece406c
prefer tsconfig over jsconfig
ciscorn Sep 6, 2024
5c994a0
svelte-kit/prerelease-ts: rename doc examples
ciscorn Sep 7, 2024
1fe5ca8
Merge remote-tracking branch 'upstream/next' into svelte-autodoc-ts
ciscorn Sep 7, 2024
08d3f4f
fix lint, e2e
ciscorn Sep 7, 2024
0d696db
fix type.name being '{}' instead of 'object'
JReinhold Oct 18, 2024
a4b54b6
Merge branch 'next' of github.com:storybookjs/storybook into svelte-a…
JReinhold Oct 18, 2024
6ddb46e
Merge branch 'next' into svelte-autodoc-ts
JReinhold Oct 22, 2024
7cecdaf
Merge branch 'next' of github.com:storybookjs/storybook into svelte-a…
JReinhold Oct 24, 2024
08c2bb9
Merge branch 'next' into svelte-autodoc-ts
JReinhold Oct 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions code/e2e-tests/framework-svelte.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ test.describe('Svelte', () => {
test('JS story has auto-generated args table', async ({ page }) => {
const sbPage = new SbPage(page, expect);

await sbPage.navigateToStory('stories/renderers/svelte/js-docs', 'docs');
await sbPage.navigateToStory('stories/renderers/svelte/docs-jsdoc', 'docs');
const root = sbPage.previewRoot();
const argsTable = root.locator('.docblock-argstable');
await expect(argsTable).toContainText('Rounds the button');
await expect(argsTable).toContainText('Union of literal strings');
});

test('TS story has auto-generated args table', async ({ page }) => {
test.skip(!templateName?.endsWith('ts') || false, 'Only test TS story in TS templates');
const sbPage = new SbPage(page, expect);

await sbPage.navigateToStory('stories/renderers/svelte/ts-docs', 'docs');
await sbPage.navigateToStory('stories/renderers/svelte/docs-ts', 'docs');
const root = sbPage.previewRoot();
const argsTable = root.locator('.docblock-argstable');
await expect(argsTable).toContainText('Rounds the button');
await expect(argsTable).toContainText('Union of literal strings');
});

test('Decorators are excluded from generated source code', async ({ page }) => {
Expand Down
4 changes: 3 additions & 1 deletion code/frameworks/svelte-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@
"@storybook/svelte": "workspace:*",
"magic-string": "^0.30.0",
"svelte-preprocess": "^5.1.1",
"svelte2tsx": "^0.7.13",
"sveltedoc-parser": "^4.2.1",
"ts-dedent": "^2.2.0"
"ts-dedent": "^2.2.0",
"typescript": "^4.9.4 || ^5.0.0"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^4.0.0",
Expand Down
Loading