@storybook/angular-vite 11.0.0-beta.3 → 11.0.0-beta.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/_browser-chunks/{chunk-VA3FEKPB.js → chunk-2JE7SKTX.js} +7 -7
- package/dist/_browser-chunks/{chunk-OAG3JRJQ.js → chunk-56QYE53C.js} +3 -3
- package/dist/_browser-chunks/{chunk-JSKZYOEY.js → chunk-GVR3YWT3.js} +1 -1
- package/dist/_browser-chunks/{chunk-FDLKT4EQ.js → chunk-UU6I6OE3.js} +1 -1
- package/dist/_node-chunks/{chunk-UTSO2W6Q.js → chunk-AVIR5V77.js} +1 -12
- package/dist/_node-chunks/{chunk-NV6YXVLU.js → chunk-DSX4K57A.js} +0 -12
- package/dist/_node-chunks/chunk-MIQVDAHU.js +37 -0
- package/dist/_node-chunks/{chunk-GWSNLRTA.js → chunk-V5HMO3W7.js} +0 -12
- package/dist/_node-chunks/story-docs-template-analysis-D4DNIJAK.js +8 -0
- package/dist/builders/build-storybook/index.js +9 -17
- package/dist/builders/start-storybook/index.js +9 -17
- package/dist/client/config.js +2 -2
- package/dist/client/docs/config.js +2 -2
- package/dist/client/index.js +4 -4
- package/dist/docgen/docgen-worker.js +122 -601
- package/dist/index.js +4 -4
- package/dist/node/index.js +0 -12
- package/dist/node/vitest.js +0 -12
- package/dist/preset.js +8 -17
- package/package.json +6 -6
- package/dist/_node-chunks/chunk-KF3ADECJ.js +0 -42
- package/dist/_node-chunks/story-docs-template-analysis-U2JRJFSJ.js +0 -19
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
inputBinding,
|
|
8
8
|
printExpressionValue,
|
|
9
9
|
textValue
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-UU6I6OE3.js";
|
|
11
11
|
|
|
12
12
|
// src/client/docs/config.ts
|
|
13
13
|
var config_exports = {};
|
|
@@ -15,7 +15,7 @@ __export(config_exports, {
|
|
|
15
15
|
decorators: () => decorators,
|
|
16
16
|
parameters: () => parameters
|
|
17
17
|
});
|
|
18
|
-
import { SourceType as SourceType2 } from "storybook/internal/docs-tools";
|
|
18
|
+
import { SourceType as SourceType2, getSourceSnippetRuntime } from "storybook/internal/docs-tools";
|
|
19
19
|
|
|
20
20
|
// src/client/docs/print-hole.ts
|
|
21
21
|
import {
|
|
@@ -65,16 +65,16 @@ var skipSourceRender = (context) => {
|
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
// src/client/docs/config.ts
|
|
68
|
-
var
|
|
68
|
+
var snippetRuntime = getSourceSnippetRuntime(), parameters = {
|
|
69
69
|
docs: {
|
|
70
70
|
source: {
|
|
71
71
|
type: SourceType2.DYNAMIC,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
...
|
|
72
|
+
// The server snippet is the TypeScript host component that renders the story.
|
|
73
|
+
language: snippetRuntime === "server" ? "ts" : "html",
|
|
74
|
+
...snippetRuntime === "server" ? { printHole } : {}
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
}, decorators =
|
|
77
|
+
}, decorators = snippetRuntime === "preview" ? [sourceDecorator] : [];
|
|
78
78
|
|
|
79
79
|
export {
|
|
80
80
|
parameters,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
config_exports
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GVR3YWT3.js";
|
|
4
4
|
import {
|
|
5
5
|
config_exports as config_exports2
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2JE7SKTX.js";
|
|
7
7
|
import {
|
|
8
8
|
computesTemplateFromComponent,
|
|
9
9
|
formatPropInTemplate,
|
|
10
10
|
isComponent,
|
|
11
11
|
render_exports
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-UU6I6OE3.js";
|
|
13
13
|
|
|
14
14
|
// src/client/portable-stories.ts
|
|
15
15
|
import {
|
|
@@ -519,7 +519,7 @@ var applicationRefs = /* @__PURE__ */ new Map(), STORY_UID_ATTRIBUTE = "data-sb-
|
|
|
519
519
|
/** Wait and destroy the platform */
|
|
520
520
|
static resetApplications(domNode) {
|
|
521
521
|
applicationRefs.forEach((appRef, appDOMNode) => {
|
|
522
|
-
if (!
|
|
522
|
+
if (!(domNode && appDOMNode !== domNode) && (applicationRefs.delete(appDOMNode), !appRef.destroyed))
|
|
523
523
|
try {
|
|
524
524
|
appRef.components.slice().forEach((componentRef) => componentRef.destroy());
|
|
525
525
|
} finally {
|
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_4pl39hy6w4x from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_4pl39hy6w4x from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_4pl39hy6w4x from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_4pl39hy6w4x.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_4pl39hy6w4x.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_4pl39hy6w4x.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|
|
12
1
|
import {
|
|
13
2
|
up
|
|
14
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DSX4K57A.js";
|
|
15
4
|
|
|
16
5
|
// ../../../node_modules/empathic/package.mjs
|
|
17
6
|
function up2(options) {
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_4pl39hy6w4x from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_4pl39hy6w4x from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_4pl39hy6w4x from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_4pl39hy6w4x.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_4pl39hy6w4x.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_4pl39hy6w4x.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|
|
12
|
-
|
|
13
1
|
// src/find-tsconfig.ts
|
|
14
2
|
import { getProjectRoot } from "storybook/internal/common";
|
|
15
3
|
import { resolve as resolve2 } from "node:path";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// src/docgen/resolve-component.ts
|
|
2
|
+
import {
|
|
3
|
+
createMetaComponentResolver,
|
|
4
|
+
createModuleResolver,
|
|
5
|
+
extractDeclaredSubcomponents,
|
|
6
|
+
jsTsSourceExtensions
|
|
7
|
+
} from "storybook/internal/common";
|
|
8
|
+
import { loadCsf } from "storybook/internal/csf-tools";
|
|
9
|
+
import { readFileSync } from "node:fs";
|
|
10
|
+
var resolveMetaComponent = createMetaComponentResolver(), storyImportResolver = createModuleResolver({
|
|
11
|
+
extensions: [...jsTsSourceExtensions],
|
|
12
|
+
mainFields: ["module", "main"],
|
|
13
|
+
tsconfig: "auto"
|
|
14
|
+
});
|
|
15
|
+
function parseStoryFile(storyFilePath, title) {
|
|
16
|
+
try {
|
|
17
|
+
let source = readFileSync(storyFilePath, "utf8");
|
|
18
|
+
return loadCsf(source, { makeTitle: () => title, fileName: storyFilePath }).parse();
|
|
19
|
+
} catch {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function resolveStoryComponents(storyFilePath, title = "Docgen") {
|
|
24
|
+
let csf = parseStoryFile(storyFilePath, title);
|
|
25
|
+
return csf ? {
|
|
26
|
+
component: resolveMetaComponent(csf, storyFilePath),
|
|
27
|
+
subcomponents: extractDeclaredSubcomponents(csf).map(({ name, node }) => ({
|
|
28
|
+
name,
|
|
29
|
+
resolution: resolveMetaComponent(csf, storyFilePath, node)
|
|
30
|
+
}))
|
|
31
|
+
} : { component: { reason: "no-meta-component" }, subcomponents: [] };
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export {
|
|
35
|
+
parseStoryFile,
|
|
36
|
+
resolveStoryComponents
|
|
37
|
+
};
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_4pl39hy6w4x from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_4pl39hy6w4x from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_4pl39hy6w4x from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_4pl39hy6w4x.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_4pl39hy6w4x.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_4pl39hy6w4x.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|
|
12
|
-
|
|
13
1
|
// src/docgen/story-docs-template-analysis.ts
|
|
14
2
|
import {
|
|
15
3
|
CombinedRecursiveAstVisitor,
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_4pl39hy6w4x from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_4pl39hy6w4x from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_4pl39hy6w4x from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_4pl39hy6w4x.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_4pl39hy6w4x.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_4pl39hy6w4x.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|
|
12
1
|
import {
|
|
13
2
|
errorSummary,
|
|
14
3
|
mergeBrowserTargetOptions,
|
|
@@ -16,10 +5,10 @@ import {
|
|
|
16
5
|
printErrorDetails,
|
|
17
6
|
requireBuilderTarget,
|
|
18
7
|
up
|
|
19
|
-
} from "../../_node-chunks/chunk-
|
|
8
|
+
} from "../../_node-chunks/chunk-AVIR5V77.js";
|
|
20
9
|
import {
|
|
21
10
|
resolveTsconfig
|
|
22
|
-
} from "../../_node-chunks/chunk-
|
|
11
|
+
} from "../../_node-chunks/chunk-DSX4K57A.js";
|
|
23
12
|
|
|
24
13
|
// src/builders/build-storybook/index.ts
|
|
25
14
|
import { readFileSync } from "node:fs";
|
|
@@ -53,7 +42,7 @@ var commandBuilder = async (options, context) => {
|
|
|
53
42
|
sourceMap = !1,
|
|
54
43
|
preserveSymlinks = !1,
|
|
55
44
|
zoneless = !0
|
|
56
|
-
} = options, packageJsonPath = up({ cwd:
|
|
45
|
+
} = options, packageJsonPath = up({ cwd: import.meta.dirname }), packageJson = packageJsonPath != null ? JSON.parse(readFileSync(packageJsonPath, "utf8")) : null, declaredOptions = resolvedTarget ? await context.getTargetOptions(requireBuilderTarget(context)) : options, angularBuilderOptions = mergeBrowserTargetOptions(
|
|
57
46
|
{
|
|
58
47
|
stylePreprocessorOptions: declaredOptions.stylePreprocessorOptions,
|
|
59
48
|
styles: declaredOptions.styles,
|
|
@@ -79,9 +68,12 @@ var commandBuilder = async (options, context) => {
|
|
|
79
68
|
tsConfig,
|
|
80
69
|
statsJson: normalizeStatsJson(statsJson)
|
|
81
70
|
};
|
|
82
|
-
if (process.env.STORYBOOK_ANGULAR_BUILDER_OPTIONS_JSON = JSON.stringify(
|
|
83
|
-
standaloneOptions.angularBuilderOptions
|
|
84
|
-
|
|
71
|
+
if (process.env.STORYBOOK_ANGULAR_BUILDER_OPTIONS_JSON = JSON.stringify({
|
|
72
|
+
...standaloneOptions.angularBuilderOptions,
|
|
73
|
+
// Style and load paths in the target options are workspace-root-relative; the addon-vitest
|
|
74
|
+
// child runs with a different Vite root, so it needs the workspace root to resolve them.
|
|
75
|
+
workspaceRoot: context.workspaceRoot
|
|
76
|
+
}), await runInstance({ ...standaloneOptions, mode: "static" }), logTracker.shouldWriteLogsToFile) {
|
|
85
77
|
let logFile = await logTracker.writeToFile(options.logfile);
|
|
86
78
|
logger.info(`Debug logs are written to: ${logFile}`);
|
|
87
79
|
}
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_4pl39hy6w4x from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_4pl39hy6w4x from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_4pl39hy6w4x from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_4pl39hy6w4x.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_4pl39hy6w4x.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_4pl39hy6w4x.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|
|
12
1
|
import {
|
|
13
2
|
errorSummary,
|
|
14
3
|
mergeBrowserTargetOptions,
|
|
@@ -16,10 +5,10 @@ import {
|
|
|
16
5
|
printErrorDetails,
|
|
17
6
|
requireBuilderTarget,
|
|
18
7
|
up
|
|
19
|
-
} from "../../_node-chunks/chunk-
|
|
8
|
+
} from "../../_node-chunks/chunk-AVIR5V77.js";
|
|
20
9
|
import {
|
|
21
10
|
resolveTsconfig
|
|
22
|
-
} from "../../_node-chunks/chunk-
|
|
11
|
+
} from "../../_node-chunks/chunk-DSX4K57A.js";
|
|
23
12
|
|
|
24
13
|
// src/builders/start-storybook/index.ts
|
|
25
14
|
import { readFileSync } from "node:fs";
|
|
@@ -70,7 +59,7 @@ var commandBuilder = (options, context) => new Observable((observer) => {
|
|
|
70
59
|
sourceMap = !1,
|
|
71
60
|
preserveSymlinks = !1,
|
|
72
61
|
zoneless = !0
|
|
73
|
-
} = options, packageJsonPath = up({ cwd:
|
|
62
|
+
} = options, packageJsonPath = up({ cwd: import.meta.dirname }), packageJson = packageJsonPath != null ? JSON.parse(readFileSync(packageJsonPath, "utf8")) : null, declaredOptions = resolvedTarget ? await context.getTargetOptions(requireBuilderTarget(context)) : options, angularBuilderOptions = mergeBrowserTargetOptions(
|
|
74
63
|
{
|
|
75
64
|
stylePreprocessorOptions: declaredOptions.stylePreprocessorOptions,
|
|
76
65
|
styles: declaredOptions.styles,
|
|
@@ -104,9 +93,12 @@ var commandBuilder = (options, context) => new Observable((observer) => {
|
|
|
104
93
|
statsJson: normalizeStatsJson(statsJson),
|
|
105
94
|
loglevel
|
|
106
95
|
};
|
|
107
|
-
process.env.STORYBOOK_ANGULAR_BUILDER_OPTIONS_JSON = JSON.stringify(
|
|
108
|
-
standaloneOptions.angularBuilderOptions
|
|
109
|
-
|
|
96
|
+
process.env.STORYBOOK_ANGULAR_BUILDER_OPTIONS_JSON = JSON.stringify({
|
|
97
|
+
...standaloneOptions.angularBuilderOptions,
|
|
98
|
+
// Style and load paths in the target options are workspace-root-relative; the addon-vitest
|
|
99
|
+
// child runs with a different Vite root, so it needs the workspace root to resolve them.
|
|
100
|
+
workspaceRoot: context.workspaceRoot
|
|
101
|
+
});
|
|
110
102
|
let startedPort = await runInstance(standaloneOptions);
|
|
111
103
|
observer.next({ success: !0, info: { port: startedPort } });
|
|
112
104
|
} catch (error) {
|
package/dist/client/config.js
CHANGED
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
argTypesEnhancers,
|
|
3
3
|
decorateStory,
|
|
4
4
|
parameters
|
|
5
|
-
} from "../_browser-chunks/chunk-
|
|
5
|
+
} from "../_browser-chunks/chunk-GVR3YWT3.js";
|
|
6
6
|
import {
|
|
7
7
|
render,
|
|
8
8
|
renderToCanvas
|
|
9
|
-
} from "../_browser-chunks/chunk-
|
|
9
|
+
} from "../_browser-chunks/chunk-UU6I6OE3.js";
|
|
10
10
|
export {
|
|
11
11
|
decorateStory as applyDecorators,
|
|
12
12
|
argTypesEnhancers,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
decorators,
|
|
3
3
|
parameters
|
|
4
|
-
} from "../../_browser-chunks/chunk-
|
|
5
|
-
import "../../_browser-chunks/chunk-
|
|
4
|
+
} from "../../_browser-chunks/chunk-2JE7SKTX.js";
|
|
5
|
+
import "../../_browser-chunks/chunk-UU6I6OE3.js";
|
|
6
6
|
export {
|
|
7
7
|
decorators,
|
|
8
8
|
parameters
|
package/dist/client/index.js
CHANGED
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
componentWrapperDecorator,
|
|
6
6
|
moduleMetadata,
|
|
7
7
|
setProjectAnnotations
|
|
8
|
-
} from "../_browser-chunks/chunk-
|
|
9
|
-
import "../_browser-chunks/chunk-
|
|
10
|
-
import "../_browser-chunks/chunk-
|
|
11
|
-
import "../_browser-chunks/chunk-
|
|
8
|
+
} from "../_browser-chunks/chunk-56QYE53C.js";
|
|
9
|
+
import "../_browser-chunks/chunk-GVR3YWT3.js";
|
|
10
|
+
import "../_browser-chunks/chunk-2JE7SKTX.js";
|
|
11
|
+
import "../_browser-chunks/chunk-UU6I6OE3.js";
|
|
12
12
|
export {
|
|
13
13
|
__definePreview,
|
|
14
14
|
applicationConfig,
|