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