@servicetitan/startup 36.3.0 → 36.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/vite.js +3 -0
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +14 -9
- package/dist/cli/commands/build.js.map +1 -1
- package/dist/cli/commands/bundle-vite.d.ts +6 -0
- package/dist/cli/commands/bundle-vite.d.ts.map +1 -0
- package/dist/cli/commands/bundle-vite.js +110 -0
- package/dist/cli/commands/bundle-vite.js.map +1 -0
- package/dist/cli/commands/bundle-webpack.d.ts +6 -0
- package/dist/cli/commands/bundle-webpack.d.ts.map +1 -0
- package/dist/cli/commands/{bundle-package.js → bundle-webpack.js} +8 -6
- package/dist/cli/commands/bundle-webpack.js.map +1 -0
- package/dist/cli/commands/install.d.ts.map +1 -1
- package/dist/cli/commands/install.js +2 -1
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/mfe-check.d.ts.map +1 -1
- package/dist/cli/commands/mfe-check.js +13 -3
- package/dist/cli/commands/mfe-check.js.map +1 -1
- package/dist/cli/commands/mfe-generate-metadata.d.ts.map +1 -1
- package/dist/cli/commands/mfe-generate-metadata.js +5 -3
- package/dist/cli/commands/mfe-generate-metadata.js.map +1 -1
- package/dist/cli/commands/mfe-list.js +1 -1
- package/dist/cli/commands/mfe-list.js.map +1 -1
- package/dist/cli/commands/mfe-package-publish.js.map +1 -1
- package/dist/cli/commands/mfe-publish.js +1 -1
- package/dist/cli/commands/mfe-publish.js.map +1 -1
- package/dist/cli/commands/registry/build.d.ts +8 -0
- package/dist/cli/commands/registry/build.d.ts.map +1 -1
- package/dist/cli/commands/registry/build.js +8 -0
- package/dist/cli/commands/registry/build.js.map +1 -1
- package/dist/cli/commands/registry/bundle-vite.d.ts +33 -0
- package/dist/cli/commands/registry/bundle-vite.d.ts.map +1 -0
- package/dist/cli/commands/registry/bundle-vite.js +45 -0
- package/dist/cli/commands/registry/bundle-vite.js.map +1 -0
- package/dist/cli/commands/registry/{bundle-package.d.ts → bundle-webpack.d.ts} +1 -1
- package/dist/cli/commands/registry/bundle-webpack.d.ts.map +1 -0
- package/dist/cli/commands/registry/{bundle-package.js → bundle-webpack.js} +1 -1
- package/dist/cli/commands/registry/{bundle-package.js.map → bundle-webpack.js.map} +1 -1
- package/dist/cli/commands/registry/command-registry.d.ts +72 -0
- package/dist/cli/commands/registry/command-registry.d.ts.map +1 -1
- package/dist/cli/commands/registry/command-registry.js +7 -2
- package/dist/cli/commands/registry/command-registry.js.map +1 -1
- package/dist/cli/commands/registry/start.d.ts +4 -0
- package/dist/cli/commands/registry/start.d.ts.map +1 -1
- package/dist/cli/commands/registry/start.js +4 -0
- package/dist/cli/commands/registry/start.js.map +1 -1
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +12 -22
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/index.js +2 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/tasks/swc-compile-package/swc-compile-package.d.ts.map +1 -1
- package/dist/cli/tasks/swc-compile-package/swc-compile-package.js +8 -3
- package/dist/cli/tasks/swc-compile-package/swc-compile-package.js.map +1 -1
- package/dist/cli/tasks/tsc-compile/tsc-compile.js +1 -1
- package/dist/cli/tasks/tsc-compile/tsc-compile.js.map +1 -1
- package/dist/cli/utils/copy-files.js +1 -0
- package/dist/cli/utils/copy-files.js.map +1 -1
- package/dist/cli/utils/index.d.ts +0 -1
- package/dist/cli/utils/index.d.ts.map +1 -1
- package/dist/cli/utils/index.js +0 -1
- package/dist/cli/utils/index.js.map +1 -1
- package/dist/core/check-resource/check-resource.d.ts +4 -0
- package/dist/core/check-resource/check-resource.d.ts.map +1 -0
- package/dist/core/check-resource/check-resource.js +44 -0
- package/dist/core/check-resource/check-resource.js.map +1 -0
- package/dist/core/check-resource/get-package-json.d.ts +10 -0
- package/dist/core/check-resource/get-package-json.d.ts.map +1 -0
- package/dist/{webpack/configs/plugins/ignore-plugin → core/check-resource}/get-package-json.js +12 -10
- package/dist/core/check-resource/get-package-json.js.map +1 -0
- package/dist/core/check-resource/get-peer-dependency-meta.d.ts +7 -0
- package/dist/core/check-resource/get-peer-dependency-meta.d.ts.map +1 -0
- package/dist/core/check-resource/get-peer-dependency-meta.js +17 -0
- package/dist/core/check-resource/get-peer-dependency-meta.js.map +1 -0
- package/dist/core/check-resource/index.d.ts +3 -0
- package/dist/core/check-resource/index.d.ts.map +1 -0
- package/dist/core/check-resource/index.js +13 -0
- package/dist/core/check-resource/index.js.map +1 -0
- package/dist/core/check-resource/is-managed-react-dom-client-dependency.d.ts +8 -0
- package/dist/core/check-resource/is-managed-react-dom-client-dependency.d.ts.map +1 -0
- package/dist/core/check-resource/is-managed-react-dom-client-dependency.js +15 -0
- package/dist/core/check-resource/is-managed-react-dom-client-dependency.js.map +1 -0
- package/dist/core/check-resource/types.d.ts +5 -0
- package/dist/core/check-resource/types.d.ts.map +1 -0
- package/dist/core/check-resource/types.js.map +1 -0
- package/dist/core/constants.d.ts +17 -0
- package/dist/core/constants.d.ts.map +1 -0
- package/dist/core/constants.js +28 -0
- package/dist/core/constants.js.map +1 -0
- package/dist/core/create-build-context.d.ts +14 -0
- package/dist/core/create-build-context.d.ts.map +1 -0
- package/dist/core/create-build-context.js +54 -0
- package/dist/core/create-build-context.js.map +1 -0
- package/dist/core/defines/define-exposed-dependencies.d.ts +5 -0
- package/dist/core/defines/define-exposed-dependencies.d.ts.map +1 -0
- package/dist/core/defines/define-exposed-dependencies.js +32 -0
- package/dist/core/defines/define-exposed-dependencies.js.map +1 -0
- package/dist/core/defines/define-exposed-instance-dependencies.d.ts +5 -0
- package/dist/core/defines/define-exposed-instance-dependencies.d.ts.map +1 -0
- package/dist/core/defines/define-exposed-instance-dependencies.js +29 -0
- package/dist/core/defines/define-exposed-instance-dependencies.js.map +1 -0
- package/dist/core/defines/define-web-component-name.d.ts +5 -0
- package/dist/core/defines/define-web-component-name.d.ts.map +1 -0
- package/dist/core/defines/define-web-component-name.js +23 -0
- package/dist/core/defines/define-web-component-name.js.map +1 -0
- package/dist/core/defines/index.d.ts +4 -0
- package/dist/core/defines/index.d.ts.map +1 -0
- package/dist/core/defines/index.js +26 -0
- package/dist/core/defines/index.js.map +1 -0
- package/dist/core/externals.d.ts +3 -0
- package/dist/core/externals.d.ts.map +1 -0
- package/dist/core/externals.js +28 -0
- package/dist/core/externals.js.map +1 -0
- package/dist/core/get-build-name.d.ts +2 -0
- package/dist/core/get-build-name.d.ts.map +1 -0
- package/dist/core/get-build-name.js +24 -0
- package/dist/core/get-build-name.js.map +1 -0
- package/dist/core/get-bundle-type.d.ts +3 -0
- package/dist/core/get-bundle-type.d.ts.map +1 -0
- package/dist/{webpack/configs/utils → core}/get-bundle-type.js +4 -2
- package/dist/core/get-bundle-type.js.map +1 -0
- package/dist/core/get-cdn-path.d.ts +3 -0
- package/dist/core/get-cdn-path.d.ts.map +1 -0
- package/dist/core/get-cdn-path.js +15 -0
- package/dist/core/get-cdn-path.js.map +1 -0
- package/dist/core/get-exposed-dependencies.d.ts.map +1 -0
- package/dist/core/get-exposed-dependencies.js.map +1 -0
- package/dist/core/get-output-path.d.ts +3 -0
- package/dist/core/get-output-path.d.ts.map +1 -0
- package/dist/core/get-output-path.js +29 -0
- package/dist/core/get-output-path.js.map +1 -0
- package/dist/core/get-shared-entry-points.d.ts +11 -0
- package/dist/core/get-shared-entry-points.d.ts.map +1 -0
- package/dist/core/get-shared-entry-points.js +43 -0
- package/dist/core/get-shared-entry-points.js.map +1 -0
- package/dist/core/get-version/get-launchdarkly-sdk-version.d.ts +3 -0
- package/dist/core/get-version/get-launchdarkly-sdk-version.d.ts.map +1 -0
- package/dist/core/get-version/get-launchdarkly-sdk-version.js +18 -0
- package/dist/core/get-version/get-launchdarkly-sdk-version.js.map +1 -0
- package/dist/core/get-version/get-startup-version.d.ts.map +1 -0
- package/dist/{utils → core/get-version}/get-startup-version.js +2 -2
- package/dist/core/get-version/get-startup-version.js.map +1 -0
- package/dist/core/get-version/get-web-components-version.d.ts +3 -0
- package/dist/core/get-version/get-web-components-version.d.ts.map +1 -0
- package/dist/core/get-version/get-web-components-version.js +23 -0
- package/dist/core/get-version/get-web-components-version.js.map +1 -0
- package/dist/core/get-version/index.d.ts +4 -0
- package/dist/core/get-version/index.d.ts.map +1 -0
- package/dist/core/get-version/index.js +22 -0
- package/dist/core/get-version/index.js.map +1 -0
- package/dist/core/index.d.ts +17 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +34 -0
- package/dist/core/index.js.map +1 -0
- package/dist/{webpack/configs/utils → core/metadata}/build-metadata.d.ts +2 -0
- package/dist/core/metadata/build-metadata.d.ts.map +1 -0
- package/dist/{webpack/configs/utils → core/metadata}/build-metadata.js +6 -7
- 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 +7 -5
- package/dist/core/metadata/generate-metadata.js.map +1 -0
- package/dist/core/metadata/index.d.ts +4 -0
- package/dist/core/metadata/index.d.ts.map +1 -0
- package/dist/{webpack/configs/utils → core/metadata}/index.js +2 -2
- package/dist/core/metadata/index.js.map +1 -0
- package/dist/core/stringify-config.d.ts.map +1 -0
- package/dist/core/stringify-config.js.map +1 -0
- package/dist/core/types.d.ts +50 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +6 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/virtual-modules.d.ts +8 -0
- package/dist/core/virtual-modules.d.ts.map +1 -0
- package/dist/core/virtual-modules.js +83 -0
- package/dist/core/virtual-modules.js.map +1 -0
- package/dist/cypress/config/webpack-config.d.ts +1 -1
- package/dist/cypress/config/webpack-config.d.ts.map +1 -1
- package/dist/cypress/config/webpack-config.js +20 -8
- package/dist/cypress/config/webpack-config.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/storybook-config/webpack-final.d.ts +1 -1
- package/dist/storybook-config/webpack-final.d.ts.map +1 -1
- package/dist/storybook-config/webpack-final.js +18 -13
- package/dist/storybook-config/webpack-final.js.map +1 -1
- package/dist/utils/find-up.js +4 -4
- package/dist/utils/find-up.js.map +1 -1
- package/dist/utils/get-configuration.d.ts +33 -2
- package/dist/utils/get-configuration.d.ts.map +1 -1
- package/dist/utils/get-configuration.js +12 -8
- package/dist/utils/get-configuration.js.map +1 -1
- package/dist/utils/get-package-data.d.ts +0 -1
- package/dist/utils/get-package-data.d.ts.map +1 -1
- package/dist/utils/get-package-data.js +6 -24
- package/dist/utils/get-package-data.js.map +1 -1
- package/dist/utils/get-packages.d.ts +1 -1
- package/dist/utils/get-packages.d.ts.map +1 -1
- package/dist/utils/get-packages.js +1 -1
- package/dist/utils/get-packages.js.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/validate-shared-dependencies.d.ts +2 -0
- package/dist/utils/validate-shared-dependencies.d.ts.map +1 -0
- package/dist/utils/validate-shared-dependencies.js +26 -0
- package/dist/utils/validate-shared-dependencies.js.map +1 -0
- package/dist/vite/build-shared-dependencies.d.ts +3 -0
- package/dist/vite/build-shared-dependencies.d.ts.map +1 -0
- package/dist/vite/build-shared-dependencies.js +61 -0
- package/dist/vite/build-shared-dependencies.js.map +1 -0
- package/dist/vite/config/base-config.d.ts +4 -0
- package/dist/vite/config/base-config.d.ts.map +1 -0
- package/dist/vite/config/base-config.js +149 -0
- package/dist/vite/config/base-config.js.map +1 -0
- package/dist/vite/config/create-vite-build-context.d.ts +5 -0
- package/dist/vite/config/create-vite-build-context.d.ts.map +1 -0
- package/dist/vite/config/create-vite-build-context.js +43 -0
- package/dist/vite/config/create-vite-build-context.js.map +1 -0
- package/dist/vite/config/create-vite-config.d.ts +3 -0
- package/dist/vite/config/create-vite-config.d.ts.map +1 -0
- package/dist/vite/config/create-vite-config.js +43 -0
- package/dist/vite/config/create-vite-config.js.map +1 -0
- package/dist/vite/config/define-config.d.ts +13 -0
- package/dist/vite/config/define-config.d.ts.map +1 -0
- package/dist/vite/config/define-config.js +15 -0
- package/dist/vite/config/define-config.js.map +1 -0
- package/dist/vite/config/index.d.ts +6 -0
- package/dist/vite/config/index.d.ts.map +1 -0
- package/dist/vite/config/index.js +24 -0
- package/dist/vite/config/index.js.map +1 -0
- package/dist/vite/config/load-config-file.d.ts +4 -0
- package/dist/vite/config/load-config-file.d.ts.map +1 -0
- package/dist/vite/config/load-config-file.js +103 -0
- package/dist/vite/config/load-config-file.js.map +1 -0
- package/dist/vite/config/merge-vite-configs.d.ts +5 -0
- package/dist/vite/config/merge-vite-configs.d.ts.map +1 -0
- package/dist/vite/config/merge-vite-configs.js +17 -0
- package/dist/vite/config/merge-vite-configs.js.map +1 -0
- package/dist/vite/index.d.ts +2 -0
- package/dist/vite/index.d.ts.map +1 -0
- package/dist/vite/index.html +32 -0
- package/dist/vite/index.js +20 -0
- package/dist/vite/index.js.map +1 -0
- package/dist/vite/plugins/css-injector-plugin.d.ts +4 -0
- package/dist/vite/plugins/css-injector-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/css-injector-plugin.js +42 -0
- package/dist/vite/plugins/css-injector-plugin.js.map +1 -0
- package/dist/vite/plugins/dev-server-routing-plugin.d.ts +24 -0
- package/dist/vite/plugins/dev-server-routing-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/dev-server-routing-plugin.js +85 -0
- package/dist/vite/plugins/dev-server-routing-plugin.js.map +1 -0
- package/dist/vite/plugins/externals-plugin.d.ts +4 -0
- package/dist/vite/plugins/externals-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/externals-plugin.js +60 -0
- package/dist/vite/plugins/externals-plugin.js.map +1 -0
- package/dist/vite/plugins/html-plugin.d.ts +4 -0
- package/dist/vite/plugins/html-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/html-plugin.js +118 -0
- package/dist/vite/plugins/html-plugin.js.map +1 -0
- package/dist/vite/plugins/ignore-modules-plugin.d.ts +5 -0
- package/dist/vite/plugins/ignore-modules-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/ignore-modules-plugin.js +44 -0
- package/dist/vite/plugins/ignore-modules-plugin.js.map +1 -0
- package/dist/vite/plugins/index.d.ts +10 -0
- package/dist/vite/plugins/index.d.ts.map +1 -0
- package/dist/vite/plugins/index.js +28 -0
- package/dist/vite/plugins/index.js.map +1 -0
- package/dist/vite/plugins/metadata-plugin.d.ts +4 -0
- package/dist/vite/plugins/metadata-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/metadata-plugin.js +76 -0
- package/dist/vite/plugins/metadata-plugin.js.map +1 -0
- package/dist/vite/plugins/shared-dependencies-plugin.d.ts +8 -0
- package/dist/vite/plugins/shared-dependencies-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/shared-dependencies-plugin.js +252 -0
- package/dist/vite/plugins/shared-dependencies-plugin.js.map +1 -0
- package/dist/vite/plugins/style-urls-plugin.d.ts +4 -0
- package/dist/vite/plugins/style-urls-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/style-urls-plugin.js +31 -0
- package/dist/vite/plugins/style-urls-plugin.js.map +1 -0
- package/dist/vite/plugins/svgr-plugin.d.ts +4 -0
- package/dist/vite/plugins/svgr-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/svgr-plugin.js +33 -0
- package/dist/vite/plugins/svgr-plugin.js.map +1 -0
- package/dist/vite/plugins/utils/get-css-file-names.d.ts +5 -0
- package/dist/vite/plugins/utils/get-css-file-names.d.ts.map +1 -0
- package/dist/vite/plugins/utils/get-css-file-names.js +21 -0
- package/dist/vite/plugins/utils/get-css-file-names.js.map +1 -0
- package/dist/vite/plugins/virtual-modules-plugin.d.ts +4 -0
- package/dist/vite/plugins/virtual-modules-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/virtual-modules-plugin.js +54 -0
- package/dist/vite/plugins/virtual-modules-plugin.js.map +1 -0
- package/dist/vite/types.d.ts +4 -0
- package/dist/vite/types.d.ts.map +1 -0
- package/dist/vite/types.js +6 -0
- package/dist/vite/types.js.map +1 -0
- package/dist/vite/validate-shared-dependencies.d.ts +2 -0
- package/dist/vite/validate-shared-dependencies.d.ts.map +1 -0
- package/dist/vite/validate-shared-dependencies.js +27 -0
- package/dist/vite/validate-shared-dependencies.js.map +1 -0
- package/dist/webpack/bundle-webpack.d.ts +11 -0
- package/dist/webpack/bundle-webpack.d.ts.map +1 -0
- package/dist/webpack/bundle-webpack.js +107 -0
- package/dist/webpack/bundle-webpack.js.map +1 -0
- package/dist/webpack/configs/amd-config.d.ts +3 -2
- package/dist/webpack/configs/amd-config.d.ts.map +1 -1
- package/dist/webpack/configs/amd-config.js.map +1 -1
- package/dist/webpack/configs/cache-config.d.ts +3 -2
- package/dist/webpack/configs/cache-config.d.ts.map +1 -1
- package/dist/webpack/configs/cache-config.js +5 -18
- package/dist/webpack/configs/cache-config.js.map +1 -1
- package/dist/webpack/configs/dev-server-config.d.ts +2 -2
- package/dist/webpack/configs/dev-server-config.d.ts.map +1 -1
- package/dist/webpack/configs/dev-server-config.js +8 -8
- package/dist/webpack/configs/dev-server-config.js.map +1 -1
- package/dist/webpack/configs/devtool-config.d.ts +3 -2
- package/dist/webpack/configs/devtool-config.d.ts.map +1 -1
- package/dist/webpack/configs/devtool-config.js +1 -1
- package/dist/webpack/configs/devtool-config.js.map +1 -1
- package/dist/webpack/configs/entry.config.d.ts +3 -2
- package/dist/webpack/configs/entry.config.d.ts.map +1 -1
- package/dist/webpack/configs/entry.config.js +6 -5
- package/dist/webpack/configs/entry.config.js.map +1 -1
- package/dist/webpack/configs/externals-config.d.ts +3 -2
- package/dist/webpack/configs/externals-config.d.ts.map +1 -1
- package/dist/webpack/configs/externals-config.js +4 -14
- package/dist/webpack/configs/externals-config.js.map +1 -1
- package/dist/webpack/configs/index.d.ts +0 -1
- package/dist/webpack/configs/index.d.ts.map +1 -1
- package/dist/webpack/configs/index.js.map +1 -1
- package/dist/webpack/configs/loaders/css-loader.d.ts +3 -3
- package/dist/webpack/configs/loaders/css-loader.d.ts.map +1 -1
- package/dist/webpack/configs/loaders/css-loader.js +5 -4
- package/dist/webpack/configs/loaders/css-loader.js.map +1 -1
- package/dist/webpack/configs/loaders/style-loader.d.ts +2 -2
- package/dist/webpack/configs/loaders/style-loader.d.ts.map +1 -1
- package/dist/webpack/configs/loaders/style-loader.js +3 -1
- package/dist/webpack/configs/loaders/style-loader.js.map +1 -1
- package/dist/webpack/configs/module-config.d.ts +2 -2
- package/dist/webpack/configs/module-config.d.ts.map +1 -1
- package/dist/webpack/configs/module-config.js.map +1 -1
- package/dist/webpack/configs/optimization-config.d.ts +2 -2
- package/dist/webpack/configs/optimization-config.d.ts.map +1 -1
- package/dist/webpack/configs/optimization-config.js +9 -7
- package/dist/webpack/configs/optimization-config.js.map +1 -1
- package/dist/webpack/configs/output-config.d.ts +3 -2
- package/dist/webpack/configs/output-config.d.ts.map +1 -1
- package/dist/webpack/configs/output-config.js +11 -25
- package/dist/webpack/configs/output-config.js.map +1 -1
- package/dist/webpack/configs/plugins/assets-manifest-plugin.d.ts +3 -8
- package/dist/webpack/configs/plugins/assets-manifest-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/assets-manifest-plugin.js +10 -47
- package/dist/webpack/configs/plugins/assets-manifest-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/bundle-analyser-plugin.d.ts +3 -2
- package/dist/webpack/configs/plugins/bundle-analyser-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/bundle-analyser-plugin.js +6 -6
- package/dist/webpack/configs/plugins/bundle-analyser-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.d.ts +3 -2
- package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.js +4 -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 +16 -21
- package/dist/webpack/configs/plugins/html-tags-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.d.ts +3 -2
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.js +9 -8
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/mini-css-extract-plugin.d.ts +2 -2
- package/dist/webpack/configs/plugins/mini-css-extract-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/mini-css-extract-plugin.js +4 -2
- package/dist/webpack/configs/plugins/mini-css-extract-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/moment-locales-plugin.d.ts +3 -2
- package/dist/webpack/configs/plugins/moment-locales-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/moment-locales-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/remove-empty-scripts-plugin.d.ts +3 -2
- package/dist/webpack/configs/plugins/remove-empty-scripts-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/remove-empty-scripts-plugin.js +1 -1
- package/dist/webpack/configs/plugins/remove-empty-scripts-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/virtual-modules-plugin.d.ts +3 -3
- package/dist/webpack/configs/plugins/virtual-modules-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/virtual-modules-plugin.js +13 -56
- package/dist/webpack/configs/plugins/virtual-modules-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/watch-run-plugin.d.ts +3 -2
- package/dist/webpack/configs/plugins/watch-run-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/watch-run-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins-config.d.ts +3 -2
- package/dist/webpack/configs/plugins-config.d.ts.map +1 -1
- package/dist/webpack/configs/plugins-config.js.map +1 -1
- package/dist/webpack/configs/resolve-config.d.ts +3 -2
- package/dist/webpack/configs/resolve-config.d.ts.map +1 -1
- package/dist/webpack/configs/resolve-config.js +2 -1
- package/dist/webpack/configs/resolve-config.js.map +1 -1
- package/dist/webpack/configs/rules/css-rules.d.ts +2 -2
- package/dist/webpack/configs/rules/css-rules.d.ts.map +1 -1
- package/dist/webpack/configs/rules/css-rules.js +2 -1
- package/dist/webpack/configs/rules/css-rules.js.map +1 -1
- package/dist/webpack/configs/rules/font-rules.d.ts +2 -2
- package/dist/webpack/configs/rules/font-rules.d.ts.map +1 -1
- package/dist/webpack/configs/rules/font-rules.js.map +1 -1
- package/dist/webpack/configs/rules/image-rules.d.ts +2 -2
- package/dist/webpack/configs/rules/image-rules.d.ts.map +1 -1
- package/dist/webpack/configs/rules/image-rules.js.map +1 -1
- package/dist/webpack/configs/rules/js-rules.d.ts +2 -2
- package/dist/webpack/configs/rules/js-rules.d.ts.map +1 -1
- package/dist/webpack/configs/rules/js-rules.js +2 -1
- package/dist/webpack/configs/rules/js-rules.js.map +1 -1
- package/dist/webpack/configs/rules/less-rules.d.ts +2 -2
- package/dist/webpack/configs/rules/less-rules.d.ts.map +1 -1
- package/dist/webpack/configs/rules/less-rules.js.map +1 -1
- package/dist/webpack/configs/rules/scss-rules.d.ts +2 -2
- package/dist/webpack/configs/rules/scss-rules.d.ts.map +1 -1
- package/dist/webpack/configs/rules/scss-rules.js.map +1 -1
- package/dist/webpack/configs/rules/svg-rules.d.ts +2 -2
- package/dist/webpack/configs/rules/svg-rules.d.ts.map +1 -1
- package/dist/webpack/configs/rules/svg-rules.js.map +1 -1
- package/dist/webpack/configs/rules-config.d.ts +2 -2
- package/dist/webpack/configs/rules-config.d.ts.map +1 -1
- package/dist/webpack/configs/rules-config.js +2 -2
- package/dist/webpack/configs/rules-config.js.map +1 -1
- package/dist/webpack/configs/stats-config.d.ts +3 -2
- package/dist/webpack/configs/stats-config.d.ts.map +1 -1
- package/dist/webpack/configs/stats-config.js.map +1 -1
- package/dist/webpack/configs/watch-options-config.d.ts +2 -2
- package/dist/webpack/configs/watch-options-config.d.ts.map +1 -1
- package/dist/webpack/configs/watch-options-config.js +2 -2
- package/dist/webpack/configs/watch-options-config.js.map +1 -1
- package/dist/webpack/create-webpack-config.d.ts +2 -0
- package/dist/webpack/create-webpack-config.d.ts.map +1 -1
- package/dist/webpack/create-webpack-config.js +37 -48
- package/dist/webpack/create-webpack-config.js.map +1 -1
- package/dist/webpack/create-webpack-configs.d.ts +16 -0
- package/dist/webpack/create-webpack-configs.d.ts.map +1 -0
- package/dist/webpack/create-webpack-configs.js +88 -0
- package/dist/webpack/create-webpack-configs.js.map +1 -0
- package/dist/webpack/index.d.ts +2 -0
- package/dist/webpack/index.d.ts.map +1 -1
- package/dist/webpack/index.js +2 -0
- package/dist/webpack/index.js.map +1 -1
- package/dist/webpack/types.d.ts +4 -11
- package/dist/webpack/types.d.ts.map +1 -1
- package/dist/webpack/utils/create-webpack-build-context.d.ts +4 -0
- package/dist/webpack/utils/create-webpack-build-context.d.ts.map +1 -0
- package/dist/webpack/utils/create-webpack-build-context.js +21 -0
- package/dist/webpack/utils/create-webpack-build-context.js.map +1 -0
- package/dist/webpack/utils/index.d.ts +1 -1
- package/dist/webpack/utils/index.d.ts.map +1 -1
- package/dist/webpack/utils/index.js +1 -1
- package/dist/webpack/utils/index.js.map +1 -1
- package/jest/babel-plugin-import-meta-env.js +18 -0
- package/jest/jest-preset.js +5 -2
- package/package.json +30 -22
- 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-check.test.ts +16 -10
- 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 +14 -8
- package/src/cli/commands/mfe-generate-metadata.ts +3 -1
- package/src/cli/commands/mfe-list.ts +1 -1
- package/src/cli/commands/mfe-package-publish.ts +1 -1
- package/src/cli/commands/mfe-publish.ts +1 -1
- package/src/cli/commands/registry/__tests__/command-registry.test.ts +1 -0
- package/src/cli/commands/registry/build.ts +2 -0
- package/src/cli/commands/registry/bundle-vite.ts +14 -0
- package/src/cli/commands/registry/command-registry.ts +5 -2
- package/src/cli/commands/registry/start.ts +1 -0
- package/src/cli/commands/start.ts +15 -29
- package/src/cli/index.ts +2 -1
- package/src/cli/tasks/swc-compile-package/__tests__/swc-compile-package.test.ts +21 -1
- package/src/cli/tasks/swc-compile-package/swc-cli.d.ts +1 -1
- package/src/cli/tasks/swc-compile-package/swc-compile-package.ts +9 -3
- package/src/cli/tasks/tsc-compile/tsc-compile.ts +1 -1
- package/src/cli/utils/copy-files.ts +1 -1
- package/src/cli/utils/index.ts +0 -1
- package/src/core/__tests__/get-cdn-path.test.ts +27 -0
- package/src/core/__tests__/get-output-path.test.ts +64 -0
- package/src/core/check-resource/__tests__/check-resource.test.ts +58 -0
- package/src/{webpack/configs/plugins/ignore-plugin → core/check-resource}/__tests__/get-package-json.test.ts +2 -1
- package/src/core/check-resource/__tests__/get-peer-dependency-meta.test.ts +51 -0
- package/src/core/check-resource/__tests__/is-managed-react-dom-client-dependency.test.ts +35 -0
- package/src/core/check-resource/check-resource.ts +30 -0
- package/src/core/check-resource/get-package-json.ts +33 -0
- package/src/core/check-resource/get-peer-dependency-meta.ts +15 -0
- package/src/core/check-resource/index.ts +2 -0
- package/src/core/check-resource/is-managed-react-dom-client-dependency.ts +13 -0
- package/src/core/check-resource/types.ts +4 -0
- package/src/core/constants.ts +16 -0
- package/src/core/create-build-context.ts +61 -0
- package/src/core/defines/define-exposed-dependencies.ts +25 -0
- package/src/core/defines/define-exposed-instance-dependencies.ts +19 -0
- package/src/core/defines/define-web-component-name.ts +15 -0
- package/src/core/defines/index.ts +3 -0
- package/src/core/externals.ts +22 -0
- package/src/core/get-build-name.ts +11 -0
- package/src/core/get-bundle-type.ts +19 -0
- package/src/core/get-cdn-path.ts +5 -0
- package/src/core/get-output-path.ts +15 -0
- package/src/core/get-shared-entry-points.ts +37 -0
- package/src/core/get-version/__tests__/get-launchdarkly-sdk-version.test.ts +48 -0
- package/src/core/get-version/__tests__/get-web-components-version.test.ts +48 -0
- package/src/core/get-version/get-launchdarkly-sdk-version.ts +8 -0
- package/src/core/get-version/get-startup-version.ts +6 -0
- package/src/core/get-version/get-web-components-version.ts +16 -0
- package/src/core/get-version/index.ts +3 -0
- package/src/core/index.ts +16 -0
- package/src/{webpack/configs/utils → core/metadata}/__tests__/build-metadata.test.ts +10 -6
- package/src/{webpack/configs/utils → core/metadata}/__tests__/generate-metadata.test.ts +25 -13
- package/src/{webpack/configs/utils → core/metadata}/build-metadata.ts +11 -6
- package/src/core/metadata/generate-exposed-dependencies-metadata.ts +20 -0
- package/src/{webpack/configs/utils → core/metadata}/generate-metadata.ts +9 -6
- package/src/core/metadata/index.ts +3 -0
- package/src/core/types.ts +54 -0
- package/src/core/virtual-modules.ts +74 -0
- package/src/cypress/config/__tests__/webpack-config.test.ts +4 -3
- package/src/cypress/config/webpack-config.ts +24 -11
- package/src/index.ts +1 -0
- package/src/storybook-config/__tests__/webpack-final.test.ts +5 -27
- package/src/storybook-config/webpack-final.ts +23 -15
- package/src/utils/__tests__/get-configuration.test.ts +28 -7
- package/src/utils/__tests__/get-package-data.test.ts +24 -34
- package/src/utils/__tests__/get-packages.test.ts +4 -4
- package/src/utils/__tests__/validate-shared-dependencies.test.ts +55 -0
- package/src/utils/find-up.ts +1 -1
- package/src/utils/get-configuration.ts +51 -7
- package/src/utils/get-package-data.ts +3 -15
- package/src/utils/get-packages.ts +2 -2
- package/src/utils/index.ts +1 -1
- package/src/utils/validate-shared-dependencies.ts +32 -0
- package/src/vite/__tests__/build-shared-dependencies.test.ts +247 -0
- package/src/vite/__tests__/validate-shared-dependencies.test.ts +34 -0
- package/src/vite/build-shared-dependencies.ts +56 -0
- package/src/vite/config/__tests__/base-config.test.ts +309 -0
- package/src/vite/config/__tests__/create-vite-build-context.test.ts +86 -0
- package/src/vite/config/__tests__/create-vite-config.test.ts +141 -0
- package/src/vite/config/__tests__/define-config.test.ts +23 -0
- package/src/vite/config/__tests__/load-config-file.test.ts +191 -0
- package/src/vite/config/__tests__/merge-vite-configs.test.ts +84 -0
- package/src/vite/config/base-config.ts +137 -0
- package/src/vite/config/create-vite-build-context.ts +45 -0
- package/src/vite/config/create-vite-config.ts +33 -0
- package/src/vite/config/define-config.ts +18 -0
- package/src/vite/config/index.ts +5 -0
- package/src/vite/config/load-config-file.ts +52 -0
- package/src/vite/config/merge-vite-configs.ts +15 -0
- package/src/vite/index.html +32 -0
- package/src/vite/index.ts +1 -0
- package/src/vite/plugins/__tests__/css-injector-plugin.test.ts +119 -0
- package/src/vite/plugins/__tests__/dev-server-routing-plugin.test.ts +255 -0
- package/src/vite/plugins/__tests__/externals-plugin.test.ts +138 -0
- package/src/vite/plugins/__tests__/html-plugin.test.ts +360 -0
- package/src/vite/plugins/__tests__/html-template.test.ts +97 -0
- package/src/vite/plugins/__tests__/ignore-modules-plugin.test.ts +85 -0
- package/src/vite/plugins/__tests__/metadata-plugin.test.ts +163 -0
- package/src/vite/plugins/__tests__/shared-dependencies-plugin.test.ts +427 -0
- package/src/vite/plugins/__tests__/style-urls-plugin.test.ts +77 -0
- package/src/vite/plugins/__tests__/svgr-plugin.test.ts +67 -0
- package/src/vite/plugins/__tests__/virtual-modules-plugin.test.ts +101 -0
- package/src/vite/plugins/css-injector-plugin.ts +65 -0
- package/src/vite/plugins/dev-server-routing-plugin.ts +96 -0
- package/src/vite/plugins/externals-plugin.ts +81 -0
- package/src/vite/plugins/html-plugin.ts +111 -0
- package/src/vite/plugins/ignore-modules-plugin.ts +25 -0
- package/src/vite/plugins/index.ts +9 -0
- package/src/vite/plugins/metadata-plugin.ts +65 -0
- package/src/vite/plugins/shared-dependencies-plugin.ts +273 -0
- package/src/vite/plugins/style-urls-plugin.ts +21 -0
- package/src/vite/plugins/svgr-plugin.ts +17 -0
- package/src/vite/plugins/utils/get-css-file-names.ts +11 -0
- package/src/vite/plugins/virtual-modules-plugin.ts +46 -0
- package/src/vite/types.ts +6 -0
- package/src/vite/validate-shared-dependencies.ts +27 -0
- package/src/webpack/__mocks__/style-rules.ts +15 -3
- package/src/{cli/utils/__tests__/bundle.test.ts → webpack/__tests__/bundle-webpack.test.ts} +30 -23
- package/src/webpack/__tests__/create-webpack-config-shared-dependencies.test.ts +50 -20
- package/src/webpack/__tests__/create-webpack-config-web-component.test.ts +17 -16
- package/src/webpack/__tests__/create-webpack-config.test.ts +9 -13
- package/src/webpack/bundle-webpack.ts +107 -0
- package/src/webpack/configs/amd-config.ts +3 -2
- package/src/webpack/configs/cache-config.ts +7 -15
- package/src/webpack/configs/dev-server-config.ts +16 -17
- package/src/webpack/configs/devtool-config.ts +4 -3
- package/src/webpack/configs/entry.config.ts +8 -7
- package/src/webpack/configs/externals-config.ts +5 -21
- package/src/webpack/configs/index.ts +0 -1
- package/src/webpack/configs/loaders/css-loader.ts +7 -3
- package/src/webpack/configs/loaders/style-loader.ts +4 -5
- package/src/webpack/configs/module-config.ts +2 -2
- package/src/webpack/configs/optimization-config.ts +17 -11
- package/src/webpack/configs/output-config.ts +12 -23
- package/src/webpack/configs/plugins/assets-manifest-plugin.ts +9 -36
- package/src/webpack/configs/plugins/bundle-analyser-plugin.ts +8 -8
- package/src/webpack/configs/plugins/define-exposed-dependencies-plugin.ts +7 -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 +10 -17
- package/src/webpack/configs/plugins/ignore-plugin/__tests__/ignore-plugin.test.ts +67 -0
- package/src/webpack/configs/plugins/ignore-plugin/ignore-plugin.ts +10 -10
- package/src/webpack/configs/plugins/mini-css-extract-plugin.ts +9 -5
- package/src/webpack/configs/plugins/moment-locales-plugin.ts +3 -2
- package/src/webpack/configs/plugins/remove-empty-scripts-plugin.ts +4 -3
- package/src/webpack/configs/plugins/virtual-modules-plugin.ts +11 -65
- package/src/webpack/configs/plugins/watch-run-plugin.ts +3 -2
- package/src/webpack/configs/plugins-config.ts +3 -2
- package/src/webpack/configs/resolve-config.ts +4 -2
- package/src/webpack/configs/rules/css-rules.ts +4 -3
- package/src/webpack/configs/rules/font-rules.ts +2 -2
- package/src/webpack/configs/rules/image-rules.ts +2 -2
- package/src/webpack/configs/rules/js-rules.ts +3 -2
- package/src/webpack/configs/rules/less-rules.ts +2 -2
- package/src/webpack/configs/rules/scss-rules.ts +2 -2
- package/src/webpack/configs/rules/svg-rules.ts +2 -2
- package/src/webpack/configs/rules-config.ts +6 -5
- package/src/webpack/configs/stats-config.ts +3 -2
- package/src/webpack/configs/watch-options-config.ts +3 -3
- package/src/webpack/create-webpack-config.ts +19 -51
- package/src/webpack/create-webpack-configs.ts +83 -0
- package/src/webpack/index.ts +2 -0
- package/src/webpack/types.ts +11 -11
- package/src/webpack/utils/__tests__/split-by-entry.test.ts +33 -0
- package/src/webpack/utils/create-webpack-build-context.ts +12 -0
- package/src/webpack/utils/index.ts +1 -1
- package/dist/cli/commands/bundle-package.d.ts +0 -6
- package/dist/cli/commands/bundle-package.d.ts.map +0 -1
- package/dist/cli/commands/bundle-package.js.map +0 -1
- package/dist/cli/commands/registry/bundle-package.d.ts.map +0 -1
- package/dist/cli/utils/bundle.d.ts +0 -14
- package/dist/cli/utils/bundle.d.ts.map +0 -1
- package/dist/cli/utils/bundle.js +0 -187
- package/dist/cli/utils/bundle.js.map +0 -1
- package/dist/utils/get-startup-version.d.ts.map +0 -1
- package/dist/utils/get-startup-version.js.map +0 -1
- package/dist/webpack/configs/plugins/ignore-plugin/check-resource.d.ts +0 -3
- package/dist/webpack/configs/plugins/ignore-plugin/check-resource.d.ts.map +0 -1
- package/dist/webpack/configs/plugins/ignore-plugin/check-resource.js +0 -40
- package/dist/webpack/configs/plugins/ignore-plugin/check-resource.js.map +0 -1
- package/dist/webpack/configs/plugins/ignore-plugin/get-package-json.d.ts +0 -2
- package/dist/webpack/configs/plugins/ignore-plugin/get-package-json.d.ts.map +0 -1
- package/dist/webpack/configs/plugins/ignore-plugin/get-package-json.js.map +0 -1
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-peer-dependency.d.ts +0 -2
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-peer-dependency.d.ts.map +0 -1
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-peer-dependency.js +0 -27
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-peer-dependency.js.map +0 -1
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-react-dom-peer-dependency.d.ts +0 -7
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-react-dom-peer-dependency.d.ts.map +0 -1
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-react-dom-peer-dependency.js +0 -15
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-react-dom-peer-dependency.js.map +0 -1
- package/dist/webpack/configs/types.d.ts +0 -37
- package/dist/webpack/configs/types.d.ts.map +0 -1
- package/dist/webpack/configs/types.js.map +0 -1
- package/dist/webpack/configs/utils/build-metadata.d.ts.map +0 -1
- package/dist/webpack/configs/utils/build-metadata.js.map +0 -1
- package/dist/webpack/configs/utils/generate-metadata.d.ts +0 -3
- package/dist/webpack/configs/utils/generate-metadata.d.ts.map +0 -1
- package/dist/webpack/configs/utils/generate-metadata.js.map +0 -1
- package/dist/webpack/configs/utils/get-bundle-type.d.ts +0 -3
- package/dist/webpack/configs/utils/get-bundle-type.d.ts.map +0 -1
- package/dist/webpack/configs/utils/get-bundle-type.js.map +0 -1
- package/dist/webpack/configs/utils/get-exposed-dependencies.d.ts.map +0 -1
- package/dist/webpack/configs/utils/get-exposed-dependencies.js.map +0 -1
- package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.d.ts +0 -2
- package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.d.ts.map +0 -1
- package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.js +0 -26
- package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.js.map +0 -1
- package/dist/webpack/configs/utils/get-web-components-version.d.ts +0 -2
- package/dist/webpack/configs/utils/get-web-components-version.d.ts.map +0 -1
- package/dist/webpack/configs/utils/get-web-components-version.js +0 -22
- package/dist/webpack/configs/utils/get-web-components-version.js.map +0 -1
- package/dist/webpack/configs/utils/index.d.ts +0 -4
- package/dist/webpack/configs/utils/index.d.ts.map +0 -1
- package/dist/webpack/configs/utils/index.js.map +0 -1
- package/dist/webpack/utils/stringify-config.d.ts.map +0 -1
- package/dist/webpack/utils/stringify-config.js.map +0 -1
- package/src/cli/utils/bundle.ts +0 -191
- package/src/utils/get-startup-version.ts +0 -6
- package/src/webpack/configs/plugins/ignore-plugin/__tests__/check-resource.test.ts +0 -62
- package/src/webpack/configs/plugins/ignore-plugin/__tests__/is-optional-peer-dependency.test.ts +0 -47
- package/src/webpack/configs/plugins/ignore-plugin/__tests__/is-optional-react-dom-peer-dependency.test.ts +0 -35
- package/src/webpack/configs/plugins/ignore-plugin/check-resource.ts +0 -29
- package/src/webpack/configs/plugins/ignore-plugin/get-package-json.ts +0 -23
- package/src/webpack/configs/plugins/ignore-plugin/is-optional-peer-dependency.ts +0 -12
- package/src/webpack/configs/plugins/ignore-plugin/is-optional-react-dom-peer-dependency.ts +0 -11
- package/src/webpack/configs/types.ts +0 -40
- package/src/webpack/configs/utils/__tests__/get-launchdarkly-sdk-version.test.ts +0 -30
- package/src/webpack/configs/utils/__tests__/get-web-components-version.test.ts +0 -24
- package/src/webpack/configs/utils/get-bundle-type.ts +0 -22
- package/src/webpack/configs/utils/get-launchdarkly-sdk-version.ts +0 -15
- package/src/webpack/configs/utils/get-web-components-version.ts +0 -8
- package/src/webpack/configs/utils/index.ts +0 -3
- /package/dist/{webpack/configs → core/check-resource}/types.js +0 -0
- /package/dist/{webpack/configs/utils → core}/get-exposed-dependencies.d.ts +0 -0
- /package/dist/{webpack/configs/utils → core}/get-exposed-dependencies.js +0 -0
- /package/dist/{utils → core/get-version}/get-startup-version.d.ts +0 -0
- /package/dist/{webpack/utils → core}/stringify-config.d.ts +0 -0
- /package/dist/{webpack/utils → core}/stringify-config.js +0 -0
- /package/src/cli/commands/registry/{bundle-package.ts → bundle-webpack.ts} +0 -0
- /package/src/{webpack/configs/utils → core}/__tests__/get-exposed-dependencies.test.ts +0 -0
- /package/src/{webpack/configs/utils → core}/get-exposed-dependencies.ts +0 -0
- /package/src/{utils → core/get-version}/__tests__/get-startup-version.test.ts +0 -0
- /package/src/{webpack/utils → core}/stringify-config.ts +0 -0
|
@@ -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);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getPackages,
|
|
1
|
+
import { getPackages, logErrors, PackageType } from '../../utils';
|
|
2
2
|
import {
|
|
3
3
|
checkArgs,
|
|
4
4
|
compile,
|
|
@@ -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)
|
|
@@ -73,23 +75,8 @@ export class Start extends Command<typeof entry> {
|
|
|
73
75
|
|
|
74
76
|
const onComplete = new Promise<void>(resolve => {
|
|
75
77
|
let counter = 0;
|
|
76
|
-
let timeout: NodeJS.Timeout;
|
|
77
78
|
|
|
78
|
-
|
|
79
|
-
/*
|
|
80
|
-
* Running the timer as a fallback
|
|
81
|
-
* In case there are no files in the package swc will not print out completion indicator
|
|
82
|
-
*/
|
|
83
|
-
timeout = setTimeout(() => {
|
|
84
|
-
log.warning(
|
|
85
|
-
'Compilation timeout exceeded. Proceeding without waiting.'
|
|
86
|
-
);
|
|
87
|
-
resolve();
|
|
88
|
-
unwatch();
|
|
89
|
-
}, 30000);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
const unwatch = watchStdout(
|
|
79
|
+
watchStdout(
|
|
93
80
|
process,
|
|
94
81
|
useTsc
|
|
95
82
|
? 'Initial tsc-compile-package task completed'
|
|
@@ -99,7 +86,6 @@ export class Start extends Command<typeof entry> {
|
|
|
99
86
|
|
|
100
87
|
if (counter === scope.length) {
|
|
101
88
|
resolve();
|
|
102
|
-
clearTimeout(timeout);
|
|
103
89
|
}
|
|
104
90
|
}
|
|
105
91
|
);
|
|
@@ -136,12 +122,12 @@ export class Start extends Command<typeof entry> {
|
|
|
136
122
|
processTree.add(
|
|
137
123
|
StartProcesses.BundleExposedDependencies,
|
|
138
124
|
() => {
|
|
139
|
-
if (
|
|
125
|
+
if (bundleScope.length === 0) {
|
|
140
126
|
return Promise.resolve();
|
|
141
127
|
}
|
|
142
128
|
return lernaExec({
|
|
143
|
-
|
|
144
|
-
'scope':
|
|
129
|
+
cmd,
|
|
130
|
+
'scope': bundleScope,
|
|
145
131
|
'parallel': true,
|
|
146
132
|
'stream': true,
|
|
147
133
|
'--': ['--exposed-dependencies', '--use-watch-config'],
|
|
@@ -150,14 +136,14 @@ export class Start extends Command<typeof entry> {
|
|
|
150
136
|
{ dependsOn: [StartProcesses.Compile, StartProcesses.PreparePackage] }
|
|
151
137
|
);
|
|
152
138
|
processTree.add(
|
|
153
|
-
StartProcesses.
|
|
139
|
+
StartProcesses.Bundle,
|
|
154
140
|
() => {
|
|
155
|
-
if (
|
|
141
|
+
if (bundleScope.length === 0) {
|
|
156
142
|
return Promise.resolve();
|
|
157
143
|
}
|
|
158
144
|
return lernaExec({
|
|
159
|
-
|
|
160
|
-
'scope':
|
|
145
|
+
cmd,
|
|
146
|
+
'scope': bundleScope,
|
|
161
147
|
'parallel': true,
|
|
162
148
|
'stream': true,
|
|
163
149
|
'--': [
|
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';
|
|
@@ -8,7 +8,7 @@ import { SwcCompilePackage } from '../swc-compile-package';
|
|
|
8
8
|
|
|
9
9
|
jest.mock('fs', () => fs);
|
|
10
10
|
jest.mock('@swc/cli', () => ({
|
|
11
|
-
swcDir: jest.fn(),
|
|
11
|
+
swcDir: jest.fn(() => Promise.resolve()),
|
|
12
12
|
}));
|
|
13
13
|
|
|
14
14
|
jest.mock('../../../../utils', () => ({
|
|
@@ -191,9 +191,29 @@ describe(`[startup] ${SwcCompilePackage.name} task`, () => {
|
|
|
191
191
|
);
|
|
192
192
|
});
|
|
193
193
|
|
|
194
|
+
/*
|
|
195
|
+
* This test covers the case where swcDir resolves without calling either callback,
|
|
196
|
+
* which will happen in watch mode when no files are compiled
|
|
197
|
+
*/
|
|
198
|
+
test('logs completion message', async () => {
|
|
199
|
+
await subject();
|
|
200
|
+
|
|
201
|
+
expect(log.info).toHaveBeenCalledWith(
|
|
202
|
+
expect.stringMatching('swc-compile-package task completed in 0ms')
|
|
203
|
+
);
|
|
204
|
+
});
|
|
205
|
+
|
|
194
206
|
describe('in watch mode', () => {
|
|
195
207
|
beforeEach(() => (watch = true));
|
|
196
208
|
|
|
209
|
+
test('logs completion message', async () => {
|
|
210
|
+
await subject();
|
|
211
|
+
|
|
212
|
+
expect(log.info).toHaveBeenCalledWith(
|
|
213
|
+
expect.stringMatching('Initial swc-compile-package task completed in 0ms')
|
|
214
|
+
);
|
|
215
|
+
});
|
|
216
|
+
|
|
197
217
|
test('calls swcDir with watch=true', () => {
|
|
198
218
|
subject();
|
|
199
219
|
|
|
@@ -25,17 +25,18 @@ export class SwcCompilePackage extends Task {
|
|
|
25
25
|
/* istanbul ignore next: debug only */
|
|
26
26
|
log.debug('swc-compile-package:config', () => JSON.stringify(config, null, 2));
|
|
27
27
|
|
|
28
|
+
let callbackFired = false;
|
|
29
|
+
|
|
28
30
|
return new Promise((resolve, reject) => {
|
|
29
31
|
swcDir({
|
|
30
32
|
...config,
|
|
31
33
|
callbacks: {
|
|
32
34
|
onSuccess: (e: { duration: number }) => {
|
|
35
|
+
callbackFired = true;
|
|
33
36
|
this.logCompletionResults(this.taskTimer.add(e.duration));
|
|
34
|
-
if (!this.watch) {
|
|
35
|
-
resolve();
|
|
36
|
-
}
|
|
37
37
|
},
|
|
38
38
|
onFail: (e: { duration: number; reasons: Map<string, string> }) => {
|
|
39
|
+
callbackFired = true;
|
|
39
40
|
log.text([...e.reasons.values()][0]);
|
|
40
41
|
this.logCompletionResults(this.taskTimer.add(e.duration));
|
|
41
42
|
if (!this.watch) {
|
|
@@ -43,6 +44,11 @@ export class SwcCompilePackage extends Task {
|
|
|
43
44
|
}
|
|
44
45
|
},
|
|
45
46
|
},
|
|
47
|
+
}).then(() => {
|
|
48
|
+
if (!callbackFired) {
|
|
49
|
+
this.logCompletionResults(this.taskTimer.add(0));
|
|
50
|
+
}
|
|
51
|
+
resolve();
|
|
46
52
|
});
|
|
47
53
|
});
|
|
48
54
|
}
|
|
@@ -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
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { getCdnPath } from '../get-cdn-path';
|
|
2
|
+
import { BuildContext } from '../types';
|
|
3
|
+
|
|
4
|
+
describe(`[startup] ${getCdnPath.name}`, () => {
|
|
5
|
+
let context: Partial<BuildContext>;
|
|
6
|
+
|
|
7
|
+
beforeAll(() => (process.env.CLIENT_CDN_PATH = 'foo'));
|
|
8
|
+
afterAll(() => delete process.env.CLIENT_CDN_PATH);
|
|
9
|
+
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
context = { build: { name: '', isProduction: true } };
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const subject = () => getCdnPath(context as any);
|
|
15
|
+
|
|
16
|
+
test('returns process.env.CLIENT_CDN_PATH', () => {
|
|
17
|
+
expect(subject()).toEqual(process.env.CLIENT_CDN_PATH);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
describe('when not production', () => {
|
|
21
|
+
beforeEach(() => (context.build!.isProduction = false));
|
|
22
|
+
|
|
23
|
+
test('returns undefined', () => {
|
|
24
|
+
expect(subject()).toBeUndefined();
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { getBundleType } from '../get-bundle-type';
|
|
3
|
+
import { getOutputPath } from '../get-output-path';
|
|
4
|
+
import { BuildContext } from '../types';
|
|
5
|
+
|
|
6
|
+
jest.mock('../get-bundle-type', () => ({
|
|
7
|
+
getBundleType: jest.fn(),
|
|
8
|
+
}));
|
|
9
|
+
|
|
10
|
+
describe(`[startup] ${getOutputPath.name}`, () => {
|
|
11
|
+
const destination = 'dist';
|
|
12
|
+
let context: BuildContext;
|
|
13
|
+
|
|
14
|
+
beforeEach(() => {
|
|
15
|
+
jest.clearAllMocks();
|
|
16
|
+
context = {
|
|
17
|
+
build: {},
|
|
18
|
+
package: { destination },
|
|
19
|
+
} as BuildContext;
|
|
20
|
+
jest.mocked(getBundleType).mockReturnValue(undefined);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const subject = () => getOutputPath(context);
|
|
24
|
+
|
|
25
|
+
test('returns default path under cwd', () => {
|
|
26
|
+
expect(subject()).toBe(path.join(process.cwd(), destination, 'bundle'));
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
describe('when getBundleType returns a subdir', () => {
|
|
30
|
+
const subdir = 'full';
|
|
31
|
+
|
|
32
|
+
beforeEach(() => {
|
|
33
|
+
jest.mocked(getBundleType).mockReturnValue(subdir);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
test('appends subdir to default path', () => {
|
|
37
|
+
expect(subject()).toBe(path.join(process.cwd(), destination, 'bundle', subdir));
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
describe('when outputBasePath is set', () => {
|
|
42
|
+
const outputBasePath = '/custom/out';
|
|
43
|
+
|
|
44
|
+
beforeEach(() => {
|
|
45
|
+
context.build.outputBasePath = outputBasePath;
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
test('uses outputBasePath as base', () => {
|
|
49
|
+
expect(subject()).toBe(path.normalize(outputBasePath));
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
describe('with a subdir from getBundleType', () => {
|
|
53
|
+
const subdir = 'shared';
|
|
54
|
+
|
|
55
|
+
beforeEach(() => {
|
|
56
|
+
jest.mocked(getBundleType).mockReturnValue(subdir);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
test('appends subdir to outputBasePath', () => {
|
|
60
|
+
expect(subject()).toBe(path.join(outputBasePath, subdir));
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { BuildContext } from '../../types';
|
|
2
|
+
import { checkResource } from '../check-resource';
|
|
3
|
+
import { getPeerDependencyMeta } from '../get-peer-dependency-meta';
|
|
4
|
+
import { isManagedReactDomClientDependency } from '../is-managed-react-dom-client-dependency';
|
|
5
|
+
|
|
6
|
+
jest.mock('../is-managed-react-dom-client-dependency');
|
|
7
|
+
jest.mock('../get-peer-dependency-meta');
|
|
8
|
+
|
|
9
|
+
describe(`${checkResource.name}`, () => {
|
|
10
|
+
const importer = 'node_modules/web-components/dist';
|
|
11
|
+
let context: BuildContext;
|
|
12
|
+
let resource: string;
|
|
13
|
+
let peerDependenciesMeta: ReturnType<typeof getPeerDependencyMeta>;
|
|
14
|
+
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
jest.resetAllMocks();
|
|
17
|
+
jest.mocked(getPeerDependencyMeta).mockImplementation(() => peerDependenciesMeta);
|
|
18
|
+
peerDependenciesMeta = undefined;
|
|
19
|
+
resource = '@servicetitan/foo';
|
|
20
|
+
context = { package: { dependencies: {} } } as BuildContext;
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const subject = () => checkResource(context)({ resource, importer });
|
|
24
|
+
|
|
25
|
+
function itReturns(value: boolean) {
|
|
26
|
+
test(`returns ${JSON.stringify(value)}`, () => expect(subject()).toBe(value));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
itReturns(false);
|
|
30
|
+
|
|
31
|
+
describe('when resource is optional peer dependency', () => {
|
|
32
|
+
beforeEach(() => (peerDependenciesMeta = { optional: true }));
|
|
33
|
+
|
|
34
|
+
itReturns(true);
|
|
35
|
+
|
|
36
|
+
describe('when resource is package dependency', () => {
|
|
37
|
+
beforeEach(() => (context.package.dependencies[resource] = '*'));
|
|
38
|
+
|
|
39
|
+
itReturns(false);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
describe('when resource is managed react-dom client dependency', () => {
|
|
44
|
+
beforeEach(() => jest.mocked(isManagedReactDomClientDependency).mockReturnValue(true));
|
|
45
|
+
|
|
46
|
+
describe('when resource is present', () => {
|
|
47
|
+
beforeEach(() => (resource = 'fs'));
|
|
48
|
+
|
|
49
|
+
itReturns(false);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
describe('when resource is not present', () => {
|
|
53
|
+
beforeEach(() => (resource = 'foo'));
|
|
54
|
+
|
|
55
|
+
itReturns(true);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
});
|
|
@@ -8,6 +8,7 @@ describe(`[startup] ${getPackageJson.name}`, () => {
|
|
|
8
8
|
let context: string;
|
|
9
9
|
|
|
10
10
|
beforeEach(() => {
|
|
11
|
+
getPackageJson.cache.clear?.();
|
|
11
12
|
context = 'node_modules/foo/dist';
|
|
12
13
|
vol.fromNestedJSON({
|
|
13
14
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
@@ -39,7 +40,7 @@ describe(`[startup] ${getPackageJson.name}`, () => {
|
|
|
39
40
|
|
|
40
41
|
describe('when context is not in node_modules', () => {
|
|
41
42
|
beforeEach(() => {
|
|
42
|
-
context = 'foo/dist';
|
|
43
|
+
context = '/foo/dist';
|
|
43
44
|
vol.fromNestedJSON({
|
|
44
45
|
foo: { 'package.json': JSON.stringify(packageJson) },
|
|
45
46
|
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { getPackageJson } from '../get-package-json';
|
|
2
|
+
import { getPeerDependencyMeta } from '../get-peer-dependency-meta';
|
|
3
|
+
|
|
4
|
+
jest.mock('../get-package-json');
|
|
5
|
+
|
|
6
|
+
describe(`[startup] ${getPeerDependencyMeta.name}`, () => {
|
|
7
|
+
const meta = { optional: true };
|
|
8
|
+
let importer: string;
|
|
9
|
+
let resource: string;
|
|
10
|
+
|
|
11
|
+
beforeEach(() => {
|
|
12
|
+
jest.clearAllMocks();
|
|
13
|
+
importer = 'node_modules/pkg/dist';
|
|
14
|
+
resource = '@scope/a';
|
|
15
|
+
jest.mocked(getPackageJson).mockImplementation(() => ({
|
|
16
|
+
peerDependenciesMeta: { [resource]: meta },
|
|
17
|
+
}));
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const subject = () => getPeerDependencyMeta({ resource, importer });
|
|
21
|
+
|
|
22
|
+
function itReturnsUndefined() {
|
|
23
|
+
test('returns undefined', () => {
|
|
24
|
+
expect(subject()).toBeUndefined();
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
test('returns peerDependenciesMeta for resource', () => {
|
|
29
|
+
expect(subject()).toEqual(meta);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
describe('when resource is not a package name', () => {
|
|
33
|
+
beforeEach(() => (resource = './local'));
|
|
34
|
+
|
|
35
|
+
itReturnsUndefined();
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
describe('when peerDependenciesMeta omits resource', () => {
|
|
39
|
+
beforeEach(() => {
|
|
40
|
+
jest.mocked(getPackageJson).mockReturnValue({ peerDependenciesMeta: {} });
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
itReturnsUndefined();
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
describe('when package.json is not found', () => {
|
|
47
|
+
beforeEach(() => jest.mocked(getPackageJson).mockReturnValue(undefined));
|
|
48
|
+
|
|
49
|
+
itReturnsUndefined();
|
|
50
|
+
});
|
|
51
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { isManagedReactDomClientDependency } from '../is-managed-react-dom-client-dependency';
|
|
2
|
+
|
|
3
|
+
describe(`[startup] ${isManagedReactDomClientDependency.name}`, () => {
|
|
4
|
+
const subject = (...args: Parameters<typeof isManagedReactDomClientDependency>) =>
|
|
5
|
+
isManagedReactDomClientDependency(...args);
|
|
6
|
+
|
|
7
|
+
describe.each([
|
|
8
|
+
{
|
|
9
|
+
resource: 'react-dom/client',
|
|
10
|
+
importers: [
|
|
11
|
+
'@servicetitan/web-components',
|
|
12
|
+
'uikit/packages/web-components/dist',
|
|
13
|
+
'@servicetitan/ko-bridge',
|
|
14
|
+
'uikit/packages/ko-bridge/dist',
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
])('with dependency "$resource"', ({ resource, importers }) => {
|
|
18
|
+
importers.forEach(importer => {
|
|
19
|
+
test(`with importer ${importer}, returns true`, () => {
|
|
20
|
+
expect(subject({ importer, resource })).toBe(true);
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
describe.each([
|
|
26
|
+
{ resource: 'react-dom', importers: ['@servicetitan/web-components'] },
|
|
27
|
+
{ resource: 'react-dom/client', importers: ['@servicetitan/foo'] },
|
|
28
|
+
])('with dependency "$resource"', ({ resource, importers }) => {
|
|
29
|
+
importers.forEach(importer => {
|
|
30
|
+
test(`with importer ${importer}, returns false`, () => {
|
|
31
|
+
expect(subject({ importer, resource })).toBe(false);
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { log } from '../../utils';
|
|
2
|
+
import { BuildContext } from '../types';
|
|
3
|
+
import { getPeerDependencyMeta } from './get-peer-dependency-meta';
|
|
4
|
+
import { isManagedReactDomClientDependency } from './is-managed-react-dom-client-dependency';
|
|
5
|
+
import type { CheckerArgs } from './types';
|
|
6
|
+
|
|
7
|
+
export function checkResource(context: BuildContext) {
|
|
8
|
+
return function ({ resource, importer }: CheckerArgs): boolean {
|
|
9
|
+
if (
|
|
10
|
+
!context.package.dependencies[resource] &&
|
|
11
|
+
getPeerDependencyMeta({ resource, importer })?.optional
|
|
12
|
+
) {
|
|
13
|
+
log.debug('check-resource', `${JSON.stringify({ resource, importer })} => true`);
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* react-dom/client isn't an explicit dependency, so the peerDependenciesMeta
|
|
19
|
+
* path above can't catch it.
|
|
20
|
+
*/
|
|
21
|
+
if (isManagedReactDomClientDependency({ resource, importer })) {
|
|
22
|
+
try {
|
|
23
|
+
require.resolve(resource);
|
|
24
|
+
} catch {
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return false;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import memoize from 'lodash.memoize';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import { log, readJson } from '../../utils';
|
|
5
|
+
|
|
6
|
+
const containsExternalPackages = /[\\/](node_modules|\.yalc|ignore-plugin-test)([\\/]|$)/;
|
|
7
|
+
const isNodeModules = /(node_modules|\.yalc)/;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Find the nearest package.json for a file path by walking up the directory tree.
|
|
11
|
+
* Only searches paths inside node_modules or .yalc because the ignore plugin only
|
|
12
|
+
* needs to suppress missing optional peer dependencies from third-party packages.
|
|
13
|
+
* ignore-plugin-test is for local integration tests.
|
|
14
|
+
*
|
|
15
|
+
* Memoized to avoid re-walking parent directories on every import resolution.
|
|
16
|
+
*/
|
|
17
|
+
export const getPackageJson = memoize(function getPackageJson(context: string) {
|
|
18
|
+
const fullPath = path.resolve(context);
|
|
19
|
+
if (!containsExternalPackages.test(fullPath)) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
for (let dir = path.dirname(fullPath); dir !== path.dirname(dir); dir = path.dirname(dir)) {
|
|
24
|
+
if (isNodeModules.test(path.basename(dir))) {
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
const packageJsonFile = path.join(dir, 'package.json');
|
|
28
|
+
if (fs.existsSync(packageJsonFile)) {
|
|
29
|
+
log.debug('get-package-json', `${context} => ${packageJsonFile}`);
|
|
30
|
+
return readJson<Record<string, any>>(packageJsonFile);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { getPackageJson } from './get-package-json';
|
|
2
|
+
import type { CheckerArgs } from './types';
|
|
3
|
+
|
|
4
|
+
interface PeerDependencyMeta {
|
|
5
|
+
optional?: boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function getPeerDependencyMeta({
|
|
9
|
+
resource,
|
|
10
|
+
importer,
|
|
11
|
+
}: CheckerArgs): PeerDependencyMeta | undefined {
|
|
12
|
+
return /^[@a-z]/.test(resource)
|
|
13
|
+
? getPackageJson(importer)?.peerDependenciesMeta?.[resource]
|
|
14
|
+
: undefined;
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CheckerArgs } from './types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Matches both published paths (@servicetitan/ko-bridge, @servicetitan/web-components) and
|
|
5
|
+
* in-repo paths (packages/ko-bridge, packages/web-components) so the check works whether the
|
|
6
|
+
* importer is installed from npm/yalc or resolved locally during a uikit-internal build.
|
|
7
|
+
*/
|
|
8
|
+
export function isManagedReactDomClientDependency({ importer, resource }: CheckerArgs) {
|
|
9
|
+
return (
|
|
10
|
+
resource === 'react-dom/client' &&
|
|
11
|
+
/(@servicetitan|packages)\/(ko-bridge|web-components)/.test(importer)
|
|
12
|
+
);
|
|
13
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const bundleConstants = {
|
|
2
|
+
cssModules: {
|
|
3
|
+
classnameTemplate: {
|
|
4
|
+
production: '[local]__[hash:base64:5]',
|
|
5
|
+
development: '[path][name]__[local]',
|
|
6
|
+
},
|
|
7
|
+
localsConvention: 'camelCaseOnly',
|
|
8
|
+
},
|
|
9
|
+
less: {
|
|
10
|
+
math: 'always',
|
|
11
|
+
},
|
|
12
|
+
mode: {
|
|
13
|
+
production: 'production',
|
|
14
|
+
development: 'development',
|
|
15
|
+
},
|
|
16
|
+
} as const;
|