@servicetitan/startup 38.0.0 → 38.2.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 +32 -10
- 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 +13 -0
- package/dist/cli/commands/command.d.ts.map +1 -0
- package/dist/cli/commands/command.js +74 -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.d.ts.map +1 -1
- package/dist/cli/commands/init.js +13 -5
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/install.d.ts.map +1 -1
- package/dist/cli/commands/install.js +14 -21
- 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 -18
- 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/install.d.ts +0 -16
- package/dist/cli/commands/registry/install.d.ts.map +1 -1
- package/dist/cli/commands/registry/install.js +1 -17
- package/dist/cli/commands/registry/install.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/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 +37 -14
- 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-git.d.ts +7 -0
- package/dist/cli/utils/cli-git.d.ts.map +1 -1
- package/dist/cli/utils/cli-git.js +30 -0
- package/dist/cli/utils/cli-git.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 +7 -1
- package/dist/cli/utils/cli-os.d.ts.map +1 -1
- package/dist/cli/utils/cli-os.js +42 -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/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/webpack-final.d.ts.map +1 -1
- package/dist/storybook-config/webpack-final.js +2 -1
- package/dist/storybook-config/webpack-final.js.map +1 -1
- package/dist/telemetry/index.d.ts +3 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +21 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/telemetry/telemetry.d.ts +15 -0
- package/dist/telemetry/telemetry.d.ts.map +1 -0
- package/dist/telemetry/telemetry.js +176 -0
- package/dist/telemetry/telemetry.js.map +1 -0
- 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 +12 -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 +6 -2
- package/dist/vite/config/create-filtering-logger.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.js +1 -1
- 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/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/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 +17 -12
- 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 +32 -26
- package/src/cli/commands/__tests__/build.test.ts +81 -20
- package/src/cli/commands/__tests__/bundle-package.test.ts +65 -0
- package/src/cli/commands/__tests__/command.test.ts +154 -0
- package/src/cli/commands/__tests__/init.test.ts +1 -1
- package/src/cli/commands/__tests__/install.test.ts +5 -72
- 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 +77 -16
- package/src/cli/commands/build.ts +15 -6
- package/src/cli/commands/bundle-package.ts +20 -0
- package/src/cli/commands/command.ts +64 -0
- package/src/cli/commands/init.ts +0 -1
- package/src/cli/commands/install.ts +5 -21
- 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/install.ts +1 -6
- package/src/cli/commands/registry/start.ts +3 -2
- package/src/cli/commands/run-task.ts +8 -2
- package/src/cli/commands/start.ts +17 -6
- 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-git.test.ts +54 -3
- package/src/cli/utils/__tests__/cli-npm.test.ts +33 -0
- package/src/cli/utils/__tests__/cli-os.test.ts +183 -4
- 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-git.ts +27 -1
- package/src/cli/utils/cli-npm.ts +19 -4
- package/src/cli/utils/cli-os.ts +44 -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/storybook-config/__tests__/vite-final.test.ts +6 -0
- package/src/storybook-config/__tests__/webpack-final.test.ts +26 -12
- package/src/storybook-config/webpack-final.ts +10 -4
- package/src/telemetry/__tests__/telemetry.test.ts +326 -0
- package/src/telemetry/index.ts +2 -0
- package/src/telemetry/telemetry.ts +134 -0
- 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 +12 -4
- package/src/vite/config/__tests__/create-css-config.test.ts +2 -6
- package/src/vite/config/__tests__/create-filtering-logger.test.ts +3 -2
- package/src/vite/config/__tests__/create-vite-config.test.ts +6 -3
- package/src/vite/config/base-config.ts +13 -1
- package/src/vite/config/create-filtering-logger.ts +8 -2
- 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 +1 -1
- 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__/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 +1 -1
- 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/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/webpack/__tests__/bundle-webpack.test.ts +32 -0
- package/src/webpack/__tests__/create-webpack-config-shared-dependencies.test.ts +27 -1
- 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 +22 -11
- 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,"sources":["../../src/webpack/bundle-webpack.ts"],"sourcesContent":["import { getPortPromise } from 'portfinder';\nimport webpack, { Configuration } from 'webpack';\nimport WebpackDevServer from 'webpack-dev-server';\nimport { isDevServerDisabled, isExposeSharedDependencies, isWebComponent, log } from '../utils';\nimport { createWebpackConfigs } from './create-webpack-configs';\n\ninterface Options {\n buildStat?: boolean;\n codeCoverage?: boolean;\n config?: string;\n emitExposedDependencies?: boolean;\n useWatchConfig?: boolean;\n watch?: boolean;\n}\n\nexport async function bundleWebpack(options: Options = {}) {\n const { emitExposedDependencies, watch } = options;\n\n if (emitExposedDependencies) {\n if (watch) {\n throw new Error('cannot bundle exposed dependencies in watch mode');\n }\n if (!isExposeSharedDependencies()) {\n return;\n }\n }\n\n log.info(`Bundling ${emitExposedDependencies ? 'exposed dependencies' : 'package'}...`);\n\n const { full, light, headless } = createWebpackConfigs(options);\n\n // Standalone app — only the full config is needed\n if (!isWebComponent()) {\n return watch ? runDevServer(full) : run(full);\n }\n\n if (watch) {\n return Promise.all([\n runDevServer(full),\n light && runWatch(light),\n headless && runWatch(headless),\n ]);\n }\n\n return Promise.all([run(full), light && run(light), headless && run(headless)]);\n}\n\nasync function runDevServer(config: Configuration) {\n return isDevServerDisabled() ? runWatch(config) : runServe(config);\n}\n\nasync function run(config: Configuration) {\n const compiler = createWebpackCompiler(config);\n\n const stats = await new Promise<webpack.Stats>((resolve, reject) => {\n compiler.run((error, stats) => {\n if (!stats || error) {\n return reject(error ?? new Error('Something went wrong.'));\n }\n\n if (stats.hasErrors()) {\n return reject(new Error(stats.toString('errors-only')));\n }\n\n compiler.close(() => resolve(stats));\n });\n });\n\n process.stdout.write(stats.toString(config.stats) + '\\n');\n}\n\nasync function runServe({ devServer = {}, ...config }: Configuration) {\n const compiler = createWebpackCompiler(config);\n const host = devServer.host ?? 'localhost';\n const port = await getPortPromise({\n port: Number(process.env.PORT) || Number(devServer.port) || 8080,\n host,\n });\n\n return new Promise<void>((_0, reject) => {\n const server = new WebpackDevServer({ ...devServer, host, port }
|
|
1
|
+
{"version":3,"sources":["../../src/webpack/bundle-webpack.ts"],"sourcesContent":["import { getPortPromise } from 'portfinder';\nimport webpack, { Configuration } from 'webpack';\nimport WebpackDevServer from 'webpack-dev-server';\nimport { isDevServerDisabled, isExposeSharedDependencies, isWebComponent, log } from '../utils';\nimport { createWebpackConfigs } from './create-webpack-configs';\nimport { normalizeProxyConfig } from './utils';\n\ninterface Options {\n buildStat?: boolean;\n codeCoverage?: boolean;\n config?: string;\n emitExposedDependencies?: boolean;\n useWatchConfig?: boolean;\n watch?: boolean;\n}\n\nexport async function bundleWebpack(options: Options = {}) {\n const { emitExposedDependencies, watch } = options;\n\n if (emitExposedDependencies) {\n if (watch) {\n throw new Error('cannot bundle exposed dependencies in watch mode');\n }\n if (!isExposeSharedDependencies()) {\n return;\n }\n }\n\n log.info(`Bundling ${emitExposedDependencies ? 'exposed dependencies' : 'package'}...`);\n\n const { full, light, headless } = createWebpackConfigs(options);\n\n // Standalone app — only the full config is needed\n if (!isWebComponent()) {\n return watch ? runDevServer(full) : run(full);\n }\n\n if (watch) {\n return Promise.all([\n runDevServer(full),\n light && runWatch(light),\n headless && runWatch(headless),\n ]);\n }\n\n return Promise.all([run(full), light && run(light), headless && run(headless)]);\n}\n\nasync function runDevServer(config: Configuration) {\n return isDevServerDisabled() ? runWatch(config) : runServe(config);\n}\n\nasync function run(config: Configuration) {\n const compiler = createWebpackCompiler(config);\n\n const stats = await new Promise<webpack.Stats>((resolve, reject) => {\n compiler.run((error, stats) => {\n if (!stats || error) {\n return reject(error ?? new Error('Something went wrong.'));\n }\n\n if (stats.hasErrors()) {\n return reject(new Error(stats.toString('errors-only')));\n }\n\n compiler.close(() => resolve(stats));\n });\n });\n\n process.stdout.write(stats.toString(config.stats) + '\\n');\n}\n\nasync function runServe({ devServer = {}, ...config }: Configuration) {\n const compiler = createWebpackCompiler(config);\n const host = devServer.host ?? 'localhost';\n const port = await getPortPromise({\n port: Number(process.env.PORT) || Number(devServer.port) || 8080,\n host,\n });\n\n const proxy = devServer.proxy && normalizeProxyConfig(devServer.proxy);\n\n return new Promise<void>((_0, reject) => {\n const server = new WebpackDevServer(\n { ...devServer, host, port, ...(proxy && { proxy }) },\n compiler\n );\n server.startCallback(e => {\n if (e) {\n server.stopCallback(() => {\n reject(e);\n });\n }\n });\n });\n}\n\nasync function runWatch(config: Configuration) {\n const compiler = createWebpackCompiler(config);\n return new Promise<void>((_0, reject) => {\n const watching = compiler.watch({}, e => {\n if (e) {\n watching?.close(() => {\n reject(e);\n });\n }\n });\n });\n}\n\nfunction createWebpackCompiler(config: Configuration) {\n return webpack(config);\n}\n"],"names":["bundleWebpack","options","emitExposedDependencies","watch","Error","isExposeSharedDependencies","log","info","full","light","headless","createWebpackConfigs","isWebComponent","runDevServer","run","Promise","all","runWatch","config","isDevServerDisabled","runServe","compiler","createWebpackCompiler","stats","resolve","reject","error","hasErrors","toString","close","process","stdout","write","devServer","host","port","getPortPromise","Number","env","PORT","proxy","normalizeProxyConfig","_0","server","WebpackDevServer","startCallback","e","stopCallback","watching","webpack"],"mappings":"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"}
|
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "optimizationConfig", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _cssminimizerwebpackplugin = /*#__PURE__*/ _interop_require_default(require("css-minimizer-webpack-plugin"));
|
|
12
|
-
const
|
|
12
|
+
const _minimizerwebpackplugin = /*#__PURE__*/ _interop_require_default(require("minimizer-webpack-plugin"));
|
|
13
13
|
const _core = require("../../core");
|
|
14
14
|
function _interop_require_default(obj) {
|
|
15
15
|
return obj && obj.__esModule ? obj : {
|
|
@@ -42,12 +42,13 @@ function optimizationConfig(context, _) {
|
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
function hostConfig(optimization, context) {
|
|
45
|
-
const { isProduction } = context.build;
|
|
46
|
-
const { isWebComponent } = context.package;
|
|
45
|
+
const { isProduction, emitExposedDependencies } = context.build;
|
|
46
|
+
const { isWebComponent, sharedDependencies } = context.package;
|
|
47
47
|
if (isWebComponent || !isProduction) {
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
|
-
|
|
50
|
+
const excludeDesignSystem = emitExposedDependencies && !!sharedDependencies['@servicetitan/design-system'];
|
|
51
|
+
Object.assign(optimization.splitChunks.cacheGroups, vendorGroups(excludeDesignSystem));
|
|
51
52
|
}
|
|
52
53
|
function minimizeConfig(optimization, context) {
|
|
53
54
|
var _ref, _ref1;
|
|
@@ -67,7 +68,7 @@ function minimizeConfig(optimization, context) {
|
|
|
67
68
|
/*
|
|
68
69
|
* MFE source maps are available to Datadog, so compress and mangle are OK.
|
|
69
70
|
* Disable for hosts until their source maps are uploaded too.
|
|
70
|
-
*/ const
|
|
71
|
+
*/ const minimizerOptions = {
|
|
71
72
|
compress: !!isWebComponent,
|
|
72
73
|
mangle: !!isWebComponent,
|
|
73
74
|
...typeof minifyJs === 'object' ? minifyJs : {}
|
|
@@ -77,8 +78,8 @@ function minimizeConfig(optimization, context) {
|
|
|
77
78
|
};
|
|
78
79
|
optimization.minimizer = [
|
|
79
80
|
...minifyJs ? [
|
|
80
|
-
new
|
|
81
|
-
|
|
81
|
+
new _minimizerwebpackplugin.default({
|
|
82
|
+
minimizerOptions
|
|
82
83
|
})
|
|
83
84
|
] : [],
|
|
84
85
|
...minifyCss ? [
|
|
@@ -125,27 +126,31 @@ function webComponentConfig(optimization, context) {
|
|
|
125
126
|
}
|
|
126
127
|
});
|
|
127
128
|
}
|
|
128
|
-
function vendorGroups() {
|
|
129
|
+
function vendorGroups(excludeDesignSystem = false) {
|
|
130
|
+
/*
|
|
131
|
+
* The design-system entry already gets its own chunk; excluding it here keeps
|
|
132
|
+
* its CSS from being absorbed into a vendor chunk.
|
|
133
|
+
*/ const chunks = excludeDesignSystem ? (chunk)=>chunk.name !== 'design-system' : 'all';
|
|
129
134
|
return {
|
|
130
135
|
'servicetitan': {
|
|
131
136
|
name: 'servicetitan',
|
|
132
137
|
test: _core.CHUNK_PATTERNS.servicetitan,
|
|
133
|
-
chunks
|
|
138
|
+
chunks
|
|
134
139
|
},
|
|
135
140
|
'vendor-core': {
|
|
136
141
|
name: 'vendor-core',
|
|
137
142
|
test: _core.CHUNK_PATTERNS['vendor-core'],
|
|
138
|
-
chunks
|
|
143
|
+
chunks
|
|
139
144
|
},
|
|
140
145
|
'kendo': {
|
|
141
146
|
name: 'kendo',
|
|
142
147
|
test: _core.CHUNK_PATTERNS.kendo,
|
|
143
|
-
chunks
|
|
148
|
+
chunks
|
|
144
149
|
},
|
|
145
150
|
'vendor': {
|
|
146
151
|
name: 'vendor',
|
|
147
152
|
test: _core.CHUNK_PATTERNS.vendor,
|
|
148
|
-
chunks
|
|
153
|
+
chunks,
|
|
149
154
|
priority: -5
|
|
150
155
|
}
|
|
151
156
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/webpack/configs/optimization-config.ts"],"sourcesContent":["import CssMinimizerWebpackPlugin from 'css-minimizer-webpack-plugin';\nimport
|
|
1
|
+
{"version":3,"sources":["../../../src/webpack/configs/optimization-config.ts"],"sourcesContent":["import CssMinimizerWebpackPlugin from 'css-minimizer-webpack-plugin';\nimport MinimizerPlugin from 'minimizer-webpack-plugin';\nimport { Configuration } from 'webpack';\nimport { CHUNK_PATTERNS } from '../../core';\nimport { Overrides, WebpackBuildContext } from '../types';\n\ntype Config = Configuration['optimization'];\ntype ConfigWithCacheGroups = Config & { splitChunks: { cacheGroups: Record<string, any> } };\ntype Result = Pick<Configuration, 'optimization'>;\n\nexport function optimizationConfig(context: WebpackBuildContext, _: Overrides): Result {\n const { headless, isProduction, emitExposedDependencies } = context.build;\n\n const optimization: ConfigWithCacheGroups = {\n chunkIds: isProduction ? 'deterministic' : 'named',\n moduleIds: 'size',\n mangleExports: 'size',\n splitChunks: { cacheGroups: {} },\n };\n\n if (emitExposedDependencies) {\n optimization.runtimeChunk = false;\n } else if (!headless && isProduction) {\n optimization.runtimeChunk = 'single';\n }\n\n [hostConfig, minimizeConfig, sharedDependenciesConfig, webComponentConfig].forEach(handler =>\n handler(optimization, context)\n );\n\n return { optimization };\n}\n\nfunction hostConfig(optimization: ConfigWithCacheGroups, context: WebpackBuildContext) {\n const { isProduction, emitExposedDependencies } = context.build;\n const { isWebComponent, sharedDependencies } = context.package;\n if (isWebComponent || !isProduction) {\n return;\n }\n\n const excludeDesignSystem =\n emitExposedDependencies && !!sharedDependencies['@servicetitan/design-system'];\n\n Object.assign(optimization.splitChunks.cacheGroups, vendorGroups(excludeDesignSystem));\n}\n\nfunction minimizeConfig(optimization: ConfigWithCacheGroups, context: WebpackBuildContext) {\n const { isProduction } = context.build;\n const { isWebComponent } = context.package;\n const { codeCoverage } = context.options;\n const { minify } = context.bundlerConfig;\n if (!isProduction) {\n return;\n }\n\n const minifyJs = minify?.js ?? true;\n const minifyCss = minify?.css ?? true;\n optimization.minimize = !codeCoverage && (!!minifyJs || !!minifyCss);\n if (!optimization.minimize) {\n return;\n }\n\n /*\n * MFE source maps are available to Datadog, so compress and mangle are OK.\n * Disable for hosts until their source maps are uploaded too.\n */\n const minimizerOptions = {\n compress: !!isWebComponent,\n mangle: !!isWebComponent,\n ...(typeof minifyJs === 'object' ? minifyJs : {}),\n };\n\n const cssMinimizerPluginOptions = {\n ...(typeof minifyCss === 'object' ? minifyCss : {}),\n };\n\n optimization.minimizer = [\n ...(minifyJs ? [new MinimizerPlugin({ minimizerOptions })] : []),\n ...(minifyCss ? [new CssMinimizerWebpackPlugin(cssMinimizerPluginOptions)] : []),\n ];\n}\n\nfunction sharedDependenciesConfig(\n optimization: ConfigWithCacheGroups,\n context: WebpackBuildContext\n) {\n const { emitExposedDependencies } = context.build;\n if (!emitExposedDependencies) {\n return;\n }\n\n Object.assign(optimization.splitChunks.cacheGroups, {\n anvil2: {\n test: /@servicetitan[\\\\/]anvil2[\\\\/].*\\.css$/,\n name: 'anvil2',\n chunks: 'all',\n enforce: true,\n // Must outrank vendor groups so anvil2 CSS lands in separate chunk\n priority: 10,\n },\n });\n}\n\nfunction webComponentConfig(optimization: ConfigWithCacheGroups, context: WebpackBuildContext) {\n const { headless, isProduction } = context.build;\n const { isWebComponent } = context.package;\n if (!isWebComponent) {\n return;\n }\n\n const groups = vendorGroups();\n const styles = { name: 'main', type: 'css/mini-extract', chunks: 'all', enforce: true };\n\n Object.assign(optimization.splitChunks.cacheGroups, {\n ...(headless ? {} : { styles }),\n // assets-manifest-plugin requires servicetitan to order CSS correctly (headless has no CSS)\n ...(isProduction ? groups : headless ? {} : { servicetitan: groups.servicetitan }),\n });\n}\n\nfunction vendorGroups(excludeDesignSystem = false): Record<string, any> {\n /*\n * The design-system entry already gets its own chunk; excluding it here keeps\n * its CSS from being absorbed into a vendor chunk.\n */\n const chunks: any = excludeDesignSystem\n ? (chunk: { name?: string }) => chunk.name !== 'design-system'\n : 'all';\n\n return {\n 'servicetitan': {\n name: 'servicetitan',\n test: CHUNK_PATTERNS.servicetitan,\n chunks,\n },\n 'vendor-core': {\n name: 'vendor-core',\n test: CHUNK_PATTERNS['vendor-core'],\n chunks,\n },\n 'kendo': {\n name: 'kendo',\n test: CHUNK_PATTERNS.kendo,\n chunks,\n },\n 'vendor': {\n name: 'vendor',\n test: CHUNK_PATTERNS.vendor,\n chunks,\n priority: -5,\n },\n };\n}\n"],"names":["optimizationConfig","context","_","headless","isProduction","emitExposedDependencies","build","optimization","chunkIds","moduleIds","mangleExports","splitChunks","cacheGroups","runtimeChunk","hostConfig","minimizeConfig","sharedDependenciesConfig","webComponentConfig","forEach","handler","isWebComponent","sharedDependencies","package","excludeDesignSystem","Object","assign","vendorGroups","codeCoverage","options","minify","bundlerConfig","minifyJs","js","minifyCss","css","minimize","minimizerOptions","compress","mangle","cssMinimizerPluginOptions","minimizer","MinimizerPlugin","CssMinimizerWebpackPlugin","anvil2","test","name","chunks","enforce","priority","groups","styles","type","servicetitan","chunk","CHUNK_PATTERNS","kendo","vendor"],"mappings":"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"}
|
|
@@ -24,7 +24,7 @@ function outputConfig(context, _) {
|
|
|
24
24
|
Object.assign(output, {
|
|
25
25
|
filename: '[name].[contenthash].bundle.js',
|
|
26
26
|
...isWebComponent ? {
|
|
27
|
-
uniqueName: name
|
|
27
|
+
uniqueName: `${name}-${(0, _core.getBundleType)(context)}`
|
|
28
28
|
} : {},
|
|
29
29
|
...cdnPath ? {
|
|
30
30
|
publicPath: cdnPath
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/webpack/configs/output-config.ts"],"sourcesContent":["import { Configuration } from 'webpack';\nimport { BuildContext, getBundleType, getCdnPath } from '../../core';\nimport { Overrides } from '../types';\n\ntype Config = Configuration['output'];\ntype Result = Pick<Configuration, 'output'>;\n\nexport function outputConfig(context: BuildContext, _: Overrides): Result {\n const { name, isProduction, emitExposedDependencies } = context.build;\n const { isWebComponent } = context.package;\n\n const output: Config = {\n filename: '[name].bundle.js',\n clean: getClean(context),\n ...(emitExposedDependencies ? { chunkLoadingGlobal: `sharedChunk${name}` } : {}),\n };\n\n if (isProduction) {\n const cdnPath = getCdnPath(context);\n Object.assign(output, {\n filename: '[name].[contenthash].bundle.js',\n ...(isWebComponent ? { uniqueName: name } : {}),\n ...(cdnPath ? { publicPath: cdnPath } : {}),\n });\n }\n\n return { output };\n}\n\nfunction getClean(context: BuildContext): NonNullable<Config>['clean'] {\n const { emitExposedDependencies } = context.build;\n if (emitExposedDependencies) {\n return true;\n }\n const exposedDependenciesDir = getBundleType({\n ...context,\n build: { ...context.build, emitExposedDependencies: true },\n });\n return exposedDependenciesDir ? { keep: new RegExp(exposedDependenciesDir) } : true;\n}\n"],"names":["outputConfig","context","_","name","isProduction","emitExposedDependencies","build","isWebComponent","package","output","filename","clean","getClean","chunkLoadingGlobal","cdnPath","getCdnPath","Object","assign","uniqueName","
|
|
1
|
+
{"version":3,"sources":["../../../src/webpack/configs/output-config.ts"],"sourcesContent":["import { Configuration } from 'webpack';\nimport { BuildContext, getBundleType, getCdnPath } from '../../core';\nimport { Overrides } from '../types';\n\ntype Config = Configuration['output'];\ntype Result = Pick<Configuration, 'output'>;\n\nexport function outputConfig(context: BuildContext, _: Overrides): Result {\n const { name, isProduction, emitExposedDependencies } = context.build;\n const { isWebComponent } = context.package;\n\n const output: Config = {\n filename: '[name].bundle.js',\n clean: getClean(context),\n ...(emitExposedDependencies ? { chunkLoadingGlobal: `sharedChunk${name}` } : {}),\n };\n\n if (isProduction) {\n const cdnPath = getCdnPath(context);\n Object.assign(output, {\n filename: '[name].[contenthash].bundle.js',\n ...(isWebComponent ? { uniqueName: `${name}-${getBundleType(context)}` } : {}),\n ...(cdnPath ? { publicPath: cdnPath } : {}),\n });\n }\n\n return { output };\n}\n\nfunction getClean(context: BuildContext): NonNullable<Config>['clean'] {\n const { emitExposedDependencies } = context.build;\n if (emitExposedDependencies) {\n return true;\n }\n const exposedDependenciesDir = getBundleType({\n ...context,\n build: { ...context.build, emitExposedDependencies: true },\n });\n return exposedDependenciesDir ? { keep: new RegExp(exposedDependenciesDir) } : true;\n}\n"],"names":["outputConfig","context","_","name","isProduction","emitExposedDependencies","build","isWebComponent","package","output","filename","clean","getClean","chunkLoadingGlobal","cdnPath","getCdnPath","Object","assign","uniqueName","getBundleType","publicPath","exposedDependenciesDir","keep","RegExp"],"mappings":";;;;+BAOgBA;;;eAAAA;;;sBANwC;AAMjD,SAASA,aAAaC,OAAqB,EAAEC,CAAY;IAC5D,MAAM,EAAEC,IAAI,EAAEC,YAAY,EAAEC,uBAAuB,EAAE,GAAGJ,QAAQK,KAAK;IACrE,MAAM,EAAEC,cAAc,EAAE,GAAGN,QAAQO,OAAO;IAE1C,MAAMC,SAAiB;QACnBC,UAAU;QACVC,OAAOC,SAASX;QAChB,GAAII,0BAA0B;YAAEQ,oBAAoB,CAAC,WAAW,EAAEV,MAAM;QAAC,IAAI,CAAC,CAAC;IACnF;IAEA,IAAIC,cAAc;QACd,MAAMU,UAAUC,IAAAA,gBAAU,EAACd;QAC3Be,OAAOC,MAAM,CAACR,QAAQ;YAClBC,UAAU;YACV,GAAIH,iBAAiB;gBAAEW,YAAY,GAAGf,KAAK,CAAC,EAAEgB,IAAAA,mBAAa,EAAClB,UAAU;YAAC,IAAI,CAAC,CAAC;YAC7E,GAAIa,UAAU;gBAAEM,YAAYN;YAAQ,IAAI,CAAC,CAAC;QAC9C;IACJ;IAEA,OAAO;QAAEL;IAAO;AACpB;AAEA,SAASG,SAASX,OAAqB;IACnC,MAAM,EAAEI,uBAAuB,EAAE,GAAGJ,QAAQK,KAAK;IACjD,IAAID,yBAAyB;QACzB,OAAO;IACX;IACA,MAAMgB,yBAAyBF,IAAAA,mBAAa,EAAC;QACzC,GAAGlB,OAAO;QACVK,OAAO;YAAE,GAAGL,QAAQK,KAAK;YAAED,yBAAyB;QAAK;IAC7D;IACA,OAAOgB,yBAAyB;QAAEC,MAAM,IAAIC,OAAOF;IAAwB,IAAI;AACnF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/webpack/configs/plugins/ignore-plugin/ignore-plugin.ts"],"sourcesContent":["import { Compiler } from 'webpack';\nimport { BuildContext, type CheckerArgs, checkResource, type IgnoreMode } from '../../../../core';\nimport { Overrides } from '../../../types';\n\n/**\n * Handles optional peer dependencies that are not installed.\n *\n * @see {@link file://./../../../../vite/plugins/ignore-modules-plugin.ts} for the vite counterpart.\n *\n * 'throw' mode: returns false from beforeResolve, mirroring webpack's built-in IgnorePlugin.\n * Webpack emits a `webpackMissingModule()` IIFE that throws \"Cannot find module\" at runtime.\n * Top-level static imports of the resource crash module evaluation, and `try { require(...) }\n * catch {}` patterns work as expected. This is the default for matched optional peers.\n *\n * 'empty' mode: rewrites the request to point at an empty physical module so the import\n * resolves successfully with no exports. Required for top-level `import * as X from 'optional'`\n * followed by `X.foo === undefined` detection. Opt in via\n * `cli.peerDependenciesMeta[\"pkg\"].fallback = \"empty\"` in the importer's package.json.\n */\ntype Checker = (args: CheckerArgs) => IgnoreMode | false;\n\nclass IgnoreOptionalDependenciesPlugin {\n private readonly checker: Checker;\n private readonly emptyModulePath: string;\n\n constructor(checker: Checker) {\n this.checker = checker;\n this.emptyModulePath = require.resolve('./empty-module');\n }\n\n apply(compiler: Compiler) {\n compiler.hooks.normalModuleFactory.tap(\n 'IgnoreOptionalDependenciesPlugin',\n normalModuleFactory => {\n normalModuleFactory.hooks.beforeResolve.tap(\n 'IgnoreOptionalDependenciesPlugin',\n resolveData => {\n if (!resolveData) {\n return;\n }\n\n const mode = this.checker({\n resource: resolveData.request,\n importer: resolveData.context,\n });\n\n if (mode === 'throw') {\n return false;\n }\n\n if (mode === 'empty') {\n resolveData.request = this.emptyModulePath; // must be a physical file\n }\n }\n );\n }\n );\n }\n}\n\nexport function ignorePlugin(context: BuildContext, _: Overrides) {\n return new IgnoreOptionalDependenciesPlugin(checkResource(context));\n}\n"],"names":["ignorePlugin","IgnoreOptionalDependenciesPlugin","apply","compiler","hooks","normalModuleFactory","tap","beforeResolve","resolveData","mode","checker","resource","request","importer","context","emptyModulePath","require","resolve","_","checkResource"],"mappings":";;;;+BA4DgBA;;;eAAAA;;;sBA3D+D
|
|
1
|
+
{"version":3,"sources":["../../../../../src/webpack/configs/plugins/ignore-plugin/ignore-plugin.ts"],"sourcesContent":["import { Compiler } from 'webpack';\nimport { BuildContext, type CheckerArgs, checkResource, type IgnoreMode } from '../../../../core';\nimport { Overrides } from '../../../types';\n\n/**\n * Handles optional peer dependencies that are not installed.\n *\n * @see {@link file://./../../../../vite/plugins/ignore-modules-plugin.ts} for the vite counterpart.\n *\n * 'throw' mode: returns false from beforeResolve, mirroring webpack's built-in IgnorePlugin.\n * Webpack emits a `webpackMissingModule()` IIFE that throws \"Cannot find module\" at runtime.\n * Top-level static imports of the resource crash module evaluation, and `try { require(...) }\n * catch {}` patterns work as expected. This is the default for matched optional peers.\n *\n * 'empty' mode: rewrites the request to point at an empty physical module so the import\n * resolves successfully with no exports. Required for top-level `import * as X from 'optional'`\n * followed by `X.foo === undefined` detection. Opt in via\n * `cli.peerDependenciesMeta[\"pkg\"].fallback = \"empty\"` in the importer's package.json.\n */\ntype Checker = (args: CheckerArgs) => IgnoreMode | false;\n\nclass IgnoreOptionalDependenciesPlugin {\n private readonly checker: Checker;\n private readonly emptyModulePath: string;\n\n constructor(checker: Checker) {\n this.checker = checker;\n this.emptyModulePath = require.resolve('./empty-module');\n }\n\n apply(compiler: Compiler) {\n compiler.hooks.normalModuleFactory.tap(\n 'IgnoreOptionalDependenciesPlugin',\n normalModuleFactory => {\n normalModuleFactory.hooks.beforeResolve.tap(\n 'IgnoreOptionalDependenciesPlugin',\n resolveData => {\n if (!resolveData) {\n return;\n }\n\n const mode = this.checker({\n resource: resolveData.request,\n importer: resolveData.context,\n });\n\n if (mode === 'throw') {\n return false;\n }\n\n if (mode === 'empty') {\n resolveData.request = this.emptyModulePath; // must be a physical file\n }\n }\n );\n }\n );\n }\n}\n\nexport function ignorePlugin(context: BuildContext, _: Overrides) {\n return new IgnoreOptionalDependenciesPlugin(checkResource(context));\n}\n"],"names":["ignorePlugin","IgnoreOptionalDependenciesPlugin","apply","compiler","hooks","normalModuleFactory","tap","beforeResolve","resolveData","mode","checker","resource","request","importer","context","emptyModulePath","require","resolve","_","checkResource"],"mappings":";;;;+BA4DgBA;;;eAAAA;;;sBA3D+D;;;;;;;;;;;;AAoB/E,MAAMC;IASFC,MAAMC,QAAkB,EAAE;QACtBA,SAASC,KAAK,CAACC,mBAAmB,CAACC,GAAG,CAClC,oCACAD,CAAAA;YACIA,oBAAoBD,KAAK,CAACG,aAAa,CAACD,GAAG,CACvC,oCACAE,CAAAA;gBACI,IAAI,CAACA,aAAa;oBACd;gBACJ;gBAEA,MAAMC,OAAO,IAAI,CAACC,OAAO,CAAC;oBACtBC,UAAUH,YAAYI,OAAO;oBAC7BC,UAAUL,YAAYM,OAAO;gBACjC;gBAEA,IAAIL,SAAS,SAAS;oBAClB,OAAO;gBACX;gBAEA,IAAIA,SAAS,SAAS;oBAClBD,YAAYI,OAAO,GAAG,IAAI,CAACG,eAAe,EAAE,0BAA0B;gBAC1E;YACJ;QAER;IAER;IAhCA,YAAYL,OAAgB,CAAE;QAH9B,uBAAiBA,WAAjB,KAAA;QACA,uBAAiBK,mBAAjB,KAAA;QAGI,IAAI,CAACL,OAAO,GAAGA;QACf,IAAI,CAACK,eAAe,GAAGC,QAAQC,OAAO,CAAC;IAC3C;AA8BJ;AAEO,SAASjB,aAAac,OAAqB,EAAEI,CAAY;IAC5D,OAAO,IAAIjB,iCAAiCkB,IAAAA,mBAAa,EAACL;AAC9D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./configuration.expose-loader');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/webpack/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/webpack/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC"}
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
_export_star(require("./create-webpack-build-context"), exports);
|
|
6
6
|
_export_star(require("./get-caller-filename"), exports);
|
|
7
7
|
_export_star(require("./get-module-entry-path"), exports);
|
|
8
|
+
_export_star(require("./normalize-proxy-config"), exports);
|
|
8
9
|
_export_star(require("./split-by-entry"), exports);
|
|
9
10
|
function _export_star(from, to) {
|
|
10
11
|
Object.keys(from).forEach(function(k) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/webpack/utils/index.ts"],"sourcesContent":["export * from './create-webpack-build-context';\nexport * from './get-caller-filename';\nexport * from './get-module-entry-path';\nexport * from './split-by-entry';\n"],"names":[],"mappings":";;;;qBAAc;qBACA;qBACA;qBACA"}
|
|
1
|
+
{"version":3,"sources":["../../../src/webpack/utils/index.ts"],"sourcesContent":["export * from './create-webpack-build-context';\nexport * from './get-caller-filename';\nexport * from './get-module-entry-path';\nexport * from './normalize-proxy-config';\nexport * from './split-by-entry';\n"],"names":[],"mappings":";;;;qBAAc;qBACA;qBACA;qBACA;qBACA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Configuration } from 'webpack';
|
|
2
|
+
type DevServerConfig = NonNullable<Configuration['devServer']>;
|
|
3
|
+
type ProxyConfig = NonNullable<DevServerConfig['proxy']>;
|
|
4
|
+
export declare function normalizeProxyConfig(proxy: ProxyConfig): ProxyConfig;
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=normalize-proxy-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-proxy-config.d.ts","sourceRoot":"","sources":["../../../src/webpack/utils/normalize-proxy-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAGxC,KAAK,eAAe,GAAG,WAAW,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC;AAC/D,KAAK,WAAW,GAAG,WAAW,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC;AAYzD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW,CAOpE"}
|
|
@@ -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": "38.
|
|
3
|
+
"version": "38.2.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": "38.
|
|
107
|
-
"@servicetitan/install": "38.
|
|
108
|
-
"@servicetitan/startup-utils": "38.
|
|
109
|
-
"@servicetitan/stylelint-config": "38.
|
|
106
|
+
"@servicetitan/eslint-config": "38.2.0",
|
|
107
|
+
"@servicetitan/install": "38.2.0",
|
|
108
|
+
"@servicetitan/startup-utils": "38.2.0",
|
|
109
|
+
"@servicetitan/stylelint-config": "38.2.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,63 +120,66 @@
|
|
|
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.3.
|
|
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",
|
|
127
127
|
"glob": "~13.0.6",
|
|
128
|
-
"html-webpack-plugin": "~5.6.
|
|
128
|
+
"html-webpack-plugin": "~5.6.8",
|
|
129
129
|
"html-webpack-tags-plugin": "^3.0.2",
|
|
130
130
|
"identity-obj-proxy": "~3.0.0",
|
|
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.2",
|
|
136
136
|
"json5": "^2.2.3",
|
|
137
137
|
"lerna": "~9.0.7",
|
|
138
|
-
"less": "~4.
|
|
138
|
+
"less": "~4.8.1",
|
|
139
139
|
"less-loader": "~13.0.0",
|
|
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": "^1.1.0",
|
|
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
151
|
"postcss": "~8.5.16",
|
|
150
|
-
"prettier": "~3.9.
|
|
151
|
-
"
|
|
152
|
+
"prettier": "~3.9.6",
|
|
153
|
+
"react-refresh": "^0.18.0",
|
|
154
|
+
"sass": "~1.102.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
|
-
"
|
|
160
|
-
"ts-jest": "29.4.11",
|
|
163
|
+
"ts-jest": "29.4.12",
|
|
161
164
|
"ts-node": "~10.9.2",
|
|
162
165
|
"typed-css-modules": "~0.9.1",
|
|
163
166
|
"typescript": "6.0.3",
|
|
164
|
-
"vite": "^8.1.
|
|
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",
|
|
176
179
|
"webpack-virtual-modules": "~0.6.2",
|
|
177
180
|
"worker-loader": "~3.0.8",
|
|
178
181
|
"xhr-mock": "~2.5.1",
|
|
179
|
-
"yargs": "~18.
|
|
182
|
+
"yargs": "~18.1.0"
|
|
180
183
|
},
|
|
181
184
|
"peerDependencies": {
|
|
182
185
|
"cypress": ">=15.0.0",
|
|
@@ -190,6 +193,9 @@
|
|
|
190
193
|
"optional": true
|
|
191
194
|
}
|
|
192
195
|
},
|
|
196
|
+
"optionalDependencies": {
|
|
197
|
+
"@servicetitan/secrets": "^3.2.0"
|
|
198
|
+
},
|
|
193
199
|
"DEVELOPER_NOTES": {},
|
|
194
200
|
"publishConfig": {
|
|
195
201
|
"access": "public"
|
|
@@ -197,5 +203,5 @@
|
|
|
197
203
|
"cli": {
|
|
198
204
|
"webpack": false
|
|
199
205
|
},
|
|
200
|
-
"gitHead": "
|
|
206
|
+
"gitHead": "fd8cf00982a529371e44d76a0ca455dbbb42bae5"
|
|
201
207
|
}
|