@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
|
File without changes
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.findAngularProjectTarget = exports.getDefaultProjectName = exports.readAngularWorkspaceConfig = void 0;
|
|
13
4
|
const node_1 = require("@angular-devkit/core/node");
|
|
@@ -18,7 +9,7 @@ const core_1 = require("@angular-devkit/core");
|
|
|
18
9
|
* - Either from NX if it is present
|
|
19
10
|
* - Either from `@angular-devkit/core` -> https://github.com/angular/angular-cli/tree/master/packages/angular_devkit/core
|
|
20
11
|
*/
|
|
21
|
-
|
|
12
|
+
const readAngularWorkspaceConfig = async (dirToSearch) => {
|
|
22
13
|
const host = core_1.workspaces.createWorkspaceHost(new node_1.NodeJsSyncHost());
|
|
23
14
|
try {
|
|
24
15
|
/**
|
|
@@ -49,9 +40,10 @@ exports.readAngularWorkspaceConfig = (dirToSearch) => __awaiter(void 0, void 0,
|
|
|
49
40
|
catch (e) {
|
|
50
41
|
// Ignore if the client does not use NX
|
|
51
42
|
}
|
|
52
|
-
return (
|
|
53
|
-
}
|
|
54
|
-
exports.
|
|
43
|
+
return (await core_1.workspaces.readWorkspace(dirToSearch, host)).workspace;
|
|
44
|
+
};
|
|
45
|
+
exports.readAngularWorkspaceConfig = readAngularWorkspaceConfig;
|
|
46
|
+
const getDefaultProjectName = (workspace) => {
|
|
55
47
|
const environmentProjectName = process.env.STORYBOOK_ANGULAR_PROJECT;
|
|
56
48
|
if (environmentProjectName) {
|
|
57
49
|
return environmentProjectName;
|
|
@@ -68,7 +60,8 @@ exports.getDefaultProjectName = (workspace) => {
|
|
|
68
60
|
}
|
|
69
61
|
throw new Error('No angular projects found');
|
|
70
62
|
};
|
|
71
|
-
exports.
|
|
63
|
+
exports.getDefaultProjectName = getDefaultProjectName;
|
|
64
|
+
const findAngularProjectTarget = (workspace, projectName, targetName) => {
|
|
72
65
|
if (!workspace.projects || !Object.keys(workspace.projects).length) {
|
|
73
66
|
throw new Error('No angular projects found');
|
|
74
67
|
}
|
|
@@ -82,3 +75,4 @@ exports.findAngularProjectTarget = (workspace, projectName, targetName) => {
|
|
|
82
75
|
const target = project.targets.get(targetName);
|
|
83
76
|
return { project, target };
|
|
84
77
|
};
|
|
78
|
+
exports.findAngularProjectTarget = findAngularProjectTarget;
|
|
File without changes
|
|
@@ -9,7 +9,7 @@ const node_logger_1 = require("@storybook/node-logger");
|
|
|
9
9
|
function default_1(tsLoaderOptions) {
|
|
10
10
|
if (tsLoaderOptions && tsLoaderOptions.configFile) {
|
|
11
11
|
return new fork_ts_checker_webpack_plugin_1.default({
|
|
12
|
-
|
|
12
|
+
typescript: { configFile: tsLoaderOptions.configFile },
|
|
13
13
|
async: true,
|
|
14
14
|
});
|
|
15
15
|
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.webpackFinal = void 0;
|
|
30
|
+
const node_logger_1 = require("@storybook/node-logger");
|
|
31
|
+
const architect_1 = require("@angular-devkit/architect");
|
|
32
|
+
const find_up_1 = require("find-up");
|
|
33
|
+
const semver_1 = __importDefault(require("@storybook/semver"));
|
|
34
|
+
const ts_dedent_1 = __importDefault(require("ts-dedent"));
|
|
35
|
+
const core_1 = require("@angular-devkit/core");
|
|
36
|
+
const module_is_available_1 = require("./utils/module-is-available");
|
|
37
|
+
const angular_cli_webpack_12_2_x_1 = require("./angular-cli-webpack-12.2.x");
|
|
38
|
+
const angular_cli_webpack_13_x_x_1 = require("./angular-cli-webpack-13.x.x");
|
|
39
|
+
const angular_cli_webpack_older_1 = require("./angular-cli-webpack-older");
|
|
40
|
+
const angular_read_workspace_1 = require("./angular-read-workspace");
|
|
41
|
+
async function webpackFinal(baseConfig, options) {
|
|
42
|
+
if (!(0, module_is_available_1.moduleIsAvailable)('@angular-devkit/build-angular')) {
|
|
43
|
+
node_logger_1.logger.info('=> Using base config because "@angular-devkit/build-angular" is not installed');
|
|
44
|
+
return baseConfig;
|
|
45
|
+
}
|
|
46
|
+
const angularCliVersion = await Promise.resolve().then(() => __importStar(require('@angular/cli'))).then((m) => semver_1.default.coerce(m.VERSION.full));
|
|
47
|
+
/**
|
|
48
|
+
* Ordered array to use the specific getWebpackConfig according to some condition like angular-cli version
|
|
49
|
+
*/
|
|
50
|
+
const webpackGetterByVersions = [
|
|
51
|
+
{
|
|
52
|
+
info: '=> Loading angular-cli config for angular >= 13.0.0',
|
|
53
|
+
condition: semver_1.default.satisfies(angularCliVersion, '>=13.0.0'),
|
|
54
|
+
getWebpackConfig: async (_baseConfig, _options) => {
|
|
55
|
+
const builderContext = getBuilderContext(_options);
|
|
56
|
+
const builderOptions = await getBuilderOptions(_options, builderContext);
|
|
57
|
+
const legacyDefaultOptions = await getLegacyDefaultBuildOptions(_options);
|
|
58
|
+
return (0, angular_cli_webpack_13_x_x_1.getWebpackConfig)(_baseConfig, {
|
|
59
|
+
builderOptions: {
|
|
60
|
+
watch: options.configType === 'DEVELOPMENT',
|
|
61
|
+
...legacyDefaultOptions,
|
|
62
|
+
...builderOptions,
|
|
63
|
+
},
|
|
64
|
+
builderContext,
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
info: '=> Loading angular-cli config for angular 12.2.x',
|
|
70
|
+
condition: semver_1.default.satisfies(angularCliVersion, '12.2.x') && options.angularBuilderContext,
|
|
71
|
+
getWebpackConfig: async (_baseConfig, _options) => {
|
|
72
|
+
const builderContext = getBuilderContext(_options);
|
|
73
|
+
const builderOptions = await getBuilderOptions(_options, builderContext);
|
|
74
|
+
return (0, angular_cli_webpack_12_2_x_1.getWebpackConfig)(_baseConfig, {
|
|
75
|
+
builderOptions,
|
|
76
|
+
builderContext,
|
|
77
|
+
});
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
info: '=> Loading angular-cli config for angular lower than 12.2.0',
|
|
82
|
+
condition: true,
|
|
83
|
+
getWebpackConfig: angular_cli_webpack_older_1.getWebpackConfig,
|
|
84
|
+
},
|
|
85
|
+
];
|
|
86
|
+
const webpackGetter = webpackGetterByVersions.find((wg) => wg.condition);
|
|
87
|
+
node_logger_1.logger.info(webpackGetter.info);
|
|
88
|
+
return Promise.resolve(webpackGetter.getWebpackConfig(baseConfig, options));
|
|
89
|
+
}
|
|
90
|
+
exports.webpackFinal = webpackFinal;
|
|
91
|
+
/**
|
|
92
|
+
* Get Builder Context
|
|
93
|
+
* If storybook is not start by angular builder create dumb BuilderContext
|
|
94
|
+
*/
|
|
95
|
+
function getBuilderContext(options) {
|
|
96
|
+
return (options.angularBuilderContext ??
|
|
97
|
+
{
|
|
98
|
+
target: { project: 'noop-project', builder: '', options: {} },
|
|
99
|
+
workspaceRoot: process.cwd(),
|
|
100
|
+
getProjectMetadata: () => ({}),
|
|
101
|
+
getTargetOptions: () => ({}),
|
|
102
|
+
logger: new core_1.logging.Logger('Storybook'),
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Get builder options
|
|
107
|
+
* Merge target options from browser target and from storybook options
|
|
108
|
+
*/
|
|
109
|
+
async function getBuilderOptions(options, builderContext) {
|
|
110
|
+
/**
|
|
111
|
+
* Get Browser Target options
|
|
112
|
+
*/
|
|
113
|
+
let browserTargetOptions = {};
|
|
114
|
+
if (options.angularBrowserTarget) {
|
|
115
|
+
const browserTarget = (0, architect_1.targetFromTargetString)(options.angularBrowserTarget);
|
|
116
|
+
node_logger_1.logger.info(`=> Using angular browser target options from "${browserTarget.project}:${browserTarget.target}${browserTarget.configuration ? `:${browserTarget.configuration}` : ''}"`);
|
|
117
|
+
browserTargetOptions = await builderContext.getTargetOptions(browserTarget);
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Merge target options from browser target options and from storybook options
|
|
121
|
+
*/
|
|
122
|
+
const builderOptions = {
|
|
123
|
+
...browserTargetOptions,
|
|
124
|
+
...options.angularBuilderOptions,
|
|
125
|
+
tsConfig: options.tsConfig ??
|
|
126
|
+
(0, find_up_1.sync)('tsconfig.json', { cwd: options.configDir }) ??
|
|
127
|
+
browserTargetOptions.tsConfig,
|
|
128
|
+
};
|
|
129
|
+
node_logger_1.logger.info(`=> Using angular project with "tsConfig:${builderOptions.tsConfig}"`);
|
|
130
|
+
return builderOptions;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Get options from legacy way
|
|
134
|
+
* /!\ This is only for backward compatibility and would be removed on Storybook 7.0
|
|
135
|
+
* only work for angular.json with [defaultProject].build or "storybook.build" config
|
|
136
|
+
*/
|
|
137
|
+
async function getLegacyDefaultBuildOptions(options) {
|
|
138
|
+
if (options.angularBrowserTarget !== undefined) {
|
|
139
|
+
// Not use legacy way with builder (`angularBrowserTarget` is defined or null with builder and undefined without)
|
|
140
|
+
return {};
|
|
141
|
+
}
|
|
142
|
+
node_logger_1.logger.warn((0, ts_dedent_1.default) `Your Storybook startup uses a solution that will not be supported in version 7.0.
|
|
143
|
+
You must use angular builder to have an explicit configuration on the project used in angular.json
|
|
144
|
+
Read more at:
|
|
145
|
+
- https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#sb-angular-builder)
|
|
146
|
+
- https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#angular13)
|
|
147
|
+
`);
|
|
148
|
+
const dirToSearch = process.cwd();
|
|
149
|
+
// Read angular workspace
|
|
150
|
+
let workspaceConfig;
|
|
151
|
+
try {
|
|
152
|
+
workspaceConfig = await (0, angular_read_workspace_1.readAngularWorkspaceConfig)(dirToSearch);
|
|
153
|
+
}
|
|
154
|
+
catch (error) {
|
|
155
|
+
node_logger_1.logger.error(`=> Could not find angular workspace config (angular.json) on this path "${dirToSearch}"`);
|
|
156
|
+
node_logger_1.logger.info(`=> Fail to load angular-cli config. Using base config`);
|
|
157
|
+
return {};
|
|
158
|
+
}
|
|
159
|
+
// Find angular project target
|
|
160
|
+
try {
|
|
161
|
+
const browserTarget = {
|
|
162
|
+
configuration: undefined,
|
|
163
|
+
project: (0, angular_read_workspace_1.getDefaultProjectName)(workspaceConfig),
|
|
164
|
+
target: 'build',
|
|
165
|
+
};
|
|
166
|
+
const { target } = (0, angular_read_workspace_1.findAngularProjectTarget)(workspaceConfig, browserTarget.project, browserTarget.target);
|
|
167
|
+
node_logger_1.logger.info(`=> Using angular project "${browserTarget.project}:${browserTarget.target}" for configuring Storybook`);
|
|
168
|
+
return { ...target.options };
|
|
169
|
+
}
|
|
170
|
+
catch (error) {
|
|
171
|
+
node_logger_1.logger.error(`=> Could not find angular project: ${error.message}`);
|
|
172
|
+
node_logger_1.logger.info(`=> Fail to load angular-cli config. Using base config`);
|
|
173
|
+
return {};
|
|
174
|
+
}
|
|
175
|
+
}
|
|
File without changes
|
|
@@ -6,8 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.previewAnnotations = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
8
|
const docs_tools_1 = require("@storybook/docs-tools");
|
|
9
|
-
|
|
10
|
-
if (!docs_tools_1.hasDocsOrControls(options))
|
|
9
|
+
const previewAnnotations = (entry = [], options) => {
|
|
10
|
+
if (!(0, docs_tools_1.hasDocsOrControls)(options))
|
|
11
11
|
return entry;
|
|
12
|
-
return [...entry, path_1.default.join(__dirname, '../../../dist/
|
|
12
|
+
return [...entry, path_1.default.join(__dirname, '../../../dist/types/client/docs/config')];
|
|
13
13
|
};
|
|
14
|
+
exports.previewAnnotations = previewAnnotations;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Configuration } from 'webpack';
|
|
2
|
-
import { PresetOptions } from './options';
|
|
2
|
+
import type { PresetOptions } from './preset-options';
|
|
3
3
|
/**
|
|
4
4
|
* Run ngcc for converting modules to ivy format before starting storybook
|
|
5
5
|
* This step is needed in order to support Ivy in storybook
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -14,19 +18,10 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
14
18
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
19
|
if (mod && mod.__esModule) return mod;
|
|
16
20
|
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
22
|
__setModuleDefault(result, mod);
|
|
19
23
|
return result;
|
|
20
24
|
};
|
|
21
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
26
|
exports.webpack = exports.runNgcc = void 0;
|
|
32
27
|
const path = __importStar(require("path"));
|
|
@@ -53,13 +48,13 @@ function loadEsmModule(modulePath) {
|
|
|
53
48
|
*
|
|
54
49
|
* Information about Ivy can be found here https://angular.io/guide/ivy
|
|
55
50
|
*/
|
|
56
|
-
|
|
51
|
+
const runNgcc = async () => {
|
|
57
52
|
let ngcc;
|
|
58
53
|
try {
|
|
59
|
-
ngcc =
|
|
54
|
+
ngcc = await Promise.resolve().then(() => __importStar(require('@angular/compiler-cli/ngcc')));
|
|
60
55
|
}
|
|
61
56
|
catch (error) {
|
|
62
|
-
ngcc =
|
|
57
|
+
ngcc = await loadEsmModule('@angular/compiler-cli/ngcc');
|
|
63
58
|
}
|
|
64
59
|
ngcc.process({
|
|
65
60
|
// should be async: true but does not work due to
|
|
@@ -67,17 +62,23 @@ exports.runNgcc = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
67
62
|
async: false,
|
|
68
63
|
basePath: path.join(process.cwd(), 'node_modules'),
|
|
69
64
|
createNewEntryPointFormats: true,
|
|
70
|
-
compileAllFormats: false,
|
|
65
|
+
compileAllFormats: false, // --first-only
|
|
71
66
|
});
|
|
72
|
-
}
|
|
73
|
-
exports.
|
|
74
|
-
|
|
67
|
+
};
|
|
68
|
+
exports.runNgcc = runNgcc;
|
|
69
|
+
const webpack = async (webpackConfig, options) => {
|
|
70
|
+
const framework = await options.presets.apply('framework');
|
|
71
|
+
const angularOptions = (typeof framework === 'object' ? framework.options : {});
|
|
75
72
|
// Default to true, if undefined
|
|
76
73
|
if (angularOptions.enableIvy === false) {
|
|
77
74
|
return webpackConfig;
|
|
78
75
|
}
|
|
79
|
-
exports.runNgcc();
|
|
80
|
-
return
|
|
76
|
+
(0, exports.runNgcc)();
|
|
77
|
+
return {
|
|
78
|
+
...webpackConfig,
|
|
79
|
+
resolve: {
|
|
80
|
+
...webpackConfig.resolve,
|
|
81
|
+
mainFields: [
|
|
81
82
|
'es2015_ivy_ngcc',
|
|
82
83
|
'module_ivy_ngcc',
|
|
83
84
|
'main_ivy_ngcc',
|
|
@@ -85,5 +86,8 @@ exports.webpack = (webpackConfig, options) => __awaiter(void 0, void 0, void 0,
|
|
|
85
86
|
'browser',
|
|
86
87
|
'module',
|
|
87
88
|
'main',
|
|
88
|
-
]
|
|
89
|
-
}
|
|
89
|
+
],
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
exports.webpack = webpack;
|
|
File without changes
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.webpack = void 0;
|
|
30
|
+
const path_1 = __importDefault(require("path"));
|
|
31
|
+
const semver_1 = __importDefault(require("@storybook/semver"));
|
|
32
|
+
const webpack_1 = require("webpack");
|
|
33
|
+
const autoprefixer_1 = __importDefault(require("autoprefixer"));
|
|
34
|
+
const ts_config_1 = __importDefault(require("./ts_config"));
|
|
35
|
+
const create_fork_ts_checker_plugin_1 = __importDefault(require("./create-fork-ts-checker-plugin"));
|
|
36
|
+
async function webpack(config, { configDir, angularBuilderContext }) {
|
|
37
|
+
try {
|
|
38
|
+
// Disable all this webpack stuff if we use angular-cli >= 12
|
|
39
|
+
// Angular cli is in charge of doing all the necessary for angular. If there is any additional configuration to add, it must be done in the preset angular-cli versioned.
|
|
40
|
+
const angularCliVersion = await Promise.resolve().then(() => __importStar(require('@angular/cli'))).then((m) => semver_1.default.coerce(m.VERSION.full));
|
|
41
|
+
if ((semver_1.default.satisfies(angularCliVersion, '12.2.x') && angularBuilderContext) ||
|
|
42
|
+
semver_1.default.satisfies(angularCliVersion, '>=13.0.0')) {
|
|
43
|
+
return config;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
// do nothing, continue
|
|
48
|
+
}
|
|
49
|
+
const tsLoaderOptions = (0, ts_config_1.default)(configDir);
|
|
50
|
+
return {
|
|
51
|
+
...config,
|
|
52
|
+
module: {
|
|
53
|
+
...config.module,
|
|
54
|
+
rules: [
|
|
55
|
+
...config.module.rules,
|
|
56
|
+
{
|
|
57
|
+
test: /\.tsx?$/,
|
|
58
|
+
use: [
|
|
59
|
+
{
|
|
60
|
+
loader: require.resolve('ts-loader'),
|
|
61
|
+
options: tsLoaderOptions,
|
|
62
|
+
},
|
|
63
|
+
{ loader: path_1.default.resolve(__dirname, 'ngx-template-loader') },
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
test: /[/\\]@angular[/\\]core[/\\].+\.js$/,
|
|
68
|
+
parser: { system: false },
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
test: /\.html$/,
|
|
72
|
+
loader: require.resolve('raw-loader'),
|
|
73
|
+
exclude: /\.async\.html$/,
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
test: /\.s(c|a)ss$/,
|
|
77
|
+
use: [
|
|
78
|
+
{ loader: require.resolve('raw-loader') },
|
|
79
|
+
{
|
|
80
|
+
loader: require.resolve('postcss-loader'),
|
|
81
|
+
options: {
|
|
82
|
+
postcssOptions: {
|
|
83
|
+
plugins: [(0, autoprefixer_1.default)()],
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
{ loader: require.resolve('sass-loader') },
|
|
88
|
+
],
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
},
|
|
92
|
+
resolve: {
|
|
93
|
+
...config.resolve,
|
|
94
|
+
},
|
|
95
|
+
plugins: [
|
|
96
|
+
...config.plugins,
|
|
97
|
+
// See https://github.com/angular/angular/issues/11580#issuecomment-401127742
|
|
98
|
+
new webpack_1.ContextReplacementPlugin(/@angular(\\|\/)core(\\|\/)(fesm5|bundles)/, path_1.default.resolve(__dirname, '..')),
|
|
99
|
+
(0, create_fork_ts_checker_plugin_1.default)(tsLoaderOptions),
|
|
100
|
+
],
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
exports.webpack = webpack;
|
|
File without changes
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Options as CoreOptions } from '@storybook/core-common';
|
|
2
2
|
import { BuilderContext } from '@angular-devkit/architect';
|
|
3
3
|
import { ExtraEntryPoint, StylePreprocessorOptions } from '@angular-devkit/build-angular';
|
|
4
4
|
export declare type PresetOptions = CoreOptions & {
|
|
@@ -10,5 +10,3 @@ export declare type PresetOptions = CoreOptions & {
|
|
|
10
10
|
angularBuilderContext?: BuilderContext | null;
|
|
11
11
|
tsConfig?: string;
|
|
12
12
|
};
|
|
13
|
-
declare const _default: LoadOptions;
|
|
14
|
-
export default _default;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -11,6 +11,7 @@ const isStylingRule = (rule) => {
|
|
|
11
11
|
}
|
|
12
12
|
return test.test('.css') || test.test('.scss') || test.test('.sass');
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
const filterOutStylingRules = (config) => {
|
|
15
15
|
return config.module.rules.filter((rule) => !isStylingRule(rule));
|
|
16
16
|
};
|
|
17
|
+
exports.filterOutStylingRules = filterOutStylingRules;
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.moduleIsAvailable = void 0;
|
|
4
|
-
|
|
4
|
+
const moduleIsAvailable = (moduleName) => {
|
|
5
5
|
try {
|
|
6
6
|
require.resolve(moduleName);
|
|
7
7
|
return true;
|
|
@@ -10,3 +10,4 @@ exports.moduleIsAvailable = (moduleName) => {
|
|
|
10
10
|
return false;
|
|
11
11
|
}
|
|
12
12
|
};
|
|
13
|
+
exports.moduleIsAvailable = moduleIsAvailable;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { BaseException, Path } from '@angular-devkit/core';
|
|
2
|
-
import { AssetPattern
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { BaseException, Path } from '@angular-devkit/core';
|
|
2
|
+
import { AssetPattern } from '@angular-devkit/build-angular';
|
|
3
|
+
import { AssetPatternClass } from '@angular-devkit/build-angular/src/builders/browser/schema';
|
|
4
|
+
export declare class MissingAssetSourceRootException extends BaseException {
|
|
5
|
+
constructor(path: string);
|
|
6
|
+
}
|
|
7
|
+
export declare function normalizeAssetPatterns(assetPatterns: AssetPattern[], root: Path, projectRoot: Path, maybeSourceRoot: Path | undefined): AssetPatternClass[];
|
|
@@ -17,16 +17,16 @@ class MissingAssetSourceRootException extends core_1.BaseException {
|
|
|
17
17
|
exports.MissingAssetSourceRootException = MissingAssetSourceRootException;
|
|
18
18
|
function normalizeAssetPatterns(assetPatterns, root, projectRoot, maybeSourceRoot) {
|
|
19
19
|
// When sourceRoot is not available, we default to ${projectRoot}/src.
|
|
20
|
-
const sourceRoot = maybeSourceRoot || core_1.join(projectRoot, 'src');
|
|
21
|
-
const resolvedSourceRoot = core_1.resolve(root, sourceRoot);
|
|
20
|
+
const sourceRoot = maybeSourceRoot || (0, core_1.join)(projectRoot, 'src');
|
|
21
|
+
const resolvedSourceRoot = (0, core_1.resolve)(root, sourceRoot);
|
|
22
22
|
if (assetPatterns.length === 0) {
|
|
23
23
|
return [];
|
|
24
24
|
}
|
|
25
25
|
return assetPatterns.map((assetPattern) => {
|
|
26
26
|
// Normalize string asset patterns to objects.
|
|
27
27
|
if (typeof assetPattern === 'string') {
|
|
28
|
-
const assetPath = core_1.normalize(assetPattern);
|
|
29
|
-
const resolvedAssetPath = core_1.resolve(root, assetPath);
|
|
28
|
+
const assetPath = (0, core_1.normalize)(assetPattern);
|
|
29
|
+
const resolvedAssetPath = (0, core_1.resolve)(root, assetPath);
|
|
30
30
|
// Check if the string asset is within sourceRoot.
|
|
31
31
|
if (!resolvedAssetPath.startsWith(resolvedSourceRoot)) {
|
|
32
32
|
throw new MissingAssetSourceRootException(assetPattern);
|
|
@@ -35,9 +35,9 @@ function normalizeAssetPatterns(assetPatterns, root, projectRoot, maybeSourceRoo
|
|
|
35
35
|
let input;
|
|
36
36
|
let isDirectory = false;
|
|
37
37
|
try {
|
|
38
|
-
isDirectory = fs_1.statSync(core_1.getSystemPath(resolvedAssetPath)).isDirectory();
|
|
38
|
+
isDirectory = (0, fs_1.statSync)((0, core_1.getSystemPath)(resolvedAssetPath)).isDirectory();
|
|
39
39
|
}
|
|
40
|
-
catch
|
|
40
|
+
catch {
|
|
41
41
|
isDirectory = true;
|
|
42
42
|
}
|
|
43
43
|
if (isDirectory) {
|
|
@@ -48,12 +48,12 @@ function normalizeAssetPatterns(assetPatterns, root, projectRoot, maybeSourceRoo
|
|
|
48
48
|
}
|
|
49
49
|
else {
|
|
50
50
|
// Files are their own glob.
|
|
51
|
-
glob = core_1.basename(assetPath);
|
|
51
|
+
glob = (0, core_1.basename)(assetPath);
|
|
52
52
|
// Input directory is their original dirname.
|
|
53
|
-
input = core_1.dirname(assetPath);
|
|
53
|
+
input = (0, core_1.dirname)(assetPath);
|
|
54
54
|
}
|
|
55
55
|
// Output directory for both is the relative path from source root to input.
|
|
56
|
-
const output = core_1.relative(resolvedSourceRoot, core_1.resolve(root, input));
|
|
56
|
+
const output = (0, core_1.relative)(resolvedSourceRoot, (0, core_1.resolve)(root, input));
|
|
57
57
|
// Return the asset pattern in object format.
|
|
58
58
|
return { glob, input, output };
|
|
59
59
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { OptimizationUnion } from '@angular-devkit/build-angular
|
|
1
|
+
import { OptimizationUnion } from '@angular-devkit/build-angular';
|
|
2
2
|
import { NormalizedOptimizationOptions } from '@angular-devkit/build-angular/src/utils/normalize-optimization';
|
|
3
3
|
export declare const normalizeOptimization: (options: OptimizationUnion) => NormalizedOptimizationOptions;
|
|
@@ -5,16 +5,17 @@ const module_is_available_1 = require("./module-is-available");
|
|
|
5
5
|
const importAngularCliNormalizeOptimization = () => {
|
|
6
6
|
// First we look for webpack config according to directory structure of Angular
|
|
7
7
|
// present since the version 7.2.0
|
|
8
|
-
if (module_is_available_1.moduleIsAvailable('@angular-devkit/build-angular/src/utils/normalize-optimization')) {
|
|
8
|
+
if ((0, module_is_available_1.moduleIsAvailable)('@angular-devkit/build-angular/src/utils/normalize-optimization')) {
|
|
9
9
|
// eslint-disable-next-line global-require
|
|
10
10
|
return require('@angular-devkit/build-angular/src/utils/normalize-optimization');
|
|
11
11
|
}
|
|
12
12
|
return undefined;
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
const normalizeOptimization = (options) => {
|
|
15
15
|
if (importAngularCliNormalizeOptimization()) {
|
|
16
16
|
return importAngularCliNormalizeOptimization().normalizeOptimization(options);
|
|
17
17
|
}
|
|
18
18
|
// Best effort to stay compatible with 6.1.*
|
|
19
19
|
return options;
|
|
20
20
|
};
|
|
21
|
+
exports.normalizeOptimization = normalizeOptimization;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { StorybookConfig as StorybookConfigBase, TypescriptOptions as TypescriptOptionsReact } from '@storybook/core-webpack';
|
|
2
|
+
import type { StorybookConfigWebpack, BuilderOptions, TypescriptOptions as TypescriptOptionsBuilder } from '@storybook/builder-webpack5';
|
|
3
|
+
declare type FrameworkName = '@storybook/angular';
|
|
4
|
+
declare type BuilderName = '@storybook/builder-webpack5';
|
|
5
|
+
export declare type FrameworkOptions = AngularOptions & {
|
|
6
|
+
builder?: BuilderOptions;
|
|
7
|
+
};
|
|
8
|
+
declare type StorybookConfigFramework = {
|
|
9
|
+
framework: FrameworkName | {
|
|
10
|
+
name: FrameworkName;
|
|
11
|
+
options: FrameworkOptions;
|
|
12
|
+
};
|
|
13
|
+
core?: StorybookConfigBase['core'] & {
|
|
14
|
+
builder?: BuilderName | {
|
|
15
|
+
name: BuilderName;
|
|
16
|
+
options: BuilderOptions;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
typescript?: Partial<TypescriptOptionsBuilder & TypescriptOptionsReact> & StorybookConfigBase['typescript'];
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* The interface for Storybook configuration in `main.ts` files.
|
|
23
|
+
*/
|
|
24
|
+
export declare type StorybookConfig = Omit<StorybookConfigBase, keyof StorybookConfigWebpack | keyof StorybookConfigFramework> & StorybookConfigWebpack & StorybookConfigFramework;
|
|
25
|
+
export interface AngularOptions {
|
|
26
|
+
enableIvy: boolean;
|
|
27
|
+
}
|
|
28
|
+
export {};
|