@storybook/angular 11.0.0-alpha.1 → 11.0.0-alpha.2
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/build-schema.json +0 -4
- package/dist/_browser-chunks/{chunk-66FC4ILY.js → chunk-A7CCO6TU.js} +1 -1
- package/dist/_browser-chunks/{chunk-R47HETDX.js → chunk-M5CWHAJJ.js} +4 -4
- package/dist/_browser-chunks/{chunk-7K2L5OXX.js → chunk-OU5A7FPZ.js} +1 -1
- package/dist/_browser-chunks/{chunk-GXUNEQIB.js → chunk-ZATG2N4T.js} +37 -26
- package/dist/_node-chunks/{angular-cli-webpack-27LEUIOU.js → angular-cli-webpack-DJ37RLNT.js} +9 -7
- package/dist/_node-chunks/{chunk-P67BN557.js → chunk-QC32CNUK.js} +6 -6
- package/dist/_node-chunks/{chunk-5OJT6SUX.js → chunk-X2BF55MD.js} +7 -7
- package/dist/builders/build-storybook/index.js +17 -15
- package/dist/builders/start-storybook/index.js +21 -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/index.d.ts +20 -859
- package/dist/index.js +4 -4
- package/dist/node/index.js +6 -6
- package/dist/preset.js +6 -6
- package/dist/server/framework-preset-angular-cli.js +16 -9
- package/dist/server/framework-preset-angular-ivy.js +6 -6
- package/package.json +6 -6
- package/start-schema.json +0 -4
package/build-schema.json
CHANGED
|
@@ -86,10 +86,6 @@
|
|
|
86
86
|
"description": "Write stats JSON to disk",
|
|
87
87
|
"default": false
|
|
88
88
|
},
|
|
89
|
-
"previewUrl": {
|
|
90
|
-
"type": "string",
|
|
91
|
-
"description": "Disables the default storybook preview and lets you use your own"
|
|
92
|
-
},
|
|
93
89
|
"styles": {
|
|
94
90
|
"type": "array",
|
|
95
91
|
"description": "Global styles to be included in the build.",
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
config_exports
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-A7CCO6TU.js";
|
|
4
4
|
import {
|
|
5
5
|
config_exports as config_exports2
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-OU5A7FPZ.js";
|
|
7
7
|
import {
|
|
8
8
|
computesTemplateFromComponent,
|
|
9
9
|
formatPropInTemplate,
|
|
10
10
|
isComponent,
|
|
11
11
|
render_exports
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ZATG2N4T.js";
|
|
13
13
|
|
|
14
14
|
// src/client/portable-stories.ts
|
|
15
15
|
import {
|
|
@@ -62,7 +62,7 @@ function applicationConfig(config) {
|
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
var componentWrapperDecorator = (element, props) => (storyFn, storyContext) => {
|
|
65
|
-
let story = storyFn(), currentProps = typeof props == "function" ? props(storyContext) : props, template = isComponent(element) ? computesTemplateFromComponent(element, currentProps ?? {}, story.template) : element(story.template);
|
|
65
|
+
let story = storyFn(), currentProps = typeof props == "function" ? props(storyContext) : props, template = isComponent(element) ? computesTemplateFromComponent(element, currentProps ?? {}, story.template) : element(story.template ?? "");
|
|
66
66
|
return {
|
|
67
67
|
...story,
|
|
68
68
|
template,
|
|
@@ -42,7 +42,7 @@ var reflectionCapabilities = new ReflectionCapabilities(), getComponentInputsOut
|
|
|
42
42
|
componentMetadata && componentMetadata.inputs && initialValue.inputs.push(
|
|
43
43
|
...componentMetadata.inputs.map((i) => ({
|
|
44
44
|
propName: typeof i == "string" ? i : i.name,
|
|
45
|
-
templateName: typeof i == "string" ? i : i.alias
|
|
45
|
+
templateName: typeof i == "string" ? i : i.alias ?? i.name
|
|
46
46
|
}))
|
|
47
47
|
), componentMetadata && componentMetadata.outputs && initialValue.outputs.push(
|
|
48
48
|
...componentMetadata.outputs.map((i) => ({ propName: i, templateName: i }))
|
|
@@ -111,6 +111,8 @@ var isValidIdentifier = (name) => /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(name), forma
|
|
|
111
111
|
};
|
|
112
112
|
}, computesTemplateFromComponent = (component, initialProps, innerTemplate = "") => {
|
|
113
113
|
let ngComponentMetadata = getComponentDecoratorMetadata(component), ngComponentInputsOutputs = getComponentInputsOutputs(component);
|
|
114
|
+
if (!ngComponentMetadata)
|
|
115
|
+
throw new Error(`${component.name} is not an Angular component`);
|
|
114
116
|
if (!ngComponentMetadata.selector)
|
|
115
117
|
return '<ng-container *ngComponentOutlet="storyComponent"></ng-container>';
|
|
116
118
|
let { inputs: initialInputs, outputs: initialOutputs } = separateInputsOutputsAttributes(
|
|
@@ -164,7 +166,7 @@ var createAngularInputProperty = ({
|
|
|
164
166
|
), templateInputs = initialInputs.length > 0 ? ` ${initialInputs.map(
|
|
165
167
|
(propertyName) => createAngularInputProperty({
|
|
166
168
|
propertyName,
|
|
167
|
-
value: initialProps[propertyName],
|
|
169
|
+
value: initialProps?.[propertyName],
|
|
168
170
|
argType: argTypes?.[propertyName]
|
|
169
171
|
})
|
|
170
172
|
).join(" ")}` : "", templateOutputs = initialOutputs.length > 0 ? ` ${initialOutputs.map((i) => `(${i})="${formatPropInTemplate(i)}($event)"`).join(" ")}` : "";
|
|
@@ -284,6 +286,9 @@ var reflectionCapabilities3 = new ReflectionCapabilities3(), REMOVED_MODULES = n
|
|
|
284
286
|
this.metadata = metadata;
|
|
285
287
|
this.component = component;
|
|
286
288
|
this.declarations = [];
|
|
289
|
+
this.imports = [];
|
|
290
|
+
this.providers = [];
|
|
291
|
+
this.applicationProviders = [];
|
|
287
292
|
/**
|
|
288
293
|
* Analyze NgModule Metadata
|
|
289
294
|
*
|
|
@@ -412,7 +417,7 @@ var getNonInputsOutputsProps = (ngComponentInputsOutputs, props = {}) => {
|
|
|
412
417
|
storyComponent,
|
|
413
418
|
styles,
|
|
414
419
|
moduleMetadata,
|
|
415
|
-
initialProps,
|
|
420
|
+
initialProps = {},
|
|
416
421
|
analyzedMetadata
|
|
417
422
|
}) => {
|
|
418
423
|
let viewChildSelector = storyComponent ?? "__storybook-noop", { imports, declarations, providers } = analyzedMetadata, StorybookComponentModule = class {
|
|
@@ -437,15 +442,16 @@ var getNonInputsOutputsProps = (ngComponentInputsOutputs, props = {}) => {
|
|
|
437
442
|
});
|
|
438
443
|
}
|
|
439
444
|
ngAfterViewInit() {
|
|
440
|
-
|
|
445
|
+
let { storyComponentElementRef, storyComponentViewContainerRef } = this;
|
|
446
|
+
if (storyComponentElementRef && storyComponentViewContainerRef) {
|
|
441
447
|
let ngComponentInputsOutputs = getComponentInputsOutputs(storyComponent);
|
|
442
448
|
getNonInputsOutputsProps(ngComponentInputsOutputs, initialProps).forEach((p) => {
|
|
443
|
-
|
|
444
|
-
}),
|
|
449
|
+
Object.assign(storyComponentElementRef, { [p]: initialProps[p] });
|
|
450
|
+
}), storyComponentViewContainerRef.injector.get(ChangeDetectorRef).markForCheck(), this.changeDetectorRef.detectChanges(), this.storyComponentPropsSubscription = this.storyProps$.pipe(
|
|
445
451
|
skip(1),
|
|
446
|
-
map((props) => getNonInputsOutputsProps(ngComponentInputsOutputs, props).reduce((acc, p) => ({ ...acc, [p]: props[p] }), {}))
|
|
452
|
+
map((props = {}) => getNonInputsOutputsProps(ngComponentInputsOutputs, props).reduce((acc, p) => ({ ...acc, [p]: props[p] }), {}))
|
|
447
453
|
).subscribe((props) => {
|
|
448
|
-
Object.assign(
|
|
454
|
+
Object.assign(storyComponentElementRef, props), storyComponentViewContainerRef.injector.get(ChangeDetectorRef).markForCheck(), this.changeDetectorRef.detectChanges();
|
|
449
455
|
});
|
|
450
456
|
}
|
|
451
457
|
}
|
|
@@ -548,15 +554,15 @@ var applicationRefs = /* @__PURE__ */ new Map(), STORY_UID_ATTRIBUTE = "data-sb-
|
|
|
548
554
|
component,
|
|
549
555
|
targetDOMNode
|
|
550
556
|
}) {
|
|
551
|
-
let targetSelector = this.generateTargetSelectorFromStoryId(storyId), newStoryProps$ = new BehaviorSubject(storyFnAngular.props)
|
|
552
|
-
if (!this.fullRendererRequired({
|
|
557
|
+
let targetSelector = this.generateTargetSelectorFromStoryId(storyId), newStoryProps$ = new BehaviorSubject(storyFnAngular.props), fullRendererRequired = this.fullRendererRequired({
|
|
553
558
|
targetDOMNode,
|
|
554
559
|
storyFnAngular,
|
|
555
560
|
moduleMetadata: {
|
|
556
561
|
...storyFnAngular.moduleMetadata
|
|
557
562
|
},
|
|
558
563
|
forced
|
|
559
|
-
})
|
|
564
|
+
});
|
|
565
|
+
if (this.storyProps$ && !fullRendererRequired) {
|
|
560
566
|
this.storyProps$.next(storyFnAngular.props);
|
|
561
567
|
return;
|
|
562
568
|
}
|
|
@@ -566,7 +572,12 @@ var applicationRefs = /* @__PURE__ */ new Map(), STORY_UID_ATTRIBUTE = "data-sb-
|
|
|
566
572
|
let storyUid = this.generateStoryUIdFromRawStoryUid(
|
|
567
573
|
targetDOMNode.getAttribute(STORY_UID_ATTRIBUTE)
|
|
568
574
|
), componentSelector = storyUid !== null ? `${targetSelector}[${storyUid}]` : targetSelector;
|
|
569
|
-
storyUid !== null
|
|
575
|
+
if (storyUid !== null) {
|
|
576
|
+
let element = targetDOMNode.querySelector(targetSelector);
|
|
577
|
+
if (!element)
|
|
578
|
+
throw new Error(`Storybook could not find the story root element "${targetSelector}"`);
|
|
579
|
+
element.toggleAttribute(storyUid, !0);
|
|
580
|
+
}
|
|
570
581
|
let application = getApplication({
|
|
571
582
|
storyFnAngular,
|
|
572
583
|
component,
|
|
@@ -639,9 +650,7 @@ var applicationRefs = /* @__PURE__ */ new Map(), STORY_UID_ATTRIBUTE = "data-sb-
|
|
|
639
650
|
storyFnAngular,
|
|
640
651
|
moduleMetadataSnapshot: stringify(moduleMetadata, { maxDepth: 50 })
|
|
641
652
|
};
|
|
642
|
-
return this.previousStoryRenderInfo.set(targetDOMNode, currentStoryRender),
|
|
643
|
-
!forced || // if it's the first rendering and storyProps$ is not init
|
|
644
|
-
!this.storyProps$ || !!storyFnAngular?.template && previousStoryRenderInfo?.storyFnAngular?.template !== storyFnAngular.template ? !0 : currentStoryRender.moduleMetadataSnapshot !== previousStoryRenderInfo?.moduleMetadataSnapshot;
|
|
653
|
+
return this.previousStoryRenderInfo.set(targetDOMNode, currentStoryRender), !forced || !!storyFnAngular?.template && previousStoryRenderInfo?.storyFnAngular?.template !== storyFnAngular.template ? !0 : currentStoryRender.moduleMetadataSnapshot !== previousStoryRenderInfo?.moduleMetadataSnapshot;
|
|
645
654
|
}
|
|
646
655
|
};
|
|
647
656
|
|
|
@@ -661,8 +670,7 @@ import { addons } from "storybook/preview-api";
|
|
|
661
670
|
|
|
662
671
|
// src/client/angular-beta/utils/StoryUID.ts
|
|
663
672
|
var storyCounts = /* @__PURE__ */ new Map(), getNextStoryUID = (storyId) => {
|
|
664
|
-
storyCounts.
|
|
665
|
-
let count = storyCounts.get(storyId) + 1;
|
|
673
|
+
let count = (storyCounts.get(storyId) ?? -1) + 1;
|
|
666
674
|
return storyCounts.set(storyId, count), `${storyId}-${count}`;
|
|
667
675
|
};
|
|
668
676
|
|
|
@@ -690,11 +698,10 @@ var RendererFactory = class {
|
|
|
690
698
|
this.rendererMap = /* @__PURE__ */ new Map();
|
|
691
699
|
}
|
|
692
700
|
async getRendererInstance(targetDOMNode) {
|
|
693
|
-
let targetId = targetDOMNode.id;
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
return this.lastRenderType && this.lastRenderType !== renderType && (await AbstractRenderer.resetApplications(), clearRootHTMLElement(renderType), this.rendererMap.clear()), this.rendererMap.has(targetId) || this.rendererMap.set(targetId, this.buildRenderer(renderType)), this.lastRenderType = renderType, this.rendererMap.get(targetId);
|
|
701
|
+
let targetId = targetDOMNode.id, renderType = getRenderType(targetDOMNode);
|
|
702
|
+
this.lastRenderType && this.lastRenderType !== renderType && (await AbstractRenderer.resetApplications(), clearRootHTMLElement(renderType), this.rendererMap.clear());
|
|
703
|
+
let renderer = this.rendererMap.get(targetId);
|
|
704
|
+
return renderer || (renderer = this.buildRenderer(renderType), this.rendererMap.set(targetId, renderer)), this.lastRenderType = renderType, renderer;
|
|
698
705
|
}
|
|
699
706
|
buildRenderer(renderType) {
|
|
700
707
|
return renderType === "docs" ? new DocsRenderer() : new CanvasRenderer();
|
|
@@ -702,12 +709,16 @@ var RendererFactory = class {
|
|
|
702
709
|
}, getRenderType = (targetDOMNode) => targetDOMNode.id === "storybook-root" ? "canvas" : "docs";
|
|
703
710
|
function clearRootHTMLElement(renderType) {
|
|
704
711
|
switch (renderType) {
|
|
705
|
-
case "canvas":
|
|
706
|
-
global.document.getElementById("storybook-docs")
|
|
712
|
+
case "canvas": {
|
|
713
|
+
let docsRoot = global.document.getElementById("storybook-docs");
|
|
714
|
+
docsRoot && (docsRoot.innerHTML = "");
|
|
707
715
|
break;
|
|
708
|
-
|
|
709
|
-
|
|
716
|
+
}
|
|
717
|
+
case "docs": {
|
|
718
|
+
let canvasRoot = global.document.getElementById("storybook-root");
|
|
719
|
+
canvasRoot && (canvasRoot.innerHTML = "");
|
|
710
720
|
break;
|
|
721
|
+
}
|
|
711
722
|
default:
|
|
712
723
|
break;
|
|
713
724
|
}
|
package/dist/_node-chunks/{angular-cli-webpack-27LEUIOU.js → angular-cli-webpack-DJ37RLNT.js}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_bh3ft757e7 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_bh3ft757e7 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_bh3ft757e7 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_bh3ft757e7.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_bh3ft757e7.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_bh3ft757e7.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -50,7 +50,9 @@ var PLUGIN_NAME = "storybook-normalize-angular-entry-plugin", StorybookNormalize
|
|
|
50
50
|
var isStylingRule = (rule) => {
|
|
51
51
|
let { test } = rule;
|
|
52
52
|
return !test || !(test instanceof RegExp) ? !1 : test.test(".css") || test.test(".scss") || test.test(".sass");
|
|
53
|
-
}, filterOutStylingRules = (config) => config.module
|
|
53
|
+
}, filterOutStylingRules = (config) => (config.module?.rules ?? []).filter(
|
|
54
|
+
(rule) => !rule || rule === "..." || !isStylingRule(rule)
|
|
55
|
+
);
|
|
54
56
|
|
|
55
57
|
// src/server/angular-cli-webpack.js
|
|
56
58
|
var require2 = createRequire(import.meta.url), {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_bh3ft757e7 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_bh3ft757e7 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_bh3ft757e7 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_bh3ft757e7.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_bh3ft757e7.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_bh3ft757e7.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_bh3ft757e7 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_bh3ft757e7 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_bh3ft757e7 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_bh3ft757e7.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_bh3ft757e7.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_bh3ft757e7.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
|
up
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-QC32CNUK.js";
|
|
15
15
|
|
|
16
16
|
// ../../../node_modules/empathic/package.mjs
|
|
17
17
|
function up2(options) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_bh3ft757e7 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_bh3ft757e7 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_bh3ft757e7 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_bh3ft757e7.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_bh3ft757e7.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_bh3ft757e7.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -14,10 +14,10 @@ import {
|
|
|
14
14
|
printErrorDetails,
|
|
15
15
|
runCompodoc,
|
|
16
16
|
up as up2
|
|
17
|
-
} from "../../_node-chunks/chunk-
|
|
17
|
+
} from "../../_node-chunks/chunk-X2BF55MD.js";
|
|
18
18
|
import {
|
|
19
19
|
up
|
|
20
|
-
} from "../../_node-chunks/chunk-
|
|
20
|
+
} from "../../_node-chunks/chunk-QC32CNUK.js";
|
|
21
21
|
|
|
22
22
|
// src/builders/build-storybook/index.ts
|
|
23
23
|
import { readFileSync } from "node:fs";
|
|
@@ -58,7 +58,6 @@ var commandBuilder = async (options, context) => {
|
|
|
58
58
|
debugWebpack,
|
|
59
59
|
disableTelemetry,
|
|
60
60
|
assets,
|
|
61
|
-
previewUrl,
|
|
62
61
|
sourceMap = !1,
|
|
63
62
|
preserveSymlinks = !1,
|
|
64
63
|
// Angular 21+ always supports zoneless; users still opt out via `experimentalZoneless: false`
|
|
@@ -86,8 +85,7 @@ var commandBuilder = async (options, context) => {
|
|
|
86
85
|
tsConfig,
|
|
87
86
|
webpackStatsJson,
|
|
88
87
|
statsJson,
|
|
89
|
-
debugWebpack
|
|
90
|
-
previewUrl
|
|
88
|
+
debugWebpack
|
|
91
89
|
};
|
|
92
90
|
if (await runInstance({ ...standaloneOptions, mode: "static" }), logTracker.shouldWriteLogsToFile) {
|
|
93
91
|
let logFile = await logTracker.writeToFile(options.logfile);
|
|
@@ -97,12 +95,16 @@ var commandBuilder = async (options, context) => {
|
|
|
97
95
|
}, build_storybook_default = createBuilder(commandBuilder);
|
|
98
96
|
async function setup(options, context) {
|
|
99
97
|
let browserOptions, browserTarget;
|
|
100
|
-
|
|
98
|
+
options.browserTarget && (browserTarget = targetFromTargetString(options.browserTarget), browserOptions = await context.validateOptions(
|
|
101
99
|
await context.getTargetOptions(browserTarget),
|
|
102
100
|
await context.getBuilderNameForTarget(browserTarget)
|
|
103
|
-
))
|
|
104
|
-
|
|
105
|
-
|
|
101
|
+
));
|
|
102
|
+
let tsConfig = options.tsConfig ?? up("tsconfig.json", { cwd: options.configDir, last: getProjectRoot() }) ?? browserOptions?.tsConfig;
|
|
103
|
+
if (tsConfig === void 0)
|
|
104
|
+
throw new Error(
|
|
105
|
+
'Storybook could not find a tsconfig.json. Set the "tsConfig" or "browserTarget" option of the Storybook builder.'
|
|
106
|
+
);
|
|
107
|
+
return { tsConfig };
|
|
106
108
|
}
|
|
107
109
|
async function runInstance(options) {
|
|
108
110
|
try {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_bh3ft757e7 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_bh3ft757e7 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_bh3ft757e7 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_bh3ft757e7.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_bh3ft757e7.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_bh3ft757e7.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -14,10 +14,10 @@ import {
|
|
|
14
14
|
printErrorDetails,
|
|
15
15
|
runCompodoc,
|
|
16
16
|
up as up2
|
|
17
|
-
} from "../../_node-chunks/chunk-
|
|
17
|
+
} from "../../_node-chunks/chunk-X2BF55MD.js";
|
|
18
18
|
import {
|
|
19
19
|
up
|
|
20
|
-
} from "../../_node-chunks/chunk-
|
|
20
|
+
} from "../../_node-chunks/chunk-QC32CNUK.js";
|
|
21
21
|
|
|
22
22
|
// src/builders/start-storybook/index.ts
|
|
23
23
|
import { readFileSync } from "node:fs";
|
|
@@ -74,7 +74,6 @@ var commandBuilder = (options, context) => new Observable((observer) => {
|
|
|
74
74
|
loglevel,
|
|
75
75
|
webpackStatsJson,
|
|
76
76
|
statsJson,
|
|
77
|
-
previewUrl,
|
|
78
77
|
sourceMap = !1,
|
|
79
78
|
preserveSymlinks = !1,
|
|
80
79
|
// Angular 21+ always supports zoneless; users still opt out via `experimentalZoneless: false`
|
|
@@ -110,8 +109,7 @@ var commandBuilder = (options, context) => new Observable((observer) => {
|
|
|
110
109
|
debugWebpack,
|
|
111
110
|
webpackStatsJson,
|
|
112
111
|
statsJson,
|
|
113
|
-
loglevel
|
|
114
|
-
previewUrl
|
|
112
|
+
loglevel
|
|
115
113
|
}, startedPort = await runInstance(standaloneOptions);
|
|
116
114
|
observer.next({ success: !0, info: { port: startedPort } });
|
|
117
115
|
} catch (error) {
|
|
@@ -130,16 +128,20 @@ var commandBuilder = (options, context) => new Observable((observer) => {
|
|
|
130
128
|
}), start_storybook_default = createBuilder(commandBuilder);
|
|
131
129
|
async function setup(options, context) {
|
|
132
130
|
let browserOptions, browserTarget;
|
|
133
|
-
|
|
131
|
+
options.browserTarget && (browserTarget = targetFromTargetString(options.browserTarget), browserOptions = await context.validateOptions(
|
|
134
132
|
await context.getTargetOptions(browserTarget),
|
|
135
133
|
await context.getBuilderNameForTarget(browserTarget)
|
|
136
|
-
))
|
|
137
|
-
|
|
138
|
-
|
|
134
|
+
));
|
|
135
|
+
let tsConfig = options.tsConfig ?? up("tsconfig.json", { cwd: options.configDir }) ?? browserOptions?.tsConfig;
|
|
136
|
+
if (tsConfig === void 0)
|
|
137
|
+
throw new Error(
|
|
138
|
+
'Storybook could not find a tsconfig.json. Set the "tsConfig" or "browserTarget" option of the Storybook builder.'
|
|
139
|
+
);
|
|
140
|
+
return { tsConfig };
|
|
139
141
|
}
|
|
140
142
|
async function runInstance(options) {
|
|
141
143
|
try {
|
|
142
|
-
let
|
|
144
|
+
let result = await withTelemetry(
|
|
143
145
|
"dev",
|
|
144
146
|
{
|
|
145
147
|
cliOptions: options,
|
|
@@ -153,7 +155,9 @@ async function runInstance(options) {
|
|
|
153
155
|
},
|
|
154
156
|
() => buildDevStandalone(options)
|
|
155
157
|
);
|
|
156
|
-
|
|
158
|
+
if (!result)
|
|
159
|
+
throw new Error("Storybook dev server did not start");
|
|
160
|
+
return result.port;
|
|
157
161
|
} catch (error) {
|
|
158
162
|
let summarized = errorSummary(error);
|
|
159
163
|
throw new Error(String(summarized));
|
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-A7CCO6TU.js";
|
|
6
6
|
import {
|
|
7
7
|
render,
|
|
8
8
|
renderToCanvas
|
|
9
|
-
} from "../_browser-chunks/chunk-
|
|
9
|
+
} from "../_browser-chunks/chunk-ZATG2N4T.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-OU5A7FPZ.js";
|
|
5
|
+
import "../../_browser-chunks/chunk-ZATG2N4T.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-M5CWHAJJ.js";
|
|
9
|
+
import "../_browser-chunks/chunk-A7CCO6TU.js";
|
|
10
|
+
import "../_browser-chunks/chunk-OU5A7FPZ.js";
|
|
11
|
+
import "../_browser-chunks/chunk-ZATG2N4T.js";
|
|
12
12
|
export {
|
|
13
13
|
__definePreview,
|
|
14
14
|
applicationConfig,
|