@servicetitan/startup 37.0.2 → 38.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/js-yaml.js +2 -2
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +22 -9
- package/dist/cli/commands/build.js.map +1 -1
- package/dist/cli/commands/bundle-package.d.ts +6 -0
- package/dist/cli/commands/bundle-package.d.ts.map +1 -0
- package/dist/cli/commands/bundle-package.js +59 -0
- package/dist/cli/commands/bundle-package.js.map +1 -0
- package/dist/cli/commands/bundle-vite.js +13 -4
- package/dist/cli/commands/bundle-vite.js.map +1 -1
- package/dist/cli/commands/bundle-webpack.js +13 -4
- package/dist/cli/commands/bundle-webpack.js.map +1 -1
- package/dist/cli/commands/clean.js +13 -4
- package/dist/cli/commands/clean.js.map +1 -1
- package/dist/cli/commands/command.d.ts +9 -0
- package/dist/cli/commands/command.d.ts.map +1 -0
- package/dist/cli/commands/command.js +35 -0
- package/dist/cli/commands/command.js.map +1 -0
- package/dist/cli/commands/convert-eslint-config.js +14 -7
- package/dist/cli/commands/convert-eslint-config.js.map +1 -1
- package/dist/cli/commands/eslint.js +13 -4
- package/dist/cli/commands/eslint.js.map +1 -1
- package/dist/cli/commands/init.js +13 -4
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/install.js +13 -4
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/kendo-ui-license.js +13 -4
- package/dist/cli/commands/kendo-ui-license.js.map +1 -1
- package/dist/cli/commands/lint.js +13 -4
- package/dist/cli/commands/lint.js.map +1 -1
- package/dist/cli/commands/mfe-check.d.ts.map +1 -1
- package/dist/cli/commands/mfe-check.js +15 -7
- package/dist/cli/commands/mfe-check.js.map +1 -1
- package/dist/cli/commands/mfe-generate-metadata.js +13 -4
- package/dist/cli/commands/mfe-generate-metadata.js.map +1 -1
- package/dist/cli/commands/mfe-list.js +13 -4
- package/dist/cli/commands/mfe-list.js.map +1 -1
- package/dist/cli/commands/mfe-package-clean.js +13 -4
- package/dist/cli/commands/mfe-package-clean.js.map +1 -1
- package/dist/cli/commands/mfe-package-publish.js +13 -4
- package/dist/cli/commands/mfe-package-publish.js.map +1 -1
- package/dist/cli/commands/mfe-package-rollback.js +13 -4
- package/dist/cli/commands/mfe-package-rollback.js.map +1 -1
- package/dist/cli/commands/mfe-publish.js +13 -4
- package/dist/cli/commands/mfe-publish.js.map +1 -1
- package/dist/cli/commands/mfe-purge-cache.js +13 -4
- package/dist/cli/commands/mfe-purge-cache.js.map +1 -1
- package/dist/cli/commands/prepare-package.js +13 -4
- package/dist/cli/commands/prepare-package.js.map +1 -1
- package/dist/cli/commands/registry/build.d.ts +1 -1
- package/dist/cli/commands/registry/build.d.ts.map +1 -1
- package/dist/cli/commands/registry/build.js +3 -5
- package/dist/cli/commands/registry/build.js.map +1 -1
- package/dist/cli/commands/registry/bundle-package.d.ts +41 -0
- package/dist/cli/commands/registry/bundle-package.d.ts.map +1 -0
- package/dist/cli/commands/registry/bundle-package.js +54 -0
- package/dist/cli/commands/registry/bundle-package.js.map +1 -0
- package/dist/cli/commands/registry/command-registry.d.ts +42 -2
- package/dist/cli/commands/registry/command-registry.d.ts.map +1 -1
- package/dist/cli/commands/registry/command-registry.js +10 -19
- package/dist/cli/commands/registry/command-registry.js.map +1 -1
- package/dist/cli/commands/registry/start.d.ts +1 -1
- package/dist/cli/commands/registry/start.d.ts.map +1 -1
- package/dist/cli/commands/registry/start.js +3 -5
- package/dist/cli/commands/registry/start.js.map +1 -1
- package/dist/cli/commands/review/review.js +14 -7
- package/dist/cli/commands/review/review.js.map +1 -1
- package/dist/cli/commands/review/rules/no-deprecated-content-base.js +1 -3
- package/dist/cli/commands/review/rules/no-deprecated-content-base.js.map +1 -1
- package/dist/cli/commands/review/rules/no-direct-peer-dependencies.js +1 -3
- package/dist/cli/commands/review/rules/no-direct-peer-dependencies.js.map +1 -1
- package/dist/cli/commands/review/rules/no-typescript-entry-point.js +1 -3
- package/dist/cli/commands/review/rules/no-typescript-entry-point.js.map +1 -1
- package/dist/cli/commands/review/rules/prefer-open-ended-peer-dependencies.js +5 -12
- package/dist/cli/commands/review/rules/prefer-open-ended-peer-dependencies.js.map +1 -1
- package/dist/cli/commands/review/rules/require-compatible-launch-darkly-sdk.js +5 -12
- package/dist/cli/commands/review/rules/require-compatible-launch-darkly-sdk.js.map +1 -1
- package/dist/cli/commands/review/rules/require-explicit-side-effects.js +1 -3
- package/dist/cli/commands/review/rules/require-explicit-side-effects.js.map +1 -1
- package/dist/cli/commands/review/rules/require-one-collection-version.js +1 -3
- package/dist/cli/commands/review/rules/require-one-collection-version.js.map +1 -1
- package/dist/cli/commands/review/rules/require-servicetitan-scope.js +1 -3
- package/dist/cli/commands/review/rules/require-servicetitan-scope.js.map +1 -1
- package/dist/cli/commands/review/rules/require-tsconfig-references.js +1 -3
- package/dist/cli/commands/review/rules/require-tsconfig-references.js.map +1 -1
- package/dist/cli/commands/review/types.d.ts.map +1 -1
- package/dist/cli/commands/review/types.js.map +1 -1
- package/dist/cli/commands/review/utils/compare-version.js +8 -19
- package/dist/cli/commands/review/utils/compare-version.js.map +1 -1
- package/dist/cli/commands/run-task.d.ts +1 -0
- package/dist/cli/commands/run-task.d.ts.map +1 -1
- package/dist/cli/commands/run-task.js +20 -6
- package/dist/cli/commands/run-task.js.map +1 -1
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +28 -13
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/stylelint.js +13 -4
- package/dist/cli/commands/stylelint.js.map +1 -1
- package/dist/cli/commands/styles-check.js +13 -4
- package/dist/cli/commands/styles-check.js.map +1 -1
- package/dist/cli/commands/test/runners/jest.js +1 -3
- package/dist/cli/commands/test/runners/jest.js.map +1 -1
- package/dist/cli/commands/test/tests.js +13 -4
- package/dist/cli/commands/test/tests.js.map +1 -1
- package/dist/cli/commands/types.d.ts +1 -6
- package/dist/cli/commands/types.d.ts.map +1 -1
- package/dist/cli/commands/types.js +2 -20
- package/dist/cli/commands/types.js.map +1 -1
- package/dist/cli/commands/upload-sourcemaps.js +17 -13
- package/dist/cli/commands/upload-sourcemaps.js.map +1 -1
- package/dist/cli/index.js +1 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/tasks/cli-task.d.ts +3 -0
- package/dist/cli/tasks/cli-task.d.ts.map +1 -1
- package/dist/cli/tasks/cli-task.js +41 -9
- package/dist/cli/tasks/cli-task.js.map +1 -1
- package/dist/cli/tasks/swc-compile-package/get-swc-options.d.ts +9 -1
- package/dist/cli/tasks/swc-compile-package/get-swc-options.d.ts.map +1 -1
- package/dist/cli/tasks/swc-compile-package/get-swc-options.js +18 -2
- package/dist/cli/tasks/swc-compile-package/get-swc-options.js.map +1 -1
- package/dist/cli/tasks/swc-compile-package/swc-compile-package.d.ts +3 -1
- package/dist/cli/tasks/swc-compile-package/swc-compile-package.d.ts.map +1 -1
- package/dist/cli/tasks/swc-compile-package/swc-compile-package.js +17 -3
- package/dist/cli/tasks/swc-compile-package/swc-compile-package.js.map +1 -1
- package/dist/cli/tasks/task.d.ts +2 -1
- package/dist/cli/tasks/task.d.ts.map +1 -1
- package/dist/cli/tasks/task.js +6 -3
- package/dist/cli/tasks/task.js.map +1 -1
- package/dist/cli/tasks/tsc-compile/tsc-compile.js +1 -3
- package/dist/cli/tasks/tsc-compile/tsc-compile.js.map +1 -1
- package/dist/cli/utils/cli-npm.d.ts.map +1 -1
- package/dist/cli/utils/cli-npm.js +8 -1
- package/dist/cli/utils/cli-npm.js.map +1 -1
- package/dist/cli/utils/cli-os.d.ts +1 -0
- package/dist/cli/utils/cli-os.d.ts.map +1 -1
- package/dist/cli/utils/cli-os.js +20 -0
- package/dist/cli/utils/cli-os.js.map +1 -1
- package/dist/cli/utils/compile.d.ts.map +1 -1
- package/dist/cli/utils/compile.js +7 -4
- package/dist/cli/utils/compile.js.map +1 -1
- package/dist/cli/utils/copy-files.js +1 -0
- package/dist/cli/utils/copy-files.js.map +1 -1
- package/dist/cli/utils/index.d.ts +1 -1
- package/dist/cli/utils/index.d.ts.map +1 -1
- package/dist/cli/utils/index.js +1 -1
- package/dist/cli/utils/index.js.map +1 -1
- package/dist/cli/utils/process-tree.js +2 -6
- package/dist/cli/utils/process-tree.js.map +1 -1
- package/dist/cli/utils/resolve-bundler.d.ts.map +1 -1
- package/dist/cli/utils/resolve-bundler.js +2 -1
- package/dist/cli/utils/resolve-bundler.js.map +1 -1
- package/dist/cli/utils/ts-config.d.ts +1 -1
- package/dist/cli/utils/ts-config.d.ts.map +1 -1
- package/dist/cli/utils/ts-config.js +1 -3
- package/dist/cli/utils/ts-config.js.map +1 -1
- package/dist/cli/utils/with-exponential-backoff.d.ts +7 -0
- package/dist/cli/utils/with-exponential-backoff.d.ts.map +1 -0
- package/dist/cli/utils/with-exponential-backoff.js +28 -0
- package/dist/cli/utils/with-exponential-backoff.js.map +1 -0
- package/dist/core/constants.d.ts +2 -0
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/constants.js +6 -1
- package/dist/core/constants.js.map +1 -1
- package/dist/cypress/config/vite-config.d.ts.map +1 -1
- package/dist/cypress/config/vite-config.js +23 -3
- package/dist/cypress/config/vite-config.js.map +1 -1
- package/dist/cypress/config/webpack-config.d.ts.map +1 -1
- package/dist/cypress/config/webpack-config.js +5 -0
- package/dist/cypress/config/webpack-config.js.map +1 -1
- package/dist/postinstall.js +118 -0
- package/dist/scripts/generate-bin-wrappers.js +203 -0
- package/dist/storybook-config/swc.d.ts +6 -0
- package/dist/storybook-config/swc.d.ts.map +1 -1
- package/dist/storybook-config/vite-final.d.ts.map +1 -1
- package/dist/storybook-config/vite-final.js +32 -6
- package/dist/storybook-config/vite-final.js.map +1 -1
- package/dist/storybook-config/webpack-final.d.ts.map +1 -1
- package/dist/storybook-config/webpack-final.js +3 -1
- package/dist/storybook-config/webpack-final.js.map +1 -1
- package/dist/utils/exit-when-parent-exits.d.ts +6 -0
- package/dist/utils/exit-when-parent-exits.d.ts.map +1 -0
- package/dist/utils/exit-when-parent-exits.js +37 -0
- package/dist/utils/exit-when-parent-exits.js.map +1 -0
- package/dist/utils/find-up.d.ts +1 -1
- package/dist/utils/find-up.d.ts.map +1 -1
- package/dist/utils/find-up.js +2 -2
- package/dist/utils/find-up.js.map +1 -1
- package/dist/utils/get-configuration.d.ts +6 -3
- package/dist/utils/get-configuration.d.ts.map +1 -1
- package/dist/utils/get-configuration.js +10 -2
- package/dist/utils/get-configuration.js.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/log.js +1 -3
- package/dist/utils/log.js.map +1 -1
- package/dist/vite/build-shared-dependencies.d.ts.map +1 -1
- package/dist/vite/build-shared-dependencies.js +2 -0
- package/dist/vite/build-shared-dependencies.js.map +1 -1
- package/dist/vite/config/base-config.d.ts.map +1 -1
- package/dist/vite/config/base-config.js +14 -1
- package/dist/vite/config/base-config.js.map +1 -1
- package/dist/vite/config/create-filtering-logger.d.ts.map +1 -1
- package/dist/vite/config/create-filtering-logger.js +12 -1
- package/dist/vite/config/create-filtering-logger.js.map +1 -1
- package/dist/vite/config/create-vite-build-context.d.ts.map +1 -1
- package/dist/vite/config/create-vite-build-context.js +4 -1
- package/dist/vite/config/create-vite-build-context.js.map +1 -1
- package/dist/vite/config/create-vite-config.js +7 -2
- package/dist/vite/config/create-vite-config.js.map +1 -1
- package/dist/vite/config/load-config-file.js +8 -19
- package/dist/vite/config/load-config-file.js.map +1 -1
- package/dist/vite/index.d.ts +2 -0
- package/dist/vite/index.d.ts.map +1 -1
- package/dist/vite/index.html +2 -2
- package/dist/vite/index.js +16 -0
- package/dist/vite/index.js.map +1 -1
- package/dist/vite/plugins/chain-source-maps-plugin.js +1 -1
- package/dist/vite/plugins/chain-source-maps-plugin.js.map +1 -1
- package/dist/vite/plugins/clean-plugin.js +1 -1
- package/dist/vite/plugins/clean-plugin.js.map +1 -1
- package/dist/vite/plugins/css-injector-plugin.js +1 -1
- package/dist/vite/plugins/css-injector-plugin.js.map +1 -1
- package/dist/vite/plugins/design-system-guard-plugin.d.ts.map +1 -1
- package/dist/vite/plugins/design-system-guard-plugin.js +10 -5
- package/dist/vite/plugins/design-system-guard-plugin.js.map +1 -1
- package/dist/vite/plugins/dev-server-routing-plugin.d.ts +1 -1
- package/dist/vite/plugins/dev-server-routing-plugin.d.ts.map +1 -1
- package/dist/vite/plugins/dev-server-routing-plugin.js +4 -3
- package/dist/vite/plugins/dev-server-routing-plugin.js.map +1 -1
- package/dist/vite/plugins/externals-plugin.d.ts.map +1 -1
- package/dist/vite/plugins/externals-plugin.js +11 -5
- package/dist/vite/plugins/externals-plugin.js.map +1 -1
- package/dist/vite/plugins/html-plugin.d.ts.map +1 -1
- package/dist/vite/plugins/html-plugin.js +5 -3
- package/dist/vite/plugins/html-plugin.js.map +1 -1
- package/dist/vite/plugins/ignore-modules-plugin.d.ts +2 -2
- package/dist/vite/plugins/ignore-modules-plugin.d.ts.map +1 -1
- package/dist/vite/plugins/ignore-modules-plugin.js +36 -24
- package/dist/vite/plugins/ignore-modules-plugin.js.map +1 -1
- package/dist/vite/plugins/index.d.ts +3 -0
- package/dist/vite/plugins/index.d.ts.map +1 -1
- package/dist/vite/plugins/index.js +3 -0
- package/dist/vite/plugins/index.js.map +1 -1
- package/dist/vite/plugins/istanbul-plugin.d.ts.map +1 -1
- package/dist/vite/plugins/istanbul-plugin.js +33 -1
- package/dist/vite/plugins/istanbul-plugin.js.map +1 -1
- package/dist/vite/plugins/less-tilde-plugin.d.ts +8 -0
- package/dist/vite/plugins/less-tilde-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/less-tilde-plugin.js +53 -0
- package/dist/vite/plugins/less-tilde-plugin.js.map +1 -0
- package/dist/vite/plugins/magic-comments-plugin/magic-comments-plugin.js +1 -1
- package/dist/vite/plugins/magic-comments-plugin/magic-comments-plugin.js.map +1 -1
- package/dist/vite/plugins/metadata-plugin.js +1 -1
- package/dist/vite/plugins/metadata-plugin.js.map +1 -1
- package/dist/vite/plugins/moment-locales-plugin.d.ts +1 -1
- package/dist/vite/plugins/moment-locales-plugin.d.ts.map +1 -1
- package/dist/vite/plugins/moment-locales-plugin.js +30 -14
- package/dist/vite/plugins/moment-locales-plugin.js.map +1 -1
- package/dist/vite/plugins/react-refresh-plugin/index.d.ts +2 -0
- package/dist/vite/plugins/react-refresh-plugin/index.d.ts.map +1 -0
- package/dist/vite/plugins/react-refresh-plugin/index.js +20 -0
- package/dist/vite/plugins/react-refresh-plugin/index.js.map +1 -0
- package/dist/vite/plugins/react-refresh-plugin/react-refresh-plugin.d.ts +4 -0
- package/dist/vite/plugins/react-refresh-plugin/react-refresh-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/react-refresh-plugin/react-refresh-plugin.js +143 -0
- package/dist/vite/plugins/react-refresh-plugin/react-refresh-plugin.js.map +1 -0
- package/dist/vite/plugins/react-refresh-plugin/refresh-runtime.js +113 -0
- package/dist/vite/plugins/shared-dependencies-plugin/shared-dependencies-plugin.d.ts.map +1 -1
- package/dist/vite/plugins/shared-dependencies-plugin/shared-dependencies-plugin.js +14 -11
- package/dist/vite/plugins/shared-dependencies-plugin/shared-dependencies-plugin.js.map +1 -1
- package/dist/vite/plugins/style-urls-plugin.js +1 -1
- package/dist/vite/plugins/style-urls-plugin.js.map +1 -1
- package/dist/vite/plugins/virtual-modules-plugin.d.ts.map +1 -1
- package/dist/vite/plugins/virtual-modules-plugin.js +9 -6
- package/dist/vite/plugins/virtual-modules-plugin.js.map +1 -1
- package/dist/vite/plugins/window-externals-plugin.d.ts +22 -0
- package/dist/vite/plugins/window-externals-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/window-externals-plugin.js +74 -0
- package/dist/vite/plugins/window-externals-plugin.js.map +1 -0
- package/dist/vite/types.d.ts +4 -1
- package/dist/vite/types.d.ts.map +1 -1
- package/dist/webpack/bundle-webpack.d.ts.map +1 -1
- package/dist/webpack/bundle-webpack.js +6 -1
- package/dist/webpack/bundle-webpack.js.map +1 -1
- package/dist/webpack/configs/optimization-config.js +4 -4
- package/dist/webpack/configs/optimization-config.js.map +1 -1
- package/dist/webpack/configs/output-config.js +1 -1
- package/dist/webpack/configs/output-config.js.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.js +1 -3
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.js.map +1 -1
- package/dist/webpack/loaders/expose-loader/__tests__/__mocks__/configuration.expose-loader.js +13 -0
- package/dist/webpack/loaders/expose-loader/__tests__/__mocks__/index.js +1 -0
- 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/normalize-proxy-config.d.ts +6 -0
- package/dist/webpack/utils/normalize-proxy-config.d.ts.map +1 -0
- package/dist/webpack/utils/normalize-proxy-config.js +52 -0
- package/dist/webpack/utils/normalize-proxy-config.js.map +1 -0
- package/package.json +25 -22
- package/src/cli/commands/__tests__/build.test.ts +33 -19
- package/src/cli/commands/__tests__/bundle-package.test.ts +65 -0
- package/src/cli/commands/__tests__/bundle-vite.test.ts +1 -0
- package/src/cli/commands/__tests__/command.test.ts +42 -0
- package/src/cli/commands/__tests__/mfe-check.test.ts +26 -5
- package/src/cli/commands/__tests__/run-task.test.ts +20 -1
- package/src/cli/commands/__tests__/start.test.ts +35 -15
- package/src/cli/commands/build.ts +6 -5
- package/src/cli/commands/bundle-package.ts +20 -0
- package/src/cli/commands/command.ts +14 -0
- package/src/cli/commands/mfe-check.ts +6 -10
- package/src/cli/commands/registry/build.ts +3 -2
- package/src/cli/commands/registry/bundle-package.ts +22 -0
- package/src/cli/commands/registry/command-registry.ts +2 -0
- package/src/cli/commands/registry/start.ts +3 -2
- package/src/cli/commands/review/types.ts +1 -3
- package/src/cli/commands/run-task.ts +8 -2
- package/src/cli/commands/start.ts +9 -5
- package/src/cli/commands/types.ts +2 -6
- package/src/cli/index.ts +3 -0
- package/src/cli/tasks/__tests__/cli-task.test.ts +181 -69
- package/src/cli/tasks/__tests__/task.test.ts +40 -45
- package/src/cli/tasks/cli-task.ts +43 -2
- package/src/cli/tasks/swc-compile-package/__tests__/get-swc-options.test.ts +46 -4
- package/src/cli/tasks/swc-compile-package/__tests__/swc-compile-package.test.ts +25 -4
- package/src/cli/tasks/swc-compile-package/get-swc-options.ts +14 -1
- package/src/cli/tasks/swc-compile-package/swc-compile-package.ts +6 -2
- package/src/cli/tasks/task.ts +8 -2
- package/src/cli/tasks/tsc-compile/__tests__/tsc-compile.test.ts +8 -32
- package/src/cli/tasks/tsc-compile-package/__tests__/tsc-compile-package.test.ts +10 -19
- package/src/cli/utils/__tests__/cli-npm.test.ts +33 -0
- package/src/cli/utils/__tests__/cli-os.test.ts +86 -3
- package/src/cli/utils/__tests__/compile.test.ts +37 -2
- package/src/cli/utils/__tests__/copy-files.test.ts +1 -1
- package/src/cli/utils/__tests__/with-exponential-backoff.test.ts +119 -0
- package/src/cli/utils/cli-npm.ts +19 -4
- package/src/cli/utils/cli-os.ts +14 -0
- package/src/cli/utils/compile.ts +8 -1
- package/src/cli/utils/copy-files.ts +1 -1
- package/src/cli/utils/index.ts +1 -1
- package/src/cli/utils/resolve-bundler.ts +2 -1
- package/src/cli/utils/ts-config.ts +1 -1
- package/src/cli/utils/with-exponential-backoff.ts +28 -0
- package/src/core/constants.ts +2 -0
- package/src/cypress/config/__tests__/vite-config.test.ts +21 -11
- package/src/cypress/config/__tests__/webpack-config.test.ts +17 -0
- package/src/cypress/config/vite-config.ts +18 -3
- package/src/cypress/config/webpack-config.ts +2 -0
- package/src/storybook-config/__tests__/vite-final.test.ts +71 -11
- package/src/storybook-config/__tests__/webpack-final.test.ts +30 -6
- package/src/storybook-config/vite-final.ts +23 -2
- package/src/storybook-config/webpack-final.ts +10 -2
- package/src/utils/__tests__/exit-when-parent-exits.test.ts +87 -0
- package/src/utils/__tests__/find-up.test.ts +49 -0
- package/src/utils/__tests__/get-configuration.test.ts +62 -0
- package/src/utils/exit-when-parent-exits.ts +33 -0
- package/src/utils/find-up.ts +2 -2
- package/src/utils/get-configuration.ts +14 -5
- package/src/utils/index.ts +1 -0
- package/src/vite/__tests__/build-shared-dependencies.test.ts +39 -5
- package/src/vite/build-shared-dependencies.ts +2 -1
- package/src/vite/config/__tests__/base-config.test.ts +16 -4
- package/src/vite/config/__tests__/create-css-config.test.ts +2 -6
- package/src/vite/config/__tests__/create-filtering-logger.test.ts +9 -0
- package/src/vite/config/__tests__/create-vite-build-context.test.ts +25 -0
- package/src/vite/config/__tests__/create-vite-config.test.ts +6 -3
- package/src/vite/config/base-config.ts +18 -2
- package/src/vite/config/create-filtering-logger.ts +13 -2
- package/src/vite/config/create-vite-build-context.ts +1 -0
- package/src/vite/config/create-vite-config.ts +6 -3
- package/src/vite/index.html +2 -2
- package/src/vite/index.ts +2 -0
- package/src/vite/plugins/__tests__/chain-source-maps-plugin.test.ts +1 -1
- package/src/vite/plugins/__tests__/clean-plugin.test.ts +1 -1
- package/src/vite/plugins/__tests__/css-injector-plugin.test.ts +1 -1
- package/src/vite/plugins/__tests__/design-system-guard-plugin.test.ts +15 -3
- package/src/vite/plugins/__tests__/dev-server-routing-plugin.test.ts +121 -99
- package/src/vite/plugins/__tests__/externals-plugin.test.ts +24 -3
- package/src/vite/plugins/__tests__/html-plugin.test.ts +10 -3
- package/src/vite/plugins/__tests__/html-template.test.ts +10 -2
- package/src/vite/plugins/__tests__/ignore-modules-plugin.test.ts +30 -6
- package/src/vite/plugins/__tests__/istanbul-plugin.test.ts +42 -1
- package/src/vite/plugins/__tests__/less-tilde-plugin.test.ts +91 -0
- package/src/vite/plugins/__tests__/metadata-plugin.test.ts +1 -1
- package/src/vite/plugins/__tests__/moment-locales-plugin.test.ts +35 -25
- package/src/vite/plugins/__tests__/style-urls-plugin.test.ts +1 -1
- package/src/vite/plugins/__tests__/virtual-modules-plugin.test.ts +20 -9
- package/src/vite/plugins/__tests__/window-externals-plugin.test.ts +128 -0
- package/src/vite/plugins/chain-source-maps-plugin.ts +1 -1
- package/src/vite/plugins/clean-plugin.ts +1 -1
- package/src/vite/plugins/css-injector-plugin.ts +1 -1
- package/src/vite/plugins/design-system-guard-plugin.ts +11 -8
- package/src/vite/plugins/dev-server-routing-plugin.ts +4 -4
- package/src/vite/plugins/externals-plugin.ts +15 -6
- package/src/vite/plugins/html-plugin.ts +4 -2
- package/src/vite/plugins/ignore-modules-plugin.ts +32 -23
- package/src/vite/plugins/index.ts +3 -0
- package/src/vite/plugins/istanbul-plugin.ts +28 -1
- package/src/vite/plugins/less-tilde-plugin.ts +64 -0
- package/src/vite/plugins/magic-comments-plugin/magic-comments-plugin.ts +1 -1
- package/src/vite/plugins/metadata-plugin.ts +1 -1
- package/src/vite/plugins/moment-locales-plugin.ts +24 -14
- package/src/vite/plugins/react-refresh-plugin/README.md +165 -0
- package/src/vite/plugins/react-refresh-plugin/__tests__/react-refresh-plugin.test.ts +366 -0
- package/src/vite/plugins/react-refresh-plugin/__tests__/refresh-runtime.test.ts +193 -0
- package/src/vite/plugins/react-refresh-plugin/index.ts +1 -0
- package/src/vite/plugins/react-refresh-plugin/react-refresh-plugin.ts +144 -0
- package/src/vite/plugins/react-refresh-plugin/refresh-runtime.js +113 -0
- package/src/vite/plugins/shared-dependencies-plugin/__tests__/shared-dependencies-plugin.test.ts +21 -16
- package/src/vite/plugins/shared-dependencies-plugin/shared-dependencies-plugin.ts +13 -12
- package/src/vite/plugins/style-urls-plugin.ts +1 -1
- package/src/vite/plugins/virtual-modules-plugin.ts +8 -7
- package/src/vite/plugins/window-externals-plugin.ts +94 -0
- package/src/vite/types.ts +4 -1
- package/src/webpack/__tests__/bundle-webpack.test.ts +32 -0
- package/src/webpack/__tests__/create-webpack-config-web-component.test.ts +17 -5
- package/src/webpack/__tests__/create-webpack-config.test.ts +10 -6
- package/src/webpack/bundle-webpack.ts +7 -1
- package/src/webpack/configs/optimization-config.ts +3 -3
- package/src/webpack/configs/output-config.ts +1 -1
- package/src/webpack/utils/__tests__/normalize-proxy-config.test.ts +121 -0
- package/src/webpack/utils/index.ts +1 -0
- package/src/webpack/utils/normalize-proxy-config.ts +59 -0
- package/tsconfig/types.d.ts +10 -0
- package/dist/cli/utils/get-bundle-command.d.ts +0 -3
- package/dist/cli/utils/get-bundle-command.d.ts.map +0 -1
- package/dist/cli/utils/get-bundle-command.js +0 -16
- package/dist/cli/utils/get-bundle-command.js.map +0 -1
- package/src/cli/utils/__tests__/get-bundle-command.test.ts +0 -23
- package/src/cli/utils/get-bundle-command.ts +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-configuration.d.ts","sourceRoot":"","sources":["../../src/utils/get-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AACzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,IAAI,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AACzF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"get-configuration.d.ts","sourceRoot":"","sources":["../../src/utils/get-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM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mBAAmB,IAAI,MAAM,EAAE,CAE9C;AAED,wBAAgB,oBAAoB,IAAI,uBAAuB,CAG9D;AAED,wBAAgB,sBAAsB;kBA5GpB,MAAM,EAAE;EA8GzB;AAED,wBAAgB,uBAAuB,CAAC,cAAc,CAAC,EAAE,cAAc,wBAGtE;AAED,wBAAgB,4BAA4B,CACxC,cAAc,GAAE,cAAqB,GACtC,mBAAmB,GAAG,SAAS,CAsBjC;AAED,wBAAgB,4BAA4B,CAAC,cAAc,GAAE,cAAqB,yDAIjF;AAED,wBAAgB,iBAAiB,YAShC;AAED,wBAAgB,iCAAiC,+BAEhD;AAED,wBAAgB,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,WAIvD;AAED,wBAAgB,mBAAmB,YAGlC;AAED,wBAAgB,uBAAuB,YAEtC;AAED,wBAAgB,qBAAqB,CAAC,cAAc,CAAC,EAAE,cAAc,sCAKpE;AAED,wBAAgB,0BAA0B,CAAC,cAAc,CAAC,EAAE,cAAc,WAKzE;AAED,wBAAgB,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,WAEvD;AAED,wBAAgB,YAAY,YAE3B;AAED,wBAAgB,oBAAoB,YAEnC;AAED,wBAAgB,cAAc,CAAC,cAAc,GAAE,cAAqB,WAEnE"}
|
|
@@ -33,6 +33,9 @@ _export(exports, {
|
|
|
33
33
|
get getReviewConfiguration () {
|
|
34
34
|
return getReviewConfiguration;
|
|
35
35
|
},
|
|
36
|
+
get getSharedDependencies () {
|
|
37
|
+
return getSharedDependencies;
|
|
38
|
+
},
|
|
36
39
|
get getStylelintConfiguration () {
|
|
37
40
|
return getStylelintConfiguration;
|
|
38
41
|
},
|
|
@@ -101,6 +104,7 @@ const allowedWebpackDevServerOptions = [
|
|
|
101
104
|
];
|
|
102
105
|
var CommandName = /*#__PURE__*/ function(CommandName) {
|
|
103
106
|
CommandName["build"] = "build";
|
|
107
|
+
CommandName["bundle-package"] = "bundle-package";
|
|
104
108
|
CommandName["bundle-vite"] = "bundle-vite";
|
|
105
109
|
CommandName["bundle-webpack"] = "bundle-webpack";
|
|
106
110
|
CommandName["clean"] = "clean";
|
|
@@ -220,9 +224,13 @@ function isDevServerDisabled() {
|
|
|
220
224
|
function isViteDevServerDisabled() {
|
|
221
225
|
return getViteConfiguration().devServer === false;
|
|
222
226
|
}
|
|
223
|
-
function
|
|
227
|
+
function getSharedDependencies(locationOrJson) {
|
|
228
|
+
var _getConfiguration_shareddependencies;
|
|
229
|
+
return (_getConfiguration_shareddependencies = getConfiguration(locationOrJson)['shared-dependencies']) !== null && _getConfiguration_shareddependencies !== void 0 ? _getConfiguration_shareddependencies : getWebpackConfiguration(locationOrJson)['shared-dependencies'];
|
|
230
|
+
}
|
|
231
|
+
function isExposeSharedDependencies(locationOrJson) {
|
|
224
232
|
var _getConfiguration_exposeshareddependencies;
|
|
225
|
-
return ((_getConfiguration_exposeshareddependencies = getConfiguration()['expose-shared-dependencies']) !== null && _getConfiguration_exposeshareddependencies !== void 0 ? _getConfiguration_exposeshareddependencies : getWebpackConfiguration()['expose-shared-dependencies']) === true;
|
|
233
|
+
return ((_getConfiguration_exposeshareddependencies = getConfiguration(locationOrJson)['expose-shared-dependencies']) !== null && _getConfiguration_exposeshareddependencies !== void 0 ? _getConfiguration_exposeshareddependencies : getWebpackConfiguration(locationOrJson)['expose-shared-dependencies']) === true;
|
|
226
234
|
}
|
|
227
235
|
function isLegacy(locationOrJson) {
|
|
228
236
|
return getConfiguration(locationOrJson).legacy === true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/get-configuration.ts"],"sourcesContent":["import type { Config } from '@jest/types';\nimport type { swcDir } from '@swc/cli';\nimport type { ESLint } from 'eslint';\nimport fs from 'fs';\nimport path from 'path';\nimport type { LinterOptions } from 'stylelint';\nimport type svgr from 'vite-plugin-svgr';\nimport type { ViteUserConfig } from 'vitest/config';\nimport type { Configuration as WebpackDevServerConfiguration } from 'webpack-dev-server';\nimport type { ReviewConfiguration } from '../cli/commands/review';\nimport { getFolders } from './get-folders';\nimport { getPackageName } from './get-package-name';\nimport { log } from './log';\nimport { readJson, readJsonSafe } from './read-json';\nimport { LocationOrJson } from './types';\n\ntype VitePluginSvgrOptions = NonNullable<Parameters<typeof svgr>[0]>;\n\ntype ElementType<T> = T extends readonly (infer ElementType)[] ? ElementType : never;\n\nexport type Bundler = 'vite' | 'webpack';\n\nexport const allowedWebpackDevServerOptions = ['headers', 'port', 'proxy', 'static'] as const;\n\nexport interface MinifyJSOptions {\n compress?: boolean;\n mangle?: boolean;\n}\n\nexport interface MinifyCssOptions {}\n\nexport interface MinifyOptions {\n css?: boolean | MinifyCssOptions;\n js?: boolean | MinifyJSOptions;\n}\n\nexport interface WebpackConfiguration extends Omit<\n Pick<WebpackDevServerConfiguration, ElementType<typeof allowedWebpackDevServerOptions>>,\n 'proxy'\n> {\n 'contentBase'?: boolean | string | string[] | number; // deprecated 2024-07\n 'custom-style-rules'?: boolean;\n 'expose-shared-dependencies'?: boolean;\n 'devServer'?: false | WebpackDevServerConfiguration;\n 'disable-style-check'?: boolean;\n 'minify'?: MinifyOptions;\n 'proxy'?: WebpackDevServerConfiguration['proxy'] | string;\n 'shared-dependencies'?: Record<string, string>;\n}\n\nexport interface ESLintConfiguration extends ESLint.Options {\n disabled?: boolean;\n}\n\nexport interface StylelintConfiguration extends Partial<LinterOptions> {\n ignorePattern?: string[];\n disabled?: boolean;\n}\n\nexport interface JestConfiguration extends Omit<Config.Argv, '_' | '$0'> {\n omitDefault?: string[];\n}\n\nexport interface NodeConfiguration {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n NODE_OPTIONS?: string[];\n}\n\n/* eslint-disable @typescript-eslint/naming-convention */\nexport enum CommandName {\n 'build' = 'build',\n 'bundle-vite' = 'bundle-vite',\n 'bundle-webpack' = 'bundle-webpack',\n 'clean' = 'clean',\n 'convert-eslint-config' = 'convert-eslint-config',\n 'eslint' = 'eslint',\n 'init' = 'init',\n 'install' = 'install',\n 'kendo-ui-license' = 'kendo-ui-license',\n 'lint' = 'lint',\n 'mfe-check' = 'mfe-check',\n 'mfe-generate-metadata' = 'mfe-generate-metadata',\n 'mfe-list' = 'mfe-list',\n 'mfe-package-clean' = 'mfe-package-clean',\n 'mfe-package-publish' = 'mfe-package-publish',\n 'mfe-package-rollback' = 'mfe-package-rollback',\n 'mfe-publish' = 'mfe-publish',\n 'mfe-purge-cache' = 'mfe-purge-cache',\n 'prepare-package' = 'prepare-package',\n 'review' = 'review',\n 'start' = 'start',\n 'stylelint' = 'stylelint',\n 'styles-check' = 'styles-check',\n 'test' = 'test',\n 'task' = 'task',\n 'upload-sourcemaps' = 'upload-sourcemaps',\n}\n/* eslint-enable @typescript-eslint/naming-convention */\n\nexport type VitestConfiguration = ViteUserConfig['test'] & {\n omitDefault?: string[];\n};\n\nexport interface HtmlPluginOptions {\n title?: string;\n favicon?: string;\n template?: string;\n}\n\nexport interface SvgrPluginOptions {\n include?: VitePluginSvgrOptions['include'];\n exclude?: VitePluginSvgrOptions['exclude'];\n svgrOptions?: VitePluginSvgrOptions['svgrOptions'];\n}\n\nexport interface PluginOverrides {\n html?: HtmlPluginOptions;\n svgr?: SvgrPluginOptions;\n}\n\nexport interface ViteBundlerConfig {\n port?: number;\n omitDefault?: string[];\n minify?: MinifyOptions;\n pluginOverrides?: PluginOverrides;\n}\n\nexport interface VitePackageJsonOverride extends ViteBundlerConfig {\n config?: Omit<import('vite').UserConfig, 'plugins'>;\n devServer?: false;\n}\n\nexport interface WebComponentBranchConfigs {\n publishTag?: string;\n uploadSourcemaps?: boolean;\n}\n\ninterface WebComponentOptions {\n legacyRoot?: boolean;\n /**\n * mapping of git branches to configs.\n * Used to separate configs (ex publish tag) depending on current branch\n */\n branches?: Record<string, WebComponentBranchConfigs>;\n}\n\ntype Configuration = {\n 'bundler'?: Bundler;\n 'jest'?: JestConfiguration;\n 'legacy'?: boolean;\n 'lint'?: { eslint: ESLintConfiguration; stylelint: StylelintConfiguration };\n 'review'?: ReviewConfiguration;\n 'swc-compile-package'?: Parameters<typeof swcDir>[0];\n 'test'?: JestConfiguration; // for backward-compatibility\n 'testRunner'?: string;\n 'expose-process-env'?: string[];\n 'expose-shared-dependencies'?: boolean;\n 'shared-dependencies'?: Record<string, string>;\n 'vite'?: false | VitePackageJsonOverride;\n 'vitest'?: VitestConfiguration;\n 'web-component'?: boolean | string | WebComponentOptions;\n 'webpack'?: false | WebpackConfiguration;\n} & {\n [key in CommandName]?: NodeConfiguration;\n} & NodeConfiguration;\n\nexport function getConfiguration(locationOrJson: LocationOrJson = './'): Configuration {\n const json =\n typeof locationOrJson === 'string'\n ? readJson(path.join(locationOrJson, 'package.json'))\n : locationOrJson;\n return json?.cli ?? {};\n}\n\nexport function getConfigurationSafe(locationOrJson: LocationOrJson = './'): Configuration {\n const json =\n typeof locationOrJson === 'string'\n ? readJsonSafe(path.join(locationOrJson, 'package.json'))\n : locationOrJson;\n return json?.cli ?? {};\n}\n\nexport function getESLintConfiguration() {\n return getConfiguration().lint?.eslint ?? {};\n}\n\nexport function getJestConfiguration() {\n const configuration = getConfiguration();\n return configuration.jest ?? configuration.test ?? {};\n}\n\nexport function getReviewConfiguration() {\n return getConfiguration().review ?? {};\n}\n\nexport function getStylelintConfiguration() {\n return getConfiguration().lint?.stylelint ?? {};\n}\n\nexport function getExposeProcessEnv(): string[] {\n return getConfiguration()['expose-process-env'] ?? [];\n}\n\nexport function getViteConfiguration(): VitePackageJsonOverride {\n const { vite } = getConfiguration();\n return typeof vite === 'object' ? vite : {};\n}\n\nexport function getVitestConfiguration() {\n return getConfiguration().vitest ?? {};\n}\n\nexport function getWebpackConfiguration(locationOrJson?: LocationOrJson) {\n const { webpack } = getConfiguration(locationOrJson);\n return typeof webpack === 'object' ? webpack : {};\n}\n\nexport function getWebComponentConfiguration(\n locationOrJson: LocationOrJson = './'\n): WebComponentOptions | undefined {\n const config = getConfigurationSafe(locationOrJson)['web-component'];\n\n if (config === true) {\n return {};\n }\n\n if (typeof config === 'object') {\n return config;\n }\n\n if (typeof config === 'string') {\n const configPath = path.resolve(\n typeof locationOrJson === 'string' ? path.join(locationOrJson, config) : config\n );\n if (fs.existsSync(configPath)) {\n return require(path.resolve(configPath));\n }\n log.warning(`could not find web-component configuration: \"${config}\"`);\n\n return undefined;\n }\n}\n\nexport function getWebComponentBranchConfigs(locationOrJson: LocationOrJson = './') {\n const config = getWebComponentConfiguration(locationOrJson);\n\n return config?.branches;\n}\n\nexport function hasHeadlessBundle() {\n let source: string;\n try {\n source = getFolders().source;\n } catch {\n return false;\n }\n const headlessPath = path.join(source, 'headless.ts');\n return fs.existsSync(headlessPath);\n}\n\nexport function getSwcCompilePackageConfiguration() {\n return getConfiguration()['swc-compile-package'] ?? {};\n}\n\nexport function isBundle(locationOrJson?: LocationOrJson) {\n const { webpack, vite } = getConfiguration(locationOrJson);\n assertBundlersAgree(webpack, vite, locationOrJson);\n return webpack !== false && vite !== false;\n}\n\nexport function isDevServerDisabled() {\n const webpackConfiguration = getWebpackConfiguration();\n return webpackConfiguration.devServer === false;\n}\n\nexport function isViteDevServerDisabled() {\n return getViteConfiguration().devServer === false;\n}\n\nexport function isExposeSharedDependencies() {\n return (\n (getConfiguration()['expose-shared-dependencies'] ??\n getWebpackConfiguration()['expose-shared-dependencies']) === true\n );\n}\n\nexport function isLegacy(locationOrJson?: LocationOrJson) {\n return getConfiguration(locationOrJson).legacy === true;\n}\n\nexport function isLegacyRoot() {\n return getWebComponentConfiguration()?.legacyRoot === true;\n}\n\nexport function isStyleCheckDisabled() {\n return getWebpackConfiguration()['disable-style-check'] === true;\n}\n\nexport function isWebComponent(locationOrJson: LocationOrJson = './') {\n return !!getWebComponentConfiguration(locationOrJson);\n}\n\n/*\n * Require that Vite and Webpack configurations agree whether package is a bundle.\n */\nfunction assertBundlersAgree(\n webpack: Configuration['webpack'],\n vite: Configuration['vite'],\n locationOrJson?: LocationOrJson\n) {\n if (webpack === undefined || vite === undefined || !!webpack === !!vite) {\n return;\n }\n\n const mismatch =\n webpack === false\n ? { falsy: 'cli.webpack', truthy: 'cli.vite' }\n : { falsy: 'cli.vite', truthy: 'cli.webpack' };\n\n throw new Error(\n `package ${getPackageName(locationOrJson)} has conflicting webpack ` +\n `and vite configurations: ${mismatch.falsy} is false but ` +\n `${mismatch.truthy} is not`\n );\n}\n"],"names":["CommandName","allowedWebpackDevServerOptions","getConfiguration","getConfigurationSafe","getESLintConfiguration","getExposeProcessEnv","getJestConfiguration","getReviewConfiguration","getStylelintConfiguration","getSwcCompilePackageConfiguration","getViteConfiguration","getVitestConfiguration","getWebComponentBranchConfigs","getWebComponentConfiguration","getWebpackConfiguration","hasHeadlessBundle","isBundle","isDevServerDisabled","isExposeSharedDependencies","isLegacy","isLegacyRoot","isStyleCheckDisabled","isViteDevServerDisabled","isWebComponent","locationOrJson","json","readJson","path","join","cli","readJsonSafe","lint","eslint","configuration","jest","test","review","stylelint","vite","vitest","webpack","config","configPath","resolve","fs","existsSync","require","log","warning","undefined","branches","source","getFolders","headlessPath","assertBundlersAgree","webpackConfiguration","devServer","legacy","legacyRoot","mismatch","falsy","truthy","Error","getPackageName"],"mappings":";;;;;;;;;;;QAqEYA;eAAAA;;QA/CCC;eAAAA;;QAgJGC;eAAAA;;QAQAC;eAAAA;;QAQAC;eAAAA;;QAiBAC;eAAAA;;QAbAC;eAAAA;;QAKAC;eAAAA;;QAIAC;eAAAA;;QAiEAC;eAAAA;;QAzDAC;eAAAA;;QAKAC;eAAAA;;QAmCAC;eAAAA;;QA1BAC;eAAAA;;QALAC;eAAAA;;QAqCAC;eAAAA;;QAeAC;eAAAA;;QAMAC;eAAAA;;QASAC;eAAAA;;QAOAC;eAAAA;;QAIAC;eAAAA;;QAIAC;eAAAA;;QAnBAC;eAAAA;;QAuBAC;eAAAA;;;2DAvSD;6DACE;4BAMU;gCACI;qBACX;0BACmB;;;;;;AAShC,MAAMtB,iCAAiC;IAAC;IAAW;IAAQ;IAAS;CAAS;AA+C7E,IAAA,AAAKD,qCAAAA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oBd,SAASF,MAAMd;IACnC,OAAOgB,YAAY,SAASF,SAAS;AACzC;AAEO,SAASrB;IACZ,MAAMsC,uBAAuBzC;IAC7B,OAAOyC,qBAAqBC,SAAS,KAAK;AAC9C;AAEO,SAASlC;IACZ,OAAOZ,uBAAuB8C,SAAS,KAAK;AAChD;AAEO,SAAStC;QAEPhB;IADL,OACI,EAACA,6CAAAA,kBAAkB,CAAC,6BAA6B,cAAhDA,wDAAAA,6CACGY,yBAAyB,CAAC,6BAA6B,MAAM;AAEzE;AAEO,SAASK,SAASK,cAA+B;IACpD,OAAOtB,iBAAiBsB,gBAAgBiC,MAAM,KAAK;AACvD;AAEO,SAASrC;QACLP;IAAP,OAAOA,EAAAA,gCAAAA,4CAAAA,oDAAAA,8BAAgC6C,UAAU,MAAK;AAC1D;AAEO,SAASrC;IACZ,OAAOP,yBAAyB,CAAC,sBAAsB,KAAK;AAChE;AAEO,SAASS,eAAeC,iBAAiC,IAAI;IAChE,OAAO,CAAC,CAACX,6BAA6BW;AAC1C;AAEA;;CAEC,GACD,SAAS8B,oBACLd,OAAiC,EACjCF,IAA2B,EAC3Bd,cAA+B;IAE/B,IAAIgB,YAAYS,aAAaX,SAASW,aAAa,CAAC,CAACT,YAAY,CAAC,CAACF,MAAM;QACrE;IACJ;IAEA,MAAMqB,WACFnB,YAAY,QACN;QAAEoB,OAAO;QAAeC,QAAQ;IAAW,IAC3C;QAAED,OAAO;QAAYC,QAAQ;IAAc;IAErD,MAAM,IAAIC,MACN,CAAC,QAAQ,EAAEC,IAAAA,8BAAc,EAACvC,gBAAgB,yBAAyB,CAAC,GAChE,CAAC,yBAAyB,EAAEmC,SAASC,KAAK,CAAC,cAAc,CAAC,GAC1D,GAAGD,SAASE,MAAM,CAAC,OAAO,CAAC;AAEvC"}
|
|
1
|
+
{"version":3,"sources":["../../src/utils/get-configuration.ts"],"sourcesContent":["import type { Config } from '@jest/types';\nimport type { swcDir } from '@swc/cli';\nimport type { ESLint } from 'eslint';\nimport fs from 'fs';\nimport path from 'path';\nimport type { LinterOptions } from 'stylelint';\nimport type svgr from 'vite-plugin-svgr';\nimport type { ViteUserConfig } from 'vitest/config';\nimport type { Configuration as WebpackDevServerConfiguration } from 'webpack-dev-server';\nimport type { ReviewConfiguration } from '../cli/commands/review';\nimport { bundleConstants } from '../core/constants';\nimport { getFolders } from './get-folders';\nimport { getPackageName } from './get-package-name';\nimport { log } from './log';\nimport { readJson, readJsonSafe } from './read-json';\nimport { LocationOrJson } from './types';\n\ntype VitePluginSvgrOptions = NonNullable<Parameters<typeof svgr>[0]>;\n\ntype ElementType<T> = T extends readonly (infer ElementType)[] ? ElementType : never;\n\nexport type Bundler = ElementType<typeof bundleConstants.bundlers>;\n\nexport const allowedWebpackDevServerOptions = ['headers', 'port', 'proxy', 'static'] as const;\n\nexport interface MinifyJSOptions {\n compress?: boolean;\n mangle?: boolean;\n}\n\nexport interface MinifyCssOptions {}\n\nexport interface MinifyOptions {\n css?: boolean | MinifyCssOptions;\n js?: boolean | MinifyJSOptions;\n}\n\nexport interface WebpackConfiguration extends Omit<\n Pick<WebpackDevServerConfiguration, ElementType<typeof allowedWebpackDevServerOptions>>,\n 'proxy'\n> {\n 'contentBase'?: boolean | string | string[] | number; // deprecated 2024-07\n 'custom-style-rules'?: boolean;\n 'expose-shared-dependencies'?: boolean;\n 'devServer'?: false | WebpackDevServerConfiguration;\n 'disable-style-check'?: boolean;\n 'minify'?: MinifyOptions;\n 'proxy'?: WebpackDevServerConfiguration['proxy'] | string;\n 'shared-dependencies'?: Record<string, string>;\n}\n\nexport interface ESLintConfiguration extends ESLint.Options {\n disabled?: boolean;\n}\n\nexport interface StylelintConfiguration extends Partial<LinterOptions> {\n ignorePattern?: string[];\n disabled?: boolean;\n}\n\nexport interface JestConfiguration extends Omit<Config.Argv, '_' | '$0'> {\n omitDefault?: string[];\n}\n\nexport interface NodeConfiguration {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n NODE_OPTIONS?: string[];\n}\n\n/* eslint-disable @typescript-eslint/naming-convention */\nexport enum CommandName {\n 'build' = 'build',\n 'bundle-package' = 'bundle-package',\n 'bundle-vite' = 'bundle-vite',\n 'bundle-webpack' = 'bundle-webpack',\n 'clean' = 'clean',\n 'convert-eslint-config' = 'convert-eslint-config',\n 'eslint' = 'eslint',\n 'init' = 'init',\n 'install' = 'install',\n 'kendo-ui-license' = 'kendo-ui-license',\n 'lint' = 'lint',\n 'mfe-check' = 'mfe-check',\n 'mfe-generate-metadata' = 'mfe-generate-metadata',\n 'mfe-list' = 'mfe-list',\n 'mfe-package-clean' = 'mfe-package-clean',\n 'mfe-package-publish' = 'mfe-package-publish',\n 'mfe-package-rollback' = 'mfe-package-rollback',\n 'mfe-publish' = 'mfe-publish',\n 'mfe-purge-cache' = 'mfe-purge-cache',\n 'prepare-package' = 'prepare-package',\n 'review' = 'review',\n 'start' = 'start',\n 'stylelint' = 'stylelint',\n 'styles-check' = 'styles-check',\n 'test' = 'test',\n 'task' = 'task',\n 'upload-sourcemaps' = 'upload-sourcemaps',\n}\n/* eslint-enable @typescript-eslint/naming-convention */\n\nexport type VitestConfiguration = ViteUserConfig['test'] & {\n omitDefault?: string[];\n};\n\nexport interface HtmlPluginOptions {\n title?: string;\n favicon?: string;\n template?: string;\n}\n\nexport interface SvgrPluginOptions {\n include?: VitePluginSvgrOptions['include'];\n exclude?: VitePluginSvgrOptions['exclude'];\n svgrOptions?: VitePluginSvgrOptions['svgrOptions'];\n}\n\nexport interface PluginOverrides {\n html?: HtmlPluginOptions;\n svgr?: SvgrPluginOptions;\n}\n\nexport interface ViteBundlerConfig {\n port?: number;\n omitDefault?: string[];\n minify?: MinifyOptions;\n pluginOverrides?: PluginOverrides;\n}\n\nexport interface VitePackageJsonOverride extends ViteBundlerConfig {\n config?: Omit<import('vite').UserConfig, 'plugins'>;\n devServer?: false;\n}\n\nexport interface WebComponentBranchConfigs {\n publishTag?: string;\n uploadSourcemaps?: boolean;\n}\n\ninterface WebComponentOptions {\n legacyRoot?: boolean;\n /**\n * mapping of git branches to configs.\n * Used to separate configs (ex publish tag) depending on current branch\n */\n branches?: Record<string, WebComponentBranchConfigs>;\n}\n\nexport type Configuration = {\n 'bundler'?: Bundler;\n 'jest'?: JestConfiguration;\n 'legacy'?: boolean;\n 'lint'?: { eslint: ESLintConfiguration; stylelint: StylelintConfiguration };\n 'review'?: ReviewConfiguration;\n 'swc-compile-package'?: Parameters<typeof swcDir>[0];\n 'test'?: JestConfiguration; // for backward-compatibility\n 'testRunner'?: string;\n 'expose-process-env'?: string[];\n 'expose-shared-dependencies'?: boolean;\n 'shared-dependencies'?: Record<string, string>;\n 'vite'?: false | VitePackageJsonOverride;\n 'vitest'?: VitestConfiguration;\n 'web-component'?: boolean | string | WebComponentOptions;\n 'webpack'?: false | WebpackConfiguration;\n} & {\n [key in CommandName]?: NodeConfiguration;\n} & NodeConfiguration;\n\nexport function getConfiguration(locationOrJson: LocationOrJson = './'): Configuration {\n const json =\n typeof locationOrJson === 'string'\n ? readJson(path.join(locationOrJson, 'package.json'))\n : locationOrJson;\n return json?.cli ?? {};\n}\n\nexport function getConfigurationSafe(locationOrJson: LocationOrJson = './'): Configuration {\n const json =\n typeof locationOrJson === 'string'\n ? readJsonSafe(path.join(locationOrJson, 'package.json'))\n : locationOrJson;\n return json?.cli ?? {};\n}\n\nexport function getESLintConfiguration() {\n return getConfiguration().lint?.eslint ?? {};\n}\n\nexport function getJestConfiguration() {\n const configuration = getConfiguration();\n return configuration.jest ?? configuration.test ?? {};\n}\n\nexport function getReviewConfiguration() {\n return getConfiguration().review ?? {};\n}\n\nexport function getStylelintConfiguration() {\n return getConfiguration().lint?.stylelint ?? {};\n}\n\nexport function getExposeProcessEnv(): string[] {\n return getConfiguration()['expose-process-env'] ?? [];\n}\n\nexport function getViteConfiguration(): VitePackageJsonOverride {\n const { vite } = getConfiguration();\n return typeof vite === 'object' ? vite : {};\n}\n\nexport function getVitestConfiguration() {\n return getConfiguration().vitest ?? {};\n}\n\nexport function getWebpackConfiguration(locationOrJson?: LocationOrJson) {\n const { webpack } = getConfiguration(locationOrJson);\n return typeof webpack === 'object' ? webpack : {};\n}\n\nexport function getWebComponentConfiguration(\n locationOrJson: LocationOrJson = './'\n): WebComponentOptions | undefined {\n const config = getConfigurationSafe(locationOrJson)['web-component'];\n\n if (config === true) {\n return {};\n }\n\n if (typeof config === 'object') {\n return config;\n }\n\n if (typeof config === 'string') {\n const configPath = path.resolve(\n typeof locationOrJson === 'string' ? path.join(locationOrJson, config) : config\n );\n if (fs.existsSync(configPath)) {\n return require(path.resolve(configPath));\n }\n log.warning(`could not find web-component configuration: \"${config}\"`);\n\n return undefined;\n }\n}\n\nexport function getWebComponentBranchConfigs(locationOrJson: LocationOrJson = './') {\n const config = getWebComponentConfiguration(locationOrJson);\n\n return config?.branches;\n}\n\nexport function hasHeadlessBundle() {\n let source: string;\n try {\n source = getFolders().source;\n } catch {\n return false;\n }\n const headlessPath = path.join(source, 'headless.ts');\n return fs.existsSync(headlessPath);\n}\n\nexport function getSwcCompilePackageConfiguration() {\n return getConfiguration()['swc-compile-package'] ?? {};\n}\n\nexport function isBundle(locationOrJson?: LocationOrJson) {\n const { webpack, vite } = getConfiguration(locationOrJson);\n assertBundlersAgree(webpack, vite, locationOrJson);\n return webpack !== false && vite !== false;\n}\n\nexport function isDevServerDisabled() {\n const webpackConfiguration = getWebpackConfiguration();\n return webpackConfiguration.devServer === false;\n}\n\nexport function isViteDevServerDisabled() {\n return getViteConfiguration().devServer === false;\n}\n\nexport function getSharedDependencies(locationOrJson?: LocationOrJson) {\n return (\n getConfiguration(locationOrJson)['shared-dependencies'] ??\n getWebpackConfiguration(locationOrJson)['shared-dependencies']\n );\n}\n\nexport function isExposeSharedDependencies(locationOrJson?: LocationOrJson) {\n return (\n (getConfiguration(locationOrJson)['expose-shared-dependencies'] ??\n getWebpackConfiguration(locationOrJson)['expose-shared-dependencies']) === true\n );\n}\n\nexport function isLegacy(locationOrJson?: LocationOrJson) {\n return getConfiguration(locationOrJson).legacy === true;\n}\n\nexport function isLegacyRoot() {\n return getWebComponentConfiguration()?.legacyRoot === true;\n}\n\nexport function isStyleCheckDisabled() {\n return getWebpackConfiguration()['disable-style-check'] === true;\n}\n\nexport function isWebComponent(locationOrJson: LocationOrJson = './') {\n return !!getWebComponentConfiguration(locationOrJson);\n}\n\n/*\n * Require that Vite and Webpack configurations agree whether package is a bundle.\n */\nfunction assertBundlersAgree(\n webpack: Configuration['webpack'],\n vite: Configuration['vite'],\n locationOrJson?: LocationOrJson\n) {\n if (webpack === undefined || vite === undefined || !!webpack === !!vite) {\n return;\n }\n\n const mismatch =\n webpack === false\n ? { falsy: 'cli.webpack', truthy: 'cli.vite' }\n : { falsy: 'cli.vite', truthy: 'cli.webpack' };\n\n throw new Error(\n `package ${getPackageName(locationOrJson)} has conflicting webpack ` +\n `and vite configurations: ${mismatch.falsy} is false but ` +\n `${mismatch.truthy} is not`\n );\n}\n"],"names":["CommandName","allowedWebpackDevServerOptions","getConfiguration","getConfigurationSafe","getESLintConfiguration","getExposeProcessEnv","getJestConfiguration","getReviewConfiguration","getSharedDependencies","getStylelintConfiguration","getSwcCompilePackageConfiguration","getViteConfiguration","getVitestConfiguration","getWebComponentBranchConfigs","getWebComponentConfiguration","getWebpackConfiguration","hasHeadlessBundle","isBundle","isDevServerDisabled","isExposeSharedDependencies","isLegacy","isLegacyRoot","isStyleCheckDisabled","isViteDevServerDisabled","isWebComponent","locationOrJson","json","readJson","path","join","cli","readJsonSafe","lint","eslint","configuration","jest","test","review","stylelint","vite","vitest","webpack","config","configPath","resolve","fs","existsSync","require","log","warning","undefined","branches","source","getFolders","headlessPath","assertBundlersAgree","webpackConfiguration","devServer","legacy","legacyRoot","mismatch","falsy","truthy","Error","getPackageName"],"mappings":";;;;;;;;;;;QAsEYA;eAAAA;;QA/CCC;eAAAA;;QAiJGC;eAAAA;;QAQAC;eAAAA;;QAQAC;eAAAA;;QAiBAC;eAAAA;;QAbAC;eAAAA;;QAKAC;eA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AC3B,mBAAmB,SAAS,CAAC;AAC7B,cAAc,gCAAgC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,mBAAmB,SAAS,CAAC;AAC7B,cAAc,gCAAgC,CAAC"}
|
package/dist/utils/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
+
_export_star(require("./exit-when-parent-exits"), exports);
|
|
5
6
|
_export_star(require("./find-packages"), exports);
|
|
6
7
|
_export_star(require("./find-up"), exports);
|
|
7
8
|
_export_star(require("./format-duration"), exports);
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/index.ts"],"sourcesContent":["export * from './find-packages';\nexport * from './find-up';\nexport * from './format-duration';\nexport * from './format-relative-date';\nexport * from './get-base-tsconfig';\nexport * from './get-branch-configs';\nexport * from './get-configuration';\nexport * from './get-default-test-excludes';\nexport * from './get-destination-folders';\nexport * from './get-folders';\nexport * from './get-jest-config';\nexport * from './get-package-data';\nexport * from './get-package-name';\nexport * from './get-packages';\nexport * from './get-tsconfig';\nexport * from './get-tsconfig-with-fallback';\nexport * from './load-shared-dependencies';\nexport * from './log';\nexport * from './log-errors';\nexport * from './omit';\nexport * from './pick';\nexport * from './prettify';\nexport * from './read-json';\nexport * from './to-array';\nexport type * from './types';\nexport * from './validate-shared-dependencies';\n"],"names":[],"mappings":";;;;qBAAc;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBAEA"}
|
|
1
|
+
{"version":3,"sources":["../../src/utils/index.ts"],"sourcesContent":["export * from './exit-when-parent-exits';\nexport * from './find-packages';\nexport * from './find-up';\nexport * from './format-duration';\nexport * from './format-relative-date';\nexport * from './get-base-tsconfig';\nexport * from './get-branch-configs';\nexport * from './get-configuration';\nexport * from './get-default-test-excludes';\nexport * from './get-destination-folders';\nexport * from './get-folders';\nexport * from './get-jest-config';\nexport * from './get-package-data';\nexport * from './get-package-name';\nexport * from './get-packages';\nexport * from './get-tsconfig';\nexport * from './get-tsconfig-with-fallback';\nexport * from './load-shared-dependencies';\nexport * from './log';\nexport * from './log-errors';\nexport * from './omit';\nexport * from './pick';\nexport * from './prettify';\nexport * from './read-json';\nexport * from './to-array';\nexport type * from './types';\nexport * from './validate-shared-dependencies';\n"],"names":[],"mappings":";;;;qBAAc;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBAEA"}
|
package/dist/utils/log.js
CHANGED
package/dist/utils/log.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/log.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { createDebug } from './debug';\n\ntype Debugger = ReturnType<typeof createDebug>;\n\nclass Log {\n private readonly debugMap: Map<string, Debugger>;\n\n constructor() {\n this.debugMap = new Map<string, Debugger>();\n }\n\n get timestamp() {\n return new Date().toLocaleTimeString(undefined, {\n hour12: false,\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n fractionalSecondDigits: 3,\n });\n }\n\n text(...text: string[]) {\n process.stdout.write(chalk(...text) + '\\n');\n }\n\n info(...text: string[]) {\n process.stdout.write(chalk.bold.cyan(...text) + '\\n');\n }\n\n success(...text: string[]) {\n process.stdout.write(chalk.bold.green(...text) + '\\n');\n }\n\n warning(...text: string[]) {\n process.stdout.write(chalk.bold.yellow(...text) + '\\n');\n }\n\n error(...text: string[]) {\n process.stdout.write(chalk.bold.red(...text) + '\\n');\n }\n\n debug(namespace: string, ...text: any[]) {\n let dbg = this.debugMap.get(namespace);\n if (!dbg) {\n dbg = createDebug(namespace);\n this.debugMap.set(namespace, dbg);\n }\n if (dbg.enabled && text.length) {\n const [formatter, ...args] = text.map(str => (typeof str === 'function' ? str() : str));\n dbg(formatter, ...args);\n }\n return dbg;\n }\n}\n\nexport const log = new Log();\n"],"names":["log","Log","timestamp","Date","toLocaleTimeString","undefined","hour12","hour","minute","second","fractionalSecondDigits","text","process","stdout","write","chalk","info","bold","cyan","success","green","warning","yellow","error","red","debug","namespace","dbg","debugMap","get","createDebug","set","enabled","length","formatter","args","map","str","Map"],"mappings":";;;;+BAwDaA;;;eAAAA;;;8DAxDK;uBACU
|
|
1
|
+
{"version":3,"sources":["../../src/utils/log.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { createDebug } from './debug';\n\ntype Debugger = ReturnType<typeof createDebug>;\n\nclass Log {\n private readonly debugMap: Map<string, Debugger>;\n\n constructor() {\n this.debugMap = new Map<string, Debugger>();\n }\n\n get timestamp() {\n return new Date().toLocaleTimeString(undefined, {\n hour12: false,\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n fractionalSecondDigits: 3,\n });\n }\n\n text(...text: string[]) {\n process.stdout.write(chalk(...text) + '\\n');\n }\n\n info(...text: string[]) {\n process.stdout.write(chalk.bold.cyan(...text) + '\\n');\n }\n\n success(...text: string[]) {\n process.stdout.write(chalk.bold.green(...text) + '\\n');\n }\n\n warning(...text: string[]) {\n process.stdout.write(chalk.bold.yellow(...text) + '\\n');\n }\n\n error(...text: string[]) {\n process.stdout.write(chalk.bold.red(...text) + '\\n');\n }\n\n debug(namespace: string, ...text: any[]) {\n let dbg = this.debugMap.get(namespace);\n if (!dbg) {\n dbg = createDebug(namespace);\n this.debugMap.set(namespace, dbg);\n }\n if (dbg.enabled && text.length) {\n const [formatter, ...args] = text.map(str => (typeof str === 'function' ? str() : str));\n dbg(formatter, ...args);\n }\n return dbg;\n }\n}\n\nexport const log = new Log();\n"],"names":["log","Log","timestamp","Date","toLocaleTimeString","undefined","hour12","hour","minute","second","fractionalSecondDigits","text","process","stdout","write","chalk","info","bold","cyan","success","green","warning","yellow","error","red","debug","namespace","dbg","debugMap","get","createDebug","set","enabled","length","formatter","args","map","str","Map"],"mappings":";;;;+BAwDaA;;;eAAAA;;;8DAxDK;uBACU;;;;;;;;;;;;;;;;;AAI5B,MAAMC;IAOF,IAAIC,YAAY;QACZ,OAAO,IAAIC,OAAOC,kBAAkB,CAACC,WAAW;YAC5CC,QAAQ;YACRC,MAAM;YACNC,QAAQ;YACRC,QAAQ;YACRC,wBAAwB;QAC5B;IACJ;IAEAC,KAAK,GAAGA,IAAc,EAAE;QACpBC,QAAQC,MAAM,CAACC,KAAK,CAACC,IAAAA,cAAK,KAAIJ,QAAQ;IAC1C;IAEAK,KAAK,GAAGL,IAAc,EAAE;QACpBC,QAAQC,MAAM,CAACC,KAAK,CAACC,cAAK,CAACE,IAAI,CAACC,IAAI,IAAIP,QAAQ;IACpD;IAEAQ,QAAQ,GAAGR,IAAc,EAAE;QACvBC,QAAQC,MAAM,CAACC,KAAK,CAACC,cAAK,CAACE,IAAI,CAACG,KAAK,IAAIT,QAAQ;IACrD;IAEAU,QAAQ,GAAGV,IAAc,EAAE;QACvBC,QAAQC,MAAM,CAACC,KAAK,CAACC,cAAK,CAACE,IAAI,CAACK,MAAM,IAAIX,QAAQ;IACtD;IAEAY,MAAM,GAAGZ,IAAc,EAAE;QACrBC,QAAQC,MAAM,CAACC,KAAK,CAACC,cAAK,CAACE,IAAI,CAACO,GAAG,IAAIb,QAAQ;IACnD;IAEAc,MAAMC,SAAiB,EAAE,GAAGf,IAAW,EAAE;QACrC,IAAIgB,MAAM,IAAI,CAACC,QAAQ,CAACC,GAAG,CAACH;QAC5B,IAAI,CAACC,KAAK;YACNA,MAAMG,IAAAA,kBAAW,EAACJ;YAClB,IAAI,CAACE,QAAQ,CAACG,GAAG,CAACL,WAAWC;QACjC;QACA,IAAIA,IAAIK,OAAO,IAAIrB,KAAKsB,MAAM,EAAE;YAC5B,MAAM,CAACC,WAAW,GAAGC,KAAK,GAAGxB,KAAKyB,GAAG,CAACC,CAAAA,MAAQ,OAAOA,QAAQ,aAAaA,QAAQA;YAClFV,IAAIO,cAAcC;QACtB;QACA,OAAOR;IACX;IA7CA,aAAc;QAFd,uBAAiBC,YAAjB,KAAA;QAGI,IAAI,CAACA,QAAQ,GAAG,IAAIU;IACxB;AA4CJ;AAEO,MAAMtC,MAAM,IAAIC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-shared-dependencies.d.ts","sourceRoot":"","sources":["../../src/vite/build-shared-dependencies.ts"],"names":[],"mappings":"AACA,OAAO,EAEH,mBAAmB,EAItB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"build-shared-dependencies.d.ts","sourceRoot":"","sources":["../../src/vite/build-shared-dependencies.ts"],"names":[],"mappings":"AACA,OAAO,EAEH,mBAAmB,EAItB,MAAM,SAAS,CAAC;AAKjB,wBAAsB,uBAAuB,CAAC,OAAO,EAAE,mBAAmB,iBAmBzE"}
|
|
@@ -11,6 +11,7 @@ Object.defineProperty(exports, "buildSharedDependencies", {
|
|
|
11
11
|
const _vite = require("vite");
|
|
12
12
|
const _core = require("../core");
|
|
13
13
|
const _config = require("./config");
|
|
14
|
+
const _plugins = require("./plugins");
|
|
14
15
|
const _shareddependenciesplugin = require("./plugins/shared-dependencies-plugin");
|
|
15
16
|
async function buildSharedDependencies(options) {
|
|
16
17
|
var _config_build, _config_build1, _config_build2, _config_build3;
|
|
@@ -27,6 +28,7 @@ async function buildSharedDependencies(options) {
|
|
|
27
28
|
},
|
|
28
29
|
mode: getMode(context),
|
|
29
30
|
plugins: [
|
|
31
|
+
(0, _plugins.cleanPlugin)(context),
|
|
30
32
|
getSharedDependenciesPlugin(context)
|
|
31
33
|
],
|
|
32
34
|
build: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/vite/build-shared-dependencies.ts"],"sourcesContent":["import { build } from 'vite';\nimport {\n BuildContext,\n BuildContextOptions,\n bundleConstants,\n createBuildContext,\n resolveOutputPath,\n} from '../core';\nimport { createViteConfig } from './config';\nimport { sharedDependenciesPlugin } from './plugins/shared-dependencies-plugin';\n\nexport async function buildSharedDependencies(options: BuildContextOptions) {\n const config = await createViteConfig(options);\n const context = createBuildContext({ ...options, emitExposedDependencies: true });\n\n await build({\n configFile: false,\n oxc: {\n minify: config.oxc ? config.oxc.minify : undefined,\n legalComments: 'none',\n },\n mode: getMode(context),\n plugins: [getSharedDependenciesPlugin(context)],\n build: {\n outDir: resolveOutputPath(context, config.build?.outDir),\n minify: config.build?.minify,\n cssMinify: config.build?.cssMinify,\n terserOptions: config.build?.terserOptions,\n },\n });\n}\n\nfunction getMode(context: BuildContext) {\n return context.build.isProduction\n ? bundleConstants.mode.production\n : bundleConstants.mode.development;\n}\n\nfunction getSharedDependenciesPlugin(context: BuildContext) {\n const { destination: metadataDir, sharedDependencies: dependencies } = context.package;\n\n const css: Record<string, string[]> = {};\n if (dependencies['@servicetitan/design-system']) {\n css['design-system'] = [\n '@servicetitan/tokens/core/tokens.css',\n '@servicetitan/anvil-fonts/dist/css/anvil-fonts.css',\n '@servicetitan/design-system/dist/system.min.css',\n ];\n }\n\n return sharedDependenciesPlugin({ css, dependencies, metadataDir });\n}\n"],"names":["buildSharedDependencies","options","config","createViteConfig","context","createBuildContext","emitExposedDependencies","build","configFile","oxc","minify","undefined","legalComments","mode","getMode","plugins","getSharedDependenciesPlugin","outDir","resolveOutputPath","cssMinify","terserOptions","isProduction","bundleConstants","production","development","destination","metadataDir","sharedDependencies","dependencies","package","css","sharedDependenciesPlugin"],"mappings":";;;;+
|
|
1
|
+
{"version":3,"sources":["../../src/vite/build-shared-dependencies.ts"],"sourcesContent":["import { build } from 'vite';\nimport {\n BuildContext,\n BuildContextOptions,\n bundleConstants,\n createBuildContext,\n resolveOutputPath,\n} from '../core';\nimport { createViteConfig } from './config';\nimport { cleanPlugin } from './plugins';\nimport { sharedDependenciesPlugin } from './plugins/shared-dependencies-plugin';\n\nexport async function buildSharedDependencies(options: BuildContextOptions) {\n const config = await createViteConfig(options);\n const context = createBuildContext({ ...options, emitExposedDependencies: true });\n\n await build({\n configFile: false,\n oxc: {\n minify: config.oxc ? config.oxc.minify : undefined,\n legalComments: 'none',\n },\n mode: getMode(context),\n plugins: [cleanPlugin(context), getSharedDependenciesPlugin(context)],\n build: {\n outDir: resolveOutputPath(context, config.build?.outDir),\n minify: config.build?.minify,\n cssMinify: config.build?.cssMinify,\n terserOptions: config.build?.terserOptions,\n },\n });\n}\n\nfunction getMode(context: BuildContext) {\n return context.build.isProduction\n ? bundleConstants.mode.production\n : bundleConstants.mode.development;\n}\n\nfunction getSharedDependenciesPlugin(context: BuildContext) {\n const { destination: metadataDir, sharedDependencies: dependencies } = context.package;\n\n const css: Record<string, string[]> = {};\n if (dependencies['@servicetitan/design-system']) {\n css['design-system'] = [\n '@servicetitan/tokens/core/tokens.css',\n '@servicetitan/anvil-fonts/dist/css/anvil-fonts.css',\n '@servicetitan/design-system/dist/system.min.css',\n ];\n }\n\n return sharedDependenciesPlugin({ css, dependencies, metadataDir });\n}\n"],"names":["buildSharedDependencies","options","config","createViteConfig","context","createBuildContext","emitExposedDependencies","build","configFile","oxc","minify","undefined","legalComments","mode","getMode","plugins","cleanPlugin","getSharedDependenciesPlugin","outDir","resolveOutputPath","cssMinify","terserOptions","isProduction","bundleConstants","production","development","destination","metadataDir","sharedDependencies","dependencies","package","css","sharedDependenciesPlugin"],"mappings":";;;;+BAYsBA;;;eAAAA;;;sBAZA;sBAOf;wBAC0B;yBACL;0CACa;AAElC,eAAeA,wBAAwBC,OAA4B;QAa3BC,eAC3BA,gBACGA,gBACIA;IAfvB,MAAMA,SAAS,MAAMC,IAAAA,wBAAgB,EAACF;IACtC,MAAMG,UAAUC,IAAAA,wBAAkB,EAAC;QAAE,GAAGJ,OAAO;QAAEK,yBAAyB;IAAK;IAE/E,MAAMC,IAAAA,WAAK,EAAC;QACRC,YAAY;QACZC,KAAK;YACDC,QAAQR,OAAOO,GAAG,GAAGP,OAAOO,GAAG,CAACC,MAAM,GAAGC;YACzCC,eAAe;QACnB;QACAC,MAAMC,QAAQV;QACdW,SAAS;YAACC,IAAAA,oBAAW,EAACZ;YAAUa,4BAA4Bb;SAAS;QACrEG,OAAO;YACHW,QAAQC,IAAAA,uBAAiB,EAACf,UAASF,gBAAAA,OAAOK,KAAK,cAAZL,oCAAAA,cAAcgB,MAAM;YACvDR,MAAM,GAAER,iBAAAA,OAAOK,KAAK,cAAZL,qCAAAA,eAAcQ,MAAM;YAC5BU,SAAS,GAAElB,iBAAAA,OAAOK,KAAK,cAAZL,qCAAAA,eAAckB,SAAS;YAClCC,aAAa,GAAEnB,iBAAAA,OAAOK,KAAK,cAAZL,qCAAAA,eAAcmB,aAAa;QAC9C;IACJ;AACJ;AAEA,SAASP,QAAQV,OAAqB;IAClC,OAAOA,QAAQG,KAAK,CAACe,YAAY,GAC3BC,qBAAe,CAACV,IAAI,CAACW,UAAU,GAC/BD,qBAAe,CAACV,IAAI,CAACY,WAAW;AAC1C;AAEA,SAASR,4BAA4Bb,OAAqB;IACtD,MAAM,EAAEsB,aAAaC,WAAW,EAAEC,oBAAoBC,YAAY,EAAE,GAAGzB,QAAQ0B,OAAO;IAEtF,MAAMC,MAAgC,CAAC;IACvC,IAAIF,YAAY,CAAC,8BAA8B,EAAE;QAC7CE,GAAG,CAAC,gBAAgB,GAAG;YACnB;YACA;YACA;SACH;IACL;IAEA,OAAOC,IAAAA,kDAAwB,EAAC;QAAED;QAAKF;QAAcF;IAAY;AACrE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-config.d.ts","sourceRoot":"","sources":["../../../src/vite/config/base-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAU,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"base-config.d.ts","sourceRoot":"","sources":["../../../src/vite/config/base-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAU,MAAM,MAAM,CAAC;AA8BjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAkD5C,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,GAAG,YAAY,CAgFxE"}
|
|
@@ -24,6 +24,10 @@ function importMetaRemap(...definitions) {
|
|
|
24
24
|
}
|
|
25
25
|
function createPlugins(context) {
|
|
26
26
|
const entries = [
|
|
27
|
+
[
|
|
28
|
+
'reactRefresh',
|
|
29
|
+
(0, _plugins.reactRefreshPlugin)(context)
|
|
30
|
+
],
|
|
27
31
|
[
|
|
28
32
|
'bundleStat',
|
|
29
33
|
(0, _plugins.bundleStatPlugin)(context)
|
|
@@ -99,6 +103,8 @@ function createBaseConfig(context) {
|
|
|
99
103
|
cacheDir: `node_modules/.vite/${(_getBundleType = (0, _core.getBundleType)(context)) !== null && _getBundleType !== void 0 ? _getBundleType : 'host'}`,
|
|
100
104
|
customLogger: (0, _createfilteringlogger.createFilteringLogger)(),
|
|
101
105
|
server: {
|
|
106
|
+
// Windows machines can fail to connect to "localhost"; bind to a fixed address instead.
|
|
107
|
+
host: '127.0.0.1',
|
|
102
108
|
port: (_context_bundlerConfig_port = context.bundlerConfig.port) !== null && _context_bundlerConfig_port !== void 0 ? _context_bundlerConfig_port : isWebComponent ? 8888 : 8080
|
|
103
109
|
},
|
|
104
110
|
mode: isProduction ? _core.bundleConstants.mode.production : _core.bundleConstants.mode.development,
|
|
@@ -125,12 +131,19 @@ function createBaseConfig(context) {
|
|
|
125
131
|
}
|
|
126
132
|
},
|
|
127
133
|
define: {
|
|
134
|
+
/*
|
|
135
|
+
* Some dependencies assume Node's `global` exists (webpack polyfills this
|
|
136
|
+
* automatically for browser targets; Vite does not).
|
|
137
|
+
*/ global: 'globalThis',
|
|
128
138
|
...importMetaRemap((0, _core.defineExposedDependencies)(context), (0, _core.defineExposedInstanceDependencies)(context), (0, _core.defineWebComponentName)(context)),
|
|
129
139
|
...(_getProcessEnv = (0, _core.getProcessEnv)(context)) !== null && _getProcessEnv !== void 0 ? _getProcessEnv : {}
|
|
130
140
|
},
|
|
131
141
|
optimizeDeps: {
|
|
132
142
|
include: [
|
|
133
|
-
'@servicetitan/startup-utils'
|
|
143
|
+
'@servicetitan/startup-utils',
|
|
144
|
+
'react-refresh/runtime',
|
|
145
|
+
'react/jsx-runtime',
|
|
146
|
+
'react/jsx-dev-runtime'
|
|
134
147
|
],
|
|
135
148
|
/*
|
|
136
149
|
* Top-level plugins don't run during dependency pre-bundling, so
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/vite/config/base-config.ts"],"sourcesContent":["import type { InlineConfig, Plugin } from 'vite';\nimport {\n bundleConstants,\n defineExposedDependencies,\n defineExposedInstanceDependencies,\n defineWebComponentName,\n getBundleType,\n getCdnPath,\n getProcessEnv,\n} from '../../core';\nimport { omit } from '../../utils';\nimport {\n bundleStatPlugin,\n chainSourceMapsPlugin,\n cleanPlugin,\n cssInjectorPlugin,\n designSystemGuardPlugin,\n devServerRoutingPlugin,\n externalsPlugin,\n htmlPlugin,\n ignoreModulesPlugin,\n istanbulPlugin,\n magicCommentsPlugin,\n metadataPlugin,\n momentLocalesPlugin,\n styleUrlsPlugin,\n svgrPlugin,\n virtualModulesPlugin,\n} from '../plugins';\nimport { ViteBuildContext } from '../types';\nimport { assetFileNames } from './asset-file-names';\nimport { getCodeSplitting } from './code-splitting';\nimport { createCssConfig } from './create-css-config';\nimport { createFilteringLogger } from './create-filtering-logger';\n\nfunction importMetaRemap(\n ...definitions: (Record<string, string> | undefined)[]\n): Record<string, string> {\n const result: Record<string, string> = {};\n\n definitions\n .filter(definition => definition !== undefined)\n .forEach(definition =>\n Object.keys(definition).forEach(item => {\n result[`import.meta.env.${item}`] = definition[item];\n })\n );\n\n return result;\n}\n\nfunction createPlugins(context: ViteBuildContext) {\n const entries: [string, Plugin[] | Plugin | Promise<Plugin> | undefined][] = [\n ['bundleStat', bundleStatPlugin(context)],\n ['clean', cleanPlugin(context)],\n ['cssInjector', cssInjectorPlugin(context)],\n ['designSystemGuard', designSystemGuardPlugin(context)],\n ['devServerRouting', devServerRoutingPlugin(context)],\n ['externals', externalsPlugin(context)],\n ['html', htmlPlugin(context)],\n ['ignoreModules', ignoreModulesPlugin(context)],\n ['istanbul', istanbulPlugin(context)],\n ['magicComments', magicCommentsPlugin(context)],\n ['metadata', metadataPlugin(context)],\n ['momentLocales', momentLocalesPlugin(context)],\n ['styleUrls', styleUrlsPlugin(context)],\n ['svgr', svgrPlugin(context)],\n ['virtualModules', virtualModulesPlugin(context)],\n ];\n\n return entries\n .filter(\n ([name, plugin]) =>\n plugin && !context.bundlerConfig.omitDefault?.includes(`plugins.${name}`)\n )\n .flatMap(([, plugin]) => plugin);\n}\n\nexport function createBaseConfig(context: ViteBuildContext): InlineConfig {\n const { isProduction } = context.build;\n const { isWebComponent } = context.package;\n\n let config: InlineConfig = {\n cacheDir: `node_modules/.vite/${getBundleType(context) ?? 'host'}`,\n customLogger: createFilteringLogger(),\n server: { port: context.bundlerConfig.port ?? (isWebComponent ? 8888 : 8080) },\n mode: isProduction ? bundleConstants.mode.production : bundleConstants.mode.development,\n configFile: false,\n oxc: { legalComments: 'none' },\n base: getCdnPath(context) || './', // eslint-disable-line @typescript-eslint/prefer-nullish-coalescing\n css: createCssConfig(isProduction),\n build: {\n /*\n * MFEs render inside shadow DOM — lazy CSS chunks would inject into document.head,\n * leaking styles into the host. Bundling all CSS into one file avoids this.\n */\n cssCodeSplit: !isWebComponent,\n sourcemap: true,\n rolldownOptions: {\n output: { assetFileNames, codeSplitting: getCodeSplitting(context) },\n plugins: [chainSourceMapsPlugin()],\n },\n },\n define: {\n ...importMetaRemap(\n defineExposedDependencies(context),\n defineExposedInstanceDependencies(context),\n defineWebComponentName(context)\n ),\n ...(getProcessEnv(context) ?? {}),\n },\n optimizeDeps: {\n include: ['@servicetitan/startup-utils'],\n /*\n * Top-level plugins don't run during dependency pre-bundling, so\n * register ignoreModulesPlugin again here. Without this, missing\n * optional peer dependencies inside pre-bundled packages throw at\n * runtime instead of resolving to an empty module.\n */\n rolldownOptions: {\n plugins: [ignoreModulesPlugin(context)],\n },\n },\n plugins: createPlugins(context),\n };\n\n const omitKeys = context.bundlerConfig.omitDefault?.filter(k => !k.startsWith('plugins.'));\n if (omitKeys?.length) {\n config = omit({ ...config }, omitKeys);\n }\n\n if (context.bundlerConfig.minify.js !== undefined) {\n config.build = { ...config.build, minify: !!context.bundlerConfig.minify.js };\n }\n if (context.bundlerConfig.minify.css !== undefined) {\n config.build = { ...config.build, cssMinify: !!context.bundlerConfig.minify.css };\n }\n\n // Minified output can't be mapped back to source, so skip it when instrumenting.\n if (context.options.codeCoverage) {\n config.build = { ...config.build, minify: false };\n }\n\n return config;\n}\n"],"names":["createBaseConfig","importMetaRemap","definitions","result","filter","definition","undefined","forEach","Object","keys","item","createPlugins","context","entries","bundleStatPlugin","cleanPlugin","cssInjectorPlugin","designSystemGuardPlugin","devServerRoutingPlugin","externalsPlugin","htmlPlugin","ignoreModulesPlugin","istanbulPlugin","magicCommentsPlugin","metadataPlugin","momentLocalesPlugin","styleUrlsPlugin","svgrPlugin","virtualModulesPlugin","name","plugin","bundlerConfig","omitDefault","includes","flatMap","getBundleType","getProcessEnv","isProduction","build","isWebComponent","package","config","cacheDir","customLogger","createFilteringLogger","server","port","mode","bundleConstants","production","development","configFile","oxc","legalComments","base","getCdnPath","css","createCssConfig","cssCodeSplit","sourcemap","rolldownOptions","output","assetFileNames","codeSplitting","getCodeSplitting","plugins","chainSourceMapsPlugin","define","defineExposedDependencies","defineExposedInstanceDependencies","defineWebComponentName","optimizeDeps","include","omitKeys","k","startsWith","length","omit","minify","js","cssMinify","options","codeCoverage"],"mappings":";;;;+BA8EgBA;;;eAAAA;;;sBArET;uBACc;yBAkBd;gCAEwB;+BACE;iCACD;uCACM;AAEtC,SAASC,gBACL,GAAGC,WAAmD;IAEtD,MAAMC,SAAiC,CAAC;IAExCD,YACKE,MAAM,CAACC,CAAAA,aAAcA,eAAeC,WACpCC,OAAO,CAACF,CAAAA,aACLG,OAAOC,IAAI,CAACJ,YAAYE,OAAO,CAACG,CAAAA;YAC5BP,MAAM,CAAC,CAAC,gBAAgB,EAAEO,MAAM,CAAC,GAAGL,UAAU,CAACK,KAAK;QACxD;IAGR,OAAOP;AACX;AAEA,SAASQ,cAAcC,OAAyB;IAC5C,MAAMC,UAAuE;QACzE;YAAC;YAAcC,IAAAA,yBAAgB,EAACF;SAAS;QACzC;YAAC;YAASG,IAAAA,oBAAW,EAACH;SAAS;QAC/B;YAAC;YAAeI,IAAAA,0BAAiB,EAACJ;SAAS;QAC3C;YAAC;YAAqBK,IAAAA,gCAAuB,EAACL;SAAS;QACvD;YAAC;YAAoBM,IAAAA,+BAAsB,EAACN;SAA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AC;IAChF;IACA,IAAInE,QAAQmB,aAAa,CAAC+C,MAAM,CAACtB,GAAG,KAAKlD,WAAW;QAChDmC,OAAOH,KAAK,GAAG;YAAE,GAAGG,OAAOH,KAAK;YAAE0C,WAAW,CAAC,CAACpE,QAAQmB,aAAa,CAAC+C,MAAM,CAACtB,GAAG;QAAC;IACpF;IAEA,iFAAiF;IACjF,IAAI5C,QAAQqE,OAAO,CAACC,YAAY,EAAE;QAC9BzC,OAAOH,KAAK,GAAG;YAAE,GAAGG,OAAOH,KAAK;YAAEwC,QAAQ;QAAM;IACpD;IAEA,OAAOrC;AACX"}
|
|
1
|
+
{"version":3,"sources":["../../../src/vite/config/base-config.ts"],"sourcesContent":["import type { InlineConfig, Plugin } from 'vite';\nimport {\n bundleConstants,\n defineExposedDependencies,\n defineExposedInstanceDependencies,\n defineWebComponentName,\n getBundleType,\n getCdnPath,\n getProcessEnv,\n} from '../../core';\nimport { omit } from '../../utils';\nimport {\n bundleStatPlugin,\n chainSourceMapsPlugin,\n cleanPlugin,\n cssInjectorPlugin,\n designSystemGuardPlugin,\n devServerRoutingPlugin,\n externalsPlugin,\n htmlPlugin,\n ignoreModulesPlugin,\n istanbulPlugin,\n magicCommentsPlugin,\n metadataPlugin,\n momentLocalesPlugin,\n reactRefreshPlugin,\n styleUrlsPlugin,\n svgrPlugin,\n virtualModulesPlugin,\n} from '../plugins';\nimport { ViteBuildContext } from '../types';\nimport { assetFileNames } from './asset-file-names';\nimport { getCodeSplitting } from './code-splitting';\nimport { createCssConfig } from './create-css-config';\nimport { createFilteringLogger } from './create-filtering-logger';\n\nfunction importMetaRemap(\n ...definitions: (Record<string, string> | undefined)[]\n): Record<string, string> {\n const result: Record<string, string> = {};\n\n definitions\n .filter(definition => definition !== undefined)\n .forEach(definition =>\n Object.keys(definition).forEach(item => {\n result[`import.meta.env.${item}`] = definition[item];\n })\n );\n\n return result;\n}\n\nfunction createPlugins(context: ViteBuildContext) {\n const entries: [string, Plugin[] | Plugin | Promise<Plugin> | undefined][] = [\n ['reactRefresh', reactRefreshPlugin(context)],\n ['bundleStat', bundleStatPlugin(context)],\n ['clean', cleanPlugin(context)],\n ['cssInjector', cssInjectorPlugin(context)],\n ['designSystemGuard', designSystemGuardPlugin(context)],\n ['devServerRouting', devServerRoutingPlugin(context)],\n ['externals', externalsPlugin(context)],\n ['html', htmlPlugin(context)],\n ['ignoreModules', ignoreModulesPlugin(context)],\n ['istanbul', istanbulPlugin(context)],\n ['magicComments', magicCommentsPlugin(context)],\n ['metadata', metadataPlugin(context)],\n ['momentLocales', momentLocalesPlugin(context)],\n ['styleUrls', styleUrlsPlugin(context)],\n ['svgr', svgrPlugin(context)],\n ['virtualModules', virtualModulesPlugin(context)],\n ];\n\n return entries\n .filter(\n ([name, plugin]) =>\n plugin && !context.bundlerConfig.omitDefault?.includes(`plugins.${name}`)\n )\n .flatMap(([, plugin]) => plugin);\n}\n\nexport function createBaseConfig(context: ViteBuildContext): InlineConfig {\n const { isProduction } = context.build;\n const { isWebComponent } = context.package;\n\n let config: InlineConfig = {\n cacheDir: `node_modules/.vite/${getBundleType(context) ?? 'host'}`,\n customLogger: createFilteringLogger(),\n server: {\n // Windows machines can fail to connect to \"localhost\"; bind to a fixed address instead.\n host: '127.0.0.1',\n port: context.bundlerConfig.port ?? (isWebComponent ? 8888 : 8080),\n },\n mode: isProduction ? bundleConstants.mode.production : bundleConstants.mode.development,\n configFile: false,\n oxc: { legalComments: 'none' },\n base: getCdnPath(context) || './', // eslint-disable-line @typescript-eslint/prefer-nullish-coalescing\n css: createCssConfig(isProduction),\n build: {\n /*\n * MFEs render inside shadow DOM — lazy CSS chunks would inject into document.head,\n * leaking styles into the host. Bundling all CSS into one file avoids this.\n */\n cssCodeSplit: !isWebComponent,\n sourcemap: true,\n rolldownOptions: {\n output: { assetFileNames, codeSplitting: getCodeSplitting(context) },\n plugins: [chainSourceMapsPlugin()],\n },\n },\n define: {\n /*\n * Some dependencies assume Node's `global` exists (webpack polyfills this\n * automatically for browser targets; Vite does not).\n */\n global: 'globalThis',\n ...importMetaRemap(\n defineExposedDependencies(context),\n defineExposedInstanceDependencies(context),\n defineWebComponentName(context)\n ),\n ...(getProcessEnv(context) ?? {}),\n },\n optimizeDeps: {\n include: [\n '@servicetitan/startup-utils',\n 'react-refresh/runtime',\n 'react/jsx-runtime',\n 'react/jsx-dev-runtime',\n ],\n /*\n * Top-level plugins don't run during dependency pre-bundling, so\n * register ignoreModulesPlugin again here. Without this, missing\n * optional peer dependencies inside pre-bundled packages throw at\n * runtime instead of resolving to an empty module.\n */\n rolldownOptions: {\n plugins: [ignoreModulesPlugin(context)],\n },\n },\n plugins: createPlugins(context),\n };\n\n const omitKeys = context.bundlerConfig.omitDefault?.filter(k => !k.startsWith('plugins.'));\n if (omitKeys?.length) {\n config = omit({ ...config }, omitKeys);\n }\n\n if (context.bundlerConfig.minify.js !== undefined) {\n config.build = { ...config.build, minify: !!context.bundlerConfig.minify.js };\n }\n if (context.bundlerConfig.minify.css !== undefined) {\n config.build = { ...config.build, cssMinify: !!context.bundlerConfig.minify.css };\n }\n\n // Minified output can't be mapped back to source, so skip it when instrumenting.\n if (context.options.codeCoverage) {\n config.build = { ...config.build, minify: false };\n }\n\n return config;\n}\n"],"names":["createBaseConfig","importMetaRemap","definitions","result","filter","definition","undefined","forEach","Object","keys","item","createPlugins","context","entries","reactRefreshPlugin","bundleStatPlugin","cleanPlugin","cssInjectorPlugin","designSystemGuardPlugin","devServerRoutingPlugin","externalsPlugin","htmlPlugin","ignoreModulesPlugin","istanbulPlugin","magicCommentsPlugin","metadataPlugin","momentLocalesPlugin","styleUrlsPlugin","svgrPlugin","virtualModulesPlugin","name","plugin","bundlerConfig","omitDefault","includes","flatMap","getBundleType","getProcessEnv","isProduction","build","isWebComponent","package","config","cacheDir","customLogger","createFilteringLogger","server","host","port","mode","bundleConstants","production","development","configFile","oxc","legalComments","base","getCdnPath","css","createCssConfig","cssCodeSplit","sourcemap","rolldownOptions","output","assetFileNames","codeSplitting","getCodeSplitting","plugins","chainSourceMapsPlugin","define","global","defineExposedDependencies","defineExposedInstanceDependencies","defineWebComponentName","optimizeDeps","include","omitKeys","k","startsWith","length","omit","minify","js","cssMinify","options","codeCoverage"],"mappings":";;;;+BAgFgBA;;;eAAAA;;;sBAvET;uBACc;yBAmBd;gCAEwB;+BACE;iCACD;uCACM;AAEtC,SAASC,gBACL,GAAGC,WAAmD;IAEtD,MAAMC,SAAiC,CAAC;IAExCD,YACKE,MAAM,CAACC,CAAAA,aAAcA,eAAeC,WACpCC,OAAO,CAACF,CAAAA,aACLG,OAAOC,IAAI,CAACJ,YAAYE,OAAO,CAACG,CAAAA;YAC5BP,MAAM,CAAC,CAAC,gBAAgB,EAAEO,MAAM,CAAC,GAAGL,UAAU,CAACK,KAAK;QACxD;IAGR,OAAOP;AACX;AAEA,SAASQ,cAAcC,OAAyB;IAC5C,MAAMC,UAAuE;QACzE;YAAC;YAAgBC,IAAAA,2BAAkB,EAACF;SAAS;QAC7C;YAAC;YAAcG,IAAAA,yBAAgB,EAACH;SAAS;QACzC;YAAC;YAASI,IAAAA,oBAAW,EAACJ;SAAS;QAC/B;YAAC;YAAeK,IAAAA,0BAAiB,EAACL;SAAS;QAC3C;YAAC;YAAqBM,IAAAA,gCAAuB,EAACN;SAAS;QACvD;YAAC;YAAoBO,IAAAA,+BAAsB,EAACP;SAAS;QACrD;YAAC;YAAaQ,IAAAA,wBAAe,EAACR;SAAS;QACvC;YAAC;YAAQS,IAAAA,mBAAU,EAACT;SAAS;QAC7B;YAAC;YAAiBU,IAAAA,4BAAmB,EAACV;SAAS;QAC/C;YAAC;YAAYW,IAAAA,uBAAc,EAACX;SAAS;QACrC;YAAC;YAAiBY,IAAAA,4BAAmB,EAACZ;SAAS;QAC/C;YAAC;YAAYa,IAAAA,uBAAc,EAACb;SAAS;QACrC;YAAC;YAAiBc,IAAAA,4BAAmB,EAACd;SAAS;QAC/C;YAAC;YAAae,IAAAA,wBAAe,EAACf;SAAS;QACv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AAOH,KAAK;YAAE0C,QAAQ;QAAM;IACpD;IAEA,OAAOvC;AACX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-filtering-logger.d.ts","sourceRoot":"","sources":["../../../src/vite/config/create-filtering-logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"create-filtering-logger.d.ts","sourceRoot":"","sources":["../../../src/vite/config/create-filtering-logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,MAAM,CAAC;AA0BjD,wBAAgB,qBAAqB,IAAI,MAAM,CAkB9C"}
|
|
@@ -17,10 +17,21 @@ const _vite = require("vite");
|
|
|
17
17
|
/<script src="\.\/shared\/[^"]+"> in "[^"]*" can't be bundled without type="module"/,
|
|
18
18
|
/\.\/shared\/\S+ doesn't exist at build time/
|
|
19
19
|
];
|
|
20
|
+
/*
|
|
21
|
+
* Expected when code feature-detects an optional peer dependency (e.g. `Package.Export
|
|
22
|
+
* === undefined`) and ignoreModulesPlugin has substituted an empty module for it. Matched
|
|
23
|
+
* on the plugin's IGNORE_EMPTY marker so a genuinely undefined export elsewhere still warns.
|
|
24
|
+
*/ const IGNORED_MODULE_WARNINGS = [
|
|
25
|
+
/Import `\w+` will always be undefined because there is no matching export in '\\0IGNORE_EMPTY:[^']+'/
|
|
26
|
+
];
|
|
27
|
+
const SUPPRESSED_WARNINGS = [
|
|
28
|
+
...SHARED_ASSET_WARNINGS,
|
|
29
|
+
...IGNORED_MODULE_WARNINGS
|
|
30
|
+
];
|
|
20
31
|
function createFilteringLogger() {
|
|
21
32
|
const logger = (0, _vite.createLogger)();
|
|
22
33
|
const { warn, warnOnce } = logger;
|
|
23
|
-
const isSuppressed = (message)=>
|
|
34
|
+
const isSuppressed = (message)=>SUPPRESSED_WARNINGS.some((pattern)=>pattern.test(message));
|
|
24
35
|
logger.warn = (message, options)=>{
|
|
25
36
|
if (!isSuppressed(message)) {
|
|
26
37
|
warn.call(logger, message, options);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/vite/config/create-filtering-logger.ts"],"sourcesContent":["import { createLogger, type Logger } from 'vite';\n\n/*\n * Expected warnings when a host's HTML references the shared-bundle assets created by\n * separate \"exposed dependencies\" build. Matched on ./shared/ so a genuinely missing\n * app asset still warns.\n */\nconst SHARED_ASSET_WARNINGS = [\n /<script src=\"\\.\\/shared\\/[^\"]+\"> in \"[^\"]*\" can't be bundled without type=\"module\"/,\n /\\.\\/shared\\/\\S+ doesn't exist at build time/,\n];\n\n/*\n * Wraps Vite's logger to drop
|
|
1
|
+
{"version":3,"sources":["../../../src/vite/config/create-filtering-logger.ts"],"sourcesContent":["import { createLogger, type Logger } from 'vite';\n\n/*\n * Expected warnings when a host's HTML references the shared-bundle assets created by\n * separate \"exposed dependencies\" build. Matched on ./shared/ so a genuinely missing\n * app asset still warns.\n */\nconst SHARED_ASSET_WARNINGS = [\n /<script src=\"\\.\\/shared\\/[^\"]+\"> in \"[^\"]*\" can't be bundled without type=\"module\"/,\n /\\.\\/shared\\/\\S+ doesn't exist at build time/,\n];\n\n/*\n * Expected when code feature-detects an optional peer dependency (e.g. `Package.Export\n * === undefined`) and ignoreModulesPlugin has substituted an empty module for it. Matched\n * on the plugin's IGNORE_EMPTY marker so a genuinely undefined export elsewhere still warns.\n */\nconst IGNORED_MODULE_WARNINGS = [\n /Import `\\w+` will always be undefined because there is no matching export in '\\\\0IGNORE_EMPTY:[^']+'/,\n];\n\nconst SUPPRESSED_WARNINGS = [...SHARED_ASSET_WARNINGS, ...IGNORED_MODULE_WARNINGS];\n\n/*\n * Wraps Vite's logger to drop expected warnings. Everything else passes through.\n */\nexport function createFilteringLogger(): Logger {\n const logger = createLogger();\n const { warn, warnOnce } = logger;\n const isSuppressed = (message: string) =>\n SUPPRESSED_WARNINGS.some(pattern => pattern.test(message));\n\n logger.warn = (message, options) => {\n if (!isSuppressed(message)) {\n warn.call(logger, message, options);\n }\n };\n logger.warnOnce = (message, options) => {\n if (!isSuppressed(message)) {\n warnOnce.call(logger, message, options);\n }\n };\n\n return logger;\n}\n"],"names":["createFilteringLogger","SHARED_ASSET_WARNINGS","IGNORED_MODULE_WARNINGS","SUPPRESSED_WARNINGS","logger","createLogger","warn","warnOnce","isSuppressed","message","some","pattern","test","options","call"],"mappings":";;;;+BA0BgBA;;;eAAAA;;;sBA1B0B;AAE1C;;;;CAIC,GACD,MAAMC,wBAAwB;IAC1B;IACA;CACH;AAED;;;;CAIC,GACD,MAAMC,0BAA0B;IAC5B;CACH;AAED,MAAMC,sBAAsB;OAAIF;OAA0BC;CAAwB;AAK3E,SAASF;IACZ,MAAMI,SAASC,IAAAA,kBAAY;IAC3B,MAAM,EAAEC,IAAI,EAAEC,QAAQ,EAAE,GAAGH;IAC3B,MAAMI,eAAe,CAACC,UAClBN,oBAAoBO,IAAI,CAACC,CAAAA,UAAWA,QAAQC,IAAI,CAACH;IAErDL,OAAOE,IAAI,GAAG,CAACG,SAASI;QACpB,IAAI,CAACL,aAAaC,UAAU;YACxBH,KAAKQ,IAAI,CAACV,QAAQK,SAASI;QAC/B;IACJ;IACAT,OAAOG,QAAQ,GAAG,CAACE,SAASI;QACxB,IAAI,CAACL,aAAaC,UAAU;YACxBF,SAASO,IAAI,CAACV,QAAQK,SAASI;QACnC;IACJ;IAEA,OAAOT;AACX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-vite-build-context.d.ts","sourceRoot":"","sources":["../../../src/vite/config/create-vite-build-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"create-vite-build-context.d.ts","sourceRoot":"","sources":["../../../src/vite/config/create-vite-build-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAkCzD,wBAAgB,sBAAsB,CAClC,OAAO,EAAE,YAAY,EACrB,aAAa,EAAE,uBAAuB,EACtC,UAAU,EAAE,sBAAsB,GACnC,gBAAgB,CAElB"}
|
|
@@ -9,6 +9,8 @@ Object.defineProperty(exports, "createViteBuildContext", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
function createBundlerConfig(packageJsonConfig, fileConfig) {
|
|
12
|
+
var _ref;
|
|
13
|
+
var _fileConfig_config_build, _fileConfig_config, _packageJsonConfig_config_build, _packageJsonConfig_config;
|
|
12
14
|
const { port: pkgPort, omitDefault: pkgOmit = [], pluginOverrides: pkgPluginOverrides = {}, minify: pkgMinify = {} } = packageJsonConfig;
|
|
13
15
|
const { port: filePort, omitDefault: fileOmit = [], pluginOverrides: filePluginOverrides = {}, minify: fileMinify = {} } = fileConfig;
|
|
14
16
|
return {
|
|
@@ -30,7 +32,8 @@ function createBundlerConfig(packageJsonConfig, fileConfig) {
|
|
|
30
32
|
minify: {
|
|
31
33
|
...pkgMinify,
|
|
32
34
|
...fileMinify
|
|
33
|
-
}
|
|
35
|
+
},
|
|
36
|
+
outDir: (_ref = (_fileConfig_config = fileConfig.config) === null || _fileConfig_config === void 0 ? void 0 : (_fileConfig_config_build = _fileConfig_config.build) === null || _fileConfig_config_build === void 0 ? void 0 : _fileConfig_config_build.outDir) !== null && _ref !== void 0 ? _ref : (_packageJsonConfig_config = packageJsonConfig.config) === null || _packageJsonConfig_config === void 0 ? void 0 : (_packageJsonConfig_config_build = _packageJsonConfig_config.build) === null || _packageJsonConfig_config_build === void 0 ? void 0 : _packageJsonConfig_config_build.outDir
|
|
34
37
|
};
|
|
35
38
|
}
|
|
36
39
|
function createViteBuildContext(context, pkgJsonConfig, fileConfig) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/vite/config/create-vite-build-context.ts"],"sourcesContent":["import { BuildContext } from '../../core';\nimport { VitePackageJsonOverride } from '../../utils';\nimport { ViteBuildContext } from '../types';\nimport { ViteConfigFileOverride } from './define-config';\n\nfunction createBundlerConfig(\n packageJsonConfig: VitePackageJsonOverride,\n fileConfig: ViteConfigFileOverride\n): ViteBuildContext['bundlerConfig'] {\n const {\n port: pkgPort,\n omitDefault: pkgOmit = [],\n pluginOverrides: pkgPluginOverrides = {},\n minify: pkgMinify = {},\n } = packageJsonConfig;\n const {\n port: filePort,\n omitDefault: fileOmit = [],\n pluginOverrides: filePluginOverrides = {},\n minify: fileMinify = {},\n } = fileConfig;\n\n return {\n port: filePort ?? pkgPort,\n omitDefault: [...pkgOmit, ...fileOmit],\n pluginOverrides: {\n html: {\n ...pkgPluginOverrides.html,\n ...filePluginOverrides.html,\n },\n svgr: { ...pkgPluginOverrides.svgr, ...filePluginOverrides.svgr },\n },\n minify: { ...pkgMinify, ...fileMinify },\n };\n}\n\nexport function createViteBuildContext(\n context: BuildContext,\n pkgJsonConfig: VitePackageJsonOverride,\n fileConfig: ViteConfigFileOverride\n): ViteBuildContext {\n return { ...context, bundlerConfig: createBundlerConfig(pkgJsonConfig, fileConfig) };\n}\n"],"names":["createViteBuildContext","createBundlerConfig","packageJsonConfig","fileConfig","port","pkgPort","omitDefault","pkgOmit","pluginOverrides","pkgPluginOverrides","minify","pkgMinify","filePort","fileOmit","filePluginOverrides","fileMinify","html","svgr","context","pkgJsonConfig","bundlerConfig"],"mappings":";;;;+
|
|
1
|
+
{"version":3,"sources":["../../../src/vite/config/create-vite-build-context.ts"],"sourcesContent":["import { BuildContext } from '../../core';\nimport { VitePackageJsonOverride } from '../../utils';\nimport { ViteBuildContext } from '../types';\nimport { ViteConfigFileOverride } from './define-config';\n\nfunction createBundlerConfig(\n packageJsonConfig: VitePackageJsonOverride,\n fileConfig: ViteConfigFileOverride\n): ViteBuildContext['bundlerConfig'] {\n const {\n port: pkgPort,\n omitDefault: pkgOmit = [],\n pluginOverrides: pkgPluginOverrides = {},\n minify: pkgMinify = {},\n } = packageJsonConfig;\n const {\n port: filePort,\n omitDefault: fileOmit = [],\n pluginOverrides: filePluginOverrides = {},\n minify: fileMinify = {},\n } = fileConfig;\n\n return {\n port: filePort ?? pkgPort,\n omitDefault: [...pkgOmit, ...fileOmit],\n pluginOverrides: {\n html: {\n ...pkgPluginOverrides.html,\n ...filePluginOverrides.html,\n },\n svgr: { ...pkgPluginOverrides.svgr, ...filePluginOverrides.svgr },\n },\n minify: { ...pkgMinify, ...fileMinify },\n outDir: fileConfig.config?.build?.outDir ?? packageJsonConfig.config?.build?.outDir,\n };\n}\n\nexport function createViteBuildContext(\n context: BuildContext,\n pkgJsonConfig: VitePackageJsonOverride,\n fileConfig: ViteConfigFileOverride\n): ViteBuildContext {\n return { ...context, bundlerConfig: createBundlerConfig(pkgJsonConfig, fileConfig) };\n}\n"],"names":["createViteBuildContext","createBundlerConfig","packageJsonConfig","fileConfig","port","pkgPort","omitDefault","pkgOmit","pluginOverrides","pkgPluginOverrides","minify","pkgMinify","filePort","fileOmit","filePluginOverrides","fileMinify","html","svgr","outDir","config","build","context","pkgJsonConfig","bundlerConfig"],"mappings":";;;;+BAqCgBA;;;eAAAA;;;AAhChB,SAASC,oBACLC,iBAA0C,EAC1CC,UAAkC;;QA0BtBA,0BAAAA,oBAAoCD,iCAAAA;IAxBhD,MAAM,EACFE,MAAMC,OAAO,EACbC,aAAaC,UAAU,EAAE,EACzBC,iBAAiBC,qBAAqB,CAAC,CAAC,EACxCC,QAAQC,YAAY,CAAC,CAAC,EACzB,GAAGT;IACJ,MAAM,EACFE,MAAMQ,QAAQ,EACdN,aAAaO,WAAW,EAAE,EAC1BL,iBAAiBM,sBAAsB,CAAC,CAAC,EACzCJ,QAAQK,aAAa,CAAC,CAAC,EAC1B,GAAGZ;IAEJ,OAAO;QACHC,IAAI,EAAEQ,qBAAAA,sBAAAA,WAAYP;QAClBC,aAAa;eAAIC;eAAYM;SAAS;QACtCL,iBAAiB;YACbQ,MAAM;gBACF,GAAGP,mBAAmBO,IAAI;gBAC1B,GAAGF,oBAAoBE,IAAI;YAC/B;YACAC,MAAM;gBAAE,GAAGR,mBAAmBQ,IAAI;gBAAE,GAAGH,oBAAoBG,IAAI;YAAC;QACpE;QACAP,QAAQ;YAAE,GAAGC,SAAS;YAAE,GAAGI,UAAU;QAAC;QACtCG,MAAM,WAAEf,qBAAAA,WAAWgB,MAAM,cAAjBhB,0CAAAA,2BAAAA,mBAAmBiB,KAAK,cAAxBjB,+CAAAA,yBAA0Be,MAAM,wCAAIhB,4BAAAA,kBAAkBiB,MAAM,cAAxBjB,iDAAAA,kCAAAA,0BAA0BkB,KAAK,cAA/BlB,sDAAAA,gCAAiCgB,MAAM;IACvF;AACJ;AAEO,SAASlB,uBACZqB,OAAqB,EACrBC,aAAsC,EACtCnB,UAAkC;IAElC,OAAO;QAAE,GAAGkB,OAAO;QAAEE,eAAetB,oBAAoBqB,eAAenB;IAAY;AACvF"}
|
|
@@ -36,13 +36,18 @@ async function createViteConfig(options) {
|
|
|
36
36
|
return finalConfig;
|
|
37
37
|
}
|
|
38
38
|
function createDevServerConfig(viteContext, finalConfig, outputRoot) {
|
|
39
|
+
var _ref;
|
|
39
40
|
var _finalConfig_server;
|
|
40
41
|
const { light, headless, emitExposedDependencies } = viteContext.build;
|
|
42
|
+
const warmup = (_finalConfig_server = finalConfig.server) === null || _finalConfig_server === void 0 ? void 0 : _finalConfig_server.warmup;
|
|
41
43
|
const server = {
|
|
42
44
|
...finalConfig.server,
|
|
43
45
|
warmup: {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
...warmup,
|
|
47
|
+
clientFiles: [
|
|
48
|
+
...(0, _getwarmupclientfiles.getWarmupClientFiles)(viteContext, outputRoot),
|
|
49
|
+
...(_ref = warmup === null || warmup === void 0 ? void 0 : warmup.clientFiles) !== null && _ref !== void 0 ? _ref : []
|
|
50
|
+
]
|
|
46
51
|
}
|
|
47
52
|
};
|
|
48
53
|
/*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/vite/config/create-vite-config.ts"],"sourcesContent":["import {\n BuildContextOptions,\n createBuildContext,\n resolveOutputPath,\n resolveOutputRoot,\n stringifyConfig,\n} from '../../core';\nimport { getViteConfiguration, log } from '../../utils';\nimport { createBaseConfig } from './base-config';\nimport { createViteBuildContext } from './create-vite-build-context';\nimport { getWarmupClientFiles } from './get-warmup-client-files';\nimport { loadConfigFile } from './load-config-file';\nimport { mergeViteConfigs } from './merge-vite-configs';\n\nexport async function createViteConfig(options: BuildContextOptions) {\n const context = createBuildContext(options);\n const packageJsonConfig = getViteConfiguration();\n const fileConfig = await loadConfigFile('./', context);\n const viteContext = createViteBuildContext(context, packageJsonConfig, fileConfig);\n const baseConfig = createBaseConfig(viteContext);\n const finalConfig = mergeViteConfigs(baseConfig, packageJsonConfig, fileConfig);\n const outputRoot = resolveOutputRoot(context, finalConfig.build?.outDir);\n\n // Resolve the output path: web components force the default, hosts honor a configured path.\n finalConfig.build = {\n ...finalConfig.build,\n outDir: resolveOutputPath(context, finalConfig.build?.outDir),\n };\n\n if (!context.build.isProduction) {\n finalConfig.server = createDevServerConfig(viteContext, finalConfig, outputRoot);\n }\n\n /* istanbul ignore next: debug only */\n log.debug('create-vite-config', () => stringifyConfig(finalConfig));\n\n return finalConfig;\n}\n\nfunction createDevServerConfig(\n viteContext: ReturnType<typeof createViteBuildContext>,\n finalConfig: ReturnType<typeof mergeViteConfigs>,\n outputRoot: string\n) {\n const { light, headless, emitExposedDependencies } = viteContext.build;\n
|
|
1
|
+
{"version":3,"sources":["../../../src/vite/config/create-vite-config.ts"],"sourcesContent":["import {\n BuildContextOptions,\n createBuildContext,\n resolveOutputPath,\n resolveOutputRoot,\n stringifyConfig,\n} from '../../core';\nimport { getViteConfiguration, log } from '../../utils';\nimport { createBaseConfig } from './base-config';\nimport { createViteBuildContext } from './create-vite-build-context';\nimport { getWarmupClientFiles } from './get-warmup-client-files';\nimport { loadConfigFile } from './load-config-file';\nimport { mergeViteConfigs } from './merge-vite-configs';\n\nexport async function createViteConfig(options: BuildContextOptions) {\n const context = createBuildContext(options);\n const packageJsonConfig = getViteConfiguration();\n const fileConfig = await loadConfigFile('./', context);\n const viteContext = createViteBuildContext(context, packageJsonConfig, fileConfig);\n const baseConfig = createBaseConfig(viteContext);\n const finalConfig = mergeViteConfigs(baseConfig, packageJsonConfig, fileConfig);\n const outputRoot = resolveOutputRoot(context, finalConfig.build?.outDir);\n\n // Resolve the output path: web components force the default, hosts honor a configured path.\n finalConfig.build = {\n ...finalConfig.build,\n outDir: resolveOutputPath(context, finalConfig.build?.outDir),\n };\n\n if (!context.build.isProduction) {\n finalConfig.server = createDevServerConfig(viteContext, finalConfig, outputRoot);\n }\n\n /* istanbul ignore next: debug only */\n log.debug('create-vite-config', () => stringifyConfig(finalConfig));\n\n return finalConfig;\n}\n\nfunction createDevServerConfig(\n viteContext: ReturnType<typeof createViteBuildContext>,\n finalConfig: ReturnType<typeof mergeViteConfigs>,\n outputRoot: string\n) {\n const { light, headless, emitExposedDependencies } = viteContext.build;\n const warmup = finalConfig.server?.warmup;\n const server = {\n ...finalConfig.server,\n warmup: {\n ...warmup,\n clientFiles: [\n ...getWarmupClientFiles(viteContext, outputRoot),\n ...(warmup?.clientFiles ?? []),\n ],\n },\n };\n\n /*\n * Background dev servers (light/headless) must use a random port to avoid\n * conflicting with the full bundle's user-configured port.\n */\n if (light || headless) {\n server.port = 0;\n } else if (!emitExposedDependencies) {\n server.port = Number(process.env.PORT) || finalConfig.server?.port;\n }\n\n return server;\n}\n"],"names":["createViteConfig","options","finalConfig","context","createBuildContext","packageJsonConfig","getViteConfiguration","fileConfig","loadConfigFile","viteContext","createViteBuildContext","baseConfig","createBaseConfig","mergeViteConfigs","outputRoot","resolveOutputRoot","build","outDir","resolveOutputPath","isProduction","server","createDevServerConfig","log","debug","stringifyConfig","light","headless","emitExposedDependencies","warmup","clientFiles","getWarmupClientFiles","port","Number","process","env","PORT"],"mappings":";;;;+BAcsBA;;;eAAAA;;;sBARf;uBACmC;4BACT;wCACM;sCACF;gCACN;kCACE;AAE1B,eAAeA,iBAAiBC,OAA4B;QAOjBC,oBAKPA;IAXvC,MAAMC,UAAUC,IAAAA,wBAAkB,EAACH;IACnC,MAAMI,oBAAoBC,IAAAA,2BAAoB;IAC9C,MAAMC,aAAa,MAAMC,IAAAA,8BAAc,EAAC,MAAML;IAC9C,MAAMM,cAAcC,IAAAA,8CAAsB,EAACP,SAASE,mBAAmBE;IACvE,MAAMI,aAAaC,IAAAA,4BAAgB,EAACH;IACpC,MAAMP,cAAcW,IAAAA,kCAAgB,EAACF,YAAYN,mBAAmBE;IACpE,MAAMO,aAAaC,IAAAA,uBAAiB,EAACZ,UAASD,qBAAAA,YAAYc,KAAK,cAAjBd,yCAAAA,mBAAmBe,MAAM;IAEvE,4FAA4F;IAC5Ff,YAAYc,KAAK,GAAG;QAChB,GAAGd,YAAYc,KAAK;QACpBC,QAAQC,IAAAA,uBAAiB,EAACf,UAASD,sBAAAA,YAAYc,KAAK,cAAjBd,0CAAAA,oBAAmBe,MAAM;IAChE;IAEA,IAAI,CAACd,QAAQa,KAAK,CAACG,YAAY,EAAE;QAC7BjB,YAAYkB,MAAM,GAAGC,sBAAsBZ,aAAaP,aAAaY;IACzE;IAEA,oCAAoC,GACpCQ,UAAG,CAACC,KAAK,CAAC,sBAAsB,IAAMC,IAAAA,qBAAe,EAACtB;IAEtD,OAAOA;AACX;AAEA,SAASmB,sBACLZ,WAAsD,EACtDP,WAAgD,EAChDY,UAAkB;;QAGHZ;IADf,MAAM,EAAEuB,KAAK,EAAEC,QAAQ,EAAEC,uBAAuB,EAAE,GAAGlB,YAAYO,KAAK;IACtE,MAAMY,UAAS1B,sBAAAA,YAAYkB,MAAM,cAAlBlB,0CAAAA,oBAAoB0B,MAAM;IACzC,MAAMR,SAAS;QACX,GAAGlB,YAAYkB,MAAM;QACrBQ,QAAQ;YACJ,GAAGA,MAAM;YACTC,aAAa;mBACNC,IAAAA,0CAAoB,EAACrB,aAAaK;2BACjCc,mBAAAA,6BAAAA,OAAQC,WAAW,uCAAI,EAAE;aAChC;QACL;IACJ;IAEA;;;KAGC,GACD,IAAIJ,SAASC,UAAU;QACnBN,OAAOW,IAAI,GAAG;IAClB,OAAO,IAAI,CAACJ,yBAAyB;YACSzB;QAA1CkB,OAAOW,IAAI,GAAGC,OAAOC,QAAQC,GAAG,CAACC,IAAI,OAAKjC,uBAAAA,YAAYkB,MAAM,cAAlBlB,2CAAAA,qBAAoB6B,IAAI;IACtE;IAEA,OAAOX;AACX"}
|
|
@@ -26,18 +26,12 @@ function _getRequireWildcardCache(nodeInterop) {
|
|
|
26
26
|
})(nodeInterop);
|
|
27
27
|
}
|
|
28
28
|
function _interop_require_wildcard(obj, nodeInterop) {
|
|
29
|
-
if (!nodeInterop && obj && obj.__esModule)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return {
|
|
34
|
-
default: obj
|
|
35
|
-
};
|
|
36
|
-
}
|
|
29
|
+
if (!nodeInterop && obj && obj.__esModule) return obj;
|
|
30
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") return {
|
|
31
|
+
default: obj
|
|
32
|
+
};
|
|
37
33
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
38
|
-
if (cache && cache.has(obj))
|
|
39
|
-
return cache.get(obj);
|
|
40
|
-
}
|
|
34
|
+
if (cache && cache.has(obj)) return cache.get(obj);
|
|
41
35
|
var newObj = {
|
|
42
36
|
__proto__: null
|
|
43
37
|
};
|
|
@@ -45,17 +39,12 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
45
39
|
for(var key in obj){
|
|
46
40
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
47
41
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
48
|
-
if (desc && (desc.get || desc.set))
|
|
49
|
-
|
|
50
|
-
} else {
|
|
51
|
-
newObj[key] = obj[key];
|
|
52
|
-
}
|
|
42
|
+
if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc);
|
|
43
|
+
else newObj[key] = obj[key];
|
|
53
44
|
}
|
|
54
45
|
}
|
|
55
46
|
newObj.default = obj;
|
|
56
|
-
if (cache)
|
|
57
|
-
cache.set(obj, newObj);
|
|
58
|
-
}
|
|
47
|
+
if (cache) cache.set(obj, newObj);
|
|
59
48
|
return newObj;
|
|
60
49
|
}
|
|
61
50
|
async function loadConfigFile(root, context) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/vite/config/load-config-file.ts"],"sourcesContent":["import crypto from 'crypto';\nimport fs from 'fs';\nimport path from 'path';\nimport { rolldown } from 'rolldown'; // eslint-disable-line import/no-extraneous-dependencies\nimport type { BuildContext } from '../../core/types';\nimport type { ViteConfigFileOverride } from './define-config';\n\nexport async function loadConfigFile(\n root: string,\n context: BuildContext\n): Promise<ViteConfigFileOverride> {\n const baseName = context.build.isProduction ? 'vite.prod.config' : 'vite.dev.config';\n const configPath = ['.ts', '.js']\n .map(ext => path.join(root, baseName + ext))\n .find(path => fs.existsSync(path));\n\n if (!configPath) {\n return {};\n }\n\n /*\n * Write to node_modules/.startup/ so Node can resolve package imports\n * relative to the project's node_modules. The leading dot follows the\n * convention for tool-managed directories (like .cache, .vite) — npm\n * ignores dotfiles inside node_modules. The directory persists after the\n * temp file is cleaned up, avoiding re-creation on subsequent runs.\n */\n const tmpDir = path.resolve(root, 'node_modules', '.startup');\n fs.mkdirSync(tmpDir, { recursive: true });\n const tmpFile = path.join(tmpDir, `vite-config-${crypto.randomUUID()}.cjs`);\n\n const bundle = await rolldown({\n input: configPath,\n /*\n * Externalize bare imports (node_modules) — only bundle relative files\n * like ./vite.shared.ts. Rolldown calls external() twice per import: once\n * with the original specifier (./foo) and once with the resolved absolute\n * path (/Users/.../foo.ts or C:\\...\\foo.ts). Both must return false to\n * keep the import internal.\n */\n external: id => !id.startsWith('.') && !path.isAbsolute(id),\n });\n const code = (await bundle.generate({ format: 'cjs' })).output[0].code;\n\n try {\n fs.writeFileSync(tmpFile, code);\n const exported = (await import(tmpFile)).default;\n return typeof exported === 'function' ? exported(context) : (exported ?? {});\n } finally {\n fs.unlinkSync(tmpFile);\n }\n}\n"],"names":["loadConfigFile","root","context","baseName","build","isProduction","configPath","map","ext","path","join","find","fs","existsSync","tmpDir","resolve","mkdirSync","recursive","tmpFile","crypto","randomUUID","bundle","rolldown","input","external","id","startsWith","isAbsolute","code","generate","format","output","writeFileSync","exported","default","unlinkSync"],"mappings":";;;;+BAOsBA;;;eAAAA;;;+DAPH;2DACJ;6DACE;0BACQ
|
|
1
|
+
{"version":3,"sources":["../../../src/vite/config/load-config-file.ts"],"sourcesContent":["import crypto from 'crypto';\nimport fs from 'fs';\nimport path from 'path';\nimport { rolldown } from 'rolldown'; // eslint-disable-line import/no-extraneous-dependencies\nimport type { BuildContext } from '../../core/types';\nimport type { ViteConfigFileOverride } from './define-config';\n\nexport async function loadConfigFile(\n root: string,\n context: BuildContext\n): Promise<ViteConfigFileOverride> {\n const baseName = context.build.isProduction ? 'vite.prod.config' : 'vite.dev.config';\n const configPath = ['.ts', '.js']\n .map(ext => path.join(root, baseName + ext))\n .find(path => fs.existsSync(path));\n\n if (!configPath) {\n return {};\n }\n\n /*\n * Write to node_modules/.startup/ so Node can resolve package imports\n * relative to the project's node_modules. The leading dot follows the\n * convention for tool-managed directories (like .cache, .vite) — npm\n * ignores dotfiles inside node_modules. The directory persists after the\n * temp file is cleaned up, avoiding re-creation on subsequent runs.\n */\n const tmpDir = path.resolve(root, 'node_modules', '.startup');\n fs.mkdirSync(tmpDir, { recursive: true });\n const tmpFile = path.join(tmpDir, `vite-config-${crypto.randomUUID()}.cjs`);\n\n const bundle = await rolldown({\n input: configPath,\n /*\n * Externalize bare imports (node_modules) — only bundle relative files\n * like ./vite.shared.ts. Rolldown calls external() twice per import: once\n * with the original specifier (./foo) and once with the resolved absolute\n * path (/Users/.../foo.ts or C:\\...\\foo.ts). Both must return false to\n * keep the import internal.\n */\n external: id => !id.startsWith('.') && !path.isAbsolute(id),\n });\n const code = (await bundle.generate({ format: 'cjs' })).output[0].code;\n\n try {\n fs.writeFileSync(tmpFile, code);\n const exported = (await import(tmpFile)).default;\n return typeof exported === 'function' ? exported(context) : (exported ?? {});\n } finally {\n fs.unlinkSync(tmpFile);\n }\n}\n"],"names":["loadConfigFile","root","context","baseName","build","isProduction","configPath","map","ext","path","join","find","fs","existsSync","tmpDir","resolve","mkdirSync","recursive","tmpFile","crypto","randomUUID","bundle","rolldown","input","external","id","startsWith","isAbsolute","code","generate","format","output","writeFileSync","exported","default","unlinkSync"],"mappings":";;;;+BAOsBA;;;eAAAA;;;+DAPH;2DACJ;6DACE;0BACQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIlB,eAAeA,eAClBC,IAAY,EACZC,OAAqB;IAErB,MAAMC,WAAWD,QAAQE,KAAK,CAACC,YAAY,GAAG,qBAAqB;IACnE,MAAMC,aAAa;QAAC;QAAO;KAAM,CAC5BC,GAAG,CAACC,CAAAA,MAAOC,aAAI,CAACC,IAAI,CAACT,MAAME,WAAWK,MACtCG,IAAI,CAACF,CAAAA,OAAQG,WAAE,CAACC,UAAU,CAACJ;IAEhC,IAAI,CAACH,YAAY;QACb,OAAO,CAAC;IACZ;IAEA;;;;;;KAMC,GACD,MAAMQ,SAASL,aAAI,CAACM,OAAO,CAACd,MAAM,gBAAgB;IAClDW,WAAE,CAACI,SAAS,CAACF,QAAQ;QAAEG,WAAW;IAAK;IACvC,MAAMC,UAAUT,aAAI,CAACC,IAAI,CAACI,QAAQ,CAAC,YAAY,EAAEK,eAAM,CAACC,UAAU,GAAG,IAAI,CAAC;IAE1E,MAAMC,SAAS,MAAMC,IAAAA,kBAAQ,EAAC;QAC1BC,OAAOjB;QACP;;;;;;SAMC,GACDkB,UAAUC,CAAAA,KAAM,CAACA,GAAGC,UAAU,CAAC,QAAQ,CAACjB,aAAI,CAACkB,UAAU,CAACF;IAC5D;IACA,MAAMG,OAAO,AAAC,CAAA,MAAMP,OAAOQ,QAAQ,CAAC;QAAEC,QAAQ;IAAM,EAAC,EAAGC,MAAM,CAAC,EAAE,CAACH,IAAI;IAEtE,IAAI;QACAhB,WAAE,CAACoB,aAAa,CAACd,SAASU;QAC1B,MAAMK,WAAW,AAAC,CAAA,MAAM,gBAAOf,2DAAP,YAAc,EAAGgB,OAAO;QAChD,OAAO,OAAOD,aAAa,aAAaA,SAAS/B,WAAY+B,qBAAAA,sBAAAA,WAAY,CAAC;IAC9E,SAAU;QACNrB,WAAE,CAACuB,UAAU,CAACjB;IAClB;AACJ"}
|
package/dist/vite/index.d.ts
CHANGED
package/dist/vite/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vite/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vite/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,KAAK,eAAe,EAAE,MAAM,mCAAmC,CAAC"}
|
package/dist/vite/index.html
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<% } %> <% it.css.forEach(function(item) { %>
|
|
10
10
|
<link href="./<%= item %>" rel="stylesheet" crossorigin="anonymous" />
|
|
11
11
|
<% }); %> <% it.js.forEach(function(item) { %>
|
|
12
|
-
<script src="./<%= item %>"></script>
|
|
12
|
+
<script defer src="./<%= item %>"></script>
|
|
13
13
|
<% }); %>
|
|
14
14
|
<script type="text/javascript">
|
|
15
15
|
<% if (it.isWebComponent) { %>
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
<% if (it.isWebComponent) { %>
|
|
26
26
|
import './index';
|
|
27
27
|
<% } else { %>
|
|
28
|
-
import '
|
|
28
|
+
import './<%= it.tsOutDir %>/index';
|
|
29
29
|
<% } %>
|
|
30
30
|
</script>
|
|
31
31
|
<% if (it.isWebComponent) { %><<%~ it.name %> /><% } %>
|