@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,5 +1,6 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
+
import { buildMetadata } from '../../core';
|
|
3
4
|
import {
|
|
4
5
|
getFolders,
|
|
5
6
|
getPackageData,
|
|
@@ -9,7 +10,6 @@ import {
|
|
|
9
10
|
log,
|
|
10
11
|
logErrors,
|
|
11
12
|
} from '../../utils';
|
|
12
|
-
import { buildMetadata } from '../../webpack/configs/utils/build-metadata';
|
|
13
13
|
import type { entry } from './registry/mfe-generate-metadata';
|
|
14
14
|
import { Command } from './types';
|
|
15
15
|
|
|
@@ -140,7 +140,7 @@ export class MFEList extends Command<typeof entry> {
|
|
|
140
140
|
return [..._, ...packageNames];
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
return getPackages({ ignore: this.args.ignore, type: PackageType.
|
|
143
|
+
return getPackages({ ignore: this.args.ignore, type: PackageType.Bundle })
|
|
144
144
|
.filter(isWebComponent)
|
|
145
145
|
.map(({ name }) => name)
|
|
146
146
|
.sort((a, b) => collator.compare(a, b));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
|
+
import { EntryPoint, EntryPoints, Metadata } from '../../core';
|
|
3
4
|
import {
|
|
4
5
|
getBranchesConfigs,
|
|
5
6
|
getFolders,
|
|
@@ -8,7 +9,6 @@ import {
|
|
|
8
9
|
logErrors,
|
|
9
10
|
readJson,
|
|
10
11
|
} from '../../utils';
|
|
11
|
-
import { EntryPoint, EntryPoints, Metadata } from '../../webpack/configs';
|
|
12
12
|
import {
|
|
13
13
|
DRY_RUN_PREFIX,
|
|
14
14
|
getDefaultBuildVersion,
|
|
@@ -17,7 +17,7 @@ type MFEPublishOptions = (typeof entry)['options'] &
|
|
|
17
17
|
export class MFEPublish extends Command<{ options: MFEPublishOptions }> {
|
|
18
18
|
@logErrors
|
|
19
19
|
async execute() {
|
|
20
|
-
const packages = getPackages({ scope: this.args.scope, type: PackageType.
|
|
20
|
+
const packages = getPackages({ scope: this.args.scope, type: PackageType.Bundle }).filter(
|
|
21
21
|
({ location }) => isWebComponent(location)
|
|
22
22
|
);
|
|
23
23
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { commandRegistry } from '../command-registry';
|
|
2
2
|
|
|
3
3
|
jest.mock('stylelint', () => ({ lint: jest.fn() }));
|
|
4
|
+
jest.mock('../../bundle-vite', () => ({ BundleVite: class {} }));
|
|
4
5
|
|
|
5
6
|
describe('[startup] commandRegistry', () => {
|
|
6
7
|
test.each(Object.entries(commandRegistry))(
|
|
@@ -9,8 +9,10 @@ export const entry = defineEntry({
|
|
|
9
9
|
codeCoverage: { boolean: true, description: 'Instrument code for coverage analysis?' },
|
|
10
10
|
config: { string: true, hidden: true, description: 'Use specified configuration' },
|
|
11
11
|
ignore: { array: true, string: true, description: 'Packages to skip' },
|
|
12
|
+
preview: { boolean: true, description: 'Start preview server after build?' },
|
|
12
13
|
scope: { array: true, string: true, description: 'Packages to build' },
|
|
13
14
|
stat: { boolean: true, description: 'Generate bundle report?' },
|
|
14
15
|
useTsc: { boolean: true, description: 'Use tsc to compile packages?' },
|
|
16
|
+
useVite: { boolean: true, description: 'Use Vite to bundle packages?' },
|
|
15
17
|
},
|
|
16
18
|
} satisfies CommandEntry);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CommandEntry } from '../types';
|
|
2
|
+
import { defineEntry } from './define-entry';
|
|
3
|
+
|
|
4
|
+
export const entry = defineEntry({
|
|
5
|
+
options: {
|
|
6
|
+
codeCoverage: { boolean: true, hidden: true },
|
|
7
|
+
exposedDependencies: { boolean: true, hidden: true },
|
|
8
|
+
preview: { boolean: true, hidden: true },
|
|
9
|
+
printConfig: { boolean: true, hidden: true },
|
|
10
|
+
stat: { boolean: true, hidden: true },
|
|
11
|
+
useWatchConfig: { boolean: true, hidden: true },
|
|
12
|
+
watch: { boolean: true, hidden: true },
|
|
13
|
+
},
|
|
14
|
+
} satisfies CommandEntry);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { CommandName } from '../../../utils';
|
|
2
2
|
import { Command, CommandEntry, Newable } from '../types';
|
|
3
3
|
import { entry as build } from './build';
|
|
4
|
-
import { entry as
|
|
4
|
+
import { entry as bundleVite } from './bundle-vite';
|
|
5
|
+
import { entry as bundleWebpack } from './bundle-webpack';
|
|
5
6
|
import { entry as clean } from './clean';
|
|
6
7
|
import { entry as convertEslintConfig } from './convert-eslint-config';
|
|
7
8
|
import { entry as eslint } from './eslint';
|
|
@@ -63,7 +64,9 @@ function makeEntry<K extends CommandName, T extends CommandEntry>(
|
|
|
63
64
|
*/
|
|
64
65
|
export const commandRegistry = {
|
|
65
66
|
...makeEntry(CommandName.build, build),
|
|
66
|
-
...makeEntry(CommandName['bundle-package'],
|
|
67
|
+
...makeEntry(CommandName['bundle-package'], bundleWebpack, { path: 'bundle-webpack' }),
|
|
68
|
+
...makeEntry(CommandName['bundle-vite'], bundleVite),
|
|
69
|
+
...makeEntry(CommandName['bundle-webpack'], bundleWebpack),
|
|
67
70
|
...makeEntry(CommandName.clean, clean),
|
|
68
71
|
...makeEntry(CommandName['convert-eslint-config'], convertEslintConfig),
|
|
69
72
|
...makeEntry(CommandName.eslint, eslint, { className: 'ESLintCommand' }),
|
|
@@ -10,5 +10,6 @@ export const entry = defineEntry({
|
|
|
10
10
|
ignore: { array: true, string: true, description: 'Packages to skip' },
|
|
11
11
|
scope: { array: true, string: true, description: 'Packages to run and watch' },
|
|
12
12
|
useTsc: { boolean: true, description: 'Use tsc to compile packages?' },
|
|
13
|
+
useVite: { boolean: true, description: 'Use Vite to bundle packages?' },
|
|
13
14
|
},
|
|
14
15
|
} satisfies CommandEntry);
|
|
@@ -19,7 +19,7 @@ enum StartProcesses {
|
|
|
19
19
|
PreparePackageWatch,
|
|
20
20
|
TypeCheck,
|
|
21
21
|
BundleExposedDependencies,
|
|
22
|
-
|
|
22
|
+
Bundle,
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export class Start extends Command<typeof entry> {
|
|
@@ -28,19 +28,21 @@ export class Start extends Command<typeof entry> {
|
|
|
28
28
|
checkArgs(this.args, { obsolete: ['--esbuild', '--experimental-bundlers'] });
|
|
29
29
|
|
|
30
30
|
const useTsc = this.args.useTsc;
|
|
31
|
+
const useVite = this.args.useVite;
|
|
32
|
+
const cmd = useVite ? 'startup bundle-vite' : 'startup bundle-package';
|
|
31
33
|
|
|
32
34
|
const packages = getPackages({
|
|
33
35
|
scope: this.args.scope,
|
|
34
36
|
ignore: this.args.ignore,
|
|
35
|
-
type: [PackageType.TSC, PackageType.
|
|
37
|
+
type: [PackageType.TSC, PackageType.Bundle],
|
|
36
38
|
});
|
|
37
39
|
if (packages.length === 0) {
|
|
38
40
|
return;
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
const scope = packages.map(({ name }) => name);
|
|
42
|
-
const
|
|
43
|
-
.filter(({ type }) => type === PackageType.
|
|
44
|
+
const bundleScope = packages
|
|
45
|
+
.filter(({ type }) => type === PackageType.Bundle)
|
|
44
46
|
.map(({ name }) => name);
|
|
45
47
|
const precompileScope = packages
|
|
46
48
|
.filter(({ scripts }) => !!scripts?.precompile)
|
|
@@ -136,12 +138,12 @@ export class Start extends Command<typeof entry> {
|
|
|
136
138
|
processTree.add(
|
|
137
139
|
StartProcesses.BundleExposedDependencies,
|
|
138
140
|
() => {
|
|
139
|
-
if (
|
|
141
|
+
if (bundleScope.length === 0) {
|
|
140
142
|
return Promise.resolve();
|
|
141
143
|
}
|
|
142
144
|
return lernaExec({
|
|
143
|
-
|
|
144
|
-
'scope':
|
|
145
|
+
cmd,
|
|
146
|
+
'scope': bundleScope,
|
|
145
147
|
'parallel': true,
|
|
146
148
|
'stream': true,
|
|
147
149
|
'--': ['--exposed-dependencies', '--use-watch-config'],
|
|
@@ -150,14 +152,14 @@ export class Start extends Command<typeof entry> {
|
|
|
150
152
|
{ dependsOn: [StartProcesses.Compile, StartProcesses.PreparePackage] }
|
|
151
153
|
);
|
|
152
154
|
processTree.add(
|
|
153
|
-
StartProcesses.
|
|
155
|
+
StartProcesses.Bundle,
|
|
154
156
|
() => {
|
|
155
|
-
if (
|
|
157
|
+
if (bundleScope.length === 0) {
|
|
156
158
|
return Promise.resolve();
|
|
157
159
|
}
|
|
158
160
|
return lernaExec({
|
|
159
|
-
|
|
160
|
-
'scope':
|
|
161
|
+
cmd,
|
|
162
|
+
'scope': bundleScope,
|
|
161
163
|
'parallel': true,
|
|
162
164
|
'stream': true,
|
|
163
165
|
'--': [
|
package/src/cli/index.ts
CHANGED
|
@@ -4,7 +4,8 @@ import kebabCase from 'lodash.kebabcase';
|
|
|
4
4
|
import path from 'path';
|
|
5
5
|
import yargs from 'yargs';
|
|
6
6
|
import { hideBin } from 'yargs/helpers';
|
|
7
|
-
import {
|
|
7
|
+
import { getStartupVersion } from '../core';
|
|
8
|
+
import { CommandName, log } from '../utils';
|
|
8
9
|
import { commandRegistry } from './commands/registry';
|
|
9
10
|
import type { CommandOptions } from './commands/types';
|
|
10
11
|
import { checkStartupLocation, setNodeOptions } from './utils';
|
|
@@ -31,7 +31,7 @@ export class TscCompile extends CliTask {
|
|
|
31
31
|
const packages = getPackages({
|
|
32
32
|
scope: this.args.scope,
|
|
33
33
|
ignore: this.args.ignore,
|
|
34
|
-
type: [PackageType.TSC, PackageType.
|
|
34
|
+
type: [PackageType.TSC, PackageType.Bundle],
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
const tsConfigs = collapsePackages(packages).map(({ location }) => getTsConfig(location));
|
|
@@ -7,7 +7,7 @@ import { compileLess } from './compile-less';
|
|
|
7
7
|
import { compileSass } from './compile-sass';
|
|
8
8
|
|
|
9
9
|
const assetExtensions = ['eot', 'gif', 'jpg', 'otf', 'png', 'svg', 'ttf', 'woff', 'woff2'];
|
|
10
|
-
const resourceExtensions = ['json'];
|
|
10
|
+
const resourceExtensions = ['html', 'json'];
|
|
11
11
|
export const styleExtensions = ['css', 'less', 'scss'];
|
|
12
12
|
const styleTypeDefinitionExtensions = styleExtensions.map(ext => `${ext}.d.ts`);
|
|
13
13
|
|
package/src/cli/utils/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BuildContext } from '../../types';
|
|
2
2
|
import { checkResource } from '../check-resource';
|
|
3
3
|
import { isOptionalPeerDependency } from '../is-optional-peer-dependency';
|
|
4
4
|
import { isOptionalReactDomPeerDependency } from '../is-optional-react-dom-peer-dependency';
|
|
@@ -8,7 +8,7 @@ jest.mock('../is-optional-react-dom-peer-dependency');
|
|
|
8
8
|
|
|
9
9
|
describe(`${checkResource.name}`, () => {
|
|
10
10
|
const context = 'node_modules/web-components/dist';
|
|
11
|
-
let packageContext:
|
|
11
|
+
let packageContext: BuildContext;
|
|
12
12
|
let resource: string;
|
|
13
13
|
|
|
14
14
|
beforeEach(() => {
|
|
@@ -16,15 +16,28 @@ describe(`${checkResource.name}`, () => {
|
|
|
16
16
|
|
|
17
17
|
resource = '@servicetitan/foo';
|
|
18
18
|
packageContext = {
|
|
19
|
-
|
|
19
|
+
build: {
|
|
20
|
+
name: 'application',
|
|
21
|
+
isProduction: false,
|
|
22
|
+
},
|
|
23
|
+
package: {
|
|
20
24
|
name: 'application',
|
|
21
25
|
version: '1.0.0',
|
|
26
|
+
destination: 'dist',
|
|
27
|
+
source: 'src',
|
|
22
28
|
dependencies: {},
|
|
29
|
+
sharedDependencies: {},
|
|
30
|
+
isWebComponent: false,
|
|
31
|
+
isLegacyRoot: false,
|
|
32
|
+
isExposeSharedDependencies: false,
|
|
33
|
+
},
|
|
34
|
+
options: {
|
|
35
|
+
bundlerConfig: {},
|
|
23
36
|
},
|
|
24
37
|
};
|
|
25
38
|
});
|
|
26
39
|
|
|
27
|
-
const subject = () => checkResource(packageContext
|
|
40
|
+
const subject = () => checkResource(packageContext)(resource, context);
|
|
28
41
|
|
|
29
42
|
function itReturns(value: boolean) {
|
|
30
43
|
test(`returns ${value}`, () => expect(subject()).toBe(value));
|
|
@@ -38,7 +51,7 @@ describe(`${checkResource.name}`, () => {
|
|
|
38
51
|
itReturns(true);
|
|
39
52
|
|
|
40
53
|
describe('when resource is package dependency', () => {
|
|
41
|
-
beforeEach(() => (packageContext.
|
|
54
|
+
beforeEach(() => (packageContext.package.dependencies[resource] = '*'));
|
|
42
55
|
|
|
43
56
|
itReturns(false);
|
|
44
57
|
});
|
|
@@ -39,7 +39,7 @@ describe(`[startup] ${getPackageJson.name}`, () => {
|
|
|
39
39
|
|
|
40
40
|
describe('when context is not in node_modules', () => {
|
|
41
41
|
beforeEach(() => {
|
|
42
|
-
context = 'foo/dist';
|
|
42
|
+
context = '/foo/dist';
|
|
43
43
|
vol.fromNestedJSON({
|
|
44
44
|
foo: { 'package.json': JSON.stringify(packageJson) },
|
|
45
45
|
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { log } from '
|
|
2
|
-
import {
|
|
1
|
+
import { log } from '../../utils';
|
|
2
|
+
import { BuildContext } from '../types';
|
|
3
3
|
import { isOptionalPeerDependency } from './is-optional-peer-dependency';
|
|
4
4
|
import { isOptionalReactDomPeerDependency } from './is-optional-react-dom-peer-dependency';
|
|
5
5
|
|
|
6
|
-
export function checkResource(packageContext:
|
|
6
|
+
export function checkResource(packageContext: BuildContext) {
|
|
7
7
|
return function (resource: string, context: string) {
|
|
8
8
|
if (
|
|
9
|
-
!packageContext.
|
|
9
|
+
!packageContext.package.dependencies[resource] &&
|
|
10
10
|
isOptionalPeerDependency(resource, context)
|
|
11
11
|
) {
|
|
12
12
|
log.debug('check-resource', `${JSON.stringify({ resource, context })} => true`);
|
package/src/{webpack/configs/plugins/ignore-plugin → core/check-resource}/get-package-json.ts
RENAMED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
import { log, readJson } from '
|
|
3
|
+
import { log, readJson } from '../../utils';
|
|
4
4
|
|
|
5
5
|
const containsNodeModules = /[\\/](node_modules|\.yalc)[\\/]/;
|
|
6
6
|
const isNodeModules = /(node_modules|\.yalc)/;
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Find the nearest package.json for a file path by walking up the directory tree.
|
|
10
|
+
* Only searches paths inside node_modules or .yalc because the ignore plugin only
|
|
11
|
+
* needs to suppress missing optional peer dependencies from third-party packages.
|
|
12
|
+
*/
|
|
8
13
|
export function getPackageJson(context: string) {
|
|
9
14
|
const fullPath = path.resolve(context);
|
|
10
15
|
if (!containsNodeModules.test(fullPath)) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { checkResource } from './check-resource';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const bundleConstants = {
|
|
2
|
+
postcss: {
|
|
3
|
+
classnameTemplate: {
|
|
4
|
+
production: '[local]__[hash:base64:5]',
|
|
5
|
+
development: '[local]',
|
|
6
|
+
},
|
|
7
|
+
localsConvention: 'camelCaseOnly',
|
|
8
|
+
},
|
|
9
|
+
less: {
|
|
10
|
+
math: 'always',
|
|
11
|
+
},
|
|
12
|
+
mode: {
|
|
13
|
+
production: 'production',
|
|
14
|
+
development: 'development',
|
|
15
|
+
},
|
|
16
|
+
} as const;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import yargs, { Arguments } from 'yargs';
|
|
2
|
+
import { hideBin } from 'yargs/helpers';
|
|
3
|
+
import {
|
|
4
|
+
getFolders,
|
|
5
|
+
getPackageData,
|
|
6
|
+
isExposeSharedDependencies,
|
|
7
|
+
isLegacyRoot,
|
|
8
|
+
isWebComponent,
|
|
9
|
+
loadSharedDependencies,
|
|
10
|
+
} from '../utils';
|
|
11
|
+
import { BuildContext, BuildIdentity } from './types';
|
|
12
|
+
export type { BuildContext } from './types';
|
|
13
|
+
|
|
14
|
+
export interface BuildContextOptions {
|
|
15
|
+
name: string;
|
|
16
|
+
isProduction: boolean;
|
|
17
|
+
light?: boolean;
|
|
18
|
+
headless?: boolean;
|
|
19
|
+
emitExposedDependencies?: BuildIdentity['emitExposedDependencies'];
|
|
20
|
+
codeCoverage?: boolean;
|
|
21
|
+
buildStat?: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function createBuildContext(options: BuildContextOptions): BuildContext {
|
|
25
|
+
const args = yargs(hideBin(process.argv)).argv as Arguments;
|
|
26
|
+
const { source, destination } = getFolders();
|
|
27
|
+
const packageData = getPackageData();
|
|
28
|
+
const sharedDependencies = loadSharedDependencies(
|
|
29
|
+
packageData.dependencies,
|
|
30
|
+
packageData.sharedDependencies
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
package: {
|
|
35
|
+
name: packageData.name,
|
|
36
|
+
version: packageData.version,
|
|
37
|
+
destination,
|
|
38
|
+
source,
|
|
39
|
+
dependencies: packageData.dependencies,
|
|
40
|
+
sharedDependencies,
|
|
41
|
+
isWebComponent: isWebComponent(),
|
|
42
|
+
isLegacyRoot: isLegacyRoot(),
|
|
43
|
+
isExposeSharedDependencies: isExposeSharedDependencies(),
|
|
44
|
+
},
|
|
45
|
+
build: {
|
|
46
|
+
name: options.name,
|
|
47
|
+
isProduction: options.isProduction,
|
|
48
|
+
light: options.light,
|
|
49
|
+
headless: options.headless,
|
|
50
|
+
emitExposedDependencies: options.emitExposedDependencies,
|
|
51
|
+
},
|
|
52
|
+
options: {
|
|
53
|
+
codeCoverage: options.codeCoverage ?? !!args['code-coverage'],
|
|
54
|
+
buildStat: options.buildStat,
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { getPackageDependencyVersion } from '../../utils';
|
|
2
|
+
import { getExposedDependencies } from '../get-exposed-dependencies';
|
|
3
|
+
import { BuildContext } from '../types';
|
|
4
|
+
|
|
5
|
+
export function defineExposedDependencies(context: BuildContext) {
|
|
6
|
+
const { isExposeSharedDependencies, sharedDependencies, dependencies } = context.package;
|
|
7
|
+
const { emitExposedDependencies } = context.build;
|
|
8
|
+
|
|
9
|
+
if (!isExposeSharedDependencies || emitExposedDependencies) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const exposedDependencies = getExposedDependencies(sharedDependencies, dependency =>
|
|
14
|
+
getPackageDependencyVersion(dependency, dependencies?.[dependency])
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
19
|
+
EXPOSED_DEPENDENCIES: JSON.stringify(exposedDependencies),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { getLaunchDarklySdkVersion } from '../get-version';
|
|
2
|
+
import { BuildContext } from '../types';
|
|
3
|
+
|
|
4
|
+
export function defineExposedInstanceDependencies(context: BuildContext) {
|
|
5
|
+
const { isExposeSharedDependencies } = context.package;
|
|
6
|
+
const { emitExposedDependencies } = context.build;
|
|
7
|
+
if (!isExposeSharedDependencies || emitExposedDependencies) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const instanceDependencies = {
|
|
12
|
+
launchDarkly: { version: getLaunchDarklySdkVersion() },
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
return {
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
17
|
+
EXPOSED_INSTANCE_DEPENDENCIES: JSON.stringify(instanceDependencies),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BuildContext } from '../types';
|
|
2
|
+
|
|
3
|
+
export function defineWebComponentName(context: BuildContext) {
|
|
4
|
+
const { isWebComponent } = context.package;
|
|
5
|
+
const { name } = context.build;
|
|
6
|
+
|
|
7
|
+
if (!isWebComponent) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
return {
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
13
|
+
WEB_COMPONENT_NAME: JSON.stringify(name),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BuildContext } from './types';
|
|
2
|
+
|
|
3
|
+
export function getExternals(context: BuildContext): Record<string, string> | undefined {
|
|
4
|
+
if (!needsExternals(context)) {
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const { sharedDependencies, isWebComponent } = context.package;
|
|
9
|
+
const name = isWebComponent ? context.build.name : context.package.name;
|
|
10
|
+
return Object.fromEntries(
|
|
11
|
+
Object.entries(sharedDependencies).map(([dependency, variable]) => [
|
|
12
|
+
dependency,
|
|
13
|
+
`${variable}['${name}']`,
|
|
14
|
+
])
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function needsExternals(context: BuildContext) {
|
|
19
|
+
const { light, emitExposedDependencies } = context.build;
|
|
20
|
+
const { isExposeSharedDependencies } = context.package;
|
|
21
|
+
return !!light || (isExposeSharedDependencies && !emitExposedDependencies);
|
|
22
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import crypto from 'crypto';
|
|
2
|
+
import { getPackageName } from '../utils';
|
|
3
|
+
|
|
4
|
+
export function getBuildName() {
|
|
5
|
+
const packageName = getPackageName()
|
|
6
|
+
.replace(/\//g, '-')
|
|
7
|
+
.replace(/[^\w-]/g, '');
|
|
8
|
+
const hash = crypto.randomBytes(4).toString('hex');
|
|
9
|
+
|
|
10
|
+
return `${packageName}-${hash}`;
|
|
11
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BuildContext } from './types';
|
|
2
|
+
|
|
3
|
+
export function getBundleType(context: BuildContext) {
|
|
4
|
+
const { light, headless, emitExposedDependencies } = context.build;
|
|
5
|
+
const { isExposeSharedDependencies, isWebComponent } = context.package;
|
|
6
|
+
|
|
7
|
+
if (isExposeSharedDependencies && emitExposedDependencies) {
|
|
8
|
+
return 'shared';
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
if (isWebComponent) {
|
|
12
|
+
if (headless) {
|
|
13
|
+
return 'headless';
|
|
14
|
+
}
|
|
15
|
+
return light ? 'light' : 'full';
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { getBundleType } from './get-bundle-type';
|
|
3
|
+
import { BuildContext } from './types';
|
|
4
|
+
|
|
5
|
+
export function getOutputPath(context: BuildContext) {
|
|
6
|
+
const { destination } = context.package;
|
|
7
|
+
const { emitExposedDependencies } = context.build;
|
|
8
|
+
|
|
9
|
+
const subdir = getBundleType(context) ?? '';
|
|
10
|
+
if (typeof emitExposedDependencies === 'object') {
|
|
11
|
+
const { output } = emitExposedDependencies;
|
|
12
|
+
if (output?.path) {
|
|
13
|
+
return path.join(output.path, subdir);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return path.join(process.cwd(), destination, 'bundle', subdir);
|
|
18
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { readJsonSafe } from '../utils';
|
|
2
|
+
import { getBundleType } from './get-bundle-type';
|
|
3
|
+
import { getExposedDependenciesMetadataPath } from './metadata';
|
|
4
|
+
import { BuildContext } from './types';
|
|
5
|
+
|
|
6
|
+
export interface ExposedDepsMetadata {
|
|
7
|
+
entryPointsPath: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface EntryPoints {
|
|
11
|
+
css: string[];
|
|
12
|
+
js: string[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function getExposedDependenciesEntryPoints(context: BuildContext) {
|
|
16
|
+
const metadataPath = getExposedDependenciesMetadataPath(context.package.destination);
|
|
17
|
+
const metadata = readJsonSafe<ExposedDepsMetadata>(metadataPath);
|
|
18
|
+
if (metadata?.entryPointsPath) {
|
|
19
|
+
return readJsonSafe<EntryPoints>(metadata.entryPointsPath);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function getSharedEntryPoints(context: BuildContext): EntryPoints {
|
|
24
|
+
const dirname = getBundleType({
|
|
25
|
+
...context,
|
|
26
|
+
build: { ...context.build, emitExposedDependencies: true },
|
|
27
|
+
});
|
|
28
|
+
if (!dirname) {
|
|
29
|
+
return { css: [], js: [] };
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const { css = [], js = [] } = getExposedDependenciesEntryPoints(context) ?? {};
|
|
33
|
+
return {
|
|
34
|
+
css: css.map(name => `${dirname}/${name}`),
|
|
35
|
+
js: js.map(name => `${dirname}/${name}`),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from './check-resource';
|
|
2
|
+
export * from './constants';
|
|
3
|
+
export * from './create-build-context';
|
|
4
|
+
export * from './defines';
|
|
5
|
+
export * from './externals';
|
|
6
|
+
export * from './get-build-name';
|
|
7
|
+
export * from './get-bundle-type';
|
|
8
|
+
export * from './get-exposed-dependencies';
|
|
9
|
+
export * from './get-output-path';
|
|
10
|
+
export * from './get-shared-entry-points';
|
|
11
|
+
export * from './get-version';
|
|
12
|
+
export * from './metadata';
|
|
13
|
+
export * from './stringify-config';
|
|
14
|
+
export type * from './types';
|
|
15
|
+
export * from './virtual-modules';
|