@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
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Configuration } from 'webpack';
|
|
2
|
+
import { Overrides, WebpackBuildContext } from '../types';
|
|
2
3
|
import { rulesConfig } from './rules-config';
|
|
3
|
-
import { Context, Overrides } from './types';
|
|
4
4
|
|
|
5
5
|
type Config = Configuration['module'];
|
|
6
6
|
type Result = Pick<Configuration, 'module'>;
|
|
7
7
|
|
|
8
|
-
export function moduleConfig(context:
|
|
8
|
+
export function moduleConfig(context: WebpackBuildContext, overrides: Overrides): Result {
|
|
9
9
|
const module: Config = { ...rulesConfig(context, overrides) };
|
|
10
10
|
|
|
11
11
|
return { module };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import CssMinimizerWebpackPlugin from 'css-minimizer-webpack-plugin';
|
|
2
2
|
import TerserPlugin from 'terser-webpack-plugin';
|
|
3
3
|
import { Configuration } from 'webpack';
|
|
4
|
-
import {
|
|
4
|
+
import { Overrides, WebpackBuildContext } from '../types';
|
|
5
5
|
|
|
6
6
|
type Config = Configuration['optimization'];
|
|
7
7
|
type ConfigWithCacheGroups = Config & { splitChunks: { cacheGroups: Record<string, any> } };
|
|
8
8
|
type Result = Pick<Configuration, 'optimization'>;
|
|
9
9
|
|
|
10
|
-
export function optimizationConfig(context:
|
|
11
|
-
const {
|
|
10
|
+
export function optimizationConfig(context: WebpackBuildContext, _: Overrides): Result {
|
|
11
|
+
const { headless, isProduction, emitExposedDependencies } = context.build;
|
|
12
12
|
|
|
13
13
|
const optimization: ConfigWithCacheGroups = {
|
|
14
14
|
chunkIds: isProduction ? 'deterministic' : 'named',
|
|
@@ -30,14 +30,16 @@ export function optimizationConfig(context: Context, _: Overrides): Result {
|
|
|
30
30
|
return { optimization };
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
function minimizeConfig(optimization: ConfigWithCacheGroups, context:
|
|
34
|
-
const { isProduction
|
|
33
|
+
function minimizeConfig(optimization: ConfigWithCacheGroups, context: WebpackBuildContext) {
|
|
34
|
+
const { isProduction } = context.build;
|
|
35
|
+
const { codeCoverage } = context.options;
|
|
36
|
+
const { minify } = context.bundlerConfig;
|
|
35
37
|
if (!isProduction) {
|
|
36
38
|
return;
|
|
37
39
|
}
|
|
38
40
|
|
|
39
|
-
const minifyJs =
|
|
40
|
-
const minifyCss =
|
|
41
|
+
const minifyJs = minify?.js ?? true;
|
|
42
|
+
const minifyCss = minify?.css ?? true;
|
|
41
43
|
optimization.minimize = !codeCoverage && (!!minifyJs || !!minifyCss);
|
|
42
44
|
if (!optimization.minimize) {
|
|
43
45
|
return;
|
|
@@ -59,8 +61,11 @@ function minimizeConfig(optimization: ConfigWithCacheGroups, context: Context) {
|
|
|
59
61
|
];
|
|
60
62
|
}
|
|
61
63
|
|
|
62
|
-
function sharedDependenciesConfig(
|
|
63
|
-
|
|
64
|
+
function sharedDependenciesConfig(
|
|
65
|
+
optimization: ConfigWithCacheGroups,
|
|
66
|
+
context: WebpackBuildContext
|
|
67
|
+
) {
|
|
68
|
+
const { emitExposedDependencies } = context.build;
|
|
64
69
|
if (!emitExposedDependencies) {
|
|
65
70
|
return;
|
|
66
71
|
}
|
|
@@ -75,8 +80,9 @@ function sharedDependenciesConfig(optimization: ConfigWithCacheGroups, context:
|
|
|
75
80
|
});
|
|
76
81
|
}
|
|
77
82
|
|
|
78
|
-
function webComponentConfig(optimization: ConfigWithCacheGroups, context:
|
|
79
|
-
const { headless,
|
|
83
|
+
function webComponentConfig(optimization: ConfigWithCacheGroups, context: WebpackBuildContext) {
|
|
84
|
+
const { headless, isProduction } = context.build;
|
|
85
|
+
const { isWebComponent } = context.package;
|
|
80
86
|
if (!isWebComponent || headless) {
|
|
81
87
|
return;
|
|
82
88
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import path from 'path';
|
|
2
1
|
import { Configuration } from 'webpack';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { BuildContext, getBundleType, getCdnPath, getOutputPath } from '../../core';
|
|
3
|
+
import { Overrides } from '../types';
|
|
5
4
|
|
|
6
5
|
type Config = Configuration['output'];
|
|
7
6
|
type Result = Pick<Configuration, 'output'>;
|
|
8
7
|
|
|
9
|
-
export function outputConfig(context:
|
|
10
|
-
const {
|
|
8
|
+
export function outputConfig(context: BuildContext, _: Overrides): Result {
|
|
9
|
+
const { name, isProduction, emitExposedDependencies } = context.build;
|
|
10
|
+
const { isWebComponent } = context.package;
|
|
11
11
|
|
|
12
12
|
const output: Config = {
|
|
13
13
|
filename: '[name].bundle.js',
|
|
@@ -17,7 +17,7 @@ export function outputConfig(context: Context, _: Overrides): Result {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
if (isProduction) {
|
|
20
|
-
const cdnPath =
|
|
20
|
+
const cdnPath = getCdnPath(context);
|
|
21
21
|
Object.assign(output, {
|
|
22
22
|
filename: '[name].[contenthash].bundle.js',
|
|
23
23
|
...(isWebComponent ? { uniqueName: name } : {}),
|
|
@@ -28,25 +28,14 @@ export function outputConfig(context: Context, _: Overrides): Result {
|
|
|
28
28
|
return { output };
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
function getClean(context:
|
|
32
|
-
const { emitExposedDependencies } = context;
|
|
31
|
+
function getClean(context: BuildContext): NonNullable<Config>['clean'] {
|
|
32
|
+
const { emitExposedDependencies } = context.build;
|
|
33
33
|
if (emitExposedDependencies) {
|
|
34
34
|
return true;
|
|
35
35
|
}
|
|
36
|
-
const exposedDependenciesDir = getBundleType({
|
|
36
|
+
const exposedDependenciesDir = getBundleType({
|
|
37
|
+
...context,
|
|
38
|
+
build: { ...context.build, emitExposedDependencies: true },
|
|
39
|
+
});
|
|
37
40
|
return exposedDependenciesDir ? { keep: new RegExp(exposedDependenciesDir) } : true;
|
|
38
41
|
}
|
|
39
|
-
|
|
40
|
-
function getOutputPath(context: Context) {
|
|
41
|
-
const { destination, emitExposedDependencies } = context;
|
|
42
|
-
|
|
43
|
-
const subdir = getBundleType(context) ?? '';
|
|
44
|
-
if (typeof emitExposedDependencies === 'object') {
|
|
45
|
-
const { output } = emitExposedDependencies;
|
|
46
|
-
if (output?.path) {
|
|
47
|
-
return path.join(output.path, subdir);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return path.join(process.cwd(), destination, 'bundle', subdir);
|
|
52
|
-
}
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
1
|
import { WebpackAssetsManifest } from 'webpack-assets-manifest';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { generateMetadata } from '../utils';
|
|
7
|
-
|
|
8
|
-
interface Metadata {
|
|
9
|
-
entryPointsPath: string;
|
|
10
|
-
}
|
|
2
|
+
import { BuildContext, generateExposedDependenciesMetadata, generateMetadata } from '../../../core';
|
|
3
|
+
import { Overrides } from '../../types';
|
|
11
4
|
|
|
12
5
|
interface EntryPoints {
|
|
13
6
|
css: string[];
|
|
14
7
|
js: string[];
|
|
15
8
|
}
|
|
16
9
|
|
|
17
|
-
export function assetsManifestPlugin(context:
|
|
18
|
-
|
|
10
|
+
export function assetsManifestPlugin(context: BuildContext, _: Overrides) {
|
|
11
|
+
const { destination, isWebComponent } = context.package;
|
|
12
|
+
const { emitExposedDependencies } = context.build;
|
|
13
|
+
|
|
14
|
+
if (!(isWebComponent || emitExposedDependencies)) {
|
|
19
15
|
return;
|
|
20
16
|
}
|
|
21
17
|
|
|
@@ -38,8 +34,8 @@ export function assetsManifestPlugin(context: Context, _: Overrides) {
|
|
|
38
34
|
},
|
|
39
35
|
// eslint-disable-next-line @typescript-eslint/require-await
|
|
40
36
|
done: async (manifest: WebpackAssetsManifest) => {
|
|
41
|
-
if (
|
|
42
|
-
generateExposedDependenciesMetadata(
|
|
37
|
+
if (emitExposedDependencies) {
|
|
38
|
+
generateExposedDependenciesMetadata(destination, () => manifest.getOutputPath());
|
|
43
39
|
} else {
|
|
44
40
|
generateMetadata(context);
|
|
45
41
|
}
|
|
@@ -53,26 +49,3 @@ function ensureDesignSystemCssIsFirst(cssAssets: string[]) {
|
|
|
53
49
|
? [cssAssets[offset], ...cssAssets.filter((_, index) => index !== offset)]
|
|
54
50
|
: cssAssets;
|
|
55
51
|
}
|
|
56
|
-
|
|
57
|
-
export function getExposedDependenciesEntryPoints(context: Context) {
|
|
58
|
-
const metadataPath = getExposedDependenciesMetadataPath(context);
|
|
59
|
-
const metadata = readJsonSafe<Metadata>(metadataPath);
|
|
60
|
-
if (metadata?.entryPointsPath) {
|
|
61
|
-
return readJsonSafe<EntryPoints>(metadata.entryPointsPath);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function generateExposedDependenciesMetadata(context: Context, manifest: WebpackAssetsManifest) {
|
|
66
|
-
const { destination } = context;
|
|
67
|
-
if (!fs.existsSync(destination)) {
|
|
68
|
-
fs.mkdirSync(destination, { recursive: true });
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const metadataPath = getExposedDependenciesMetadataPath(context);
|
|
72
|
-
const metadata: Metadata = { entryPointsPath: manifest.getOutputPath() };
|
|
73
|
-
fs.writeFileSync(metadataPath, JSON.stringify(metadata, null, 2), 'utf-8');
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function getExposedDependenciesMetadataPath({ destination }: Context) {
|
|
77
|
-
return path.join(destination, 'exposed-dependencies-metadata.json');
|
|
78
|
-
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import os from 'os';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { BuildContext, getBundleType } from '../../../core';
|
|
4
|
+
import { Overrides } from '../../types';
|
|
5
5
|
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
|
6
6
|
|
|
7
|
-
export function bundleAnalyzerPlugin(context:
|
|
8
|
-
if (!context.buildStat) {
|
|
7
|
+
export function bundleAnalyzerPlugin(context: BuildContext, _: Overrides) {
|
|
8
|
+
if (!context.options.buildStat) {
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
11
|
|
|
@@ -16,14 +16,14 @@ export function bundleAnalyzerPlugin(context: Context, _: Overrides) {
|
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
function getReportFileName(context:
|
|
19
|
+
function getReportFileName(context: BuildContext) {
|
|
20
20
|
const type = getBundleType(context);
|
|
21
21
|
const qualifier = type ? `-${type}` : '';
|
|
22
|
-
return `${context.
|
|
22
|
+
return `${context.package.name}${qualifier}-bundle-${Date.now()}.html`;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
function getReportTitle(context:
|
|
26
|
-
const unscopedName = context.
|
|
25
|
+
function getReportTitle(context: BuildContext) {
|
|
26
|
+
const unscopedName = context.package.name.replace(/^@[^/]+\//, '');
|
|
27
27
|
const type = getBundleType(context);
|
|
28
28
|
const qualifier = type ? ` (${type})` : '';
|
|
29
29
|
return `${unscopedName}${qualifier} ${formatDate(new Date())}`;
|
|
@@ -1,24 +1,13 @@
|
|
|
1
1
|
import { DefinePlugin } from 'webpack';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { BuildContext, defineExposedDependencies } from '../../../core';
|
|
3
|
+
import { Overrides } from '../../types';
|
|
4
4
|
|
|
5
|
-
export function defineExposedDependenciesPlugin(context:
|
|
6
|
-
const
|
|
7
|
-
|
|
5
|
+
export function defineExposedDependenciesPlugin(context: BuildContext, _: Overrides) {
|
|
6
|
+
const definition = defineExposedDependencies(context);
|
|
7
|
+
|
|
8
|
+
if (!definition) {
|
|
8
9
|
return;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
const workspacePackage = packageManager.getWorkspacePackage();
|
|
13
|
-
const exposedDependencies = getExposedDependencies(
|
|
14
|
-
sharedDependencies,
|
|
15
|
-
dependency =>
|
|
16
|
-
packageManager.getResolvedVersion({ workspacePackage, dependency }) ??
|
|
17
|
-
packageData.dependencies?.[dependency]
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
return new DefinePlugin({
|
|
21
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
22
|
-
EXPOSED_DEPENDENCIES: JSON.stringify(exposedDependencies),
|
|
23
|
-
});
|
|
12
|
+
return new DefinePlugin(definition);
|
|
24
13
|
}
|
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
import { DefinePlugin } from 'webpack';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { BuildContext, defineExposedInstanceDependencies } from '../../../core';
|
|
3
|
+
import { Overrides } from '../../types';
|
|
4
4
|
|
|
5
|
-
export function defineExposedInstanceDependenciesPlugin(context:
|
|
6
|
-
const
|
|
7
|
-
|
|
5
|
+
export function defineExposedInstanceDependenciesPlugin(context: BuildContext, _: Overrides) {
|
|
6
|
+
const definition = defineExposedInstanceDependencies(context);
|
|
7
|
+
|
|
8
|
+
if (!definition) {
|
|
8
9
|
return;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
launchDarkly: { version: getLaunchDarklySdkVersion(context.packageManager) },
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
return new DefinePlugin({
|
|
16
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
17
|
-
EXPOSED_INSTANCE_DEPENDENCIES: JSON.stringify(instanceDependencies),
|
|
18
|
-
});
|
|
12
|
+
return new DefinePlugin(definition);
|
|
19
13
|
}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { DefinePlugin } from 'webpack';
|
|
2
|
-
import {
|
|
2
|
+
import { BuildContext, defineWebComponentName } from '../../../core';
|
|
3
|
+
import { Overrides } from '../../types';
|
|
3
4
|
|
|
4
|
-
export function defineWebComponentNamePlugin(context:
|
|
5
|
-
const
|
|
6
|
-
|
|
5
|
+
export function defineWebComponentNamePlugin(context: BuildContext, _: Overrides) {
|
|
6
|
+
const definition = defineWebComponentName(context);
|
|
7
|
+
|
|
8
|
+
if (!definition) {
|
|
7
9
|
return;
|
|
8
10
|
}
|
|
9
11
|
|
|
10
|
-
return new DefinePlugin(
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
12
|
-
WEB_COMPONENT_NAME: JSON.stringify(name),
|
|
13
|
-
});
|
|
12
|
+
return new DefinePlugin(definition);
|
|
14
13
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
const FilterWarningsPlugin = require('webpack-filter-warnings-plugin');
|
|
2
|
-
import {
|
|
2
|
+
import { BuildContext } from '../../../core';
|
|
3
|
+
import { Overrides } from '../../types';
|
|
3
4
|
|
|
4
|
-
export function filterWarningsPlugin(
|
|
5
|
-
if (
|
|
5
|
+
export function filterWarningsPlugin(context: BuildContext, _: Overrides) {
|
|
6
|
+
if (context.build.light) {
|
|
6
7
|
return;
|
|
7
8
|
}
|
|
8
9
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import deepmerge from 'deepmerge';
|
|
2
2
|
import HtmlWebpackPlugin, { Options as HtmlWebpackPluginOptions } from 'html-webpack-plugin';
|
|
3
|
+
import { BuildContext } from '../../../core';
|
|
4
|
+
import { Overrides } from '../../types';
|
|
3
5
|
import { splitByEntry } from '../../utils';
|
|
4
|
-
import { Context, Overrides } from '../types';
|
|
5
6
|
|
|
6
|
-
export function htmlPlugin(
|
|
7
|
-
{
|
|
8
|
-
{
|
|
9
|
-
) {
|
|
7
|
+
export function htmlPlugin(context: BuildContext, { plugins }: Overrides) {
|
|
8
|
+
const { light, headless, name, emitExposedDependencies } = context.build;
|
|
9
|
+
const { isWebComponent } = context.package;
|
|
10
10
|
const { HtmlWebpackPlugin: htmlWebpackPluginOptions = {} } = plugins ?? {};
|
|
11
11
|
|
|
12
|
-
if (
|
|
12
|
+
if (light || headless || emitExposedDependencies) {
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -1,28 +1,21 @@
|
|
|
1
1
|
import HtmlWebpackTagsPlugin from 'html-webpack-tags-plugin';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { getExposedDependenciesEntryPoints } from './assets-manifest-plugin';
|
|
2
|
+
import { BuildContext, getSharedEntryPoints } from '../../../core';
|
|
3
|
+
import { Overrides } from '../../types';
|
|
5
4
|
|
|
6
|
-
export function htmlTagsPlugin(context:
|
|
7
|
-
const {
|
|
5
|
+
export function htmlTagsPlugin(context: BuildContext, _overrides: Overrides) {
|
|
6
|
+
const { isExposeSharedDependencies } = context.package;
|
|
7
|
+
const { emitExposedDependencies } = context.build;
|
|
8
8
|
if (!isExposeSharedDependencies || emitExposedDependencies) {
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
const
|
|
13
|
-
if (!
|
|
12
|
+
const { css, js } = getSharedEntryPoints(context);
|
|
13
|
+
if (!css.length && !js.length) {
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function getSharedEntryPoints(context: Context) {
|
|
21
|
-
const dirname = getBundleType({ ...context, emitExposedDependencies: true });
|
|
22
|
-
if (!dirname) {
|
|
23
|
-
return [];
|
|
24
|
-
}
|
|
17
|
+
// crossorigin matches the MFE side's <link> so both share one cache entry for the shared CSS.
|
|
18
|
+
const tags = [...css.map(path => ({ path, attributes: { crossorigin: 'anonymous' } })), ...js];
|
|
25
19
|
|
|
26
|
-
|
|
27
|
-
return [...css, ...js].map(name => `${dirname}/${name}`);
|
|
20
|
+
return new HtmlWebpackTagsPlugin({ tags, append: false });
|
|
28
21
|
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { IgnorePlugin } from 'webpack';
|
|
2
|
+
import type { BuildContext } from '../../../../../core';
|
|
3
|
+
import { checkResource } from '../../../../../core';
|
|
4
|
+
import { ignorePlugin } from '../ignore-plugin';
|
|
5
|
+
|
|
6
|
+
jest.mock('../../../../../core', () => ({
|
|
7
|
+
checkResource: jest.fn(),
|
|
8
|
+
}));
|
|
9
|
+
|
|
10
|
+
describe(ignorePlugin.name, () => {
|
|
11
|
+
let context: BuildContext;
|
|
12
|
+
let checker: jest.Mock;
|
|
13
|
+
|
|
14
|
+
beforeEach(() => {
|
|
15
|
+
jest.clearAllMocks();
|
|
16
|
+
context = {} as BuildContext;
|
|
17
|
+
checker = jest.fn().mockReturnValue(false);
|
|
18
|
+
jest.mocked(checkResource).mockReturnValue(checker);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const subject = () => ignorePlugin(context, {});
|
|
22
|
+
|
|
23
|
+
test('returns an IgnorePlugin', () => {
|
|
24
|
+
expect(subject()).toBeInstanceOf(IgnorePlugin);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
test('creates checker from build context', () => {
|
|
28
|
+
subject();
|
|
29
|
+
|
|
30
|
+
expect(checkResource).toHaveBeenCalledWith(context);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
describe('checkResource callback', () => {
|
|
34
|
+
let resource: string;
|
|
35
|
+
let importer: string;
|
|
36
|
+
|
|
37
|
+
beforeEach(() => {
|
|
38
|
+
resource = 'some-module';
|
|
39
|
+
importer = '/app';
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const subject = () => {
|
|
43
|
+
const { options } = ignorePlugin(context, {});
|
|
44
|
+
return (
|
|
45
|
+
options as { checkResource: (resource: string, importer: string) => boolean }
|
|
46
|
+
).checkResource(resource, importer);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
test('checks resource against importer', () => {
|
|
50
|
+
subject();
|
|
51
|
+
|
|
52
|
+
expect(checker).toHaveBeenCalledWith({ resource, importer });
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
test('returns false', () => {
|
|
56
|
+
expect(subject()).toBe(false);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
describe('when checker matches the resource', () => {
|
|
60
|
+
beforeEach(() => checker.mockReturnValue(true));
|
|
61
|
+
|
|
62
|
+
test('returns true', () => {
|
|
63
|
+
expect(subject()).toBe(true);
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { IgnorePlugin } from 'webpack';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { BuildContext, checkResource } from '../../../../core';
|
|
3
|
+
import { Overrides } from '../../../types';
|
|
4
4
|
|
|
5
|
-
export function ignorePlugin(context:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
export function ignorePlugin(context: BuildContext, _: Overrides) {
|
|
6
|
+
const checker = checkResource(context);
|
|
7
|
+
|
|
8
|
+
return new IgnorePlugin({
|
|
9
|
+
checkResource(resource: string, importer: string) {
|
|
10
|
+
return checker({ resource, importer });
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
13
|
}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
|
2
|
-
import {
|
|
2
|
+
import { Overrides, WebpackBuildContext } from '../../types';
|
|
3
3
|
|
|
4
|
-
export function miniCssExtractPlugin(context:
|
|
5
|
-
const {
|
|
6
|
-
|
|
4
|
+
export function miniCssExtractPlugin(context: WebpackBuildContext, overrides: Overrides) {
|
|
5
|
+
const { isProduction, emitExposedDependencies } = context.build;
|
|
6
|
+
const { isExposeSharedDependencies, isWebComponent } = context.package;
|
|
7
|
+
const { 'custom-style-rules': isCustomStyleRules } = context.bundlerConfig;
|
|
7
8
|
|
|
8
|
-
if (
|
|
9
|
+
if (
|
|
10
|
+
(!isCustomStyleRules || emitExposedDependencies) &&
|
|
11
|
+
(isProduction || isWebComponent || isExposeSharedDependencies)
|
|
12
|
+
) {
|
|
9
13
|
return new MiniCssExtractPlugin({
|
|
10
14
|
filename: isProduction ? '[name].[contenthash].bundle.css' : '[name].bundle.css',
|
|
11
15
|
...overrides.plugins?.MiniCssExtractPlugin,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BuildContext } from '../../../core';
|
|
2
|
+
import { Overrides } from '../../types';
|
|
2
3
|
|
|
3
4
|
const MomentLocalesPlugin: typeof import('moment-locales-webpack-plugin') | undefined =
|
|
4
5
|
isMomentInstalled() ? require('moment-locales-webpack-plugin') : undefined;
|
|
5
6
|
|
|
6
|
-
export function momentLocalesPlugin(_:
|
|
7
|
+
export function momentLocalesPlugin(_: BuildContext, _overrides: Overrides) {
|
|
7
8
|
return (
|
|
8
9
|
MomentLocalesPlugin &&
|
|
9
10
|
new MomentLocalesPlugin({
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import RemoveEmptyScriptsPlugin from 'webpack-remove-empty-scripts';
|
|
2
|
-
import {
|
|
2
|
+
import { BuildContext } from '../../../core';
|
|
3
|
+
import { Overrides } from '../../types';
|
|
3
4
|
|
|
4
|
-
export function removeEmptyScriptsPlugin(context:
|
|
5
|
-
const { emitExposedDependencies } = context;
|
|
5
|
+
export function removeEmptyScriptsPlugin(context: BuildContext, _overrides: Overrides) {
|
|
6
|
+
const { emitExposedDependencies } = context.build;
|
|
6
7
|
if (!emitExposedDependencies) {
|
|
7
8
|
return;
|
|
8
9
|
}
|
|
@@ -1,80 +1,26 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import VirtualModulesPlugin from 'webpack-virtual-modules';
|
|
4
|
-
import {
|
|
4
|
+
import { BuildContext, getDesignSystemPath, virtualModules } from '../../../core';
|
|
5
|
+
import { Overrides } from '../../types';
|
|
5
6
|
|
|
6
|
-
export function virtualModulesPlugin(context:
|
|
7
|
-
const { destination } = context;
|
|
7
|
+
export function virtualModulesPlugin(context: BuildContext, _: Overrides) {
|
|
8
|
+
const { destination } = context.package;
|
|
8
9
|
|
|
9
|
-
const modules
|
|
10
|
+
const modules = virtualModules(context);
|
|
11
|
+
const pluginModules: ConstructorParameters<typeof VirtualModulesPlugin>[0] = {};
|
|
10
12
|
|
|
11
|
-
if (
|
|
13
|
+
if (modules.index) {
|
|
12
14
|
const indexPath = path.join(process.cwd(), destination, 'index');
|
|
13
|
-
|
|
15
|
+
pluginModules[indexPath] = modules.index;
|
|
14
16
|
}
|
|
15
17
|
|
|
16
|
-
if (
|
|
18
|
+
if (modules.designSystem) {
|
|
17
19
|
const designSystemPath = getDesignSystemPath(context);
|
|
18
20
|
if (!fs.existsSync(designSystemPath)) {
|
|
19
|
-
|
|
21
|
+
pluginModules[designSystemPath] = modules.designSystem;
|
|
20
22
|
}
|
|
21
23
|
}
|
|
22
24
|
|
|
23
|
-
return Object.keys(
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export function getDesignSystemPath({ destination }: Context) {
|
|
27
|
-
return path.join(process.cwd(), destination, 'design-system.css');
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function designSystemCode() {
|
|
31
|
-
return [
|
|
32
|
-
`@import '~@servicetitan/tokens/core/tokens.css';`,
|
|
33
|
-
`@import '~@servicetitan/anvil-fonts/dist/css/anvil-fonts.css';`,
|
|
34
|
-
`@import '~@servicetitan/design-system/dist/system.min.css';`,
|
|
35
|
-
].join('\n');
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function indexCode(context: Context) {
|
|
39
|
-
const { embed = false, headless, isLegacyRoot, sharedDependencies } = context;
|
|
40
|
-
if (headless) {
|
|
41
|
-
return headlessIndex();
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const options = `{ legacyRoot: ${isLegacyRoot}, sharedDependenciesNames: ${JSON.stringify(
|
|
45
|
-
Object.keys(sharedDependencies)
|
|
46
|
-
)} }`;
|
|
47
|
-
return [
|
|
48
|
-
...(needsToIncludeDesignSystem(context) ? [`require('./design-system.css');`] : []),
|
|
49
|
-
`import { register } from '@servicetitan/web-components';`,
|
|
50
|
-
`import { App } from './app';`,
|
|
51
|
-
`register(App, ${embed}, ${options});`,
|
|
52
|
-
].join('\n');
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function needsToIncludeDesignSystem({
|
|
56
|
-
embed,
|
|
57
|
-
emitExposedDependencies,
|
|
58
|
-
headless,
|
|
59
|
-
isWebComponent,
|
|
60
|
-
packageData,
|
|
61
|
-
sharedDependencies,
|
|
62
|
-
}: Context) {
|
|
63
|
-
return (
|
|
64
|
-
(!!emitExposedDependencies && !!sharedDependencies['@servicetitan/design-system']) ||
|
|
65
|
-
(isWebComponent &&
|
|
66
|
-
!headless &&
|
|
67
|
-
// Depends on design system
|
|
68
|
-
!!packageData.dependencies['@servicetitan/design-system'] &&
|
|
69
|
-
// ... and is not light bundle with private copy of design system
|
|
70
|
-
!(embed && !!sharedDependencies['@servicetitan/design-system']))
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function headlessIndex() {
|
|
75
|
-
return [
|
|
76
|
-
"import { registerHeadless } from '@servicetitan/web-components';",
|
|
77
|
-
"import { connectedCallback, disconnectedCallback } from './headless';",
|
|
78
|
-
'registerHeadless(connectedCallback, disconnectedCallback);',
|
|
79
|
-
].join('\n');
|
|
25
|
+
return Object.keys(pluginModules).length ? new VirtualModulesPlugin(pluginModules) : undefined;
|
|
80
26
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
import { Compiler } from 'webpack';
|
|
3
|
+
import { BuildContext } from '../../../core';
|
|
3
4
|
import { log } from '../../../utils';
|
|
4
|
-
import {
|
|
5
|
+
import { Overrides } from '../../types';
|
|
5
6
|
|
|
6
|
-
export function watchRunPlugin(_context:
|
|
7
|
+
export function watchRunPlugin(_context: BuildContext, _overrides: Overrides) {
|
|
7
8
|
/* istanbul ignore next: debug only */
|
|
8
9
|
if (log.debug('modified-files').enabled) {
|
|
9
10
|
return new WatchRunPlugin();
|