@servicetitan/startup 36.4.0 → 37.0.1
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/bin/analyze.js +3 -0
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +4 -5
- package/dist/cli/commands/build.js.map +1 -1
- package/dist/cli/commands/bundle-vite.d.ts.map +1 -1
- package/dist/cli/commands/bundle-vite.js +18 -1
- package/dist/cli/commands/bundle-vite.js.map +1 -1
- package/dist/cli/commands/registry/build.d.ts +6 -0
- package/dist/cli/commands/registry/build.d.ts.map +1 -1
- package/dist/cli/commands/registry/build.js +10 -1
- package/dist/cli/commands/registry/build.js.map +1 -1
- package/dist/cli/commands/registry/command-registry.d.ts +12 -28
- package/dist/cli/commands/registry/command-registry.d.ts.map +1 -1
- package/dist/cli/commands/registry/command-registry.js +0 -3
- package/dist/cli/commands/registry/command-registry.js.map +1 -1
- package/dist/cli/commands/registry/start.d.ts +6 -0
- package/dist/cli/commands/registry/start.d.ts.map +1 -1
- package/dist/cli/commands/registry/start.js +10 -1
- package/dist/cli/commands/registry/start.js.map +1 -1
- package/dist/cli/commands/review/rules/index.d.ts.map +1 -1
- package/dist/cli/commands/review/rules/index.js +2 -0
- package/dist/cli/commands/review/rules/index.js.map +1 -1
- package/dist/cli/commands/review/rules/require-compatible-typescript.d.ts +13 -0
- package/dist/cli/commands/review/rules/require-compatible-typescript.d.ts.map +1 -0
- package/dist/cli/commands/review/rules/require-compatible-typescript.js +72 -0
- package/dist/cli/commands/review/rules/require-compatible-typescript.js.map +1 -0
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +3 -4
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/test/runners/vitest.d.ts.map +1 -1
- package/dist/cli/commands/test/runners/vitest.js +7 -1
- package/dist/cli/commands/test/runners/vitest.js.map +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/utils/get-bundle-command.d.ts +3 -0
- package/dist/cli/utils/get-bundle-command.d.ts.map +1 -0
- package/dist/cli/utils/get-bundle-command.js +16 -0
- package/dist/cli/utils/get-bundle-command.js.map +1 -0
- package/dist/cli/utils/get-exit-code.d.ts +12 -0
- package/dist/cli/utils/get-exit-code.d.ts.map +1 -0
- package/dist/cli/utils/get-exit-code.js +26 -0
- package/dist/cli/utils/get-exit-code.js.map +1 -0
- package/dist/cli/utils/index.d.ts +3 -0
- package/dist/cli/utils/index.d.ts.map +1 -1
- package/dist/cli/utils/index.js +3 -0
- package/dist/cli/utils/index.js.map +1 -1
- package/dist/cli/utils/resolve-bundler.d.ts +8 -0
- package/dist/cli/utils/resolve-bundler.d.ts.map +1 -0
- package/dist/cli/utils/resolve-bundler.js +24 -0
- package/dist/cli/utils/resolve-bundler.js.map +1 -0
- package/dist/core/bundle-report.d.ts +4 -0
- package/dist/core/bundle-report.d.ts.map +1 -0
- package/dist/core/bundle-report.js +43 -0
- package/dist/core/bundle-report.js.map +1 -0
- package/dist/core/check-resource/check-resource.d.ts +5 -3
- package/dist/core/check-resource/check-resource.d.ts.map +1 -1
- package/dist/core/check-resource/check-resource.js +20 -13
- package/dist/core/check-resource/check-resource.js.map +1 -1
- package/dist/core/check-resource/get-peer-dependency-meta.d.ts +11 -1
- package/dist/core/check-resource/get-peer-dependency-meta.d.ts.map +1 -1
- package/dist/core/check-resource/get-peer-dependency-meta.js +58 -2
- package/dist/core/check-resource/get-peer-dependency-meta.js.map +1 -1
- package/dist/core/check-resource/index.d.ts +1 -1
- package/dist/core/check-resource/index.d.ts.map +1 -1
- package/dist/core/check-resource/index.js.map +1 -1
- package/dist/core/check-resource/is-resolvable.d.ts +7 -0
- package/dist/core/check-resource/is-resolvable.d.ts.map +1 -0
- package/dist/core/check-resource/is-resolvable.js +31 -0
- package/dist/core/check-resource/is-resolvable.js.map +1 -0
- package/dist/core/check-resource/types.d.ts +1 -0
- package/dist/core/check-resource/types.d.ts.map +1 -1
- package/dist/core/chunk-patterns.d.ts +7 -0
- package/dist/core/chunk-patterns.d.ts.map +1 -0
- package/dist/core/chunk-patterns.js +37 -0
- package/dist/core/chunk-patterns.js.map +1 -0
- package/dist/core/create-build-context.d.ts +0 -1
- package/dist/core/create-build-context.d.ts.map +1 -1
- package/dist/core/create-build-context.js +2 -2
- package/dist/core/create-build-context.js.map +1 -1
- package/dist/core/create-extension-regexp.d.ts +5 -0
- package/dist/core/create-extension-regexp.d.ts.map +1 -0
- package/dist/core/create-extension-regexp.js +45 -0
- package/dist/core/create-extension-regexp.js.map +1 -0
- package/dist/core/get-process-env.d.ts +3 -0
- package/dist/core/get-process-env.d.ts.map +1 -0
- package/dist/core/get-process-env.js +25 -0
- package/dist/core/get-process-env.js.map +1 -0
- package/dist/core/index.d.ts +8 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +8 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/moment-locales.d.ts +2 -0
- package/dist/core/moment-locales.d.ts.map +1 -0
- package/dist/core/moment-locales.js +21 -0
- package/dist/core/moment-locales.js.map +1 -0
- package/dist/core/resolve-output-path.d.ts +3 -0
- package/dist/core/resolve-output-path.d.ts.map +1 -0
- package/dist/core/resolve-output-path.js +25 -0
- package/dist/core/resolve-output-path.js.map +1 -0
- package/dist/core/resolve-output-root.d.ts +3 -0
- package/dist/core/resolve-output-root.d.ts.map +1 -0
- package/dist/core/resolve-output-root.js +23 -0
- package/dist/core/resolve-output-root.js.map +1 -0
- package/dist/core/sort-shared-css.d.ts +2 -0
- package/dist/core/sort-shared-css.d.ts.map +1 -0
- package/dist/core/sort-shared-css.js +20 -0
- package/dist/core/sort-shared-css.js.map +1 -0
- package/dist/core/types.d.ts +1 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/cypress/config/index.d.ts +1 -0
- package/dist/cypress/config/index.d.ts.map +1 -1
- package/dist/cypress/config/index.js +1 -0
- package/dist/cypress/config/index.js.map +1 -1
- package/dist/cypress/config/vite-config.d.ts +3 -0
- package/dist/cypress/config/vite-config.d.ts.map +1 -0
- package/dist/cypress/config/vite-config.js +58 -0
- package/dist/cypress/config/vite-config.js.map +1 -0
- package/dist/jest/resolver.d.ts.map +1 -1
- package/dist/jest/resolver.js +20 -1
- package/dist/jest/resolver.js.map +1 -1
- package/dist/storybook-config/index.d.ts +1 -0
- package/dist/storybook-config/index.d.ts.map +1 -1
- package/dist/storybook-config/index.js +1 -0
- package/dist/storybook-config/index.js.map +1 -1
- package/dist/storybook-config/vite-final.d.ts +7 -0
- package/dist/storybook-config/vite-final.d.ts.map +1 -0
- package/dist/storybook-config/vite-final.js +86 -0
- package/dist/storybook-config/vite-final.js.map +1 -0
- package/dist/utils/get-configuration.d.ts +15 -10
- package/dist/utils/get-configuration.d.ts.map +1 -1
- package/dist/utils/get-configuration.js +32 -2
- package/dist/utils/get-configuration.js.map +1 -1
- package/dist/utils/get-package-name.d.ts +2 -1
- package/dist/utils/get-package-name.d.ts.map +1 -1
- package/dist/utils/get-package-name.js +4 -2
- package/dist/utils/get-package-name.js.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/types.d.ts +2 -0
- package/dist/utils/types.d.ts.map +1 -0
- package/dist/utils/types.js +6 -0
- package/dist/utils/types.js.map +1 -0
- package/dist/utils/validate-shared-dependencies.d.ts.map +1 -1
- package/dist/utils/validate-shared-dependencies.js +4 -0
- package/dist/utils/validate-shared-dependencies.js.map +1 -1
- package/dist/vite/build-shared-dependencies.d.ts.map +1 -1
- package/dist/vite/build-shared-dependencies.js +1 -2
- package/dist/vite/build-shared-dependencies.js.map +1 -1
- package/dist/vite/config/asset-file-names.d.ts +4 -0
- package/dist/vite/config/asset-file-names.d.ts.map +1 -0
- package/dist/vite/config/asset-file-names.js +29 -0
- package/dist/vite/config/asset-file-names.js.map +1 -0
- package/dist/vite/config/base-config.d.ts.map +1 -1
- package/dist/vite/config/base-config.js +67 -40
- package/dist/vite/config/base-config.js.map +1 -1
- package/dist/vite/config/code-splitting.d.ts +4 -0
- package/dist/vite/config/code-splitting.d.ts.map +1 -0
- package/dist/vite/config/code-splitting.js +48 -0
- package/dist/vite/config/code-splitting.js.map +1 -0
- package/dist/vite/config/create-css-config.d.ts +3 -0
- package/dist/vite/config/create-css-config.d.ts.map +1 -0
- package/dist/vite/config/create-css-config.js +26 -0
- package/dist/vite/config/create-css-config.js.map +1 -0
- package/dist/vite/config/create-filtering-logger.d.ts +3 -0
- package/dist/vite/config/create-filtering-logger.d.ts.map +1 -0
- package/dist/vite/config/create-filtering-logger.js +37 -0
- package/dist/vite/config/create-filtering-logger.js.map +1 -0
- package/dist/vite/config/create-vite-build-context.d.ts +2 -1
- package/dist/vite/config/create-vite-build-context.d.ts.map +1 -1
- package/dist/vite/config/create-vite-build-context.js.map +1 -1
- package/dist/vite/config/create-vite-config.d.ts.map +1 -1
- package/dist/vite/config/create-vite-config.js +30 -13
- package/dist/vite/config/create-vite-config.js.map +1 -1
- package/dist/vite/config/get-warmup-client-files.d.ts +3 -0
- package/dist/vite/config/get-warmup-client-files.d.ts.map +1 -0
- package/dist/vite/config/get-warmup-client-files.js +26 -0
- package/dist/vite/config/get-warmup-client-files.js.map +1 -0
- package/dist/vite/index.html +1 -0
- package/dist/vite/plugins/bundle-stat-plugin.d.ts +4 -0
- package/dist/vite/plugins/bundle-stat-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/bundle-stat-plugin.js +32 -0
- package/dist/vite/plugins/bundle-stat-plugin.js.map +1 -0
- package/dist/vite/plugins/chain-source-maps-plugin.d.ts +3 -0
- package/dist/vite/plugins/chain-source-maps-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/chain-source-maps-plugin.js +37 -0
- package/dist/vite/plugins/chain-source-maps-plugin.js.map +1 -0
- package/dist/vite/plugins/clean-plugin.d.ts +4 -0
- package/dist/vite/plugins/clean-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/clean-plugin.js +63 -0
- package/dist/vite/plugins/clean-plugin.js.map +1 -0
- package/dist/vite/plugins/design-system-guard-plugin.d.ts +4 -0
- package/dist/vite/plugins/design-system-guard-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/design-system-guard-plugin.js +35 -0
- package/dist/vite/plugins/design-system-guard-plugin.js.map +1 -0
- package/dist/vite/plugins/ignore-modules-plugin.d.ts +21 -3
- package/dist/vite/plugins/ignore-modules-plugin.d.ts.map +1 -1
- package/dist/vite/plugins/ignore-modules-plugin.js +22 -8
- package/dist/vite/plugins/ignore-modules-plugin.js.map +1 -1
- package/dist/vite/plugins/index.d.ts +7 -0
- package/dist/vite/plugins/index.d.ts.map +1 -1
- package/dist/vite/plugins/index.js +7 -0
- package/dist/vite/plugins/index.js.map +1 -1
- package/dist/vite/plugins/istanbul-plugin.d.ts +4 -0
- package/dist/vite/plugins/istanbul-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/istanbul-plugin.js +27 -0
- package/dist/vite/plugins/istanbul-plugin.js.map +1 -0
- package/dist/vite/plugins/magic-comments-plugin/index.d.ts +2 -0
- package/dist/vite/plugins/magic-comments-plugin/index.d.ts.map +1 -0
- package/dist/vite/plugins/magic-comments-plugin/index.js +20 -0
- package/dist/vite/plugins/magic-comments-plugin/index.js.map +1 -0
- package/dist/vite/plugins/magic-comments-plugin/magic-comments-plugin.d.ts +4 -0
- package/dist/vite/plugins/magic-comments-plugin/magic-comments-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/magic-comments-plugin/magic-comments-plugin.js +63 -0
- package/dist/vite/plugins/magic-comments-plugin/magic-comments-plugin.js.map +1 -0
- package/dist/vite/plugins/magic-comments-plugin/parse-magic-comments.d.ts +6 -0
- package/dist/vite/plugins/magic-comments-plugin/parse-magic-comments.d.ts.map +1 -0
- package/dist/vite/plugins/magic-comments-plugin/parse-magic-comments.js +40 -0
- package/dist/vite/plugins/magic-comments-plugin/parse-magic-comments.js.map +1 -0
- package/dist/vite/plugins/metadata-plugin.js +2 -2
- package/dist/vite/plugins/metadata-plugin.js.map +1 -1
- package/dist/vite/plugins/moment-locales-plugin.d.ts +5 -0
- package/dist/vite/plugins/moment-locales-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/moment-locales-plugin.js +50 -0
- package/dist/vite/plugins/moment-locales-plugin.js.map +1 -0
- package/dist/vite/plugins/shared-dependencies-plugin/assemble-iife.d.ts +14 -0
- package/dist/vite/plugins/shared-dependencies-plugin/assemble-iife.d.ts.map +1 -0
- package/dist/vite/plugins/shared-dependencies-plugin/assemble-iife.js +100 -0
- package/dist/vite/plugins/shared-dependencies-plugin/assemble-iife.js.map +1 -0
- package/dist/vite/plugins/shared-dependencies-plugin/assert-no-dynamic-css.d.ts +3 -0
- package/dist/vite/plugins/shared-dependencies-plugin/assert-no-dynamic-css.d.ts.map +1 -0
- package/dist/vite/plugins/shared-dependencies-plugin/assert-no-dynamic-css.js +56 -0
- package/dist/vite/plugins/shared-dependencies-plugin/assert-no-dynamic-css.js.map +1 -0
- package/dist/vite/plugins/shared-dependencies-plugin/flatten.d.ts +2 -0
- package/dist/vite/plugins/shared-dependencies-plugin/flatten.d.ts.map +1 -0
- package/dist/vite/plugins/shared-dependencies-plugin/flatten.js +19 -0
- package/dist/vite/plugins/shared-dependencies-plugin/flatten.js.map +1 -0
- package/dist/vite/plugins/shared-dependencies-plugin/index.d.ts +2 -0
- package/dist/vite/plugins/shared-dependencies-plugin/index.d.ts.map +1 -0
- package/dist/vite/plugins/shared-dependencies-plugin/index.js +20 -0
- package/dist/vite/plugins/shared-dependencies-plugin/index.js.map +1 -0
- package/dist/vite/plugins/shared-dependencies-plugin/shared-dependencies-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/{shared-dependencies-plugin.js → shared-dependencies-plugin/shared-dependencies-plugin.js} +29 -107
- package/dist/vite/plugins/shared-dependencies-plugin/shared-dependencies-plugin.js.map +1 -0
- package/dist/vite/plugins/utils/import-esm.d.ts +2 -0
- package/dist/vite/plugins/utils/import-esm.d.ts.map +1 -0
- package/dist/vite/plugins/utils/import-esm.js +22 -0
- package/dist/vite/plugins/utils/import-esm.js.map +1 -0
- package/dist/vite/plugins/utils/index.d.ts +3 -0
- package/dist/vite/plugins/utils/index.d.ts.map +1 -0
- package/dist/vite/plugins/utils/index.js +21 -0
- package/dist/vite/plugins/utils/index.js.map +1 -0
- package/dist/webpack/configs/optimization-config.d.ts.map +1 -1
- package/dist/webpack/configs/optimization-config.js +53 -24
- package/dist/webpack/configs/optimization-config.js.map +1 -1
- package/dist/webpack/configs/output-config.d.ts.map +1 -1
- package/dist/webpack/configs/output-config.js +0 -1
- package/dist/webpack/configs/output-config.js.map +1 -1
- package/dist/webpack/configs/plugins/assets-manifest-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/assets-manifest-plugin.js +11 -3
- package/dist/webpack/configs/plugins/assets-manifest-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/bundle-analyser-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/bundle-analyser-plugin.js +2 -21
- package/dist/webpack/configs/plugins/bundle-analyser-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/define-process-env-plugin.d.ts +5 -0
- package/dist/webpack/configs/plugins/define-process-env-plugin.d.ts.map +1 -0
- package/dist/webpack/configs/plugins/define-process-env-plugin.js +20 -0
- package/dist/webpack/configs/plugins/define-process-env-plugin.js.map +1 -0
- package/dist/webpack/configs/plugins/filter-warnings-plugin.d.ts +1 -1
- package/dist/webpack/configs/plugins/filter-warnings-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/filter-warnings-plugin.js +1 -4
- package/dist/webpack/configs/plugins/filter-warnings-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/empty-module.d.ts +2 -0
- package/dist/webpack/configs/plugins/ignore-plugin/empty-module.d.ts.map +1 -0
- package/dist/webpack/configs/plugins/ignore-plugin/empty-module.js +11 -0
- package/dist/webpack/configs/plugins/ignore-plugin/empty-module.js.map +1 -0
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.d.ts +26 -3
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.js +41 -10
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/index.d.ts +1 -0
- package/dist/webpack/configs/plugins/index.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/index.js +1 -0
- package/dist/webpack/configs/plugins/index.js.map +1 -1
- package/dist/webpack/configs/plugins/moment-locales-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/moment-locales-plugin.js +2 -5
- package/dist/webpack/configs/plugins/moment-locales-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins-config.d.ts.map +1 -1
- package/dist/webpack/configs/plugins-config.js +1 -0
- package/dist/webpack/configs/plugins-config.js.map +1 -1
- package/dist/webpack/configs/rules/font-rules.d.ts.map +1 -1
- package/dist/webpack/configs/rules/font-rules.js +2 -1
- package/dist/webpack/configs/rules/font-rules.js.map +1 -1
- package/dist/webpack/configs/rules/image-rules.d.ts.map +1 -1
- package/dist/webpack/configs/rules/image-rules.js +2 -1
- package/dist/webpack/configs/rules/image-rules.js.map +1 -1
- package/dist/webpack/create-webpack-config.d.ts.map +1 -1
- package/dist/webpack/create-webpack-config.js +8 -3
- package/dist/webpack/create-webpack-config.js.map +1 -1
- package/dist/webpack/create-webpack-configs.d.ts.map +1 -1
- package/dist/webpack/create-webpack-configs.js +4 -12
- package/dist/webpack/create-webpack-configs.js.map +1 -1
- package/dist/webpack/types.d.ts +1 -1
- package/dist/webpack/types.d.ts.map +1 -1
- package/dist/webpack/utils/create-webpack-build-context.d.ts.map +1 -1
- package/dist/webpack/utils/create-webpack-build-context.js +1 -2
- package/dist/webpack/utils/create-webpack-build-context.js.map +1 -1
- package/package.json +22 -18
- package/src/cli/commands/__tests__/build.test.ts +33 -5
- package/src/cli/commands/__tests__/bundle-vite.test.ts +50 -1
- package/src/cli/commands/__tests__/start.test.ts +17 -4
- package/src/cli/commands/build.ts +5 -6
- package/src/cli/commands/bundle-vite.ts +13 -0
- package/src/cli/commands/registry/build.ts +6 -1
- package/src/cli/commands/registry/command-registry.ts +0 -1
- package/src/cli/commands/registry/start.ts +6 -1
- package/src/cli/commands/review/rules/__tests__/require-compatible-typescript.test.ts +127 -0
- package/src/cli/commands/review/rules/index.ts +2 -0
- package/src/cli/commands/review/rules/require-compatible-typescript.ts +64 -0
- package/src/cli/commands/start.ts +4 -4
- package/src/cli/commands/test/runners/__tests__/vitest.test.ts +8 -1
- package/src/cli/commands/test/runners/vitest.ts +5 -3
- package/src/cli/index.ts +2 -2
- package/src/cli/utils/__tests__/get-bundle-command.test.ts +23 -0
- package/src/cli/utils/__tests__/get-exit-code.test.ts +41 -0
- package/src/cli/utils/__tests__/resolve-bundler.test.ts +64 -0
- package/src/cli/utils/get-bundle-command.ts +5 -0
- package/src/cli/utils/get-exit-code.ts +17 -0
- package/src/cli/utils/index.ts +3 -0
- package/src/cli/utils/resolve-bundler.ts +23 -0
- package/src/core/__tests__/bundle-report.test.ts +60 -0
- package/src/core/__tests__/create-extension-regexp.test.ts +32 -0
- package/src/core/__tests__/resolve-output-path.test.ts +45 -0
- package/src/core/__tests__/resolve-output-root.test.ts +37 -0
- package/src/core/__tests__/sort-shared-css.test.ts +39 -0
- package/src/core/bundle-report.ts +33 -0
- package/src/core/check-resource/__tests__/check-resource.test.ts +21 -7
- package/src/core/check-resource/__tests__/get-peer-dependency-meta.test.ts +70 -13
- package/src/core/check-resource/__tests__/is-resolvable.test.ts +20 -0
- package/src/core/check-resource/check-resource.ts +17 -16
- package/src/core/check-resource/get-peer-dependency-meta.ts +67 -4
- package/src/core/check-resource/index.ts +1 -1
- package/src/core/check-resource/is-resolvable.ts +19 -0
- package/src/core/check-resource/types.ts +2 -0
- package/src/core/chunk-patterns.ts +30 -0
- package/src/core/create-build-context.ts +2 -2
- package/src/core/create-extension-regexp.ts +7 -0
- package/src/core/get-process-env.ts +17 -0
- package/src/core/index.ts +8 -1
- package/src/core/moment-locales.ts +6 -0
- package/src/core/resolve-output-path.ts +10 -0
- package/src/core/resolve-output-root.ts +8 -0
- package/src/core/sort-shared-css.ts +7 -0
- package/src/core/types.ts +1 -1
- package/src/cypress/config/__tests__/vite-config.test.ts +72 -0
- package/src/cypress/config/index.ts +1 -0
- package/src/cypress/config/vite-config.ts +37 -0
- package/src/jest/__tests__/resolver.test.ts +42 -1
- package/src/jest/resolver.ts +17 -1
- package/src/storybook-config/__tests__/vite-final.test.ts +122 -0
- package/src/storybook-config/index.ts +1 -0
- package/src/storybook-config/vite-final.ts +65 -0
- package/src/utils/__tests__/get-configuration.test.ts +82 -5
- package/src/utils/__tests__/get-package-name.test.ts +57 -0
- package/src/utils/__tests__/validate-shared-dependencies.test.ts +50 -35
- package/src/utils/get-configuration.ts +50 -15
- package/src/utils/get-package-name.ts +8 -2
- package/src/utils/index.ts +1 -0
- package/src/utils/types.ts +1 -0
- package/src/utils/validate-shared-dependencies.ts +15 -1
- package/src/vite/__tests__/build-shared-dependencies.test.ts +13 -26
- package/src/vite/__tests__/validate-shared-dependencies.test.ts +30 -19
- package/src/vite/build-shared-dependencies.ts +3 -7
- package/src/vite/config/__tests__/asset-file-names.test.ts +40 -0
- package/src/vite/config/__tests__/base-config.test.ts +99 -31
- package/src/vite/config/__tests__/code-splitting.test.ts +34 -0
- package/src/vite/config/__tests__/create-css-config.test.ts +58 -0
- package/src/vite/config/__tests__/create-filtering-logger.test.ts +51 -0
- package/src/vite/config/__tests__/create-vite-build-context.test.ts +5 -2
- package/src/vite/config/__tests__/create-vite-config.test.ts +91 -13
- package/src/vite/config/__tests__/get-warmup-client-files.test.ts +20 -0
- package/src/vite/config/asset-file-names.ts +20 -0
- package/src/vite/config/base-config.ts +45 -37
- package/src/vite/config/code-splitting.ts +23 -0
- package/src/vite/config/create-css-config.ts +16 -0
- package/src/vite/config/create-filtering-logger.ts +34 -0
- package/src/vite/config/create-vite-build-context.ts +3 -5
- package/src/vite/config/create-vite-config.ts +45 -12
- package/src/vite/config/get-warmup-client-files.ts +13 -0
- package/src/vite/index.html +1 -0
- package/src/vite/plugins/__tests__/bundle-stat-plugin.test.ts +70 -0
- package/src/vite/plugins/__tests__/chain-source-maps-plugin.test.ts +58 -0
- package/src/vite/plugins/__tests__/clean-plugin.test.ts +121 -0
- package/src/vite/plugins/__tests__/design-system-guard-plugin.test.ts +83 -0
- package/src/vite/plugins/__tests__/html-template.test.ts +6 -0
- package/src/vite/plugins/__tests__/ignore-modules-plugin.test.ts +29 -7
- package/src/vite/plugins/__tests__/istanbul-plugin.test.ts +62 -0
- package/src/vite/plugins/__tests__/moment-locales-plugin.test.ts +104 -0
- package/src/vite/plugins/bundle-stat-plugin.ts +24 -0
- package/src/vite/plugins/chain-source-maps-plugin.ts +26 -0
- package/src/vite/plugins/clean-plugin.ts +46 -0
- package/src/vite/plugins/design-system-guard-plugin.ts +34 -0
- package/src/vite/plugins/ignore-modules-plugin.ts +36 -7
- package/src/vite/plugins/index.ts +7 -0
- package/src/vite/plugins/istanbul-plugin.ts +19 -0
- package/src/vite/plugins/magic-comments-plugin/__tests__/magic-comments-plugin.test.ts +105 -0
- package/src/vite/plugins/magic-comments-plugin/__tests__/parse-magic-comments.test.ts +40 -0
- package/src/vite/plugins/magic-comments-plugin/index.ts +1 -0
- package/src/vite/plugins/magic-comments-plugin/magic-comments-plugin.ts +63 -0
- package/src/vite/plugins/magic-comments-plugin/parse-magic-comments.ts +39 -0
- package/src/vite/plugins/metadata-plugin.ts +1 -1
- package/src/vite/plugins/moment-locales-plugin.ts +41 -0
- package/src/vite/plugins/shared-dependencies-plugin/__tests__/assemble-iife.test.ts +29 -0
- package/src/vite/plugins/shared-dependencies-plugin/__tests__/assert-no-dynamic-css.test.ts +113 -0
- package/src/vite/plugins/shared-dependencies-plugin/__tests__/flatten.test.ts +23 -0
- package/src/vite/plugins/{__tests__ → shared-dependencies-plugin/__tests__}/shared-dependencies-plugin.test.ts +38 -4
- package/src/vite/plugins/shared-dependencies-plugin/assemble-iife.ts +114 -0
- package/src/vite/plugins/shared-dependencies-plugin/assert-no-dynamic-css.ts +58 -0
- package/src/vite/plugins/shared-dependencies-plugin/flatten.ts +8 -0
- package/src/vite/plugins/shared-dependencies-plugin/index.ts +1 -0
- package/src/vite/plugins/{shared-dependencies-plugin.ts → shared-dependencies-plugin/shared-dependencies-plugin.ts} +24 -115
- package/src/vite/plugins/utils/import-esm.ts +15 -0
- package/src/vite/plugins/utils/index.ts +2 -0
- package/src/vite/rolldown-oxc.d.ts +20 -0
- package/src/webpack/__tests__/bundle-webpack.test.ts +8 -8
- package/src/webpack/__tests__/create-webpack-config-shared-dependencies.test.ts +54 -5
- package/src/webpack/__tests__/create-webpack-config-web-component.test.ts +81 -12
- package/src/webpack/__tests__/create-webpack-config.test.ts +92 -9
- package/src/webpack/configs/optimization-config.ts +47 -25
- package/src/webpack/configs/output-config.ts +1 -2
- package/src/webpack/configs/plugins/assets-manifest-plugin.ts +16 -4
- package/src/webpack/configs/plugins/bundle-analyser-plugin.ts +3 -25
- package/src/webpack/configs/plugins/define-process-env-plugin.ts +10 -0
- package/src/webpack/configs/plugins/filter-warnings-plugin.ts +1 -5
- package/src/webpack/configs/plugins/ignore-plugin/__tests__/ignore-plugin.test.ts +76 -24
- package/src/webpack/configs/plugins/ignore-plugin/empty-module.ts +7 -0
- package/src/webpack/configs/plugins/ignore-plugin/ignore-plugin.ts +59 -9
- package/src/webpack/configs/plugins/index.ts +1 -0
- package/src/webpack/configs/plugins/moment-locales-plugin.ts +2 -2
- package/src/webpack/configs/plugins-config.ts +2 -0
- package/src/webpack/configs/rules/font-rules.ts +2 -2
- package/src/webpack/configs/rules/image-rules.ts +2 -2
- package/src/webpack/create-webpack-config.ts +11 -4
- package/src/webpack/create-webpack-configs.ts +2 -8
- package/src/webpack/types.ts +1 -4
- package/src/webpack/utils/create-webpack-build-context.ts +1 -6
- package/tsconfig/base.json +1 -1
- package/tsconfig/types.d.ts +10 -0
- package/dist/core/get-output-path.d.ts +0 -3
- package/dist/core/get-output-path.d.ts.map +0 -1
- package/dist/core/get-output-path.js +0 -29
- package/dist/core/get-output-path.js.map +0 -1
- package/dist/vite/plugins/shared-dependencies-plugin.d.ts.map +0 -1
- package/dist/vite/plugins/shared-dependencies-plugin.js.map +0 -1
- package/src/core/__tests__/get-output-path.test.ts +0 -64
- package/src/core/get-output-path.ts +0 -15
- /package/dist/vite/plugins/{shared-dependencies-plugin.d.ts → shared-dependencies-plugin/shared-dependencies-plugin.d.ts} +0 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "viteConfig", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return viteConfig;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _vite = require("vite");
|
|
12
|
+
const _createcssconfig = require("../../vite/config/create-css-config");
|
|
13
|
+
const _plugins = require("../../vite/plugins");
|
|
14
|
+
/*
|
|
15
|
+
* Dedupe and pre-bundle React so component tests load a single React instance.
|
|
16
|
+
* Mirrors how viteFinal handles Storybook, where automatic discovery can miss
|
|
17
|
+
* React in monorepos.
|
|
18
|
+
*/ const REACT_DEDUPE = [
|
|
19
|
+
'react',
|
|
20
|
+
'react-dom'
|
|
21
|
+
];
|
|
22
|
+
const REACT_OPTIMIZE = [
|
|
23
|
+
...REACT_DEDUPE,
|
|
24
|
+
'react/jsx-runtime'
|
|
25
|
+
];
|
|
26
|
+
function viteConfig(overrides) {
|
|
27
|
+
const context = getContext();
|
|
28
|
+
const config = {
|
|
29
|
+
css: (0, _createcssconfig.createCssConfig)(false),
|
|
30
|
+
resolve: {
|
|
31
|
+
dedupe: REACT_DEDUPE
|
|
32
|
+
},
|
|
33
|
+
optimizeDeps: {
|
|
34
|
+
include: REACT_OPTIMIZE
|
|
35
|
+
},
|
|
36
|
+
plugins: [
|
|
37
|
+
(0, _plugins.svgrPlugin)(context),
|
|
38
|
+
(0, _plugins.istanbulPlugin)(context)
|
|
39
|
+
]
|
|
40
|
+
};
|
|
41
|
+
return (0, _vite.mergeConfig)(config, overrides !== null && overrides !== void 0 ? overrides : {});
|
|
42
|
+
}
|
|
43
|
+
function getContext() {
|
|
44
|
+
/*
|
|
45
|
+
* svgrPlugin reads bundlerConfig.pluginOverrides and istanbulPlugin reads
|
|
46
|
+
* options.codeCoverage, so a minimal context reuses both. Component tests
|
|
47
|
+
* always instrument for coverage, matching the webpack Cypress config.
|
|
48
|
+
*/ return {
|
|
49
|
+
options: {
|
|
50
|
+
codeCoverage: true
|
|
51
|
+
},
|
|
52
|
+
bundlerConfig: {
|
|
53
|
+
pluginOverrides: {}
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
//# sourceMappingURL=vite-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/cypress/config/vite-config.ts"],"sourcesContent":["import { type InlineConfig, mergeConfig } from 'vite';\nimport { createCssConfig } from '../../vite/config/create-css-config';\nimport { istanbulPlugin, svgrPlugin } from '../../vite/plugins';\nimport type { ViteBuildContext } from '../../vite/types';\n\n/*\n * Dedupe and pre-bundle React so component tests load a single React instance.\n * Mirrors how viteFinal handles Storybook, where automatic discovery can miss\n * React in monorepos.\n */\nconst REACT_DEDUPE = ['react', 'react-dom'];\nconst REACT_OPTIMIZE = [...REACT_DEDUPE, 'react/jsx-runtime'];\n\nexport function viteConfig(overrides?: InlineConfig): InlineConfig {\n const context = getContext();\n\n const config: InlineConfig = {\n css: createCssConfig(false),\n resolve: { dedupe: REACT_DEDUPE },\n optimizeDeps: { include: REACT_OPTIMIZE },\n plugins: [svgrPlugin(context), istanbulPlugin(context)],\n };\n\n return mergeConfig(config, overrides ?? {});\n}\n\nfunction getContext(): ViteBuildContext {\n /*\n * svgrPlugin reads bundlerConfig.pluginOverrides and istanbulPlugin reads\n * options.codeCoverage, so a minimal context reuses both. Component tests\n * always instrument for coverage, matching the webpack Cypress config.\n */\n return {\n options: { codeCoverage: true },\n bundlerConfig: { pluginOverrides: {} },\n } as ViteBuildContext;\n}\n"],"names":["viteConfig","REACT_DEDUPE","REACT_OPTIMIZE","overrides","context","getContext","config","css","createCssConfig","resolve","dedupe","optimizeDeps","include","plugins","svgrPlugin","istanbulPlugin","mergeConfig","options","codeCoverage","bundlerConfig","pluginOverrides"],"mappings":";;;;+BAagBA;;;eAAAA;;;sBAb+B;iCACf;yBACW;AAG3C;;;;CAIC,GACD,MAAMC,eAAe;IAAC;IAAS;CAAY;AAC3C,MAAMC,iBAAiB;OAAID;IAAc;CAAoB;AAEtD,SAASD,WAAWG,SAAwB;IAC/C,MAAMC,UAAUC;IAEhB,MAAMC,SAAuB;QACzBC,KAAKC,IAAAA,gCAAe,EAAC;QACrBC,SAAS;YAAEC,QAAQT;QAAa;QAChCU,cAAc;YAAEC,SAASV;QAAe;QACxCW,SAAS;YAACC,IAAAA,mBAAU,EAACV;YAAUW,IAAAA,uBAAc,EAACX;SAAS;IAC3D;IAEA,OAAOY,IAAAA,iBAAW,EAACV,QAAQH,sBAAAA,uBAAAA,YAAa,CAAC;AAC7C;AAEA,SAASE;IACL;;;;KAIC,GACD,OAAO;QACHY,SAAS;YAAEC,cAAc;QAAK;QAC9BC,eAAe;YAAEC,iBAAiB,CAAC;QAAE;IACzC;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../src/jest/resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../src/jest/resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAMjD,QAAA,MAAM,QAAQ,EAAE,YAgBf,CAAC;AAEF,SAAS,QAAQ,CAAC"}
|
package/dist/jest/resolver.js
CHANGED
|
@@ -1,10 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
const _checkresource = require("../core/check-resource");
|
|
2
3
|
const _transformsvg = require("../utils/transform-svg");
|
|
4
|
+
const EMPTY_MODULE_PATH = require.resolve('../webpack/configs/plugins/ignore-plugin/empty-module');
|
|
3
5
|
const resolver = (path, options)=>{
|
|
4
6
|
var _ref;
|
|
5
7
|
var _SVG_PATH_REGEX_exec;
|
|
6
8
|
const { type, path: pathSansType } = (_ref = (_SVG_PATH_REGEX_exec = _transformsvg.SVG_PATH_REGEX.exec(path)) === null || _SVG_PATH_REGEX_exec === void 0 ? void 0 : _SVG_PATH_REGEX_exec.groups) !== null && _ref !== void 0 ? _ref : {};
|
|
7
|
-
|
|
9
|
+
const resolvedPath = type ? pathSansType : path;
|
|
10
|
+
try {
|
|
11
|
+
return options.defaultResolver(resolvedPath, options);
|
|
12
|
+
} catch (error) {
|
|
13
|
+
var _options_basedir;
|
|
14
|
+
const mode = (0, _checkresource.checkResource)({
|
|
15
|
+
package: {
|
|
16
|
+
dependencies: {}
|
|
17
|
+
}
|
|
18
|
+
})({
|
|
19
|
+
resource: resolvedPath,
|
|
20
|
+
importer: (_options_basedir = options.basedir) !== null && _options_basedir !== void 0 ? _options_basedir : ''
|
|
21
|
+
});
|
|
22
|
+
if (mode === 'empty') {
|
|
23
|
+
return EMPTY_MODULE_PATH;
|
|
24
|
+
}
|
|
25
|
+
throw error;
|
|
26
|
+
}
|
|
8
27
|
};
|
|
9
28
|
module.exports = resolver;
|
|
10
29
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/jest/resolver.ts"],"sourcesContent":["import type { SyncResolver } from 'jest-resolve';\nimport { SVG_PATH_REGEX } from '../utils/transform-svg';\n\nconst resolver: SyncResolver = (path, options) => {\n const { type, path: pathSansType } = SVG_PATH_REGEX.exec(path)?.groups ?? {};\n
|
|
1
|
+
{"version":3,"sources":["../../src/jest/resolver.ts"],"sourcesContent":["import type { SyncResolver } from 'jest-resolve';\nimport { checkResource } from '../core/check-resource';\nimport { SVG_PATH_REGEX } from '../utils/transform-svg';\n\nconst EMPTY_MODULE_PATH = require.resolve('../webpack/configs/plugins/ignore-plugin/empty-module');\n\nconst resolver: SyncResolver = (path, options) => {\n const { type, path: pathSansType } = SVG_PATH_REGEX.exec(path)?.groups ?? {};\n const resolvedPath = type ? pathSansType : path;\n\n try {\n return options.defaultResolver(resolvedPath, options);\n } catch (error) {\n const mode = checkResource({ package: { dependencies: {} } })({\n resource: resolvedPath,\n importer: options.basedir ?? '',\n });\n if (mode === 'empty') {\n return EMPTY_MODULE_PATH;\n }\n throw error;\n }\n};\n\nexport = resolver;\n"],"names":["EMPTY_MODULE_PATH","require","resolve","resolver","path","options","SVG_PATH_REGEX","type","pathSansType","exec","groups","resolvedPath","defaultResolver","error","mode","checkResource","package","dependencies","resource","importer","basedir"],"mappings":";+BAC8B;8BACC;AAE/B,MAAMA,oBAAoBC,QAAQC,OAAO,CAAC;AAE1C,MAAMC,WAAyB,CAACC,MAAMC;;QACGC;IAArC,MAAM,EAAEC,IAAI,EAAEH,MAAMI,YAAY,EAAE,YAAGF,uBAAAA,4BAAc,CAACG,IAAI,CAACL,mBAApBE,2CAAAA,qBAA2BI,MAAM,uCAAI,CAAC;IAC3E,MAAMC,eAAeJ,OAAOC,eAAeJ;IAE3C,IAAI;QACA,OAAOC,QAAQO,eAAe,CAACD,cAAcN;IACjD,EAAE,OAAOQ,OAAO;YAGER;QAFd,MAAMS,OAAOC,IAAAA,4BAAa,EAAC;YAAEC,SAAS;gBAAEC,cAAc,CAAC;YAAE;QAAE,GAAG;YAC1DC,UAAUP;YACVQ,QAAQ,GAAEd,mBAAAA,QAAQe,OAAO,cAAff,8BAAAA,mBAAmB;QACjC;QACA,IAAIS,SAAS,SAAS;YAClB,OAAOd;QACX;QACA,MAAMa;IACV;AACJ;iBAESV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storybook-config/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storybook-config/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
5
|
_export_star(require("./swc"), exports);
|
|
6
|
+
_export_star(require("./vite-final"), exports);
|
|
6
7
|
_export_star(require("./webpack-final"), exports);
|
|
7
8
|
function _export_star(from, to) {
|
|
8
9
|
Object.keys(from).forEach(function(k) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/storybook-config/index.ts"],"sourcesContent":["export * from './swc';\nexport * from './webpack-final';\n"],"names":[],"mappings":";;;;qBAAc;qBACA"}
|
|
1
|
+
{"version":3,"sources":["../../src/storybook-config/index.ts"],"sourcesContent":["export * from './swc';\nexport * from './vite-final';\nexport * from './webpack-final';\n"],"names":[],"mappings":";;;;qBAAc;qBACA;qBACA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { InlineConfig } from 'vite';
|
|
2
|
+
interface ViteFinalOptions {
|
|
3
|
+
configType?: 'DEVELOPMENT' | 'PRODUCTION';
|
|
4
|
+
}
|
|
5
|
+
export declare function viteFinal(config: InlineConfig, { configType }?: ViteFinalOptions): InlineConfig;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=vite-final.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite-final.d.ts","sourceRoot":"","sources":["../../src/storybook-config/vite-final.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAMzC,UAAU,gBAAgB;IAKtB,UAAU,CAAC,EAAE,aAAa,GAAG,YAAY,CAAC;CAC7C;AAUD,wBAAgB,SAAS,CACrB,MAAM,EAAE,YAAY,EACpB,EAAE,UAAU,EAAE,GAAE,gBAAqB,GACtC,YAAY,CA8Bd"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "viteFinal", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return viteFinal;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _nodeutil = require("node:util");
|
|
12
|
+
const _utils = require("../utils");
|
|
13
|
+
const _createcssconfig = require("../vite/config/create-css-config");
|
|
14
|
+
const _svgrplugin = require("../vite/plugins/svgr-plugin");
|
|
15
|
+
/*
|
|
16
|
+
* Pre-bundle and dedupe React so the Storybook preview loads a single React
|
|
17
|
+
* instance. Storybook leaves this to Vite's automatic discovery, which can miss
|
|
18
|
+
* React in monorepos.
|
|
19
|
+
*/ const REACT_DEDUPE = [
|
|
20
|
+
'react',
|
|
21
|
+
'react-dom'
|
|
22
|
+
];
|
|
23
|
+
const REACT_OPTIMIZE = [
|
|
24
|
+
...REACT_DEDUPE,
|
|
25
|
+
'react/jsx-runtime'
|
|
26
|
+
];
|
|
27
|
+
function viteFinal(config, { configType } = {}) {
|
|
28
|
+
var _ref, _ref1, _config_plugins;
|
|
29
|
+
var _config_css, _config_resolve, _config_optimizeDeps;
|
|
30
|
+
const isProduction = configType === 'PRODUCTION';
|
|
31
|
+
const css = (0, _createcssconfig.createCssConfig)(isProduction);
|
|
32
|
+
const plugins = [
|
|
33
|
+
(0, _svgrplugin.svgrPlugin)(getContext())
|
|
34
|
+
];
|
|
35
|
+
const merged = {
|
|
36
|
+
...config,
|
|
37
|
+
css: {
|
|
38
|
+
...config.css,
|
|
39
|
+
modules: css.modules,
|
|
40
|
+
preprocessorOptions: {
|
|
41
|
+
...(_config_css = config.css) === null || _config_css === void 0 ? void 0 : _config_css.preprocessorOptions,
|
|
42
|
+
...css.preprocessorOptions
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
resolve: {
|
|
46
|
+
...config.resolve,
|
|
47
|
+
dedupe: [
|
|
48
|
+
...new Set([
|
|
49
|
+
...(_ref = (_config_resolve = config.resolve) === null || _config_resolve === void 0 ? void 0 : _config_resolve.dedupe) !== null && _ref !== void 0 ? _ref : [],
|
|
50
|
+
...REACT_DEDUPE
|
|
51
|
+
])
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
optimizeDeps: {
|
|
55
|
+
...config.optimizeDeps,
|
|
56
|
+
include: [
|
|
57
|
+
...new Set([
|
|
58
|
+
...(_ref1 = (_config_optimizeDeps = config.optimizeDeps) === null || _config_optimizeDeps === void 0 ? void 0 : _config_optimizeDeps.include) !== null && _ref1 !== void 0 ? _ref1 : [],
|
|
59
|
+
...REACT_OPTIMIZE
|
|
60
|
+
])
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
plugins: [
|
|
64
|
+
...(_config_plugins = config.plugins) !== null && _config_plugins !== void 0 ? _config_plugins : [],
|
|
65
|
+
...plugins
|
|
66
|
+
]
|
|
67
|
+
};
|
|
68
|
+
/* istanbul ignore next: debug only */ _utils.log.debug('storybook-config:vite-final', ()=>(0, _nodeutil.inspect)({
|
|
69
|
+
merged
|
|
70
|
+
}, {
|
|
71
|
+
depth: null
|
|
72
|
+
}));
|
|
73
|
+
return merged;
|
|
74
|
+
}
|
|
75
|
+
function getContext() {
|
|
76
|
+
/*
|
|
77
|
+
* svgrPlugin only reads bundlerConfig.pluginOverrides, so a minimal context
|
|
78
|
+
* is enough to reuse it with startup's default SVG include patterns.
|
|
79
|
+
*/ return {
|
|
80
|
+
bundlerConfig: {
|
|
81
|
+
pluginOverrides: {}
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
//# sourceMappingURL=vite-final.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/storybook-config/vite-final.ts"],"sourcesContent":["import { inspect } from 'node:util';\nimport type { InlineConfig } from 'vite';\nimport { log } from '../utils';\nimport { createCssConfig } from '../vite/config/create-css-config';\nimport { svgrPlugin } from '../vite/plugins/svgr-plugin';\nimport type { ViteBuildContext } from '../vite/types';\n\ninterface ViteFinalOptions {\n /*\n * Storybook signals the build type through `configType`, not Vite's\n * `config.mode` (which Storybook's Vite builder leaves unset).\n */\n configType?: 'DEVELOPMENT' | 'PRODUCTION';\n}\n\n/*\n * Pre-bundle and dedupe React so the Storybook preview loads a single React\n * instance. Storybook leaves this to Vite's automatic discovery, which can miss\n * React in monorepos.\n */\nconst REACT_DEDUPE = ['react', 'react-dom'];\nconst REACT_OPTIMIZE = [...REACT_DEDUPE, 'react/jsx-runtime'];\n\nexport function viteFinal(\n config: InlineConfig,\n { configType }: ViteFinalOptions = {}\n): InlineConfig {\n const isProduction = configType === 'PRODUCTION';\n const css = createCssConfig(isProduction);\n const plugins = [svgrPlugin(getContext())];\n\n const merged: InlineConfig = {\n ...config,\n css: {\n ...config.css,\n modules: css.modules,\n preprocessorOptions: {\n ...config.css?.preprocessorOptions,\n ...css.preprocessorOptions,\n },\n },\n resolve: {\n ...config.resolve,\n dedupe: [...new Set([...(config.resolve?.dedupe ?? []), ...REACT_DEDUPE])],\n },\n optimizeDeps: {\n ...config.optimizeDeps,\n include: [...new Set([...(config.optimizeDeps?.include ?? []), ...REACT_OPTIMIZE])],\n },\n plugins: [...(config.plugins ?? []), ...plugins],\n };\n\n /* istanbul ignore next: debug only */\n log.debug('storybook-config:vite-final', () => inspect({ merged }, { depth: null }));\n\n return merged;\n}\n\nfunction getContext(): ViteBuildContext {\n /*\n * svgrPlugin only reads bundlerConfig.pluginOverrides, so a minimal context\n * is enough to reuse it with startup's default SVG include patterns.\n */\n return { bundlerConfig: { pluginOverrides: {} } } as ViteBuildContext;\n}\n"],"names":["viteFinal","REACT_DEDUPE","REACT_OPTIMIZE","config","configType","isProduction","css","createCssConfig","plugins","svgrPlugin","getContext","merged","modules","preprocessorOptions","resolve","dedupe","Set","optimizeDeps","include","log","debug","inspect","depth","bundlerConfig","pluginOverrides"],"mappings":";;;;+BAuBgBA;;;eAAAA;;;0BAvBQ;uBAEJ;iCACY;4BACL;AAW3B;;;;CAIC,GACD,MAAMC,eAAe;IAAC;IAAS;CAAY;AAC3C,MAAMC,iBAAiB;OAAID;IAAc;CAAoB;AAEtD,SAASD,UACZG,MAAoB,EACpB,EAAEC,UAAU,EAAoB,GAAG,CAAC,CAAC;qBAwBnBD;QAZHA,aAMkBA,iBAICA;IApBlC,MAAME,eAAeD,eAAe;IACpC,MAAME,MAAMC,IAAAA,gCAAe,EAACF;IAC5B,MAAMG,UAAU;QAACC,IAAAA,sBAAU,EAACC;KAAc;IAE1C,MAAMC,SAAuB;QACzB,GAAGR,MAAM;QACTG,KAAK;YACD,GAAGH,OAAOG,GAAG;YACbM,SAASN,IAAIM,OAAO;YACpBC,qBAAqB;oBACdV,cAAAA,OAAOG,GAAG,cAAVH,kCAAAA,YAAYU,mBAAmB,AAAlC;gBACA,GAAGP,IAAIO,mBAAmB;YAC9B;QACJ;QACAC,SAAS;YACL,GAAGX,OAAOW,OAAO;YACjBC,QAAQ;mBAAI,IAAIC,IAAI;gCAAKb,kBAAAA,OAAOW,OAAO,cAAdX,sCAAAA,gBAAgBY,MAAM,uCAAI,EAAE;uBAAMd;iBAAa;aAAE;QAC9E;QACAgB,cAAc;YACV,GAAGd,OAAOc,YAAY;YACtBC,SAAS;mBAAI,IAAIF,IAAI;iCAAKb,uBAAAA,OAAOc,YAAY,cAAnBd,2CAAAA,qBAAqBe,OAAO,yCAAI,EAAE;uBAAMhB;iBAAe;aAAE;QACvF;QACAM,SAAS;gBAAKL,kBAAAA,OAAOK,OAAO,cAAdL,6BAAAA,kBAAkB,EAAE;eAAMK;SAAQ;IACpD;IAEA,oCAAoC,GACpCW,UAAG,CAACC,KAAK,CAAC,+BAA+B,IAAMC,IAAAA,iBAAO,EAAC;YAAEV;QAAO,GAAG;YAAEW,OAAO;QAAK;IAEjF,OAAOX;AACX;AAEA,SAASD;IACL;;;KAGC,GACD,OAAO;QAAEa,eAAe;YAAEC,iBAAiB,CAAC;QAAE;IAAE;AACpD"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { Config } from '@jest/types';
|
|
2
|
-
import { swcDir } from '@swc/cli';
|
|
3
|
-
import { ESLint } from 'eslint';
|
|
4
|
-
import { LinterOptions } from 'stylelint';
|
|
5
|
-
import svgr from 'vite-plugin-svgr';
|
|
6
|
-
import { ViteUserConfig } from 'vitest/config';
|
|
7
|
-
import { Configuration as WebpackDevServerConfiguration } from 'webpack-dev-server';
|
|
8
|
-
import { ReviewConfiguration } from '../cli/commands/review';
|
|
1
|
+
import type { Config } from '@jest/types';
|
|
2
|
+
import type { swcDir } from '@swc/cli';
|
|
3
|
+
import type { ESLint } from 'eslint';
|
|
4
|
+
import type { LinterOptions } from 'stylelint';
|
|
5
|
+
import type svgr from 'vite-plugin-svgr';
|
|
6
|
+
import type { ViteUserConfig } from 'vitest/config';
|
|
7
|
+
import type { Configuration as WebpackDevServerConfiguration } from 'webpack-dev-server';
|
|
8
|
+
import type { ReviewConfiguration } from '../cli/commands/review';
|
|
9
|
+
import { LocationOrJson } from './types';
|
|
9
10
|
type VitePluginSvgrOptions = NonNullable<Parameters<typeof svgr>[0]>;
|
|
10
11
|
type ElementType<T> = T extends readonly (infer ElementType)[] ? ElementType : never;
|
|
12
|
+
export type Bundler = 'vite' | 'webpack';
|
|
11
13
|
export declare const allowedWebpackDevServerOptions: readonly ["headers", "port", "proxy", "static"];
|
|
12
14
|
export interface MinifyJSOptions {
|
|
13
15
|
compress?: boolean;
|
|
@@ -44,7 +46,6 @@ export interface NodeConfiguration {
|
|
|
44
46
|
}
|
|
45
47
|
export declare enum CommandName {
|
|
46
48
|
'build' = "build",
|
|
47
|
-
'bundle-package' = "bundle-package",
|
|
48
49
|
'bundle-vite' = "bundle-vite",
|
|
49
50
|
'bundle-webpack' = "bundle-webpack",
|
|
50
51
|
'clean' = "clean",
|
|
@@ -96,6 +97,7 @@ export interface ViteBundlerConfig {
|
|
|
96
97
|
}
|
|
97
98
|
export interface VitePackageJsonOverride extends ViteBundlerConfig {
|
|
98
99
|
config?: Omit<import('vite').UserConfig, 'plugins'>;
|
|
100
|
+
devServer?: false;
|
|
99
101
|
}
|
|
100
102
|
export interface WebComponentBranchConfigs {
|
|
101
103
|
publishTag?: string;
|
|
@@ -110,6 +112,7 @@ interface WebComponentOptions {
|
|
|
110
112
|
branches?: Record<string, WebComponentBranchConfigs>;
|
|
111
113
|
}
|
|
112
114
|
type Configuration = {
|
|
115
|
+
'bundler'?: Bundler;
|
|
113
116
|
'jest'?: JestConfiguration;
|
|
114
117
|
'legacy'?: boolean;
|
|
115
118
|
'lint'?: {
|
|
@@ -120,6 +123,7 @@ type Configuration = {
|
|
|
120
123
|
'swc-compile-package'?: Parameters<typeof swcDir>[0];
|
|
121
124
|
'test'?: JestConfiguration;
|
|
122
125
|
'testRunner'?: string;
|
|
126
|
+
'expose-process-env'?: string[];
|
|
123
127
|
'expose-shared-dependencies'?: boolean;
|
|
124
128
|
'shared-dependencies'?: Record<string, string>;
|
|
125
129
|
'vite'?: false | VitePackageJsonOverride;
|
|
@@ -129,13 +133,13 @@ type Configuration = {
|
|
|
129
133
|
} & {
|
|
130
134
|
[key in CommandName]?: NodeConfiguration;
|
|
131
135
|
} & NodeConfiguration;
|
|
132
|
-
type LocationOrJson = string | Record<string, any>;
|
|
133
136
|
export declare function getConfiguration(locationOrJson?: LocationOrJson): Configuration;
|
|
134
137
|
export declare function getConfigurationSafe(locationOrJson?: LocationOrJson): Configuration;
|
|
135
138
|
export declare function getESLintConfiguration(): ESLintConfiguration;
|
|
136
139
|
export declare function getJestConfiguration(): JestConfiguration;
|
|
137
140
|
export declare function getReviewConfiguration(): ReviewConfiguration & NodeConfiguration;
|
|
138
141
|
export declare function getStylelintConfiguration(): StylelintConfiguration;
|
|
142
|
+
export declare function getExposeProcessEnv(): string[];
|
|
139
143
|
export declare function getViteConfiguration(): VitePackageJsonOverride;
|
|
140
144
|
export declare function getVitestConfiguration(): import("vitest/node").InlineConfig & {
|
|
141
145
|
omitDefault?: string[];
|
|
@@ -147,6 +151,7 @@ export declare function hasHeadlessBundle(): boolean;
|
|
|
147
151
|
export declare function getSwcCompilePackageConfiguration(): import("@swc/cli").Options;
|
|
148
152
|
export declare function isBundle(locationOrJson?: LocationOrJson): boolean;
|
|
149
153
|
export declare function isDevServerDisabled(): boolean;
|
|
154
|
+
export declare function isViteDevServerDisabled(): boolean;
|
|
150
155
|
export declare function isExposeSharedDependencies(): boolean;
|
|
151
156
|
export declare function isLegacy(locationOrJson?: LocationOrJson): boolean;
|
|
152
157
|
export declare function isLegacyRoot(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-configuration.d.ts","sourceRoot":"","sources":["../../src/utils/get-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"get-configuration.d.ts","sourceRoot":"","sources":["../../src/utils/get-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CA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AGtE;AAED,wBAAgB,4BAA4B,CACxC,cAAc,GAAE,cAAqB,GACtC,mBAAmB,GAAG,SAAS,CAsBjC;AAED,wBAAgB,4BAA4B,CAAC,cAAc,GAAE,cAAqB,yDAIjF;AAED,wBAAgB,iBAAiB,YAShC;AAED,wBAAgB,iCAAiC,+BAEhD;AAED,wBAAgB,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,WAIvD;AAED,wBAAgB,mBAAmB,YAGlC;AAED,wBAAgB,uBAAuB,YAEtC;AAED,wBAAgB,0BAA0B,YAKzC;AAED,wBAAgB,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,WAEvD;AAED,wBAAgB,YAAY,YAE3B;AAED,wBAAgB,oBAAoB,YAEnC;AAED,wBAAgB,cAAc,CAAC,cAAc,GAAE,cAAqB,WAEnE"}
|
|
@@ -24,6 +24,9 @@ _export(exports, {
|
|
|
24
24
|
get getESLintConfiguration () {
|
|
25
25
|
return getESLintConfiguration;
|
|
26
26
|
},
|
|
27
|
+
get getExposeProcessEnv () {
|
|
28
|
+
return getExposeProcessEnv;
|
|
29
|
+
},
|
|
27
30
|
get getJestConfiguration () {
|
|
28
31
|
return getJestConfiguration;
|
|
29
32
|
},
|
|
@@ -72,6 +75,9 @@ _export(exports, {
|
|
|
72
75
|
get isStyleCheckDisabled () {
|
|
73
76
|
return isStyleCheckDisabled;
|
|
74
77
|
},
|
|
78
|
+
get isViteDevServerDisabled () {
|
|
79
|
+
return isViteDevServerDisabled;
|
|
80
|
+
},
|
|
75
81
|
get isWebComponent () {
|
|
76
82
|
return isWebComponent;
|
|
77
83
|
}
|
|
@@ -79,6 +85,7 @@ _export(exports, {
|
|
|
79
85
|
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
|
80
86
|
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
81
87
|
const _getfolders = require("./get-folders");
|
|
88
|
+
const _getpackagename = require("./get-package-name");
|
|
82
89
|
const _log = require("./log");
|
|
83
90
|
const _readjson = require("./read-json");
|
|
84
91
|
function _interop_require_default(obj) {
|
|
@@ -94,7 +101,6 @@ const allowedWebpackDevServerOptions = [
|
|
|
94
101
|
];
|
|
95
102
|
var CommandName = /*#__PURE__*/ function(CommandName) {
|
|
96
103
|
CommandName["build"] = "build";
|
|
97
|
-
CommandName["bundle-package"] = "bundle-package";
|
|
98
104
|
CommandName["bundle-vite"] = "bundle-vite";
|
|
99
105
|
CommandName["bundle-webpack"] = "bundle-webpack";
|
|
100
106
|
CommandName["clean"] = "clean";
|
|
@@ -151,6 +157,10 @@ function getStylelintConfiguration() {
|
|
|
151
157
|
var _getConfiguration_lint;
|
|
152
158
|
return (_ref = (_getConfiguration_lint = getConfiguration().lint) === null || _getConfiguration_lint === void 0 ? void 0 : _getConfiguration_lint.stylelint) !== null && _ref !== void 0 ? _ref : {};
|
|
153
159
|
}
|
|
160
|
+
function getExposeProcessEnv() {
|
|
161
|
+
var _getConfiguration_exposeprocessenv;
|
|
162
|
+
return (_getConfiguration_exposeprocessenv = getConfiguration()['expose-process-env']) !== null && _getConfiguration_exposeprocessenv !== void 0 ? _getConfiguration_exposeprocessenv : [];
|
|
163
|
+
}
|
|
154
164
|
function getViteConfiguration() {
|
|
155
165
|
const { vite } = getConfiguration();
|
|
156
166
|
return typeof vite === 'object' ? vite : {};
|
|
@@ -199,12 +209,17 @@ function getSwcCompilePackageConfiguration() {
|
|
|
199
209
|
return (_getConfiguration_swccompilepackage = getConfiguration()['swc-compile-package']) !== null && _getConfiguration_swccompilepackage !== void 0 ? _getConfiguration_swccompilepackage : {};
|
|
200
210
|
}
|
|
201
211
|
function isBundle(locationOrJson) {
|
|
202
|
-
|
|
212
|
+
const { webpack, vite } = getConfiguration(locationOrJson);
|
|
213
|
+
assertBundlersAgree(webpack, vite, locationOrJson);
|
|
214
|
+
return webpack !== false && vite !== false;
|
|
203
215
|
}
|
|
204
216
|
function isDevServerDisabled() {
|
|
205
217
|
const webpackConfiguration = getWebpackConfiguration();
|
|
206
218
|
return webpackConfiguration.devServer === false;
|
|
207
219
|
}
|
|
220
|
+
function isViteDevServerDisabled() {
|
|
221
|
+
return getViteConfiguration().devServer === false;
|
|
222
|
+
}
|
|
208
223
|
function isExposeSharedDependencies() {
|
|
209
224
|
var _getConfiguration_exposeshareddependencies;
|
|
210
225
|
return ((_getConfiguration_exposeshareddependencies = getConfiguration()['expose-shared-dependencies']) !== null && _getConfiguration_exposeshareddependencies !== void 0 ? _getConfiguration_exposeshareddependencies : getWebpackConfiguration()['expose-shared-dependencies']) === true;
|
|
@@ -222,5 +237,20 @@ function isStyleCheckDisabled() {
|
|
|
222
237
|
function isWebComponent(locationOrJson = './') {
|
|
223
238
|
return !!getWebComponentConfiguration(locationOrJson);
|
|
224
239
|
}
|
|
240
|
+
/*
|
|
241
|
+
* Require that Vite and Webpack configurations agree whether package is a bundle.
|
|
242
|
+
*/ function assertBundlersAgree(webpack, vite, locationOrJson) {
|
|
243
|
+
if (webpack === undefined || vite === undefined || !!webpack === !!vite) {
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
const mismatch = webpack === false ? {
|
|
247
|
+
falsy: 'cli.webpack',
|
|
248
|
+
truthy: 'cli.vite'
|
|
249
|
+
} : {
|
|
250
|
+
falsy: 'cli.vite',
|
|
251
|
+
truthy: 'cli.webpack'
|
|
252
|
+
};
|
|
253
|
+
throw new Error(`package ${(0, _getpackagename.getPackageName)(locationOrJson)} has conflicting webpack ` + `and vite configurations: ${mismatch.falsy} is false but ` + `${mismatch.truthy} is not`);
|
|
254
|
+
}
|
|
225
255
|
|
|
226
256
|
//# sourceMappingURL=get-configuration.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/get-configuration.ts"],"sourcesContent":["import { Config } from '@jest/types';\nimport { swcDir } from '@swc/cli';\nimport { ESLint } from 'eslint';\nimport fs from 'fs';\nimport path from 'path';\nimport { LinterOptions } from 'stylelint';\nimport svgr from 'vite-plugin-svgr';\nimport { ViteUserConfig } from 'vitest/config';\nimport { Configuration as WebpackDevServerConfiguration } from 'webpack-dev-server';\nimport { ReviewConfiguration } from '../cli/commands/review';\nimport { getFolders } from './get-folders';\nimport { log } from './log';\nimport { readJson, readJsonSafe } from './read-json';\n\ntype VitePluginSvgrOptions = NonNullable<Parameters<typeof svgr>[0]>;\n\ntype ElementType<T> = T extends readonly (infer ElementType)[] ? ElementType : never;\n\nexport const allowedWebpackDevServerOptions = ['headers', 'port', 'proxy', 'static'] as const;\n\nexport interface MinifyJSOptions {\n compress?: boolean;\n mangle?: boolean;\n}\n\nexport interface MinifyCssOptions {}\n\nexport interface MinifyOptions {\n css?: boolean | MinifyCssOptions;\n js?: boolean | MinifyJSOptions;\n}\n\nexport interface WebpackConfiguration extends Omit<\n Pick<WebpackDevServerConfiguration, ElementType<typeof allowedWebpackDevServerOptions>>,\n 'proxy'\n> {\n 'contentBase'?: boolean | string | string[] | number; // deprecated 2024-07\n 'custom-style-rules'?: boolean;\n 'expose-shared-dependencies'?: boolean;\n 'devServer'?: false | WebpackDevServerConfiguration;\n 'disable-style-check'?: boolean;\n 'minify'?: MinifyOptions;\n 'proxy'?: WebpackDevServerConfiguration['proxy'] | string;\n 'shared-dependencies'?: Record<string, string>;\n}\n\nexport interface ESLintConfiguration extends ESLint.Options {\n disabled?: boolean;\n}\n\nexport interface StylelintConfiguration extends Partial<LinterOptions> {\n ignorePattern?: string[];\n disabled?: boolean;\n}\n\nexport interface JestConfiguration extends Omit<Config.Argv, '_' | '$0'> {\n omitDefault?: string[];\n}\n\nexport interface NodeConfiguration {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n NODE_OPTIONS?: string[];\n}\n\n/* eslint-disable @typescript-eslint/naming-convention */\nexport enum CommandName {\n 'build' = 'build',\n 'bundle-package' = 'bundle-package',\n 'bundle-vite' = 'bundle-vite',\n 'bundle-webpack' = 'bundle-webpack',\n 'clean' = 'clean',\n 'convert-eslint-config' = 'convert-eslint-config',\n 'eslint' = 'eslint',\n 'init' = 'init',\n 'install' = 'install',\n 'kendo-ui-license' = 'kendo-ui-license',\n 'lint' = 'lint',\n 'mfe-check' = 'mfe-check',\n 'mfe-generate-metadata' = 'mfe-generate-metadata',\n 'mfe-list' = 'mfe-list',\n 'mfe-package-clean' = 'mfe-package-clean',\n 'mfe-package-publish' = 'mfe-package-publish',\n 'mfe-package-rollback' = 'mfe-package-rollback',\n 'mfe-publish' = 'mfe-publish',\n 'mfe-purge-cache' = 'mfe-purge-cache',\n 'prepare-package' = 'prepare-package',\n 'review' = 'review',\n 'start' = 'start',\n 'stylelint' = 'stylelint',\n 'styles-check' = 'styles-check',\n 'test' = 'test',\n 'task' = 'task',\n 'upload-sourcemaps' = 'upload-sourcemaps',\n}\n/* eslint-enable @typescript-eslint/naming-convention */\n\nexport type VitestConfiguration = ViteUserConfig['test'] & {\n omitDefault?: string[];\n};\n\nexport interface HtmlPluginOptions {\n title?: string;\n favicon?: string;\n template?: string;\n}\n\nexport interface SvgrPluginOptions {\n include?: VitePluginSvgrOptions['include'];\n exclude?: VitePluginSvgrOptions['exclude'];\n svgrOptions?: VitePluginSvgrOptions['svgrOptions'];\n}\n\nexport interface PluginOverrides {\n html?: HtmlPluginOptions;\n svgr?: SvgrPluginOptions;\n}\n\nexport interface ViteBundlerConfig {\n port?: number;\n omitDefault?: string[];\n minify?: MinifyOptions;\n pluginOverrides?: PluginOverrides;\n}\n\nexport interface VitePackageJsonOverride extends ViteBundlerConfig {\n config?: Omit<import('vite').UserConfig, 'plugins'>;\n}\n\nexport interface WebComponentBranchConfigs {\n publishTag?: string;\n uploadSourcemaps?: boolean;\n}\n\ninterface WebComponentOptions {\n legacyRoot?: boolean;\n /**\n * mapping of git branches to configs.\n * Used to separate configs (ex publish tag) depending on current branch\n */\n branches?: Record<string, WebComponentBranchConfigs>;\n}\n\ntype Configuration = {\n 'jest'?: JestConfiguration;\n 'legacy'?: boolean;\n 'lint'?: { eslint: ESLintConfiguration; stylelint: StylelintConfiguration };\n 'review'?: ReviewConfiguration;\n 'swc-compile-package'?: Parameters<typeof swcDir>[0];\n 'test'?: JestConfiguration; // for backward-compatibility\n 'testRunner'?: string;\n 'expose-shared-dependencies'?: boolean;\n 'shared-dependencies'?: Record<string, string>;\n 'vite'?: false | VitePackageJsonOverride;\n 'vitest'?: VitestConfiguration;\n 'web-component'?: boolean | string | WebComponentOptions;\n 'webpack'?: false | WebpackConfiguration;\n} & {\n [key in CommandName]?: NodeConfiguration;\n} & NodeConfiguration;\n\ntype LocationOrJson = string | Record<string, any>;\n\nexport function getConfiguration(locationOrJson: LocationOrJson = './'): Configuration {\n const json =\n typeof locationOrJson === 'string'\n ? readJson(path.join(locationOrJson, 'package.json'))\n : locationOrJson;\n return json?.cli ?? {};\n}\n\nexport function getConfigurationSafe(locationOrJson: LocationOrJson = './'): Configuration {\n const json =\n typeof locationOrJson === 'string'\n ? readJsonSafe(path.join(locationOrJson, 'package.json'))\n : locationOrJson;\n return json?.cli ?? {};\n}\n\nexport function getESLintConfiguration() {\n return getConfiguration().lint?.eslint ?? {};\n}\n\nexport function getJestConfiguration() {\n const configuration = getConfiguration();\n return configuration.jest ?? configuration.test ?? {};\n}\n\nexport function getReviewConfiguration() {\n return getConfiguration().review ?? {};\n}\n\nexport function getStylelintConfiguration() {\n return getConfiguration().lint?.stylelint ?? {};\n}\n\nexport function getViteConfiguration(): VitePackageJsonOverride {\n const { vite } = getConfiguration();\n return typeof vite === 'object' ? vite : {};\n}\n\nexport function getVitestConfiguration() {\n return getConfiguration().vitest ?? {};\n}\n\nexport function getWebpackConfiguration(locationOrJson?: LocationOrJson) {\n const { webpack } = getConfiguration(locationOrJson);\n return typeof webpack === 'object' ? webpack : {};\n}\n\nexport function getWebComponentConfiguration(\n locationOrJson: LocationOrJson = './'\n): WebComponentOptions | undefined {\n const config = getConfigurationSafe(locationOrJson)['web-component'];\n\n if (config === true) {\n return {};\n }\n\n if (typeof config === 'object') {\n return config;\n }\n\n if (typeof config === 'string') {\n const configPath = path.resolve(\n typeof locationOrJson === 'string' ? path.join(locationOrJson, config) : config\n );\n if (fs.existsSync(configPath)) {\n return require(path.resolve(configPath));\n }\n log.warning(`could not find web-component configuration: \"${config}\"`);\n\n return undefined;\n }\n}\n\nexport function getWebComponentBranchConfigs(locationOrJson: LocationOrJson = './') {\n const config = getWebComponentConfiguration(locationOrJson);\n\n return config?.branches;\n}\n\nexport function hasHeadlessBundle() {\n let source: string;\n try {\n source = getFolders().source;\n } catch {\n return false;\n }\n const headlessPath = path.join(source, 'headless.ts');\n return fs.existsSync(headlessPath);\n}\n\nexport function getSwcCompilePackageConfiguration() {\n return getConfiguration()['swc-compile-package'] ?? {};\n}\n\nexport function isBundle(locationOrJson?: LocationOrJson) {\n return (\n getConfiguration(locationOrJson).webpack !== false &&\n getConfiguration(locationOrJson).vite !== false\n );\n}\n\nexport function isDevServerDisabled() {\n const webpackConfiguration = getWebpackConfiguration();\n return webpackConfiguration.devServer === false;\n}\n\nexport function isExposeSharedDependencies() {\n return (\n (getConfiguration()['expose-shared-dependencies'] ??\n getWebpackConfiguration()['expose-shared-dependencies']) === true\n );\n}\n\nexport function isLegacy(locationOrJson?: LocationOrJson) {\n return getConfiguration(locationOrJson).legacy === true;\n}\n\nexport function isLegacyRoot() {\n return getWebComponentConfiguration()?.legacyRoot === true;\n}\n\nexport function isStyleCheckDisabled() {\n return getWebpackConfiguration()['disable-style-check'] === true;\n}\n\nexport function isWebComponent(locationOrJson: LocationOrJson = './') {\n return !!getWebComponentConfiguration(locationOrJson);\n}\n"],"names":["CommandName","allowedWebpackDevServerOptions","getConfiguration","getConfigurationSafe","getESLintConfiguration","getJestConfiguration","getReviewConfiguration","getStylelintConfiguration","getSwcCompilePackageConfiguration","getViteConfiguration","getVitestConfiguration","getWebComponentBranchConfigs","getWebComponentConfiguration","getWebpackConfiguration","hasHeadlessBundle","isBundle","isDevServerDisabled","isExposeSharedDependencies","isLegacy","isLegacyRoot","isStyleCheckDisabled","isWebComponent","locationOrJson","json","readJson","path","join","cli","readJsonSafe","lint","eslint","configuration","jest","test","review","stylelint","vite","vitest","webpack","config","configPath","resolve","fs","existsSync","require","log","warning","undefined","branches","source","getFolders","headlessPath","webpackConfiguration","devServer","legacy","legacyRoot"],"mappings":";;;;;;;;;;;QAiEYA;eAAAA;;QA/CCC;eAAAA;;QAgJGC;eAAAA;;QAQAC;eAAAA;;QAQAC;eAAAA;;QAIAC;eAAAA;;QAKAC;eAAAA;;QAIAC;eAAAA;;QA6DAC;eAAAA;;QAzDAC;eAAAA;;QAKAC;eAAAA;;QAmCAC;eAAAA;;QA1BAC;eAAAA;;QALAC;eAAAA;;QAqCAC;eAAAA;;QAeAC;eAAAA;;QAOAC;eAAAA;;QAKAC;eAAAA;;QAOAC;eAAAA;;QAIAC;eAAAA;;QAIAC;eAAAA;;QAIAC;eAAAA;;;2DA5RD;6DACE;4BAMU;qBACP;0BACmB;;;;;;AAMhC,MAAMpB,iCAAiC;IAAC;IAAW;IAAQ;IAAS;CAAS;AA+C7E,IAAA,AAAKD,qCAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAAAA;;AAiGL,SAASE,iBAAiBoB,iBAAiC,IAAI;;IAClE,MAAMC,OACF,OAAOD,mBAAmB,WACpBE,IAAAA,kBAAQ,EAACC,aAAI,CAACC,IAAI,CAACJ,gBAAgB,mBACnCA;IACV,eAAOC,iBAAAA,2BAAAA,KAAMI,GAAG,uCAAI,CAAC;AACzB;AAEO,SAASxB,qBAAqBmB,iBAAiC,IAAI;;IACtE,MAAMC,OACF,OAAOD,mBAAmB,WACpBM,IAAAA,sBAAY,EAACH,aAAI,CAACC,IAAI,CAACJ,gBAAgB,mBACvCA;IACV,eAAOC,iBAAAA,2BAAAA,KAAMI,GAAG,uCAAI,CAAC;AACzB;AAEO,SAASvB;;QACLF;IAAP,gBAAOA,yBAAAA,mBAAmB2B,IAAI,cAAvB3B,6CAAAA,uBAAyB4B,MAAM,uCAAI,CAAC;AAC/C;AAEO,SAASzB;QAEL0B,M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O,SAASpC,6BAA6BW,iBAAiC,IAAI;IAC9E,MAAMiB,SAAS3B,6BAA6BU;IAE5C,OAAOiB,mBAAAA,6BAAAA,OAAQS,QAAQ;AAC3B;AAEO,SAASlC;IACZ,IAAImC;IACJ,IAAI;QACAA,SAASC,IAAAA,sBAAU,IAAGD,MAAM;IAChC,EAAE,eAAM;QACJ,OAAO;IACX;IACA,MAAME,eAAe1B,aAAI,CAACC,IAAI,CAACuB,QAAQ;IACvC,OAAOP,WAAE,CAACC,UAAU,CAACQ;AACzB;AAEO,SAAS3C;QACLN;IAAP,QAAOA,sCAAAA,kBAAkB,CAAC,sBAAsB,cAAzCA,iDAAAA,sCAA6C,CAAC;AACzD;AAEO,SAASa,SAASO,cAA+B;IACpD,OACIpB,iBAAiBoB,gBAAgBgB,OAAO,KAAK,SAC7CpC,iBAAiBoB,gBAAgBc,IAAI,KAAK;AAElD;AAEO,SAASpB;IACZ,MAAMoC,uBAAuBvC;IAC7B,OAAOuC,qBAAqBC,SAAS,KAAK;AAC9C;AAEO,SAASpC;QAEPf;IADL,OACI,EAACA,6CAAAA,kBAAkB,CAAC,6BAA6B,cAAhDA,wDAAAA,6CACGW,yBAAyB,CAAC,6BAA6B,MAAM;AAEzE;AAEO,SAASK,SAASI,cAA+B;IACpD,OAAOpB,iBAAiBoB,gBAAgBgC,MAAM,KAAK;AACvD;AAEO,SAASnC;QACLP;IAAP,OAAOA,EAAAA,gCAAAA,4CAAAA,oDAAAA,8BAAgC2C,UAAU,MAAK;AAC1D;AAEO,SAASnC;IACZ,OAAOP,yBAAyB,CAAC,sBAAsB,KAAK;AAChE;AAEO,SAASQ,eAAeC,iBAAiC,IAAI;IAChE,OAAO,CAAC,CAACV,6BAA6BU;AAC1C"}
|
|
1
|
+
{"version":3,"sources":["../../src/utils/get-configuration.ts"],"sourcesContent":["import type { Config } from '@jest/types';\nimport type { swcDir } from '@swc/cli';\nimport type { ESLint } from 'eslint';\nimport fs from 'fs';\nimport path from 'path';\nimport type { LinterOptions } from 'stylelint';\nimport type svgr from 'vite-plugin-svgr';\nimport type { ViteUserConfig } from 'vitest/config';\nimport type { Configuration as WebpackDevServerConfiguration } from 'webpack-dev-server';\nimport type { ReviewConfiguration } from '../cli/commands/review';\nimport { getFolders } from './get-folders';\nimport { getPackageName } from './get-package-name';\nimport { log } from './log';\nimport { readJson, readJsonSafe } from './read-json';\nimport { LocationOrJson } from './types';\n\ntype VitePluginSvgrOptions = NonNullable<Parameters<typeof svgr>[0]>;\n\ntype ElementType<T> = T extends readonly (infer ElementType)[] ? ElementType : never;\n\nexport type Bundler = 'vite' | 'webpack';\n\nexport const allowedWebpackDevServerOptions = ['headers', 'port', 'proxy', 'static'] as const;\n\nexport interface MinifyJSOptions {\n compress?: boolean;\n mangle?: boolean;\n}\n\nexport interface MinifyCssOptions {}\n\nexport interface MinifyOptions {\n css?: boolean | MinifyCssOptions;\n js?: boolean | MinifyJSOptions;\n}\n\nexport interface WebpackConfiguration extends Omit<\n Pick<WebpackDevServerConfiguration, ElementType<typeof allowedWebpackDevServerOptions>>,\n 'proxy'\n> {\n 'contentBase'?: boolean | string | string[] | number; // deprecated 2024-07\n 'custom-style-rules'?: boolean;\n 'expose-shared-dependencies'?: boolean;\n 'devServer'?: false | WebpackDevServerConfiguration;\n 'disable-style-check'?: boolean;\n 'minify'?: MinifyOptions;\n 'proxy'?: WebpackDevServerConfiguration['proxy'] | string;\n 'shared-dependencies'?: Record<string, string>;\n}\n\nexport interface ESLintConfiguration extends ESLint.Options {\n disabled?: boolean;\n}\n\nexport interface StylelintConfiguration extends Partial<LinterOptions> {\n ignorePattern?: string[];\n disabled?: boolean;\n}\n\nexport interface JestConfiguration extends Omit<Config.Argv, '_' | '$0'> {\n omitDefault?: string[];\n}\n\nexport interface NodeConfiguration {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n NODE_OPTIONS?: string[];\n}\n\n/* eslint-disable @typescript-eslint/naming-convention */\nexport enum CommandName {\n 'build' = 'build',\n 'bundle-vite' = 'bundle-vite',\n 'bundle-webpack' = 'bundle-webpack',\n 'clean' = 'clean',\n 'convert-eslint-config' = 'convert-eslint-config',\n 'eslint' = 'eslint',\n 'init' = 'init',\n 'install' = 'install',\n 'kendo-ui-license' = 'kendo-ui-license',\n 'lint' = 'lint',\n 'mfe-check' = 'mfe-check',\n 'mfe-generate-metadata' = 'mfe-generate-metadata',\n 'mfe-list' = 'mfe-list',\n 'mfe-package-clean' = 'mfe-package-clean',\n 'mfe-package-publish' = 'mfe-package-publish',\n 'mfe-package-rollback' = 'mfe-package-rollback',\n 'mfe-publish' = 'mfe-publish',\n 'mfe-purge-cache' = 'mfe-purge-cache',\n 'prepare-package' = 'prepare-package',\n 'review' = 'review',\n 'start' = 'start',\n 'stylelint' = 'stylelint',\n 'styles-check' = 'styles-check',\n 'test' = 'test',\n 'task' = 'task',\n 'upload-sourcemaps' = 'upload-sourcemaps',\n}\n/* eslint-enable @typescript-eslint/naming-convention */\n\nexport type VitestConfiguration = ViteUserConfig['test'] & {\n omitDefault?: string[];\n};\n\nexport interface HtmlPluginOptions {\n title?: string;\n favicon?: string;\n template?: string;\n}\n\nexport interface SvgrPluginOptions {\n include?: VitePluginSvgrOptions['include'];\n exclude?: VitePluginSvgrOptions['exclude'];\n svgrOptions?: VitePluginSvgrOptions['svgrOptions'];\n}\n\nexport interface PluginOverrides {\n html?: HtmlPluginOptions;\n svgr?: SvgrPluginOptions;\n}\n\nexport interface ViteBundlerConfig {\n port?: number;\n omitDefault?: string[];\n minify?: MinifyOptions;\n pluginOverrides?: PluginOverrides;\n}\n\nexport interface VitePackageJsonOverride extends ViteBundlerConfig {\n config?: Omit<import('vite').UserConfig, 'plugins'>;\n devServer?: false;\n}\n\nexport interface WebComponentBranchConfigs {\n publishTag?: string;\n uploadSourcemaps?: boolean;\n}\n\ninterface WebComponentOptions {\n legacyRoot?: boolean;\n /**\n * mapping of git branches to configs.\n * Used to separate configs (ex publish tag) depending on current branch\n */\n branches?: Record<string, WebComponentBranchConfigs>;\n}\n\ntype Configuration = {\n 'bundler'?: Bundler;\n 'jest'?: JestConfiguration;\n 'legacy'?: boolean;\n 'lint'?: { eslint: ESLintConfiguration; stylelint: StylelintConfiguration };\n 'review'?: ReviewConfiguration;\n 'swc-compile-package'?: Parameters<typeof swcDir>[0];\n 'test'?: JestConfiguration; // for backward-compatibility\n 'testRunner'?: string;\n 'expose-process-env'?: string[];\n 'expose-shared-dependencies'?: boolean;\n 'shared-dependencies'?: Record<string, string>;\n 'vite'?: false | VitePackageJsonOverride;\n 'vitest'?: VitestConfiguration;\n 'web-component'?: boolean | string | WebComponentOptions;\n 'webpack'?: false | WebpackConfiguration;\n} & {\n [key in CommandName]?: NodeConfiguration;\n} & NodeConfiguration;\n\nexport function getConfiguration(locationOrJson: LocationOrJson = './'): Configuration {\n const json =\n typeof locationOrJson === 'string'\n ? readJson(path.join(locationOrJson, 'package.json'))\n : locationOrJson;\n return json?.cli ?? {};\n}\n\nexport function getConfigurationSafe(locationOrJson: LocationOrJson = './'): Configuration {\n const json =\n typeof locationOrJson === 'string'\n ? readJsonSafe(path.join(locationOrJson, 'package.json'))\n : locationOrJson;\n return json?.cli ?? {};\n}\n\nexport function getESLintConfiguration() {\n return getConfiguration().lint?.eslint ?? {};\n}\n\nexport function getJestConfiguration() {\n const configuration = getConfiguration();\n return configuration.jest ?? configuration.test ?? {};\n}\n\nexport function getReviewConfiguration() {\n return getConfiguration().review ?? {};\n}\n\nexport function getStylelintConfiguration() {\n return getConfiguration().lint?.stylelint ?? {};\n}\n\nexport function getExposeProcessEnv(): string[] {\n return getConfiguration()['expose-process-env'] ?? [];\n}\n\nexport function getViteConfiguration(): VitePackageJsonOverride {\n const { vite } = getConfiguration();\n return typeof vite === 'object' ? vite : {};\n}\n\nexport function getVitestConfiguration() {\n return getConfiguration().vitest ?? {};\n}\n\nexport function getWebpackConfiguration(locationOrJson?: LocationOrJson) {\n const { webpack } = getConfiguration(locationOrJson);\n return typeof webpack === 'object' ? webpack : {};\n}\n\nexport function getWebComponentConfiguration(\n locationOrJson: LocationOrJson = './'\n): WebComponentOptions | undefined {\n const config = getConfigurationSafe(locationOrJson)['web-component'];\n\n if (config === true) {\n return {};\n }\n\n if (typeof config === 'object') {\n return config;\n }\n\n if (typeof config === 'string') {\n const configPath = path.resolve(\n typeof locationOrJson === 'string' ? path.join(locationOrJson, config) : config\n );\n if (fs.existsSync(configPath)) {\n return require(path.resolve(configPath));\n }\n log.warning(`could not find web-component configuration: \"${config}\"`);\n\n return undefined;\n }\n}\n\nexport function getWebComponentBranchConfigs(locationOrJson: LocationOrJson = './') {\n const config = getWebComponentConfiguration(locationOrJson);\n\n return config?.branches;\n}\n\nexport function hasHeadlessBundle() {\n let source: string;\n try {\n source = getFolders().source;\n } catch {\n return false;\n }\n const headlessPath = path.join(source, 'headless.ts');\n return fs.existsSync(headlessPath);\n}\n\nexport function getSwcCompilePackageConfiguration() {\n return getConfiguration()['swc-compile-package'] ?? {};\n}\n\nexport function isBundle(locationOrJson?: LocationOrJson) {\n const { webpack, vite } = getConfiguration(locationOrJson);\n assertBundlersAgree(webpack, vite, locationOrJson);\n return webpack !== false && vite !== false;\n}\n\nexport function isDevServerDisabled() {\n const webpackConfiguration = getWebpackConfiguration();\n return webpackConfiguration.devServer === false;\n}\n\nexport function isViteDevServerDisabled() {\n return getViteConfiguration().devServer === false;\n}\n\nexport function isExposeSharedDependencies() {\n return (\n (getConfiguration()['expose-shared-dependencies'] ??\n getWebpackConfiguration()['expose-shared-dependencies']) === true\n );\n}\n\nexport function isLegacy(locationOrJson?: LocationOrJson) {\n return getConfiguration(locationOrJson).legacy === true;\n}\n\nexport function isLegacyRoot() {\n return getWebComponentConfiguration()?.legacyRoot === true;\n}\n\nexport function isStyleCheckDisabled() {\n return getWebpackConfiguration()['disable-style-check'] === true;\n}\n\nexport function isWebComponent(locationOrJson: LocationOrJson = './') {\n return !!getWebComponentConfiguration(locationOrJson);\n}\n\n/*\n * Require that Vite and Webpack configurations agree whether package is a bundle.\n */\nfunction assertBundlersAgree(\n webpack: Configuration['webpack'],\n vite: Configuration['vite'],\n locationOrJson?: LocationOrJson\n) {\n if (webpack === undefined || vite === undefined || !!webpack === !!vite) {\n return;\n }\n\n const mismatch =\n webpack === false\n ? { falsy: 'cli.webpack', truthy: 'cli.vite' }\n : { falsy: 'cli.vite', truthy: 'cli.webpack' };\n\n throw new Error(\n `package ${getPackageName(locationOrJson)} has conflicting webpack ` +\n `and vite configurations: ${mismatch.falsy} is false but ` +\n `${mismatch.truthy} is not`\n );\n}\n"],"names":["CommandName","allowedWebpackDevServerOptions","getConfiguration","getConfigurationSafe","getESLintConfiguration","getExposeProcessEnv","getJestConfiguration","getReviewConfiguration","getStylelintConfiguration","getSwcCompilePackageConfiguration","getViteConfiguration","getVitestConfiguration","getWebComponentBranchConfigs","getWebComponentConfiguration","getWebpackConfiguration","hasHeadlessBundle","isBundle","isDevServerDisabled","isExposeSharedDependencies","isLegacy","isLegacyRoot","isStyleCheckDisabled","isViteDevServerDisabled","isWebComponent","locationOrJson","json","readJson","path","join","cli","readJsonSafe","lint","eslint","configuration","jest","test","review","stylelint","vite","vitest","webpack","config","configPath","resolve","fs","existsSync","require","log","warning","undefined","branches","source","getFolders","headlessPath","assertBundlersAgree","webpackConfiguration","devServer","legacy","legacyRoot","mismatch","falsy","truthy","Error","getPackageName"],"mappings":";;;;;;;;;;;QAqEYA;eAAAA;;QA/CCC;eAAAA;;QAgJGC;eAAAA;;QAQAC;eAAAA;;QAQAC;eAAAA;;QAiBAC;eAAAA;;QAbAC;eAAAA;;QAKAC;eAAAA;;QAIAC;eAAAA;;QAiEAC;eAAAA;;QAzDAC;eAAAA;;QAKAC;eAAAA;;QAmCAC;eAAAA;;QA1BAC;eAAAA;;QALAC;eAAAA;;QAqCAC;eAAAA;;QAeAC;eAAAA;;QAMAC;eAAAA;;QASAC;eAAAA;;QAOAC;eAAAA;;QAIAC;eAAAA;;QAIAC;eAAAA;;QAnBAC;eAAAA;;QAuBAC;e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AC;AAEvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-package-name.d.ts","sourceRoot":"","sources":["../../src/utils/get-package-name.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-package-name.d.ts","sourceRoot":"","sources":["../../src/utils/get-package-name.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,wBAAgB,cAAc,CAAC,cAAc,GAAE,cAAqB,GAAG,MAAM,CAO5E"}
|
|
@@ -15,8 +15,10 @@ function _interop_require_default(obj) {
|
|
|
15
15
|
default: obj
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
function getPackageName(
|
|
19
|
-
|
|
18
|
+
function getPackageName(locationOrJson = './') {
|
|
19
|
+
var _ref;
|
|
20
|
+
const json = typeof locationOrJson === 'string' ? (0, _readjson.readJson)(_path.default.join(locationOrJson, 'package.json')) : locationOrJson;
|
|
21
|
+
return (_ref = json === null || json === void 0 ? void 0 : json.name) !== null && _ref !== void 0 ? _ref : '';
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
//# sourceMappingURL=get-package-name.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/get-package-name.ts"],"sourcesContent":["import path from 'path';\nimport { readJson } from './read-json';\n\nexport function getPackageName(
|
|
1
|
+
{"version":3,"sources":["../../src/utils/get-package-name.ts"],"sourcesContent":["import path from 'path';\nimport { readJson } from './read-json';\nimport { LocationOrJson } from './types';\n\nexport function getPackageName(locationOrJson: LocationOrJson = './'): string {\n const json =\n typeof locationOrJson === 'string'\n ? readJson(path.join(locationOrJson, 'package.json'))\n : locationOrJson;\n\n return json?.name ?? '';\n}\n"],"names":["getPackageName","locationOrJson","json","readJson","path","join","name"],"mappings":";;;;+BAIgBA;;;eAAAA;;;6DAJC;0BACQ;;;;;;AAGlB,SAASA,eAAeC,iBAAiC,IAAI;;IAChE,MAAMC,OACF,OAAOD,mBAAmB,WACpBE,IAAAA,kBAAQ,EAACC,aAAI,CAACC,IAAI,CAACJ,gBAAgB,mBACnCA;IAEV,eAAOC,iBAAAA,2BAAAA,KAAMI,IAAI,uCAAI;AACzB"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,gCAAgC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,mBAAmB,SAAS,CAAC;AAC7B,cAAc,gCAAgC,CAAC"}
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/index.ts"],"sourcesContent":["export * from './find-packages';\nexport * from './find-up';\nexport * from './format-duration';\nexport * from './format-relative-date';\nexport * from './get-base-tsconfig';\nexport * from './get-branch-configs';\nexport * from './get-configuration';\nexport * from './get-default-test-excludes';\nexport * from './get-destination-folders';\nexport * from './get-folders';\nexport * from './get-jest-config';\nexport * from './get-package-data';\nexport * from './get-package-name';\nexport * from './get-packages';\nexport * from './get-tsconfig';\nexport * from './get-tsconfig-with-fallback';\nexport * from './load-shared-dependencies';\nexport * from './log';\nexport * from './log-errors';\nexport * from './omit';\nexport * from './pick';\nexport * from './prettify';\nexport * from './read-json';\nexport * from './to-array';\nexport * from './validate-shared-dependencies';\n"],"names":[],"mappings":";;;;qBAAc;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;
|
|
1
|
+
{"version":3,"sources":["../../src/utils/index.ts"],"sourcesContent":["export * from './find-packages';\nexport * from './find-up';\nexport * from './format-duration';\nexport * from './format-relative-date';\nexport * from './get-base-tsconfig';\nexport * from './get-branch-configs';\nexport * from './get-configuration';\nexport * from './get-default-test-excludes';\nexport * from './get-destination-folders';\nexport * from './get-folders';\nexport * from './get-jest-config';\nexport * from './get-package-data';\nexport * from './get-package-name';\nexport * from './get-packages';\nexport * from './get-tsconfig';\nexport * from './get-tsconfig-with-fallback';\nexport * from './load-shared-dependencies';\nexport * from './log';\nexport * from './log-errors';\nexport * from './omit';\nexport * from './pick';\nexport * from './prettify';\nexport * from './read-json';\nexport * from './to-array';\nexport type * from './types';\nexport * from './validate-shared-dependencies';\n"],"names":[],"mappings":";;;;qBAAc;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBAEA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/types.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-shared-dependencies.d.ts","sourceRoot":"","sources":["../../src/utils/validate-shared-dependencies.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validate-shared-dependencies.d.ts","sourceRoot":"","sources":["../../src/utils/validate-shared-dependencies.ts"],"names":[],"mappings":"AAQA,wBAAgB,0BAA0B,SAqCzC"}
|
|
@@ -9,8 +9,12 @@ Object.defineProperty(exports, "validateSharedDependencies", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _getconfiguration = require("./get-configuration");
|
|
12
|
+
const _getpackagename = require("./get-package-name");
|
|
12
13
|
function validateSharedDependencies() {
|
|
13
14
|
const config = (0, _getconfiguration.getConfiguration)();
|
|
15
|
+
if ((0, _getconfiguration.isWebComponent)() && (0, _getconfiguration.isExposeSharedDependencies)()) {
|
|
16
|
+
throw new Error('cli.expose-shared-dependencies only applies to host applications.' + `Remove it from ${(0, _getpackagename.getPackageName)()}.`);
|
|
17
|
+
}
|
|
14
18
|
const webpackSharedDependencies = (0, _getconfiguration.getWebpackConfiguration)()['shared-dependencies'];
|
|
15
19
|
const topLevelSharedDependencies = config['shared-dependencies'];
|
|
16
20
|
if (webpackSharedDependencies && topLevelSharedDependencies && JSON.stringify(webpackSharedDependencies) !== JSON.stringify(topLevelSharedDependencies)) {
|