@servicetitan/startup 36.3.1 → 36.4.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/vite.js +3 -0
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +14 -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 +110 -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 +8 -0
- package/dist/cli/commands/registry/build.d.ts.map +1 -1
- package/dist/cli/commands/registry/build.js +8 -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 +72 -0
- package/dist/cli/commands/registry/command-registry.d.ts.map +1 -1
- package/dist/cli/commands/registry/command-registry.js +7 -2
- package/dist/cli/commands/registry/command-registry.js.map +1 -1
- package/dist/cli/commands/registry/start.d.ts +4 -0
- package/dist/cli/commands/registry/start.d.ts.map +1 -1
- package/dist/cli/commands/registry/start.js +4 -0
- package/dist/cli/commands/registry/start.js.map +1 -1
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +12 -22
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/index.js +2 -1
- 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/index.d.ts +0 -1
- package/dist/cli/utils/index.d.ts.map +1 -1
- package/dist/cli/utils/index.js +0 -1
- package/dist/cli/utils/index.js.map +1 -1
- 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 +44 -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 +7 -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 +17 -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/types.d.ts +5 -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/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 +14 -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/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-output-path.d.ts +3 -0
- package/dist/core/get-output-path.d.ts.map +1 -0
- package/dist/core/get-output-path.js +29 -0
- package/dist/core/get-output-path.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 +17 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +34 -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/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/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/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 +33 -2
- package/dist/utils/get-configuration.d.ts.map +1 -1
- package/dist/utils/get-configuration.js +12 -8
- 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-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 +1 -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/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 +26 -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 +61 -0
- package/dist/vite/build-shared-dependencies.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 +149 -0
- package/dist/vite/config/base-config.js.map +1 -0
- package/dist/vite/config/create-vite-build-context.d.ts +5 -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 +43 -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/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 +32 -0
- package/dist/vite/index.js +20 -0
- package/dist/vite/index.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/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 +5 -0
- package/dist/vite/plugins/ignore-modules-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/ignore-modules-plugin.js +44 -0
- package/dist/vite/plugins/ignore-modules-plugin.js.map +1 -0
- package/dist/vite/plugins/index.d.ts +10 -0
- package/dist/vite/plugins/index.d.ts.map +1 -0
- package/dist/vite/plugins/index.js +28 -0
- package/dist/vite/plugins/index.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/shared-dependencies-plugin.d.ts +8 -0
- package/dist/vite/plugins/shared-dependencies-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/shared-dependencies-plugin.js +252 -0
- package/dist/vite/plugins/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/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 +9 -7
- 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 +11 -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 +10 -47
- 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 +6 -6
- 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-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/ignore-plugin.d.ts +3 -2
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.js +9 -8
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.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.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.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.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.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 +37 -48
- 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 +88 -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 +21 -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 +29 -21
- package/src/cli/commands/__tests__/build.test.ts +2 -2
- package/src/cli/commands/__tests__/bundle-vite.test.ts +228 -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 +1 -1
- package/src/cli/commands/build.ts +14 -11
- package/src/cli/commands/bundle-vite.ts +82 -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 +2 -0
- package/src/cli/commands/registry/bundle-vite.ts +14 -0
- package/src/cli/commands/registry/command-registry.ts +5 -2
- package/src/cli/commands/registry/start.ts +1 -0
- package/src/cli/commands/start.ts +15 -29
- package/src/cli/index.ts +2 -1
- 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/copy-files.ts +1 -1
- package/src/cli/utils/index.ts +0 -1
- package/src/core/__tests__/get-cdn-path.test.ts +27 -0
- package/src/core/__tests__/get-output-path.test.ts +64 -0
- package/src/core/check-resource/__tests__/check-resource.test.ts +58 -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 +51 -0
- package/src/core/check-resource/__tests__/is-managed-react-dom-client-dependency.test.ts +35 -0
- package/src/core/check-resource/check-resource.ts +30 -0
- package/src/core/check-resource/get-package-json.ts +33 -0
- package/src/core/check-resource/get-peer-dependency-meta.ts +15 -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/types.ts +4 -0
- package/src/core/constants.ts +16 -0
- package/src/core/create-build-context.ts +61 -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-output-path.ts +15 -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 +16 -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/types.ts +54 -0
- package/src/core/virtual-modules.ts +74 -0
- package/src/cypress/config/__tests__/webpack-config.test.ts +4 -3
- package/src/cypress/config/webpack-config.ts +24 -11
- package/src/index.ts +1 -0
- package/src/storybook-config/__tests__/webpack-final.test.ts +5 -27
- package/src/storybook-config/webpack-final.ts +23 -15
- package/src/utils/__tests__/get-configuration.test.ts +28 -7
- package/src/utils/__tests__/get-package-data.test.ts +35 -1
- package/src/utils/__tests__/get-packages.test.ts +4 -4
- package/src/utils/__tests__/validate-shared-dependencies.test.ts +55 -0
- package/src/utils/get-configuration.ts +51 -7
- package/src/utils/get-package-data.ts +3 -1
- package/src/utils/get-packages.ts +2 -2
- package/src/utils/index.ts +1 -1
- package/src/utils/validate-shared-dependencies.ts +32 -0
- package/src/vite/__tests__/build-shared-dependencies.test.ts +247 -0
- package/src/vite/__tests__/validate-shared-dependencies.test.ts +34 -0
- package/src/vite/build-shared-dependencies.ts +56 -0
- package/src/vite/config/__tests__/base-config.test.ts +309 -0
- package/src/vite/config/__tests__/create-vite-build-context.test.ts +86 -0
- package/src/vite/config/__tests__/create-vite-config.test.ts +141 -0
- package/src/vite/config/__tests__/define-config.test.ts +23 -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/base-config.ts +137 -0
- package/src/vite/config/create-vite-build-context.ts +45 -0
- package/src/vite/config/create-vite-config.ts +33 -0
- package/src/vite/config/define-config.ts +18 -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 +32 -0
- package/src/vite/index.ts +1 -0
- package/src/vite/plugins/__tests__/css-injector-plugin.test.ts +119 -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 +97 -0
- package/src/vite/plugins/__tests__/ignore-modules-plugin.test.ts +85 -0
- package/src/vite/plugins/__tests__/metadata-plugin.test.ts +163 -0
- package/src/vite/plugins/__tests__/shared-dependencies-plugin.test.ts +427 -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/css-injector-plugin.ts +65 -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 +25 -0
- package/src/vite/plugins/index.ts +9 -0
- package/src/vite/plugins/metadata-plugin.ts +65 -0
- package/src/vite/plugins/shared-dependencies-plugin.ts +273 -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/virtual-modules-plugin.ts +46 -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} +30 -23
- package/src/webpack/__tests__/create-webpack-config-shared-dependencies.test.ts +40 -14
- package/src/webpack/__tests__/create-webpack-config-web-component.test.ts +17 -16
- package/src/webpack/__tests__/create-webpack-config.test.ts +9 -8
- 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 +17 -11
- package/src/webpack/configs/output-config.ts +12 -23
- package/src/webpack/configs/plugins/assets-manifest-plugin.ts +9 -36
- package/src/webpack/configs/plugins/bundle-analyser-plugin.ts +8 -8
- 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-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 +67 -0
- package/src/webpack/configs/plugins/ignore-plugin/ignore-plugin.ts +10 -10
- package/src/webpack/configs/plugins/mini-css-extract-plugin.ts +9 -5
- package/src/webpack/configs/plugins/moment-locales-plugin.ts +3 -2
- 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 +3 -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 +2 -2
- package/src/webpack/configs/rules/image-rules.ts +2 -2
- 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 +19 -51
- package/src/webpack/create-webpack-configs.ts +83 -0
- package/src/webpack/index.ts +2 -0
- package/src/webpack/types.ts +11 -11
- package/src/webpack/utils/__tests__/split-by-entry.test.ts +33 -0
- package/src/webpack/utils/create-webpack-build-context.ts +12 -0
- package/src/webpack/utils/index.ts +1 -1
- 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,55 @@
|
|
|
1
|
+
import { fs, vol } from 'memfs';
|
|
2
|
+
import { validateSharedDependencies } from '../validate-shared-dependencies';
|
|
3
|
+
|
|
4
|
+
jest.mock('fs', () => fs);
|
|
5
|
+
|
|
6
|
+
describe('validateSharedDependencies', () => {
|
|
7
|
+
function mockPackageJson(content: Record<string, any> = {}) {
|
|
8
|
+
vol.fromJSON({ 'package.json': JSON.stringify(content) });
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
afterEach(() => vol.reset());
|
|
12
|
+
|
|
13
|
+
test('passes when neither is set', () => {
|
|
14
|
+
mockPackageJson();
|
|
15
|
+
expect(() => validateSharedDependencies()).not.toThrow();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
test('passes when only cli top level is set', () => {
|
|
19
|
+
mockPackageJson({ cli: { 'shared-dependencies': { defaults: '' } } });
|
|
20
|
+
expect(() => validateSharedDependencies()).not.toThrow();
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
test('passes when only cli.webpack is set', () => {
|
|
24
|
+
mockPackageJson({ cli: { webpack: { 'shared-dependencies': { defaults: '' } } } });
|
|
25
|
+
expect(() => validateSharedDependencies()).not.toThrow();
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test('passes when both are set and identical', () => {
|
|
29
|
+
const deps = { defaults: '', lodash: 'SharedDependencies.Lodash' };
|
|
30
|
+
mockPackageJson({
|
|
31
|
+
cli: { 'shared-dependencies': deps, 'webpack': { 'shared-dependencies': deps } },
|
|
32
|
+
});
|
|
33
|
+
expect(() => validateSharedDependencies()).not.toThrow();
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
test('throws when shared-dependencies both exist and differ', () => {
|
|
37
|
+
mockPackageJson({
|
|
38
|
+
cli: {
|
|
39
|
+
'shared-dependencies': { defaults: '' },
|
|
40
|
+
'webpack': { 'shared-dependencies': { defaults: '', extra: 'foo' } },
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
expect(() => validateSharedDependencies()).toThrow(/both set but differ/);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
test('throws when expose-shared-dependencies both exist and differ', () => {
|
|
47
|
+
mockPackageJson({
|
|
48
|
+
cli: {
|
|
49
|
+
'expose-shared-dependencies': true,
|
|
50
|
+
'webpack': { 'expose-shared-dependencies': false },
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
expect(() => validateSharedDependencies()).toThrow(/both set but differ/);
|
|
54
|
+
});
|
|
55
|
+
});
|
|
@@ -4,6 +4,7 @@ import { ESLint } from 'eslint';
|
|
|
4
4
|
import fs from 'fs';
|
|
5
5
|
import path from 'path';
|
|
6
6
|
import { LinterOptions } from 'stylelint';
|
|
7
|
+
import svgr from 'vite-plugin-svgr';
|
|
7
8
|
import { ViteUserConfig } from 'vitest/config';
|
|
8
9
|
import { Configuration as WebpackDevServerConfiguration } from 'webpack-dev-server';
|
|
9
10
|
import { ReviewConfiguration } from '../cli/commands/review';
|
|
@@ -11,10 +12,12 @@ import { getFolders } from './get-folders';
|
|
|
11
12
|
import { log } from './log';
|
|
12
13
|
import { readJson, readJsonSafe } from './read-json';
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
type VitePluginSvgrOptions = NonNullable<Parameters<typeof svgr>[0]>;
|
|
15
16
|
|
|
16
17
|
type ElementType<T> = T extends readonly (infer ElementType)[] ? ElementType : never;
|
|
17
18
|
|
|
19
|
+
export const allowedWebpackDevServerOptions = ['headers', 'port', 'proxy', 'static'] as const;
|
|
20
|
+
|
|
18
21
|
export interface MinifyJSOptions {
|
|
19
22
|
compress?: boolean;
|
|
20
23
|
mangle?: boolean;
|
|
@@ -38,6 +41,7 @@ export interface WebpackConfiguration extends Omit<
|
|
|
38
41
|
'disable-style-check'?: boolean;
|
|
39
42
|
'minify'?: MinifyOptions;
|
|
40
43
|
'proxy'?: WebpackDevServerConfiguration['proxy'] | string;
|
|
44
|
+
'shared-dependencies'?: Record<string, string>;
|
|
41
45
|
}
|
|
42
46
|
|
|
43
47
|
export interface ESLintConfiguration extends ESLint.Options {
|
|
@@ -62,6 +66,8 @@ export interface NodeConfiguration {
|
|
|
62
66
|
export enum CommandName {
|
|
63
67
|
'build' = 'build',
|
|
64
68
|
'bundle-package' = 'bundle-package',
|
|
69
|
+
'bundle-vite' = 'bundle-vite',
|
|
70
|
+
'bundle-webpack' = 'bundle-webpack',
|
|
65
71
|
'clean' = 'clean',
|
|
66
72
|
'convert-eslint-config' = 'convert-eslint-config',
|
|
67
73
|
'eslint' = 'eslint',
|
|
@@ -92,6 +98,34 @@ export type VitestConfiguration = ViteUserConfig['test'] & {
|
|
|
92
98
|
omitDefault?: string[];
|
|
93
99
|
};
|
|
94
100
|
|
|
101
|
+
export interface HtmlPluginOptions {
|
|
102
|
+
title?: string;
|
|
103
|
+
favicon?: string;
|
|
104
|
+
template?: string;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface SvgrPluginOptions {
|
|
108
|
+
include?: VitePluginSvgrOptions['include'];
|
|
109
|
+
exclude?: VitePluginSvgrOptions['exclude'];
|
|
110
|
+
svgrOptions?: VitePluginSvgrOptions['svgrOptions'];
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export interface PluginOverrides {
|
|
114
|
+
html?: HtmlPluginOptions;
|
|
115
|
+
svgr?: SvgrPluginOptions;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export interface ViteBundlerConfig {
|
|
119
|
+
port?: number;
|
|
120
|
+
omitDefault?: string[];
|
|
121
|
+
minify?: MinifyOptions;
|
|
122
|
+
pluginOverrides?: PluginOverrides;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export interface VitePackageJsonOverride extends ViteBundlerConfig {
|
|
126
|
+
config?: Omit<import('vite').UserConfig, 'plugins'>;
|
|
127
|
+
}
|
|
128
|
+
|
|
95
129
|
export interface WebComponentBranchConfigs {
|
|
96
130
|
publishTag?: string;
|
|
97
131
|
uploadSourcemaps?: boolean;
|
|
@@ -114,6 +148,9 @@ type Configuration = {
|
|
|
114
148
|
'swc-compile-package'?: Parameters<typeof swcDir>[0];
|
|
115
149
|
'test'?: JestConfiguration; // for backward-compatibility
|
|
116
150
|
'testRunner'?: string;
|
|
151
|
+
'expose-shared-dependencies'?: boolean;
|
|
152
|
+
'shared-dependencies'?: Record<string, string>;
|
|
153
|
+
'vite'?: false | VitePackageJsonOverride;
|
|
117
154
|
'vitest'?: VitestConfiguration;
|
|
118
155
|
'web-component'?: boolean | string | WebComponentOptions;
|
|
119
156
|
'webpack'?: false | WebpackConfiguration;
|
|
@@ -156,6 +193,11 @@ export function getStylelintConfiguration() {
|
|
|
156
193
|
return getConfiguration().lint?.stylelint ?? {};
|
|
157
194
|
}
|
|
158
195
|
|
|
196
|
+
export function getViteConfiguration(): VitePackageJsonOverride {
|
|
197
|
+
const { vite } = getConfiguration();
|
|
198
|
+
return typeof vite === 'object' ? vite : {};
|
|
199
|
+
}
|
|
200
|
+
|
|
159
201
|
export function getVitestConfiguration() {
|
|
160
202
|
return getConfiguration().vitest ?? {};
|
|
161
203
|
}
|
|
@@ -213,11 +255,10 @@ export function getSwcCompilePackageConfiguration() {
|
|
|
213
255
|
}
|
|
214
256
|
|
|
215
257
|
export function isBundle(locationOrJson?: LocationOrJson) {
|
|
216
|
-
return
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
return getWebpackConfiguration()['custom-style-rules'] === true;
|
|
258
|
+
return (
|
|
259
|
+
getConfiguration(locationOrJson).webpack !== false &&
|
|
260
|
+
getConfiguration(locationOrJson).vite !== false
|
|
261
|
+
);
|
|
221
262
|
}
|
|
222
263
|
|
|
223
264
|
export function isDevServerDisabled() {
|
|
@@ -226,7 +267,10 @@ export function isDevServerDisabled() {
|
|
|
226
267
|
}
|
|
227
268
|
|
|
228
269
|
export function isExposeSharedDependencies() {
|
|
229
|
-
return
|
|
270
|
+
return (
|
|
271
|
+
(getConfiguration()['expose-shared-dependencies'] ??
|
|
272
|
+
getWebpackConfiguration()['expose-shared-dependencies']) === true
|
|
273
|
+
);
|
|
230
274
|
}
|
|
231
275
|
|
|
232
276
|
export function isLegacy(locationOrJson?: LocationOrJson) {
|
|
@@ -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
|
}
|
|
@@ -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,4 @@ export * from './pick';
|
|
|
23
22
|
export * from './prettify';
|
|
24
23
|
export * from './read-json';
|
|
25
24
|
export * from './to-array';
|
|
25
|
+
export * from './validate-shared-dependencies';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { getConfiguration, getWebpackConfiguration } from './get-configuration';
|
|
2
|
+
|
|
3
|
+
export function validateSharedDependencies() {
|
|
4
|
+
const config = getConfiguration();
|
|
5
|
+
const webpackSharedDependencies = getWebpackConfiguration()['shared-dependencies'];
|
|
6
|
+
const topLevelSharedDependencies = config['shared-dependencies'];
|
|
7
|
+
|
|
8
|
+
if (
|
|
9
|
+
webpackSharedDependencies &&
|
|
10
|
+
topLevelSharedDependencies &&
|
|
11
|
+
JSON.stringify(webpackSharedDependencies) !== JSON.stringify(topLevelSharedDependencies)
|
|
12
|
+
) {
|
|
13
|
+
throw new Error(
|
|
14
|
+
'cli.shared-dependencies and cli.webpack.shared-dependencies are both set but differ. ' +
|
|
15
|
+
'Remove cli.webpack.shared-dependencies and use cli.shared-dependencies only.'
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const webpackExpose = getWebpackConfiguration()['expose-shared-dependencies'];
|
|
20
|
+
const topLevelExpose = config['expose-shared-dependencies'];
|
|
21
|
+
|
|
22
|
+
if (
|
|
23
|
+
webpackExpose !== undefined &&
|
|
24
|
+
topLevelExpose !== undefined &&
|
|
25
|
+
webpackExpose !== topLevelExpose
|
|
26
|
+
) {
|
|
27
|
+
throw new Error(
|
|
28
|
+
'cli.expose-shared-dependencies and cli.webpack.expose-shared-dependencies are both set but differ. ' +
|
|
29
|
+
'Remove cli.webpack.expose-shared-dependencies and use cli.expose-shared-dependencies only.'
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { build } from 'vite';
|
|
2
|
+
import type { BuildContext } from '../../core';
|
|
3
|
+
import { bundleConstants, createBuildContext, getOutputPath } 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
|
+
bundleConstants: {
|
|
13
|
+
mode: { production: 'production', development: 'development' },
|
|
14
|
+
},
|
|
15
|
+
createBuildContext: jest.fn(),
|
|
16
|
+
getOutputPath: 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
|
+
let options: any;
|
|
27
|
+
let context: BuildContext;
|
|
28
|
+
|
|
29
|
+
beforeEach(() => {
|
|
30
|
+
jest.clearAllMocks();
|
|
31
|
+
options = { name: 'my-app' };
|
|
32
|
+
context = {
|
|
33
|
+
build: { isProduction: false },
|
|
34
|
+
package: {
|
|
35
|
+
sharedDependencies: { react: 'globalReact' },
|
|
36
|
+
destination: '/output/pkg',
|
|
37
|
+
},
|
|
38
|
+
} as any;
|
|
39
|
+
jest.mocked(createViteConfig).mockResolvedValue({});
|
|
40
|
+
jest.mocked(createBuildContext).mockReturnValue(context);
|
|
41
|
+
jest.mocked(getOutputPath).mockReturnValue('/output/pkg/bundle');
|
|
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
|
+
outputBasePath: undefined,
|
|
52
|
+
emitExposedDependencies: true,
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
test('passes shared dependencies and metadata directory to plugin', async () => {
|
|
57
|
+
await subject();
|
|
58
|
+
|
|
59
|
+
expect(sharedDependenciesPlugin).toHaveBeenCalledWith(
|
|
60
|
+
expect.objectContaining({
|
|
61
|
+
dependencies: context.package.sharedDependencies,
|
|
62
|
+
metadataDir: context.package.destination,
|
|
63
|
+
})
|
|
64
|
+
);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
test('builds with development mode', async () => {
|
|
68
|
+
await subject();
|
|
69
|
+
|
|
70
|
+
expect(build).toHaveBeenCalledWith(
|
|
71
|
+
expect.objectContaining({ mode: bundleConstants.mode.development })
|
|
72
|
+
);
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
test('builds with output directory from context', async () => {
|
|
76
|
+
await subject();
|
|
77
|
+
|
|
78
|
+
expect(build).toHaveBeenCalledWith(
|
|
79
|
+
expect.objectContaining({
|
|
80
|
+
build: expect.objectContaining({ outDir: getOutputPath(context) }),
|
|
81
|
+
})
|
|
82
|
+
);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
test('disables config file', async () => {
|
|
86
|
+
await subject();
|
|
87
|
+
|
|
88
|
+
expect(build).toHaveBeenCalledWith(expect.objectContaining({ configFile: false }));
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
test('strips legal comments', async () => {
|
|
92
|
+
await subject();
|
|
93
|
+
|
|
94
|
+
expect(build).toHaveBeenCalledWith(
|
|
95
|
+
expect.objectContaining({ oxc: { legalComments: 'none' } })
|
|
96
|
+
);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
describe('when user config sets oxc options', () => {
|
|
100
|
+
const oxc = {
|
|
101
|
+
minify: { compress: true },
|
|
102
|
+
target: 'es2020',
|
|
103
|
+
legalComments: 'inline',
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
beforeEach(() => {
|
|
107
|
+
jest.mocked(createViteConfig).mockResolvedValue({ oxc });
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
test('forwards only oxc.minify', async () => {
|
|
111
|
+
await subject();
|
|
112
|
+
|
|
113
|
+
expect(build).toHaveBeenCalledWith(
|
|
114
|
+
expect.objectContaining({
|
|
115
|
+
oxc: { minify: oxc.minify, legalComments: 'none' },
|
|
116
|
+
})
|
|
117
|
+
);
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
test('passes empty CSS entries to plugin', async () => {
|
|
122
|
+
await subject();
|
|
123
|
+
|
|
124
|
+
expect(sharedDependenciesPlugin).toHaveBeenCalledWith(expect.objectContaining({ css: {} }));
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
describe('when production', () => {
|
|
128
|
+
beforeEach(() => (context.build.isProduction = true));
|
|
129
|
+
|
|
130
|
+
test('builds with production mode', async () => {
|
|
131
|
+
await subject();
|
|
132
|
+
|
|
133
|
+
expect(build).toHaveBeenCalledWith(
|
|
134
|
+
expect.objectContaining({ mode: bundleConstants.mode.production })
|
|
135
|
+
);
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
describe('when user config has custom outDir', () => {
|
|
140
|
+
const customOutDir = '/custom/out';
|
|
141
|
+
const customOutputPath = '/custom/out/bundle';
|
|
142
|
+
|
|
143
|
+
beforeEach(() => {
|
|
144
|
+
jest.mocked(createViteConfig).mockResolvedValue({
|
|
145
|
+
build: { outDir: customOutDir },
|
|
146
|
+
});
|
|
147
|
+
jest.mocked(getOutputPath).mockReturnValue(customOutputPath);
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
test('passes custom output path to build context', async () => {
|
|
151
|
+
await subject();
|
|
152
|
+
|
|
153
|
+
expect(createBuildContext).toHaveBeenCalledWith({
|
|
154
|
+
...options,
|
|
155
|
+
outputBasePath: customOutDir,
|
|
156
|
+
emitExposedDependencies: true,
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
test('builds with custom output directory', async () => {
|
|
161
|
+
await subject();
|
|
162
|
+
|
|
163
|
+
expect(build).toHaveBeenCalledWith(
|
|
164
|
+
expect.objectContaining({
|
|
165
|
+
build: expect.objectContaining({ outDir: customOutputPath }),
|
|
166
|
+
})
|
|
167
|
+
);
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
describe('when user config sets build.minify', () => {
|
|
172
|
+
const minify = true;
|
|
173
|
+
|
|
174
|
+
beforeEach(() => {
|
|
175
|
+
jest.mocked(createViteConfig).mockResolvedValue({ build: { minify } });
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
test('forwards minify to build', async () => {
|
|
179
|
+
await subject();
|
|
180
|
+
|
|
181
|
+
expect(build).toHaveBeenCalledWith(
|
|
182
|
+
expect.objectContaining({
|
|
183
|
+
build: expect.objectContaining({ minify }),
|
|
184
|
+
})
|
|
185
|
+
);
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
describe('when user config sets build.cssMinify', () => {
|
|
190
|
+
const cssMinify = 'esbuild';
|
|
191
|
+
|
|
192
|
+
beforeEach(() => {
|
|
193
|
+
jest.mocked(createViteConfig).mockResolvedValue({ build: { cssMinify } });
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
test('forwards cssMinify to build', async () => {
|
|
197
|
+
await subject();
|
|
198
|
+
|
|
199
|
+
expect(build).toHaveBeenCalledWith(
|
|
200
|
+
expect.objectContaining({
|
|
201
|
+
build: expect.objectContaining({ cssMinify }),
|
|
202
|
+
})
|
|
203
|
+
);
|
|
204
|
+
});
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
describe('when user config sets build.terserOptions', () => {
|
|
208
|
+
const terserOptions = { maxWorkers: 1 };
|
|
209
|
+
|
|
210
|
+
beforeEach(() => {
|
|
211
|
+
jest.mocked(createViteConfig).mockResolvedValue({ build: { terserOptions } });
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
test('forwards terserOptions to build', async () => {
|
|
215
|
+
await subject();
|
|
216
|
+
|
|
217
|
+
expect(build).toHaveBeenCalledWith(
|
|
218
|
+
expect.objectContaining({
|
|
219
|
+
build: expect.objectContaining({ terserOptions }),
|
|
220
|
+
})
|
|
221
|
+
);
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
describe('when shared dependencies include design-system', () => {
|
|
226
|
+
beforeEach(() => {
|
|
227
|
+
context.package.sharedDependencies['@servicetitan/design-system'] =
|
|
228
|
+
'globalDesignSystem';
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
test('passes design-system CSS entries to plugin', async () => {
|
|
232
|
+
await subject();
|
|
233
|
+
|
|
234
|
+
expect(sharedDependenciesPlugin).toHaveBeenCalledWith(
|
|
235
|
+
expect.objectContaining({
|
|
236
|
+
css: {
|
|
237
|
+
'design-system': [
|
|
238
|
+
'@servicetitan/tokens/core/tokens.css',
|
|
239
|
+
'@servicetitan/anvil-fonts/dist/css/anvil-fonts.css',
|
|
240
|
+
'@servicetitan/design-system/dist/system.min.css',
|
|
241
|
+
],
|
|
242
|
+
},
|
|
243
|
+
})
|
|
244
|
+
);
|
|
245
|
+
});
|
|
246
|
+
});
|
|
247
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { fs, vol } from 'memfs';
|
|
2
|
+
import { validateViteSharedDependencies } from '../validate-shared-dependencies';
|
|
3
|
+
|
|
4
|
+
jest.mock('fs', () => fs);
|
|
5
|
+
|
|
6
|
+
describe('validateViteSharedDependencies', () => {
|
|
7
|
+
function mockPackageJson(content: Record<string, any> = {}) {
|
|
8
|
+
vol.fromJSON({ 'package.json': JSON.stringify(content) });
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
afterEach(() => vol.reset());
|
|
12
|
+
|
|
13
|
+
test('passes when neither is set', () => {
|
|
14
|
+
mockPackageJson();
|
|
15
|
+
expect(() => validateViteSharedDependencies()).not.toThrow();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
test('passes when only cli top level is set', () => {
|
|
19
|
+
mockPackageJson({ cli: { 'expose-shared-dependencies': true } });
|
|
20
|
+
expect(() => validateViteSharedDependencies()).not.toThrow();
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
test('throws when webpack shared-dependencies is set but top level is not', () => {
|
|
24
|
+
mockPackageJson({ cli: { webpack: { 'shared-dependencies': { defaults: '' } } } });
|
|
25
|
+
expect(() => validateViteSharedDependencies()).toThrow(/Move your shared-dependencies/);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test('throws when webpack expose-shared-dependencies is set but top level is not', () => {
|
|
29
|
+
mockPackageJson({ cli: { webpack: { 'expose-shared-dependencies': true } } });
|
|
30
|
+
expect(() => validateViteSharedDependencies()).toThrow(
|
|
31
|
+
/Move your expose-shared-dependencies/
|
|
32
|
+
);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { build } from 'vite';
|
|
2
|
+
import {
|
|
3
|
+
BuildContext,
|
|
4
|
+
BuildContextOptions,
|
|
5
|
+
bundleConstants,
|
|
6
|
+
createBuildContext,
|
|
7
|
+
getOutputPath,
|
|
8
|
+
} from '../core';
|
|
9
|
+
import { createViteConfig } from './config';
|
|
10
|
+
import { sharedDependenciesPlugin } from './plugins/shared-dependencies-plugin';
|
|
11
|
+
|
|
12
|
+
export async function buildSharedDependencies(options: BuildContextOptions) {
|
|
13
|
+
const config = await createViteConfig(options);
|
|
14
|
+
const context = createBuildContext({
|
|
15
|
+
...options,
|
|
16
|
+
outputBasePath: config.build?.outDir,
|
|
17
|
+
emitExposedDependencies: true,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
await build({
|
|
21
|
+
configFile: false,
|
|
22
|
+
oxc: {
|
|
23
|
+
minify: config.oxc ? config.oxc.minify : undefined,
|
|
24
|
+
legalComments: 'none',
|
|
25
|
+
},
|
|
26
|
+
mode: getMode(context),
|
|
27
|
+
plugins: [getSharedDependenciesPlugin(context)],
|
|
28
|
+
build: {
|
|
29
|
+
outDir: getOutputPath(context),
|
|
30
|
+
minify: config.build?.minify,
|
|
31
|
+
cssMinify: config.build?.cssMinify,
|
|
32
|
+
terserOptions: config.build?.terserOptions,
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function getMode(context: BuildContext) {
|
|
38
|
+
return context.build.isProduction
|
|
39
|
+
? bundleConstants.mode.production
|
|
40
|
+
: bundleConstants.mode.development;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function getSharedDependenciesPlugin(context: BuildContext) {
|
|
44
|
+
const { destination: metadataDir, sharedDependencies: dependencies } = context.package;
|
|
45
|
+
|
|
46
|
+
const css: Record<string, string[]> = {};
|
|
47
|
+
if (dependencies['@servicetitan/design-system']) {
|
|
48
|
+
css['design-system'] = [
|
|
49
|
+
'@servicetitan/tokens/core/tokens.css',
|
|
50
|
+
'@servicetitan/anvil-fonts/dist/css/anvil-fonts.css',
|
|
51
|
+
'@servicetitan/design-system/dist/system.min.css',
|
|
52
|
+
];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return sharedDependenciesPlugin({ css, dependencies, metadataDir });
|
|
56
|
+
}
|