@storybook/angular 9.1.0-alpha.5 → 9.1.0-alpha.7
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 +199 -0
- package/builders.json +14 -0
- package/dist/builders/build-storybook/index.js +31 -80
- package/dist/builders/start-storybook/index.js +31 -101
- package/dist/chunk-CUDJAP6K.mjs +3 -0
- package/dist/chunk-KMSSK3DZ.mjs +6 -0
- package/dist/chunk-LXSTVAFF.mjs +40 -0
- package/dist/client/config.d.ts +20 -6
- package/dist/client/config.js +49 -20
- package/dist/client/config.mjs +10 -13
- package/dist/client/docs/config.d.ts +6 -3
- package/dist/client/docs/config.js +18 -14
- package/dist/client/docs/config.mjs +6 -10
- package/dist/client/index.d.ts +144 -6
- package/dist/client/index.js +47 -30
- package/dist/client/index.mjs +3 -9
- package/dist/client/preview-prod.d.ts +2 -1
- package/dist/client/preview-prod.js +5 -4
- package/dist/client/preview-prod.mjs +1 -0
- package/dist/index.d.ts +59 -2
- package/dist/index.js +47 -29
- package/dist/index.mjs +3 -13
- package/dist/preset.js +8 -38
- package/dist/server/framework-preset-angular-cli.js +20 -83
- package/dist/server/framework-preset-angular-ivy.js +6 -59
- package/dist/{client/types.d.ts → types-3b0b7107.d.ts} +9 -9
- package/package.json +59 -12
- package/start-schema.json +234 -0
- package/dist/builders/build-storybook/index.d.ts +0 -25
- package/dist/builders/build-storybook/index.mjs +0 -78
- package/dist/builders/build-storybook/index.spec.d.ts +0 -1
- package/dist/builders/build-storybook/index.spec.js +0 -222
- package/dist/builders/build-storybook/index.spec.mjs +0 -187
- package/dist/builders/build-storybook/schema.json +0 -199
- package/dist/builders/builders.json +0 -14
- package/dist/builders/start-storybook/index.d.ts +0 -21
- package/dist/builders/start-storybook/index.mjs +0 -99
- package/dist/builders/start-storybook/index.spec.d.ts +0 -1
- package/dist/builders/start-storybook/index.spec.js +0 -188
- package/dist/builders/start-storybook/index.spec.mjs +0 -186
- package/dist/builders/start-storybook/schema.json +0 -234
- package/dist/builders/utils/error-handler.d.ts +0 -2
- package/dist/builders/utils/error-handler.js +0 -38
- package/dist/builders/utils/error-handler.mjs +0 -33
- package/dist/builders/utils/run-compodoc.d.ts +0 -6
- package/dist/builders/utils/run-compodoc.js +0 -35
- package/dist/builders/utils/run-compodoc.mjs +0 -31
- package/dist/builders/utils/run-compodoc.spec.d.ts +0 -1
- package/dist/builders/utils/run-compodoc.spec.js +0 -76
- package/dist/builders/utils/run-compodoc.spec.mjs +0 -74
- package/dist/builders/utils/standalone-options.d.ts +0 -18
- package/dist/builders/utils/standalone-options.js +0 -2
- package/dist/builders/utils/standalone-options.mjs +0 -1
- package/dist/client/angular-beta/AbstractRenderer.d.ts +0 -75
- package/dist/client/angular-beta/AbstractRenderer.js +0 -201
- package/dist/client/angular-beta/AbstractRenderer.mjs +0 -164
- package/dist/client/angular-beta/CanvasRenderer.d.ts +0 -12
- package/dist/client/angular-beta/CanvasRenderer.js +0 -13
- package/dist/client/angular-beta/CanvasRenderer.mjs +0 -9
- package/dist/client/angular-beta/ComputesTemplateFromComponent.d.ts +0 -24
- package/dist/client/angular-beta/ComputesTemplateFromComponent.js +0 -160
- package/dist/client/angular-beta/ComputesTemplateFromComponent.mjs +0 -154
- package/dist/client/angular-beta/ComputesTemplateFromComponent.test.d.ts +0 -1
- package/dist/client/angular-beta/ComputesTemplateFromComponent.test.js +0 -730
- package/dist/client/angular-beta/ComputesTemplateFromComponent.test.mjs +0 -728
- package/dist/client/angular-beta/DocsRenderer.d.ts +0 -13
- package/dist/client/angular-beta/DocsRenderer.js +0 -39
- package/dist/client/angular-beta/DocsRenderer.mjs +0 -35
- package/dist/client/angular-beta/RendererFactory.d.ts +0 -11
- package/dist/client/angular-beta/RendererFactory.js +0 -56
- package/dist/client/angular-beta/RendererFactory.mjs +0 -50
- package/dist/client/angular-beta/RendererFactory.test.d.ts +0 -1
- package/dist/client/angular-beta/RendererFactory.test.js +0 -235
- package/dist/client/angular-beta/RendererFactory.test.mjs +0 -233
- package/dist/client/angular-beta/StorybookModule.d.ts +0 -8
- package/dist/client/angular-beta/StorybookModule.js +0 -27
- package/dist/client/angular-beta/StorybookModule.mjs +0 -23
- package/dist/client/angular-beta/StorybookModule.test.d.ts +0 -1
- package/dist/client/angular-beta/StorybookModule.test.js +0 -321
- package/dist/client/angular-beta/StorybookModule.test.mjs +0 -319
- package/dist/client/angular-beta/StorybookProvider.d.ts +0 -5
- package/dist/client/angular-beta/StorybookProvider.js +0 -26
- package/dist/client/angular-beta/StorybookProvider.mjs +0 -22
- package/dist/client/angular-beta/StorybookWrapperComponent.d.ts +0 -13
- package/dist/client/angular-beta/StorybookWrapperComponent.js +0 -127
- package/dist/client/angular-beta/StorybookWrapperComponent.mjs +0 -123
- package/dist/client/angular-beta/__testfixtures__/input.component.d.ts +0 -29
- package/dist/client/angular-beta/__testfixtures__/input.component.js +0 -76
- package/dist/client/angular-beta/__testfixtures__/input.component.mjs +0 -73
- package/dist/client/angular-beta/__testfixtures__/test.module.d.ts +0 -2
- package/dist/client/angular-beta/__testfixtures__/test.module.js +0 -20
- package/dist/client/angular-beta/__testfixtures__/test.module.mjs +0 -17
- package/dist/client/angular-beta/utils/BootstrapQueue.d.ts +0 -12
- package/dist/client/angular-beta/utils/BootstrapQueue.js +0 -86
- package/dist/client/angular-beta/utils/BootstrapQueue.mjs +0 -49
- package/dist/client/angular-beta/utils/BootstrapQueue.test.d.ts +0 -1
- package/dist/client/angular-beta/utils/BootstrapQueue.test.js +0 -164
- package/dist/client/angular-beta/utils/BootstrapQueue.test.mjs +0 -162
- package/dist/client/angular-beta/utils/NgComponentAnalyzer.d.ts +0 -22
- package/dist/client/angular-beta/utils/NgComponentAnalyzer.js +0 -93
- package/dist/client/angular-beta/utils/NgComponentAnalyzer.mjs +0 -84
- package/dist/client/angular-beta/utils/NgComponentAnalyzer.test.d.ts +0 -1
- package/dist/client/angular-beta/utils/NgComponentAnalyzer.test.js +0 -388
- package/dist/client/angular-beta/utils/NgComponentAnalyzer.test.mjs +0 -386
- package/dist/client/angular-beta/utils/NgModulesAnalyzer.d.ts +0 -6
- package/dist/client/angular-beta/utils/NgModulesAnalyzer.js +0 -41
- package/dist/client/angular-beta/utils/NgModulesAnalyzer.mjs +0 -37
- package/dist/client/angular-beta/utils/NgModulesAnalyzer.test.d.ts +0 -1
- package/dist/client/angular-beta/utils/NgModulesAnalyzer.test.js +0 -24
- package/dist/client/angular-beta/utils/NgModulesAnalyzer.test.mjs +0 -22
- package/dist/client/angular-beta/utils/PropertyExtractor.d.ts +0 -30
- package/dist/client/angular-beta/utils/PropertyExtractor.js +0 -196
- package/dist/client/angular-beta/utils/PropertyExtractor.mjs +0 -158
- package/dist/client/angular-beta/utils/PropertyExtractor.test.d.ts +0 -1
- package/dist/client/angular-beta/utils/PropertyExtractor.test.js +0 -177
- package/dist/client/angular-beta/utils/PropertyExtractor.test.mjs +0 -175
- package/dist/client/angular-beta/utils/StoryUID.d.ts +0 -22
- package/dist/client/angular-beta/utils/StoryUID.js +0 -43
- package/dist/client/angular-beta/utils/StoryUID.mjs +0 -38
- package/dist/client/argsToTemplate.d.ts +0 -56
- package/dist/client/argsToTemplate.js +0 -58
- package/dist/client/argsToTemplate.mjs +0 -55
- package/dist/client/argsToTemplate.test.d.ts +0 -1
- package/dist/client/argsToTemplate.test.js +0 -102
- package/dist/client/argsToTemplate.test.mjs +0 -100
- package/dist/client/compodoc-types.d.ts +0 -102
- package/dist/client/compodoc-types.js +0 -2
- package/dist/client/compodoc-types.mjs +0 -1
- package/dist/client/compodoc.d.ts +0 -12
- package/dist/client/compodoc.js +0 -261
- package/dist/client/compodoc.mjs +0 -248
- package/dist/client/compodoc.test.d.ts +0 -1
- package/dist/client/compodoc.test.js +0 -132
- package/dist/client/compodoc.test.mjs +0 -130
- package/dist/client/decorateStory.d.ts +0 -4
- package/dist/client/decorateStory.js +0 -48
- package/dist/client/decorateStory.mjs +0 -45
- package/dist/client/decorateStory.test.d.ts +0 -1
- package/dist/client/decorateStory.test.js +0 -306
- package/dist/client/decorateStory.test.mjs +0 -301
- package/dist/client/decorators.d.ts +0 -13
- package/dist/client/decorators.js +0 -69
- package/dist/client/decorators.mjs +0 -63
- package/dist/client/decorators.test.d.ts +0 -1
- package/dist/client/decorators.test.js +0 -159
- package/dist/client/decorators.test.mjs +0 -157
- package/dist/client/docs/__testfixtures__/doc-button/input.d.ts +0 -110
- package/dist/client/docs/__testfixtures__/doc-button/input.js +0 -204
- package/dist/client/docs/__testfixtures__/doc-button/input.mjs +0 -201
- package/dist/client/docs/__testfixtures__/doc-button/tsconfig.json +0 -7
- package/dist/client/docs/angular-properties.test.d.ts +0 -1
- package/dist/client/docs/angular-properties.test.js +0 -36
- package/dist/client/docs/angular-properties.test.mjs +0 -34
- package/dist/client/docs/sourceDecorator.d.ts +0 -10
- package/dist/client/docs/sourceDecorator.js +0 -53
- package/dist/client/docs/sourceDecorator.mjs +0 -48
- package/dist/client/globals.d.ts +0 -1
- package/dist/client/globals.js +0 -33
- package/dist/client/globals.mjs +0 -31
- package/dist/client/portable-stories.d.ts +0 -23
- package/dist/client/portable-stories.js +0 -62
- package/dist/client/portable-stories.mjs +0 -26
- package/dist/client/public-types.d.ts +0 -54
- package/dist/client/public-types.js +0 -2
- package/dist/client/public-types.mjs +0 -1
- package/dist/client/render.d.ts +0 -7
- package/dist/client/render.js +0 -19
- package/dist/client/render.mjs +0 -14
- package/dist/client/types.js +0 -2
- package/dist/client/types.mjs +0 -1
- package/dist/node/index.d.ts +0 -2
- package/dist/node/index.js +0 -6
- package/dist/node/index.mjs +0 -3
- package/dist/preset.d.ts +0 -5
- package/dist/preset.mjs +0 -34
- package/dist/renderer.d.ts +0 -6
- package/dist/renderer.js +0 -15
- package/dist/renderer.mjs +0 -6
- package/dist/server/__mocks-ng-workspace__/empty-projects-entry/angular.json +0 -4
- package/dist/server/__mocks-ng-workspace__/minimal-config/angular.json +0 -18
- package/dist/server/__mocks-ng-workspace__/minimal-config/src/main.d.ts +0 -1
- package/dist/server/__mocks-ng-workspace__/minimal-config/src/main.js +0 -5
- package/dist/server/__mocks-ng-workspace__/minimal-config/src/main.mjs +0 -2
- package/dist/server/__mocks-ng-workspace__/minimal-config/src/tsconfig.app.json +0 -9
- package/dist/server/__mocks-ng-workspace__/minimal-config/tsconfig.json +0 -13
- package/dist/server/__mocks-ng-workspace__/some-config/angular.json +0 -19
- package/dist/server/__mocks-ng-workspace__/some-config/src/main.d.ts +0 -1
- package/dist/server/__mocks-ng-workspace__/some-config/src/main.js +0 -5
- package/dist/server/__mocks-ng-workspace__/some-config/src/main.mjs +0 -2
- package/dist/server/__mocks-ng-workspace__/some-config/src/tsconfig.app.json +0 -9
- package/dist/server/__mocks-ng-workspace__/some-config/tsconfig.json +0 -13
- package/dist/server/__mocks-ng-workspace__/with-angularBrowserTarget/angular.json +0 -64
- package/dist/server/__mocks-ng-workspace__/with-angularBrowserTarget/src/main.d.ts +0 -1
- package/dist/server/__mocks-ng-workspace__/with-angularBrowserTarget/src/main.js +0 -5
- package/dist/server/__mocks-ng-workspace__/with-angularBrowserTarget/src/main.mjs +0 -2
- package/dist/server/__mocks-ng-workspace__/with-angularBrowserTarget/src/tsconfig.app.json +0 -9
- package/dist/server/__mocks-ng-workspace__/with-angularBrowserTarget/tsconfig.json +0 -13
- package/dist/server/__mocks-ng-workspace__/with-lib/angular.json +0 -28
- package/dist/server/__mocks-ng-workspace__/with-lib/projects/pattern-lib/src/main.d.ts +0 -1
- package/dist/server/__mocks-ng-workspace__/with-lib/projects/pattern-lib/src/main.js +0 -5
- package/dist/server/__mocks-ng-workspace__/with-lib/projects/pattern-lib/src/main.mjs +0 -2
- package/dist/server/__mocks-ng-workspace__/with-lib/projects/pattern-lib/tsconfig.lib.json +0 -20
- package/dist/server/__mocks-ng-workspace__/with-lib/tsconfig.json +0 -13
- package/dist/server/__mocks-ng-workspace__/with-nx/angular.json +0 -18
- package/dist/server/__mocks-ng-workspace__/with-nx/nx.json +0 -3
- package/dist/server/__mocks-ng-workspace__/with-nx/src/main.d.ts +0 -1
- package/dist/server/__mocks-ng-workspace__/with-nx/src/main.js +0 -5
- package/dist/server/__mocks-ng-workspace__/with-nx/src/main.mjs +0 -2
- package/dist/server/__mocks-ng-workspace__/with-nx/src/tsconfig.app.json +0 -8
- package/dist/server/__mocks-ng-workspace__/with-nx/tsconfig.json +0 -14
- package/dist/server/__mocks-ng-workspace__/with-nx-workspace/nx.json +0 -3
- package/dist/server/__mocks-ng-workspace__/with-nx-workspace/src/main.d.ts +0 -1
- package/dist/server/__mocks-ng-workspace__/with-nx-workspace/src/main.js +0 -5
- package/dist/server/__mocks-ng-workspace__/with-nx-workspace/src/main.mjs +0 -2
- package/dist/server/__mocks-ng-workspace__/with-nx-workspace/src/tsconfig.app.json +0 -8
- package/dist/server/__mocks-ng-workspace__/with-nx-workspace/tsconfig.json +0 -14
- package/dist/server/__mocks-ng-workspace__/with-nx-workspace/workspace.json +0 -18
- package/dist/server/__mocks-ng-workspace__/with-options-styles/angular.json +0 -18
- package/dist/server/__mocks-ng-workspace__/with-options-styles/src/main.d.ts +0 -1
- package/dist/server/__mocks-ng-workspace__/with-options-styles/src/main.js +0 -5
- package/dist/server/__mocks-ng-workspace__/with-options-styles/src/main.mjs +0 -2
- package/dist/server/__mocks-ng-workspace__/with-options-styles/src/tsconfig.app.json +0 -9
- package/dist/server/__mocks-ng-workspace__/with-options-styles/tsconfig.json +0 -13
- package/dist/server/__mocks-ng-workspace__/without-architect-build/angular.json +0 -5
- package/dist/server/__mocks-ng-workspace__/without-architect-build-options/angular.json +0 -11
- package/dist/server/__mocks-ng-workspace__/without-compatible-projects/angular.json +0 -7
- package/dist/server/__mocks-ng-workspace__/without-projects-entry/angular.json +0 -3
- package/dist/server/__mocks-ng-workspace__/without-projects-entry/projects/pattern-lib/src/main.d.ts +0 -1
- package/dist/server/__mocks-ng-workspace__/without-projects-entry/projects/pattern-lib/src/main.js +0 -5
- package/dist/server/__mocks-ng-workspace__/without-projects-entry/projects/pattern-lib/src/main.mjs +0 -2
- package/dist/server/__mocks-ng-workspace__/without-projects-entry/projects/pattern-lib/tsconfig.lib.json +0 -20
- package/dist/server/__mocks-ng-workspace__/without-projects-entry/tsconfig.json +0 -13
- package/dist/server/__mocks-ng-workspace__/without-tsConfig/angular.json +0 -16
- package/dist/server/__mocks-ng-workspace__/without-tsConfig/src/main.d.ts +0 -1
- package/dist/server/__mocks-ng-workspace__/without-tsConfig/src/main.js +0 -5
- package/dist/server/__mocks-ng-workspace__/without-tsConfig/src/main.mjs +0 -2
- package/dist/server/__mocks-ng-workspace__/without-tsConfig/src/tsconfig.app.json +0 -9
- package/dist/server/__mocks-ng-workspace__/without-tsConfig/tsconfig.json +0 -13
- package/dist/server/__tests__/angular.json +0 -96
- package/dist/server/angular-cli-webpack.d.ts +0 -1
- package/dist/server/angular-cli-webpack.js +0 -80
- package/dist/server/angular-cli-webpack.mjs +0 -80
- package/dist/server/framework-preset-angular-cli.d.ts +0 -3
- package/dist/server/framework-preset-angular-cli.mjs +0 -81
- package/dist/server/framework-preset-angular-ivy.d.ts +0 -10
- package/dist/server/framework-preset-angular-ivy.mjs +0 -56
- package/dist/server/plugins/storybook-normalize-angular-entry-plugin.d.ts +0 -12
- package/dist/server/plugins/storybook-normalize-angular-entry-plugin.js +0 -55
- package/dist/server/plugins/storybook-normalize-angular-entry-plugin.mjs +0 -52
- package/dist/server/preset-options.d.ts +0 -9
- package/dist/server/preset-options.js +0 -2
- package/dist/server/preset-options.mjs +0 -1
- package/dist/server/utils/filter-out-styling-rules.d.ts +0 -2
- package/dist/server/utils/filter-out-styling-rules.js +0 -17
- package/dist/server/utils/filter-out-styling-rules.mjs +0 -13
- package/dist/server/utils/module-is-available.d.ts +0 -1
- package/dist/server/utils/module-is-available.js +0 -13
- package/dist/server/utils/module-is-available.mjs +0 -9
- package/dist/test-setup.d.ts +0 -1
- package/dist/test-setup.js +0 -6
- package/dist/test-setup.mjs +0 -4
- package/dist/types.d.ts +0 -27
- package/dist/types.js +0 -2
- package/dist/types.mjs +0 -1
- package/scripts/postbuild.js +0 -17
- package/template/cli/.eslintrc.json +0 -5
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"title": "Start Storybook",
|
|
4
|
+
"description": "Serve up storybook in development mode.",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"browserTarget": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "Build target to be served in project-name:builder:config format. Should generally target on the builder: '@angular-devkit/build-angular:browser'. Useful for Storybook to use options (styles, assets, ...).",
|
|
10
|
+
"pattern": "^[^:\\s]+:[^:\\s]+(:[^\\s]+)?$"
|
|
11
|
+
},
|
|
12
|
+
"debugWebpack": {
|
|
13
|
+
"type": "boolean",
|
|
14
|
+
"description": "Debug the Webpack configuration",
|
|
15
|
+
"default": false
|
|
16
|
+
},
|
|
17
|
+
"tsConfig": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": "The full path for the TypeScript configuration file, relative to the current workspace."
|
|
20
|
+
},
|
|
21
|
+
"preserveSymlinks": {
|
|
22
|
+
"type": "boolean",
|
|
23
|
+
"description": "Do not use the real path when resolving modules. If true, symlinks are resolved to their real path, if false, symlinks are resolved to their symlinked path.",
|
|
24
|
+
"default": false
|
|
25
|
+
},
|
|
26
|
+
"port": {
|
|
27
|
+
"type": "number",
|
|
28
|
+
"description": "Port to listen on.",
|
|
29
|
+
"default": 9009
|
|
30
|
+
},
|
|
31
|
+
"host": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"description": "Host to listen on.",
|
|
34
|
+
"default": "localhost"
|
|
35
|
+
},
|
|
36
|
+
"configDir": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"description": "Directory where to load Storybook configurations from.",
|
|
39
|
+
"default": ".storybook"
|
|
40
|
+
},
|
|
41
|
+
"https": {
|
|
42
|
+
"type": "boolean",
|
|
43
|
+
"description": "Serve Storybook over HTTPS. Note: You must provide your own certificate information.",
|
|
44
|
+
"default": false
|
|
45
|
+
},
|
|
46
|
+
"sslCa": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"description": "Provide an SSL certificate authority. (Optional with --https, required if using a self-signed certificate)."
|
|
49
|
+
},
|
|
50
|
+
"sslCert": {
|
|
51
|
+
"type": "string",
|
|
52
|
+
"description": "Provide an SSL certificate. (Required with --https)."
|
|
53
|
+
},
|
|
54
|
+
"sslKey": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"description": "SSL key to use for serving HTTPS."
|
|
57
|
+
},
|
|
58
|
+
"smokeTest": {
|
|
59
|
+
"type": "boolean",
|
|
60
|
+
"description": "Exit after successful start.",
|
|
61
|
+
"default": false
|
|
62
|
+
},
|
|
63
|
+
"ci": {
|
|
64
|
+
"type": "boolean",
|
|
65
|
+
"description": "CI mode (skip interactive prompts, don't open browser).",
|
|
66
|
+
"default": false
|
|
67
|
+
},
|
|
68
|
+
"open": {
|
|
69
|
+
"type": "boolean",
|
|
70
|
+
"description": "Whether to open Storybook automatically in the browser.",
|
|
71
|
+
"default": true
|
|
72
|
+
},
|
|
73
|
+
"quiet": {
|
|
74
|
+
"type": "boolean",
|
|
75
|
+
"description": "Suppress verbose build output.",
|
|
76
|
+
"default": false
|
|
77
|
+
},
|
|
78
|
+
"enableProdMode": {
|
|
79
|
+
"type": "boolean",
|
|
80
|
+
"description": "Disable Angular's development mode, which turns off assertions and other checks within the framework.",
|
|
81
|
+
"default": false
|
|
82
|
+
},
|
|
83
|
+
"docs": {
|
|
84
|
+
"type": "boolean",
|
|
85
|
+
"description": "Starts Storybook in documentation mode. Learn more about it : https://storybook.js.org/docs/writing-docs/build-documentation#preview-storybooks-documentation.",
|
|
86
|
+
"default": false
|
|
87
|
+
},
|
|
88
|
+
"compodoc": {
|
|
89
|
+
"type": "boolean",
|
|
90
|
+
"description": "Execute compodoc before.",
|
|
91
|
+
"default": true
|
|
92
|
+
},
|
|
93
|
+
"compodocArgs": {
|
|
94
|
+
"type": "array",
|
|
95
|
+
"description": "Compodoc options : https://compodoc.app/guides/options.html. Options `-p` with tsconfig path and `-d` with workspace root is always given.",
|
|
96
|
+
"default": ["-e", "json"],
|
|
97
|
+
"items": {
|
|
98
|
+
"type": "string"
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"styles": {
|
|
102
|
+
"type": "array",
|
|
103
|
+
"description": "Global styles to be included in the build.",
|
|
104
|
+
"items": {
|
|
105
|
+
"$ref": "#/definitions/styleElement"
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"stylePreprocessorOptions": {
|
|
109
|
+
"description": "Options to pass to style preprocessors.",
|
|
110
|
+
"type": "object",
|
|
111
|
+
"properties": {
|
|
112
|
+
"includePaths": {
|
|
113
|
+
"description": "Paths to include. Paths will be resolved to workspace root.",
|
|
114
|
+
"type": "array",
|
|
115
|
+
"items": {
|
|
116
|
+
"type": "string"
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"additionalProperties": false
|
|
121
|
+
},
|
|
122
|
+
"assets": {
|
|
123
|
+
"type": "array",
|
|
124
|
+
"description": "List of static application assets.",
|
|
125
|
+
"default": [],
|
|
126
|
+
"items": {
|
|
127
|
+
"$ref": "#/definitions/assetPattern"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"initialPath": {
|
|
131
|
+
"type": "string",
|
|
132
|
+
"description": "URL path to be appended when visiting Storybook for the first time"
|
|
133
|
+
},
|
|
134
|
+
"webpackStatsJson": {
|
|
135
|
+
"type": ["boolean", "string"],
|
|
136
|
+
"description": "Write Webpack Stats JSON to disk",
|
|
137
|
+
"default": false
|
|
138
|
+
},
|
|
139
|
+
"statsJson": {
|
|
140
|
+
"type": ["boolean", "string"],
|
|
141
|
+
"description": "Write stats JSON to disk",
|
|
142
|
+
"default": false
|
|
143
|
+
},
|
|
144
|
+
"previewUrl": {
|
|
145
|
+
"type": "string",
|
|
146
|
+
"description": "Disables the default storybook preview and lets you use your own"
|
|
147
|
+
},
|
|
148
|
+
"loglevel": {
|
|
149
|
+
"type": "string",
|
|
150
|
+
"description": "Controls level of logging during build. Can be one of: [silly, verbose, info (default), warn, error, silent].",
|
|
151
|
+
"pattern": "(silly|verbose|info|warn|silent)"
|
|
152
|
+
},
|
|
153
|
+
"sourceMap": {
|
|
154
|
+
"type": ["boolean", "object"],
|
|
155
|
+
"description": "Configure sourcemaps. See: https://angular.io/guide/workspace-config#source-map-configuration",
|
|
156
|
+
"default": false
|
|
157
|
+
},
|
|
158
|
+
"experimentalZoneless": {
|
|
159
|
+
"type": "boolean",
|
|
160
|
+
"description": "Experimental: Use zoneless change detection.",
|
|
161
|
+
"default": false
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
"additionalProperties": false,
|
|
165
|
+
"definitions": {
|
|
166
|
+
"assetPattern": {
|
|
167
|
+
"oneOf": [
|
|
168
|
+
{
|
|
169
|
+
"type": "object",
|
|
170
|
+
"properties": {
|
|
171
|
+
"followSymlinks": {
|
|
172
|
+
"type": "boolean",
|
|
173
|
+
"default": false,
|
|
174
|
+
"description": "Allow glob patterns to follow symlink directories. This allows subdirectories of the symlink to be searched."
|
|
175
|
+
},
|
|
176
|
+
"glob": {
|
|
177
|
+
"type": "string",
|
|
178
|
+
"description": "The pattern to match."
|
|
179
|
+
},
|
|
180
|
+
"input": {
|
|
181
|
+
"type": "string",
|
|
182
|
+
"description": "The input directory path in which to apply 'glob'. Defaults to the project root."
|
|
183
|
+
},
|
|
184
|
+
"ignore": {
|
|
185
|
+
"description": "An array of globs to ignore.",
|
|
186
|
+
"type": "array",
|
|
187
|
+
"items": {
|
|
188
|
+
"type": "string"
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
"output": {
|
|
192
|
+
"type": "string",
|
|
193
|
+
"description": "Absolute path within the output."
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
"additionalProperties": false,
|
|
197
|
+
"required": ["glob", "input", "output"]
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"type": "string"
|
|
201
|
+
}
|
|
202
|
+
]
|
|
203
|
+
},
|
|
204
|
+
"styleElement": {
|
|
205
|
+
"oneOf": [
|
|
206
|
+
{
|
|
207
|
+
"type": "object",
|
|
208
|
+
"properties": {
|
|
209
|
+
"input": {
|
|
210
|
+
"type": "string",
|
|
211
|
+
"description": "The file to include."
|
|
212
|
+
},
|
|
213
|
+
"bundleName": {
|
|
214
|
+
"type": "string",
|
|
215
|
+
"pattern": "^[\\w\\-.]*$",
|
|
216
|
+
"description": "The bundle name for this extra entry point."
|
|
217
|
+
},
|
|
218
|
+
"inject": {
|
|
219
|
+
"type": "boolean",
|
|
220
|
+
"description": "If the bundle will be referenced in the HTML file.",
|
|
221
|
+
"default": true
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
"additionalProperties": false,
|
|
225
|
+
"required": ["input"]
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"type": "string",
|
|
229
|
+
"description": "The file to include."
|
|
230
|
+
}
|
|
231
|
+
]
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { CLIOptions } from 'storybook/internal/types';
|
|
2
|
-
import { BuilderOutput, Builder as DevkitBuilder } from '@angular-devkit/architect';
|
|
3
|
-
import { StylePreprocessorOptions } from '@angular-devkit/build-angular';
|
|
4
|
-
import { AssetPattern, SourceMapUnion, StyleElement } from '@angular-devkit/build-angular/src/builders/browser/schema';
|
|
5
|
-
import { JsonObject } from '@angular-devkit/core';
|
|
6
|
-
export type StorybookBuilderOptions = JsonObject & {
|
|
7
|
-
browserTarget?: string | null;
|
|
8
|
-
tsConfig?: string;
|
|
9
|
-
test: boolean;
|
|
10
|
-
docs: boolean;
|
|
11
|
-
compodoc: boolean;
|
|
12
|
-
compodocArgs: string[];
|
|
13
|
-
enableProdMode?: boolean;
|
|
14
|
-
styles?: StyleElement[];
|
|
15
|
-
stylePreprocessorOptions?: StylePreprocessorOptions;
|
|
16
|
-
preserveSymlinks?: boolean;
|
|
17
|
-
assets?: AssetPattern[];
|
|
18
|
-
sourceMap?: SourceMapUnion;
|
|
19
|
-
experimentalZoneless?: boolean;
|
|
20
|
-
} & Pick<CLIOptions, 'outputDir' | 'configDir' | 'loglevel' | 'quiet' | 'test' | 'webpackStatsJson' | 'statsJson' | 'disableTelemetry' | 'debugWebpack' | 'previewUrl'>;
|
|
21
|
-
export type StorybookBuilderOutput = JsonObject & BuilderOutput & {
|
|
22
|
-
[key: string]: any;
|
|
23
|
-
};
|
|
24
|
-
declare const _default: DevkitBuilder<StorybookBuilderOptions & JsonObject>;
|
|
25
|
-
export default _default;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { getEnvConfig, versions } from 'storybook/internal/common';
|
|
2
|
-
import { buildStaticStandalone, withTelemetry } from 'storybook/internal/core-server';
|
|
3
|
-
import { addToGlobalContext } from 'storybook/internal/telemetry';
|
|
4
|
-
import { createBuilder, targetFromTargetString, } from '@angular-devkit/architect';
|
|
5
|
-
import { findPackageSync } from 'fd-package-json';
|
|
6
|
-
import { sync as findUpSync } from 'find-up';
|
|
7
|
-
import { from, of, throwError } from 'rxjs';
|
|
8
|
-
import { catchError, map, mapTo, switchMap } from 'rxjs/operators';
|
|
9
|
-
import { errorSummary, printErrorDetails } from '../utils/error-handler';
|
|
10
|
-
import { runCompodoc } from '../utils/run-compodoc';
|
|
11
|
-
addToGlobalContext('cliVersion', versions.storybook);
|
|
12
|
-
const commandBuilder = (options, context) => {
|
|
13
|
-
const builder = from(setup(options, context)).pipe(switchMap(({ tsConfig }) => {
|
|
14
|
-
const docTSConfig = findUpSync('tsconfig.doc.json', { cwd: options.configDir });
|
|
15
|
-
const runCompodoc$ = options.compodoc
|
|
16
|
-
? runCompodoc({ compodocArgs: options.compodocArgs, tsconfig: docTSConfig ?? tsConfig }, context).pipe(mapTo({ tsConfig }))
|
|
17
|
-
: of({});
|
|
18
|
-
return runCompodoc$.pipe(mapTo({ tsConfig }));
|
|
19
|
-
}), map(({ tsConfig }) => {
|
|
20
|
-
getEnvConfig(options, {
|
|
21
|
-
staticDir: 'SBCONFIG_STATIC_DIR',
|
|
22
|
-
outputDir: 'SBCONFIG_OUTPUT_DIR',
|
|
23
|
-
configDir: 'SBCONFIG_CONFIG_DIR',
|
|
24
|
-
});
|
|
25
|
-
const { browserTarget, stylePreprocessorOptions, styles, configDir, docs, loglevel, test, outputDir, quiet, enableProdMode = true, webpackStatsJson, statsJson, debugWebpack, disableTelemetry, assets, previewUrl, sourceMap = false, preserveSymlinks = false, experimentalZoneless = false, } = options;
|
|
26
|
-
const standaloneOptions = {
|
|
27
|
-
packageJson: findPackageSync(__dirname),
|
|
28
|
-
configDir,
|
|
29
|
-
...(docs ? { docs } : {}),
|
|
30
|
-
loglevel,
|
|
31
|
-
outputDir,
|
|
32
|
-
test,
|
|
33
|
-
quiet,
|
|
34
|
-
enableProdMode,
|
|
35
|
-
disableTelemetry,
|
|
36
|
-
angularBrowserTarget: browserTarget,
|
|
37
|
-
angularBuilderContext: context,
|
|
38
|
-
angularBuilderOptions: {
|
|
39
|
-
...(stylePreprocessorOptions ? { stylePreprocessorOptions } : {}),
|
|
40
|
-
...(styles ? { styles } : {}),
|
|
41
|
-
...(assets ? { assets } : {}),
|
|
42
|
-
sourceMap,
|
|
43
|
-
preserveSymlinks,
|
|
44
|
-
experimentalZoneless,
|
|
45
|
-
},
|
|
46
|
-
tsConfig,
|
|
47
|
-
webpackStatsJson,
|
|
48
|
-
statsJson,
|
|
49
|
-
debugWebpack,
|
|
50
|
-
previewUrl,
|
|
51
|
-
};
|
|
52
|
-
return standaloneOptions;
|
|
53
|
-
}), switchMap((standaloneOptions) => runInstance({ ...standaloneOptions, mode: 'static' })), map(() => {
|
|
54
|
-
return { success: true };
|
|
55
|
-
}));
|
|
56
|
-
return builder;
|
|
57
|
-
};
|
|
58
|
-
export default createBuilder(commandBuilder);
|
|
59
|
-
async function setup(options, context) {
|
|
60
|
-
let browserOptions;
|
|
61
|
-
let browserTarget;
|
|
62
|
-
if (options.browserTarget) {
|
|
63
|
-
browserTarget = targetFromTargetString(options.browserTarget);
|
|
64
|
-
browserOptions = await context.validateOptions(await context.getTargetOptions(browserTarget), await context.getBuilderNameForTarget(browserTarget));
|
|
65
|
-
}
|
|
66
|
-
return {
|
|
67
|
-
tsConfig: options.tsConfig ??
|
|
68
|
-
findUpSync('tsconfig.json', { cwd: options.configDir }) ??
|
|
69
|
-
browserOptions.tsConfig,
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
function runInstance(options) {
|
|
73
|
-
return from(withTelemetry('build', {
|
|
74
|
-
cliOptions: options,
|
|
75
|
-
presetOptions: { ...options, corePresets: [], overridePresets: [] },
|
|
76
|
-
printError: printErrorDetails,
|
|
77
|
-
}, () => buildStaticStandalone(options))).pipe(catchError((error) => throwError(errorSummary(error))));
|
|
78
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
const architect_1 = require("@angular-devkit/architect");
|
|
37
|
-
const testing_1 = require("@angular-devkit/architect/testing");
|
|
38
|
-
const core_1 = require("@angular-devkit/core");
|
|
39
|
-
const path = __importStar(require("node:path"));
|
|
40
|
-
const vitest_1 = require("vitest");
|
|
41
|
-
const buildDevStandaloneMock = vitest_1.vi.fn();
|
|
42
|
-
const buildStaticStandaloneMock = vitest_1.vi.fn();
|
|
43
|
-
const buildMock = {
|
|
44
|
-
buildDevStandalone: buildDevStandaloneMock,
|
|
45
|
-
buildStaticStandalone: buildStaticStandaloneMock,
|
|
46
|
-
withTelemetry: (name, options, fn) => fn(),
|
|
47
|
-
};
|
|
48
|
-
vitest_1.vi.doMock('storybook/internal/core-server', () => buildMock);
|
|
49
|
-
vitest_1.vi.doMock('storybook/internal/common', () => ({
|
|
50
|
-
JsPackageManagerFactory: {
|
|
51
|
-
getPackageManager: () => ({
|
|
52
|
-
runPackageCommand: mockRunScript,
|
|
53
|
-
}),
|
|
54
|
-
},
|
|
55
|
-
getEnvConfig: (options) => options,
|
|
56
|
-
versions: {
|
|
57
|
-
storybook: 'x.x.x',
|
|
58
|
-
},
|
|
59
|
-
}));
|
|
60
|
-
vitest_1.vi.doMock('find-up', () => ({ sync: () => './storybook/tsconfig.ts' }));
|
|
61
|
-
const mockRunScript = vitest_1.vi.fn();
|
|
62
|
-
// Randomly fails on CI. TODO: investigate why
|
|
63
|
-
vitest_1.describe.skip('Build Storybook Builder', () => {
|
|
64
|
-
let architect;
|
|
65
|
-
let architectHost;
|
|
66
|
-
(0, vitest_1.beforeEach)(async () => {
|
|
67
|
-
const registry = new core_1.schema.CoreSchemaRegistry();
|
|
68
|
-
registry.addPostTransform(core_1.schema.transforms.addUndefinedDefaults);
|
|
69
|
-
architectHost = new testing_1.TestingArchitectHost();
|
|
70
|
-
architect = new architect_1.Architect(architectHost, registry);
|
|
71
|
-
architectHost.addBuilder('@angular-devkit/build-angular:browser', (0, architect_1.createBuilder)(() => {
|
|
72
|
-
return { success: true };
|
|
73
|
-
}));
|
|
74
|
-
architectHost.addTarget({ project: 'angular-cli', target: 'build-2' }, '@angular-devkit/build-angular:browser', {
|
|
75
|
-
outputPath: 'dist/angular-cli',
|
|
76
|
-
index: 'src/index.html',
|
|
77
|
-
main: 'src/main.ts',
|
|
78
|
-
polyfills: 'src/polyfills.ts',
|
|
79
|
-
tsConfig: 'src/tsconfig.app.json',
|
|
80
|
-
assets: ['src/favicon.ico', 'src/assets'],
|
|
81
|
-
styles: ['src/styles.css'],
|
|
82
|
-
scripts: [],
|
|
83
|
-
});
|
|
84
|
-
// This will either take a Node package name, or a path to the directory
|
|
85
|
-
// for the package.json file.
|
|
86
|
-
await architectHost.addBuilderFromPackage(path.join(__dirname, '../../..'));
|
|
87
|
-
});
|
|
88
|
-
(0, vitest_1.beforeEach)(() => {
|
|
89
|
-
buildStaticStandaloneMock.mockImplementation((_options) => Promise.resolve(_options));
|
|
90
|
-
});
|
|
91
|
-
(0, vitest_1.afterEach)(() => {
|
|
92
|
-
vitest_1.vi.clearAllMocks();
|
|
93
|
-
});
|
|
94
|
-
(0, vitest_1.it)('should start storybook with angularBrowserTarget', async () => {
|
|
95
|
-
const run = await architect.scheduleBuilder('@storybook/angular:build-storybook', {
|
|
96
|
-
browserTarget: 'angular-cli:build-2',
|
|
97
|
-
compodoc: false,
|
|
98
|
-
});
|
|
99
|
-
const output = await run.result;
|
|
100
|
-
await run.stop();
|
|
101
|
-
(0, vitest_1.expect)(output.success).toBeTruthy();
|
|
102
|
-
(0, vitest_1.expect)(mockRunScript).not.toHaveBeenCalledWith();
|
|
103
|
-
(0, vitest_1.expect)(buildStaticStandaloneMock).toHaveBeenCalledWith(vitest_1.expect.objectContaining({
|
|
104
|
-
angularBrowserTarget: 'angular-cli:build-2',
|
|
105
|
-
angularBuilderContext: vitest_1.expect.any(Object),
|
|
106
|
-
configDir: '.storybook',
|
|
107
|
-
loglevel: undefined,
|
|
108
|
-
quiet: false,
|
|
109
|
-
disableTelemetry: undefined,
|
|
110
|
-
outputDir: 'storybook-static',
|
|
111
|
-
packageJson: vitest_1.expect.any(Object),
|
|
112
|
-
mode: 'static',
|
|
113
|
-
tsConfig: './storybook/tsconfig.ts',
|
|
114
|
-
statsJson: false,
|
|
115
|
-
}));
|
|
116
|
-
});
|
|
117
|
-
(0, vitest_1.it)('should start storybook with tsConfig', async () => {
|
|
118
|
-
const run = await architect.scheduleBuilder('@storybook/angular:build-storybook', {
|
|
119
|
-
tsConfig: 'path/to/tsConfig.json',
|
|
120
|
-
compodoc: false,
|
|
121
|
-
});
|
|
122
|
-
const output = await run.result;
|
|
123
|
-
await run.stop();
|
|
124
|
-
(0, vitest_1.expect)(output.success).toBeTruthy();
|
|
125
|
-
(0, vitest_1.expect)(mockRunScript).not.toHaveBeenCalledWith();
|
|
126
|
-
(0, vitest_1.expect)(buildStaticStandaloneMock).toHaveBeenCalledWith(vitest_1.expect.objectContaining({
|
|
127
|
-
angularBrowserTarget: null,
|
|
128
|
-
angularBuilderContext: vitest_1.expect.any(Object),
|
|
129
|
-
configDir: '.storybook',
|
|
130
|
-
loglevel: undefined,
|
|
131
|
-
quiet: false,
|
|
132
|
-
disableTelemetry: undefined,
|
|
133
|
-
outputDir: 'storybook-static',
|
|
134
|
-
packageJson: vitest_1.expect.any(Object),
|
|
135
|
-
mode: 'static',
|
|
136
|
-
tsConfig: 'path/to/tsConfig.json',
|
|
137
|
-
statsJson: false,
|
|
138
|
-
}));
|
|
139
|
-
});
|
|
140
|
-
(0, vitest_1.it)('should build storybook with webpack stats.json', async () => {
|
|
141
|
-
const run = await architect.scheduleBuilder('@storybook/angular:build-storybook', {
|
|
142
|
-
tsConfig: 'path/to/tsConfig.json',
|
|
143
|
-
compodoc: false,
|
|
144
|
-
statsJson: true,
|
|
145
|
-
});
|
|
146
|
-
const output = await run.result;
|
|
147
|
-
await run.stop();
|
|
148
|
-
(0, vitest_1.expect)(output.success).toBeTruthy();
|
|
149
|
-
(0, vitest_1.expect)(mockRunScript).not.toHaveBeenCalledWith();
|
|
150
|
-
(0, vitest_1.expect)(buildStaticStandaloneMock).toHaveBeenCalledWith(vitest_1.expect.objectContaining({
|
|
151
|
-
angularBrowserTarget: null,
|
|
152
|
-
angularBuilderContext: vitest_1.expect.any(Object),
|
|
153
|
-
configDir: '.storybook',
|
|
154
|
-
loglevel: undefined,
|
|
155
|
-
quiet: false,
|
|
156
|
-
outputDir: 'storybook-static',
|
|
157
|
-
packageJson: vitest_1.expect.any(Object),
|
|
158
|
-
mode: 'static',
|
|
159
|
-
tsConfig: 'path/to/tsConfig.json',
|
|
160
|
-
statsJson: true,
|
|
161
|
-
}));
|
|
162
|
-
});
|
|
163
|
-
(0, vitest_1.it)('should throw error', async () => {
|
|
164
|
-
buildStaticStandaloneMock.mockRejectedValue(true);
|
|
165
|
-
const run = await architect.scheduleBuilder('@storybook/angular:build-storybook', {
|
|
166
|
-
browserTarget: 'angular-cli:build-2',
|
|
167
|
-
compodoc: false,
|
|
168
|
-
});
|
|
169
|
-
try {
|
|
170
|
-
await run.result;
|
|
171
|
-
(0, vitest_1.expect)(false).toEqual('Throw expected');
|
|
172
|
-
}
|
|
173
|
-
catch (error) {
|
|
174
|
-
(0, vitest_1.expect)(error).toEqual('Broken build, fix the error above.\nYou may need to refresh the browser.');
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
(0, vitest_1.it)('should run compodoc', async () => {
|
|
178
|
-
const run = await architect.scheduleBuilder('@storybook/angular:build-storybook', {
|
|
179
|
-
browserTarget: 'angular-cli:build-2',
|
|
180
|
-
});
|
|
181
|
-
const output = await run.result;
|
|
182
|
-
await run.stop();
|
|
183
|
-
(0, vitest_1.expect)(output.success).toBeTruthy();
|
|
184
|
-
(0, vitest_1.expect)(mockRunScript).toHaveBeenCalledWith('compodoc', ['-p', './storybook/tsconfig.ts', '-d', '.', '-e', 'json'], '');
|
|
185
|
-
(0, vitest_1.expect)(buildStaticStandaloneMock).toHaveBeenCalledWith(vitest_1.expect.objectContaining({
|
|
186
|
-
angularBrowserTarget: 'angular-cli:build-2',
|
|
187
|
-
angularBuilderContext: vitest_1.expect.any(Object),
|
|
188
|
-
configDir: '.storybook',
|
|
189
|
-
loglevel: undefined,
|
|
190
|
-
quiet: false,
|
|
191
|
-
outputDir: 'storybook-static',
|
|
192
|
-
packageJson: vitest_1.expect.any(Object),
|
|
193
|
-
mode: 'static',
|
|
194
|
-
tsConfig: './storybook/tsconfig.ts',
|
|
195
|
-
statsJson: false,
|
|
196
|
-
}));
|
|
197
|
-
});
|
|
198
|
-
(0, vitest_1.it)('should start storybook with styles options', async () => {
|
|
199
|
-
const run = await architect.scheduleBuilder('@storybook/angular:build-storybook', {
|
|
200
|
-
tsConfig: 'path/to/tsConfig.json',
|
|
201
|
-
compodoc: false,
|
|
202
|
-
styles: ['style.scss'],
|
|
203
|
-
});
|
|
204
|
-
const output = await run.result;
|
|
205
|
-
await run.stop();
|
|
206
|
-
(0, vitest_1.expect)(output.success).toBeTruthy();
|
|
207
|
-
(0, vitest_1.expect)(mockRunScript).not.toHaveBeenCalledWith();
|
|
208
|
-
(0, vitest_1.expect)(buildStaticStandaloneMock).toHaveBeenCalledWith(vitest_1.expect.objectContaining({
|
|
209
|
-
angularBrowserTarget: null,
|
|
210
|
-
angularBuilderContext: vitest_1.expect.any(Object),
|
|
211
|
-
angularBuilderOptions: { assets: [], styles: ['style.scss'] },
|
|
212
|
-
configDir: '.storybook',
|
|
213
|
-
loglevel: undefined,
|
|
214
|
-
quiet: false,
|
|
215
|
-
outputDir: 'storybook-static',
|
|
216
|
-
packageJson: vitest_1.expect.any(Object),
|
|
217
|
-
mode: 'static',
|
|
218
|
-
tsConfig: 'path/to/tsConfig.json',
|
|
219
|
-
statsJson: false,
|
|
220
|
-
}));
|
|
221
|
-
});
|
|
222
|
-
});
|