@storybook/svelte 11.0.0-alpha.4 → 11.0.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_node-chunks/chunk-6BK7HG3O.js +18 -0
- package/dist/_node-chunks/{chunk-WLOBE2PV.js → chunk-O2DS6ZO4.js} +9 -7
- package/dist/_node-chunks/{parsers-7UT6VQFY.js → parsers-M6NONOAR.js} +6 -6
- package/dist/_node-chunks/{walk-OD6JWHQN.js → walk-6ZITNZOU.js} +6 -6
- package/dist/docgen/docgen-worker.js +7 -7
- package/dist/preset.js +15 -22
- package/dist/svelte-csf/addon-check.js +6 -6
- package/dist/svelte-csf/compiler/transform.js +19 -19
- package/dist/svelte-csf/indexer/index.js +21 -21
- package/package.json +3 -7
- package/dist/_node-chunks/chunk-I6YGVJHW.js +0 -18
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_sonf0acx99i from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_sonf0acx99i from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_sonf0acx99i from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_sonf0acx99i.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_sonf0acx99i.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_sonf0acx99i.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
|
|
13
|
+
// src/docgen/story-file.ts
|
|
14
|
+
var SVELTE_STORY_FILE_TEST_REGEXP = /\.stories\.svelte$/;
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
SVELTE_STORY_FILE_TEST_REGEXP
|
|
18
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_sonf0acx99i from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_sonf0acx99i from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_sonf0acx99i from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_sonf0acx99i.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_sonf0acx99i.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_sonf0acx99i.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -356,7 +356,9 @@ In a SvelteKit project, import defineMeta from "${StorybookSvelteCSFError.svelte
|
|
|
356
356
|
|
|
357
357
|
${describeCause(this.cause)}
|
|
358
358
|
|
|
359
|
-
|
|
359
|
+
The indexer doesn't run Svelte preprocessors. It ignores the content of <style> blocks, but the rest of a stories file must be standard Svelte syntax.
|
|
360
|
+
|
|
361
|
+
If the original error doesn't point to a problem in the stories file, please report it on the issue tracker on GitHub at https://github.com/storybookjs/storybook/issues/new?template=bug_report.yml.
|
|
360
362
|
`;
|
|
361
363
|
}
|
|
362
364
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_sonf0acx99i from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_sonf0acx99i from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_sonf0acx99i from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_sonf0acx99i.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_sonf0acx99i.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_sonf0acx99i.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_sonf0acx99i from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_sonf0acx99i from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_sonf0acx99i from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_sonf0acx99i.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_sonf0acx99i.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_sonf0acx99i.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_sonf0acx99i from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_sonf0acx99i from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_sonf0acx99i from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_sonf0acx99i.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_sonf0acx99i.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_sonf0acx99i.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
SVELTE_STORY_FILE_TEST_REGEXP
|
|
14
|
-
} from "../_node-chunks/chunk-
|
|
14
|
+
} from "../_node-chunks/chunk-6BK7HG3O.js";
|
|
15
15
|
|
|
16
16
|
// src/docgen/docgen-worker.ts
|
|
17
17
|
import { createLazyDocgenMiddleware } from "storybook/internal/common";
|
package/dist/preset.js
CHANGED
|
@@ -1,34 +1,28 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_sonf0acx99i from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_sonf0acx99i from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_sonf0acx99i from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_sonf0acx99i.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_sonf0acx99i.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_sonf0acx99i.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
SVELTE_STORY_FILE_TEST_REGEXP
|
|
14
|
-
} from "./_node-chunks/chunk-
|
|
14
|
+
} from "./_node-chunks/chunk-6BK7HG3O.js";
|
|
15
15
|
|
|
16
16
|
// src/preset.ts
|
|
17
|
-
import { fileURLToPath as
|
|
18
|
-
|
|
19
|
-
// src/docgen/preset.ts
|
|
20
|
-
import { fileURLToPath } from "node:url";
|
|
17
|
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
21
18
|
|
|
22
19
|
// src/docgen/worker-specifier.ts
|
|
23
20
|
var DOCGEN_WORKER_SPECIFIER = "@storybook/svelte/internal/docgen-worker";
|
|
24
21
|
|
|
25
22
|
// src/docgen/preset.ts
|
|
26
|
-
var
|
|
27
|
-
...existing,
|
|
28
|
-
{ moduleSpecifier: fileURLToPath(import.meta.resolve(DOCGEN_WORKER_SPECIFIER)) }
|
|
29
|
-
] : existing, experimental_manifests = async (existingManifests = {}, options) => {
|
|
23
|
+
var experimental_manifests = async (existingManifests = {}, options) => {
|
|
30
24
|
let features = await options.presets.apply("features", {});
|
|
31
|
-
return !features?.
|
|
25
|
+
return !features?.docgenServer || !features?.componentsManifest ? existingManifests : {
|
|
32
26
|
...existingManifests,
|
|
33
27
|
components: {
|
|
34
28
|
v: 0,
|
|
@@ -39,7 +33,7 @@ var experimental_docgenProvider = async (existing = [], options) => (await optio
|
|
|
39
33
|
};
|
|
40
34
|
|
|
41
35
|
// src/docgen/story-docs-provider.ts
|
|
42
|
-
import { fileURLToPath
|
|
36
|
+
import { fileURLToPath } from "node:url";
|
|
43
37
|
import { getStoryImportPathFromEntry } from "storybook/internal/common";
|
|
44
38
|
|
|
45
39
|
// src/docgen/story-docs/build-story-docs.ts
|
|
@@ -51,7 +45,7 @@ var experimental_storyDocsProvider = async (nextStoryDocs, options) => {
|
|
|
51
45
|
let descriptors = await options.presets.apply(
|
|
52
46
|
"experimental_docgenProvider",
|
|
53
47
|
[]
|
|
54
|
-
), svelteWorker =
|
|
48
|
+
), svelteWorker = fileURLToPath(import.meta.resolve(DOCGEN_WORKER_SPECIFIER));
|
|
55
49
|
return descriptors.some((descriptor) => descriptor.moduleSpecifier === svelteWorker) ? async (input) => {
|
|
56
50
|
let storyImportPath = getStoryImportPathFromEntry(input.entry);
|
|
57
51
|
if (!storyImportPath || !SVELTE_STORY_FILE_TEST_REGEXP.test(storyImportPath))
|
|
@@ -64,18 +58,17 @@ var experimental_storyDocsProvider = async (nextStoryDocs, options) => {
|
|
|
64
58
|
// src/preset.ts
|
|
65
59
|
var previewAnnotations = async (input = [], options) => {
|
|
66
60
|
let docsEnabled = Object.keys(await options.presets.apply("docs", {}, options)).length > 0;
|
|
67
|
-
return [].concat(input).concat([
|
|
68
|
-
docsEnabled ? [
|
|
61
|
+
return [].concat(input).concat([fileURLToPath2(import.meta.resolve("@storybook/svelte/entry-preview"))]).concat(
|
|
62
|
+
docsEnabled ? [fileURLToPath2(import.meta.resolve("@storybook/svelte/entry-preview-docs"))] : []
|
|
69
63
|
);
|
|
70
64
|
}, experimental_importParsers = async (input = []) => {
|
|
71
|
-
let { svelteImportParser } = await import("./_node-chunks/parsers-
|
|
65
|
+
let { svelteImportParser } = await import("./_node-chunks/parsers-M6NONOAR.js");
|
|
72
66
|
return [...input, svelteImportParser];
|
|
73
67
|
}, experimental_indexers = async (existingIndexers) => {
|
|
74
68
|
let { createIndexer } = await import("./svelte-csf/indexer/index.js");
|
|
75
69
|
return [createIndexer(), ...existingIndexers ?? []];
|
|
76
70
|
};
|
|
77
71
|
export {
|
|
78
|
-
experimental_docgenProvider,
|
|
79
72
|
experimental_importParsers,
|
|
80
73
|
experimental_indexers,
|
|
81
74
|
experimental_manifests,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_sonf0acx99i from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_sonf0acx99i from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_sonf0acx99i from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_sonf0acx99i.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_sonf0acx99i.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_sonf0acx99i.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_sonf0acx99i from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_sonf0acx99i from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_sonf0acx99i from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_sonf0acx99i.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_sonf0acx99i.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_sonf0acx99i.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
getStoriesIdentifiers,
|
|
39
39
|
getSvelteAST,
|
|
40
40
|
isOneOf
|
|
41
|
-
} from "../../_node-chunks/chunk-
|
|
41
|
+
} from "../../_node-chunks/chunk-O2DS6ZO4.js";
|
|
42
42
|
|
|
43
43
|
// src/svelte-csf/compiler/transform.ts
|
|
44
44
|
import fs from "node:fs";
|
|
@@ -50,14 +50,14 @@ for (let i = 0; i < chars.length; i++) {
|
|
|
50
50
|
let c2 = chars.charCodeAt(i);
|
|
51
51
|
intToChar[i] = c2, charToInt[c2] = i;
|
|
52
52
|
}
|
|
53
|
-
function encodeInteger(builder, num
|
|
54
|
-
let delta = num - relative;
|
|
55
|
-
delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
|
|
53
|
+
function encodeInteger(builder, num) {
|
|
56
54
|
do {
|
|
57
|
-
let clamped =
|
|
58
|
-
|
|
59
|
-
} while (
|
|
60
|
-
|
|
55
|
+
let clamped = num & 31;
|
|
56
|
+
num >>>= 5, num > 0 && (clamped |= 32), builder.write(intToChar[clamped]);
|
|
57
|
+
} while (num > 0);
|
|
58
|
+
}
|
|
59
|
+
function encodeSign(num) {
|
|
60
|
+
return num < 0 ? -num << 1 | 1 : num << 1;
|
|
61
61
|
}
|
|
62
62
|
var bufLength = 1024 * 16, td = typeof TextDecoder < "u" ? new TextDecoder() : typeof Buffer < "u" ? {
|
|
63
63
|
decode(buf) {
|
|
@@ -91,7 +91,7 @@ function encode(decoded) {
|
|
|
91
91
|
let genColumn = 0;
|
|
92
92
|
for (let j = 0; j < line.length; j++) {
|
|
93
93
|
let segment = line[j];
|
|
94
|
-
j > 0 && writer.write(comma),
|
|
94
|
+
j > 0 && writer.write(comma), encodeInteger(writer, encodeSign(segment[0] - genColumn)), genColumn = segment[0], segment.length !== 1 && (encodeInteger(writer, encodeSign(segment[1] - sourcesIndex)), encodeInteger(writer, encodeSign(segment[2] - sourceLine)), encodeInteger(writer, encodeSign(segment[3] - sourceColumn)), sourcesIndex = segment[1], sourceLine = segment[2], sourceColumn = segment[3], segment.length !== 4 && (encodeInteger(writer, encodeSign(segment[4] - namesIndex)), namesIndex = segment[4]));
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
return writer.flush();
|
|
@@ -2010,7 +2010,7 @@ function getStoryTags(params) {
|
|
|
2010
2010
|
|
|
2011
2011
|
// src/svelte-csf/parser/extract/compiled/stories.ts
|
|
2012
2012
|
async function extractStoriesNodesFromExportDefaultFn(params) {
|
|
2013
|
-
let { walk } = await import("../../_node-chunks/walk-
|
|
2013
|
+
let { walk } = await import("../../_node-chunks/walk-6ZITNZOU.js"), { nodes } = params, { storiesFunctionDeclaration, storyIdentifier } = nodes, state = [], visitors = {
|
|
2014
2014
|
CallExpression(node, context) {
|
|
2015
2015
|
let { state: state2 } = context;
|
|
2016
2016
|
node.callee.type === "Identifier" && node.callee.name === storyIdentifier.name ? state2.push(node) : context.next();
|
|
@@ -2055,7 +2055,7 @@ var AST_NODES_NAMES = {
|
|
|
2055
2055
|
Story: "Story"
|
|
2056
2056
|
};
|
|
2057
2057
|
async function extractCompiledASTNodes(params) {
|
|
2058
|
-
let { ast, filename } = params, { walk } = await import("../../_node-chunks/walk-
|
|
2058
|
+
let { ast, filename } = params, { walk } = await import("../../_node-chunks/walk-6ZITNZOU.js"), state = { potentialStoriesFunctionDeclaration: [] }, imports = findDefineMetaImport(ast.body);
|
|
2059
2059
|
state.defineMetaImport = imports.defineMetaImport, walk(ast, state, {
|
|
2060
2060
|
VariableDeclaration(node, { state: state2 }) {
|
|
2061
2061
|
let { declarations } = node, declaration = declarations[0], { id, init } = declaration;
|
|
@@ -2113,7 +2113,7 @@ async function extractModuleNodes(options) {
|
|
|
2113
2113
|
let { module, filename } = options;
|
|
2114
2114
|
if (!module)
|
|
2115
2115
|
throw new MissingModuleTagError(filename);
|
|
2116
|
-
let { walk } = await import("../../_node-chunks/walk-
|
|
2116
|
+
let { walk } = await import("../../_node-chunks/walk-6ZITNZOU.js"), imports = findDefineMetaImport(module.content.body), state = { defineMetaImport: imports.defineMetaImport }, visitors = {
|
|
2117
2117
|
VariableDeclaration(node, { state: state2 }) {
|
|
2118
2118
|
let { declarations } = node, declaration = declarations[0], { id, init } = declaration;
|
|
2119
2119
|
if (id.type === "ObjectPattern" && init?.type === "CallExpression" && init.callee.type === "Identifier" && init.callee.name === state2.defineMetaImport?.local.name) {
|
|
@@ -2140,7 +2140,7 @@ async function extractModuleNodes(options) {
|
|
|
2140
2140
|
|
|
2141
2141
|
// src/svelte-csf/parser/extract/svelte/fragment-nodes.ts
|
|
2142
2142
|
async function extractFragmentNodes(params) {
|
|
2143
|
-
let { walk } = await import("../../_node-chunks/walk-
|
|
2143
|
+
let { walk } = await import("../../_node-chunks/walk-6ZITNZOU.js"), { fragment, moduleNodes } = params, { storyIdentifier } = moduleNodes, latestComment, state = {
|
|
2144
2144
|
storyComponents: [],
|
|
2145
2145
|
snippetBlocks: []
|
|
2146
2146
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_sonf0acx99i from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_sonf0acx99i from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_sonf0acx99i from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_sonf0acx99i.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_sonf0acx99i.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_sonf0acx99i.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -31,11 +31,10 @@ import {
|
|
|
31
31
|
getStoryIdentifiers,
|
|
32
32
|
getSvelteAST,
|
|
33
33
|
isStorybookSvelteCSFError
|
|
34
|
-
} from "../../_node-chunks/chunk-
|
|
34
|
+
} from "../../_node-chunks/chunk-O2DS6ZO4.js";
|
|
35
35
|
|
|
36
36
|
// src/svelte-csf/indexer/parser.ts
|
|
37
37
|
import fs from "node:fs/promises";
|
|
38
|
-
import { preprocess } from "svelte/compiler";
|
|
39
38
|
|
|
40
39
|
// src/svelte-csf/parser/analyse/define-meta/properties.ts
|
|
41
40
|
function getPropertyStringValue(options) {
|
|
@@ -65,22 +64,23 @@ function getPropertyArrayOfStringsValue(options) {
|
|
|
65
64
|
}
|
|
66
65
|
|
|
67
66
|
// src/svelte-csf/indexer/parser.ts
|
|
68
|
-
var
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
67
|
+
var styleBlocks = /<script(?:\s(?:"[^"]*"|'[^']*'|[^>"'])*)?>[\s\S]*?<\/script\s*>|<!--[\s\S]*?-->|(<style(?:\s(?:"[^"]*"|'[^']*'|[^>"'])*)?>)([\s\S]*?)(<\/style\s*>)/g;
|
|
68
|
+
function getIndexableAST(code, filename) {
|
|
69
|
+
try {
|
|
70
|
+
return getSvelteAST({ code, filename });
|
|
71
|
+
} catch {
|
|
72
|
+
let blanked = code.replace(
|
|
73
|
+
styleBlocks,
|
|
74
|
+
(match, open, content = "", close = "") => open === void 0 ? match : open + content.replace(/[^\r\n]/g, " ") + close
|
|
75
|
+
);
|
|
76
|
+
return getSvelteAST({ code: blanked, filename });
|
|
77
|
+
}
|
|
73
78
|
}
|
|
74
79
|
async function parseForIndexer(filename) {
|
|
75
|
-
let [
|
|
80
|
+
let [code, { walk }] = await Promise.all([
|
|
76
81
|
fs.readFile(filename, { encoding: "utf8" }),
|
|
77
|
-
import("../../_node-chunks/walk-
|
|
78
|
-
|
|
79
|
-
]), code = rawCode;
|
|
80
|
-
svelteConfig?.preprocess && (code = (await preprocess(code, svelteConfig.preprocess, {
|
|
81
|
-
filename
|
|
82
|
-
})).code);
|
|
83
|
-
let svelteAST = getSvelteAST({ code, filename }), results = {
|
|
82
|
+
import("../../_node-chunks/walk-6ZITNZOU.js")
|
|
83
|
+
]), svelteAST = getIndexableAST(code, filename), results = {
|
|
84
84
|
meta: {},
|
|
85
85
|
stories: []
|
|
86
86
|
}, hasDefaultOrNamespaceImport = !1;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/svelte",
|
|
3
|
-
"version": "11.0.0-alpha.
|
|
3
|
+
"version": "11.0.0-alpha.5",
|
|
4
4
|
"description": "Storybook Svelte renderer: Develop, document, and test UI components in isolation.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"type-fest": "^5.6.0"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
|
-
"@storybook/builder-vite": "11.0.0-alpha.
|
|
87
|
+
"@storybook/builder-vite": "11.0.0-alpha.5",
|
|
88
88
|
"@sveltejs/vite-plugin-svelte": "^6.2.0",
|
|
89
89
|
"@testing-library/svelte": "^5.2.4",
|
|
90
90
|
"esrap": "1.2.2",
|
|
@@ -98,16 +98,12 @@
|
|
|
98
98
|
"zimmerframe": "^1.1.2"
|
|
99
99
|
},
|
|
100
100
|
"peerDependencies": {
|
|
101
|
-
"
|
|
102
|
-
"storybook": "^11.0.0-alpha.4",
|
|
101
|
+
"storybook": "^11.0.0-alpha.5",
|
|
103
102
|
"svelte": "^5.0.0",
|
|
104
103
|
"typescript": "^5.9.0 || ^6.0.0",
|
|
105
104
|
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"
|
|
106
105
|
},
|
|
107
106
|
"peerDependenciesMeta": {
|
|
108
|
-
"@sveltejs/vite-plugin-svelte": {
|
|
109
|
-
"optional": true
|
|
110
|
-
},
|
|
111
107
|
"typescript": {
|
|
112
108
|
"optional": true
|
|
113
109
|
},
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_zkvrpzic86 from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_zkvrpzic86 from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_zkvrpzic86 from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_zkvrpzic86.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_zkvrpzic86.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_zkvrpzic86.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|
|
12
|
-
|
|
13
|
-
// src/docgen/story-file.ts
|
|
14
|
-
var SVELTE_STORY_FILE_TEST_REGEXP = /\.stories\.svelte$/;
|
|
15
|
-
|
|
16
|
-
export {
|
|
17
|
-
SVELTE_STORY_FILE_TEST_REGEXP
|
|
18
|
-
};
|