Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
JReinhold committed Jan 13, 2025
1 parent 909debf commit 26d9df6
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 20 deletions.
4 changes: 2 additions & 2 deletions src/compiler/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ export async function transformPlugin(): Promise<Plugin> {
return {
optimizeDeps: {
include: ['@storybook/addon-svelte-csf/internal/create-runtime-stories'],
}
}
},
};
},
async transform(compiledCode, id) {
if (!filter(id)) return undefined;
Expand Down
4 changes: 3 additions & 1 deletion src/compiler/post-transform/define-meta/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ describe(transformDefineMeta.name, () => {
ast: parseAst(code.toString()),
});

expect(print(defineMetaVariableDeclaration).code).toMatchInlineSnapshot(`"const { Story } = defineMeta(meta);"`);
expect(print(defineMetaVariableDeclaration).code).toMatchInlineSnapshot(
`"const { Story } = defineMeta(meta);"`
);
});
});
2 changes: 1 addition & 1 deletion src/runtime/contexts/extractor.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function useStoriesExtractor<TCmp extends Cmp>() {
CONTEXT_KEY,
buildContext<TCmp>({
isExtracting: false,
register: () => { },
register: () => {},
})
);
}
Expand Down
10 changes: 5 additions & 5 deletions svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default {
kit: {
files: {
lib: 'src',
}
}
kit: {
files: {
lib: 'src',
},
},
};
9 changes: 7 additions & 2 deletions tests/extractor.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import { type SvelteAST } from '$lib/parser/ast.js';
export declare function extractSvelteNode<TNode extends SvelteAST.SvelteNode | SvelteAST.Script>(parsed: SvelteAST.SvelteNode | SvelteAST.Script, name: TNode['type']): Promise<TNode>;
export declare function parseAndExtractSvelteNode<TNode extends SvelteAST.SvelteNode | SvelteAST.Script>(code: string, name: TNode['type']): Promise<TNode>;
export declare function extractSvelteNode<TNode extends SvelteAST.SvelteNode | SvelteAST.Script>(
parsed: SvelteAST.SvelteNode | SvelteAST.Script,
name: TNode['type']
): Promise<TNode>;
export declare function parseAndExtractSvelteNode<
TNode extends SvelteAST.SvelteNode | SvelteAST.Script,
>(code: string, name: TNode['type']): Promise<TNode>;
12 changes: 4 additions & 8 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,11 @@
"verbatimModuleSyntax": true,
"isolatedModules": true,
"types": ["vitest/importMeta"],
"forceConsistentCasingInFileNames": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"$lib": [
"src"
],
"$lib/*": [
"src/*"
]
},
"$lib": ["src"],
"$lib/*": ["src/*"]
},
"plugins": [
{
"name": "typescript-svelte-plugin",
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default defineConfig({
resolve: {
alias: {
// This is already set up in svelte.config.js, but we need it explicitly here for vitest
'$lib': path.resolve(__dirname, 'src'),
$lib: path.resolve(__dirname, 'src'),
},
},
test: {
Expand Down

0 comments on commit 26d9df6

Please sign in to comment.