@servicetitan/startup 34.2.1 → 34.3.0-beta.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/dist/cli/commands/build.d.ts +16 -0
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +15 -2
- package/dist/cli/commands/build.js.map +1 -1
- package/dist/cli/commands/bundle-vite.d.ts +66 -0
- package/dist/cli/commands/bundle-vite.d.ts.map +1 -0
- package/dist/cli/commands/bundle-vite.js +184 -0
- package/dist/cli/commands/bundle-vite.js.map +1 -0
- package/dist/cli/commands/get-command.d.ts.map +1 -1
- package/dist/cli/commands/get-command.js +2 -0
- package/dist/cli/commands/get-command.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-package-publish.js.map +1 -1
- package/dist/cli/commands/start.d.ts +8 -0
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +8 -2
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/tasks/swc-compile-package.js +127 -0
- package/dist/cli/tasks/swc-compile-package.js.map +1 -0
- package/dist/cli/tasks/tsc-compile-package.js +46 -0
- package/dist/cli/tasks/tsc-compile-package.js.map +1 -0
- package/dist/cli/tasks/tsc-compile.js +68 -0
- package/dist/cli/tasks/tsc-compile.js.map +1 -0
- package/dist/cli/utils/bundle.d.ts +2 -5
- package/dist/cli/utils/bundle.d.ts.map +1 -1
- package/dist/cli/utils/bundle.js +18 -98
- package/dist/cli/utils/bundle.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/core/check-resource/check-resource.js +40 -0
- package/dist/core/check-resource/check-resource.js.map +1 -0
- package/dist/core/check-resource/get-package-json.d.ts.map +1 -0
- package/dist/core/check-resource/get-package-json.js +37 -0
- 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 +27 -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 +15 -0
- package/dist/core/check-resource/is-optional-react-dom-peer-dependency.js.map +1 -0
- package/dist/core/context.d.ts +14 -0
- package/dist/core/context.d.ts.map +1 -0
- package/dist/core/context.js +62 -0
- package/dist/core/context.js.map +1 -0
- package/dist/core/defines/exposed-dependencies.d.ts +5 -0
- package/dist/core/defines/exposed-dependencies.d.ts.map +1 -0
- package/dist/core/defines/exposed-dependencies.js +26 -0
- package/dist/core/defines/exposed-dependencies.js.map +1 -0
- package/dist/core/defines/exposed-instance-dependencies.d.ts +5 -0
- package/dist/core/defines/exposed-instance-dependencies.d.ts.map +1 -0
- package/dist/core/defines/exposed-instance-dependencies.js +29 -0
- package/dist/core/defines/exposed-instance-dependencies.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/defines/web-component-name.d.ts +5 -0
- package/dist/core/defines/web-component-name.d.ts.map +1 -0
- package/dist/core/defines/web-component-name.js +23 -0
- package/dist/core/defines/web-component-name.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 +29 -0
- package/dist/core/externals.js.map +1 -0
- package/dist/core/get-exposed-dependencies-entry-points.d.ts +11 -0
- package/dist/core/get-exposed-dependencies-entry-points.d.ts.map +1 -0
- package/dist/core/get-exposed-dependencies-entry-points.js +82 -0
- package/dist/core/get-exposed-dependencies-entry-points.js.map +1 -0
- package/dist/core/index.d.ts +9 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +26 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/types.d.ts +55 -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/utils/build-metadata.d.ts.map +1 -0
- package/dist/core/utils/build-metadata.js +50 -0
- package/dist/core/utils/build-metadata.js.map +1 -0
- package/dist/core/utils/generate-metadata.d.ts +3 -0
- package/dist/core/utils/generate-metadata.d.ts.map +1 -0
- package/dist/core/utils/generate-metadata.js +40 -0
- package/dist/core/utils/generate-metadata.js.map +1 -0
- package/dist/core/utils/get-bundle-type.d.ts +3 -0
- package/dist/core/utils/get-bundle-type.d.ts.map +1 -0
- package/dist/core/utils/get-bundle-type.js +27 -0
- package/dist/core/utils/get-bundle-type.js.map +1 -0
- package/dist/core/utils/get-exposed-dependencies.d.ts.map +1 -0
- package/dist/core/utils/get-exposed-dependencies.js +21 -0
- package/dist/core/utils/get-exposed-dependencies.js.map +1 -0
- package/dist/core/utils/get-launchdarkly-sdk-version.d.ts.map +1 -0
- package/dist/core/utils/get-launchdarkly-sdk-version.js +26 -0
- package/dist/core/utils/get-launchdarkly-sdk-version.js.map +1 -0
- package/dist/core/utils/get-output-path.d.ts +3 -0
- package/dist/core/utils/get-output-path.d.ts.map +1 -0
- package/dist/core/utils/get-output-path.js +32 -0
- package/dist/core/utils/get-output-path.js.map +1 -0
- package/dist/core/utils/get-web-components-version.d.ts.map +1 -0
- package/dist/core/utils/get-web-components-version.js +22 -0
- package/dist/core/utils/get-web-components-version.js.map +1 -0
- package/dist/core/utils/index.d.ts +9 -0
- package/dist/core/utils/index.d.ts.map +1 -0
- package/dist/core/utils/index.js +27 -0
- package/dist/core/utils/index.js.map +1 -0
- package/dist/core/utils/stringify-config.d.ts +2 -0
- package/dist/core/utils/stringify-config.d.ts.map +1 -0
- package/dist/core/utils/stringify-config.js +35 -0
- package/dist/core/utils/stringify-config.js.map +1 -0
- package/dist/core/virtual-modules.d.ts +9 -0
- package/dist/core/virtual-modules.d.ts.map +1 -0
- package/dist/core/virtual-modules.js +84 -0
- package/dist/core/virtual-modules.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- 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 -6
- package/dist/storybook-config/webpack-final.js.map +1 -1
- package/dist/utils/get-configuration.d.ts +28 -0
- package/dist/utils/get-configuration.d.ts.map +1 -1
- package/dist/utils/get-configuration.js +42 -1
- 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/vite/base-config.d.ts +4 -0
- package/dist/vite/base-config.d.ts.map +1 -0
- package/dist/vite/base-config.js +65 -0
- package/dist/vite/base-config.js.map +1 -0
- package/dist/vite/build-shared-deps.d.ts +3 -0
- package/dist/vite/build-shared-deps.d.ts.map +1 -0
- package/dist/vite/build-shared-deps.js +310 -0
- package/dist/vite/build-shared-deps.js.map +1 -0
- package/dist/vite/create-vite-config.d.ts +3 -0
- package/dist/vite/create-vite-config.d.ts.map +1 -0
- package/dist/vite/create-vite-config.js +52 -0
- package/dist/vite/create-vite-config.js.map +1 -0
- package/dist/vite/define-config.d.ts +12 -0
- package/dist/vite/define-config.d.ts.map +1 -0
- package/dist/vite/define-config.js +15 -0
- package/dist/vite/define-config.js.map +1 -0
- package/dist/vite/load-config-file.d.ts +6 -0
- package/dist/vite/load-config-file.d.ts.map +1 -0
- package/dist/vite/load-config-file.js +107 -0
- package/dist/vite/load-config-file.js.map +1 -0
- package/dist/vite/merge-config.d.ts +6 -0
- package/dist/vite/merge-config.d.ts.map +1 -0
- package/dist/vite/merge-config.js +106 -0
- package/dist/vite/merge-config.js.map +1 -0
- package/dist/vite/plugins/css-injector-plugin.d.ts +15 -0
- package/dist/vite/plugins/css-injector-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/css-injector-plugin.js +76 -0
- package/dist/vite/plugins/css-injector-plugin.js.map +1 -0
- package/dist/vite/plugins/dev-bundle-routing-plugin.d.ts +7 -0
- package/dist/vite/plugins/dev-bundle-routing-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/dev-bundle-routing-plugin.js +48 -0
- package/dist/vite/plugins/dev-bundle-routing-plugin.js.map +1 -0
- package/dist/vite/plugins/dev-server-routing-plugin.d.ts +12 -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 +39 -0
- package/dist/vite/plugins/externals-plugin.js.map +1 -0
- package/dist/vite/plugins/full-bundle-proxy-plugin.d.ts +14 -0
- package/dist/vite/plugins/full-bundle-proxy-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/full-bundle-proxy-plugin.js +48 -0
- package/dist/vite/plugins/full-bundle-proxy-plugin.js.map +1 -0
- package/dist/vite/plugins/html-plugin.d.ts +5 -0
- package/dist/vite/plugins/html-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/html-plugin.js +74 -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 +86 -0
- package/dist/vite/plugins/metadata-plugin.js.map +1 -0
- package/dist/vite/plugins/outdir-rewrite-plugin.d.ts +9 -0
- package/dist/vite/plugins/outdir-rewrite-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/preview-static-files-plugin.d.ts +9 -0
- package/dist/vite/plugins/preview-static-files-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/preview-static-files-plugin.js +50 -0
- package/dist/vite/plugins/preview-static-files-plugin.js.map +1 -0
- package/dist/vite/plugins/shared-deps-dev-server-plugin.d.ts +11 -0
- package/dist/vite/plugins/shared-deps-dev-server-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/shared-deps-rewrite-plugin.d.ts +10 -0
- package/dist/vite/plugins/shared-deps-rewrite-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/shared-deps-rewrite-plugin.js +51 -0
- package/dist/vite/plugins/shared-deps-rewrite-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 +29 -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 +31 -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 +71 -0
- package/dist/vite/plugins/virtual-modules-plugin.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 +3 -2
- package/dist/webpack/configs/dev-server-config.d.ts.map +1 -1
- package/dist/webpack/configs/dev-server-config.js +1 -1
- 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 +4 -1
- package/dist/webpack/configs/loaders/style-loader.js.map +1 -1
- package/dist/webpack/configs/module-config.d.ts +3 -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 +3 -2
- package/dist/webpack/configs/optimization-config.d.ts.map +1 -1
- package/dist/webpack/configs/optimization-config.js +10 -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 +15 -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 +5 -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/get-package-json.js +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/get-package-json.js.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.d.ts +17 -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 +45 -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 +3 -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 +3 -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 +10 -0
- package/dist/webpack/create-webpack-config.d.ts.map +1 -1
- package/dist/webpack/create-webpack-config.js +109 -41
- package/dist/webpack/create-webpack-config.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/index.d.ts +0 -1
- package/dist/webpack/utils/index.d.ts.map +1 -1
- package/dist/webpack/utils/index.js +0 -1
- package/dist/webpack/utils/index.js.map +1 -1
- package/package.json +13 -10
- package/patches/vite-plugin-css-injected-by-js+3.5.2.patch +63 -0
- package/src/cli/commands/__tests__/mfe-generate-metadata.test.ts +3 -4
- package/src/cli/commands/build.ts +7 -2
- package/src/cli/commands/bundle-vite.ts +112 -0
- package/src/cli/commands/get-command.ts +2 -0
- package/src/cli/commands/mfe-check.ts +1 -2
- package/src/cli/commands/mfe-generate-metadata.ts +1 -1
- package/src/cli/commands/mfe-package-publish.ts +1 -1
- package/src/cli/commands/start.ts +5 -2
- package/src/cli/utils/__tests__/bundle.test.ts +19 -10
- package/src/cli/utils/bundle.ts +20 -101
- 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}/check-resource.ts +4 -4
- package/src/{webpack/configs/plugins/ignore-plugin → core/check-resource}/get-package-json.ts +2 -2
- package/src/core/check-resource/index.ts +1 -0
- package/src/core/context.ts +65 -0
- package/src/core/defines/exposed-dependencies.ts +21 -0
- package/src/core/defines/exposed-instance-dependencies.ts +19 -0
- package/src/core/defines/index.ts +3 -0
- package/src/core/defines/web-component-name.ts +15 -0
- package/src/core/externals.ts +23 -0
- package/src/core/get-exposed-dependencies-entry-points.ts +59 -0
- package/src/core/index.ts +8 -0
- package/src/core/types.ts +59 -0
- package/src/{webpack/configs → core}/utils/__tests__/build-metadata.test.ts +2 -2
- package/src/{webpack/configs → core}/utils/__tests__/generate-metadata.test.ts +27 -13
- package/src/{webpack/configs → core}/utils/build-metadata.ts +1 -1
- package/src/{webpack/configs → core}/utils/generate-metadata.ts +7 -6
- package/src/core/utils/get-bundle-type.ts +20 -0
- package/src/{webpack/configs → core}/utils/get-launchdarkly-sdk-version.ts +1 -1
- package/src/core/utils/get-output-path.ts +18 -0
- package/src/{webpack/configs → core}/utils/get-web-components-version.ts +1 -1
- package/src/core/utils/index.ts +8 -0
- package/src/core/virtual-modules.ts +76 -0
- package/src/index.ts +1 -0
- package/src/storybook-config/__tests__/webpack-final.test.ts +5 -2
- package/src/storybook-config/webpack-final.ts +24 -10
- package/src/utils/__tests__/get-configuration.test.ts +99 -1
- package/src/utils/__tests__/get-package-data.test.ts +35 -1
- package/src/utils/get-configuration.ts +92 -1
- package/src/utils/get-package-data.ts +3 -1
- package/src/vite/__tests__/define-config.test.ts +13 -0
- package/src/vite/__tests__/load-config-file.test.ts +115 -0
- package/src/vite/__tests__/merge-config.test.ts +173 -0
- package/src/vite/base-config.ts +70 -0
- package/src/vite/build-shared-deps.ts +320 -0
- package/src/vite/create-vite-config.ts +50 -0
- package/src/vite/define-config.ts +20 -0
- package/src/vite/index.html +29 -0
- package/src/vite/load-config-file.ts +54 -0
- package/src/vite/merge-config.ts +93 -0
- package/src/vite/plugins/css-injector-plugin.ts +85 -0
- package/src/vite/plugins/dev-server-routing-plugin.ts +89 -0
- package/src/vite/plugins/externals-plugin.ts +27 -0
- package/src/vite/plugins/html-plugin.ts +65 -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 +78 -0
- package/src/vite/plugins/style-urls-plugin.ts +34 -0
- package/src/vite/plugins/svgr-plugin.ts +11 -0
- package/src/vite/plugins/virtual-modules-plugin.ts +74 -0
- package/src/webpack/__tests__/create-webpack-config-shared-dependencies.test.ts +2 -2
- package/src/webpack/__tests__/create-webpack-config-web-component.test.ts +11 -11
- package/src/webpack/__tests__/create-webpack-config.test.ts +3 -2
- 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 +8 -3
- 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 +5 -5
- package/src/webpack/configs/module-config.ts +3 -2
- package/src/webpack/configs/optimization-config.ts +16 -11
- package/src/webpack/configs/output-config.ts +16 -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 +7 -6
- package/src/webpack/configs/plugins/html-tags-plugin.ts +7 -16
- package/src/webpack/configs/plugins/ignore-plugin/empty-module.js +1 -0
- package/src/webpack/configs/plugins/ignore-plugin/ignore-plugin.ts +48 -6
- package/src/webpack/configs/plugins/mini-css-extract-plugin.ts +10 -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 +13 -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 +9 -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 +88 -43
- package/src/webpack/types.ts +7 -11
- package/src/webpack/utils/index.ts +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/get-package-json.d.ts.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-react-dom-peer-dependency.d.ts.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/utils/build-metadata.d.ts.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/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-exposed-dependencies.d.ts.map +0 -1
- package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.d.ts.map +0 -1
- package/dist/webpack/configs/utils/get-web-components-version.d.ts.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/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}/get-package-json.d.ts +0 -0
- /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-react-dom-peer-dependency.d.ts +0 -0
- /package/dist/{webpack/configs → core}/utils/build-metadata.d.ts +0 -0
- /package/dist/{webpack/configs → core}/utils/get-exposed-dependencies.d.ts +0 -0
- /package/dist/{webpack/configs → core}/utils/get-launchdarkly-sdk-version.d.ts +0 -0
- /package/dist/{webpack/configs → core}/utils/get-web-components-version.d.ts +0 -0
- /package/src/{webpack/configs/plugins/ignore-plugin → core/check-resource}/__tests__/get-package-json.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 → core}/utils/__tests__/get-exposed-dependencies.test.ts +0 -0
- /package/src/{webpack/configs → core}/utils/__tests__/get-launchdarkly-sdk-version.test.ts +0 -0
- /package/src/{webpack/configs → core}/utils/__tests__/get-web-components-version.test.ts +0 -0
- /package/src/{webpack/configs → core}/utils/get-exposed-dependencies.ts +0 -0
- /package/src/{webpack → core}/utils/stringify-config.ts +0 -0
|
@@ -6,7 +6,7 @@ import { DefinePlugin } from 'webpack';
|
|
|
6
6
|
import { WebpackAssetsManifest } from 'webpack-assets-manifest';
|
|
7
7
|
import VirtualModulesPlugin from 'webpack-virtual-modules';
|
|
8
8
|
import yargs from 'yargs';
|
|
9
|
-
import {
|
|
9
|
+
import { generateMetadata } from '../../core';
|
|
10
10
|
import {
|
|
11
11
|
getFolders,
|
|
12
12
|
getPackageData,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
isWebComponent,
|
|
17
17
|
} from '../../utils';
|
|
18
18
|
import { miniCssPluginStyleRules } from '../__mocks__';
|
|
19
|
-
import {
|
|
19
|
+
import { webpackDevConfigFileName, webpackProdConfigFileName } from '../create-webpack-config';
|
|
20
20
|
import { createWebpackConfig } from '../index';
|
|
21
21
|
import { getCallerFile, splitByEntry } from '../utils';
|
|
22
22
|
|
|
@@ -42,7 +42,7 @@ jest.mock('../../utils', () => ({
|
|
|
42
42
|
isLegacyRoot: jest.fn(),
|
|
43
43
|
isWebComponent: jest.fn(),
|
|
44
44
|
}));
|
|
45
|
-
jest.mock('
|
|
45
|
+
jest.mock('../../core/utils/generate-metadata');
|
|
46
46
|
jest.mock('../utils', () => ({
|
|
47
47
|
...jest.requireActual('../utils'),
|
|
48
48
|
getCallerFile: jest.fn(),
|
|
@@ -64,15 +64,15 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
64
64
|
|
|
65
65
|
const indexPath = () => path.join(process.cwd(), `${destination}/index`);
|
|
66
66
|
const indexCode = ({
|
|
67
|
-
|
|
67
|
+
light = false,
|
|
68
68
|
legacyRoot = false,
|
|
69
69
|
designSystem,
|
|
70
|
-
}: {
|
|
70
|
+
}: { light?: boolean; legacyRoot?: boolean; designSystem?: boolean } = {}) =>
|
|
71
71
|
[
|
|
72
72
|
...(designSystem ? [`require('./design-system.css');`] : []),
|
|
73
73
|
`import { register } from '@servicetitan/web-components';`,
|
|
74
74
|
`import { App } from './app';`,
|
|
75
|
-
`register(App, ${
|
|
75
|
+
`register(App, ${light}, { legacyRoot: ${legacyRoot}, sharedDependenciesNames: ${JSON.stringify(Object.keys(sharedDependencies))} });`,
|
|
76
76
|
].join('\n');
|
|
77
77
|
|
|
78
78
|
let overrides: Parameters<typeof createWebpackConfig>[0];
|
|
@@ -331,13 +331,13 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
331
331
|
});
|
|
332
332
|
});
|
|
333
333
|
|
|
334
|
-
describe('when
|
|
335
|
-
beforeEach(() => (options.
|
|
334
|
+
describe('when light option is set to true', () => {
|
|
335
|
+
beforeEach(() => (options.light = true));
|
|
336
336
|
|
|
337
|
-
test(`omits design system and registers App with
|
|
337
|
+
test(`omits design system and registers App with light set to true`, () => {
|
|
338
338
|
expect(subject().plugins).toContainEqual(
|
|
339
339
|
new VirtualModulesPlugin({
|
|
340
|
-
[indexPath()]: indexCode({ designSystem: false,
|
|
340
|
+
[indexPath()]: indexCode({ designSystem: false, light: true }),
|
|
341
341
|
})
|
|
342
342
|
);
|
|
343
343
|
});
|
|
@@ -366,7 +366,7 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
366
366
|
expect(subject().plugins).toContainEqual(
|
|
367
367
|
new VirtualModulesPlugin({
|
|
368
368
|
[designSystemPath()]: designSystemCode,
|
|
369
|
-
[indexPath()]: indexCode({ designSystem: true,
|
|
369
|
+
[indexPath()]: indexCode({ designSystem: true, light: true }),
|
|
370
370
|
})
|
|
371
371
|
);
|
|
372
372
|
});
|
|
@@ -108,6 +108,7 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
108
108
|
argv = {};
|
|
109
109
|
packages = [];
|
|
110
110
|
overrides = {
|
|
111
|
+
configuration: { mode: 'development' },
|
|
111
112
|
plugins: {
|
|
112
113
|
HtmlWebpackPlugin: { favicon: 'foo' },
|
|
113
114
|
MiniCssExtractPlugin: { attributes: { foo: 'bar' } },
|
|
@@ -526,8 +527,8 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
526
527
|
);
|
|
527
528
|
});
|
|
528
529
|
|
|
529
|
-
describe('when
|
|
530
|
-
beforeEach(() => setOptions({
|
|
530
|
+
describe('when light option is set to true', () => {
|
|
531
|
+
beforeEach(() => setOptions({ light: true }));
|
|
531
532
|
|
|
532
533
|
test('adds "light" to reportFilename and reportTitle', () => {
|
|
533
534
|
expect(subject().plugins).toContainEqual(
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Configuration } from 'webpack';
|
|
2
|
-
import {
|
|
2
|
+
import { BuildContext } from '../../core';
|
|
3
|
+
import { Overrides } from '../types';
|
|
3
4
|
|
|
4
5
|
type Result = Pick<Configuration, 'amd'>;
|
|
5
6
|
|
|
6
|
-
export function amdConfig(_context:
|
|
7
|
+
export function amdConfig(_context: BuildContext, _: Overrides): Result {
|
|
7
8
|
return { amd: false };
|
|
8
9
|
}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import { Configuration } from 'webpack';
|
|
4
|
+
import { BuildContext } from '../../core';
|
|
4
5
|
import { findUp } from '../../utils';
|
|
5
|
-
import {
|
|
6
|
+
import { Overrides } from '../types';
|
|
6
7
|
|
|
7
8
|
type Config = Configuration['cache'];
|
|
8
9
|
type Result = Pick<Configuration, 'cache' | 'infrastructureLogging'> | undefined;
|
|
9
10
|
|
|
10
11
|
const CACHE_VERSION = '1';
|
|
11
12
|
|
|
12
|
-
export function cacheConfig(context:
|
|
13
|
-
const { emitExposedDependencies } = context;
|
|
13
|
+
export function cacheConfig(context: BuildContext, _overrides: Overrides): Result {
|
|
14
|
+
const { emitExposedDependencies } = context.options.bundlerConfig;
|
|
14
15
|
if (!emitExposedDependencies) {
|
|
15
16
|
return;
|
|
16
17
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import { Configuration } from 'webpack';
|
|
4
|
+
import { BuildContext } from '../../core';
|
|
4
5
|
import {
|
|
5
6
|
allowedWebpackDevServerOptions,
|
|
6
7
|
getWebpackConfiguration,
|
|
@@ -8,14 +9,18 @@ import {
|
|
|
8
9
|
log,
|
|
9
10
|
pick,
|
|
10
11
|
} from '../../utils';
|
|
12
|
+
import { Overrides } from '../types';
|
|
11
13
|
import { statsConfig } from './stats-config';
|
|
12
|
-
import { Context, Overrides } from './types';
|
|
13
14
|
|
|
14
15
|
type DevServerConfig = NonNullable<Configuration['devServer']>;
|
|
15
16
|
type Result = Pick<Configuration, 'devServer'> | undefined;
|
|
16
17
|
|
|
17
|
-
export function devServerConfig(context:
|
|
18
|
-
if (
|
|
18
|
+
export function devServerConfig(context: BuildContext, overrides: Overrides): Result {
|
|
19
|
+
if (
|
|
20
|
+
context.build.isProduction ||
|
|
21
|
+
context.options.bundlerConfig.emitExposedDependencies ||
|
|
22
|
+
isDevServerDisabled()
|
|
23
|
+
) {
|
|
19
24
|
return;
|
|
20
25
|
}
|
|
21
26
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Configuration } from 'webpack';
|
|
2
|
-
import {
|
|
2
|
+
import { BuildContext } from '../../core';
|
|
3
|
+
import { Overrides } from '../types';
|
|
3
4
|
|
|
4
5
|
type Config = Configuration['devtool'];
|
|
5
6
|
type Result = Pick<Configuration, 'devtool'>;
|
|
6
7
|
|
|
7
|
-
export function devtoolConfig(context:
|
|
8
|
-
const { isProduction } = context;
|
|
8
|
+
export function devtoolConfig(context: BuildContext, _: Overrides): Result {
|
|
9
|
+
const { isProduction } = context.build;
|
|
9
10
|
let devtool: Config;
|
|
10
11
|
|
|
11
12
|
if (isProduction) {
|
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import { Configuration } from 'webpack';
|
|
3
|
+
import { BuildContext, getDesignSystemPath } from '../../core';
|
|
4
|
+
import { Overrides } from '../types';
|
|
3
5
|
import { getModuleEntryPath } from '../utils';
|
|
4
|
-
import { getDesignSystemPath } from './plugins';
|
|
5
|
-
import { Context, Overrides } from './types';
|
|
6
6
|
|
|
7
7
|
type Config = Configuration['entry'];
|
|
8
8
|
type Result = Pick<Configuration, 'entry'>;
|
|
9
9
|
|
|
10
|
-
export function entryConfig(context:
|
|
11
|
-
const entry: Config = context.emitExposedDependencies
|
|
10
|
+
export function entryConfig(context: BuildContext, _: Overrides): Result {
|
|
11
|
+
const entry: Config = context.options.bundlerConfig.emitExposedDependencies
|
|
12
12
|
? getSharedEntryPoints(context)
|
|
13
13
|
: getIndexEntryPoint(context);
|
|
14
14
|
|
|
15
15
|
return { entry };
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
function getIndexEntryPoint(
|
|
18
|
+
function getIndexEntryPoint(context: BuildContext): Config {
|
|
19
|
+
const { source, destination } = context.package;
|
|
19
20
|
const index = fs.existsSync(`./${source}/index.js`)
|
|
20
21
|
? `./${source}/index`
|
|
21
22
|
: `./${destination}/index`;
|
|
22
23
|
return { main: [index] };
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
function getSharedEntryPoints(context:
|
|
26
|
-
const { sharedDependencies } = context;
|
|
26
|
+
function getSharedEntryPoints(context: BuildContext): Config {
|
|
27
|
+
const { sharedDependencies } = context.package;
|
|
27
28
|
return {
|
|
28
29
|
shared: Object.keys(sharedDependencies).map(getModuleEntryPath),
|
|
29
30
|
...(sharedDependencies['@servicetitan/design-system']
|
|
@@ -1,26 +1,10 @@
|
|
|
1
1
|
import { Configuration } from 'webpack';
|
|
2
|
-
import {
|
|
2
|
+
import { BuildContext, getExternalsMapping } from '../../core';
|
|
3
|
+
import { Overrides } from '../types';
|
|
3
4
|
|
|
4
|
-
type Config = Configuration['externals'];
|
|
5
5
|
type Result = Pick<Configuration, 'externals'> | undefined;
|
|
6
6
|
|
|
7
|
-
export function externalsConfig(context:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const { sharedDependencies } = context;
|
|
13
|
-
const name = context.name || context.packageData.name;
|
|
14
|
-
const externals: Config = Object.fromEntries(
|
|
15
|
-
Object.entries(sharedDependencies).map(([dependency, variable]) => [
|
|
16
|
-
dependency,
|
|
17
|
-
`${variable}['${name}']`,
|
|
18
|
-
])
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
return { externals };
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function needsExternals({ embed, emitExposedDependencies, isExposeSharedDependencies }: Context) {
|
|
25
|
-
return !!embed || (isExposeSharedDependencies && !emitExposedDependencies);
|
|
7
|
+
export function externalsConfig(context: BuildContext, _: Overrides): Result {
|
|
8
|
+
const externals = getExternalsMapping(context);
|
|
9
|
+
return externals ? { externals } : undefined;
|
|
26
10
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BuildContext } from '../../../core';
|
|
2
2
|
import { LoaderOptions } from './types';
|
|
3
3
|
|
|
4
|
-
export function cssLoader(
|
|
4
|
+
export function cssLoader(context: BuildContext, { esModule }: LoaderOptions = {}) {
|
|
5
|
+
const { isProduction } = context.build;
|
|
5
6
|
const loader = 'css-loader';
|
|
6
7
|
return esModule
|
|
7
8
|
? {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
|
2
|
-
import {
|
|
2
|
+
import { BuildContext } from '../../../core';
|
|
3
3
|
import { LoaderOptions } from './types';
|
|
4
4
|
|
|
5
|
-
export function styleLoader(
|
|
6
|
-
{ isProduction
|
|
7
|
-
{
|
|
8
|
-
|
|
5
|
+
export function styleLoader(context: BuildContext, { esModule }: LoaderOptions = {}) {
|
|
6
|
+
const { isProduction } = context.build;
|
|
7
|
+
const { isWebComponent } = context.package;
|
|
8
|
+
const { emitExposedDependencies } = context.options.bundlerConfig;
|
|
9
9
|
const loader =
|
|
10
10
|
isProduction || isWebComponent || emitExposedDependencies
|
|
11
11
|
? MiniCssExtractPlugin.loader
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Configuration } from 'webpack';
|
|
2
|
+
import { BuildContext } from '../../core';
|
|
3
|
+
import { Overrides } from '../types';
|
|
2
4
|
import { rulesConfig } from './rules-config';
|
|
3
|
-
import { Context, Overrides } from './types';
|
|
4
5
|
|
|
5
6
|
type Config = Configuration['module'];
|
|
6
7
|
type Result = Pick<Configuration, 'module'>;
|
|
7
8
|
|
|
8
|
-
export function moduleConfig(context:
|
|
9
|
+
export function moduleConfig(context: BuildContext, overrides: Overrides): Result {
|
|
9
10
|
const module: Config = { ...rulesConfig(context, overrides) };
|
|
10
11
|
|
|
11
12
|
return { module };
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import CssMinimizerWebpackPlugin from 'css-minimizer-webpack-plugin';
|
|
2
2
|
import TerserPlugin from 'terser-webpack-plugin';
|
|
3
3
|
import { Configuration } from 'webpack';
|
|
4
|
-
import {
|
|
4
|
+
import { BuildContext } from '../../core';
|
|
5
|
+
import { Overrides } from '../types';
|
|
5
6
|
|
|
6
7
|
type Config = Configuration['optimization'];
|
|
7
8
|
type ConfigWithCacheGroups = Config & { splitChunks: { cacheGroups: Record<string, any> } };
|
|
8
9
|
type Result = Pick<Configuration, 'optimization'>;
|
|
9
10
|
|
|
10
|
-
export function optimizationConfig(context:
|
|
11
|
-
const {
|
|
11
|
+
export function optimizationConfig(context: BuildContext, _: Overrides): Result {
|
|
12
|
+
const { headless, isProduction } = context.build;
|
|
13
|
+
const { emitExposedDependencies } = context.options.bundlerConfig;
|
|
12
14
|
|
|
13
15
|
const optimization: ConfigWithCacheGroups = {
|
|
14
16
|
chunkIds: isProduction ? 'deterministic' : 'named',
|
|
@@ -30,14 +32,16 @@ export function optimizationConfig(context: Context, _: Overrides): Result {
|
|
|
30
32
|
return { optimization };
|
|
31
33
|
}
|
|
32
34
|
|
|
33
|
-
function minimizeConfig(optimization: ConfigWithCacheGroups, context:
|
|
34
|
-
const { isProduction
|
|
35
|
+
function minimizeConfig(optimization: ConfigWithCacheGroups, context: BuildContext) {
|
|
36
|
+
const { isProduction } = context.build;
|
|
37
|
+
const { codeCoverage } = context.options;
|
|
38
|
+
const { minify } = context.options.bundlerConfig;
|
|
35
39
|
if (!isProduction) {
|
|
36
40
|
return;
|
|
37
41
|
}
|
|
38
42
|
|
|
39
|
-
const minifyJs =
|
|
40
|
-
const minifyCss =
|
|
43
|
+
const minifyJs = minify?.js ?? true;
|
|
44
|
+
const minifyCss = minify?.css ?? true;
|
|
41
45
|
optimization.minimize = !codeCoverage && (!!minifyJs || !!minifyCss);
|
|
42
46
|
if (!optimization.minimize) {
|
|
43
47
|
return;
|
|
@@ -59,8 +63,8 @@ function minimizeConfig(optimization: ConfigWithCacheGroups, context: Context) {
|
|
|
59
63
|
];
|
|
60
64
|
}
|
|
61
65
|
|
|
62
|
-
function sharedDependenciesConfig(optimization: ConfigWithCacheGroups, context:
|
|
63
|
-
const { emitExposedDependencies } = context;
|
|
66
|
+
function sharedDependenciesConfig(optimization: ConfigWithCacheGroups, context: BuildContext) {
|
|
67
|
+
const { emitExposedDependencies } = context.options.bundlerConfig;
|
|
64
68
|
if (!emitExposedDependencies) {
|
|
65
69
|
return;
|
|
66
70
|
}
|
|
@@ -75,8 +79,9 @@ function sharedDependenciesConfig(optimization: ConfigWithCacheGroups, context:
|
|
|
75
79
|
});
|
|
76
80
|
}
|
|
77
81
|
|
|
78
|
-
function webComponentConfig(optimization: ConfigWithCacheGroups, context:
|
|
79
|
-
const { headless,
|
|
82
|
+
function webComponentConfig(optimization: ConfigWithCacheGroups, context: BuildContext) {
|
|
83
|
+
const { headless, isProduction } = context.build;
|
|
84
|
+
const { isWebComponent } = context.package;
|
|
80
85
|
if (!isWebComponent || headless) {
|
|
81
86
|
return;
|
|
82
87
|
}
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import path from 'path';
|
|
2
1
|
import { Configuration } from 'webpack';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { BuildContext, getBundleType, getOutputPath } from '../../core';
|
|
3
|
+
import { Overrides } from '../types';
|
|
5
4
|
|
|
6
5
|
type Config = Configuration['output'];
|
|
7
6
|
type Result = Pick<Configuration, 'output'>;
|
|
8
7
|
|
|
9
|
-
export function outputConfig(context:
|
|
10
|
-
const {
|
|
8
|
+
export function outputConfig(context: BuildContext, _: Overrides): Result {
|
|
9
|
+
const { name, isProduction } = context.build;
|
|
10
|
+
const { isWebComponent } = context.package;
|
|
11
|
+
const { emitExposedDependencies } = context.options.bundlerConfig;
|
|
11
12
|
|
|
12
13
|
const output: Config = {
|
|
13
14
|
filename: '[name].bundle.js',
|
|
14
15
|
path: getOutputPath(context),
|
|
15
16
|
clean: getClean(context),
|
|
17
|
+
// TODO: ask Dexter about chunkLoadingGlobal and whether it's expected that we pass empty name here
|
|
16
18
|
...(emitExposedDependencies ? { chunkLoadingGlobal: `sharedChunk${name}` } : {}),
|
|
17
19
|
};
|
|
18
20
|
|
|
@@ -28,25 +30,17 @@ export function outputConfig(context: Context, _: Overrides): Result {
|
|
|
28
30
|
return { output };
|
|
29
31
|
}
|
|
30
32
|
|
|
31
|
-
function getClean(context:
|
|
32
|
-
const { emitExposedDependencies } = context;
|
|
33
|
+
function getClean(context: BuildContext): NonNullable<Config>['clean'] {
|
|
34
|
+
const { emitExposedDependencies } = context.options.bundlerConfig;
|
|
33
35
|
if (emitExposedDependencies) {
|
|
34
36
|
return true;
|
|
35
37
|
}
|
|
36
|
-
const exposedDependenciesDir = getBundleType({
|
|
38
|
+
const exposedDependenciesDir = getBundleType({
|
|
39
|
+
...context,
|
|
40
|
+
options: {
|
|
41
|
+
...context.options,
|
|
42
|
+
bundlerConfig: { ...context.options.bundlerConfig, emitExposedDependencies: true },
|
|
43
|
+
},
|
|
44
|
+
});
|
|
37
45
|
return exposedDependenciesDir ? { keep: new RegExp(exposedDependenciesDir) } : true;
|
|
38
46
|
}
|
|
39
|
-
|
|
40
|
-
function getOutputPath(context: Context) {
|
|
41
|
-
const { destination, emitExposedDependencies } = context;
|
|
42
|
-
|
|
43
|
-
const subdir = getBundleType(context) ?? '';
|
|
44
|
-
if (typeof emitExposedDependencies === 'object') {
|
|
45
|
-
const { output } = emitExposedDependencies;
|
|
46
|
-
if (output?.path) {
|
|
47
|
-
return path.join(output.path, subdir);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return path.join(process.cwd(), destination, 'bundle', subdir);
|
|
52
|
-
}
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
1
|
import { WebpackAssetsManifest } from 'webpack-assets-manifest';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { generateMetadata } from '../utils';
|
|
7
|
-
|
|
8
|
-
interface Metadata {
|
|
9
|
-
entryPointsPath: string;
|
|
10
|
-
}
|
|
2
|
+
import { BuildContext, generateExposedDependenciesMetadata, generateMetadata } from '../../../core';
|
|
3
|
+
import { Overrides } from '../../types';
|
|
11
4
|
|
|
12
5
|
interface EntryPoints {
|
|
13
6
|
css: string[];
|
|
14
7
|
js: string[];
|
|
15
8
|
}
|
|
16
9
|
|
|
17
|
-
export function assetsManifestPlugin(context:
|
|
18
|
-
|
|
10
|
+
export function assetsManifestPlugin(context: BuildContext, _: Overrides) {
|
|
11
|
+
const { isWebComponent } = context.package;
|
|
12
|
+
const { emitExposedDependencies } = context.options.bundlerConfig;
|
|
13
|
+
|
|
14
|
+
if (!(isWebComponent || emitExposedDependencies)) {
|
|
19
15
|
return;
|
|
20
16
|
}
|
|
21
17
|
|
|
@@ -38,8 +34,8 @@ export function assetsManifestPlugin(context: Context, _: Overrides) {
|
|
|
38
34
|
},
|
|
39
35
|
// eslint-disable-next-line @typescript-eslint/require-await
|
|
40
36
|
done: async (manifest: WebpackAssetsManifest) => {
|
|
41
|
-
if (
|
|
42
|
-
generateExposedDependenciesMetadata(context, manifest);
|
|
37
|
+
if (emitExposedDependencies) {
|
|
38
|
+
generateExposedDependenciesMetadata(context, () => manifest.getOutputPath());
|
|
43
39
|
} else {
|
|
44
40
|
generateMetadata(context);
|
|
45
41
|
}
|
|
@@ -53,26 +49,3 @@ function ensureDesignSystemCssIsFirst(cssAssets: string[]) {
|
|
|
53
49
|
? [cssAssets[offset], ...cssAssets.filter((_, index) => index !== offset)]
|
|
54
50
|
: cssAssets;
|
|
55
51
|
}
|
|
56
|
-
|
|
57
|
-
export function getExposedDependenciesEntryPoints(context: Context) {
|
|
58
|
-
const metadataPath = getExposedDependenciesMetadataPath(context);
|
|
59
|
-
const metadata = readJsonSafe<Metadata>(metadataPath);
|
|
60
|
-
if (metadata?.entryPointsPath) {
|
|
61
|
-
return readJsonSafe<EntryPoints>(metadata.entryPointsPath);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function generateExposedDependenciesMetadata(context: Context, manifest: WebpackAssetsManifest) {
|
|
66
|
-
const { destination } = context;
|
|
67
|
-
if (!fs.existsSync(destination)) {
|
|
68
|
-
fs.mkdirSync(destination, { recursive: true });
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const metadataPath = getExposedDependenciesMetadataPath(context);
|
|
72
|
-
const metadata: Metadata = { entryPointsPath: manifest.getOutputPath() };
|
|
73
|
-
fs.writeFileSync(metadataPath, JSON.stringify(metadata, null, 2), 'utf-8');
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function getExposedDependenciesMetadataPath({ destination }: Context) {
|
|
77
|
-
return path.join(destination, 'exposed-dependencies-metadata.json');
|
|
78
|
-
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import os from 'os';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { BuildContext, getBundleType } from '../../../core';
|
|
4
|
+
import { Overrides } from '../../types';
|
|
5
5
|
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
|
6
6
|
|
|
7
|
-
export function bundleAnalyzerPlugin(context:
|
|
8
|
-
if (!context.buildStat) {
|
|
7
|
+
export function bundleAnalyzerPlugin(context: BuildContext, _: Overrides) {
|
|
8
|
+
if (!context.options.buildStat) {
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
11
|
|
|
@@ -16,14 +16,14 @@ export function bundleAnalyzerPlugin(context: Context, _: Overrides) {
|
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
function getReportFileName(context:
|
|
19
|
+
function getReportFileName(context: BuildContext) {
|
|
20
20
|
const type = getBundleType(context);
|
|
21
21
|
const qualifier = type ? `-${type}` : '';
|
|
22
|
-
return `${context.
|
|
22
|
+
return `${context.package.name}${qualifier}-bundle-${Date.now()}.html`;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
function getReportTitle(context:
|
|
26
|
-
const unscopedName = context.
|
|
25
|
+
function getReportTitle(context: BuildContext) {
|
|
26
|
+
const unscopedName = context.package.name.replace(/^@[^/]+\//, '');
|
|
27
27
|
const type = getBundleType(context);
|
|
28
28
|
const qualifier = type ? ` (${type})` : '';
|
|
29
29
|
return `${unscopedName}${qualifier} ${formatDate(new Date())}`;
|
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
import { DefinePlugin } from 'webpack';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { getExposedDependencies } from '../utils';
|
|
2
|
+
import { BuildContext, defineExposedDependencies } from '../../../core';
|
|
3
|
+
import { Overrides } from '../../types';
|
|
5
4
|
|
|
6
|
-
export function defineExposedDependenciesPlugin(context:
|
|
7
|
-
const
|
|
8
|
-
|
|
5
|
+
export function defineExposedDependenciesPlugin(context: BuildContext, _: Overrides) {
|
|
6
|
+
const definition = defineExposedDependencies(context);
|
|
7
|
+
|
|
8
|
+
if (!definition) {
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
const exposedDependencies = getExposedDependencies(sharedDependencies, dependency =>
|
|
14
|
-
getPackageDependencyVersion(dependency, packageData.dependencies?.[dependency])
|
|
15
|
-
);
|
|
16
|
-
|
|
17
|
-
return new DefinePlugin({
|
|
18
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
19
|
-
EXPOSED_DEPENDENCIES: JSON.stringify(exposedDependencies),
|
|
20
|
-
});
|
|
12
|
+
return new DefinePlugin(definition);
|
|
21
13
|
}
|
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
import { DefinePlugin } from 'webpack';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { BuildContext, defineExposedInstanceDependencies } from '../../../core';
|
|
3
|
+
import { Overrides } from '../../types';
|
|
4
4
|
|
|
5
|
-
export function defineExposedInstanceDependenciesPlugin(context:
|
|
6
|
-
const
|
|
7
|
-
|
|
5
|
+
export function defineExposedInstanceDependenciesPlugin(context: BuildContext, _: Overrides) {
|
|
6
|
+
const definition = defineExposedInstanceDependencies(context);
|
|
7
|
+
|
|
8
|
+
if (!definition) {
|
|
8
9
|
return;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
launchDarkly: { version: getLaunchDarklySdkVersion() },
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
return new DefinePlugin({
|
|
16
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
17
|
-
EXPOSED_INSTANCE_DEPENDENCIES: JSON.stringify(instanceDependencies),
|
|
18
|
-
});
|
|
12
|
+
return new DefinePlugin(definition);
|
|
19
13
|
}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { DefinePlugin } from 'webpack';
|
|
2
|
-
import {
|
|
2
|
+
import { BuildContext, defineWebComponentName } from '../../../core';
|
|
3
|
+
import { Overrides } from '../../types';
|
|
3
4
|
|
|
4
|
-
export function defineWebComponentNamePlugin(context:
|
|
5
|
-
const
|
|
6
|
-
|
|
5
|
+
export function defineWebComponentNamePlugin(context: BuildContext, _: Overrides) {
|
|
6
|
+
const definition = defineWebComponentName(context);
|
|
7
|
+
|
|
8
|
+
if (!definition) {
|
|
7
9
|
return;
|
|
8
10
|
}
|
|
9
11
|
|
|
10
|
-
return new DefinePlugin(
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
12
|
-
WEB_COMPONENT_NAME: JSON.stringify(name),
|
|
13
|
-
});
|
|
12
|
+
return new DefinePlugin(definition);
|
|
14
13
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
const FilterWarningsPlugin = require('webpack-filter-warnings-plugin');
|
|
2
|
-
import {
|
|
2
|
+
import { BuildContext } from '../../../core';
|
|
3
|
+
import { Overrides } from '../../types';
|
|
3
4
|
|
|
4
|
-
export function filterWarningsPlugin(
|
|
5
|
-
if (
|
|
5
|
+
export function filterWarningsPlugin(context: BuildContext, _: Overrides) {
|
|
6
|
+
if (context.build.light) {
|
|
6
7
|
return;
|
|
7
8
|
}
|
|
8
9
|
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import deepmerge from 'deepmerge';
|
|
2
2
|
import HtmlWebpackPlugin, { Options as HtmlWebpackPluginOptions } from 'html-webpack-plugin';
|
|
3
|
+
import { BuildContext } from '../../../core';
|
|
4
|
+
import { Overrides } from '../../types';
|
|
3
5
|
import { splitByEntry } from '../../utils';
|
|
4
|
-
import { Context, Overrides } from '../types';
|
|
5
6
|
|
|
6
|
-
export function htmlPlugin(
|
|
7
|
-
{
|
|
8
|
-
{
|
|
9
|
-
|
|
7
|
+
export function htmlPlugin(context: BuildContext, { plugins }: Overrides) {
|
|
8
|
+
const { light, headless, name } = context.build;
|
|
9
|
+
const { isWebComponent } = context.package;
|
|
10
|
+
const { emitExposedDependencies } = context.options.bundlerConfig;
|
|
10
11
|
const { HtmlWebpackPlugin: htmlWebpackPluginOptions = {} } = plugins ?? {};
|
|
11
12
|
|
|
12
|
-
if (
|
|
13
|
+
if (light || headless || emitExposedDependencies) {
|
|
13
14
|
return;
|
|
14
15
|
}
|
|
15
16
|
|