@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
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
/* angular.json can have comments */
|
|
3
|
-
// angular.json can have comments
|
|
4
|
-
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
|
5
|
-
"version": 1,
|
|
6
|
-
"newProjectRoot": "projects",
|
|
7
|
-
"projects": {
|
|
8
|
-
"angular-cli": {
|
|
9
|
-
"root": "",
|
|
10
|
-
"sourceRoot": "src",
|
|
11
|
-
"projectType": "application",
|
|
12
|
-
"prefix": "app",
|
|
13
|
-
"schematics": {},
|
|
14
|
-
"architect": {
|
|
15
|
-
"build": {
|
|
16
|
-
"builder": "@angular-devkit/build-angular:browser",
|
|
17
|
-
"options": {
|
|
18
|
-
"outputPath": "dist/angular-cli",
|
|
19
|
-
"index": "src/index.html",
|
|
20
|
-
"main": "src/main.ts",
|
|
21
|
-
"polyfills": "src/polyfills.ts",
|
|
22
|
-
"tsConfig": "src/tsconfig.app.json",
|
|
23
|
-
"assets": ["src/favicon.ico", "src/assets"],
|
|
24
|
-
"styles": ["src/styles.css", "src/styles.scss"],
|
|
25
|
-
"stylePreprocessorOptions": {
|
|
26
|
-
"includePaths": ["src/commons"]
|
|
27
|
-
},
|
|
28
|
-
"scripts": []
|
|
29
|
-
},
|
|
30
|
-
"configurations": {
|
|
31
|
-
"production": {
|
|
32
|
-
"fileReplacements": [
|
|
33
|
-
{
|
|
34
|
-
"replace": "src/environments/environment.ts",
|
|
35
|
-
"with": "src/environments/environment.prod.ts"
|
|
36
|
-
}
|
|
37
|
-
],
|
|
38
|
-
"optimization": true,
|
|
39
|
-
"outputHashing": "all",
|
|
40
|
-
"sourceMap": false,
|
|
41
|
-
"extractCss": true,
|
|
42
|
-
"namedChunks": false,
|
|
43
|
-
"aot": true,
|
|
44
|
-
"extractLicenses": true,
|
|
45
|
-
"vendorChunk": false,
|
|
46
|
-
"buildOptimizer": true
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
"serve": {
|
|
51
|
-
"builder": "@angular-devkit/build-angular:dev-server",
|
|
52
|
-
"options": {
|
|
53
|
-
"browserTarget": "angular-cli:build"
|
|
54
|
-
},
|
|
55
|
-
"configurations": {
|
|
56
|
-
"production": {
|
|
57
|
-
"browserTarget": "angular-cli:build:production"
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
"extract-i18n": {
|
|
62
|
-
"builder": "@angular-devkit/build-angular:extract-i18n",
|
|
63
|
-
"options": {
|
|
64
|
-
"browserTarget": "angular-cli:build"
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
"test": {
|
|
68
|
-
"builder": "@angular-devkit/build-angular:karma",
|
|
69
|
-
"options": {
|
|
70
|
-
"main": "src/karma.ts",
|
|
71
|
-
"polyfills": "src/polyfills.ts",
|
|
72
|
-
"tsConfig": "src/tsconfig.spec.json",
|
|
73
|
-
"karmaConfig": "src/karma.conf.js",
|
|
74
|
-
"styles": ["styles.css"],
|
|
75
|
-
"scripts": [],
|
|
76
|
-
"assets": ["src/favicon.ico", "src/assets"]
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
"angular-cli-e2e": {
|
|
82
|
-
"root": "e2e/",
|
|
83
|
-
"projectType": "application",
|
|
84
|
-
"architect": {
|
|
85
|
-
"e2e": {
|
|
86
|
-
"builder": "@angular-devkit/build-angular:protractor",
|
|
87
|
-
"options": {
|
|
88
|
-
"protractorConfig": "e2e/protractor.conf.js",
|
|
89
|
-
"devServerTarget": "angular-cli:serve"
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
"defaultProject": "angular-cli"
|
|
96
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function getWebpackConfig(baseConfig: any, { builderOptions, builderContext }: any): Promise<any>;
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Private angular devkit stuff
|
|
3
|
-
const { generateI18nBrowserWebpackConfigFromContext, } = require('@angular-devkit/build-angular/src/utils/webpack-browser-config');
|
|
4
|
-
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
|
|
5
|
-
const { filterOutStylingRules } = require('./utils/filter-out-styling-rules');
|
|
6
|
-
const { default: StorybookNormalizeAngularEntryPlugin, } = require('./plugins/storybook-normalize-angular-entry-plugin');
|
|
7
|
-
const { getCommonConfig, getStylesConfig, getDevServerConfig, getTypeScriptConfig, } = require('@angular-devkit/build-angular/src/tools/webpack/configs');
|
|
8
|
-
/**
|
|
9
|
-
* Extract webpack config from angular-cli 13.x.x ⚠️ This file is in JavaScript to not use
|
|
10
|
-
* TypeScript. Because current storybook TypeScript version is not compatible with Angular CLI.
|
|
11
|
-
* FIXME: Try another way with TypeScript on future storybook version (7 maybe 🤞)
|
|
12
|
-
*
|
|
13
|
-
* @param {any} baseConfig Previous webpack config from storybook
|
|
14
|
-
* @param {any} options { builderOptions, builderContext }
|
|
15
|
-
*/
|
|
16
|
-
exports.getWebpackConfig = async (baseConfig, { builderOptions, builderContext }) => {
|
|
17
|
-
/** Get angular-cli Webpack config */
|
|
18
|
-
const { config: cliConfig } = await generateI18nBrowserWebpackConfigFromContext({
|
|
19
|
-
// Default options
|
|
20
|
-
index: 'noop-index',
|
|
21
|
-
main: 'noop-main',
|
|
22
|
-
// Options provided by user
|
|
23
|
-
...builderOptions,
|
|
24
|
-
styles: builderOptions.styles
|
|
25
|
-
?.map((style) => (typeof style === 'string' ? style : style.input))
|
|
26
|
-
.filter((style) => typeof style === 'string' || style.inject !== false),
|
|
27
|
-
outputPath: typeof builderOptions.outputPath === 'string'
|
|
28
|
-
? builderOptions.outputPath
|
|
29
|
-
: (builderOptions.outputPath?.base ?? 'noop-out'),
|
|
30
|
-
// Fixed options
|
|
31
|
-
optimization: false,
|
|
32
|
-
namedChunks: false,
|
|
33
|
-
progress: false,
|
|
34
|
-
buildOptimizer: false,
|
|
35
|
-
aot: false,
|
|
36
|
-
}, builderContext, (wco) => [
|
|
37
|
-
getCommonConfig(wco),
|
|
38
|
-
getStylesConfig(wco),
|
|
39
|
-
getTypeScriptConfig ? getTypeScriptConfig(wco) : getDevServerConfig(wco),
|
|
40
|
-
]);
|
|
41
|
-
if (!builderOptions.experimentalZoneless && !cliConfig.entry.polyfills?.includes('zone.js')) {
|
|
42
|
-
cliConfig.entry.polyfills.push('zone.js');
|
|
43
|
-
}
|
|
44
|
-
/** Merge baseConfig Webpack with angular-cli Webpack */
|
|
45
|
-
const entry = [
|
|
46
|
-
...(cliConfig.entry.polyfills ?? []),
|
|
47
|
-
...baseConfig.entry,
|
|
48
|
-
...(cliConfig.entry.styles ?? []),
|
|
49
|
-
];
|
|
50
|
-
// Don't use storybooks styling rules because we have to use rules created by @angular-devkit/build-angular
|
|
51
|
-
// because @angular-devkit/build-angular created rules have include/exclude for global style files.
|
|
52
|
-
const rulesExcludingStyles = filterOutStylingRules(baseConfig);
|
|
53
|
-
const module = {
|
|
54
|
-
...baseConfig.module,
|
|
55
|
-
rules: [...cliConfig.module.rules, ...rulesExcludingStyles],
|
|
56
|
-
};
|
|
57
|
-
const plugins = [
|
|
58
|
-
...(cliConfig.plugins ?? []),
|
|
59
|
-
...baseConfig.plugins,
|
|
60
|
-
new StorybookNormalizeAngularEntryPlugin(),
|
|
61
|
-
];
|
|
62
|
-
const resolve = {
|
|
63
|
-
...baseConfig.resolve,
|
|
64
|
-
modules: Array.from(new Set([...baseConfig.resolve.modules, ...cliConfig.resolve.modules])),
|
|
65
|
-
plugins: [
|
|
66
|
-
new TsconfigPathsPlugin({
|
|
67
|
-
configFile: builderOptions.tsConfig,
|
|
68
|
-
mainFields: ['browser', 'module', 'main'],
|
|
69
|
-
}),
|
|
70
|
-
],
|
|
71
|
-
};
|
|
72
|
-
return {
|
|
73
|
-
...baseConfig,
|
|
74
|
-
entry,
|
|
75
|
-
module,
|
|
76
|
-
plugins,
|
|
77
|
-
resolve,
|
|
78
|
-
resolveLoader: cliConfig.resolveLoader,
|
|
79
|
-
};
|
|
80
|
-
};
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Private angular devkit stuff
|
|
3
|
-
const { generateI18nBrowserWebpackConfigFromContext, } = require('@angular-devkit/build-angular/src/utils/webpack-browser-config');
|
|
4
|
-
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
|
|
5
|
-
const { filterOutStylingRules } = require('./utils/filter-out-styling-rules');
|
|
6
|
-
const { default: StorybookNormalizeAngularEntryPlugin, } = require('./plugins/storybook-normalize-angular-entry-plugin');
|
|
7
|
-
const { getCommonConfig, getStylesConfig, getDevServerConfig, getTypeScriptConfig, } = require('@angular-devkit/build-angular/src/tools/webpack/configs');
|
|
8
|
-
/**
|
|
9
|
-
* Extract webpack config from angular-cli 13.x.x ⚠️ This file is in JavaScript to not use
|
|
10
|
-
* TypeScript. Because current storybook TypeScript version is not compatible with Angular CLI.
|
|
11
|
-
* FIXME: Try another way with TypeScript on future storybook version (7 maybe 🤞)
|
|
12
|
-
*
|
|
13
|
-
* @param {any} baseConfig Previous webpack config from storybook
|
|
14
|
-
* @param {any} options { builderOptions, builderContext }
|
|
15
|
-
*/
|
|
16
|
-
exports.getWebpackConfig = async (baseConfig, { builderOptions, builderContext }) => {
|
|
17
|
-
/** Get angular-cli Webpack config */
|
|
18
|
-
const { config: cliConfig } = await generateI18nBrowserWebpackConfigFromContext({
|
|
19
|
-
// Default options
|
|
20
|
-
index: 'noop-index',
|
|
21
|
-
main: 'noop-main',
|
|
22
|
-
// Options provided by user
|
|
23
|
-
...builderOptions,
|
|
24
|
-
styles: builderOptions.styles
|
|
25
|
-
?.map((style) => (typeof style === 'string' ? style : style.input))
|
|
26
|
-
.filter((style) => typeof style === 'string' || style.inject !== false),
|
|
27
|
-
outputPath: typeof builderOptions.outputPath === 'string'
|
|
28
|
-
? builderOptions.outputPath
|
|
29
|
-
: (builderOptions.outputPath?.base ?? 'noop-out'),
|
|
30
|
-
// Fixed options
|
|
31
|
-
optimization: false,
|
|
32
|
-
namedChunks: false,
|
|
33
|
-
progress: false,
|
|
34
|
-
buildOptimizer: false,
|
|
35
|
-
aot: false,
|
|
36
|
-
}, builderContext, (wco) => [
|
|
37
|
-
getCommonConfig(wco),
|
|
38
|
-
getStylesConfig(wco),
|
|
39
|
-
getTypeScriptConfig ? getTypeScriptConfig(wco) : getDevServerConfig(wco),
|
|
40
|
-
]);
|
|
41
|
-
if (!builderOptions.experimentalZoneless && !cliConfig.entry.polyfills?.includes('zone.js')) {
|
|
42
|
-
cliConfig.entry.polyfills.push('zone.js');
|
|
43
|
-
}
|
|
44
|
-
/** Merge baseConfig Webpack with angular-cli Webpack */
|
|
45
|
-
const entry = [
|
|
46
|
-
...(cliConfig.entry.polyfills ?? []),
|
|
47
|
-
...baseConfig.entry,
|
|
48
|
-
...(cliConfig.entry.styles ?? []),
|
|
49
|
-
];
|
|
50
|
-
// Don't use storybooks styling rules because we have to use rules created by @angular-devkit/build-angular
|
|
51
|
-
// because @angular-devkit/build-angular created rules have include/exclude for global style files.
|
|
52
|
-
const rulesExcludingStyles = filterOutStylingRules(baseConfig);
|
|
53
|
-
const module = {
|
|
54
|
-
...baseConfig.module,
|
|
55
|
-
rules: [...cliConfig.module.rules, ...rulesExcludingStyles],
|
|
56
|
-
};
|
|
57
|
-
const plugins = [
|
|
58
|
-
...(cliConfig.plugins ?? []),
|
|
59
|
-
...baseConfig.plugins,
|
|
60
|
-
new StorybookNormalizeAngularEntryPlugin(),
|
|
61
|
-
];
|
|
62
|
-
const resolve = {
|
|
63
|
-
...baseConfig.resolve,
|
|
64
|
-
modules: Array.from(new Set([...baseConfig.resolve.modules, ...cliConfig.resolve.modules])),
|
|
65
|
-
plugins: [
|
|
66
|
-
new TsconfigPathsPlugin({
|
|
67
|
-
configFile: builderOptions.tsConfig,
|
|
68
|
-
mainFields: ['browser', 'module', 'main'],
|
|
69
|
-
}),
|
|
70
|
-
],
|
|
71
|
-
};
|
|
72
|
-
return {
|
|
73
|
-
...baseConfig,
|
|
74
|
-
entry,
|
|
75
|
-
module,
|
|
76
|
-
plugins,
|
|
77
|
-
resolve,
|
|
78
|
-
resolveLoader: cliConfig.resolveLoader,
|
|
79
|
-
};
|
|
80
|
-
};
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { logger } from 'storybook/internal/node-logger';
|
|
2
|
-
import { AngularLegacyBuildOptionsError } from 'storybook/internal/server-errors';
|
|
3
|
-
import { WebpackDefinePlugin, WebpackIgnorePlugin } from '@storybook/builder-webpack5';
|
|
4
|
-
import { targetFromTargetString } from '@angular-devkit/architect';
|
|
5
|
-
import { logging } from '@angular-devkit/core';
|
|
6
|
-
import { sync as findUpSync } from 'find-up';
|
|
7
|
-
import { getWebpackConfig as getCustomWebpackConfig } from './angular-cli-webpack';
|
|
8
|
-
import { moduleIsAvailable } from './utils/module-is-available';
|
|
9
|
-
export async function webpackFinal(baseConfig, options) {
|
|
10
|
-
if (!moduleIsAvailable('@angular-devkit/build-angular')) {
|
|
11
|
-
logger.info('=> Using base config because "@angular-devkit/build-angular" is not installed');
|
|
12
|
-
return baseConfig;
|
|
13
|
-
}
|
|
14
|
-
checkForLegacyBuildOptions(options);
|
|
15
|
-
const builderContext = getBuilderContext(options);
|
|
16
|
-
const builderOptions = await getBuilderOptions(options, builderContext);
|
|
17
|
-
const webpackConfig = await getCustomWebpackConfig(baseConfig, {
|
|
18
|
-
builderOptions: {
|
|
19
|
-
watch: options.configType === 'DEVELOPMENT',
|
|
20
|
-
...builderOptions,
|
|
21
|
-
},
|
|
22
|
-
builderContext,
|
|
23
|
-
});
|
|
24
|
-
webpackConfig.plugins = webpackConfig.plugins ?? [];
|
|
25
|
-
webpackConfig.plugins.push(new WebpackDefinePlugin({
|
|
26
|
-
STORYBOOK_ANGULAR_OPTIONS: JSON.stringify({
|
|
27
|
-
experimentalZoneless: builderOptions.experimentalZoneless,
|
|
28
|
-
}),
|
|
29
|
-
}));
|
|
30
|
-
try {
|
|
31
|
-
require.resolve('@angular/animations');
|
|
32
|
-
}
|
|
33
|
-
catch (e) {
|
|
34
|
-
webpackConfig.plugins.push(new WebpackIgnorePlugin({
|
|
35
|
-
resourceRegExp: /@angular\/platform-browser\/animations$/,
|
|
36
|
-
}));
|
|
37
|
-
}
|
|
38
|
-
return webpackConfig;
|
|
39
|
-
}
|
|
40
|
-
/** Get Builder Context If storybook is not start by angular builder create dumb BuilderContext */
|
|
41
|
-
function getBuilderContext(options) {
|
|
42
|
-
return (options.angularBuilderContext ??
|
|
43
|
-
{
|
|
44
|
-
target: { project: 'noop-project', builder: '', options: {} },
|
|
45
|
-
workspaceRoot: process.cwd(),
|
|
46
|
-
getProjectMetadata: () => ({}),
|
|
47
|
-
getTargetOptions: () => ({}),
|
|
48
|
-
logger: new logging.Logger('Storybook'),
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
/** Get builder options Merge target options from browser target and from storybook options */
|
|
52
|
-
async function getBuilderOptions(options, builderContext) {
|
|
53
|
-
/** Get Browser Target options */
|
|
54
|
-
let browserTargetOptions = {};
|
|
55
|
-
if (options.angularBrowserTarget) {
|
|
56
|
-
const browserTarget = targetFromTargetString(options.angularBrowserTarget);
|
|
57
|
-
logger.info(`=> Using angular browser target options from "${browserTarget.project}:${browserTarget.target}${browserTarget.configuration ? `:${browserTarget.configuration}` : ''}"`);
|
|
58
|
-
browserTargetOptions = await builderContext.getTargetOptions(browserTarget);
|
|
59
|
-
}
|
|
60
|
-
/** Merge target options from browser target options and from storybook options */
|
|
61
|
-
const builderOptions = {
|
|
62
|
-
...browserTargetOptions,
|
|
63
|
-
...options.angularBuilderOptions,
|
|
64
|
-
tsConfig: options.tsConfig ??
|
|
65
|
-
findUpSync('tsconfig.json', { cwd: options.configDir }) ??
|
|
66
|
-
browserTargetOptions.tsConfig,
|
|
67
|
-
};
|
|
68
|
-
logger.info(`=> Using angular project with "tsConfig:${builderOptions.tsConfig}"`);
|
|
69
|
-
return builderOptions;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Checks if using legacy configuration that doesn't use builder and logs message referring to
|
|
73
|
-
* migration docs.
|
|
74
|
-
*/
|
|
75
|
-
function checkForLegacyBuildOptions(options) {
|
|
76
|
-
if (options.angularBrowserTarget !== undefined) {
|
|
77
|
-
// Not use legacy way with builder (`angularBrowserTarget` is defined or null with builder and undefined without)
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
throw new AngularLegacyBuildOptionsError();
|
|
81
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Configuration } from 'webpack';
|
|
2
|
-
import { PresetOptions } from './preset-options';
|
|
3
|
-
/**
|
|
4
|
-
* Run ngcc for converting modules to ivy format before starting storybook This step is needed in
|
|
5
|
-
* order to support Ivy in storybook
|
|
6
|
-
*
|
|
7
|
-
* Information about Ivy can be found here https://angular.io/guide/ivy
|
|
8
|
-
*/
|
|
9
|
-
export declare const runNgcc: () => Promise<void>;
|
|
10
|
-
export declare const webpack: (webpackConfig: Configuration, options: PresetOptions) => Promise<Configuration>;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { join } from 'node:path';
|
|
2
|
-
/**
|
|
3
|
-
* Source :
|
|
4
|
-
* https://github.com/angular/angular-cli/blob/ebccb5de4a455af813c5e82483db6af20666bdbd/packages/angular_devkit/build_angular/src/utils/load-esm.ts#L23
|
|
5
|
-
* This uses a dynamic import to load a module which may be ESM. CommonJS code can load ESM code via
|
|
6
|
-
* a dynamic import. Unfortunately, TypeScript will currently, unconditionally downlevel dynamic
|
|
7
|
-
* import into a require call. require calls cannot load ESM code and will result in a runtime
|
|
8
|
-
* error. To workaround this, a Function constructor is used to prevent TypeScript from changing the
|
|
9
|
-
* dynamic import. Once TypeScript provides support for keeping the dynamic import this workaround
|
|
10
|
-
* can be dropped.
|
|
11
|
-
*
|
|
12
|
-
* @param modulePath The path of the module to load.
|
|
13
|
-
* @returns A Promise that resolves to the dynamically imported module.
|
|
14
|
-
*/
|
|
15
|
-
function loadEsmModule(modulePath) {
|
|
16
|
-
// eslint-disable-next-line @typescript-eslint/no-implied-eval
|
|
17
|
-
return new Function('modulePath', `return import(modulePath);`)(modulePath);
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Run ngcc for converting modules to ivy format before starting storybook This step is needed in
|
|
21
|
-
* order to support Ivy in storybook
|
|
22
|
-
*
|
|
23
|
-
* Information about Ivy can be found here https://angular.io/guide/ivy
|
|
24
|
-
*/
|
|
25
|
-
export const runNgcc = async () => {
|
|
26
|
-
let ngcc;
|
|
27
|
-
try {
|
|
28
|
-
ngcc = require('@angular/compiler-cli/ngcc');
|
|
29
|
-
}
|
|
30
|
-
catch (error) {
|
|
31
|
-
ngcc = await loadEsmModule('@angular/compiler-cli/ngcc');
|
|
32
|
-
}
|
|
33
|
-
ngcc.process({
|
|
34
|
-
// should be async: true but does not work due to
|
|
35
|
-
// https://github.com/storybookjs/storybook/pull/11157/files#r615413803
|
|
36
|
-
async: false,
|
|
37
|
-
basePath: join(process.cwd(), 'node_modules'), // absolute path to node_modules
|
|
38
|
-
createNewEntryPointFormats: true, // --create-ivy-entry-points
|
|
39
|
-
compileAllFormats: false, // --first-only
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
export const webpack = async (webpackConfig, options) => {
|
|
43
|
-
const framework = await options.presets.apply('framework');
|
|
44
|
-
const angularOptions = (typeof framework === 'object' ? framework.options : {});
|
|
45
|
-
// Default to true, if undefined
|
|
46
|
-
if (angularOptions.enableIvy === false) {
|
|
47
|
-
return webpackConfig;
|
|
48
|
-
}
|
|
49
|
-
return {
|
|
50
|
-
...webpackConfig,
|
|
51
|
-
resolve: {
|
|
52
|
-
...webpackConfig.resolve,
|
|
53
|
-
mainFields: ['browser', 'module', 'main'],
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This plugin is designed to modify the Webpack configuration for Storybook projects that use
|
|
3
|
-
* Angular, specifically to prevent multiple runtime bundle issues by merging 'main' and 'styles'
|
|
4
|
-
* entry points. It ensures that only one runtime bundle is generated to avoid
|
|
5
|
-
* '**webpack_require**.nmd is not a function' errors.
|
|
6
|
-
*/
|
|
7
|
-
export default class StorybookNormalizeAngularEntryPlugin {
|
|
8
|
-
constructor(options: any);
|
|
9
|
-
options: any;
|
|
10
|
-
apply(compiler: any): void;
|
|
11
|
-
compilation: any;
|
|
12
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const PLUGIN_NAME = 'storybook-normalize-angular-entry-plugin';
|
|
4
|
-
/**
|
|
5
|
-
* This plugin is designed to modify the Webpack configuration for Storybook projects that use
|
|
6
|
-
* Angular, specifically to prevent multiple runtime bundle issues by merging 'main' and 'styles'
|
|
7
|
-
* entry points. It ensures that only one runtime bundle is generated to avoid
|
|
8
|
-
* '**webpack_require**.nmd is not a function' errors.
|
|
9
|
-
*/
|
|
10
|
-
class StorybookNormalizeAngularEntryPlugin {
|
|
11
|
-
constructor(options) {
|
|
12
|
-
this.options = options; // Store options if future configuration is needed
|
|
13
|
-
}
|
|
14
|
-
apply(compiler) {
|
|
15
|
-
compiler.hooks.environment.tap(PLUGIN_NAME, () => {
|
|
16
|
-
// Store the original entry configuration
|
|
17
|
-
const originalEntry = compiler.options.entry;
|
|
18
|
-
// Overwrite the entry configuration to normalize it
|
|
19
|
-
compiler.options.entry = async () => {
|
|
20
|
-
let entryResult;
|
|
21
|
-
// Handle the case where the original entry is a function, which could be async
|
|
22
|
-
if (typeof originalEntry === 'function') {
|
|
23
|
-
try {
|
|
24
|
-
// Execute the function and await its result, in case it returns a promise
|
|
25
|
-
entryResult = await originalEntry();
|
|
26
|
-
}
|
|
27
|
-
catch (error) {
|
|
28
|
-
// Log the error and re-throw it to ensure it's visible and doesn't silently fail
|
|
29
|
-
console.error('Failed to execute the entry function:', error);
|
|
30
|
-
throw error;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
// If the original entry is not a function, use it as is
|
|
35
|
-
entryResult = originalEntry;
|
|
36
|
-
}
|
|
37
|
-
// Merge 'main' and 'styles' entries if both exist
|
|
38
|
-
if (entryResult && entryResult.main && entryResult.styles) {
|
|
39
|
-
// Combine and deduplicate imports from 'main' and 'styles'
|
|
40
|
-
return {
|
|
41
|
-
main: {
|
|
42
|
-
import: Array.from(new Set([...entryResult.main.import, ...entryResult.styles.import])),
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
// If not both 'main' and 'styles' are present, return the original or resolved entry result
|
|
47
|
-
return entryResult;
|
|
48
|
-
};
|
|
49
|
-
});
|
|
50
|
-
compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation) => {
|
|
51
|
-
this.compilation = compilation;
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
exports.default = StorybookNormalizeAngularEntryPlugin;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
const PLUGIN_NAME = 'storybook-normalize-angular-entry-plugin';
|
|
2
|
-
/**
|
|
3
|
-
* This plugin is designed to modify the Webpack configuration for Storybook projects that use
|
|
4
|
-
* Angular, specifically to prevent multiple runtime bundle issues by merging 'main' and 'styles'
|
|
5
|
-
* entry points. It ensures that only one runtime bundle is generated to avoid
|
|
6
|
-
* '**webpack_require**.nmd is not a function' errors.
|
|
7
|
-
*/
|
|
8
|
-
export default class StorybookNormalizeAngularEntryPlugin {
|
|
9
|
-
constructor(options) {
|
|
10
|
-
this.options = options; // Store options if future configuration is needed
|
|
11
|
-
}
|
|
12
|
-
apply(compiler) {
|
|
13
|
-
compiler.hooks.environment.tap(PLUGIN_NAME, () => {
|
|
14
|
-
// Store the original entry configuration
|
|
15
|
-
const originalEntry = compiler.options.entry;
|
|
16
|
-
// Overwrite the entry configuration to normalize it
|
|
17
|
-
compiler.options.entry = async () => {
|
|
18
|
-
let entryResult;
|
|
19
|
-
// Handle the case where the original entry is a function, which could be async
|
|
20
|
-
if (typeof originalEntry === 'function') {
|
|
21
|
-
try {
|
|
22
|
-
// Execute the function and await its result, in case it returns a promise
|
|
23
|
-
entryResult = await originalEntry();
|
|
24
|
-
}
|
|
25
|
-
catch (error) {
|
|
26
|
-
// Log the error and re-throw it to ensure it's visible and doesn't silently fail
|
|
27
|
-
console.error('Failed to execute the entry function:', error);
|
|
28
|
-
throw error;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
// If the original entry is not a function, use it as is
|
|
33
|
-
entryResult = originalEntry;
|
|
34
|
-
}
|
|
35
|
-
// Merge 'main' and 'styles' entries if both exist
|
|
36
|
-
if (entryResult && entryResult.main && entryResult.styles) {
|
|
37
|
-
// Combine and deduplicate imports from 'main' and 'styles'
|
|
38
|
-
return {
|
|
39
|
-
main: {
|
|
40
|
-
import: Array.from(new Set([...entryResult.main.import, ...entryResult.styles.import])),
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
// If not both 'main' and 'styles' are present, return the original or resolved entry result
|
|
45
|
-
return entryResult;
|
|
46
|
-
};
|
|
47
|
-
});
|
|
48
|
-
compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation) => {
|
|
49
|
-
this.compilation = compilation;
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Options as CoreOptions } from 'storybook/internal/types';
|
|
2
|
-
import { BuilderContext } from '@angular-devkit/architect';
|
|
3
|
-
import { StandaloneOptions } from '../builders/utils/standalone-options';
|
|
4
|
-
export type PresetOptions = CoreOptions & {
|
|
5
|
-
angularBrowserTarget?: string | null;
|
|
6
|
-
angularBuilderOptions?: StandaloneOptions['angularBuilderOptions'];
|
|
7
|
-
angularBuilderContext?: BuilderContext | null;
|
|
8
|
-
tsConfig?: string;
|
|
9
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.filterOutStylingRules = void 0;
|
|
4
|
-
const isStylingRule = (rule) => {
|
|
5
|
-
const { test } = rule;
|
|
6
|
-
if (!test) {
|
|
7
|
-
return false;
|
|
8
|
-
}
|
|
9
|
-
if (!(test instanceof RegExp)) {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
return test.test('.css') || test.test('.scss') || test.test('.sass');
|
|
13
|
-
};
|
|
14
|
-
const filterOutStylingRules = (config) => {
|
|
15
|
-
return config.module.rules.filter((rule) => !isStylingRule(rule));
|
|
16
|
-
};
|
|
17
|
-
exports.filterOutStylingRules = filterOutStylingRules;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
const isStylingRule = (rule) => {
|
|
2
|
-
const { test } = rule;
|
|
3
|
-
if (!test) {
|
|
4
|
-
return false;
|
|
5
|
-
}
|
|
6
|
-
if (!(test instanceof RegExp)) {
|
|
7
|
-
return false;
|
|
8
|
-
}
|
|
9
|
-
return test.test('.css') || test.test('.scss') || test.test('.sass');
|
|
10
|
-
};
|
|
11
|
-
export const filterOutStylingRules = (config) => {
|
|
12
|
-
return config.module.rules.filter((rule) => !isStylingRule(rule));
|
|
13
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const moduleIsAvailable: (moduleName: string) => boolean;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.moduleIsAvailable = void 0;
|
|
4
|
-
const moduleIsAvailable = (moduleName) => {
|
|
5
|
-
try {
|
|
6
|
-
require.resolve(moduleName);
|
|
7
|
-
return true;
|
|
8
|
-
}
|
|
9
|
-
catch (e) {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
exports.moduleIsAvailable = moduleIsAvailable;
|
package/dist/test-setup.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@analogjs/vite-plugin-angular/setup-vitest';
|
package/dist/test-setup.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
require("@analogjs/vite-plugin-angular/setup-vitest");
|
|
4
|
-
const testing_1 = require("@angular/core/testing");
|
|
5
|
-
const testing_2 = require("@angular/platform-browser-dynamic/testing");
|
|
6
|
-
(0, testing_1.getTestBed)().initTestEnvironment(testing_2.BrowserDynamicTestingModule, (0, testing_2.platformBrowserDynamicTesting)());
|
package/dist/test-setup.mjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import '@analogjs/vite-plugin-angular/setup-vitest';
|
|
2
|
-
import { getTestBed } from '@angular/core/testing';
|
|
3
|
-
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting, } from '@angular/platform-browser-dynamic/testing';
|
|
4
|
-
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
|