@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
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "normalizeProxyConfig", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return normalizeProxyConfig;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _utils = require("../../utils");
|
|
12
|
+
const LEGACY_PROXY_EVENTS = {
|
|
13
|
+
onProxyReq: 'proxyReq',
|
|
14
|
+
onProxyRes: 'proxyRes',
|
|
15
|
+
onProxyReqWs: 'proxyReqWs',
|
|
16
|
+
onOpen: 'open',
|
|
17
|
+
onClose: 'close',
|
|
18
|
+
onError: 'error'
|
|
19
|
+
};
|
|
20
|
+
function normalizeProxyConfig(proxy) {
|
|
21
|
+
return proxy.map((item)=>typeof item === 'function' ? (...args)=>migrateLegacyProxyEvents(item(...args)) : migrateLegacyProxyEvents(item));
|
|
22
|
+
}
|
|
23
|
+
function migrateLegacyProxyEvents(item) {
|
|
24
|
+
const source = item;
|
|
25
|
+
const legacyKeys = Object.keys(LEGACY_PROXY_EVENTS).filter((key)=>source[key] !== undefined);
|
|
26
|
+
if (!legacyKeys.length) {
|
|
27
|
+
return item;
|
|
28
|
+
}
|
|
29
|
+
_utils.log.warning(PROXY_EVENTS_DEPRECATION_WARNING);
|
|
30
|
+
const legacyOn = {};
|
|
31
|
+
const { on: modernOn, ...rest } = source;
|
|
32
|
+
for (const key of legacyKeys){
|
|
33
|
+
legacyOn[LEGACY_PROXY_EVENTS[key]] = rest[key];
|
|
34
|
+
delete rest[key];
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
...rest,
|
|
38
|
+
on: {
|
|
39
|
+
...legacyOn,
|
|
40
|
+
...modernOn
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
const PROXY_EVENTS_DEPRECATION_WARNING = `
|
|
45
|
+
DEPRECATION WARNING: webpack-dev-server proxy config uses one or more legacy event options
|
|
46
|
+
(onProxyReq, onProxyRes, onProxyReqWs, onOpen, onClose, onError). These are moved to an "on"
|
|
47
|
+
object automatically, but support for the legacy options will be removed in a future release.
|
|
48
|
+
See the http-proxy-middleware v3 migration guide:
|
|
49
|
+
https://github.com/chimurai/http-proxy-middleware/blob/master/MIGRATION.md
|
|
50
|
+
`.replace(/\n\s*/g, ' ').trim();
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=normalize-proxy-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/webpack/utils/normalize-proxy-config.ts"],"sourcesContent":["import { Configuration } from 'webpack';\nimport { log } from '../../utils';\n\ntype DevServerConfig = NonNullable<Configuration['devServer']>;\ntype ProxyConfig = NonNullable<DevServerConfig['proxy']>;\ntype ProxyConfigItem = ProxyConfig[number];\n\nconst LEGACY_PROXY_EVENTS = {\n onProxyReq: 'proxyReq',\n onProxyRes: 'proxyRes',\n onProxyReqWs: 'proxyReqWs',\n onOpen: 'open',\n onClose: 'close',\n onError: 'error',\n} as const;\n\nexport function normalizeProxyConfig(proxy: ProxyConfig): ProxyConfig {\n return proxy.map(item =>\n typeof item === 'function'\n ? (((...args: Parameters<typeof item>) =>\n migrateLegacyProxyEvents(item(...args))) as typeof item)\n : migrateLegacyProxyEvents(item)\n );\n}\n\nfunction migrateLegacyProxyEvents(item: ProxyConfigItem): ProxyConfigItem {\n const source = item as Record<string, unknown>;\n const legacyKeys = Object.keys(LEGACY_PROXY_EVENTS).filter(\n key => source[key] !== undefined\n ) as (keyof typeof LEGACY_PROXY_EVENTS)[];\n\n if (!legacyKeys.length) {\n return item;\n }\n\n log.warning(PROXY_EVENTS_DEPRECATION_WARNING);\n\n const legacyOn: Record<string, unknown> = {};\n const { on: modernOn, ...rest } = source;\n for (const key of legacyKeys) {\n legacyOn[LEGACY_PROXY_EVENTS[key]] = rest[key];\n delete rest[key];\n }\n\n return {\n ...rest,\n on: { ...legacyOn, ...(modernOn as Record<string, unknown>) },\n } as ProxyConfigItem;\n}\n\nconst PROXY_EVENTS_DEPRECATION_WARNING = `\n DEPRECATION WARNING: webpack-dev-server proxy config uses one or more legacy event options\n (onProxyReq, onProxyRes, onProxyReqWs, onOpen, onClose, onError). These are moved to an \"on\"\n object automatically, but support for the legacy options will be removed in a future release.\n See the http-proxy-middleware v3 migration guide:\n https://github.com/chimurai/http-proxy-middleware/blob/master/MIGRATION.md\n`\n .replace(/\\n\\s*/g, ' ')\n .trim();\n"],"names":["normalizeProxyConfig","LEGACY_PROXY_EVENTS","onProxyReq","onProxyRes","onProxyReqWs","onOpen","onClose","onError","proxy","map","item","args","migrateLegacyProxyEvents","source","legacyKeys","Object","keys","filter","key","undefined","length","log","warning","PROXY_EVENTS_DEPRECATION_WARNING","legacyOn","on","modernOn","rest","replace","trim"],"mappings":";;;;+BAgBgBA;;;eAAAA;;;uBAfI;AAMpB,MAAMC,sBAAsB;IACxBC,YAAY;IACZC,YAAY;IACZC,cAAc;IACdC,QAAQ;IACRC,SAAS;IACTC,SAAS;AACb;AAEO,SAASP,qBAAqBQ,KAAkB;IACnD,OAAOA,MAAMC,GAAG,CAACC,CAAAA,OACb,OAAOA,SAAS,aACR,CAAC,GAAGC,OACFC,yBAAyBF,QAAQC,SACrCC,yBAAyBF;AAEvC;AAEA,SAASE,yBAAyBF,IAAqB;IACnD,MAAMG,SAASH;IACf,MAAMI,aAAaC,OAAOC,IAAI,CAACf,qBAAqBgB,MAAM,CACtDC,CAAAA,MAAOL,MAAM,CAACK,IAAI,KAAKC;IAG3B,IAAI,CAACL,WAAWM,MAAM,EAAE;QACpB,OAAOV;IACX;IAEAW,UAAG,CAACC,OAAO,CAACC;IAEZ,MAAMC,WAAoC,CAAC;IAC3C,MAAM,EAAEC,IAAIC,QAAQ,EAAE,GAAGC,MAAM,GAAGd;IAClC,KAAK,MAAMK,OAAOJ,WAAY;QAC1BU,QAAQ,CAACvB,mBAAmB,CAACiB,IAAI,CAAC,GAAGS,IAAI,CAACT,IAAI;QAC9C,OAAOS,IAAI,CAACT,IAAI;IACpB;IAEA,OAAO;QACH,GAAGS,IAAI;QACPF,IAAI;YAAE,GAAGD,QAAQ;YAAE,GAAIE,QAAQ;QAA6B;IAChE;AACJ;AAEA,MAAMH,mCAAmC,CAAC;;;;;;AAM1C,CAAC,CACIK,OAAO,CAAC,UAAU,KAClBC,IAAI"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/startup",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "38.1.0",
|
|
4
4
|
"description": "CLI to create multi-package Lerna projects with TypeScript and React",
|
|
5
5
|
"homepage": "https://docs.st.dev/docs/frontend/uikit/startup",
|
|
6
6
|
"repository": {
|
|
@@ -103,16 +103,16 @@
|
|
|
103
103
|
"@jest/core": "~30.4.2",
|
|
104
104
|
"@jest/types": "~30.4.1",
|
|
105
105
|
"@jsdevtools/coverage-istanbul-loader": "^3.0.5",
|
|
106
|
-
"@servicetitan/eslint-config": "
|
|
107
|
-
"@servicetitan/install": "
|
|
108
|
-
"@servicetitan/startup-utils": "
|
|
109
|
-
"@servicetitan/stylelint-config": "
|
|
106
|
+
"@servicetitan/eslint-config": "38.1.0",
|
|
107
|
+
"@servicetitan/install": "38.1.0",
|
|
108
|
+
"@servicetitan/startup-utils": "38.1.0",
|
|
109
|
+
"@servicetitan/stylelint-config": "38.1.0",
|
|
110
110
|
"@svgr/webpack": "^8.1.0",
|
|
111
111
|
"@swc/cli": "^0.8.1",
|
|
112
|
-
"@swc/core": "1.15.
|
|
112
|
+
"@swc/core": "1.15.46",
|
|
113
113
|
"@types/debug": "^4.1.12",
|
|
114
114
|
"@types/jest": "~30.0.0",
|
|
115
|
-
"@vitest/coverage-v8": "^4.1.
|
|
115
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
116
116
|
"chalk": "~4.1.2",
|
|
117
117
|
"cli-table3": "^0.6.5",
|
|
118
118
|
"cpx2": "9.0.0",
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"css-minimizer-webpack-plugin": "^8.0.0",
|
|
121
121
|
"debug": "^4.4.3",
|
|
122
122
|
"deepmerge": "~4.3.1",
|
|
123
|
-
"es-module-lexer": "^2.1
|
|
123
|
+
"es-module-lexer": "^2.3.1",
|
|
124
124
|
"eslint": "~9.39.2",
|
|
125
125
|
"eta": "^4.6.0",
|
|
126
126
|
"execa": "~5.1.1",
|
|
@@ -131,8 +131,8 @@
|
|
|
131
131
|
"jest": "~30.4.2",
|
|
132
132
|
"jest-circus": "~30.4.2",
|
|
133
133
|
"jest-environment-jsdom": "~30.4.1",
|
|
134
|
-
"jest-fetch-mock": "~
|
|
135
|
-
"js-yaml": "~
|
|
134
|
+
"jest-fetch-mock": "~4.2.0",
|
|
135
|
+
"js-yaml": "~5.2.1",
|
|
136
136
|
"json5": "^2.2.3",
|
|
137
137
|
"lerna": "~9.0.7",
|
|
138
138
|
"less": "~4.6.7",
|
|
@@ -140,36 +140,39 @@
|
|
|
140
140
|
"less-plugin-npm-import": "~2.1.0",
|
|
141
141
|
"lodash.kebabcase": "^4.1.1",
|
|
142
142
|
"lodash.memoize": "^4.1.2",
|
|
143
|
-
"
|
|
143
|
+
"magic-string": "^0.30.21",
|
|
144
|
+
"memfs": "~4.64.0",
|
|
144
145
|
"mini-css-extract-plugin": "~2.10.2",
|
|
146
|
+
"minimizer-webpack-plugin": "^5.6.1",
|
|
145
147
|
"moment-locales-webpack-plugin": "~1.2.0",
|
|
146
148
|
"multimatch": "~8.0.0",
|
|
147
149
|
"patch-package": "^8.0.1",
|
|
148
150
|
"portfinder": "~1.0.38",
|
|
149
|
-
"postcss": "~8.5.
|
|
150
|
-
"prettier": "~3.
|
|
151
|
+
"postcss": "~8.5.16",
|
|
152
|
+
"prettier": "~3.9.5",
|
|
153
|
+
"react-refresh": "^0.18.0",
|
|
151
154
|
"sass": "~1.101.0",
|
|
152
155
|
"sass-loader": "~17.0.0",
|
|
153
156
|
"semver": "~7.8.5",
|
|
157
|
+
"source-map-js": "^1.2.1",
|
|
154
158
|
"source-map-loader": "~5.0.0",
|
|
155
159
|
"style-loader": "~4.0.0",
|
|
156
|
-
"stylelint": "~17.14.
|
|
160
|
+
"stylelint": "~17.14.1",
|
|
157
161
|
"swc-loader": "^0.2.7",
|
|
158
162
|
"terminal-link": "^5.0.0",
|
|
159
|
-
"terser-webpack-plugin": "^5.6.1",
|
|
160
163
|
"ts-jest": "29.4.11",
|
|
161
164
|
"ts-node": "~10.9.2",
|
|
162
165
|
"typed-css-modules": "~0.9.1",
|
|
163
166
|
"typescript": "6.0.3",
|
|
164
|
-
"vite": "^8.
|
|
165
|
-
"vite-bundle-analyzer": "^1.3.
|
|
167
|
+
"vite": "^8.1.5",
|
|
168
|
+
"vite-bundle-analyzer": "^1.3.9",
|
|
166
169
|
"vite-plugin-istanbul": "^9.0.1",
|
|
167
170
|
"vite-plugin-svgr": "^5.2.0",
|
|
168
|
-
"vitest": "^4.1.
|
|
169
|
-
"webpack": "~5.
|
|
171
|
+
"vitest": "^4.1.10",
|
|
172
|
+
"webpack": "~5.108.4",
|
|
170
173
|
"webpack-assets-manifest": "~6.5.2",
|
|
171
|
-
"webpack-bundle-analyzer": "^5.3.
|
|
172
|
-
"webpack-dev-server": "^
|
|
174
|
+
"webpack-bundle-analyzer": "^5.3.1",
|
|
175
|
+
"webpack-dev-server": "^6.0.0",
|
|
173
176
|
"webpack-filter-warnings-plugin": "~1.2.1",
|
|
174
177
|
"webpack-merge": "~6.0.1",
|
|
175
178
|
"webpack-remove-empty-scripts": "^1.1.1",
|
|
@@ -197,5 +200,5 @@
|
|
|
197
200
|
"cli": {
|
|
198
201
|
"webpack": false
|
|
199
202
|
},
|
|
200
|
-
"gitHead": "
|
|
203
|
+
"gitHead": "e8c601a26ad49ca0d6b0b84a9f530f3242d53c7f"
|
|
201
204
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @jest-environment node
|
|
3
3
|
*/
|
|
4
4
|
import { createPackage } from '../../../__mocks__';
|
|
5
|
-
import { Package, PackageType, getPackages, log } from '../../../utils';
|
|
5
|
+
import { Package, PackageType, getConfiguration, getPackages, log } from '../../../utils';
|
|
6
6
|
import { compile, lernaExec, typeCheck } from '../../utils';
|
|
7
7
|
import { Build } from '../build';
|
|
8
8
|
import { kendoUILicense } from '../kendo-ui-license';
|
|
@@ -32,6 +32,7 @@ describe(`[startup] ${Build.name}`, () => {
|
|
|
32
32
|
args = {};
|
|
33
33
|
packages = [];
|
|
34
34
|
jest.clearAllMocks();
|
|
35
|
+
jest.mocked(getConfiguration).mockReturnValue({});
|
|
35
36
|
jest.mocked(getPackages).mockImplementation(() => packages);
|
|
36
37
|
});
|
|
37
38
|
|
|
@@ -105,7 +106,7 @@ describe(`[startup] ${Build.name}`, () => {
|
|
|
105
106
|
});
|
|
106
107
|
});
|
|
107
108
|
|
|
108
|
-
describe('with
|
|
109
|
+
describe('with bundle package', () => {
|
|
109
110
|
beforeEach(() => packages.push(createPackage({ type: PackageType.Bundle })));
|
|
110
111
|
|
|
111
112
|
itPreparesThePackage();
|
|
@@ -122,11 +123,11 @@ describe(`[startup] ${Build.name}`, () => {
|
|
|
122
123
|
await subject();
|
|
123
124
|
|
|
124
125
|
expect(lernaExec).toHaveBeenCalledWith({
|
|
125
|
-
'cmd': 'startup bundle-
|
|
126
|
+
'cmd': 'startup bundle-package',
|
|
126
127
|
'scope': packages.map(({ name }) => name),
|
|
127
128
|
'parallel': true,
|
|
128
129
|
'stream': true,
|
|
129
|
-
'--': ['--exposed-dependencies'],
|
|
130
|
+
'--': ['--exposed-dependencies', '--bundler webpack'],
|
|
130
131
|
});
|
|
131
132
|
});
|
|
132
133
|
|
|
@@ -134,23 +135,36 @@ describe(`[startup] ${Build.name}`, () => {
|
|
|
134
135
|
await subject();
|
|
135
136
|
|
|
136
137
|
expect(lernaExec).toHaveBeenCalledWith({
|
|
137
|
-
'cmd': 'startup bundle-
|
|
138
|
+
'cmd': 'startup bundle-package',
|
|
138
139
|
'scope': packages.map(({ name }) => name),
|
|
139
140
|
'stream': true,
|
|
140
|
-
'--': [],
|
|
141
|
+
'--': ['--bundler webpack'],
|
|
141
142
|
});
|
|
142
143
|
});
|
|
143
144
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
test('bundles with Vite', async () => {
|
|
145
|
+
function itBundlesWithVite() {
|
|
146
|
+
test('bundles with vite', async () => {
|
|
148
147
|
await subject();
|
|
149
148
|
|
|
150
149
|
expect(lernaExec).toHaveBeenCalledWith(
|
|
151
|
-
expect.objectContaining({
|
|
150
|
+
expect.objectContaining({
|
|
151
|
+
'cmd': 'startup bundle-package',
|
|
152
|
+
'--': ['--bundler vite'],
|
|
153
|
+
})
|
|
152
154
|
);
|
|
153
155
|
});
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
describe('with --bundler=vite', () => {
|
|
159
|
+
beforeEach(() => (args.bundler = 'vite'));
|
|
160
|
+
|
|
161
|
+
itBundlesWithVite();
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
describe('with cli.bundler set to vite', () => {
|
|
165
|
+
beforeEach(() => jest.mocked(getConfiguration).mockReturnValue({ bundler: 'vite' }));
|
|
166
|
+
|
|
167
|
+
itBundlesWithVite();
|
|
154
168
|
});
|
|
155
169
|
|
|
156
170
|
describe('with "code-coverage"', () => {
|
|
@@ -161,8 +175,8 @@ describe(`[startup] ${Build.name}`, () => {
|
|
|
161
175
|
|
|
162
176
|
expect(lernaExec).toHaveBeenCalledWith(
|
|
163
177
|
expect.objectContaining({
|
|
164
|
-
'cmd': 'startup bundle-
|
|
165
|
-
'--': ['--code-coverage'],
|
|
178
|
+
'cmd': 'startup bundle-package',
|
|
179
|
+
'--': ['--code-coverage', '--bundler webpack'],
|
|
166
180
|
})
|
|
167
181
|
);
|
|
168
182
|
});
|
|
@@ -176,8 +190,8 @@ describe(`[startup] ${Build.name}`, () => {
|
|
|
176
190
|
|
|
177
191
|
expect(lernaExec).toHaveBeenCalledWith(
|
|
178
192
|
expect.objectContaining({
|
|
179
|
-
'cmd': 'startup bundle-
|
|
180
|
-
'--': ['--stat'],
|
|
193
|
+
'cmd': 'startup bundle-package',
|
|
194
|
+
'--': ['--stat', '--bundler webpack'],
|
|
181
195
|
})
|
|
182
196
|
);
|
|
183
197
|
});
|
|
@@ -191,8 +205,8 @@ describe(`[startup] ${Build.name}`, () => {
|
|
|
191
205
|
|
|
192
206
|
expect(lernaExec).toHaveBeenCalledWith(
|
|
193
207
|
expect.objectContaining({
|
|
194
|
-
'cmd': 'startup bundle-
|
|
195
|
-
'--': ['--preview'],
|
|
208
|
+
'cmd': 'startup bundle-package',
|
|
209
|
+
'--': ['--preview', '--bundler webpack'],
|
|
196
210
|
})
|
|
197
211
|
);
|
|
198
212
|
});
|
|
@@ -206,8 +220,8 @@ describe(`[startup] ${Build.name}`, () => {
|
|
|
206
220
|
|
|
207
221
|
expect(lernaExec).toHaveBeenCalledWith(
|
|
208
222
|
expect.objectContaining({
|
|
209
|
-
'cmd': 'startup bundle-
|
|
210
|
-
'--': [`--config "${args.config}"
|
|
223
|
+
'cmd': 'startup bundle-package',
|
|
224
|
+
'--': [`--config "${args.config}"`, '--bundler webpack'],
|
|
211
225
|
})
|
|
212
226
|
);
|
|
213
227
|
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { getConfiguration } from '../../../utils';
|
|
2
|
+
import { BundlePackage } from '../bundle-package';
|
|
3
|
+
import { BundleVite } from '../bundle-vite';
|
|
4
|
+
import { BundleWebpack } from '../bundle-webpack';
|
|
5
|
+
|
|
6
|
+
jest.mock('../../../utils', () => ({
|
|
7
|
+
...jest.requireActual('../../../utils'),
|
|
8
|
+
getConfiguration: jest.fn(() => ({})),
|
|
9
|
+
}));
|
|
10
|
+
jest.mock('../bundle-vite', () => ({ BundleVite: jest.fn(() => ({ execute: jest.fn() })) }));
|
|
11
|
+
jest.mock('../bundle-webpack', () => ({ BundleWebpack: jest.fn(() => ({ execute: jest.fn() })) }));
|
|
12
|
+
|
|
13
|
+
describe(`[startup] ${BundlePackage.name}`, () => {
|
|
14
|
+
let args: ConstructorParameters<typeof BundlePackage>[0];
|
|
15
|
+
|
|
16
|
+
const subject = () => new BundlePackage(args).execute();
|
|
17
|
+
|
|
18
|
+
beforeEach(() => {
|
|
19
|
+
jest.clearAllMocks();
|
|
20
|
+
args = { exposedDependencies: true };
|
|
21
|
+
jest.mocked(getConfiguration).mockReturnValue({});
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
function itBundlesWithWebpack() {
|
|
25
|
+
test('bundles with webpack', async () => {
|
|
26
|
+
await subject();
|
|
27
|
+
|
|
28
|
+
expect(BundleWebpack).toHaveBeenCalledWith(args);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function itBundlesWithVite() {
|
|
33
|
+
test('bundles with vite', async () => {
|
|
34
|
+
await subject();
|
|
35
|
+
|
|
36
|
+
expect(BundleVite).toHaveBeenCalledWith(args);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
itBundlesWithWebpack();
|
|
41
|
+
|
|
42
|
+
describe('with --bundler=vite', () => {
|
|
43
|
+
beforeEach(() => (args = { bundler: 'vite' }));
|
|
44
|
+
|
|
45
|
+
itBundlesWithVite();
|
|
46
|
+
|
|
47
|
+
describe('with cli.bundler set to webpack', () => {
|
|
48
|
+
beforeEach(() => jest.mocked(getConfiguration).mockReturnValue({ bundler: 'webpack' }));
|
|
49
|
+
|
|
50
|
+
itBundlesWithWebpack();
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
describe('with cli.bundler set to vite', () => {
|
|
55
|
+
beforeEach(() => jest.mocked(getConfiguration).mockReturnValue({ bundler: 'vite' }));
|
|
56
|
+
|
|
57
|
+
itBundlesWithVite();
|
|
58
|
+
|
|
59
|
+
describe('with --bundler=webpack', () => {
|
|
60
|
+
beforeEach(() => (args = { bundler: 'webpack' }));
|
|
61
|
+
|
|
62
|
+
itBundlesWithVite();
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
});
|
|
@@ -136,6 +136,7 @@ describe(BundleVite.name, () => {
|
|
|
136
136
|
beforeEach(() => (args.watch = true));
|
|
137
137
|
|
|
138
138
|
test('throws error', async () => {
|
|
139
|
+
jest.spyOn(process.stdout, 'write').mockImplementationOnce(jest.fn()); // suppress error output
|
|
139
140
|
await expect(subject()).rejects.toThrow(
|
|
140
141
|
'cannot bundle exposed dependencies in watch mode'
|
|
141
142
|
);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { exitWhenParentExits } from '../../../utils';
|
|
2
|
+
import { Command } from '../command';
|
|
3
|
+
|
|
4
|
+
jest.mock('../../../utils', () => ({
|
|
5
|
+
exitWhenParentExits: jest.fn(),
|
|
6
|
+
}));
|
|
7
|
+
|
|
8
|
+
class MockCommand extends Command {
|
|
9
|
+
execute() {
|
|
10
|
+
return Promise.resolve();
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
describe(`[startup] ${Command.name} entity`, () => {
|
|
15
|
+
const name: any = 'mock-command';
|
|
16
|
+
let args: any;
|
|
17
|
+
|
|
18
|
+
beforeEach(() => {
|
|
19
|
+
jest.clearAllMocks();
|
|
20
|
+
args = {};
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
describe('watchForParentExit', () => {
|
|
24
|
+
const subject = () => new MockCommand(args).watchForParentExit(name);
|
|
25
|
+
|
|
26
|
+
test('does not watch for the parent process to exit', () => {
|
|
27
|
+
subject();
|
|
28
|
+
|
|
29
|
+
expect(exitWhenParentExits).not.toHaveBeenCalled();
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
describe('with watch: true', () => {
|
|
33
|
+
beforeEach(() => (args = { watch: true }));
|
|
34
|
+
|
|
35
|
+
test('watches for the parent process to exit', () => {
|
|
36
|
+
subject();
|
|
37
|
+
|
|
38
|
+
expect(exitWhenParentExits).toHaveBeenCalledWith(name);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -83,6 +83,14 @@ describe(`[startup] ${MfeCheck.name}`, () => {
|
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
+
function itReportsCompatibleLightBundle() {
|
|
87
|
+
test('outputs human-readable compatible message', async () => {
|
|
88
|
+
await subject();
|
|
89
|
+
|
|
90
|
+
expect(utils.log.info).toHaveBeenCalledWith('Compatible: light bundle can be used');
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
86
94
|
test('allows running from global location', () => {
|
|
87
95
|
expect(entry.allowRunFromGlobal).toBe(true);
|
|
88
96
|
});
|
|
@@ -97,11 +105,7 @@ describe(`[startup] ${MfeCheck.name}`, () => {
|
|
|
97
105
|
});
|
|
98
106
|
});
|
|
99
107
|
|
|
100
|
-
|
|
101
|
-
await subject();
|
|
102
|
-
|
|
103
|
-
expect(utils.log.info).toHaveBeenCalledWith('Compatible: light bundle can be used');
|
|
104
|
-
});
|
|
108
|
+
itReportsCompatibleLightBundle();
|
|
105
109
|
|
|
106
110
|
test('does not set exit code', async () => {
|
|
107
111
|
await subject();
|
|
@@ -131,6 +135,23 @@ describe(`[startup] ${MfeCheck.name}`, () => {
|
|
|
131
135
|
});
|
|
132
136
|
});
|
|
133
137
|
});
|
|
138
|
+
|
|
139
|
+
describe('when host enables expose-shared-dependencies at the top level of cli', () => {
|
|
140
|
+
beforeEach(() => {
|
|
141
|
+
vol.fromJSON({
|
|
142
|
+
'/path/to/host/package.json': JSON.stringify({
|
|
143
|
+
name: 'host-app',
|
|
144
|
+
dependencies: mockMetadata.dependencies,
|
|
145
|
+
cli: {
|
|
146
|
+
'expose-shared-dependencies': true,
|
|
147
|
+
'shared-dependencies': mockMetadata.sharedDependencies,
|
|
148
|
+
},
|
|
149
|
+
}),
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
itReportsCompatibleLightBundle();
|
|
154
|
+
});
|
|
134
155
|
});
|
|
135
156
|
|
|
136
157
|
describe('when incompatible', () => {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { log } from '../../../utils';
|
|
1
|
+
import { exitWhenParentExits, log } from '../../../utils';
|
|
2
2
|
import { SwcCompilePackage, TscCompile, TscCompilePackage } from '../../tasks';
|
|
3
3
|
import { RunTask } from '../run-task';
|
|
4
4
|
|
|
5
5
|
jest.mock('../../../utils', () => ({
|
|
6
6
|
...jest.requireActual('../../../utils'),
|
|
7
|
+
exitWhenParentExits: jest.fn(),
|
|
7
8
|
log: { error: jest.fn(), text: jest.fn() },
|
|
8
9
|
}));
|
|
9
10
|
jest.mock('../../tasks/swc-compile-package');
|
|
@@ -34,9 +35,27 @@ describe(`[startup] ${RunTask.name}`, () => {
|
|
|
34
35
|
|
|
35
36
|
expect(jest.mocked(task).mock.instances[0].execute).toHaveBeenCalled();
|
|
36
37
|
});
|
|
38
|
+
|
|
39
|
+
test(`watches ${task.name} for the parent process to exit`, async () => {
|
|
40
|
+
await subject();
|
|
41
|
+
|
|
42
|
+
expect(jest.mocked(task).mock.instances[0].watchForParentExit).toHaveBeenCalled();
|
|
43
|
+
});
|
|
37
44
|
})
|
|
38
45
|
);
|
|
39
46
|
|
|
47
|
+
describe('watchForParentExit', () => {
|
|
48
|
+
beforeEach(() => (args = {}));
|
|
49
|
+
|
|
50
|
+
const subject = () => new RunTask(args).watchForParentExit();
|
|
51
|
+
|
|
52
|
+
test('does not watch for the parent process to exit', () => {
|
|
53
|
+
subject();
|
|
54
|
+
|
|
55
|
+
expect(exitWhenParentExits).not.toHaveBeenCalled();
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
|
|
40
59
|
describe('with empty args', () => {
|
|
41
60
|
beforeEach(() => (args = {}));
|
|
42
61
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createPackage } from '../../../__mocks__';
|
|
2
|
-
import { Package, PackageType, getPackages, log } from '../../../utils';
|
|
2
|
+
import { Package, PackageType, getConfiguration, getPackages, log } from '../../../utils';
|
|
3
3
|
import { compile, lernaExec, typeCheck, watchStdout } from '../../utils';
|
|
4
4
|
import { entry } from '../registry/start';
|
|
5
5
|
import { Start } from '../start';
|
|
@@ -38,6 +38,7 @@ describe(`[startup] ${Start.name}`, () => {
|
|
|
38
38
|
args = {};
|
|
39
39
|
packages = [];
|
|
40
40
|
jest.clearAllMocks();
|
|
41
|
+
jest.mocked(getConfiguration).mockReturnValue({});
|
|
41
42
|
jest.mocked(getPackages).mockImplementation(() => packages);
|
|
42
43
|
jest.mocked(watchStdout).mockImplementation((_process, _indicator, handler) => {
|
|
43
44
|
handler(packages.length);
|
|
@@ -106,6 +107,12 @@ describe(`[startup] ${Start.name}`, () => {
|
|
|
106
107
|
expect(entry.greedy).toBe(true);
|
|
107
108
|
});
|
|
108
109
|
|
|
110
|
+
test('sets process.env.STARTUP_PARENT_PID', async () => {
|
|
111
|
+
await subject();
|
|
112
|
+
|
|
113
|
+
expect(process.env.STARTUP_PARENT_PID).toBe(String(process.pid));
|
|
114
|
+
});
|
|
115
|
+
|
|
109
116
|
describe('with TSC package', () => {
|
|
110
117
|
beforeEach(() => packages.push(createPackage({ type: PackageType.TSC })));
|
|
111
118
|
|
|
@@ -121,7 +128,7 @@ describe(`[startup] ${Start.name}`, () => {
|
|
|
121
128
|
});
|
|
122
129
|
});
|
|
123
130
|
|
|
124
|
-
describe('with
|
|
131
|
+
describe('with bundle package', () => {
|
|
125
132
|
beforeEach(() => packages.push(createPackage({ type: PackageType.Bundle })));
|
|
126
133
|
|
|
127
134
|
itPreparesThePackages();
|
|
@@ -132,11 +139,11 @@ describe(`[startup] ${Start.name}`, () => {
|
|
|
132
139
|
await subject();
|
|
133
140
|
|
|
134
141
|
expect(lernaExec).toHaveBeenCalledWith({
|
|
135
|
-
'cmd': 'startup bundle-
|
|
142
|
+
'cmd': 'startup bundle-package',
|
|
136
143
|
'scope': packages.map(({ name }) => name),
|
|
137
144
|
'parallel': true,
|
|
138
145
|
'stream': true,
|
|
139
|
-
'--': ['--exposed-dependencies', '--use-watch-config'],
|
|
146
|
+
'--': ['--exposed-dependencies', '--use-watch-config', '--bundler webpack'],
|
|
140
147
|
});
|
|
141
148
|
});
|
|
142
149
|
|
|
@@ -144,24 +151,37 @@ describe(`[startup] ${Start.name}`, () => {
|
|
|
144
151
|
await subject();
|
|
145
152
|
|
|
146
153
|
expect(lernaExec).toHaveBeenCalledWith({
|
|
147
|
-
'cmd': 'startup bundle-
|
|
154
|
+
'cmd': 'startup bundle-package',
|
|
148
155
|
'scope': packages.map(({ name }) => name),
|
|
149
156
|
'parallel': true,
|
|
150
157
|
'stream': true,
|
|
151
|
-
'--': ['--watch'],
|
|
158
|
+
'--': ['--watch', '--bundler webpack'],
|
|
152
159
|
});
|
|
153
160
|
});
|
|
154
161
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
test('bundles with Vite in watch mode', async () => {
|
|
162
|
+
function itBundlesWithVite() {
|
|
163
|
+
test('bundles with vite', async () => {
|
|
159
164
|
await subject();
|
|
160
165
|
|
|
161
166
|
expect(lernaExec).toHaveBeenCalledWith(
|
|
162
|
-
expect.objectContaining({
|
|
167
|
+
expect.objectContaining({
|
|
168
|
+
'cmd': 'startup bundle-package',
|
|
169
|
+
'--': ['--watch', '--bundler vite'],
|
|
170
|
+
})
|
|
163
171
|
);
|
|
164
172
|
});
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
describe('with --bundler=vite', () => {
|
|
176
|
+
beforeEach(() => (args.bundler = 'vite'));
|
|
177
|
+
|
|
178
|
+
itBundlesWithVite();
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
describe('with cli.bundler set to vite', () => {
|
|
182
|
+
beforeEach(() => jest.mocked(getConfiguration).mockReturnValue({ bundler: 'vite' }));
|
|
183
|
+
|
|
184
|
+
itBundlesWithVite();
|
|
165
185
|
});
|
|
166
186
|
|
|
167
187
|
describe('with "code-coverage"', () => {
|
|
@@ -172,8 +192,8 @@ describe(`[startup] ${Start.name}`, () => {
|
|
|
172
192
|
|
|
173
193
|
expect(lernaExec).toHaveBeenCalledWith(
|
|
174
194
|
expect.objectContaining({
|
|
175
|
-
'cmd': 'startup bundle-
|
|
176
|
-
'--': ['--watch', '--code-coverage'],
|
|
195
|
+
'cmd': 'startup bundle-package',
|
|
196
|
+
'--': ['--watch', '--code-coverage', '--bundler webpack'],
|
|
177
197
|
})
|
|
178
198
|
);
|
|
179
199
|
});
|
|
@@ -187,8 +207,8 @@ describe(`[startup] ${Start.name}`, () => {
|
|
|
187
207
|
|
|
188
208
|
expect(lernaExec).toHaveBeenCalledWith(
|
|
189
209
|
expect.objectContaining({
|
|
190
|
-
'cmd': 'startup bundle-
|
|
191
|
-
'--': ['--watch', `--config "${args.config}"
|
|
210
|
+
'cmd': 'startup bundle-package',
|
|
211
|
+
'--': ['--watch', `--config "${args.config}"`, '--bundler webpack'],
|
|
192
212
|
})
|
|
193
213
|
);
|
|
194
214
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getPackages, logErrors, PackageType } from '../../utils';
|
|
2
|
-
import { checkArgs, compile,
|
|
2
|
+
import { checkArgs, compile, lernaExec, ProcessTree, resolveBundler, typeCheck } from '../utils';
|
|
3
3
|
import { kendoUILicense } from './kendo-ui-license';
|
|
4
4
|
import type { entry } from './registry/build';
|
|
5
5
|
import { Command } from './types';
|
|
@@ -38,7 +38,7 @@ export class Build extends Command<typeof entry> {
|
|
|
38
38
|
const bundleScope = packages
|
|
39
39
|
.filter(({ type }) => type === PackageType.Bundle)
|
|
40
40
|
.map(({ name }) => name);
|
|
41
|
-
const
|
|
41
|
+
const bundlerArg = [`--bundler ${resolveBundler(this.args)}`];
|
|
42
42
|
const precompileScope = packages
|
|
43
43
|
.filter(({ scripts }) => !!scripts?.precompile)
|
|
44
44
|
.map(({ name }) => name);
|
|
@@ -77,11 +77,11 @@ export class Build extends Command<typeof entry> {
|
|
|
77
77
|
return Promise.resolve();
|
|
78
78
|
}
|
|
79
79
|
return lernaExec({
|
|
80
|
-
'cmd':
|
|
80
|
+
'cmd': 'startup bundle-package',
|
|
81
81
|
'scope': bundleScope,
|
|
82
82
|
'parallel': true,
|
|
83
83
|
'stream': true,
|
|
84
|
-
'--': ['--exposed-dependencies'],
|
|
84
|
+
'--': ['--exposed-dependencies', ...bundlerArg],
|
|
85
85
|
});
|
|
86
86
|
},
|
|
87
87
|
{
|
|
@@ -100,7 +100,7 @@ export class Build extends Command<typeof entry> {
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
return lernaExec({
|
|
103
|
-
'cmd':
|
|
103
|
+
'cmd': 'startup bundle-package',
|
|
104
104
|
'scope': bundleScope,
|
|
105
105
|
'stream': true,
|
|
106
106
|
'--': [
|
|
@@ -108,6 +108,7 @@ export class Build extends Command<typeof entry> {
|
|
|
108
108
|
...[this.args.codeCoverage ? '--code-coverage' : undefined],
|
|
109
109
|
...[this.args.stat ? '--stat' : undefined],
|
|
110
110
|
...[this.args.preview ? '--preview' : undefined],
|
|
111
|
+
...bundlerArg,
|
|
111
112
|
].filter(item => !!item) as string[],
|
|
112
113
|
});
|
|
113
114
|
},
|