Skip to content

Commit fc8e649

Browse files
committed
add fixes based on latest version of svelte
1 parent 25531f5 commit fc8e649

File tree

8 files changed

+10
-8
lines changed

8 files changed

+10
-8
lines changed

src/compiler/post-transform/appendix/create-export-order.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,6 @@ export function createExportOrderVariableDeclaration(
3636
},
3737
],
3838
},
39+
attributes: [],
3940
};
4041
}

src/compiler/post-transform/appendix/create-import.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,6 @@ export function createRuntimeStoriesImport(): ESTreeAST.ImportDeclaration {
2626
local: imported,
2727
},
2828
],
29+
attributes: [],
2930
};
3031
}

src/compiler/post-transform/appendix/create-named-export-stories.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export function createNamedExportStories(
1313
type: 'ExportNamedDeclaration',
1414
specifiers: params.storiesIdentifiers.map(createExportSpecifier),
1515
declaration: null,
16+
attributes: [],
1617
};
1718
}
1819

src/parser/ast.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ export function getSvelteAST(options: GetSvelteASTOptions) {
2222
*/
2323
export function createASTAttribute(
2424
name: string,
25-
value: SvelteAST.Attribute['value'] = true
25+
value: SvelteAST.Attribute['value'] = true,
2626
): SvelteAST.Attribute {
27+
// @ts-expect-error - name_loc is required but not used
2728
return {
2829
type: 'Attribute',
2930
name,

src/runtime/LegacyStory.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ Vite pre-transform hook does codemod where this component gets transformed into
1515
type $$Props = StoryProps;
1616
type $$Slots = Slots;
1717
18-
let args: $$Slots['default']['args'];
19-
let context: $$Slots['default']['context'];
18+
let args!: $$Slots['default']['args'];
19+
let context!: $$Slots['default']['context'];
2020
</script>
2121

2222
<slot {context} {args} />

src/runtime/LegacyTemplate.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ Vite pre-transform hook does codemod where this component gets transformed into
1818
type $$Props = TemplateProps;
1919
type $$Slots = Slots;
2020
21-
let args: $$Slots['default']['args'];
22-
let context: $$Slots['default']['context'];
21+
let args!: $$Slots['default']['args'];
22+
let context!: $$Slots['default']['context'];
2323
</script>
2424

2525
<slot {context} {args} />

src/runtime/create-runtime-stories.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ export const createRuntimeStories = (Stories: Component, meta: ComponentAnnotati
7575
return delegate(storyContext);
7676
}
7777

78-
// @ts-expect-error WARN: It should not affect user perspective- the problem lies in this addon's type `SvelteRenderer` missing type constrains or default generic parameter type
7978
return play(storyContext);
8079
};
8180
}

tests/stories/LegacyStory.stories.svelte

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<script context="module" lang="ts">
22
import { Story, Template, type StoryProps } from '@storybook/addon-svelte-csf';
33
import { expect, within } from 'storybook/test';
4-
import type { Meta } from '@storybook/svelte-vite';
54
65
import LegacyStory from './LegacyStory.svelte';
76
@@ -21,7 +20,7 @@
2120
rounded: false,
2221
},
2322
tags: ['autodocs'],
24-
} satisfies Meta<LegacyStory>;
23+
};
2524
2625
let count = 0;
2726

0 commit comments

Comments
 (0)