@servicetitan/startup 36.3.1 → 37.0.0
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/bin/vite.js +3 -0
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +13 -9
- package/dist/cli/commands/build.js.map +1 -1
- package/dist/cli/commands/bundle-vite.d.ts +6 -0
- package/dist/cli/commands/bundle-vite.d.ts.map +1 -0
- package/dist/cli/commands/bundle-vite.js +127 -0
- package/dist/cli/commands/bundle-vite.js.map +1 -0
- package/dist/cli/commands/bundle-webpack.d.ts +6 -0
- package/dist/cli/commands/bundle-webpack.d.ts.map +1 -0
- package/dist/cli/commands/{bundle-package.js → bundle-webpack.js} +8 -6
- package/dist/cli/commands/bundle-webpack.js.map +1 -0
- package/dist/cli/commands/install.d.ts.map +1 -1
- package/dist/cli/commands/install.js +2 -1
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/mfe-check.d.ts.map +1 -1
- package/dist/cli/commands/mfe-check.js +2 -2
- package/dist/cli/commands/mfe-check.js.map +1 -1
- package/dist/cli/commands/mfe-generate-metadata.js +2 -2
- package/dist/cli/commands/mfe-generate-metadata.js.map +1 -1
- package/dist/cli/commands/mfe-list.js +1 -1
- package/dist/cli/commands/mfe-list.js.map +1 -1
- package/dist/cli/commands/mfe-package-publish.js.map +1 -1
- package/dist/cli/commands/mfe-publish.js +1 -1
- package/dist/cli/commands/mfe-publish.js.map +1 -1
- package/dist/cli/commands/registry/build.d.ts +14 -0
- package/dist/cli/commands/registry/build.d.ts.map +1 -1
- package/dist/cli/commands/registry/build.js +17 -0
- package/dist/cli/commands/registry/build.js.map +1 -1
- package/dist/cli/commands/registry/bundle-vite.d.ts +33 -0
- package/dist/cli/commands/registry/bundle-vite.d.ts.map +1 -0
- package/dist/cli/commands/registry/bundle-vite.js +45 -0
- package/dist/cli/commands/registry/bundle-vite.js.map +1 -0
- package/dist/cli/commands/registry/{bundle-package.d.ts → bundle-webpack.d.ts} +1 -1
- package/dist/cli/commands/registry/bundle-webpack.d.ts.map +1 -0
- package/dist/cli/commands/registry/{bundle-package.js → bundle-webpack.js} +1 -1
- package/dist/cli/commands/registry/{bundle-package.js.map → bundle-webpack.js.map} +1 -1
- package/dist/cli/commands/registry/command-registry.d.ts +57 -1
- package/dist/cli/commands/registry/command-registry.d.ts.map +1 -1
- package/dist/cli/commands/registry/command-registry.js +4 -2
- package/dist/cli/commands/registry/command-registry.js.map +1 -1
- package/dist/cli/commands/registry/start.d.ts +10 -0
- package/dist/cli/commands/registry/start.d.ts.map +1 -1
- package/dist/cli/commands/registry/start.js +13 -0
- 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 +11 -22
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/index.js +3 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/tasks/swc-compile-package/swc-compile-package.d.ts.map +1 -1
- package/dist/cli/tasks/swc-compile-package/swc-compile-package.js +8 -3
- package/dist/cli/tasks/swc-compile-package/swc-compile-package.js.map +1 -1
- package/dist/cli/tasks/tsc-compile/tsc-compile.js +1 -1
- package/dist/cli/tasks/tsc-compile/tsc-compile.js.map +1 -1
- package/dist/cli/utils/copy-files.js +1 -0
- package/dist/cli/utils/copy-files.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 -1
- package/dist/cli/utils/index.d.ts.map +1 -1
- package/dist/cli/utils/index.js +3 -1
- 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 +4 -0
- package/dist/core/check-resource/check-resource.d.ts.map +1 -0
- package/dist/core/check-resource/check-resource.js +51 -0
- package/dist/core/check-resource/check-resource.js.map +1 -0
- package/dist/core/check-resource/get-package-json.d.ts +10 -0
- package/dist/core/check-resource/get-package-json.d.ts.map +1 -0
- package/dist/{webpack/configs/plugins/ignore-plugin → core/check-resource}/get-package-json.js +12 -10
- package/dist/core/check-resource/get-package-json.js.map +1 -0
- package/dist/core/check-resource/get-peer-dependency-meta.d.ts +17 -0
- package/dist/core/check-resource/get-peer-dependency-meta.d.ts.map +1 -0
- package/dist/core/check-resource/get-peer-dependency-meta.js +73 -0
- package/dist/core/check-resource/get-peer-dependency-meta.js.map +1 -0
- package/dist/core/check-resource/index.d.ts +3 -0
- package/dist/core/check-resource/index.d.ts.map +1 -0
- package/dist/core/check-resource/index.js +13 -0
- package/dist/core/check-resource/index.js.map +1 -0
- package/dist/core/check-resource/is-managed-react-dom-client-dependency.d.ts +8 -0
- package/dist/core/check-resource/is-managed-react-dom-client-dependency.d.ts.map +1 -0
- package/dist/core/check-resource/is-managed-react-dom-client-dependency.js +15 -0
- package/dist/core/check-resource/is-managed-react-dom-client-dependency.js.map +1 -0
- 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 +6 -0
- package/dist/core/check-resource/types.d.ts.map +1 -0
- package/dist/core/check-resource/types.js.map +1 -0
- 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/constants.d.ts +17 -0
- package/dist/core/constants.d.ts.map +1 -0
- package/dist/core/constants.js +28 -0
- package/dist/core/constants.js.map +1 -0
- package/dist/core/create-build-context.d.ts +13 -0
- package/dist/core/create-build-context.d.ts.map +1 -0
- package/dist/core/create-build-context.js +54 -0
- package/dist/core/create-build-context.js.map +1 -0
- 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/defines/define-exposed-dependencies.d.ts +5 -0
- package/dist/core/defines/define-exposed-dependencies.d.ts.map +1 -0
- package/dist/core/defines/define-exposed-dependencies.js +32 -0
- package/dist/core/defines/define-exposed-dependencies.js.map +1 -0
- package/dist/core/defines/define-exposed-instance-dependencies.d.ts +5 -0
- package/dist/core/defines/define-exposed-instance-dependencies.d.ts.map +1 -0
- package/dist/core/defines/define-exposed-instance-dependencies.js +29 -0
- package/dist/core/defines/define-exposed-instance-dependencies.js.map +1 -0
- package/dist/core/defines/define-web-component-name.d.ts +5 -0
- package/dist/core/defines/define-web-component-name.d.ts.map +1 -0
- package/dist/core/defines/define-web-component-name.js +23 -0
- package/dist/core/defines/define-web-component-name.js.map +1 -0
- package/dist/core/defines/index.d.ts +4 -0
- package/dist/core/defines/index.d.ts.map +1 -0
- package/dist/core/defines/index.js +26 -0
- package/dist/core/defines/index.js.map +1 -0
- package/dist/core/externals.d.ts +3 -0
- package/dist/core/externals.d.ts.map +1 -0
- package/dist/core/externals.js +28 -0
- package/dist/core/externals.js.map +1 -0
- package/dist/core/get-build-name.d.ts +2 -0
- package/dist/core/get-build-name.d.ts.map +1 -0
- package/dist/core/get-build-name.js +24 -0
- package/dist/core/get-build-name.js.map +1 -0
- package/dist/core/get-bundle-type.d.ts +3 -0
- package/dist/core/get-bundle-type.d.ts.map +1 -0
- package/dist/{webpack/configs/utils → core}/get-bundle-type.js +4 -2
- package/dist/core/get-bundle-type.js.map +1 -0
- package/dist/core/get-cdn-path.d.ts +3 -0
- package/dist/core/get-cdn-path.d.ts.map +1 -0
- package/dist/core/get-cdn-path.js +15 -0
- package/dist/core/get-cdn-path.js.map +1 -0
- package/dist/core/get-exposed-dependencies.d.ts.map +1 -0
- package/dist/core/get-exposed-dependencies.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/get-shared-entry-points.d.ts +11 -0
- package/dist/core/get-shared-entry-points.d.ts.map +1 -0
- package/dist/core/get-shared-entry-points.js +43 -0
- package/dist/core/get-shared-entry-points.js.map +1 -0
- package/dist/core/get-version/get-launchdarkly-sdk-version.d.ts.map +1 -0
- package/dist/core/get-version/get-launchdarkly-sdk-version.js.map +1 -0
- package/dist/core/get-version/get-startup-version.d.ts.map +1 -0
- package/dist/{utils → core/get-version}/get-startup-version.js +2 -2
- package/dist/core/get-version/get-startup-version.js.map +1 -0
- package/dist/core/get-version/get-web-components-version.d.ts.map +1 -0
- package/dist/core/get-version/get-web-components-version.js.map +1 -0
- package/dist/core/get-version/index.d.ts +4 -0
- package/dist/core/get-version/index.d.ts.map +1 -0
- package/dist/core/get-version/index.js +22 -0
- package/dist/core/get-version/index.js.map +1 -0
- package/dist/core/index.d.ts +24 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +41 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/metadata/build-metadata.d.ts.map +1 -0
- package/dist/{webpack/configs/utils → core/metadata}/build-metadata.js +5 -6
- package/dist/core/metadata/build-metadata.js.map +1 -0
- package/dist/core/metadata/generate-exposed-dependencies-metadata.d.ts +3 -0
- package/dist/core/metadata/generate-exposed-dependencies-metadata.d.ts.map +1 -0
- package/dist/core/metadata/generate-exposed-dependencies-metadata.js +42 -0
- package/dist/core/metadata/generate-exposed-dependencies-metadata.js.map +1 -0
- package/dist/core/metadata/generate-metadata.d.ts +3 -0
- package/dist/core/metadata/generate-metadata.d.ts.map +1 -0
- package/dist/{webpack/configs/utils → core/metadata}/generate-metadata.js +5 -4
- package/dist/core/metadata/generate-metadata.js.map +1 -0
- package/dist/core/metadata/index.d.ts +4 -0
- package/dist/core/metadata/index.d.ts.map +1 -0
- package/dist/{webpack/configs/utils → core/metadata}/index.js +2 -2
- package/dist/core/metadata/index.js.map +1 -0
- 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/stringify-config.d.ts.map +1 -0
- package/dist/core/stringify-config.js.map +1 -0
- package/dist/core/types.d.ts +50 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +6 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/virtual-modules.d.ts +8 -0
- package/dist/core/virtual-modules.d.ts.map +1 -0
- package/dist/core/virtual-modules.js +83 -0
- package/dist/core/virtual-modules.js.map +1 -0
- 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/cypress/config/webpack-config.d.ts +1 -1
- package/dist/cypress/config/webpack-config.d.ts.map +1 -1
- package/dist/cypress/config/webpack-config.js +20 -8
- package/dist/cypress/config/webpack-config.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.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/storybook-config/webpack-final.d.ts +1 -1
- package/dist/storybook-config/webpack-final.d.ts.map +1 -1
- package/dist/storybook-config/webpack-final.js +18 -13
- package/dist/storybook-config/webpack-final.js.map +1 -1
- package/dist/utils/get-configuration.d.ts +47 -11
- package/dist/utils/get-configuration.d.ts.map +1 -1
- package/dist/utils/get-configuration.js +43 -9
- package/dist/utils/get-configuration.js.map +1 -1
- package/dist/utils/get-package-data.d.ts.map +1 -1
- package/dist/utils/get-package-data.js +3 -2
- package/dist/utils/get-package-data.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/get-packages.d.ts +1 -1
- package/dist/utils/get-packages.d.ts.map +1 -1
- package/dist/utils/get-packages.js +1 -1
- package/dist/utils/get-packages.js.map +1 -1
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +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 +2 -0
- package/dist/utils/validate-shared-dependencies.d.ts.map +1 -0
- package/dist/utils/validate-shared-dependencies.js +30 -0
- package/dist/utils/validate-shared-dependencies.js.map +1 -0
- package/dist/vite/build-shared-dependencies.d.ts +3 -0
- package/dist/vite/build-shared-dependencies.d.ts.map +1 -0
- package/dist/vite/build-shared-dependencies.js +60 -0
- package/dist/vite/build-shared-dependencies.js.map +1 -0
- 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 +4 -0
- package/dist/vite/config/base-config.d.ts.map +1 -0
- package/dist/vite/config/base-config.js +176 -0
- package/dist/vite/config/base-config.js.map +1 -0
- 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 +6 -0
- package/dist/vite/config/create-vite-build-context.d.ts.map +1 -0
- package/dist/vite/config/create-vite-build-context.js +43 -0
- package/dist/vite/config/create-vite-build-context.js.map +1 -0
- package/dist/vite/config/create-vite-config.d.ts +3 -0
- package/dist/vite/config/create-vite-config.d.ts.map +1 -0
- package/dist/vite/config/create-vite-config.js +60 -0
- package/dist/vite/config/create-vite-config.js.map +1 -0
- package/dist/vite/config/define-config.d.ts +13 -0
- package/dist/vite/config/define-config.d.ts.map +1 -0
- package/dist/vite/config/define-config.js +15 -0
- package/dist/vite/config/define-config.js.map +1 -0
- 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/config/index.d.ts +6 -0
- package/dist/vite/config/index.d.ts.map +1 -0
- package/dist/vite/config/index.js +24 -0
- package/dist/vite/config/index.js.map +1 -0
- package/dist/vite/config/load-config-file.d.ts +4 -0
- package/dist/vite/config/load-config-file.d.ts.map +1 -0
- package/dist/vite/config/load-config-file.js +103 -0
- package/dist/vite/config/load-config-file.js.map +1 -0
- package/dist/vite/config/merge-vite-configs.d.ts +5 -0
- package/dist/vite/config/merge-vite-configs.d.ts.map +1 -0
- package/dist/vite/config/merge-vite-configs.js +17 -0
- package/dist/vite/config/merge-vite-configs.js.map +1 -0
- package/dist/vite/index.d.ts +2 -0
- package/dist/vite/index.d.ts.map +1 -0
- package/dist/vite/index.html +33 -0
- package/dist/vite/index.js +20 -0
- package/dist/vite/index.js.map +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/css-injector-plugin.d.ts +4 -0
- package/dist/vite/plugins/css-injector-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/css-injector-plugin.js +42 -0
- package/dist/vite/plugins/css-injector-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/dev-server-routing-plugin.d.ts +24 -0
- package/dist/vite/plugins/dev-server-routing-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/dev-server-routing-plugin.js +85 -0
- package/dist/vite/plugins/dev-server-routing-plugin.js.map +1 -0
- package/dist/vite/plugins/externals-plugin.d.ts +4 -0
- package/dist/vite/plugins/externals-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/externals-plugin.js +60 -0
- package/dist/vite/plugins/externals-plugin.js.map +1 -0
- package/dist/vite/plugins/html-plugin.d.ts +4 -0
- package/dist/vite/plugins/html-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/html-plugin.js +118 -0
- package/dist/vite/plugins/html-plugin.js.map +1 -0
- package/dist/vite/plugins/ignore-modules-plugin.d.ts +21 -0
- package/dist/vite/plugins/ignore-modules-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/ignore-modules-plugin.js +58 -0
- package/dist/vite/plugins/ignore-modules-plugin.js.map +1 -0
- package/dist/vite/plugins/index.d.ts +17 -0
- package/dist/vite/plugins/index.d.ts.map +1 -0
- package/dist/vite/plugins/index.js +35 -0
- package/dist/vite/plugins/index.js.map +1 -0
- 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.d.ts +4 -0
- package/dist/vite/plugins/metadata-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/metadata-plugin.js +76 -0
- package/dist/vite/plugins/metadata-plugin.js.map +1 -0
- 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 +8 -0
- package/dist/vite/plugins/shared-dependencies-plugin/shared-dependencies-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/shared-dependencies-plugin/shared-dependencies-plugin.js +174 -0
- package/dist/vite/plugins/shared-dependencies-plugin/shared-dependencies-plugin.js.map +1 -0
- package/dist/vite/plugins/style-urls-plugin.d.ts +4 -0
- package/dist/vite/plugins/style-urls-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/style-urls-plugin.js +31 -0
- package/dist/vite/plugins/style-urls-plugin.js.map +1 -0
- package/dist/vite/plugins/svgr-plugin.d.ts +4 -0
- package/dist/vite/plugins/svgr-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/svgr-plugin.js +33 -0
- package/dist/vite/plugins/svgr-plugin.js.map +1 -0
- package/dist/vite/plugins/utils/get-css-file-names.d.ts +5 -0
- package/dist/vite/plugins/utils/get-css-file-names.d.ts.map +1 -0
- package/dist/vite/plugins/utils/get-css-file-names.js +21 -0
- package/dist/vite/plugins/utils/get-css-file-names.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/vite/plugins/virtual-modules-plugin.d.ts +4 -0
- package/dist/vite/plugins/virtual-modules-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/virtual-modules-plugin.js +54 -0
- package/dist/vite/plugins/virtual-modules-plugin.js.map +1 -0
- package/dist/vite/types.d.ts +4 -0
- package/dist/vite/types.d.ts.map +1 -0
- package/dist/vite/types.js +6 -0
- package/dist/vite/types.js.map +1 -0
- package/dist/vite/validate-shared-dependencies.d.ts +2 -0
- package/dist/vite/validate-shared-dependencies.d.ts.map +1 -0
- package/dist/vite/validate-shared-dependencies.js +27 -0
- package/dist/vite/validate-shared-dependencies.js.map +1 -0
- package/dist/webpack/bundle-webpack.d.ts +11 -0
- package/dist/webpack/bundle-webpack.d.ts.map +1 -0
- package/dist/webpack/bundle-webpack.js +107 -0
- package/dist/webpack/bundle-webpack.js.map +1 -0
- package/dist/webpack/configs/amd-config.d.ts +3 -2
- package/dist/webpack/configs/amd-config.d.ts.map +1 -1
- package/dist/webpack/configs/amd-config.js.map +1 -1
- package/dist/webpack/configs/cache-config.d.ts +3 -2
- package/dist/webpack/configs/cache-config.d.ts.map +1 -1
- package/dist/webpack/configs/cache-config.js +5 -18
- package/dist/webpack/configs/cache-config.js.map +1 -1
- package/dist/webpack/configs/dev-server-config.d.ts +2 -2
- package/dist/webpack/configs/dev-server-config.d.ts.map +1 -1
- package/dist/webpack/configs/dev-server-config.js +8 -8
- package/dist/webpack/configs/dev-server-config.js.map +1 -1
- package/dist/webpack/configs/devtool-config.d.ts +3 -2
- package/dist/webpack/configs/devtool-config.d.ts.map +1 -1
- package/dist/webpack/configs/devtool-config.js +1 -1
- package/dist/webpack/configs/devtool-config.js.map +1 -1
- package/dist/webpack/configs/entry.config.d.ts +3 -2
- package/dist/webpack/configs/entry.config.d.ts.map +1 -1
- package/dist/webpack/configs/entry.config.js +6 -5
- package/dist/webpack/configs/entry.config.js.map +1 -1
- package/dist/webpack/configs/externals-config.d.ts +3 -2
- package/dist/webpack/configs/externals-config.d.ts.map +1 -1
- package/dist/webpack/configs/externals-config.js +4 -14
- package/dist/webpack/configs/externals-config.js.map +1 -1
- package/dist/webpack/configs/index.d.ts +0 -1
- package/dist/webpack/configs/index.d.ts.map +1 -1
- package/dist/webpack/configs/index.js.map +1 -1
- package/dist/webpack/configs/loaders/css-loader.d.ts +3 -3
- package/dist/webpack/configs/loaders/css-loader.d.ts.map +1 -1
- package/dist/webpack/configs/loaders/css-loader.js +5 -4
- package/dist/webpack/configs/loaders/css-loader.js.map +1 -1
- package/dist/webpack/configs/loaders/style-loader.d.ts +2 -2
- package/dist/webpack/configs/loaders/style-loader.d.ts.map +1 -1
- package/dist/webpack/configs/loaders/style-loader.js +3 -1
- package/dist/webpack/configs/loaders/style-loader.js.map +1 -1
- package/dist/webpack/configs/module-config.d.ts +2 -2
- package/dist/webpack/configs/module-config.d.ts.map +1 -1
- package/dist/webpack/configs/module-config.js.map +1 -1
- package/dist/webpack/configs/optimization-config.d.ts +2 -2
- package/dist/webpack/configs/optimization-config.d.ts.map +1 -1
- package/dist/webpack/configs/optimization-config.js +62 -31
- package/dist/webpack/configs/optimization-config.js.map +1 -1
- package/dist/webpack/configs/output-config.d.ts +3 -2
- package/dist/webpack/configs/output-config.d.ts.map +1 -1
- package/dist/webpack/configs/output-config.js +10 -25
- package/dist/webpack/configs/output-config.js.map +1 -1
- package/dist/webpack/configs/plugins/assets-manifest-plugin.d.ts +3 -8
- package/dist/webpack/configs/plugins/assets-manifest-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/assets-manifest-plugin.js +21 -50
- package/dist/webpack/configs/plugins/assets-manifest-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/bundle-analyser-plugin.d.ts +3 -2
- package/dist/webpack/configs/plugins/bundle-analyser-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/bundle-analyser-plugin.js +4 -23
- package/dist/webpack/configs/plugins/bundle-analyser-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.d.ts +3 -2
- package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.js +4 -17
- package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/define-exposed-instance-dependencies-plugin.d.ts +3 -2
- package/dist/webpack/configs/plugins/define-exposed-instance-dependencies-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/define-exposed-instance-dependencies-plugin.js +4 -12
- package/dist/webpack/configs/plugins/define-exposed-instance-dependencies-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/define-web-component-name-plugin.d.ts +3 -2
- package/dist/webpack/configs/plugins/define-web-component-name-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/define-web-component-name-plugin.js +4 -6
- package/dist/webpack/configs/plugins/define-web-component-name-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/filter-warnings-plugin.d.ts +3 -2
- package/dist/webpack/configs/plugins/filter-warnings-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/filter-warnings-plugin.js +2 -2
- package/dist/webpack/configs/plugins/filter-warnings-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/html-plugin.d.ts +3 -2
- package/dist/webpack/configs/plugins/html-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/html-plugin.js +4 -2
- package/dist/webpack/configs/plugins/html-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/html-tags-plugin.d.ts +3 -2
- package/dist/webpack/configs/plugins/html-tags-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/html-tags-plugin.js +16 -21
- package/dist/webpack/configs/plugins/html-tags-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 +27 -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 +42 -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/mini-css-extract-plugin.d.ts +2 -2
- package/dist/webpack/configs/plugins/mini-css-extract-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/mini-css-extract-plugin.js +4 -2
- package/dist/webpack/configs/plugins/mini-css-extract-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/moment-locales-plugin.d.ts +3 -2
- 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/remove-empty-scripts-plugin.d.ts +3 -2
- package/dist/webpack/configs/plugins/remove-empty-scripts-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/remove-empty-scripts-plugin.js +1 -1
- package/dist/webpack/configs/plugins/remove-empty-scripts-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/virtual-modules-plugin.d.ts +3 -3
- package/dist/webpack/configs/plugins/virtual-modules-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/virtual-modules-plugin.js +13 -56
- package/dist/webpack/configs/plugins/virtual-modules-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/watch-run-plugin.d.ts +3 -2
- package/dist/webpack/configs/plugins/watch-run-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/watch-run-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins-config.d.ts +3 -2
- 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/resolve-config.d.ts +3 -2
- package/dist/webpack/configs/resolve-config.d.ts.map +1 -1
- package/dist/webpack/configs/resolve-config.js +2 -1
- package/dist/webpack/configs/resolve-config.js.map +1 -1
- package/dist/webpack/configs/rules/css-rules.d.ts +2 -2
- package/dist/webpack/configs/rules/css-rules.d.ts.map +1 -1
- package/dist/webpack/configs/rules/css-rules.js +2 -1
- package/dist/webpack/configs/rules/css-rules.js.map +1 -1
- package/dist/webpack/configs/rules/font-rules.d.ts +2 -2
- 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 +2 -2
- 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/configs/rules/js-rules.d.ts +2 -2
- package/dist/webpack/configs/rules/js-rules.d.ts.map +1 -1
- package/dist/webpack/configs/rules/js-rules.js +2 -1
- package/dist/webpack/configs/rules/js-rules.js.map +1 -1
- package/dist/webpack/configs/rules/less-rules.d.ts +2 -2
- package/dist/webpack/configs/rules/less-rules.d.ts.map +1 -1
- package/dist/webpack/configs/rules/less-rules.js.map +1 -1
- package/dist/webpack/configs/rules/scss-rules.d.ts +2 -2
- package/dist/webpack/configs/rules/scss-rules.d.ts.map +1 -1
- package/dist/webpack/configs/rules/scss-rules.js.map +1 -1
- package/dist/webpack/configs/rules/svg-rules.d.ts +2 -2
- package/dist/webpack/configs/rules/svg-rules.d.ts.map +1 -1
- package/dist/webpack/configs/rules/svg-rules.js.map +1 -1
- package/dist/webpack/configs/rules-config.d.ts +2 -2
- package/dist/webpack/configs/rules-config.d.ts.map +1 -1
- package/dist/webpack/configs/rules-config.js +2 -2
- package/dist/webpack/configs/rules-config.js.map +1 -1
- package/dist/webpack/configs/stats-config.d.ts +3 -2
- package/dist/webpack/configs/stats-config.d.ts.map +1 -1
- package/dist/webpack/configs/stats-config.js.map +1 -1
- package/dist/webpack/configs/watch-options-config.d.ts +2 -2
- package/dist/webpack/configs/watch-options-config.d.ts.map +1 -1
- package/dist/webpack/configs/watch-options-config.js +2 -2
- package/dist/webpack/configs/watch-options-config.js.map +1 -1
- package/dist/webpack/create-webpack-config.d.ts +2 -0
- package/dist/webpack/create-webpack-config.d.ts.map +1 -1
- package/dist/webpack/create-webpack-config.js +43 -49
- package/dist/webpack/create-webpack-config.js.map +1 -1
- package/dist/webpack/create-webpack-configs.d.ts +16 -0
- package/dist/webpack/create-webpack-configs.d.ts.map +1 -0
- package/dist/webpack/create-webpack-configs.js +80 -0
- package/dist/webpack/create-webpack-configs.js.map +1 -0
- package/dist/webpack/index.d.ts +2 -0
- package/dist/webpack/index.d.ts.map +1 -1
- package/dist/webpack/index.js +2 -0
- package/dist/webpack/index.js.map +1 -1
- package/dist/webpack/types.d.ts +4 -11
- package/dist/webpack/types.d.ts.map +1 -1
- package/dist/webpack/utils/create-webpack-build-context.d.ts +4 -0
- package/dist/webpack/utils/create-webpack-build-context.d.ts.map +1 -0
- package/dist/webpack/utils/create-webpack-build-context.js +20 -0
- package/dist/webpack/utils/create-webpack-build-context.js.map +1 -0
- package/dist/webpack/utils/index.d.ts +1 -1
- package/dist/webpack/utils/index.d.ts.map +1 -1
- package/dist/webpack/utils/index.js +1 -1
- package/dist/webpack/utils/index.js.map +1 -1
- package/jest/babel-plugin-import-meta-env.js +18 -0
- package/jest/jest-preset.js +5 -2
- package/package.json +40 -28
- package/src/cli/commands/__tests__/build.test.ts +35 -7
- package/src/cli/commands/__tests__/bundle-vite.test.ts +277 -0
- package/src/cli/commands/__tests__/{bundle-package.test.ts → bundle-webpack.test.ts} +26 -17
- package/src/cli/commands/__tests__/install.test.ts +6 -2
- package/src/cli/commands/__tests__/mfe-generate-metadata.test.ts +13 -10
- package/src/cli/commands/__tests__/mfe-publish.test.ts +4 -4
- package/src/cli/commands/__tests__/start.test.ts +18 -5
- package/src/cli/commands/build.ts +14 -12
- package/src/cli/commands/bundle-vite.ts +95 -0
- package/src/cli/commands/{bundle-package.ts → bundle-webpack.ts} +9 -6
- package/src/cli/commands/install.ts +2 -1
- package/src/cli/commands/mfe-check.ts +1 -2
- package/src/cli/commands/mfe-generate-metadata.ts +1 -1
- package/src/cli/commands/mfe-list.ts +1 -1
- package/src/cli/commands/mfe-package-publish.ts +1 -1
- package/src/cli/commands/mfe-publish.ts +1 -1
- package/src/cli/commands/registry/__tests__/command-registry.test.ts +1 -0
- package/src/cli/commands/registry/build.ts +7 -0
- package/src/cli/commands/registry/bundle-vite.ts +14 -0
- package/src/cli/commands/registry/command-registry.ts +4 -2
- package/src/cli/commands/registry/start.ts +6 -0
- 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 +15 -29
- package/src/cli/index.ts +4 -3
- package/src/cli/tasks/swc-compile-package/__tests__/swc-compile-package.test.ts +21 -1
- package/src/cli/tasks/swc-compile-package/swc-cli.d.ts +1 -1
- package/src/cli/tasks/swc-compile-package/swc-compile-package.ts +9 -3
- package/src/cli/tasks/tsc-compile/tsc-compile.ts +1 -1
- 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/copy-files.ts +1 -1
- 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 -1
- 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__/get-cdn-path.test.ts +27 -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 +72 -0
- package/src/{webpack/configs/plugins/ignore-plugin → core/check-resource}/__tests__/get-package-json.test.ts +2 -1
- package/src/core/check-resource/__tests__/get-peer-dependency-meta.test.ts +108 -0
- package/src/core/check-resource/__tests__/is-managed-react-dom-client-dependency.test.ts +35 -0
- package/src/core/check-resource/__tests__/is-resolvable.test.ts +20 -0
- package/src/core/check-resource/check-resource.ts +31 -0
- package/src/core/check-resource/get-package-json.ts +33 -0
- package/src/core/check-resource/get-peer-dependency-meta.ts +78 -0
- package/src/core/check-resource/index.ts +2 -0
- package/src/core/check-resource/is-managed-react-dom-client-dependency.ts +13 -0
- package/src/core/check-resource/is-resolvable.ts +19 -0
- package/src/core/check-resource/types.ts +6 -0
- package/src/core/chunk-patterns.ts +30 -0
- package/src/core/constants.ts +16 -0
- package/src/core/create-build-context.ts +61 -0
- package/src/core/create-extension-regexp.ts +7 -0
- package/src/core/defines/define-exposed-dependencies.ts +25 -0
- package/src/core/defines/define-exposed-instance-dependencies.ts +19 -0
- package/src/core/defines/define-web-component-name.ts +15 -0
- package/src/core/defines/index.ts +3 -0
- package/src/core/externals.ts +22 -0
- package/src/core/get-build-name.ts +11 -0
- package/src/core/get-bundle-type.ts +19 -0
- package/src/core/get-cdn-path.ts +5 -0
- package/src/core/get-process-env.ts +17 -0
- package/src/core/get-shared-entry-points.ts +37 -0
- package/src/core/get-version/get-startup-version.ts +6 -0
- package/src/core/get-version/index.ts +3 -0
- package/src/core/index.ts +23 -0
- package/src/{webpack/configs/utils → core/metadata}/__tests__/build-metadata.test.ts +10 -6
- package/src/{webpack/configs/utils → core/metadata}/__tests__/generate-metadata.test.ts +25 -13
- package/src/{webpack/configs/utils → core/metadata}/build-metadata.ts +6 -3
- package/src/core/metadata/generate-exposed-dependencies-metadata.ts +20 -0
- package/src/{webpack/configs/utils → core/metadata}/generate-metadata.ts +8 -6
- package/src/core/metadata/index.ts +3 -0
- 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 +54 -0
- package/src/core/virtual-modules.ts +74 -0
- package/src/cypress/config/__tests__/vite-config.test.ts +72 -0
- package/src/cypress/config/__tests__/webpack-config.test.ts +4 -3
- package/src/cypress/config/index.ts +1 -0
- package/src/cypress/config/vite-config.ts +37 -0
- package/src/cypress/config/webpack-config.ts +24 -11
- package/src/index.ts +1 -0
- package/src/storybook-config/__tests__/vite-final.test.ts +122 -0
- package/src/storybook-config/__tests__/webpack-final.test.ts +5 -27
- package/src/storybook-config/index.ts +1 -0
- package/src/storybook-config/vite-final.ts +65 -0
- package/src/storybook-config/webpack-final.ts +23 -15
- package/src/utils/__tests__/get-configuration.test.ts +109 -11
- package/src/utils/__tests__/get-package-data.test.ts +35 -1
- package/src/utils/__tests__/get-package-name.test.ts +57 -0
- package/src/utils/__tests__/get-packages.test.ts +4 -4
- package/src/utils/__tests__/validate-shared-dependencies.test.ts +70 -0
- package/src/utils/get-configuration.ts +96 -17
- package/src/utils/get-package-data.ts +3 -1
- package/src/utils/get-package-name.ts +8 -2
- package/src/utils/get-packages.ts +2 -2
- package/src/utils/index.ts +2 -1
- package/src/utils/types.ts +1 -0
- package/src/utils/validate-shared-dependencies.ts +46 -0
- package/src/vite/__tests__/build-shared-dependencies.test.ts +234 -0
- package/src/vite/__tests__/validate-shared-dependencies.test.ts +45 -0
- package/src/vite/build-shared-dependencies.ts +52 -0
- package/src/vite/config/__tests__/asset-file-names.test.ts +40 -0
- package/src/vite/config/__tests__/base-config.test.ts +377 -0
- 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 +89 -0
- package/src/vite/config/__tests__/create-vite-config.test.ts +219 -0
- package/src/vite/config/__tests__/define-config.test.ts +23 -0
- package/src/vite/config/__tests__/get-warmup-client-files.test.ts +20 -0
- package/src/vite/config/__tests__/load-config-file.test.ts +191 -0
- package/src/vite/config/__tests__/merge-vite-configs.test.ts +84 -0
- package/src/vite/config/asset-file-names.ts +20 -0
- package/src/vite/config/base-config.ts +145 -0
- 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 +43 -0
- package/src/vite/config/create-vite-config.ts +66 -0
- package/src/vite/config/define-config.ts +18 -0
- package/src/vite/config/get-warmup-client-files.ts +13 -0
- package/src/vite/config/index.ts +5 -0
- package/src/vite/config/load-config-file.ts +52 -0
- package/src/vite/config/merge-vite-configs.ts +15 -0
- package/src/vite/index.html +33 -0
- package/src/vite/index.ts +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__/css-injector-plugin.test.ts +119 -0
- package/src/vite/plugins/__tests__/design-system-guard-plugin.test.ts +83 -0
- package/src/vite/plugins/__tests__/dev-server-routing-plugin.test.ts +255 -0
- package/src/vite/plugins/__tests__/externals-plugin.test.ts +138 -0
- package/src/vite/plugins/__tests__/html-plugin.test.ts +360 -0
- package/src/vite/plugins/__tests__/html-template.test.ts +103 -0
- package/src/vite/plugins/__tests__/ignore-modules-plugin.test.ts +107 -0
- package/src/vite/plugins/__tests__/istanbul-plugin.test.ts +62 -0
- package/src/vite/plugins/__tests__/metadata-plugin.test.ts +163 -0
- package/src/vite/plugins/__tests__/moment-locales-plugin.test.ts +104 -0
- package/src/vite/plugins/__tests__/style-urls-plugin.test.ts +77 -0
- package/src/vite/plugins/__tests__/svgr-plugin.test.ts +67 -0
- package/src/vite/plugins/__tests__/virtual-modules-plugin.test.ts +101 -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/css-injector-plugin.ts +65 -0
- package/src/vite/plugins/design-system-guard-plugin.ts +34 -0
- package/src/vite/plugins/dev-server-routing-plugin.ts +96 -0
- package/src/vite/plugins/externals-plugin.ts +81 -0
- package/src/vite/plugins/html-plugin.ts +111 -0
- package/src/vite/plugins/ignore-modules-plugin.ts +51 -0
- package/src/vite/plugins/index.ts +16 -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 +65 -0
- 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/shared-dependencies-plugin/__tests__/shared-dependencies-plugin.test.ts +461 -0
- 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/shared-dependencies-plugin.ts +182 -0
- package/src/vite/plugins/style-urls-plugin.ts +21 -0
- package/src/vite/plugins/svgr-plugin.ts +17 -0
- package/src/vite/plugins/utils/get-css-file-names.ts +11 -0
- package/src/vite/plugins/utils/import-esm.ts +15 -0
- package/src/vite/plugins/utils/index.ts +2 -0
- package/src/vite/plugins/virtual-modules-plugin.ts +46 -0
- package/src/vite/rolldown-oxc.d.ts +20 -0
- package/src/vite/types.ts +6 -0
- package/src/vite/validate-shared-dependencies.ts +27 -0
- package/src/webpack/__mocks__/style-rules.ts +15 -3
- package/src/{cli/utils/__tests__/bundle.test.ts → webpack/__tests__/bundle-webpack.test.ts} +33 -26
- package/src/webpack/__tests__/create-webpack-config-shared-dependencies.test.ts +91 -16
- package/src/webpack/__tests__/create-webpack-config-web-component.test.ts +85 -26
- package/src/webpack/__tests__/create-webpack-config.test.ts +97 -13
- package/src/webpack/bundle-webpack.ts +107 -0
- package/src/webpack/configs/amd-config.ts +3 -2
- package/src/webpack/configs/cache-config.ts +7 -15
- package/src/webpack/configs/dev-server-config.ts +16 -17
- package/src/webpack/configs/devtool-config.ts +4 -3
- package/src/webpack/configs/entry.config.ts +8 -7
- package/src/webpack/configs/externals-config.ts +5 -21
- package/src/webpack/configs/index.ts +0 -1
- package/src/webpack/configs/loaders/css-loader.ts +7 -3
- package/src/webpack/configs/loaders/style-loader.ts +4 -5
- package/src/webpack/configs/module-config.ts +2 -2
- package/src/webpack/configs/optimization-config.ts +64 -36
- package/src/webpack/configs/output-config.ts +12 -24
- package/src/webpack/configs/plugins/assets-manifest-plugin.ts +24 -39
- package/src/webpack/configs/plugins/bundle-analyser-plugin.ts +6 -28
- package/src/webpack/configs/plugins/define-exposed-dependencies-plugin.ts +7 -18
- package/src/webpack/configs/plugins/define-exposed-instance-dependencies-plugin.ts +7 -13
- package/src/webpack/configs/plugins/define-process-env-plugin.ts +10 -0
- package/src/webpack/configs/plugins/define-web-component-name-plugin.ts +7 -8
- package/src/webpack/configs/plugins/filter-warnings-plugin.ts +4 -3
- package/src/webpack/configs/plugins/html-plugin.ts +6 -6
- package/src/webpack/configs/plugins/html-tags-plugin.ts +10 -17
- package/src/webpack/configs/plugins/ignore-plugin/__tests__/ignore-plugin.test.ts +119 -0
- package/src/webpack/configs/plugins/ignore-plugin/empty-module.ts +7 -0
- package/src/webpack/configs/plugins/ignore-plugin/ignore-plugin.ts +62 -12
- package/src/webpack/configs/plugins/index.ts +1 -0
- package/src/webpack/configs/plugins/mini-css-extract-plugin.ts +9 -5
- package/src/webpack/configs/plugins/moment-locales-plugin.ts +4 -3
- package/src/webpack/configs/plugins/remove-empty-scripts-plugin.ts +4 -3
- package/src/webpack/configs/plugins/virtual-modules-plugin.ts +11 -65
- package/src/webpack/configs/plugins/watch-run-plugin.ts +3 -2
- package/src/webpack/configs/plugins-config.ts +5 -2
- package/src/webpack/configs/resolve-config.ts +4 -2
- package/src/webpack/configs/rules/css-rules.ts +4 -3
- package/src/webpack/configs/rules/font-rules.ts +3 -3
- package/src/webpack/configs/rules/image-rules.ts +3 -3
- package/src/webpack/configs/rules/js-rules.ts +3 -2
- package/src/webpack/configs/rules/less-rules.ts +2 -2
- package/src/webpack/configs/rules/scss-rules.ts +2 -2
- package/src/webpack/configs/rules/svg-rules.ts +2 -2
- package/src/webpack/configs/rules-config.ts +6 -5
- package/src/webpack/configs/stats-config.ts +3 -2
- package/src/webpack/configs/watch-options-config.ts +3 -3
- package/src/webpack/create-webpack-config.ts +28 -53
- package/src/webpack/create-webpack-configs.ts +77 -0
- package/src/webpack/index.ts +2 -0
- package/src/webpack/types.ts +8 -11
- package/src/webpack/utils/__tests__/split-by-entry.test.ts +33 -0
- package/src/webpack/utils/create-webpack-build-context.ts +7 -0
- package/src/webpack/utils/index.ts +1 -1
- package/tsconfig/base.json +1 -1
- package/tsconfig/types.d.ts +10 -0
- package/dist/cli/commands/bundle-package.d.ts +0 -6
- package/dist/cli/commands/bundle-package.d.ts.map +0 -1
- package/dist/cli/commands/bundle-package.js.map +0 -1
- package/dist/cli/commands/registry/bundle-package.d.ts.map +0 -1
- package/dist/cli/utils/bundle.d.ts +0 -14
- package/dist/cli/utils/bundle.d.ts.map +0 -1
- package/dist/cli/utils/bundle.js +0 -187
- package/dist/cli/utils/bundle.js.map +0 -1
- package/dist/utils/get-startup-version.d.ts.map +0 -1
- package/dist/utils/get-startup-version.js.map +0 -1
- package/dist/webpack/configs/plugins/ignore-plugin/check-resource.d.ts +0 -3
- package/dist/webpack/configs/plugins/ignore-plugin/check-resource.d.ts.map +0 -1
- package/dist/webpack/configs/plugins/ignore-plugin/check-resource.js +0 -40
- package/dist/webpack/configs/plugins/ignore-plugin/check-resource.js.map +0 -1
- package/dist/webpack/configs/plugins/ignore-plugin/get-package-json.d.ts +0 -2
- package/dist/webpack/configs/plugins/ignore-plugin/get-package-json.d.ts.map +0 -1
- package/dist/webpack/configs/plugins/ignore-plugin/get-package-json.js.map +0 -1
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-peer-dependency.d.ts +0 -2
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-peer-dependency.d.ts.map +0 -1
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-peer-dependency.js +0 -27
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-peer-dependency.js.map +0 -1
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-react-dom-peer-dependency.d.ts +0 -7
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-react-dom-peer-dependency.d.ts.map +0 -1
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-react-dom-peer-dependency.js +0 -15
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-react-dom-peer-dependency.js.map +0 -1
- package/dist/webpack/configs/types.d.ts +0 -37
- package/dist/webpack/configs/types.d.ts.map +0 -1
- package/dist/webpack/configs/types.js.map +0 -1
- package/dist/webpack/configs/utils/build-metadata.d.ts.map +0 -1
- package/dist/webpack/configs/utils/build-metadata.js.map +0 -1
- package/dist/webpack/configs/utils/generate-metadata.d.ts +0 -3
- package/dist/webpack/configs/utils/generate-metadata.d.ts.map +0 -1
- package/dist/webpack/configs/utils/generate-metadata.js.map +0 -1
- package/dist/webpack/configs/utils/get-bundle-type.d.ts +0 -3
- package/dist/webpack/configs/utils/get-bundle-type.d.ts.map +0 -1
- package/dist/webpack/configs/utils/get-bundle-type.js.map +0 -1
- package/dist/webpack/configs/utils/get-exposed-dependencies.d.ts.map +0 -1
- package/dist/webpack/configs/utils/get-exposed-dependencies.js.map +0 -1
- package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.d.ts.map +0 -1
- package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.js.map +0 -1
- package/dist/webpack/configs/utils/get-web-components-version.d.ts.map +0 -1
- package/dist/webpack/configs/utils/get-web-components-version.js.map +0 -1
- package/dist/webpack/configs/utils/index.d.ts +0 -4
- package/dist/webpack/configs/utils/index.d.ts.map +0 -1
- package/dist/webpack/configs/utils/index.js.map +0 -1
- package/dist/webpack/utils/stringify-config.d.ts.map +0 -1
- package/dist/webpack/utils/stringify-config.js.map +0 -1
- package/src/cli/utils/bundle.ts +0 -191
- package/src/utils/get-startup-version.ts +0 -6
- package/src/webpack/configs/plugins/ignore-plugin/__tests__/check-resource.test.ts +0 -62
- package/src/webpack/configs/plugins/ignore-plugin/__tests__/is-optional-peer-dependency.test.ts +0 -47
- package/src/webpack/configs/plugins/ignore-plugin/__tests__/is-optional-react-dom-peer-dependency.test.ts +0 -35
- package/src/webpack/configs/plugins/ignore-plugin/check-resource.ts +0 -29
- package/src/webpack/configs/plugins/ignore-plugin/get-package-json.ts +0 -23
- package/src/webpack/configs/plugins/ignore-plugin/is-optional-peer-dependency.ts +0 -12
- package/src/webpack/configs/plugins/ignore-plugin/is-optional-react-dom-peer-dependency.ts +0 -11
- package/src/webpack/configs/types.ts +0 -40
- package/src/webpack/configs/utils/get-bundle-type.ts +0 -22
- package/src/webpack/configs/utils/index.ts +0 -3
- /package/dist/{webpack/configs → core/check-resource}/types.js +0 -0
- /package/dist/{webpack/configs/utils → core}/get-exposed-dependencies.d.ts +0 -0
- /package/dist/{webpack/configs/utils → core}/get-exposed-dependencies.js +0 -0
- /package/dist/{webpack/configs/utils → core/get-version}/get-launchdarkly-sdk-version.d.ts +0 -0
- /package/dist/{webpack/configs/utils → core/get-version}/get-launchdarkly-sdk-version.js +0 -0
- /package/dist/{utils → core/get-version}/get-startup-version.d.ts +0 -0
- /package/dist/{webpack/configs/utils → core/get-version}/get-web-components-version.d.ts +0 -0
- /package/dist/{webpack/configs/utils → core/get-version}/get-web-components-version.js +0 -0
- /package/dist/{webpack/configs/utils → core/metadata}/build-metadata.d.ts +0 -0
- /package/dist/{webpack/utils → core}/stringify-config.d.ts +0 -0
- /package/dist/{webpack/utils → core}/stringify-config.js +0 -0
- /package/src/cli/commands/registry/{bundle-package.ts → bundle-webpack.ts} +0 -0
- /package/src/{webpack/configs/utils → core}/__tests__/get-exposed-dependencies.test.ts +0 -0
- /package/src/{webpack/configs/utils → core}/get-exposed-dependencies.ts +0 -0
- /package/src/{webpack/configs/utils → core/get-version}/__tests__/get-launchdarkly-sdk-version.test.ts +0 -0
- /package/src/{utils → core/get-version}/__tests__/get-startup-version.test.ts +0 -0
- /package/src/{webpack/configs/utils → core/get-version}/__tests__/get-web-components-version.test.ts +0 -0
- /package/src/{webpack/configs/utils → core/get-version}/get-launchdarkly-sdk-version.ts +0 -0
- /package/src/{webpack/configs/utils → core/get-version}/get-web-components-version.ts +0 -0
- /package/src/{webpack/utils → core}/stringify-config.ts +0 -0
|
@@ -65,7 +65,7 @@ describe('[startup] Utils', () => {
|
|
|
65
65
|
version: '1.0.0',
|
|
66
66
|
private: true,
|
|
67
67
|
location: path.resolve('./packages/foo'),
|
|
68
|
-
type: PackageType.
|
|
68
|
+
type: PackageType.Bundle,
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
71
|
name: 'bar',
|
|
@@ -167,14 +167,14 @@ describe('[startup] Utils', () => {
|
|
|
167
167
|
});
|
|
168
168
|
|
|
169
169
|
describe('with "type"', () => {
|
|
170
|
-
beforeEach(() => (options = { type: PackageType.
|
|
170
|
+
beforeEach(() => (options = { type: PackageType.Bundle }));
|
|
171
171
|
|
|
172
172
|
test('returns only the specified packages', () => {
|
|
173
173
|
expect(subject()).toEqual([expect.objectContaining({ name: 'foo' })]);
|
|
174
174
|
});
|
|
175
175
|
|
|
176
176
|
describe('when "type" is an array', () => {
|
|
177
|
-
beforeEach(() => (options = { type: [PackageType.TSC, PackageType.
|
|
177
|
+
beforeEach(() => (options = { type: [PackageType.TSC, PackageType.Bundle] }));
|
|
178
178
|
|
|
179
179
|
test('returns only the specified packages', () => {
|
|
180
180
|
expect(subject()).toEqual(
|
|
@@ -230,7 +230,7 @@ describe('[startup] Utils', () => {
|
|
|
230
230
|
itReturnsPackages();
|
|
231
231
|
});
|
|
232
232
|
|
|
233
|
-
describe('
|
|
233
|
+
describe('when lerna.json contains packages', () => {
|
|
234
234
|
beforeEach(() => {
|
|
235
235
|
volFromJSON({
|
|
236
236
|
'lerna.json': JSON.stringify({ packages: ['packages/*'] }),
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { fs, vol } from 'memfs';
|
|
2
|
+
import { validateSharedDependencies } from '../validate-shared-dependencies';
|
|
3
|
+
|
|
4
|
+
jest.mock('fs', () => fs);
|
|
5
|
+
|
|
6
|
+
describe(`[startup] ${validateSharedDependencies.name}`, () => {
|
|
7
|
+
let cli: Record<string, any>;
|
|
8
|
+
|
|
9
|
+
beforeEach(() => (cli = {}));
|
|
10
|
+
afterEach(() => vol.reset());
|
|
11
|
+
|
|
12
|
+
const subject = () => {
|
|
13
|
+
vol.fromJSON({ 'package.json': JSON.stringify({ cli }) });
|
|
14
|
+
return validateSharedDependencies();
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
function itDoesNotThrow() {
|
|
18
|
+
test('does not throw', () => {
|
|
19
|
+
expect(subject).not.toThrow();
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function itThrows(message: RegExp) {
|
|
24
|
+
test('throws', () => {
|
|
25
|
+
expect(subject).toThrow(message);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
itDoesNotThrow();
|
|
30
|
+
|
|
31
|
+
describe('with conflicting {cli, cli.webpack}.shared-dependencies', () => {
|
|
32
|
+
beforeEach(() => {
|
|
33
|
+
cli['shared-dependencies'] = { defaults: '' };
|
|
34
|
+
cli.webpack = { 'shared-dependencies': { defaults: '', extra: 'foo' } };
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
itThrows(/both set but differ/);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
describe('with conflicting {cli, cli.webpack}.expose-shared-dependencies', () => {
|
|
41
|
+
beforeEach(() => {
|
|
42
|
+
cli['expose-shared-dependencies'] = true;
|
|
43
|
+
cli.webpack = { 'expose-shared-dependencies': false };
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
itThrows(/both set but differ/);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
describe('when configured as a web-component', () => {
|
|
50
|
+
beforeEach(() => (cli['web-component'] = true));
|
|
51
|
+
|
|
52
|
+
describe.each([
|
|
53
|
+
{ cli: { 'expose-shared-dependencies': true } },
|
|
54
|
+
{ cli: { webpack: { 'expose-shared-dependencies': true } } },
|
|
55
|
+
])('with %o', config => {
|
|
56
|
+
beforeEach(() => Object.assign(cli, config.cli));
|
|
57
|
+
|
|
58
|
+
itThrows(/only applies to host applications/);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
describe.each([
|
|
62
|
+
{ cli: { 'expose-shared-dependencies': false } },
|
|
63
|
+
{ cli: { webpack: { 'expose-shared-dependencies': false } } },
|
|
64
|
+
])('with %o', config => {
|
|
65
|
+
beforeEach(() => Object.assign(cli, config.cli));
|
|
66
|
+
|
|
67
|
+
itDoesNotThrow();
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
});
|
|
@@ -1,20 +1,27 @@
|
|
|
1
|
-
import { Config } from '@jest/types';
|
|
2
|
-
import { swcDir } from '@swc/cli';
|
|
3
|
-
import { ESLint } from 'eslint';
|
|
1
|
+
import type { Config } from '@jest/types';
|
|
2
|
+
import type { swcDir } from '@swc/cli';
|
|
3
|
+
import type { ESLint } from 'eslint';
|
|
4
4
|
import fs from 'fs';
|
|
5
5
|
import path from 'path';
|
|
6
|
-
import { LinterOptions } from 'stylelint';
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import type { LinterOptions } from 'stylelint';
|
|
7
|
+
import type svgr from 'vite-plugin-svgr';
|
|
8
|
+
import type { ViteUserConfig } from 'vitest/config';
|
|
9
|
+
import type { Configuration as WebpackDevServerConfiguration } from 'webpack-dev-server';
|
|
10
|
+
import type { ReviewConfiguration } from '../cli/commands/review';
|
|
10
11
|
import { getFolders } from './get-folders';
|
|
12
|
+
import { getPackageName } from './get-package-name';
|
|
11
13
|
import { log } from './log';
|
|
12
14
|
import { readJson, readJsonSafe } from './read-json';
|
|
15
|
+
import { LocationOrJson } from './types';
|
|
13
16
|
|
|
14
|
-
|
|
17
|
+
type VitePluginSvgrOptions = NonNullable<Parameters<typeof svgr>[0]>;
|
|
15
18
|
|
|
16
19
|
type ElementType<T> = T extends readonly (infer ElementType)[] ? ElementType : never;
|
|
17
20
|
|
|
21
|
+
export type Bundler = 'vite' | 'webpack';
|
|
22
|
+
|
|
23
|
+
export const allowedWebpackDevServerOptions = ['headers', 'port', 'proxy', 'static'] as const;
|
|
24
|
+
|
|
18
25
|
export interface MinifyJSOptions {
|
|
19
26
|
compress?: boolean;
|
|
20
27
|
mangle?: boolean;
|
|
@@ -38,6 +45,7 @@ export interface WebpackConfiguration extends Omit<
|
|
|
38
45
|
'disable-style-check'?: boolean;
|
|
39
46
|
'minify'?: MinifyOptions;
|
|
40
47
|
'proxy'?: WebpackDevServerConfiguration['proxy'] | string;
|
|
48
|
+
'shared-dependencies'?: Record<string, string>;
|
|
41
49
|
}
|
|
42
50
|
|
|
43
51
|
export interface ESLintConfiguration extends ESLint.Options {
|
|
@@ -61,7 +69,8 @@ export interface NodeConfiguration {
|
|
|
61
69
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
62
70
|
export enum CommandName {
|
|
63
71
|
'build' = 'build',
|
|
64
|
-
'bundle-
|
|
72
|
+
'bundle-vite' = 'bundle-vite',
|
|
73
|
+
'bundle-webpack' = 'bundle-webpack',
|
|
65
74
|
'clean' = 'clean',
|
|
66
75
|
'convert-eslint-config' = 'convert-eslint-config',
|
|
67
76
|
'eslint' = 'eslint',
|
|
@@ -92,6 +101,35 @@ export type VitestConfiguration = ViteUserConfig['test'] & {
|
|
|
92
101
|
omitDefault?: string[];
|
|
93
102
|
};
|
|
94
103
|
|
|
104
|
+
export interface HtmlPluginOptions {
|
|
105
|
+
title?: string;
|
|
106
|
+
favicon?: string;
|
|
107
|
+
template?: string;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface SvgrPluginOptions {
|
|
111
|
+
include?: VitePluginSvgrOptions['include'];
|
|
112
|
+
exclude?: VitePluginSvgrOptions['exclude'];
|
|
113
|
+
svgrOptions?: VitePluginSvgrOptions['svgrOptions'];
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export interface PluginOverrides {
|
|
117
|
+
html?: HtmlPluginOptions;
|
|
118
|
+
svgr?: SvgrPluginOptions;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export interface ViteBundlerConfig {
|
|
122
|
+
port?: number;
|
|
123
|
+
omitDefault?: string[];
|
|
124
|
+
minify?: MinifyOptions;
|
|
125
|
+
pluginOverrides?: PluginOverrides;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface VitePackageJsonOverride extends ViteBundlerConfig {
|
|
129
|
+
config?: Omit<import('vite').UserConfig, 'plugins'>;
|
|
130
|
+
devServer?: false;
|
|
131
|
+
}
|
|
132
|
+
|
|
95
133
|
export interface WebComponentBranchConfigs {
|
|
96
134
|
publishTag?: string;
|
|
97
135
|
uploadSourcemaps?: boolean;
|
|
@@ -107,6 +145,7 @@ interface WebComponentOptions {
|
|
|
107
145
|
}
|
|
108
146
|
|
|
109
147
|
type Configuration = {
|
|
148
|
+
'bundler'?: Bundler;
|
|
110
149
|
'jest'?: JestConfiguration;
|
|
111
150
|
'legacy'?: boolean;
|
|
112
151
|
'lint'?: { eslint: ESLintConfiguration; stylelint: StylelintConfiguration };
|
|
@@ -114,6 +153,10 @@ type Configuration = {
|
|
|
114
153
|
'swc-compile-package'?: Parameters<typeof swcDir>[0];
|
|
115
154
|
'test'?: JestConfiguration; // for backward-compatibility
|
|
116
155
|
'testRunner'?: string;
|
|
156
|
+
'expose-process-env'?: string[];
|
|
157
|
+
'expose-shared-dependencies'?: boolean;
|
|
158
|
+
'shared-dependencies'?: Record<string, string>;
|
|
159
|
+
'vite'?: false | VitePackageJsonOverride;
|
|
117
160
|
'vitest'?: VitestConfiguration;
|
|
118
161
|
'web-component'?: boolean | string | WebComponentOptions;
|
|
119
162
|
'webpack'?: false | WebpackConfiguration;
|
|
@@ -121,8 +164,6 @@ type Configuration = {
|
|
|
121
164
|
[key in CommandName]?: NodeConfiguration;
|
|
122
165
|
} & NodeConfiguration;
|
|
123
166
|
|
|
124
|
-
type LocationOrJson = string | Record<string, any>;
|
|
125
|
-
|
|
126
167
|
export function getConfiguration(locationOrJson: LocationOrJson = './'): Configuration {
|
|
127
168
|
const json =
|
|
128
169
|
typeof locationOrJson === 'string'
|
|
@@ -156,6 +197,15 @@ export function getStylelintConfiguration() {
|
|
|
156
197
|
return getConfiguration().lint?.stylelint ?? {};
|
|
157
198
|
}
|
|
158
199
|
|
|
200
|
+
export function getExposeProcessEnv(): string[] {
|
|
201
|
+
return getConfiguration()['expose-process-env'] ?? [];
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export function getViteConfiguration(): VitePackageJsonOverride {
|
|
205
|
+
const { vite } = getConfiguration();
|
|
206
|
+
return typeof vite === 'object' ? vite : {};
|
|
207
|
+
}
|
|
208
|
+
|
|
159
209
|
export function getVitestConfiguration() {
|
|
160
210
|
return getConfiguration().vitest ?? {};
|
|
161
211
|
}
|
|
@@ -213,11 +263,9 @@ export function getSwcCompilePackageConfiguration() {
|
|
|
213
263
|
}
|
|
214
264
|
|
|
215
265
|
export function isBundle(locationOrJson?: LocationOrJson) {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
export function isCustomStyleRules() {
|
|
220
|
-
return getWebpackConfiguration()['custom-style-rules'] === true;
|
|
266
|
+
const { webpack, vite } = getConfiguration(locationOrJson);
|
|
267
|
+
assertBundlersAgree(webpack, vite, locationOrJson);
|
|
268
|
+
return webpack !== false && vite !== false;
|
|
221
269
|
}
|
|
222
270
|
|
|
223
271
|
export function isDevServerDisabled() {
|
|
@@ -225,8 +273,15 @@ export function isDevServerDisabled() {
|
|
|
225
273
|
return webpackConfiguration.devServer === false;
|
|
226
274
|
}
|
|
227
275
|
|
|
276
|
+
export function isViteDevServerDisabled() {
|
|
277
|
+
return getViteConfiguration().devServer === false;
|
|
278
|
+
}
|
|
279
|
+
|
|
228
280
|
export function isExposeSharedDependencies() {
|
|
229
|
-
return
|
|
281
|
+
return (
|
|
282
|
+
(getConfiguration()['expose-shared-dependencies'] ??
|
|
283
|
+
getWebpackConfiguration()['expose-shared-dependencies']) === true
|
|
284
|
+
);
|
|
230
285
|
}
|
|
231
286
|
|
|
232
287
|
export function isLegacy(locationOrJson?: LocationOrJson) {
|
|
@@ -244,3 +299,27 @@ export function isStyleCheckDisabled() {
|
|
|
244
299
|
export function isWebComponent(locationOrJson: LocationOrJson = './') {
|
|
245
300
|
return !!getWebComponentConfiguration(locationOrJson);
|
|
246
301
|
}
|
|
302
|
+
|
|
303
|
+
/*
|
|
304
|
+
* Require that Vite and Webpack configurations agree whether package is a bundle.
|
|
305
|
+
*/
|
|
306
|
+
function assertBundlersAgree(
|
|
307
|
+
webpack: Configuration['webpack'],
|
|
308
|
+
vite: Configuration['vite'],
|
|
309
|
+
locationOrJson?: LocationOrJson
|
|
310
|
+
) {
|
|
311
|
+
if (webpack === undefined || vite === undefined || !!webpack === !!vite) {
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
const mismatch =
|
|
316
|
+
webpack === false
|
|
317
|
+
? { falsy: 'cli.webpack', truthy: 'cli.vite' }
|
|
318
|
+
: { falsy: 'cli.vite', truthy: 'cli.webpack' };
|
|
319
|
+
|
|
320
|
+
throw new Error(
|
|
321
|
+
`package ${getPackageName(locationOrJson)} has conflicting webpack ` +
|
|
322
|
+
`and vite configurations: ${mismatch.falsy} is false but ` +
|
|
323
|
+
`${mismatch.truthy} is not`
|
|
324
|
+
);
|
|
325
|
+
}
|
|
@@ -17,6 +17,8 @@ export function getPackageData(): PackageData {
|
|
|
17
17
|
...readJson('../../package.json').dependencies,
|
|
18
18
|
...packageJson.dependencies,
|
|
19
19
|
},
|
|
20
|
-
sharedDependencies:
|
|
20
|
+
sharedDependencies:
|
|
21
|
+
packageJson.cli?.['shared-dependencies'] ??
|
|
22
|
+
packageJson.cli?.webpack?.['shared-dependencies'],
|
|
21
23
|
};
|
|
22
24
|
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
import { readJson } from './read-json';
|
|
3
|
+
import { LocationOrJson } from './types';
|
|
3
4
|
|
|
4
|
-
export function getPackageName(
|
|
5
|
-
|
|
5
|
+
export function getPackageName(locationOrJson: LocationOrJson = './'): string {
|
|
6
|
+
const json =
|
|
7
|
+
typeof locationOrJson === 'string'
|
|
8
|
+
? readJson(path.join(locationOrJson, 'package.json'))
|
|
9
|
+
: locationOrJson;
|
|
10
|
+
|
|
11
|
+
return json?.name ?? '';
|
|
6
12
|
}
|
|
@@ -5,7 +5,7 @@ import { toArray } from './to-array';
|
|
|
5
5
|
|
|
6
6
|
export enum PackageType {
|
|
7
7
|
TSC,
|
|
8
|
-
|
|
8
|
+
Bundle,
|
|
9
9
|
Legacy,
|
|
10
10
|
}
|
|
11
11
|
|
|
@@ -124,7 +124,7 @@ function getPackageType(packageJson: ProjectPackage) {
|
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
if (isBundle(packageJson)) {
|
|
127
|
-
return PackageType.
|
|
127
|
+
return PackageType.Bundle;
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
return PackageType.TSC;
|
package/src/utils/index.ts
CHANGED
|
@@ -12,7 +12,6 @@ export * from './get-jest-config';
|
|
|
12
12
|
export * from './get-package-data';
|
|
13
13
|
export * from './get-package-name';
|
|
14
14
|
export * from './get-packages';
|
|
15
|
-
export * from './get-startup-version';
|
|
16
15
|
export * from './get-tsconfig';
|
|
17
16
|
export * from './get-tsconfig-with-fallback';
|
|
18
17
|
export * from './load-shared-dependencies';
|
|
@@ -23,3 +22,5 @@ export * from './pick';
|
|
|
23
22
|
export * from './prettify';
|
|
24
23
|
export * from './read-json';
|
|
25
24
|
export * from './to-array';
|
|
25
|
+
export type * from './types';
|
|
26
|
+
export * from './validate-shared-dependencies';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type LocationOrJson = string | Record<string, any>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getConfiguration,
|
|
3
|
+
getWebpackConfiguration,
|
|
4
|
+
isExposeSharedDependencies,
|
|
5
|
+
isWebComponent,
|
|
6
|
+
} from './get-configuration';
|
|
7
|
+
import { getPackageName } from './get-package-name';
|
|
8
|
+
|
|
9
|
+
export function validateSharedDependencies() {
|
|
10
|
+
const config = getConfiguration();
|
|
11
|
+
|
|
12
|
+
if (isWebComponent() && isExposeSharedDependencies()) {
|
|
13
|
+
throw new Error(
|
|
14
|
+
'cli.expose-shared-dependencies only applies to host applications.' +
|
|
15
|
+
`Remove it from ${getPackageName()}.`
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const webpackSharedDependencies = getWebpackConfiguration()['shared-dependencies'];
|
|
20
|
+
const topLevelSharedDependencies = config['shared-dependencies'];
|
|
21
|
+
|
|
22
|
+
if (
|
|
23
|
+
webpackSharedDependencies &&
|
|
24
|
+
topLevelSharedDependencies &&
|
|
25
|
+
JSON.stringify(webpackSharedDependencies) !== JSON.stringify(topLevelSharedDependencies)
|
|
26
|
+
) {
|
|
27
|
+
throw new Error(
|
|
28
|
+
'cli.shared-dependencies and cli.webpack.shared-dependencies are both set but differ. ' +
|
|
29
|
+
'Remove cli.webpack.shared-dependencies and use cli.shared-dependencies only.'
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const webpackExpose = getWebpackConfiguration()['expose-shared-dependencies'];
|
|
34
|
+
const topLevelExpose = config['expose-shared-dependencies'];
|
|
35
|
+
|
|
36
|
+
if (
|
|
37
|
+
webpackExpose !== undefined &&
|
|
38
|
+
topLevelExpose !== undefined &&
|
|
39
|
+
webpackExpose !== topLevelExpose
|
|
40
|
+
) {
|
|
41
|
+
throw new Error(
|
|
42
|
+
'cli.expose-shared-dependencies and cli.webpack.expose-shared-dependencies are both set but differ. ' +
|
|
43
|
+
'Remove cli.webpack.expose-shared-dependencies and use cli.expose-shared-dependencies only.'
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { build, type InlineConfig } from 'vite';
|
|
2
|
+
import type { BuildContext } from '../../core';
|
|
3
|
+
import { bundleConstants, createBuildContext, resolveOutputPath } from '../../core';
|
|
4
|
+
import { buildSharedDependencies } from '../build-shared-dependencies';
|
|
5
|
+
import { createViteConfig } from '../config';
|
|
6
|
+
import { sharedDependenciesPlugin } from '../plugins/shared-dependencies-plugin';
|
|
7
|
+
|
|
8
|
+
jest.mock('vite', () => ({
|
|
9
|
+
build: jest.fn(),
|
|
10
|
+
}));
|
|
11
|
+
jest.mock('../../core', () => ({
|
|
12
|
+
...jest.requireActual('../../core'),
|
|
13
|
+
bundleConstants: {
|
|
14
|
+
mode: { production: 'production', development: 'development' },
|
|
15
|
+
},
|
|
16
|
+
createBuildContext: jest.fn(),
|
|
17
|
+
}));
|
|
18
|
+
jest.mock('../config', () => ({
|
|
19
|
+
createViteConfig: jest.fn(),
|
|
20
|
+
}));
|
|
21
|
+
jest.mock('../plugins/shared-dependencies-plugin', () => ({
|
|
22
|
+
sharedDependenciesPlugin: jest.fn(() => ({ name: 'shared-dependencies' })),
|
|
23
|
+
}));
|
|
24
|
+
|
|
25
|
+
describe(buildSharedDependencies.name, () => {
|
|
26
|
+
const viteConfig: any = {};
|
|
27
|
+
let options: any;
|
|
28
|
+
let context: BuildContext;
|
|
29
|
+
|
|
30
|
+
beforeEach(() => {
|
|
31
|
+
jest.clearAllMocks();
|
|
32
|
+
options = { name: 'my-app' };
|
|
33
|
+
context = {
|
|
34
|
+
build: { isProduction: false },
|
|
35
|
+
package: {
|
|
36
|
+
sharedDependencies: { react: 'globalReact' },
|
|
37
|
+
destination: 'dist',
|
|
38
|
+
},
|
|
39
|
+
} as any;
|
|
40
|
+
jest.mocked(createViteConfig).mockResolvedValue(viteConfig);
|
|
41
|
+
jest.mocked(createBuildContext).mockReturnValue(context);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
const subject = () => buildSharedDependencies(options);
|
|
45
|
+
|
|
46
|
+
test('creates build context with options and exposed dependencies enabled', async () => {
|
|
47
|
+
await subject();
|
|
48
|
+
|
|
49
|
+
expect(createBuildContext).toHaveBeenCalledWith({
|
|
50
|
+
...options,
|
|
51
|
+
emitExposedDependencies: true,
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
test('passes shared dependencies and metadata directory to plugin', async () => {
|
|
56
|
+
await subject();
|
|
57
|
+
|
|
58
|
+
expect(sharedDependenciesPlugin).toHaveBeenCalledWith(
|
|
59
|
+
expect.objectContaining({
|
|
60
|
+
dependencies: context.package.sharedDependencies,
|
|
61
|
+
metadataDir: context.package.destination,
|
|
62
|
+
})
|
|
63
|
+
);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
test('builds with development mode', async () => {
|
|
67
|
+
await subject();
|
|
68
|
+
|
|
69
|
+
expect(build).toHaveBeenCalledWith(
|
|
70
|
+
expect.objectContaining({ mode: bundleConstants.mode.development })
|
|
71
|
+
);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
test('builds with output directory from context', async () => {
|
|
75
|
+
await subject();
|
|
76
|
+
|
|
77
|
+
expect(build).toHaveBeenCalledWith(
|
|
78
|
+
expect.objectContaining({
|
|
79
|
+
build: expect.objectContaining({
|
|
80
|
+
outDir: resolveOutputPath(context, viteConfig.build?.outDir),
|
|
81
|
+
}),
|
|
82
|
+
})
|
|
83
|
+
);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
test('disables config file', async () => {
|
|
87
|
+
await subject();
|
|
88
|
+
|
|
89
|
+
expect(build).toHaveBeenCalledWith(expect.objectContaining({ configFile: false }));
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
test('strips legal comments', async () => {
|
|
93
|
+
await subject();
|
|
94
|
+
|
|
95
|
+
expect(build).toHaveBeenCalledWith(
|
|
96
|
+
expect.objectContaining({ oxc: { legalComments: 'none' } })
|
|
97
|
+
);
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
describe('when user config sets oxc options', () => {
|
|
101
|
+
const oxc: InlineConfig['oxc'] = {
|
|
102
|
+
minify: { compress: true },
|
|
103
|
+
target: 'es2020',
|
|
104
|
+
legalComments: 'inline',
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
beforeEach(() => {
|
|
108
|
+
jest.mocked(createViteConfig).mockResolvedValue({ oxc });
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
test('forwards only oxc.minify', async () => {
|
|
112
|
+
await subject();
|
|
113
|
+
|
|
114
|
+
expect(build).toHaveBeenCalledWith(
|
|
115
|
+
expect.objectContaining({
|
|
116
|
+
oxc: { minify: oxc.minify, legalComments: 'none' },
|
|
117
|
+
})
|
|
118
|
+
);
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
test('passes empty CSS entries to plugin', async () => {
|
|
123
|
+
await subject();
|
|
124
|
+
|
|
125
|
+
expect(sharedDependenciesPlugin).toHaveBeenCalledWith(expect.objectContaining({ css: {} }));
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
describe('when production', () => {
|
|
129
|
+
beforeEach(() => (context.build.isProduction = true));
|
|
130
|
+
|
|
131
|
+
test('builds with production mode', async () => {
|
|
132
|
+
await subject();
|
|
133
|
+
|
|
134
|
+
expect(build).toHaveBeenCalledWith(
|
|
135
|
+
expect.objectContaining({ mode: bundleConstants.mode.production })
|
|
136
|
+
);
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
describe('when user config has custom outDir', () => {
|
|
141
|
+
const outDir = '/foo';
|
|
142
|
+
|
|
143
|
+
beforeEach(() => {
|
|
144
|
+
jest.mocked(createViteConfig).mockResolvedValue({ build: { outDir } });
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
test('builds with custom output directory', async () => {
|
|
148
|
+
await subject();
|
|
149
|
+
|
|
150
|
+
expect(build).toHaveBeenCalledWith(
|
|
151
|
+
expect.objectContaining({
|
|
152
|
+
build: expect.objectContaining({ outDir }),
|
|
153
|
+
})
|
|
154
|
+
);
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
describe('when user config sets build.minify', () => {
|
|
159
|
+
const minify = true;
|
|
160
|
+
|
|
161
|
+
beforeEach(() => {
|
|
162
|
+
jest.mocked(createViteConfig).mockResolvedValue({ build: { minify } });
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
test('forwards minify to build', async () => {
|
|
166
|
+
await subject();
|
|
167
|
+
|
|
168
|
+
expect(build).toHaveBeenCalledWith(
|
|
169
|
+
expect.objectContaining({
|
|
170
|
+
build: expect.objectContaining({ minify }),
|
|
171
|
+
})
|
|
172
|
+
);
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
describe('when user config sets build.cssMinify', () => {
|
|
177
|
+
const cssMinify = 'esbuild';
|
|
178
|
+
|
|
179
|
+
beforeEach(() => {
|
|
180
|
+
jest.mocked(createViteConfig).mockResolvedValue({ build: { cssMinify } });
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
test('forwards cssMinify to build', async () => {
|
|
184
|
+
await subject();
|
|
185
|
+
|
|
186
|
+
expect(build).toHaveBeenCalledWith(
|
|
187
|
+
expect.objectContaining({
|
|
188
|
+
build: expect.objectContaining({ cssMinify }),
|
|
189
|
+
})
|
|
190
|
+
);
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
describe('when user config sets build.terserOptions', () => {
|
|
195
|
+
const terserOptions = { maxWorkers: 1 };
|
|
196
|
+
|
|
197
|
+
beforeEach(() => {
|
|
198
|
+
jest.mocked(createViteConfig).mockResolvedValue({ build: { terserOptions } });
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
test('forwards terserOptions to build', async () => {
|
|
202
|
+
await subject();
|
|
203
|
+
|
|
204
|
+
expect(build).toHaveBeenCalledWith(
|
|
205
|
+
expect.objectContaining({
|
|
206
|
+
build: expect.objectContaining({ terserOptions }),
|
|
207
|
+
})
|
|
208
|
+
);
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
describe('when shared dependencies include design-system', () => {
|
|
213
|
+
beforeEach(() => {
|
|
214
|
+
context.package.sharedDependencies['@servicetitan/design-system'] =
|
|
215
|
+
'globalDesignSystem';
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
test('passes design-system CSS entries to plugin', async () => {
|
|
219
|
+
await subject();
|
|
220
|
+
|
|
221
|
+
expect(sharedDependenciesPlugin).toHaveBeenCalledWith(
|
|
222
|
+
expect.objectContaining({
|
|
223
|
+
css: {
|
|
224
|
+
'design-system': [
|
|
225
|
+
'@servicetitan/tokens/core/tokens.css',
|
|
226
|
+
'@servicetitan/anvil-fonts/dist/css/anvil-fonts.css',
|
|
227
|
+
'@servicetitan/design-system/dist/system.min.css',
|
|
228
|
+
],
|
|
229
|
+
},
|
|
230
|
+
})
|
|
231
|
+
);
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { fs, vol } from 'memfs';
|
|
2
|
+
import { validateSharedDependencies } from '../../utils/validate-shared-dependencies';
|
|
3
|
+
import { validateViteSharedDependencies } from '../validate-shared-dependencies';
|
|
4
|
+
|
|
5
|
+
jest.mock('fs', () => fs);
|
|
6
|
+
jest.mock('../../utils/validate-shared-dependencies');
|
|
7
|
+
|
|
8
|
+
describe(`[startup] ${validateViteSharedDependencies.name}`, () => {
|
|
9
|
+
let cli: Record<string, any>;
|
|
10
|
+
|
|
11
|
+
beforeEach(() => {
|
|
12
|
+
jest.clearAllMocks();
|
|
13
|
+
cli = {};
|
|
14
|
+
});
|
|
15
|
+
afterEach(() => vol.reset());
|
|
16
|
+
|
|
17
|
+
const subject = () => {
|
|
18
|
+
vol.fromJSON({ 'package.json': JSON.stringify({ cli }) });
|
|
19
|
+
return validateViteSharedDependencies();
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
function itThrows(message: RegExp) {
|
|
23
|
+
test('throws', () => {
|
|
24
|
+
expect(subject).toThrow(message);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
test('delegates to validateSharedDependencies', () => {
|
|
29
|
+
subject();
|
|
30
|
+
|
|
31
|
+
expect(validateSharedDependencies).toHaveBeenCalled();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
describe('with cli.webpack.shared-dependencies', () => {
|
|
35
|
+
beforeEach(() => (cli.webpack = { 'shared-dependencies': { defaults: '' } }));
|
|
36
|
+
|
|
37
|
+
itThrows(/Move your shared-dependencies/);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
describe('with cli.webpack.expose-shared-dependencies', () => {
|
|
41
|
+
beforeEach(() => (cli.webpack = { 'expose-shared-dependencies': true }));
|
|
42
|
+
|
|
43
|
+
itThrows(/Move your expose-shared-dependencies/);
|
|
44
|
+
});
|
|
45
|
+
});
|