@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Context } from '../../../types';
|
|
2
2
|
import { checkResource } from '../check-resource';
|
|
3
3
|
import { isOptionalPeerDependency } from '../is-optional-peer-dependency';
|
|
4
4
|
import { isOptionalReactDomPeerDependency } from '../is-optional-react-dom-peer-dependency';
|
|
@@ -8,7 +8,7 @@ jest.mock('../is-optional-react-dom-peer-dependency');
|
|
|
8
8
|
|
|
9
9
|
describe(`${checkResource.name}`, () => {
|
|
10
10
|
const context = 'node_modules/web-components/dist';
|
|
11
|
-
let packageContext:
|
|
11
|
+
let packageContext: Partial<Context>;
|
|
12
12
|
let resource: string;
|
|
13
13
|
|
|
14
14
|
beforeEach(() => {
|
|
@@ -16,28 +16,15 @@ describe(`${checkResource.name}`, () => {
|
|
|
16
16
|
|
|
17
17
|
resource = '@servicetitan/foo';
|
|
18
18
|
packageContext = {
|
|
19
|
-
|
|
20
|
-
name: 'application',
|
|
21
|
-
isProduction: false,
|
|
22
|
-
},
|
|
23
|
-
package: {
|
|
19
|
+
packageData: {
|
|
24
20
|
name: 'application',
|
|
25
21
|
version: '1.0.0',
|
|
26
|
-
destination: 'dist',
|
|
27
|
-
source: 'src',
|
|
28
22
|
dependencies: {},
|
|
29
|
-
sharedDependencies: {},
|
|
30
|
-
isWebComponent: false,
|
|
31
|
-
isLegacyRoot: false,
|
|
32
|
-
isExposeSharedDependencies: false,
|
|
33
|
-
},
|
|
34
|
-
options: {
|
|
35
|
-
bundlerConfig: {},
|
|
36
23
|
},
|
|
37
24
|
};
|
|
38
25
|
});
|
|
39
26
|
|
|
40
|
-
const subject = () => checkResource(packageContext)(resource, context);
|
|
27
|
+
const subject = () => checkResource(packageContext as any)(resource, context);
|
|
41
28
|
|
|
42
29
|
function itReturns(value: boolean) {
|
|
43
30
|
test(`returns ${value}`, () => expect(subject()).toBe(value));
|
|
@@ -51,7 +38,7 @@ describe(`${checkResource.name}`, () => {
|
|
|
51
38
|
itReturns(true);
|
|
52
39
|
|
|
53
40
|
describe('when resource is package dependency', () => {
|
|
54
|
-
beforeEach(() => (packageContext.
|
|
41
|
+
beforeEach(() => (packageContext.packageData!.dependencies[resource] = '*'));
|
|
55
42
|
|
|
56
43
|
itReturns(false);
|
|
57
44
|
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { log } from '
|
|
2
|
-
import {
|
|
1
|
+
import { log } from '../../../../utils';
|
|
2
|
+
import { Context } from '../../types';
|
|
3
3
|
import { isOptionalPeerDependency } from './is-optional-peer-dependency';
|
|
4
4
|
import { isOptionalReactDomPeerDependency } from './is-optional-react-dom-peer-dependency';
|
|
5
5
|
|
|
6
|
-
export function checkResource(packageContext:
|
|
6
|
+
export function checkResource(packageContext: Context) {
|
|
7
7
|
return function (resource: string, context: string) {
|
|
8
8
|
if (
|
|
9
|
-
!packageContext.
|
|
9
|
+
!packageContext.packageData.dependencies[resource] &&
|
|
10
10
|
isOptionalPeerDependency(resource, context)
|
|
11
11
|
) {
|
|
12
12
|
log.debug('check-resource', `${JSON.stringify({ resource, context })} => true`);
|
package/src/{core/check-resource → webpack/configs/plugins/ignore-plugin}/get-package-json.ts
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
import { log, readJson } from '
|
|
3
|
+
import { log, readJson } from '../../../../utils';
|
|
4
4
|
|
|
5
|
-
const containsNodeModules = /[\\/](node_modules|\.yalc
|
|
5
|
+
const containsNodeModules = /[\\/](node_modules|\.yalc)[\\/]/;
|
|
6
6
|
const isNodeModules = /(node_modules|\.yalc)/;
|
|
7
7
|
|
|
8
8
|
export function getPackageJson(context: string) {
|
|
@@ -1,55 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { IgnorePlugin } from 'webpack';
|
|
2
|
+
import { Context, Overrides } from '../../types';
|
|
3
|
+
import { checkResource } from './check-resource';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
* TODO: backward compatibility
|
|
7
|
-
* TODO: rename things
|
|
8
|
-
* Custom plugin to replace optional peer dependencies with an empty module
|
|
9
|
-
* Follows the same pattern as IgnorePlugin by tapping into normalModuleFactory hooks
|
|
10
|
-
*/
|
|
11
|
-
class ReplaceOptionalDependenciesPlugin {
|
|
12
|
-
private readonly checkResource: (resource: string, context: string) => boolean;
|
|
13
|
-
private readonly emptyModulePath: string;
|
|
14
|
-
|
|
15
|
-
constructor(checkResource: (resource: string, context: string) => boolean) {
|
|
16
|
-
this.checkResource = checkResource;
|
|
17
|
-
this.emptyModulePath = require.resolve('./empty-module.js');
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
apply(compiler: Compiler) {
|
|
21
|
-
compiler.hooks.normalModuleFactory.tap(
|
|
22
|
-
'ReplaceOptionalDependenciesPlugin',
|
|
23
|
-
normalModuleFactory => {
|
|
24
|
-
normalModuleFactory.hooks.beforeResolve.tap(
|
|
25
|
-
'ReplaceOptionalDependenciesPlugin',
|
|
26
|
-
resolveData => {
|
|
27
|
-
if (!resolveData) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const { request, context } = resolveData;
|
|
32
|
-
|
|
33
|
-
// Check if this module should be replaced
|
|
34
|
-
if (this.checkResource(request, context)) {
|
|
35
|
-
// Replace the request with the empty module path
|
|
36
|
-
resolveData.request = this.emptyModulePath;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export function ignorePlugin(context: BuildContext, _: Overrides) {
|
|
5
|
+
export function ignorePlugin(context: Context, _: Overrides) {
|
|
46
6
|
/**
|
|
47
|
-
* Ignore optional peer dependencies
|
|
7
|
+
* Ignore optional peer dependencies
|
|
48
8
|
* @see {@link: file://./../../../../../../web-components/src/register.tsx}
|
|
49
9
|
* @see {@link: file://./../../../../../../web-components/src/render.ts}
|
|
50
10
|
* @see {@link: file://./../../../../../../ko-bridge/src/ko-binding-handlers.tsx}
|
|
51
11
|
*/
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return new ReplaceOptionalDependenciesPlugin(shouldIgnore);
|
|
12
|
+
return new IgnorePlugin({ checkResource: checkResource(context) });
|
|
55
13
|
}
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
|
2
|
-
import {
|
|
3
|
-
import { Overrides } from '../../types';
|
|
2
|
+
import { Context, Overrides } from '../types';
|
|
4
3
|
|
|
5
|
-
export function miniCssExtractPlugin(context:
|
|
6
|
-
const { isProduction } =
|
|
7
|
-
|
|
8
|
-
const { isCustomStyleRules, emitExposedDependencies } = context.options.bundlerConfig;
|
|
4
|
+
export function miniCssExtractPlugin(context: Context, overrides: Overrides) {
|
|
5
|
+
const { isCustomStyleRules, isExposeSharedDependencies, isProduction, isWebComponent } =
|
|
6
|
+
context;
|
|
9
7
|
|
|
10
|
-
if (
|
|
11
|
-
(!isCustomStyleRules || emitExposedDependencies) &&
|
|
12
|
-
(isProduction || isWebComponent || isExposeSharedDependencies)
|
|
13
|
-
) {
|
|
8
|
+
if (!isCustomStyleRules && (isProduction || isWebComponent || isExposeSharedDependencies)) {
|
|
14
9
|
return new MiniCssExtractPlugin({
|
|
15
10
|
filename: isProduction ? '[name].[contenthash].bundle.css' : '[name].bundle.css',
|
|
16
11
|
...overrides.plugins?.MiniCssExtractPlugin,
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Overrides } from '../../types';
|
|
1
|
+
import { Context, Overrides } from '../types';
|
|
3
2
|
|
|
4
3
|
const MomentLocalesPlugin: typeof import('moment-locales-webpack-plugin') | undefined =
|
|
5
4
|
isMomentInstalled() ? require('moment-locales-webpack-plugin') : undefined;
|
|
6
5
|
|
|
7
|
-
export function momentLocalesPlugin(_:
|
|
6
|
+
export function momentLocalesPlugin(_: Context, _overrides: Overrides) {
|
|
8
7
|
return (
|
|
9
8
|
MomentLocalesPlugin &&
|
|
10
9
|
new MomentLocalesPlugin({
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import RemoveEmptyScriptsPlugin from 'webpack-remove-empty-scripts';
|
|
2
|
-
import {
|
|
3
|
-
import { Overrides } from '../../types';
|
|
2
|
+
import { Context, Overrides } from '../types';
|
|
4
3
|
|
|
5
|
-
export function removeEmptyScriptsPlugin(context:
|
|
6
|
-
const { emitExposedDependencies } = context
|
|
4
|
+
export function removeEmptyScriptsPlugin(context: Context, _overrides: Overrides) {
|
|
5
|
+
const { emitExposedDependencies } = context;
|
|
7
6
|
if (!emitExposedDependencies) {
|
|
8
7
|
return;
|
|
9
8
|
}
|
|
@@ -1,28 +1,80 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import VirtualModulesPlugin from 'webpack-virtual-modules';
|
|
4
|
-
import {
|
|
5
|
-
import { Overrides } from '../../types';
|
|
4
|
+
import { Context, Overrides } from '../types';
|
|
6
5
|
|
|
7
|
-
export function virtualModulesPlugin(context:
|
|
8
|
-
const { destination } = context
|
|
6
|
+
export function virtualModulesPlugin(context: Context, _: Overrides) {
|
|
7
|
+
const { destination } = context;
|
|
9
8
|
|
|
10
|
-
const modules =
|
|
11
|
-
const webpackModules: ConstructorParameters<typeof VirtualModulesPlugin>[0] = {};
|
|
9
|
+
const modules: ConstructorParameters<typeof VirtualModulesPlugin>[0] = {};
|
|
12
10
|
|
|
13
|
-
if (
|
|
11
|
+
if (context.isWebComponent) {
|
|
14
12
|
const indexPath = path.join(process.cwd(), destination, 'index');
|
|
15
|
-
|
|
13
|
+
modules[indexPath] = indexCode(context);
|
|
16
14
|
}
|
|
17
15
|
|
|
18
|
-
if (
|
|
16
|
+
if (needsToIncludeDesignSystem(context)) {
|
|
19
17
|
const designSystemPath = getDesignSystemPath(context);
|
|
20
18
|
if (!fs.existsSync(designSystemPath)) {
|
|
21
|
-
|
|
19
|
+
modules[designSystemPath] = designSystemCode();
|
|
22
20
|
}
|
|
23
21
|
}
|
|
24
22
|
|
|
25
|
-
return Object.keys(
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
return Object.keys(modules).length ? new VirtualModulesPlugin(modules) : undefined;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function getDesignSystemPath({ destination }: Context) {
|
|
27
|
+
return path.join(process.cwd(), destination, 'design-system.css');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function designSystemCode() {
|
|
31
|
+
return [
|
|
32
|
+
`@import '~@servicetitan/tokens/core/tokens.css';`,
|
|
33
|
+
`@import '~@servicetitan/anvil-fonts/dist/css/anvil-fonts.css';`,
|
|
34
|
+
`@import '~@servicetitan/design-system/dist/system.min.css';`,
|
|
35
|
+
].join('\n');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function indexCode(context: Context) {
|
|
39
|
+
const { embed = false, headless, isLegacyRoot, sharedDependencies } = context;
|
|
40
|
+
if (headless) {
|
|
41
|
+
return headlessIndex();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const options = `{ legacyRoot: ${isLegacyRoot}, sharedDependenciesNames: ${JSON.stringify(
|
|
45
|
+
Object.keys(sharedDependencies)
|
|
46
|
+
)} }`;
|
|
47
|
+
return [
|
|
48
|
+
...(needsToIncludeDesignSystem(context) ? [`require('./design-system.css');`] : []),
|
|
49
|
+
`import { register } from '@servicetitan/web-components';`,
|
|
50
|
+
`import { App } from './app';`,
|
|
51
|
+
`register(App, ${embed}, ${options});`,
|
|
52
|
+
].join('\n');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function needsToIncludeDesignSystem({
|
|
56
|
+
embed,
|
|
57
|
+
emitExposedDependencies,
|
|
58
|
+
headless,
|
|
59
|
+
isWebComponent,
|
|
60
|
+
packageData,
|
|
61
|
+
sharedDependencies,
|
|
62
|
+
}: Context) {
|
|
63
|
+
return (
|
|
64
|
+
(!!emitExposedDependencies && !!sharedDependencies['@servicetitan/design-system']) ||
|
|
65
|
+
(isWebComponent &&
|
|
66
|
+
!headless &&
|
|
67
|
+
// Depends on design system
|
|
68
|
+
!!packageData.dependencies['@servicetitan/design-system'] &&
|
|
69
|
+
// ... and is not light bundle with private copy of design system
|
|
70
|
+
!(embed && !!sharedDependencies['@servicetitan/design-system']))
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function headlessIndex() {
|
|
75
|
+
return [
|
|
76
|
+
"import { registerHeadless } from '@servicetitan/web-components';",
|
|
77
|
+
"import { connectedCallback, disconnectedCallback } from './headless';",
|
|
78
|
+
'registerHeadless(connectedCallback, disconnectedCallback);',
|
|
79
|
+
].join('\n');
|
|
28
80
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
import { Compiler } from 'webpack';
|
|
3
|
-
import { BuildContext } from '../../../core';
|
|
4
3
|
import { log } from '../../../utils';
|
|
5
|
-
import { Overrides } from '
|
|
4
|
+
import { Context, Overrides } from '../types';
|
|
6
5
|
|
|
7
|
-
export function watchRunPlugin(_context:
|
|
6
|
+
export function watchRunPlugin(_context: Context, _overrides: Overrides) {
|
|
8
7
|
/* istanbul ignore next: debug only */
|
|
9
8
|
if (log.debug('modified-files').enabled) {
|
|
10
9
|
return new WatchRunPlugin();
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { Configuration } from 'webpack';
|
|
2
|
-
import { BuildContext } from '../../core';
|
|
3
|
-
import { Overrides } from '../types';
|
|
4
2
|
import {
|
|
5
3
|
assetsManifestPlugin,
|
|
6
4
|
bundleAnalyzerPlugin,
|
|
@@ -17,11 +15,12 @@ import {
|
|
|
17
15
|
virtualModulesPlugin,
|
|
18
16
|
watchRunPlugin,
|
|
19
17
|
} from './plugins';
|
|
18
|
+
import { Context, Overrides } from './types';
|
|
20
19
|
|
|
21
20
|
type Config = Configuration['plugins'];
|
|
22
21
|
type Result = Pick<Configuration, 'plugins'>;
|
|
23
22
|
|
|
24
|
-
export function pluginsConfig(context:
|
|
23
|
+
export function pluginsConfig(context: Context, overrides: Overrides): Result {
|
|
25
24
|
const plugins: Config = [
|
|
26
25
|
assetsManifestPlugin,
|
|
27
26
|
bundleAnalyzerPlugin,
|
|
@@ -1,11 +1,10 @@
|
|
|
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['resolve'];
|
|
6
5
|
type Result = Pick<Configuration, 'resolve'>;
|
|
7
6
|
|
|
8
|
-
export function resolveConfig(_context:
|
|
7
|
+
export function resolveConfig(_context: Context, _: Overrides): Result {
|
|
9
8
|
const resolve: Config = {
|
|
10
9
|
extensions: ['.js'],
|
|
11
10
|
};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
import { RuleSetRule } from 'webpack';
|
|
3
|
-
import { BuildContext } from '../../../core';
|
|
4
3
|
import { log } from '../../../utils';
|
|
5
4
|
import { cssLoader, styleLoader } from '../loaders';
|
|
5
|
+
import { Context } from '../types';
|
|
6
6
|
|
|
7
|
-
export function cssRules(context:
|
|
8
|
-
const { isExposeSharedDependencies, sharedDependencies } = context
|
|
9
|
-
const { emitExposedDependencies } = context.options.bundlerConfig;
|
|
7
|
+
export function cssRules(context: Context): RuleSetRule[] {
|
|
8
|
+
const { emitExposedDependencies, isExposeSharedDependencies, sharedDependencies } = context;
|
|
10
9
|
const result: RuleSetRule[] = [
|
|
11
10
|
{
|
|
12
11
|
test: /\.module.css$/,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RuleSetRule } from 'webpack';
|
|
2
|
-
import {
|
|
2
|
+
import { Context } from '../types';
|
|
3
3
|
|
|
4
|
-
export function fontRules(_:
|
|
4
|
+
export function fontRules(_: Context): RuleSetRule[] {
|
|
5
5
|
return [
|
|
6
6
|
{
|
|
7
7
|
test: /\.(woff|woff2|eot|ttf|otf)$/i,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RuleSetRule } from 'webpack';
|
|
2
|
-
import {
|
|
2
|
+
import { Context } from '../types';
|
|
3
3
|
|
|
4
|
-
export function imageRules(_:
|
|
4
|
+
export function imageRules(_: Context): RuleSetRule[] {
|
|
5
5
|
return [
|
|
6
6
|
{
|
|
7
7
|
test: /\.(png|jpg|jpeg|gif)$/i,
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
import { RuleSetRule } from 'webpack';
|
|
3
|
-
import {
|
|
3
|
+
import { Context } from '../types';
|
|
4
4
|
|
|
5
|
-
export function jsRules(
|
|
6
|
-
const { destination } = context.package;
|
|
7
|
-
const { codeCoverage } = context.options;
|
|
5
|
+
export function jsRules({ codeCoverage, destination }: Context): RuleSetRule[] {
|
|
8
6
|
const result: RuleSetRule[] = [
|
|
9
7
|
{
|
|
10
8
|
enforce: 'pre',
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { RuleSetRule } from 'webpack';
|
|
2
|
-
import { BuildContext } from '../../../core';
|
|
3
2
|
import { cssLoader, lessLoader, styleLoader } from '../loaders';
|
|
3
|
+
import { Context } from '../types';
|
|
4
4
|
|
|
5
|
-
export function lessRules(context:
|
|
5
|
+
export function lessRules(context: Context): RuleSetRule[] {
|
|
6
6
|
return [
|
|
7
7
|
{
|
|
8
8
|
test: /\.module.less$/,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { RuleSetRule } from 'webpack';
|
|
2
|
-
import { BuildContext } from '../../../core';
|
|
3
2
|
import { cssLoader, styleLoader } from '../loaders';
|
|
3
|
+
import { Context } from '../types';
|
|
4
4
|
|
|
5
|
-
export function scssRules(context:
|
|
5
|
+
export function scssRules(context: Context): RuleSetRule[] {
|
|
6
6
|
return [
|
|
7
7
|
{
|
|
8
8
|
test: /\.module.scss$/,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RuleSetRule } from 'webpack';
|
|
2
|
-
import {
|
|
2
|
+
import { Context } from '../types';
|
|
3
3
|
|
|
4
|
-
export function svgRules(_:
|
|
4
|
+
export function svgRules(_: Context): RuleSetRule[] {
|
|
5
5
|
// Using [\\\/] because Windows uses backslash as path separator
|
|
6
6
|
const librariesRegEx = /node_modules[\\\/]@servicetitan[\\\/]anvil2/;
|
|
7
7
|
|
|
@@ -1,30 +1,26 @@
|
|
|
1
1
|
import { RuleSetRule } from 'webpack';
|
|
2
|
-
import { BuildContext } from '../../core';
|
|
3
|
-
import { Overrides } from '../types';
|
|
4
2
|
import { getModuleEntryPath } from '../utils';
|
|
5
3
|
import { cssRules, fontRules, imageRules, jsRules, lessRules, scssRules, svgRules } from './rules';
|
|
4
|
+
import { Context, Overrides } from './types';
|
|
6
5
|
|
|
7
6
|
interface Result {
|
|
8
7
|
rules: RuleSetRule[];
|
|
9
8
|
}
|
|
10
9
|
|
|
11
|
-
export function rulesConfig(context:
|
|
10
|
+
export function rulesConfig(context: Context, _: Overrides): Result {
|
|
12
11
|
const rules = [jsRules, imageRules, fontRules, svgRules, sharedDependenciesRules].flatMap(fn =>
|
|
13
12
|
fn(context)
|
|
14
13
|
);
|
|
15
14
|
|
|
16
|
-
if (
|
|
17
|
-
!context.options.bundlerConfig.isCustomStyleRules ||
|
|
18
|
-
context.options.bundlerConfig.emitExposedDependencies
|
|
19
|
-
) {
|
|
15
|
+
if (!context.isCustomStyleRules) {
|
|
20
16
|
rules.push(...[scssRules, lessRules, cssRules].flatMap(fn => fn(context)));
|
|
21
17
|
}
|
|
22
18
|
|
|
23
19
|
return { rules };
|
|
24
20
|
}
|
|
25
21
|
|
|
26
|
-
function sharedDependenciesRules(context:
|
|
27
|
-
const { isExposeSharedDependencies, sharedDependencies } = context
|
|
22
|
+
function sharedDependenciesRules(context: Context): RuleSetRule[] {
|
|
23
|
+
const { isExposeSharedDependencies, sharedDependencies } = context;
|
|
28
24
|
if (!isExposeSharedDependencies) {
|
|
29
25
|
return [];
|
|
30
26
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
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['stats'];
|
|
6
5
|
type Result = Pick<Configuration, 'stats'>;
|
|
7
6
|
|
|
8
|
-
export function statsConfig(_context:
|
|
7
|
+
export function statsConfig(_context: Context, _: Overrides): Result {
|
|
9
8
|
const stats: Config = {
|
|
10
9
|
all: false,
|
|
11
10
|
errors: true,
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { getPackageData, loadSharedDependencies, MinifyOptions } from '../../utils';
|
|
2
|
+
import { Options } from '../types';
|
|
3
|
+
export type { Overrides } from '../types';
|
|
4
|
+
|
|
5
|
+
export interface Context extends Options {
|
|
6
|
+
codeCoverage?: boolean;
|
|
7
|
+
destination: string;
|
|
8
|
+
isCustomStyleRules?: boolean;
|
|
9
|
+
isExposeSharedDependencies?: boolean;
|
|
10
|
+
isLegacyRoot?: boolean;
|
|
11
|
+
isProduction?: boolean;
|
|
12
|
+
isWebComponent?: boolean;
|
|
13
|
+
minify?: MinifyOptions;
|
|
14
|
+
name: string;
|
|
15
|
+
packageData: ReturnType<typeof getPackageData>;
|
|
16
|
+
sharedDependencies: ReturnType<typeof loadSharedDependencies>;
|
|
17
|
+
source: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface EntryPoint {
|
|
21
|
+
css?: string[];
|
|
22
|
+
js?: string[];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface EntryPoints {
|
|
26
|
+
full?: EntryPoint;
|
|
27
|
+
light?: EntryPoint;
|
|
28
|
+
headless?: EntryPoint;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface Metadata {
|
|
32
|
+
name: string;
|
|
33
|
+
version: string;
|
|
34
|
+
bundledWith: Record<string, string | undefined>;
|
|
35
|
+
sharedDependencies: Record<string, string>;
|
|
36
|
+
dependencies: Record<string, string>;
|
|
37
|
+
entrypoints: EntryPoints;
|
|
38
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { fs, vol } from 'memfs';
|
|
2
|
-
import { getStartupVersion } from '
|
|
2
|
+
import { getStartupVersion } from '../../../../utils/get-startup-version';
|
|
3
3
|
import { buildMetadata, BuildMetadataParams } from '../build-metadata';
|
|
4
4
|
import { getLaunchDarklySdkVersion } from '../get-launchdarkly-sdk-version';
|
|
5
5
|
import { getWebComponentsVersion } from '../get-web-components-version';
|
|
6
6
|
|
|
7
7
|
jest.mock('fs', () => fs);
|
|
8
|
-
jest.mock('
|
|
8
|
+
jest.mock('../../../../utils/get-startup-version');
|
|
9
9
|
jest.mock('../get-launchdarkly-sdk-version');
|
|
10
10
|
jest.mock('../get-web-components-version');
|
|
11
11
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { fs, vol } from 'memfs';
|
|
2
2
|
|
|
3
3
|
import * as mockedFs from 'fs';
|
|
4
|
-
import { createPackage } from '
|
|
5
|
-
import {
|
|
4
|
+
import { createPackage } from '../../../../__mocks__';
|
|
5
|
+
import { Context } from '../../types';
|
|
6
6
|
import { buildMetadata } from '../build-metadata';
|
|
7
7
|
import { generateMetadata } from '../generate-metadata';
|
|
8
8
|
|
|
@@ -16,7 +16,7 @@ function generatedMetadata(dest: string) {
|
|
|
16
16
|
describe(`[startup] ${generateMetadata.name}`, () => {
|
|
17
17
|
const pkg = createPackage({});
|
|
18
18
|
const destination = 'dist';
|
|
19
|
-
let context:
|
|
19
|
+
let context: Partial<Context>;
|
|
20
20
|
|
|
21
21
|
const mockMetadata = {
|
|
22
22
|
name: pkg.name,
|
|
@@ -36,30 +36,16 @@ describe(`[startup] ${generateMetadata.name}`, () => {
|
|
|
36
36
|
jest.mocked(buildMetadata).mockReturnValue(mockMetadata);
|
|
37
37
|
|
|
38
38
|
context = {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
},
|
|
43
|
-
package: {
|
|
44
|
-
name: pkg.name,
|
|
45
|
-
version: pkg.version,
|
|
46
|
-
destination,
|
|
47
|
-
source: 'src',
|
|
48
|
-
dependencies: { foo: '1.0.1' },
|
|
49
|
-
sharedDependencies: { react: 'SharedDependencies.React' },
|
|
50
|
-
isWebComponent: false,
|
|
51
|
-
isLegacyRoot: false,
|
|
52
|
-
isExposeSharedDependencies: false,
|
|
53
|
-
},
|
|
54
|
-
options: {
|
|
55
|
-
bundlerConfig: {},
|
|
56
|
-
},
|
|
39
|
+
destination,
|
|
40
|
+
name: pkg.name,
|
|
41
|
+
packageData: { name: pkg.name, version: pkg.version, dependencies: { foo: '1.0.1' } },
|
|
42
|
+
sharedDependencies: { react: 'SharedDependencies.React' },
|
|
57
43
|
};
|
|
58
44
|
});
|
|
59
45
|
|
|
60
46
|
afterEach(() => vol.reset());
|
|
61
47
|
|
|
62
|
-
const subject = () => generateMetadata(context);
|
|
48
|
+
const subject = () => generateMetadata(context as any);
|
|
63
49
|
|
|
64
50
|
function itWritesMetadataToDestination(destination: string) {
|
|
65
51
|
test('writes metadata to output file', () => {
|
|
@@ -74,10 +60,10 @@ describe(`[startup] ${generateMetadata.name}`, () => {
|
|
|
74
60
|
|
|
75
61
|
expect(buildMetadata).toHaveBeenCalledWith({
|
|
76
62
|
destination,
|
|
77
|
-
name: context.
|
|
78
|
-
version: context.
|
|
79
|
-
dependencies: context.
|
|
80
|
-
sharedDependencies: context.
|
|
63
|
+
name: context.name,
|
|
64
|
+
version: context.packageData!.version,
|
|
65
|
+
dependencies: context.packageData!.dependencies,
|
|
66
|
+
sharedDependencies: context.sharedDependencies,
|
|
81
67
|
});
|
|
82
68
|
});
|
|
83
69
|
|
|
@@ -86,7 +72,7 @@ describe(`[startup] ${generateMetadata.name}`, () => {
|
|
|
86
72
|
describe('when destination directory does not exist', () => {
|
|
87
73
|
const nestedDestination = 'nested/path/dist';
|
|
88
74
|
|
|
89
|
-
beforeEach(() => (context.
|
|
75
|
+
beforeEach(() => (context.destination = nestedDestination));
|
|
90
76
|
|
|
91
77
|
test('creates destination directory', () => {
|
|
92
78
|
subject();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
|
-
import { getStartupVersion, readJsonSafe } from '
|
|
2
|
+
import { getStartupVersion, readJsonSafe } from '../../../utils';
|
|
3
3
|
import { EntryPoints, Metadata } from '../types';
|
|
4
4
|
import { getLaunchDarklySdkVersion } from './get-launchdarkly-sdk-version';
|
|
5
5
|
import { getWebComponentsVersion } from './get-web-components-version';
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
import { log } from '
|
|
4
|
-
import {
|
|
3
|
+
import { log } from '../../../utils';
|
|
4
|
+
import { Context } from '../types';
|
|
5
5
|
import { buildMetadata } from './build-metadata';
|
|
6
6
|
|
|
7
|
-
export function generateMetadata(context:
|
|
8
|
-
const { destination,
|
|
9
|
-
const { name } = context.build;
|
|
7
|
+
export function generateMetadata(context: Context) {
|
|
8
|
+
const { destination, name, packageData, sharedDependencies } = context;
|
|
10
9
|
|
|
11
10
|
if (!fs.existsSync(destination)) {
|
|
12
11
|
fs.mkdirSync(destination, { recursive: true });
|
|
@@ -15,8 +14,8 @@ export function generateMetadata(context: BuildContext) {
|
|
|
15
14
|
const metadata = buildMetadata({
|
|
16
15
|
destination,
|
|
17
16
|
name,
|
|
18
|
-
version,
|
|
19
|
-
dependencies,
|
|
17
|
+
version: packageData.version,
|
|
18
|
+
dependencies: packageData.dependencies,
|
|
20
19
|
sharedDependencies,
|
|
21
20
|
});
|
|
22
21
|
|