@servicetitan/startup 36.0.0 → 36.1.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +11 -9
- 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/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 +3 -0
- package/dist/core/check-resource/check-resource.d.ts.map +1 -0
- package/dist/{webpack/configs/plugins/ignore-plugin → core/check-resource}/check-resource.js +2 -2
- package/dist/core/check-resource/check-resource.js.map +1 -0
- package/dist/core/check-resource/get-package-json.d.ts +7 -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 +1 -1
- package/dist/core/check-resource/get-package-json.js.map +1 -0
- package/dist/core/check-resource/index.d.ts +2 -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-optional-peer-dependency.d.ts.map +1 -0
- package/dist/core/check-resource/is-optional-peer-dependency.js.map +1 -0
- package/dist/core/check-resource/is-optional-react-dom-peer-dependency.d.ts.map +1 -0
- package/dist/core/check-resource/is-optional-react-dom-peer-dependency.js.map +1 -0
- package/dist/core/constants.d.ts +17 -0
- package/dist/core/constants.d.ts.map +1 -0
- package/dist/core/constants.js +28 -0
- package/dist/core/constants.js.map +1 -0
- package/dist/core/create-build-context.d.ts +13 -0
- package/dist/core/create-build-context.d.ts.map +1 -0
- package/dist/core/create-build-context.js +51 -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 +26 -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-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 +32 -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/{webpack/configs/utils → core/get-version}/get-launchdarkly-sdk-version.js +1 -1
- 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/{webpack/configs/utils → core/get-version}/get-web-components-version.js +1 -1
- 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 +16 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +33 -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 +51 -0
- package/dist/core/types.d.ts.map +1 -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 +19 -6
- 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 +17 -6
- package/dist/storybook-config/webpack-final.js.map +1 -1
- package/dist/utils/get-configuration.d.ts +31 -1
- 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 +59 -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 +139 -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 +36 -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 +57 -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 +102 -0
- package/dist/vite/plugins/html-plugin.js.map +1 -0
- package/dist/vite/plugins/ignore-modules-plugin.d.ts +4 -0
- package/dist/vite/plugins/ignore-modules-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/ignore-modules-plugin.js +30 -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 +78 -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/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 +63 -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 +1 -1
- 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 +2 -2
- package/dist/webpack/configs/loaders/css-loader.d.ts.map +1 -1
- package/dist/webpack/configs/loaders/css-loader.js +2 -1
- 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 +10 -24
- 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 -13
- 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 +8 -19
- package/dist/webpack/configs/plugins/html-tags-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.d.ts +15 -3
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.js +41 -6
- 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.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 +3 -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 +36 -46
- 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 +82 -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 +4 -1
- package/package.json +24 -17
- package/patches/vite-plugin-css-injected-by-js+3.5.2.patch +63 -0
- 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 +13 -11
- package/src/cli/index.ts +2 -1
- 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/{webpack/configs/plugins/ignore-plugin → core/check-resource}/__tests__/check-resource.test.ts +18 -5
- package/src/{webpack/configs/plugins/ignore-plugin → core/check-resource}/__tests__/get-package-json.test.ts +1 -1
- package/src/{webpack/configs/plugins/ignore-plugin → core/check-resource}/check-resource.ts +4 -4
- package/src/{webpack/configs/plugins/ignore-plugin → core/check-resource}/get-package-json.ts +6 -1
- package/src/core/check-resource/index.ts +1 -0
- package/src/core/constants.ts +16 -0
- package/src/core/create-build-context.ts +57 -0
- package/src/core/defines/define-exposed-dependencies.ts +21 -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-output-path.ts +18 -0
- package/src/core/get-shared-entry-points.ts +37 -0
- package/src/{webpack/configs/utils → core/get-version}/get-launchdarkly-sdk-version.ts +1 -1
- package/src/core/get-version/get-startup-version.ts +6 -0
- package/src/{webpack/configs/utils → core/get-version}/get-web-components-version.ts +1 -1
- package/src/core/get-version/index.ts +3 -0
- package/src/core/index.ts +15 -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 +27 -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 +7 -6
- package/src/core/metadata/index.ts +3 -0
- package/src/core/types.ts +50 -0
- package/src/core/virtual-modules.ts +74 -0
- package/src/cypress/config/__tests__/webpack-config.test.ts +12 -2
- package/src/cypress/config/webpack-config.ts +23 -9
- package/src/index.ts +1 -0
- package/src/storybook-config/__tests__/webpack-final.test.ts +5 -2
- package/src/storybook-config/webpack-final.ts +22 -10
- 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 +3 -3
- package/src/utils/__tests__/validate-shared-dependencies.test.ts +55 -0
- package/src/utils/get-configuration.ts +48 -6
- 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 +165 -0
- package/src/vite/__tests__/validate-shared-dependencies.test.ts +34 -0
- package/src/vite/build-shared-dependencies.ts +47 -0
- package/src/vite/config/__tests__/base-config.test.ts +291 -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 +127 -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 +36 -0
- package/src/vite/index.ts +1 -0
- package/src/vite/plugins/__tests__/css-injector-plugin.test.ts +61 -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 +308 -0
- package/src/vite/plugins/__tests__/ignore-modules-plugin.test.ts +80 -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 +76 -0
- package/src/vite/plugins/__tests__/svgr-plugin.test.ts +67 -0
- package/src/vite/plugins/__tests__/virtual-modules-plugin.test.ts +120 -0
- package/src/vite/plugins/css-injector-plugin.ts +60 -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 +94 -0
- package/src/vite/plugins/ignore-modules-plugin.ts +22 -0
- package/src/vite/plugins/index.ts +9 -0
- package/src/vite/plugins/metadata-plugin.ts +66 -0
- package/src/vite/plugins/shared-dependencies-plugin.ts +273 -0
- package/src/vite/plugins/style-urls-plugin.ts +28 -0
- package/src/vite/plugins/svgr-plugin.ts +17 -0
- package/src/vite/plugins/virtual-modules-plugin.ts +59 -0
- package/src/vite/types.ts +6 -0
- package/src/vite/validate-shared-dependencies.ts +27 -0
- package/src/{cli/utils/__tests__/bundle.test.ts → webpack/__tests__/bundle-webpack.test.ts} +26 -19
- package/src/webpack/__tests__/create-webpack-config-shared-dependencies.test.ts +23 -9
- package/src/webpack/__tests__/create-webpack-config-web-component.test.ts +17 -16
- package/src/webpack/__tests__/create-webpack-config.test.ts +10 -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 +4 -3
- 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 +3 -2
- 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 +11 -22
- 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 -15
- 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 +7 -16
- package/src/webpack/configs/plugins/ignore-plugin/__tests__/ignore-plugin.test.ts +92 -0
- package/src/webpack/configs/plugins/ignore-plugin/empty-module.js +6 -0
- package/src/webpack/configs/plugins/ignore-plugin/ignore-plugin.ts +44 -6
- 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 +3 -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 +4 -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 +18 -49
- package/src/webpack/create-webpack-configs.ts +77 -0
- package/src/webpack/index.ts +2 -0
- package/src/webpack/types.ts +8 -11
- package/src/webpack/utils/__tests__/split-by-entry.test.ts +33 -0
- package/src/webpack/utils/create-webpack-build-context.ts +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.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.map +0 -1
- 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.map +0 -1
- 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 -35
- 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/types.ts +0 -38
- package/src/webpack/configs/utils/get-bundle-type.ts +0 -22
- package/src/webpack/configs/utils/index.ts +0 -3
- /package/dist/{webpack/configs/plugins/ignore-plugin → core/check-resource}/is-optional-peer-dependency.d.ts +0 -0
- /package/dist/{webpack/configs/plugins/ignore-plugin → core/check-resource}/is-optional-peer-dependency.js +0 -0
- /package/dist/{webpack/configs/plugins/ignore-plugin → core/check-resource}/is-optional-react-dom-peer-dependency.d.ts +0 -0
- /package/dist/{webpack/configs/plugins/ignore-plugin → core/check-resource}/is-optional-react-dom-peer-dependency.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/{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/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/dist/{webpack/configs → core}/types.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/plugins/ignore-plugin → core/check-resource}/__tests__/is-optional-peer-dependency.test.ts +0 -0
- /package/src/{webpack/configs/plugins/ignore-plugin → core/check-resource}/__tests__/is-optional-react-dom-peer-dependency.test.ts +0 -0
- /package/src/{webpack/configs/plugins/ignore-plugin → core/check-resource}/is-optional-peer-dependency.ts +0 -0
- /package/src/{webpack/configs/plugins/ignore-plugin → core/check-resource}/is-optional-react-dom-peer-dependency.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/utils → core}/stringify-config.ts +0 -0
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { fs, vol } from 'memfs';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
getLaunchDarklySdkVersion,
|
|
4
|
+
getStartupVersion,
|
|
5
|
+
getWebComponentsVersion,
|
|
6
|
+
} from '../../get-version';
|
|
3
7
|
import { buildMetadata, BuildMetadataParams } from '../build-metadata';
|
|
4
|
-
import { getLaunchDarklySdkVersion } from '../get-launchdarkly-sdk-version';
|
|
5
|
-
import { getWebComponentsVersion } from '../get-web-components-version';
|
|
6
8
|
|
|
7
9
|
jest.mock('fs', () => fs);
|
|
8
|
-
jest.mock('
|
|
9
|
-
jest.
|
|
10
|
-
jest.
|
|
10
|
+
jest.mock('../../get-version', () => ({
|
|
11
|
+
getLaunchDarklySdkVersion: jest.fn(),
|
|
12
|
+
getStartupVersion: jest.fn(),
|
|
13
|
+
getWebComponentsVersion: jest.fn(),
|
|
14
|
+
}));
|
|
11
15
|
|
|
12
16
|
describe(`[startup] ${buildMetadata.name}`, () => {
|
|
13
17
|
const destination = 'dist';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { fs, vol } from 'memfs';
|
|
2
2
|
|
|
3
3
|
import * as mockedFs from 'fs';
|
|
4
|
-
import { createPackage } from '
|
|
5
|
-
import {
|
|
4
|
+
import { createPackage } from '../../../__mocks__';
|
|
5
|
+
import { BuildContext } from '../../types';
|
|
6
6
|
import { buildMetadata } from '../build-metadata';
|
|
7
7
|
import { generateMetadata } from '../generate-metadata';
|
|
8
8
|
|
|
@@ -16,7 +16,7 @@ function generatedMetadata(dest: string) {
|
|
|
16
16
|
describe(`[startup] ${generateMetadata.name}`, () => {
|
|
17
17
|
const pkg = createPackage({});
|
|
18
18
|
const destination = 'dist';
|
|
19
|
-
let context:
|
|
19
|
+
let context: BuildContext;
|
|
20
20
|
|
|
21
21
|
const mockMetadata = {
|
|
22
22
|
name: pkg.name,
|
|
@@ -36,16 +36,30 @@ describe(`[startup] ${generateMetadata.name}`, () => {
|
|
|
36
36
|
jest.mocked(buildMetadata).mockReturnValue(mockMetadata);
|
|
37
37
|
|
|
38
38
|
context = {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
build: {
|
|
40
|
+
name: pkg.name,
|
|
41
|
+
isProduction: false,
|
|
42
|
+
},
|
|
43
|
+
package: {
|
|
44
|
+
name: pkg.name,
|
|
45
|
+
version: pkg.version,
|
|
46
|
+
destination,
|
|
47
|
+
source: 'src',
|
|
48
|
+
dependencies: { foo: '1.0.1' },
|
|
49
|
+
sharedDependencies: { react: 'SharedDependencies.React' },
|
|
50
|
+
isWebComponent: false,
|
|
51
|
+
isLegacyRoot: false,
|
|
52
|
+
isExposeSharedDependencies: false,
|
|
53
|
+
},
|
|
54
|
+
options: {
|
|
55
|
+
bundlerConfig: {},
|
|
56
|
+
},
|
|
43
57
|
};
|
|
44
58
|
});
|
|
45
59
|
|
|
46
60
|
afterEach(() => vol.reset());
|
|
47
61
|
|
|
48
|
-
const subject = () => generateMetadata(context
|
|
62
|
+
const subject = () => generateMetadata(context);
|
|
49
63
|
|
|
50
64
|
function itWritesMetadataToDestination(destination: string) {
|
|
51
65
|
test('writes metadata to output file', () => {
|
|
@@ -60,10 +74,10 @@ describe(`[startup] ${generateMetadata.name}`, () => {
|
|
|
60
74
|
|
|
61
75
|
expect(buildMetadata).toHaveBeenCalledWith({
|
|
62
76
|
destination,
|
|
63
|
-
name: context.name,
|
|
64
|
-
version: context.
|
|
65
|
-
dependencies: context.
|
|
66
|
-
sharedDependencies: context.sharedDependencies,
|
|
77
|
+
name: context.build.name,
|
|
78
|
+
version: context.package.version,
|
|
79
|
+
dependencies: context.package.dependencies,
|
|
80
|
+
sharedDependencies: context.package.sharedDependencies,
|
|
67
81
|
});
|
|
68
82
|
});
|
|
69
83
|
|
|
@@ -72,7 +86,7 @@ describe(`[startup] ${generateMetadata.name}`, () => {
|
|
|
72
86
|
describe('when destination directory does not exist', () => {
|
|
73
87
|
const nestedDestination = 'nested/path/dist';
|
|
74
88
|
|
|
75
|
-
beforeEach(() => (context.destination = nestedDestination));
|
|
89
|
+
beforeEach(() => (context.package.destination = nestedDestination));
|
|
76
90
|
|
|
77
91
|
test('creates destination directory', () => {
|
|
78
92
|
subject();
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
|
-
import {
|
|
2
|
+
import { readJsonSafe } from '../../utils';
|
|
3
|
+
import {
|
|
4
|
+
getLaunchDarklySdkVersion,
|
|
5
|
+
getStartupVersion,
|
|
6
|
+
getWebComponentsVersion,
|
|
7
|
+
} from '../get-version';
|
|
3
8
|
import { EntryPoints, Metadata } from '../types';
|
|
4
|
-
import { getLaunchDarklySdkVersion } from './get-launchdarkly-sdk-version';
|
|
5
|
-
import { getWebComponentsVersion } from './get-web-components-version';
|
|
6
9
|
|
|
7
10
|
export interface BuildMetadataParams {
|
|
8
11
|
destination: string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { ExposedDepsMetadata } from '../get-shared-entry-points';
|
|
4
|
+
|
|
5
|
+
export function getExposedDependenciesMetadataPath(destination: string) {
|
|
6
|
+
return path.join(destination, 'exposed-dependencies-metadata.json');
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function generateExposedDependenciesMetadata(
|
|
10
|
+
destination: string,
|
|
11
|
+
getOutputPath: () => string
|
|
12
|
+
) {
|
|
13
|
+
if (!fs.existsSync(destination)) {
|
|
14
|
+
fs.mkdirSync(destination, { recursive: true });
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const metadataPath = getExposedDependenciesMetadataPath(destination);
|
|
18
|
+
const metadata: ExposedDepsMetadata = { entryPointsPath: getOutputPath() };
|
|
19
|
+
fs.writeFileSync(metadataPath, JSON.stringify(metadata, null, 2), 'utf-8');
|
|
20
|
+
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
import { log } from '
|
|
4
|
-
import {
|
|
3
|
+
import { log } from '../../utils';
|
|
4
|
+
import { BuildContext } from '../types';
|
|
5
5
|
import { buildMetadata } from './build-metadata';
|
|
6
6
|
|
|
7
|
-
export function generateMetadata(context:
|
|
8
|
-
const { destination,
|
|
7
|
+
export function generateMetadata(context: BuildContext) {
|
|
8
|
+
const { destination, sharedDependencies, version, dependencies } = context.package;
|
|
9
|
+
const { name } = context.build;
|
|
9
10
|
|
|
10
11
|
if (!fs.existsSync(destination)) {
|
|
11
12
|
fs.mkdirSync(destination, { recursive: true });
|
|
@@ -14,8 +15,8 @@ export function generateMetadata(context: Context) {
|
|
|
14
15
|
const metadata = buildMetadata({
|
|
15
16
|
destination,
|
|
16
17
|
name,
|
|
17
|
-
version
|
|
18
|
-
dependencies
|
|
18
|
+
version,
|
|
19
|
+
dependencies,
|
|
19
20
|
sharedDependencies,
|
|
20
21
|
});
|
|
21
22
|
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export type BuildContext<T = unknown> = {
|
|
2
|
+
package: PackageContext;
|
|
3
|
+
build: BuildIdentity;
|
|
4
|
+
options: BuildOptions;
|
|
5
|
+
} & (unknown extends T ? {} : { bundlerConfig: T });
|
|
6
|
+
|
|
7
|
+
export interface PackageContext {
|
|
8
|
+
name: string;
|
|
9
|
+
version: string;
|
|
10
|
+
destination: string;
|
|
11
|
+
source: string;
|
|
12
|
+
dependencies: Record<string, string>;
|
|
13
|
+
sharedDependencies: Record<string, string>;
|
|
14
|
+
isWebComponent: boolean;
|
|
15
|
+
isLegacyRoot: boolean;
|
|
16
|
+
isExposeSharedDependencies: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface BuildIdentity {
|
|
20
|
+
name: string;
|
|
21
|
+
isProduction: boolean;
|
|
22
|
+
light?: boolean;
|
|
23
|
+
headless?: boolean;
|
|
24
|
+
emitExposedDependencies?: boolean | { output?: { path?: string } };
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface BuildOptions {
|
|
28
|
+
codeCoverage?: boolean;
|
|
29
|
+
buildStat?: boolean;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface EntryPoint {
|
|
33
|
+
css?: string[];
|
|
34
|
+
js?: string[];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface EntryPoints {
|
|
38
|
+
full?: EntryPoint;
|
|
39
|
+
light?: EntryPoint;
|
|
40
|
+
headless?: EntryPoint;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface Metadata {
|
|
44
|
+
name: string;
|
|
45
|
+
version: string;
|
|
46
|
+
bundledWith: Record<string, string | undefined>;
|
|
47
|
+
sharedDependencies: Record<string, string>;
|
|
48
|
+
dependencies: Record<string, string>;
|
|
49
|
+
entrypoints: EntryPoints;
|
|
50
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { BuildContext } from './types';
|
|
4
|
+
|
|
5
|
+
export function virtualModules(context: BuildContext) {
|
|
6
|
+
const modules: { index?: string; designSystem?: string } = {};
|
|
7
|
+
|
|
8
|
+
if (context.package.isWebComponent) {
|
|
9
|
+
modules.index = indexCode(context);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (needsToIncludeDesignSystem(context)) {
|
|
13
|
+
const designSystemPath = getDesignSystemPath(context);
|
|
14
|
+
if (!fs.existsSync(designSystemPath)) {
|
|
15
|
+
modules.designSystem = designSystemCode();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return modules;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function getDesignSystemPath(context: BuildContext) {
|
|
23
|
+
return path.join(process.cwd(), context.package.destination, 'design-system.css');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function designSystemCode() {
|
|
27
|
+
return [
|
|
28
|
+
`@import '@servicetitan/tokens/core/tokens.css';`,
|
|
29
|
+
`@import '@servicetitan/anvil-fonts/dist/css/anvil-fonts.css';`,
|
|
30
|
+
`@import '@servicetitan/design-system/dist/system.min.css';`,
|
|
31
|
+
].join('\n');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function indexCode(context: BuildContext) {
|
|
35
|
+
const { light = false, headless } = context.build;
|
|
36
|
+
const { isLegacyRoot, sharedDependencies } = context.package;
|
|
37
|
+
if (headless) {
|
|
38
|
+
return headlessIndex();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const options = `{ legacyRoot: ${isLegacyRoot}, sharedDependenciesNames: ${JSON.stringify(
|
|
42
|
+
Object.keys(sharedDependencies)
|
|
43
|
+
)} }`;
|
|
44
|
+
|
|
45
|
+
return [
|
|
46
|
+
...(needsToIncludeDesignSystem(context) ? [`import './design-system.css';`] : []),
|
|
47
|
+
`import { register } from '@servicetitan/web-components';`,
|
|
48
|
+
`import { App } from './app';`,
|
|
49
|
+
`register(App, ${light}, ${options});`,
|
|
50
|
+
].join('\n');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function needsToIncludeDesignSystem(context: BuildContext) {
|
|
54
|
+
const { light, headless, emitExposedDependencies } = context.build;
|
|
55
|
+
const { isWebComponent, dependencies, sharedDependencies } = context.package;
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
(!!emitExposedDependencies && !!sharedDependencies['@servicetitan/design-system']) ||
|
|
59
|
+
(isWebComponent &&
|
|
60
|
+
!headless &&
|
|
61
|
+
// Depends on design system
|
|
62
|
+
!!dependencies['@servicetitan/design-system'] &&
|
|
63
|
+
// ... and is not light bundle with private copy of design system
|
|
64
|
+
!(light && !!sharedDependencies['@servicetitan/design-system']))
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function headlessIndex() {
|
|
69
|
+
return [
|
|
70
|
+
"import { registerHeadless } from '@servicetitan/web-components/register-headless';",
|
|
71
|
+
"import { connectedCallback, disconnectedCallback } from './headless';",
|
|
72
|
+
'registerHeadless(connectedCallback, disconnectedCallback);',
|
|
73
|
+
].join('\n');
|
|
74
|
+
}
|
|
@@ -2,7 +2,8 @@ import { fs, vol } from 'memfs';
|
|
|
2
2
|
import { getSwcOptions } from '../../../cli/tasks';
|
|
3
3
|
import { TSConfig } from '../../../cli/utils';
|
|
4
4
|
import { getBaseTsConfig } from '../../../utils';
|
|
5
|
-
import {
|
|
5
|
+
import { rulesConfig } from '../../../webpack/configs';
|
|
6
|
+
import { Overrides } from '../../../webpack/types';
|
|
6
7
|
import { webpackConfig } from '../webpack-config';
|
|
7
8
|
|
|
8
9
|
jest.mock('fs', () => fs);
|
|
@@ -40,7 +41,16 @@ describe(`[startup/cypress-config] ${webpackConfig.name}`, () => {
|
|
|
40
41
|
subject();
|
|
41
42
|
|
|
42
43
|
expect(rulesConfig).toHaveBeenCalledWith(
|
|
43
|
-
expect.objectContaining({ isProduction: false }),
|
|
44
|
+
expect.objectContaining({ build: expect.objectContaining({ isProduction: false }) }),
|
|
45
|
+
expect.anything()
|
|
46
|
+
);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test('enables code coverage', () => {
|
|
50
|
+
subject();
|
|
51
|
+
|
|
52
|
+
expect(rulesConfig).toHaveBeenCalledWith(
|
|
53
|
+
expect.objectContaining({ options: { codeCoverage: true } }),
|
|
44
54
|
expect.anything()
|
|
45
55
|
);
|
|
46
56
|
});
|
|
@@ -4,7 +4,8 @@ import merge from 'webpack-merge';
|
|
|
4
4
|
import { getSwcOptions } from '../../cli/tasks';
|
|
5
5
|
import { TSConfig } from '../../cli/utils';
|
|
6
6
|
import { getTsConfigWithFallback, log } from '../../utils';
|
|
7
|
-
import {
|
|
7
|
+
import { rulesConfig } from '../../webpack/configs';
|
|
8
|
+
import { Overrides, WebpackBuildContext } from '../../webpack/types';
|
|
8
9
|
|
|
9
10
|
export function webpackConfig(overrides?: Overrides): Configuration {
|
|
10
11
|
const context = getContext();
|
|
@@ -25,18 +26,31 @@ export function webpackConfig(overrides?: Overrides): Configuration {
|
|
|
25
26
|
return merge(config, overrides?.configuration ?? {});
|
|
26
27
|
}
|
|
27
28
|
|
|
28
|
-
function getContext():
|
|
29
|
+
function getContext(): WebpackBuildContext {
|
|
29
30
|
return {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
package: {
|
|
32
|
+
name: '',
|
|
33
|
+
version: '',
|
|
34
|
+
destination: '',
|
|
35
|
+
source: '',
|
|
36
|
+
dependencies: {},
|
|
37
|
+
sharedDependencies: {},
|
|
38
|
+
isWebComponent: false,
|
|
39
|
+
isLegacyRoot: false,
|
|
40
|
+
isExposeSharedDependencies: false,
|
|
41
|
+
},
|
|
42
|
+
build: {
|
|
43
|
+
name: '',
|
|
44
|
+
isProduction: false,
|
|
45
|
+
},
|
|
46
|
+
options: {
|
|
47
|
+
codeCoverage: true,
|
|
48
|
+
},
|
|
49
|
+
bundlerConfig: {},
|
|
36
50
|
};
|
|
37
51
|
}
|
|
38
52
|
|
|
39
|
-
function getRules(context:
|
|
53
|
+
function getRules(context: WebpackBuildContext, overrides: Overrides) {
|
|
40
54
|
const { rules } = rulesConfig(context, overrides);
|
|
41
55
|
|
|
42
56
|
return [getSwcLoaderRule(), ...rules];
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Configuration } from 'webpack';
|
|
2
|
-
import {
|
|
2
|
+
import { rulesConfig } from '../../webpack/configs';
|
|
3
3
|
import { miniCssExtractPlugin } from '../../webpack/configs/plugins';
|
|
4
|
+
import { Overrides } from '../../webpack/types';
|
|
4
5
|
import { webpackFinal } from '../webpack-final';
|
|
5
6
|
|
|
6
7
|
jest.mock('../../webpack/configs');
|
|
@@ -91,7 +92,9 @@ describe(`[startup/storybook-config] ${webpackFinal.name}`, () => {
|
|
|
91
92
|
subject();
|
|
92
93
|
|
|
93
94
|
expect(rulesConfig).toHaveBeenCalledWith(
|
|
94
|
-
expect.objectContaining({
|
|
95
|
+
expect.objectContaining({
|
|
96
|
+
build: expect.objectContaining({ isProduction: true }),
|
|
97
|
+
}),
|
|
95
98
|
expect.anything()
|
|
96
99
|
);
|
|
97
100
|
});
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { inspect } from 'node:util';
|
|
2
2
|
import type { Configuration } from 'webpack';
|
|
3
3
|
import { log } from '../utils';
|
|
4
|
-
import {
|
|
4
|
+
import { rulesConfig } from '../webpack/configs';
|
|
5
5
|
import { miniCssExtractPlugin } from '../webpack/configs/plugins';
|
|
6
|
+
import { Overrides, WebpackBuildContext } from '../webpack/types';
|
|
6
7
|
|
|
7
8
|
export function webpackFinal(config: Configuration, overrides: Overrides = {}): Configuration {
|
|
8
9
|
const context = getContext(config);
|
|
@@ -22,22 +23,33 @@ export function webpackFinal(config: Configuration, overrides: Overrides = {}):
|
|
|
22
23
|
};
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
function getContext(config: Configuration):
|
|
26
|
+
function getContext(config: Configuration): WebpackBuildContext {
|
|
26
27
|
return {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
package: {
|
|
29
|
+
name: '',
|
|
30
|
+
version: '',
|
|
31
|
+
destination: '',
|
|
32
|
+
source: '',
|
|
33
|
+
dependencies: {},
|
|
34
|
+
sharedDependencies: {},
|
|
35
|
+
isWebComponent: false,
|
|
36
|
+
isLegacyRoot: false,
|
|
37
|
+
isExposeSharedDependencies: false,
|
|
38
|
+
},
|
|
39
|
+
build: {
|
|
40
|
+
name: '',
|
|
41
|
+
isProduction: config.mode === 'production',
|
|
42
|
+
},
|
|
43
|
+
options: {},
|
|
44
|
+
bundlerConfig: {},
|
|
33
45
|
};
|
|
34
46
|
}
|
|
35
47
|
|
|
36
|
-
function getPlugins(context:
|
|
48
|
+
function getPlugins(context: WebpackBuildContext, overrides: Overrides) {
|
|
37
49
|
return [miniCssExtractPlugin(context, overrides)].filter(plugin => !!plugin);
|
|
38
50
|
}
|
|
39
51
|
|
|
40
|
-
function getRules(context:
|
|
52
|
+
function getRules(context: WebpackBuildContext, overrides: Overrides) {
|
|
41
53
|
const include = ['.module.css', '.module.less', '.less', '.module.scss', '.scss', '.svg'];
|
|
42
54
|
const exclude = ['.css'];
|
|
43
55
|
|
|
@@ -7,12 +7,12 @@ import {
|
|
|
7
7
|
getJestConfiguration,
|
|
8
8
|
getReviewConfiguration,
|
|
9
9
|
getStylelintConfiguration,
|
|
10
|
+
getViteConfiguration,
|
|
10
11
|
getVitestConfiguration,
|
|
11
12
|
getWebComponentBranchConfigs,
|
|
12
13
|
getWebComponentConfiguration,
|
|
13
14
|
hasHeadlessBundle,
|
|
14
15
|
isBundle,
|
|
15
|
-
isCustomStyleRules,
|
|
16
16
|
isDevServerDisabled,
|
|
17
17
|
isExposeSharedDependencies,
|
|
18
18
|
isLegacy,
|
|
@@ -225,6 +225,29 @@ describe('[startup] Utils', () => {
|
|
|
225
225
|
});
|
|
226
226
|
});
|
|
227
227
|
|
|
228
|
+
describe(getViteConfiguration.name, () => {
|
|
229
|
+
const subject = () => getViteConfiguration();
|
|
230
|
+
|
|
231
|
+
itReturns(subject, {});
|
|
232
|
+
|
|
233
|
+
describe('with "cli.vite"', () => {
|
|
234
|
+
const content = {
|
|
235
|
+
cli: {
|
|
236
|
+
vite: {
|
|
237
|
+
omitDefault: ['plugins.svgr'],
|
|
238
|
+
config: { server: { port: 9000 }, build: { minify: false } },
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
beforeEach(() => mockPackageJson(content));
|
|
244
|
+
|
|
245
|
+
test('returns "cli.vite"', () => {
|
|
246
|
+
expect(subject()).toEqual(content.cli.vite);
|
|
247
|
+
});
|
|
248
|
+
});
|
|
249
|
+
});
|
|
250
|
+
|
|
228
251
|
describe(getVitestConfiguration.name, () => {
|
|
229
252
|
const subject = () => getVitestConfiguration();
|
|
230
253
|
|
|
@@ -394,11 +417,6 @@ describe('[startup] Utils', () => {
|
|
|
394
417
|
defaultValue: true,
|
|
395
418
|
trigger: { cli: { webpack: false } },
|
|
396
419
|
},
|
|
397
|
-
{
|
|
398
|
-
fn: isCustomStyleRules,
|
|
399
|
-
defaultValue: false,
|
|
400
|
-
trigger: { cli: { webpack: { 'custom-style-rules': true } } },
|
|
401
|
-
},
|
|
402
420
|
{
|
|
403
421
|
fn: isDevServerDisabled,
|
|
404
422
|
defaultValue: false,
|
|
@@ -407,7 +425,10 @@ describe('[startup] Utils', () => {
|
|
|
407
425
|
{
|
|
408
426
|
fn: isExposeSharedDependencies,
|
|
409
427
|
defaultValue: false,
|
|
410
|
-
trigger:
|
|
428
|
+
trigger: [
|
|
429
|
+
{ cli: { 'expose-shared-dependencies': true } },
|
|
430
|
+
{ cli: { webpack: { 'expose-shared-dependencies': true } } },
|
|
431
|
+
],
|
|
411
432
|
},
|
|
412
433
|
{
|
|
413
434
|
fn: isLegacy,
|
|
@@ -32,7 +32,7 @@ describe(`[startup] Utils`, () => {
|
|
|
32
32
|
});
|
|
33
33
|
});
|
|
34
34
|
|
|
35
|
-
describe(`when ${packageJson} contains sharedDependencies`, () => {
|
|
35
|
+
describe(`when ${packageJson} contains cli.webpack.sharedDependencies`, () => {
|
|
36
36
|
const sharedDependencies = { react: 'SharedDependencies.React' };
|
|
37
37
|
|
|
38
38
|
beforeEach(() => {
|
|
@@ -45,6 +45,40 @@ describe(`[startup] Utils`, () => {
|
|
|
45
45
|
expect(subject()).toEqual(expect.objectContaining({ sharedDependencies }));
|
|
46
46
|
});
|
|
47
47
|
});
|
|
48
|
+
|
|
49
|
+
describe(`when ${packageJson} contains cli.sharedDependencies`, () => {
|
|
50
|
+
const sharedDependencies = { mobx: 'SharedDependencies.MobX' };
|
|
51
|
+
|
|
52
|
+
beforeEach(() => {
|
|
53
|
+
Object.assign(packages[packageJson], {
|
|
54
|
+
cli: { 'shared-dependencies': sharedDependencies },
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
test('returns sharedDependencies', () => {
|
|
59
|
+
expect(subject()).toEqual(expect.objectContaining({ sharedDependencies }));
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
describe(`when ${packageJson} contains cli.sharedDependencies and cli.webpack.sharedDependencies`, () => {
|
|
64
|
+
const topLevel = { react: 'SharedDependencies.React' };
|
|
65
|
+
const webpack = { mobx: 'SharedDependencies.MobX' };
|
|
66
|
+
|
|
67
|
+
beforeEach(() => {
|
|
68
|
+
Object.assign(packages[packageJson], {
|
|
69
|
+
cli: {
|
|
70
|
+
'shared-dependencies': topLevel,
|
|
71
|
+
'webpack': { 'shared-dependencies': webpack },
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
test('returns cli.sharedDependencies', () => {
|
|
77
|
+
expect(subject()).toEqual(
|
|
78
|
+
expect.objectContaining({ sharedDependencies: topLevel })
|
|
79
|
+
);
|
|
80
|
+
});
|
|
81
|
+
});
|
|
48
82
|
});
|
|
49
83
|
|
|
50
84
|
describe(`${getPackageDependencyVersion.name}`, () => {
|
|
@@ -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(
|
|
@@ -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
|
+
});
|