@storybook/angular 6.5.9 → 7.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ts3.9 → types}/builders/build-storybook/index.d.ts +1 -1
- package/dist/types/builders/build-storybook/index.js +56 -0
- package/dist/{ts3.9 → types}/builders/build-storybook/schema.json +0 -0
- package/dist/{ts3.9 → types}/builders/builders.json +0 -0
- package/dist/{ts3.9 → types}/builders/start-storybook/index.d.ts +1 -1
- package/dist/types/builders/start-storybook/index.js +64 -0
- package/dist/{ts3.9 → types}/builders/start-storybook/schema.json +0 -0
- package/dist/{ts3.9 → types}/builders/utils/build-standalone-errors-handler.d.ts +0 -0
- package/dist/{ts3.9 → types}/builders/utils/build-standalone-errors-handler.js +5 -5
- package/dist/{ts3.9 → types}/builders/utils/run-compodoc.d.ts +0 -0
- package/dist/{ts3.9 → types}/builders/utils/run-compodoc.js +9 -4
- package/dist/types/builders/utils/standalone-options.d.ts +12 -0
- package/dist/{ts3.9/client/docs/types.js → types/builders/utils/standalone-options.js} +0 -0
- package/dist/{ts3.9/client/preview/angular/components → types/client/angular}/app.component.d.ts +1 -1
- package/dist/{ts3.9/client/preview/angular/components → types/client/angular}/app.component.js +5 -5
- package/dist/{ts3.9/client/preview → types/client}/angular/app.token.d.ts +0 -0
- package/dist/{ts3.9/client/preview → types/client}/angular/app.token.js +0 -0
- package/dist/{ts3.9/client/preview → types/client}/angular/helpers.d.ts +1 -1
- package/dist/{ts3.9/client/preview → types/client}/angular/helpers.js +7 -7
- package/dist/{ts3.9/client/preview → types/client}/angular-beta/AbstractRenderer.d.ts +1 -2
- package/dist/{ts3.9/client/preview → types/client}/angular-beta/AbstractRenderer.js +40 -48
- package/dist/{ts3.9/client/preview → types/client}/angular-beta/CanvasRenderer.d.ts +1 -2
- package/dist/types/client/angular-beta/CanvasRenderer.js +16 -0
- package/dist/{ts3.9/client/preview → types/client}/angular-beta/ComputesTemplateFromComponent.d.ts +0 -0
- package/dist/{ts3.9/client/preview → types/client}/angular-beta/ComputesTemplateFromComponent.js +10 -8
- package/dist/{ts3.9/client/preview → types/client}/angular-beta/DocsRenderer.d.ts +1 -2
- package/dist/types/client/angular-beta/DocsRenderer.js +41 -0
- package/dist/{ts3.9/client/preview → types/client}/angular-beta/RendererFactory.d.ts +0 -0
- package/dist/types/client/angular-beta/RendererFactory.js +55 -0
- package/dist/{ts3.9/client/preview → types/client}/angular-beta/StorybookModule.d.ts +0 -0
- package/dist/{ts3.9/client/preview → types/client}/angular-beta/StorybookModule.js +18 -17
- package/dist/{ts3.9/client/preview → types/client}/angular-beta/StorybookProvider.d.ts +0 -0
- package/dist/{ts3.9/client/preview → types/client}/angular-beta/StorybookProvider.js +2 -1
- package/dist/{ts3.9/client/preview → types/client}/angular-beta/StorybookWrapperComponent.d.ts +0 -0
- package/dist/{ts3.9/client/preview → types/client}/angular-beta/StorybookWrapperComponent.js +11 -10
- package/dist/{ts3.9/client/preview → types/client}/angular-beta/utils/NgComponentAnalyzer.d.ts +0 -0
- package/dist/{ts3.9/client/preview → types/client}/angular-beta/utils/NgComponentAnalyzer.js +24 -13
- package/dist/{ts3.9/client/preview → types/client}/angular-beta/utils/NgModulesAnalyzer.d.ts +0 -0
- package/dist/{ts3.9/client/preview → types/client}/angular-beta/utils/NgModulesAnalyzer.js +3 -2
- package/dist/{ts3.9/client/preview → types/client}/config.d.ts +1 -1
- package/dist/{ts3.9/client/preview → types/client}/config.js +1 -1
- package/dist/{ts3.9/client/preview → types/client}/decorateStory.d.ts +1 -1
- package/dist/{ts3.9/client/preview → types/client}/decorateStory.js +11 -6
- package/dist/{ts3.9/client/preview → types/client}/decorators.d.ts +1 -2
- package/dist/{ts3.9/client/preview → types/client}/decorators.js +23 -11
- package/dist/{ts3.9 → types}/client/docs/compodoc.d.ts +0 -0
- package/dist/{ts3.9 → types}/client/docs/compodoc.js +47 -34
- package/dist/{ts3.9 → types}/client/docs/config.d.ts +3 -4
- package/dist/{ts3.9 → types}/client/docs/config.js +0 -2
- package/dist/{ts3.9 → types}/client/docs/index.d.ts +0 -0
- package/dist/{ts3.9 → types}/client/docs/index.js +6 -2
- package/dist/{ts3.9 → types}/client/docs/sourceDecorator.d.ts +2 -2
- package/dist/{ts3.9 → types}/client/docs/sourceDecorator.js +10 -9
- package/dist/{ts3.9 → types}/client/docs/types.d.ts +0 -0
- package/dist/{ts3.9/client/preview → types/client/docs}/types.js +0 -0
- package/dist/{ts3.9/client/preview/angular-polyfills.d.ts → types/client/globals.d.ts} +0 -10
- package/dist/{ts3.9/client/preview/angular-polyfills.js → types/client/globals.js} +7 -1
- package/dist/types/client/index.d.ts +5 -0
- package/dist/types/client/index.js +25 -0
- package/dist/{ts3.9/client/preview/index.d.ts → types/client/public-api.d.ts} +2 -4
- package/dist/types/client/public-api.js +43 -0
- package/dist/{ts3.9/client/preview/types-6-0.d.ts → types/client/public-types.d.ts} +4 -19
- package/dist/{ts3.9/client/preview/types-6-0.js → types/client/public-types.js} +0 -0
- package/dist/{ts3.9/client/preview → types/client}/render.d.ts +1 -1
- package/dist/types/client/render.js +24 -0
- package/dist/{ts3.9/client/preview → types/client}/types.d.ts +13 -0
- package/dist/{ts3.9/client/preview/types-7-0.js → types/client/types.js} +0 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/{ts3.9/public_api.js → types/index.js} +8 -3
- package/dist/types/preset.d.ts +6 -0
- package/dist/types/preset.js +36 -0
- package/dist/types/renderer.d.ts +4 -0
- package/dist/{ts3.9 → types}/renderer.js +5 -4
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/empty-projects-entry/angular.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/minimal-config/angular.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/minimal-config/src/main.d.ts +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/minimal-config/src/main.js +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/minimal-config/src/tsconfig.app.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/minimal-config/tsconfig.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/some-config/angular.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/some-config/src/main.d.ts +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/some-config/src/main.js +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/some-config/src/tsconfig.app.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/some-config/tsconfig.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-angularBrowserTarget/angular.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-angularBrowserTarget/src/main.d.ts +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-angularBrowserTarget/src/main.js +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-angularBrowserTarget/src/tsconfig.app.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-angularBrowserTarget/tsconfig.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-lib/angular.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-lib/projects/pattern-lib/src/main.d.ts +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-lib/projects/pattern-lib/src/main.js +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-lib/projects/pattern-lib/tsconfig.lib.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-lib/tsconfig.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-nx/angular.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-nx/nx.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-nx/src/main.d.ts +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-nx/src/main.js +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-nx/src/tsconfig.app.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-nx/tsconfig.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-nx-workspace/nx.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-nx-workspace/src/main.d.ts +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-nx-workspace/src/main.js +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-nx-workspace/src/tsconfig.app.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-nx-workspace/tsconfig.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-nx-workspace/workspace.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-options-styles/angular.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-options-styles/src/main.d.ts +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-options-styles/src/main.js +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-options-styles/src/tsconfig.app.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-options-styles/tsconfig.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/without-architect-build/angular.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/without-architect-build-options/angular.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/without-compatible-projects/angular.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/without-projects-entry/angular.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/without-projects-entry/projects/pattern-lib/src/main.d.ts +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/without-projects-entry/projects/pattern-lib/src/main.js +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/without-projects-entry/projects/pattern-lib/tsconfig.lib.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/without-projects-entry/tsconfig.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/without-tsConfig/angular.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/without-tsConfig/src/main.d.ts +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/without-tsConfig/src/main.js +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/without-tsConfig/src/tsconfig.app.json +0 -0
- package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/without-tsConfig/tsconfig.json +0 -0
- package/dist/{ts3.9 → types}/server/angular-cli-webpack-12.2.x.d.ts +0 -0
- package/dist/types/server/angular-cli-webpack-12.2.x.js +66 -0
- package/dist/{ts3.9 → types}/server/angular-cli-webpack-13.x.x.d.ts +0 -0
- package/dist/types/server/angular-cli-webpack-13.x.x.js +70 -0
- package/dist/types/server/angular-cli-webpack-older.d.ts +6 -0
- package/dist/types/server/angular-cli-webpack-older.js +111 -0
- package/dist/{ts3.9 → types}/server/angular-devkit-build-webpack.d.ts +6 -6
- package/dist/{ts3.9 → types}/server/angular-devkit-build-webpack.js +66 -54
- package/dist/{ts3.9 → types}/server/angular-read-workspace.d.ts +0 -0
- package/dist/{ts3.9 → types}/server/angular-read-workspace.js +8 -14
- package/dist/{ts3.9 → types}/server/create-fork-ts-checker-plugin.d.ts +0 -0
- package/dist/{ts3.9 → types}/server/create-fork-ts-checker-plugin.js +1 -1
- package/dist/{ts3.9 → types}/server/framework-preset-angular-cli.d.ts +1 -1
- package/dist/types/server/framework-preset-angular-cli.js +175 -0
- package/dist/{ts3.9 → types}/server/framework-preset-angular-docs.d.ts +0 -0
- package/dist/{ts3.9 → types}/server/framework-preset-angular-docs.js +4 -3
- package/dist/{ts3.9 → types}/server/framework-preset-angular-ivy.d.ts +1 -1
- package/dist/{ts3.9 → types}/server/framework-preset-angular-ivy.js +26 -22
- package/dist/{ts3.9 → types}/server/framework-preset-angular.d.ts +0 -0
- package/dist/types/server/framework-preset-angular.js +103 -0
- package/dist/{ts3.9 → types}/server/ngx-template-loader/index.d.ts +0 -0
- package/dist/{ts3.9 → types}/server/ngx-template-loader/index.js +0 -0
- package/dist/{ts3.9/server/options.d.ts → types/server/preset-options.d.ts} +1 -3
- package/dist/{ts3.9/types/index.js → types/server/preset-options.js} +0 -0
- package/dist/{ts3.9 → types}/server/ts_config.d.ts +0 -0
- package/dist/{ts3.9 → types}/server/ts_config.js +0 -0
- package/dist/{ts3.9 → types}/server/utils/filter-out-styling-rules.d.ts +0 -0
- package/dist/{ts3.9 → types}/server/utils/filter-out-styling-rules.js +2 -1
- package/dist/{ts3.9 → types}/server/utils/module-is-available.d.ts +0 -0
- package/dist/{ts3.9 → types}/server/utils/module-is-available.js +2 -1
- package/dist/{ts3.4 → types}/server/utils/normalize-asset-patterns.d.ts +7 -6
- package/dist/{ts3.9 → types}/server/utils/normalize-asset-patterns.js +9 -9
- package/dist/{ts3.9 → types}/server/utils/normalize-optimization.d.ts +1 -1
- package/dist/{ts3.9 → types}/server/utils/normalize-optimization.js +3 -2
- package/dist/types/types.d.ts +28 -0
- package/dist/types/types.js +2 -0
- package/jest.config.js +1 -0
- package/package.json +47 -57
- package/preset.js +1 -1
- package/renderer.d.ts +1 -1
- package/renderer.js +1 -1
- package/bin/build.js +0 -4
- package/bin/index.js +0 -3
- package/demo.d.ts +0 -4
- package/demo.js +0 -5
- package/dist/ts3.4/builders/build-storybook/index.d.ts +0 -15
- package/dist/ts3.4/builders/start-storybook/index.d.ts +0 -15
- package/dist/ts3.4/builders/utils/build-standalone-errors-handler.d.ts +0 -1
- package/dist/ts3.4/builders/utils/run-compodoc.d.ts +0 -6
- package/dist/ts3.4/client/docs/compodoc.d.ts +0 -18
- package/dist/ts3.4/client/docs/config.d.ts +0 -15
- package/dist/ts3.4/client/docs/index.d.ts +0 -1
- package/dist/ts3.4/client/docs/prepareForInline.d.ts +0 -7
- package/dist/ts3.4/client/docs/sourceDecorator.d.ts +0 -9
- package/dist/ts3.4/client/docs/types.d.ts +0 -102
- package/dist/ts3.4/client/index.d.ts +0 -4
- package/dist/ts3.4/client/preview/angular/app.token.d.ts +0 -3
- package/dist/ts3.4/client/preview/angular/components/app.component.d.ts +0 -38
- package/dist/ts3.4/client/preview/angular/helpers.d.ts +0 -8
- package/dist/ts3.4/client/preview/angular-beta/AbstractRenderer.d.ts +0 -57
- package/dist/ts3.4/client/preview/angular-beta/CanvasRenderer.d.ts +0 -14
- package/dist/ts3.4/client/preview/angular-beta/ComputesTemplateFromComponent.d.ts +0 -17
- package/dist/ts3.4/client/preview/angular-beta/DocsRenderer.d.ts +0 -14
- package/dist/ts3.4/client/preview/angular-beta/RendererFactory.d.ts +0 -11
- package/dist/ts3.4/client/preview/angular-beta/StorybookModule.d.ts +0 -9
- package/dist/ts3.4/client/preview/angular-beta/StorybookProvider.d.ts +0 -5
- package/dist/ts3.4/client/preview/angular-beta/StorybookWrapperComponent.d.ts +0 -9
- package/dist/ts3.4/client/preview/angular-beta/utils/NgComponentAnalyzer.d.ts +0 -29
- package/dist/ts3.4/client/preview/angular-beta/utils/NgModulesAnalyzer.d.ts +0 -6
- package/dist/ts3.4/client/preview/angular-polyfills.d.ts +0 -41
- package/dist/ts3.4/client/preview/config.d.ts +0 -6
- package/dist/ts3.4/client/preview/decorateStory.d.ts +0 -4
- package/dist/ts3.4/client/preview/decorators.d.ts +0 -6
- package/dist/ts3.4/client/preview/globals.d.ts +0 -1
- package/dist/ts3.4/client/preview/index.d.ts +0 -25
- package/dist/ts3.4/client/preview/render.d.ts +0 -7
- package/dist/ts3.4/client/preview/types-6-0.d.ts +0 -42
- package/dist/ts3.4/client/preview/types-7-0.d.ts +0 -9
- package/dist/ts3.4/client/preview/types.d.ts +0 -29
- package/dist/ts3.4/demo/button.component.d.ts +0 -5
- package/dist/ts3.4/demo/welcome.component.d.ts +0 -4
- package/dist/ts3.4/public_api.d.ts +0 -1
- package/dist/ts3.4/renderer.d.ts +0 -4
- package/dist/ts3.4/server/__mocks-ng-workspace__/minimal-config/src/main.d.ts +0 -1
- package/dist/ts3.4/server/__mocks-ng-workspace__/some-config/src/main.d.ts +0 -1
- package/dist/ts3.4/server/__mocks-ng-workspace__/with-angularBrowserTarget/src/main.d.ts +0 -1
- package/dist/ts3.4/server/__mocks-ng-workspace__/with-lib/projects/pattern-lib/src/main.d.ts +0 -1
- package/dist/ts3.4/server/__mocks-ng-workspace__/with-nx/src/main.d.ts +0 -1
- package/dist/ts3.4/server/__mocks-ng-workspace__/with-nx-workspace/src/main.d.ts +0 -1
- package/dist/ts3.4/server/__mocks-ng-workspace__/with-options-styles/src/main.d.ts +0 -1
- package/dist/ts3.4/server/__mocks-ng-workspace__/without-projects-entry/projects/pattern-lib/src/main.d.ts +0 -1
- package/dist/ts3.4/server/__mocks-ng-workspace__/without-tsConfig/src/main.d.ts +0 -1
- package/dist/ts3.4/server/angular-cli-webpack-12.2.x.d.ts +0 -1
- package/dist/ts3.4/server/angular-cli-webpack-13.x.x.d.ts +0 -1
- package/dist/ts3.4/server/angular-cli-webpack-older.d.ts +0 -73
- package/dist/ts3.4/server/angular-devkit-build-webpack.d.ts +0 -30
- package/dist/ts3.4/server/angular-read-workspace.d.ts +0 -13
- package/dist/ts3.4/server/build.d.ts +0 -1
- package/dist/ts3.4/server/create-fork-ts-checker-plugin.d.ts +0 -3
- package/dist/ts3.4/server/framework-preset-angular-cli.d.ts +0 -3
- package/dist/ts3.4/server/framework-preset-angular-docs.d.ts +0 -2
- package/dist/ts3.4/server/framework-preset-angular-ivy.d.ts +0 -10
- package/dist/ts3.4/server/framework-preset-angular.d.ts +0 -5
- package/dist/ts3.4/server/index.d.ts +0 -1
- package/dist/ts3.4/server/ngx-template-loader/index.d.ts +0 -1
- package/dist/ts3.4/server/options.d.ts +0 -14
- package/dist/ts3.4/server/preset.d.ts +0 -3
- package/dist/ts3.4/server/ts_config.d.ts +0 -2
- package/dist/ts3.4/server/utils/filter-out-styling-rules.d.ts +0 -2
- package/dist/ts3.4/server/utils/module-is-available.d.ts +0 -1
- package/dist/ts3.4/server/utils/normalize-optimization.d.ts +0 -3
- package/dist/ts3.4/types/index.d.ts +0 -6
- package/dist/ts3.9/builders/build-storybook/index.js +0 -65
- package/dist/ts3.9/builders/start-storybook/index.js +0 -73
- package/dist/ts3.9/client/docs/prepareForInline.d.ts +0 -7
- package/dist/ts3.9/client/docs/prepareForInline.js +0 -45
- package/dist/ts3.9/client/index.d.ts +0 -4
- package/dist/ts3.9/client/index.js +0 -28
- package/dist/ts3.9/client/preview/angular-beta/CanvasRenderer.js +0 -34
- package/dist/ts3.9/client/preview/angular-beta/DocsRenderer.js +0 -59
- package/dist/ts3.9/client/preview/angular-beta/RendererFactory.js +0 -65
- package/dist/ts3.9/client/preview/globals.d.ts +0 -1
- package/dist/ts3.9/client/preview/globals.js +0 -9
- package/dist/ts3.9/client/preview/index.js +0 -27
- package/dist/ts3.9/client/preview/render.js +0 -34
- package/dist/ts3.9/client/preview/types-7-0.d.ts +0 -9
- package/dist/ts3.9/demo/button.component.d.ts +0 -5
- package/dist/ts3.9/demo/button.component.js +0 -46
- package/dist/ts3.9/demo/welcome.component.d.ts +0 -4
- package/dist/ts3.9/demo/welcome.component.js +0 -99
- package/dist/ts3.9/public_api.d.ts +0 -1
- package/dist/ts3.9/renderer.d.ts +0 -4
- package/dist/ts3.9/server/angular-cli-webpack-12.2.x.js +0 -56
- package/dist/ts3.9/server/angular-cli-webpack-13.x.x.js +0 -60
- package/dist/ts3.9/server/angular-cli-webpack-older.d.ts +0 -73
- package/dist/ts3.9/server/angular-cli-webpack-older.js +0 -110
- package/dist/ts3.9/server/build.d.ts +0 -1
- package/dist/ts3.9/server/build.js +0 -28
- package/dist/ts3.9/server/framework-preset-angular-cli.js +0 -177
- package/dist/ts3.9/server/framework-preset-angular.js +0 -100
- package/dist/ts3.9/server/index.d.ts +0 -1
- package/dist/ts3.9/server/index.js +0 -8
- package/dist/ts3.9/server/options.js +0 -8
- package/dist/ts3.9/server/preset.d.ts +0 -3
- package/dist/ts3.9/server/preset.js +0 -13
- package/dist/ts3.9/server/utils/normalize-asset-patterns.d.ts +0 -6
- package/dist/ts3.9/types/index.d.ts +0 -6
- package/standalone.d.ts +0 -21
- package/standalone.js +0 -8
- package/types-6-0.d.ts +0 -1
- package/types-7-0.d.ts +0 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
exports.getStorybookModuleMetadata = exports.AbstractRenderer = exports.rendererFactory = exports.computesTemplateSourceFromComponent = void 0;
|
|
4
|
+
var ComputesTemplateFromComponent_1 = require("./client/angular-beta/ComputesTemplateFromComponent");
|
|
4
5
|
Object.defineProperty(exports, "computesTemplateSourceFromComponent", { enumerable: true, get: function () { return ComputesTemplateFromComponent_1.computesTemplateSourceFromComponent; } });
|
|
5
|
-
var render_1 = require("./client/
|
|
6
|
+
var render_1 = require("./client/render");
|
|
6
7
|
Object.defineProperty(exports, "rendererFactory", { enumerable: true, get: function () { return render_1.rendererFactory; } });
|
|
7
|
-
var AbstractRenderer_1 = require("./client/
|
|
8
|
+
var AbstractRenderer_1 = require("./client/angular-beta/AbstractRenderer");
|
|
8
9
|
Object.defineProperty(exports, "AbstractRenderer", { enumerable: true, get: function () { return AbstractRenderer_1.AbstractRenderer; } });
|
|
9
|
-
var StorybookModule_1 = require("./client/
|
|
10
|
+
var StorybookModule_1 = require("./client/angular-beta/StorybookModule");
|
|
10
11
|
Object.defineProperty(exports, "getStorybookModuleMetadata", { enumerable: true, get: function () { return StorybookModule_1.getStorybookModuleMetadata; } });
|
package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/empty-projects-entry/angular.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/minimal-config/src/tsconfig.app.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/some-config/src/tsconfig.app.json
RENAMED
|
File without changes
|
|
File without changes
|
package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-angularBrowserTarget/angular.json
RENAMED
|
File without changes
|
package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-angularBrowserTarget/src/main.d.ts
RENAMED
|
File without changes
|
package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-angularBrowserTarget/src/main.js
RENAMED
|
File without changes
|
|
File without changes
|
package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-angularBrowserTarget/tsconfig.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-lib/projects/pattern-lib/src/main.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-nx-workspace/src/tsconfig.app.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-options-styles/src/main.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-options-styles/src/tsconfig.app.json
RENAMED
|
File without changes
|
package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/with-options-styles/tsconfig.json
RENAMED
|
File without changes
|
package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/without-architect-build/angular.json
RENAMED
|
File without changes
|
|
File without changes
|
package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/without-compatible-projects/angular.json
RENAMED
|
File without changes
|
package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/without-projects-entry/angular.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/without-projects-entry/tsconfig.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/{ts3.9 → types}/server/__mocks-ng-workspace__/without-tsConfig/src/tsconfig.app.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// Private angular devkit stuff
|
|
2
|
+
const { generateI18nBrowserWebpackConfigFromContext, } = require('@angular-devkit/build-angular/src/utils/webpack-browser-config');
|
|
3
|
+
const { getCommonConfig, getStylesConfig, getTypeScriptConfig, } = require('@angular-devkit/build-angular/src/webpack/configs');
|
|
4
|
+
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
|
|
5
|
+
const { filterOutStylingRules } = require('./utils/filter-out-styling-rules');
|
|
6
|
+
/**
|
|
7
|
+
* Extract webpack config from angular-cli 12.2.x
|
|
8
|
+
* ⚠️ This file is in JavaScript to not use TypeScript. Because current storybook TypeScript version is not compatible with Angular CLI.
|
|
9
|
+
* FIXME: Try another way with TypeScript on future storybook version (7 maybe 🤞)
|
|
10
|
+
*
|
|
11
|
+
* @param {*} baseConfig Previous webpack config from storybook
|
|
12
|
+
* @param {*} options { builderOptions, builderContext }
|
|
13
|
+
*/
|
|
14
|
+
exports.getWebpackConfig = async (baseConfig, { builderOptions, builderContext }) => {
|
|
15
|
+
/**
|
|
16
|
+
* Get angular-cli Webpack config
|
|
17
|
+
*/
|
|
18
|
+
const { config: cliConfig } = await generateI18nBrowserWebpackConfigFromContext({
|
|
19
|
+
// Default options
|
|
20
|
+
index: 'noop-index',
|
|
21
|
+
main: 'noop-main',
|
|
22
|
+
outputPath: 'noop-out',
|
|
23
|
+
// Options provided by user
|
|
24
|
+
...builderOptions,
|
|
25
|
+
// Fixed options
|
|
26
|
+
optimization: false,
|
|
27
|
+
namedChunks: false,
|
|
28
|
+
progress: false,
|
|
29
|
+
buildOptimizer: false,
|
|
30
|
+
aot: false,
|
|
31
|
+
}, builderContext, (wco) => [getCommonConfig(wco), getStylesConfig(wco), getTypeScriptConfig(wco)]);
|
|
32
|
+
/**
|
|
33
|
+
* Merge baseConfig Webpack with angular-cli Webpack
|
|
34
|
+
*/
|
|
35
|
+
const entry = [
|
|
36
|
+
...baseConfig.entry,
|
|
37
|
+
...(cliConfig.entry.styles ?? []),
|
|
38
|
+
...(cliConfig.entry.polyfills ?? []),
|
|
39
|
+
];
|
|
40
|
+
// Don't use storybooks styling rules because we have to use rules created by @angular-devkit/build-angular
|
|
41
|
+
// because @angular-devkit/build-angular created rules have include/exclude for global style files.
|
|
42
|
+
const rulesExcludingStyles = filterOutStylingRules(baseConfig);
|
|
43
|
+
const module = {
|
|
44
|
+
...baseConfig.module,
|
|
45
|
+
rules: [...cliConfig.module.rules, ...rulesExcludingStyles],
|
|
46
|
+
};
|
|
47
|
+
const plugins = [...(cliConfig.plugins ?? []), ...baseConfig.plugins];
|
|
48
|
+
const resolve = {
|
|
49
|
+
...baseConfig.resolve,
|
|
50
|
+
modules: Array.from(new Set([...baseConfig.resolve.modules, ...cliConfig.resolve.modules])),
|
|
51
|
+
plugins: [
|
|
52
|
+
new TsconfigPathsPlugin({
|
|
53
|
+
configFile: builderOptions.tsConfig,
|
|
54
|
+
mainFields: ['browser', 'module', 'main'],
|
|
55
|
+
}),
|
|
56
|
+
],
|
|
57
|
+
};
|
|
58
|
+
return {
|
|
59
|
+
...baseConfig,
|
|
60
|
+
entry,
|
|
61
|
+
module,
|
|
62
|
+
plugins,
|
|
63
|
+
resolve,
|
|
64
|
+
resolveLoader: cliConfig.resolveLoader,
|
|
65
|
+
};
|
|
66
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// Private angular devkit stuff
|
|
2
|
+
const { generateI18nBrowserWebpackConfigFromContext, } = require('@angular-devkit/build-angular/src/utils/webpack-browser-config');
|
|
3
|
+
const { getCommonConfig, getStylesConfig, getDevServerConfig, getTypeScriptConfig, } = require('@angular-devkit/build-angular/src/webpack/configs');
|
|
4
|
+
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
|
|
5
|
+
const { filterOutStylingRules } = require('./utils/filter-out-styling-rules');
|
|
6
|
+
/**
|
|
7
|
+
* Extract webpack config from angular-cli 13.x.x
|
|
8
|
+
* ⚠️ This file is in JavaScript to not use TypeScript. Because current storybook TypeScript version is not compatible with Angular CLI.
|
|
9
|
+
* FIXME: Try another way with TypeScript on future storybook version (7 maybe 🤞)
|
|
10
|
+
*
|
|
11
|
+
* @param {*} baseConfig Previous webpack config from storybook
|
|
12
|
+
* @param {*} options { builderOptions, builderContext }
|
|
13
|
+
*/
|
|
14
|
+
exports.getWebpackConfig = async (baseConfig, { builderOptions, builderContext }) => {
|
|
15
|
+
/**
|
|
16
|
+
* Get angular-cli Webpack config
|
|
17
|
+
*/
|
|
18
|
+
const { config: cliConfig } = await generateI18nBrowserWebpackConfigFromContext({
|
|
19
|
+
// Default options
|
|
20
|
+
index: 'noop-index',
|
|
21
|
+
main: 'noop-main',
|
|
22
|
+
outputPath: 'noop-out',
|
|
23
|
+
// Options provided by user
|
|
24
|
+
...builderOptions,
|
|
25
|
+
// Fixed options
|
|
26
|
+
optimization: false,
|
|
27
|
+
namedChunks: false,
|
|
28
|
+
progress: false,
|
|
29
|
+
buildOptimizer: false,
|
|
30
|
+
aot: false,
|
|
31
|
+
}, builderContext, (wco) => [
|
|
32
|
+
getCommonConfig(wco),
|
|
33
|
+
getStylesConfig(wco),
|
|
34
|
+
getTypeScriptConfig ? getTypeScriptConfig(wco) : getDevServerConfig(wco),
|
|
35
|
+
]);
|
|
36
|
+
/**
|
|
37
|
+
* Merge baseConfig Webpack with angular-cli Webpack
|
|
38
|
+
*/
|
|
39
|
+
const entry = [
|
|
40
|
+
...baseConfig.entry,
|
|
41
|
+
...(cliConfig.entry.styles ?? []),
|
|
42
|
+
...(cliConfig.entry.polyfills ?? []),
|
|
43
|
+
];
|
|
44
|
+
// Don't use storybooks styling rules because we have to use rules created by @angular-devkit/build-angular
|
|
45
|
+
// because @angular-devkit/build-angular created rules have include/exclude for global style files.
|
|
46
|
+
const rulesExcludingStyles = filterOutStylingRules(baseConfig);
|
|
47
|
+
const module = {
|
|
48
|
+
...baseConfig.module,
|
|
49
|
+
rules: [...cliConfig.module.rules, ...rulesExcludingStyles],
|
|
50
|
+
};
|
|
51
|
+
const plugins = [...(cliConfig.plugins ?? []), ...baseConfig.plugins];
|
|
52
|
+
const resolve = {
|
|
53
|
+
...baseConfig.resolve,
|
|
54
|
+
modules: Array.from(new Set([...baseConfig.resolve.modules, ...cliConfig.resolve.modules])),
|
|
55
|
+
plugins: [
|
|
56
|
+
new TsconfigPathsPlugin({
|
|
57
|
+
configFile: builderOptions.tsConfig,
|
|
58
|
+
mainFields: ['browser', 'module', 'main'],
|
|
59
|
+
}),
|
|
60
|
+
],
|
|
61
|
+
};
|
|
62
|
+
return {
|
|
63
|
+
...baseConfig,
|
|
64
|
+
entry,
|
|
65
|
+
module,
|
|
66
|
+
plugins,
|
|
67
|
+
resolve,
|
|
68
|
+
resolveLoader: cliConfig.resolveLoader,
|
|
69
|
+
};
|
|
70
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import webpack, { Configuration } from 'webpack';
|
|
2
|
+
import type { PresetOptions } from './preset-options';
|
|
3
|
+
/**
|
|
4
|
+
* Old way currently support version lower than 12.2.x
|
|
5
|
+
*/
|
|
6
|
+
export declare function getWebpackConfig(baseConfig: webpack.Configuration, options: PresetOptions): Promise<Configuration>;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getWebpackConfig = void 0;
|
|
7
|
+
const node_logger_1 = require("@storybook/node-logger");
|
|
8
|
+
const tsconfig_paths_webpack_plugin_1 = __importDefault(require("tsconfig-paths-webpack-plugin"));
|
|
9
|
+
const architect_1 = require("@angular-devkit/architect");
|
|
10
|
+
const angular_read_workspace_1 = require("./angular-read-workspace");
|
|
11
|
+
const angular_devkit_build_webpack_1 = require("./angular-devkit-build-webpack");
|
|
12
|
+
const filter_out_styling_rules_1 = require("./utils/filter-out-styling-rules");
|
|
13
|
+
/**
|
|
14
|
+
* Old way currently support version lower than 12.2.x
|
|
15
|
+
*/
|
|
16
|
+
async function getWebpackConfig(baseConfig, options) {
|
|
17
|
+
const dirToSearch = process.cwd();
|
|
18
|
+
// Read angular workspace
|
|
19
|
+
let workspaceConfig;
|
|
20
|
+
try {
|
|
21
|
+
workspaceConfig = await (0, angular_read_workspace_1.readAngularWorkspaceConfig)(dirToSearch);
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
node_logger_1.logger.error(`=> Could not find angular workspace config (angular.json) on this path "${dirToSearch}"`);
|
|
25
|
+
node_logger_1.logger.info(`=> Fail to load angular-cli config. Using base config`);
|
|
26
|
+
return baseConfig;
|
|
27
|
+
}
|
|
28
|
+
// Find angular project target
|
|
29
|
+
let project;
|
|
30
|
+
let target;
|
|
31
|
+
let confName;
|
|
32
|
+
try {
|
|
33
|
+
// Default behavior when `angularBrowserTarget` are not explicitly defined to null
|
|
34
|
+
if (options.angularBrowserTarget !== null) {
|
|
35
|
+
const browserTarget = options.angularBrowserTarget
|
|
36
|
+
? (0, architect_1.targetFromTargetString)(options.angularBrowserTarget)
|
|
37
|
+
: {
|
|
38
|
+
configuration: undefined,
|
|
39
|
+
project: (0, angular_read_workspace_1.getDefaultProjectName)(workspaceConfig),
|
|
40
|
+
target: 'build',
|
|
41
|
+
};
|
|
42
|
+
const fondProject = (0, angular_read_workspace_1.findAngularProjectTarget)(workspaceConfig, browserTarget.project, browserTarget.target);
|
|
43
|
+
project = fondProject.project;
|
|
44
|
+
target = fondProject.target;
|
|
45
|
+
confName = browserTarget.configuration;
|
|
46
|
+
node_logger_1.logger.info(`=> Using angular project "${browserTarget.project}:${browserTarget.target}${confName ? `:${confName}` : ''}" for configuring Storybook`);
|
|
47
|
+
}
|
|
48
|
+
// Start storybook when only tsConfig is provided.
|
|
49
|
+
if (options.angularBrowserTarget === null && options.tsConfig) {
|
|
50
|
+
node_logger_1.logger.info(`=> Using default angular project with "tsConfig:${options.tsConfig}"`);
|
|
51
|
+
project = { root: '', extensions: {}, targets: undefined };
|
|
52
|
+
target = { builder: '', options: { tsConfig: options.tsConfig } };
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
node_logger_1.logger.error(`=> Could not find angular project: ${error.message}`);
|
|
57
|
+
node_logger_1.logger.info(`=> Fail to load angular-cli config. Using base config`);
|
|
58
|
+
return baseConfig;
|
|
59
|
+
}
|
|
60
|
+
// Use angular-cli to get some webpack config
|
|
61
|
+
let angularCliWebpackConfig;
|
|
62
|
+
try {
|
|
63
|
+
angularCliWebpackConfig = await (0, angular_devkit_build_webpack_1.extractAngularCliWebpackConfig)(dirToSearch, project, target, confName);
|
|
64
|
+
node_logger_1.logger.info(`=> Using angular-cli webpack config`);
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
node_logger_1.logger.error(`=> Could not get angular cli webpack config`);
|
|
68
|
+
throw error;
|
|
69
|
+
}
|
|
70
|
+
return mergeAngularCliWebpackConfig(angularCliWebpackConfig, baseConfig);
|
|
71
|
+
}
|
|
72
|
+
exports.getWebpackConfig = getWebpackConfig;
|
|
73
|
+
function mergeAngularCliWebpackConfig({ cliCommonWebpackConfig, cliStyleWebpackConfig, tsConfigPath }, baseConfig) {
|
|
74
|
+
// Don't use storybooks styling rules because we have to use rules created by @angular-devkit/build-angular
|
|
75
|
+
// because @angular-devkit/build-angular created rules have include/exclude for global style files.
|
|
76
|
+
const rulesExcludingStyles = (0, filter_out_styling_rules_1.filterOutStylingRules)(baseConfig);
|
|
77
|
+
// styleWebpackConfig.entry adds global style files to the webpack context
|
|
78
|
+
const entry = [
|
|
79
|
+
...baseConfig.entry,
|
|
80
|
+
// @ts-ignore
|
|
81
|
+
...Object.values(cliStyleWebpackConfig.entry).reduce((acc, item) => acc.concat(item), []),
|
|
82
|
+
];
|
|
83
|
+
const module = {
|
|
84
|
+
...baseConfig.module,
|
|
85
|
+
rules: [...cliStyleWebpackConfig.module.rules, ...rulesExcludingStyles],
|
|
86
|
+
};
|
|
87
|
+
// We use cliCommonConfig plugins to serve static assets files.
|
|
88
|
+
const plugins = [
|
|
89
|
+
...cliStyleWebpackConfig.plugins,
|
|
90
|
+
...cliCommonWebpackConfig.plugins,
|
|
91
|
+
...baseConfig.plugins,
|
|
92
|
+
];
|
|
93
|
+
const resolve = {
|
|
94
|
+
...baseConfig.resolve,
|
|
95
|
+
modules: Array.from(new Set([...baseConfig.resolve.modules, ...cliCommonWebpackConfig.resolve.modules])),
|
|
96
|
+
plugins: [
|
|
97
|
+
new tsconfig_paths_webpack_plugin_1.default({
|
|
98
|
+
configFile: tsConfigPath,
|
|
99
|
+
mainFields: ['browser', 'module', 'main'],
|
|
100
|
+
}),
|
|
101
|
+
],
|
|
102
|
+
};
|
|
103
|
+
return {
|
|
104
|
+
...baseConfig,
|
|
105
|
+
entry,
|
|
106
|
+
module,
|
|
107
|
+
plugins,
|
|
108
|
+
resolve,
|
|
109
|
+
resolveLoader: cliCommonWebpackConfig.resolveLoader,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
@@ -4,22 +4,22 @@
|
|
|
4
4
|
*
|
|
5
5
|
* It uses code block of angular cli to extract parts of webpack configuration
|
|
6
6
|
*/
|
|
7
|
-
import
|
|
7
|
+
import { Configuration } from 'webpack';
|
|
8
8
|
import { workspaces } from '@angular-devkit/core';
|
|
9
9
|
export declare type AngularCliWebpackConfig = {
|
|
10
10
|
cliCommonWebpackConfig: {
|
|
11
|
-
plugins:
|
|
11
|
+
plugins: Configuration['plugins'];
|
|
12
12
|
resolve: {
|
|
13
13
|
modules: string[];
|
|
14
14
|
};
|
|
15
|
-
resolveLoader:
|
|
15
|
+
resolveLoader: Configuration['resolveLoader'];
|
|
16
16
|
};
|
|
17
17
|
cliStyleWebpackConfig: {
|
|
18
|
-
entry:
|
|
18
|
+
entry: Configuration['entry'];
|
|
19
19
|
module: {
|
|
20
|
-
rules:
|
|
20
|
+
rules: Configuration['module']['rules'];
|
|
21
21
|
};
|
|
22
|
-
plugins:
|
|
22
|
+
plugins: Configuration['plugins'];
|
|
23
23
|
};
|
|
24
24
|
tsConfigPath: string;
|
|
25
25
|
};
|
|
@@ -7,7 +7,11 @@
|
|
|
7
7
|
*/
|
|
8
8
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
9
|
if (k2 === undefined) k2 = k;
|
|
10
|
-
Object.
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
11
15
|
}) : (function(o, m, k, k2) {
|
|
12
16
|
if (k2 === undefined) k2 = k;
|
|
13
17
|
o[k2] = m[k];
|
|
@@ -20,19 +24,10 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
20
24
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
21
25
|
if (mod && mod.__esModule) return mod;
|
|
22
26
|
var result = {};
|
|
23
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
27
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
24
28
|
__setModuleDefault(result, mod);
|
|
25
29
|
return result;
|
|
26
30
|
};
|
|
27
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
28
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
29
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
30
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
31
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
32
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
33
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
31
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
32
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
33
|
};
|
|
@@ -47,12 +42,12 @@ const normalize_optimization_1 = require("./utils/normalize-optimization");
|
|
|
47
42
|
const importAngularCliWebpackConfigGenerator = () => {
|
|
48
43
|
let angularWebpackConfig;
|
|
49
44
|
// First we look for webpack config according to directory structure of Angular 11
|
|
50
|
-
if (module_is_available_1.moduleIsAvailable('@angular-devkit/build-angular/src/webpack/configs')) {
|
|
45
|
+
if ((0, module_is_available_1.moduleIsAvailable)('@angular-devkit/build-angular/src/webpack/configs')) {
|
|
51
46
|
// eslint-disable-next-line global-require
|
|
52
47
|
angularWebpackConfig = require('@angular-devkit/build-angular/src/webpack/configs');
|
|
53
48
|
}
|
|
54
49
|
// We fallback on directory structure of Angular 10 (and below)
|
|
55
|
-
else if (module_is_available_1.moduleIsAvailable('@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs')) {
|
|
50
|
+
else if ((0, module_is_available_1.moduleIsAvailable)('@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs')) {
|
|
56
51
|
// eslint-disable-next-line global-require
|
|
57
52
|
angularWebpackConfig = require('@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs');
|
|
58
53
|
}
|
|
@@ -66,18 +61,18 @@ const importAngularCliWebpackConfigGenerator = () => {
|
|
|
66
61
|
};
|
|
67
62
|
const importAngularCliReadTsconfigUtil = () => {
|
|
68
63
|
// First we look for webpack config according to directory structure of Angular 11
|
|
69
|
-
if (module_is_available_1.moduleIsAvailable('@angular-devkit/build-angular/src/utils/read-tsconfig')) {
|
|
64
|
+
if ((0, module_is_available_1.moduleIsAvailable)('@angular-devkit/build-angular/src/utils/read-tsconfig')) {
|
|
70
65
|
// eslint-disable-next-line global-require
|
|
71
66
|
return require('@angular-devkit/build-angular/src/utils/read-tsconfig');
|
|
72
67
|
}
|
|
73
68
|
// We fallback on directory structure of Angular 10 (and below)
|
|
74
|
-
if (module_is_available_1.moduleIsAvailable('@angular-devkit/build-angular/src/angular-cli-files/utilities/read-tsconfig')) {
|
|
69
|
+
if ((0, module_is_available_1.moduleIsAvailable)('@angular-devkit/build-angular/src/angular-cli-files/utilities/read-tsconfig')) {
|
|
75
70
|
// eslint-disable-next-line global-require
|
|
76
71
|
return require('@angular-devkit/build-angular/src/angular-cli-files/utilities/read-tsconfig');
|
|
77
72
|
}
|
|
78
73
|
throw new Error('ReadTsconfig not found in "@angular-devkit/build-angular"');
|
|
79
74
|
};
|
|
80
|
-
const buildWebpackConfigOptions = (dirToSearch, project, target, confName) =>
|
|
75
|
+
const buildWebpackConfigOptions = async (dirToSearch, project, target, confName) => {
|
|
81
76
|
let conf = {};
|
|
82
77
|
if (confName) {
|
|
83
78
|
if (!target.configurations) {
|
|
@@ -88,65 +83,82 @@ const buildWebpackConfigOptions = (dirToSearch, project, target, confName) => __
|
|
|
88
83
|
}
|
|
89
84
|
conf = target.configurations[confName];
|
|
90
85
|
}
|
|
91
|
-
const projectBuildOptions =
|
|
86
|
+
const projectBuildOptions = { ...target.options, ...conf };
|
|
92
87
|
const requiredOptions = ['tsConfig'];
|
|
93
88
|
if (!requiredOptions.every((key) => !!projectBuildOptions[key])) {
|
|
94
89
|
throw new Error(`Missing required options in project target. Check "${requiredOptions.join(', ')}"`);
|
|
95
90
|
}
|
|
96
|
-
const workspaceRootNormalized = core_1.normalize(dirToSearch);
|
|
97
|
-
const projectRootNormalized = core_1.resolve(workspaceRootNormalized, core_1.normalize(project.root || ''));
|
|
91
|
+
const workspaceRootNormalized = (0, core_1.normalize)(dirToSearch);
|
|
92
|
+
const projectRootNormalized = (0, core_1.resolve)(workspaceRootNormalized, (0, core_1.normalize)(project.root || ''));
|
|
98
93
|
const sourceRootNormalized = project.sourceRoot
|
|
99
|
-
? core_1.resolve(workspaceRootNormalized, core_1.normalize(project.sourceRoot))
|
|
94
|
+
? (0, core_1.resolve)(workspaceRootNormalized, (0, core_1.normalize)(project.sourceRoot))
|
|
100
95
|
: undefined;
|
|
101
|
-
const tsConfigPath = path_1.default.resolve(core_1.getSystemPath(workspaceRootNormalized), projectBuildOptions.tsConfig);
|
|
102
|
-
const tsConfig = importAngularCliReadTsconfigUtil().readTsconfig(tsConfigPath);
|
|
103
|
-
const ts =
|
|
96
|
+
const tsConfigPath = path_1.default.resolve((0, core_1.getSystemPath)(workspaceRootNormalized), projectBuildOptions.tsConfig);
|
|
97
|
+
const tsConfig = await importAngularCliReadTsconfigUtil().readTsconfig(tsConfigPath);
|
|
98
|
+
const ts = await Promise.resolve().then(() => __importStar(require('typescript')));
|
|
104
99
|
const scriptTarget = tsConfig.options.target || ts.ScriptTarget.ES5;
|
|
105
|
-
const buildOptions =
|
|
100
|
+
const buildOptions = {
|
|
106
101
|
// Default options
|
|
107
|
-
budgets: [],
|
|
102
|
+
budgets: [],
|
|
103
|
+
fileReplacements: [],
|
|
104
|
+
main: '',
|
|
105
|
+
outputPath: 'dist/storybook-angular',
|
|
106
|
+
scripts: [],
|
|
107
|
+
sourceMap: {},
|
|
108
|
+
styles: [],
|
|
109
|
+
// Deleted in angular 12. Keep for compatibility with versions lower than angular 12
|
|
110
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
111
|
+
// @ts-ignore
|
|
112
|
+
lazyModules: [],
|
|
113
|
+
// Project Options
|
|
114
|
+
...projectBuildOptions,
|
|
115
|
+
assets: (0, normalize_asset_patterns_1.normalizeAssetPatterns)(projectBuildOptions.assets || [], workspaceRootNormalized, projectRootNormalized, sourceRootNormalized),
|
|
116
|
+
optimization: (0, normalize_optimization_1.normalizeOptimization)(projectBuildOptions.optimization),
|
|
108
117
|
// Forced options
|
|
109
|
-
statsJson: false,
|
|
118
|
+
statsJson: false,
|
|
119
|
+
// Deleted in angular 12. Keep for compatibility with versions lower than angular 12
|
|
120
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
121
|
+
// @ts-ignore
|
|
122
|
+
forkTypeChecker: false,
|
|
123
|
+
};
|
|
110
124
|
return {
|
|
111
|
-
|
|
125
|
+
projectName: 'this-is-just-a-fake-name-for-getting-rid-of-the-error',
|
|
126
|
+
root: (0, core_1.getSystemPath)(workspaceRootNormalized),
|
|
112
127
|
// The dependency of `@angular-devkit/build-angular` to `@angular-devkit/core` is not exactly the same version as the one for storybook (node modules of node modules ^^)
|
|
113
|
-
logger: node_1.createConsoleLogger(),
|
|
114
|
-
projectRoot: core_1.getSystemPath(projectRootNormalized),
|
|
115
|
-
sourceRoot: sourceRootNormalized ? core_1.getSystemPath(sourceRootNormalized) : undefined,
|
|
128
|
+
logger: (0, node_1.createConsoleLogger)(),
|
|
129
|
+
projectRoot: (0, core_1.getSystemPath)(projectRootNormalized),
|
|
130
|
+
sourceRoot: sourceRootNormalized ? (0, core_1.getSystemPath)(sourceRootNormalized) : undefined,
|
|
116
131
|
buildOptions,
|
|
117
132
|
tsConfig,
|
|
118
133
|
tsConfigPath,
|
|
119
134
|
scriptTarget,
|
|
120
135
|
};
|
|
121
|
-
}
|
|
136
|
+
};
|
|
122
137
|
/**
|
|
123
138
|
* Uses angular cli to extract webpack configuration.
|
|
124
139
|
* The `AngularCliWebpackConfig` type lists the parts used by storybook
|
|
125
140
|
*/
|
|
126
|
-
function extractAngularCliWebpackConfig(dirToSearch, project, target, confName) {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
resolve: {
|
|
137
|
-
modules: (_a = cliCommonConfig.resolve) === null || _a === void 0 ? void 0 : _a.modules,
|
|
138
|
-
},
|
|
139
|
-
resolveLoader: cliCommonConfig.resolveLoader,
|
|
141
|
+
async function extractAngularCliWebpackConfig(dirToSearch, project, target, confName) {
|
|
142
|
+
const { getCommonConfig, getStylesConfig } = importAngularCliWebpackConfigGenerator();
|
|
143
|
+
const webpackConfigOptions = await buildWebpackConfigOptions(dirToSearch, project, target, confName);
|
|
144
|
+
const cliCommonConfig = getCommonConfig(webpackConfigOptions);
|
|
145
|
+
const cliStyleConfig = getStylesConfig(webpackConfigOptions);
|
|
146
|
+
return {
|
|
147
|
+
cliCommonWebpackConfig: {
|
|
148
|
+
plugins: cliCommonConfig.plugins,
|
|
149
|
+
resolve: {
|
|
150
|
+
modules: cliCommonConfig.resolve?.modules,
|
|
140
151
|
},
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
152
|
+
resolveLoader: cliCommonConfig.resolveLoader,
|
|
153
|
+
},
|
|
154
|
+
cliStyleWebpackConfig: {
|
|
155
|
+
entry: cliStyleConfig.entry,
|
|
156
|
+
module: {
|
|
157
|
+
rules: [...cliStyleConfig.module.rules],
|
|
147
158
|
},
|
|
148
|
-
|
|
149
|
-
}
|
|
150
|
-
|
|
159
|
+
plugins: cliStyleConfig.plugins,
|
|
160
|
+
},
|
|
161
|
+
tsConfigPath: webpackConfigOptions.tsConfigPath,
|
|
162
|
+
};
|
|
151
163
|
}
|
|
152
164
|
exports.extractAngularCliWebpackConfig = extractAngularCliWebpackConfig;
|