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 #28492

Merged
merged 21 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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);

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);

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
5 changes: 3 additions & 2 deletions code/frameworks/svelte-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,15 @@
"@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": "^3.0.1",
"@types/node": "^22.0.0",
"svelte": "^5.0.0-next.65",
"typescript": "^5.3.2",
"vite": "^4.0.0"
},
"peerDependencies": {
Expand Down
Loading