@servicetitan/startup 36.4.0 → 37.0.1
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/analyze.js +3 -0
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +4 -5
- package/dist/cli/commands/build.js.map +1 -1
- package/dist/cli/commands/bundle-vite.d.ts.map +1 -1
- package/dist/cli/commands/bundle-vite.js +18 -1
- package/dist/cli/commands/bundle-vite.js.map +1 -1
- package/dist/cli/commands/registry/build.d.ts +6 -0
- package/dist/cli/commands/registry/build.d.ts.map +1 -1
- package/dist/cli/commands/registry/build.js +10 -1
- package/dist/cli/commands/registry/build.js.map +1 -1
- package/dist/cli/commands/registry/command-registry.d.ts +12 -28
- package/dist/cli/commands/registry/command-registry.d.ts.map +1 -1
- package/dist/cli/commands/registry/command-registry.js +0 -3
- package/dist/cli/commands/registry/command-registry.js.map +1 -1
- package/dist/cli/commands/registry/start.d.ts +6 -0
- package/dist/cli/commands/registry/start.d.ts.map +1 -1
- package/dist/cli/commands/registry/start.js +10 -1
- package/dist/cli/commands/registry/start.js.map +1 -1
- package/dist/cli/commands/review/rules/index.d.ts.map +1 -1
- package/dist/cli/commands/review/rules/index.js +2 -0
- package/dist/cli/commands/review/rules/index.js.map +1 -1
- package/dist/cli/commands/review/rules/require-compatible-typescript.d.ts +13 -0
- package/dist/cli/commands/review/rules/require-compatible-typescript.d.ts.map +1 -0
- package/dist/cli/commands/review/rules/require-compatible-typescript.js +72 -0
- package/dist/cli/commands/review/rules/require-compatible-typescript.js.map +1 -0
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +3 -4
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/test/runners/vitest.d.ts.map +1 -1
- package/dist/cli/commands/test/runners/vitest.js +7 -1
- package/dist/cli/commands/test/runners/vitest.js.map +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/utils/get-bundle-command.d.ts +3 -0
- package/dist/cli/utils/get-bundle-command.d.ts.map +1 -0
- package/dist/cli/utils/get-bundle-command.js +16 -0
- package/dist/cli/utils/get-bundle-command.js.map +1 -0
- package/dist/cli/utils/get-exit-code.d.ts +12 -0
- package/dist/cli/utils/get-exit-code.d.ts.map +1 -0
- package/dist/cli/utils/get-exit-code.js +26 -0
- package/dist/cli/utils/get-exit-code.js.map +1 -0
- package/dist/cli/utils/index.d.ts +3 -0
- package/dist/cli/utils/index.d.ts.map +1 -1
- package/dist/cli/utils/index.js +3 -0
- package/dist/cli/utils/index.js.map +1 -1
- package/dist/cli/utils/resolve-bundler.d.ts +8 -0
- package/dist/cli/utils/resolve-bundler.d.ts.map +1 -0
- package/dist/cli/utils/resolve-bundler.js +24 -0
- package/dist/cli/utils/resolve-bundler.js.map +1 -0
- package/dist/core/bundle-report.d.ts +4 -0
- package/dist/core/bundle-report.d.ts.map +1 -0
- package/dist/core/bundle-report.js +43 -0
- package/dist/core/bundle-report.js.map +1 -0
- package/dist/core/check-resource/check-resource.d.ts +5 -3
- package/dist/core/check-resource/check-resource.d.ts.map +1 -1
- package/dist/core/check-resource/check-resource.js +20 -13
- package/dist/core/check-resource/check-resource.js.map +1 -1
- package/dist/core/check-resource/get-peer-dependency-meta.d.ts +11 -1
- package/dist/core/check-resource/get-peer-dependency-meta.d.ts.map +1 -1
- package/dist/core/check-resource/get-peer-dependency-meta.js +58 -2
- package/dist/core/check-resource/get-peer-dependency-meta.js.map +1 -1
- package/dist/core/check-resource/index.d.ts +1 -1
- package/dist/core/check-resource/index.d.ts.map +1 -1
- package/dist/core/check-resource/index.js.map +1 -1
- package/dist/core/check-resource/is-resolvable.d.ts +7 -0
- package/dist/core/check-resource/is-resolvable.d.ts.map +1 -0
- package/dist/core/check-resource/is-resolvable.js +31 -0
- package/dist/core/check-resource/is-resolvable.js.map +1 -0
- package/dist/core/check-resource/types.d.ts +1 -0
- package/dist/core/check-resource/types.d.ts.map +1 -1
- package/dist/core/chunk-patterns.d.ts +7 -0
- package/dist/core/chunk-patterns.d.ts.map +1 -0
- package/dist/core/chunk-patterns.js +37 -0
- package/dist/core/chunk-patterns.js.map +1 -0
- package/dist/core/create-build-context.d.ts +0 -1
- package/dist/core/create-build-context.d.ts.map +1 -1
- package/dist/core/create-build-context.js +2 -2
- package/dist/core/create-build-context.js.map +1 -1
- package/dist/core/create-extension-regexp.d.ts +5 -0
- package/dist/core/create-extension-regexp.d.ts.map +1 -0
- package/dist/core/create-extension-regexp.js +45 -0
- package/dist/core/create-extension-regexp.js.map +1 -0
- package/dist/core/get-process-env.d.ts +3 -0
- package/dist/core/get-process-env.d.ts.map +1 -0
- package/dist/core/get-process-env.js +25 -0
- package/dist/core/get-process-env.js.map +1 -0
- package/dist/core/index.d.ts +8 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +8 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/moment-locales.d.ts +2 -0
- package/dist/core/moment-locales.d.ts.map +1 -0
- package/dist/core/moment-locales.js +21 -0
- package/dist/core/moment-locales.js.map +1 -0
- package/dist/core/resolve-output-path.d.ts +3 -0
- package/dist/core/resolve-output-path.d.ts.map +1 -0
- package/dist/core/resolve-output-path.js +25 -0
- package/dist/core/resolve-output-path.js.map +1 -0
- package/dist/core/resolve-output-root.d.ts +3 -0
- package/dist/core/resolve-output-root.d.ts.map +1 -0
- package/dist/core/resolve-output-root.js +23 -0
- package/dist/core/resolve-output-root.js.map +1 -0
- package/dist/core/sort-shared-css.d.ts +2 -0
- package/dist/core/sort-shared-css.d.ts.map +1 -0
- package/dist/core/sort-shared-css.js +20 -0
- package/dist/core/sort-shared-css.js.map +1 -0
- package/dist/core/types.d.ts +1 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/cypress/config/index.d.ts +1 -0
- package/dist/cypress/config/index.d.ts.map +1 -1
- package/dist/cypress/config/index.js +1 -0
- package/dist/cypress/config/index.js.map +1 -1
- package/dist/cypress/config/vite-config.d.ts +3 -0
- package/dist/cypress/config/vite-config.d.ts.map +1 -0
- package/dist/cypress/config/vite-config.js +58 -0
- package/dist/cypress/config/vite-config.js.map +1 -0
- package/dist/jest/resolver.d.ts.map +1 -1
- package/dist/jest/resolver.js +20 -1
- package/dist/jest/resolver.js.map +1 -1
- package/dist/storybook-config/index.d.ts +1 -0
- package/dist/storybook-config/index.d.ts.map +1 -1
- package/dist/storybook-config/index.js +1 -0
- package/dist/storybook-config/index.js.map +1 -1
- package/dist/storybook-config/vite-final.d.ts +7 -0
- package/dist/storybook-config/vite-final.d.ts.map +1 -0
- package/dist/storybook-config/vite-final.js +86 -0
- package/dist/storybook-config/vite-final.js.map +1 -0
- package/dist/utils/get-configuration.d.ts +15 -10
- package/dist/utils/get-configuration.d.ts.map +1 -1
- package/dist/utils/get-configuration.js +32 -2
- package/dist/utils/get-configuration.js.map +1 -1
- package/dist/utils/get-package-name.d.ts +2 -1
- package/dist/utils/get-package-name.d.ts.map +1 -1
- package/dist/utils/get-package-name.js +4 -2
- package/dist/utils/get-package-name.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.map +1 -1
- package/dist/utils/types.d.ts +2 -0
- package/dist/utils/types.d.ts.map +1 -0
- package/dist/utils/types.js +6 -0
- package/dist/utils/types.js.map +1 -0
- package/dist/utils/validate-shared-dependencies.d.ts.map +1 -1
- package/dist/utils/validate-shared-dependencies.js +4 -0
- package/dist/utils/validate-shared-dependencies.js.map +1 -1
- package/dist/vite/build-shared-dependencies.d.ts.map +1 -1
- package/dist/vite/build-shared-dependencies.js +1 -2
- package/dist/vite/build-shared-dependencies.js.map +1 -1
- package/dist/vite/config/asset-file-names.d.ts +4 -0
- package/dist/vite/config/asset-file-names.d.ts.map +1 -0
- package/dist/vite/config/asset-file-names.js +29 -0
- package/dist/vite/config/asset-file-names.js.map +1 -0
- package/dist/vite/config/base-config.d.ts.map +1 -1
- package/dist/vite/config/base-config.js +67 -40
- package/dist/vite/config/base-config.js.map +1 -1
- package/dist/vite/config/code-splitting.d.ts +4 -0
- package/dist/vite/config/code-splitting.d.ts.map +1 -0
- package/dist/vite/config/code-splitting.js +48 -0
- package/dist/vite/config/code-splitting.js.map +1 -0
- package/dist/vite/config/create-css-config.d.ts +3 -0
- package/dist/vite/config/create-css-config.d.ts.map +1 -0
- package/dist/vite/config/create-css-config.js +26 -0
- package/dist/vite/config/create-css-config.js.map +1 -0
- package/dist/vite/config/create-filtering-logger.d.ts +3 -0
- package/dist/vite/config/create-filtering-logger.d.ts.map +1 -0
- package/dist/vite/config/create-filtering-logger.js +37 -0
- package/dist/vite/config/create-filtering-logger.js.map +1 -0
- package/dist/vite/config/create-vite-build-context.d.ts +2 -1
- package/dist/vite/config/create-vite-build-context.d.ts.map +1 -1
- package/dist/vite/config/create-vite-build-context.js.map +1 -1
- package/dist/vite/config/create-vite-config.d.ts.map +1 -1
- package/dist/vite/config/create-vite-config.js +30 -13
- package/dist/vite/config/create-vite-config.js.map +1 -1
- package/dist/vite/config/get-warmup-client-files.d.ts +3 -0
- package/dist/vite/config/get-warmup-client-files.d.ts.map +1 -0
- package/dist/vite/config/get-warmup-client-files.js +26 -0
- package/dist/vite/config/get-warmup-client-files.js.map +1 -0
- package/dist/vite/index.html +1 -0
- package/dist/vite/plugins/bundle-stat-plugin.d.ts +4 -0
- package/dist/vite/plugins/bundle-stat-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/bundle-stat-plugin.js +32 -0
- package/dist/vite/plugins/bundle-stat-plugin.js.map +1 -0
- package/dist/vite/plugins/chain-source-maps-plugin.d.ts +3 -0
- package/dist/vite/plugins/chain-source-maps-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/chain-source-maps-plugin.js +37 -0
- package/dist/vite/plugins/chain-source-maps-plugin.js.map +1 -0
- package/dist/vite/plugins/clean-plugin.d.ts +4 -0
- package/dist/vite/plugins/clean-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/clean-plugin.js +63 -0
- package/dist/vite/plugins/clean-plugin.js.map +1 -0
- package/dist/vite/plugins/design-system-guard-plugin.d.ts +4 -0
- package/dist/vite/plugins/design-system-guard-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/design-system-guard-plugin.js +35 -0
- package/dist/vite/plugins/design-system-guard-plugin.js.map +1 -0
- package/dist/vite/plugins/ignore-modules-plugin.d.ts +21 -3
- package/dist/vite/plugins/ignore-modules-plugin.d.ts.map +1 -1
- package/dist/vite/plugins/ignore-modules-plugin.js +22 -8
- package/dist/vite/plugins/ignore-modules-plugin.js.map +1 -1
- package/dist/vite/plugins/index.d.ts +7 -0
- package/dist/vite/plugins/index.d.ts.map +1 -1
- package/dist/vite/plugins/index.js +7 -0
- package/dist/vite/plugins/index.js.map +1 -1
- package/dist/vite/plugins/istanbul-plugin.d.ts +4 -0
- package/dist/vite/plugins/istanbul-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/istanbul-plugin.js +27 -0
- package/dist/vite/plugins/istanbul-plugin.js.map +1 -0
- package/dist/vite/plugins/magic-comments-plugin/index.d.ts +2 -0
- package/dist/vite/plugins/magic-comments-plugin/index.d.ts.map +1 -0
- package/dist/vite/plugins/magic-comments-plugin/index.js +20 -0
- package/dist/vite/plugins/magic-comments-plugin/index.js.map +1 -0
- package/dist/vite/plugins/magic-comments-plugin/magic-comments-plugin.d.ts +4 -0
- package/dist/vite/plugins/magic-comments-plugin/magic-comments-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/magic-comments-plugin/magic-comments-plugin.js +63 -0
- package/dist/vite/plugins/magic-comments-plugin/magic-comments-plugin.js.map +1 -0
- package/dist/vite/plugins/magic-comments-plugin/parse-magic-comments.d.ts +6 -0
- package/dist/vite/plugins/magic-comments-plugin/parse-magic-comments.d.ts.map +1 -0
- package/dist/vite/plugins/magic-comments-plugin/parse-magic-comments.js +40 -0
- package/dist/vite/plugins/magic-comments-plugin/parse-magic-comments.js.map +1 -0
- package/dist/vite/plugins/metadata-plugin.js +2 -2
- package/dist/vite/plugins/metadata-plugin.js.map +1 -1
- package/dist/vite/plugins/moment-locales-plugin.d.ts +5 -0
- package/dist/vite/plugins/moment-locales-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/moment-locales-plugin.js +50 -0
- package/dist/vite/plugins/moment-locales-plugin.js.map +1 -0
- package/dist/vite/plugins/shared-dependencies-plugin/assemble-iife.d.ts +14 -0
- package/dist/vite/plugins/shared-dependencies-plugin/assemble-iife.d.ts.map +1 -0
- package/dist/vite/plugins/shared-dependencies-plugin/assemble-iife.js +100 -0
- package/dist/vite/plugins/shared-dependencies-plugin/assemble-iife.js.map +1 -0
- package/dist/vite/plugins/shared-dependencies-plugin/assert-no-dynamic-css.d.ts +3 -0
- package/dist/vite/plugins/shared-dependencies-plugin/assert-no-dynamic-css.d.ts.map +1 -0
- package/dist/vite/plugins/shared-dependencies-plugin/assert-no-dynamic-css.js +56 -0
- package/dist/vite/plugins/shared-dependencies-plugin/assert-no-dynamic-css.js.map +1 -0
- package/dist/vite/plugins/shared-dependencies-plugin/flatten.d.ts +2 -0
- package/dist/vite/plugins/shared-dependencies-plugin/flatten.d.ts.map +1 -0
- package/dist/vite/plugins/shared-dependencies-plugin/flatten.js +19 -0
- package/dist/vite/plugins/shared-dependencies-plugin/flatten.js.map +1 -0
- package/dist/vite/plugins/shared-dependencies-plugin/index.d.ts +2 -0
- package/dist/vite/plugins/shared-dependencies-plugin/index.d.ts.map +1 -0
- package/dist/vite/plugins/shared-dependencies-plugin/index.js +20 -0
- package/dist/vite/plugins/shared-dependencies-plugin/index.js.map +1 -0
- package/dist/vite/plugins/shared-dependencies-plugin/shared-dependencies-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/{shared-dependencies-plugin.js → shared-dependencies-plugin/shared-dependencies-plugin.js} +29 -107
- package/dist/vite/plugins/shared-dependencies-plugin/shared-dependencies-plugin.js.map +1 -0
- package/dist/vite/plugins/utils/import-esm.d.ts +2 -0
- package/dist/vite/plugins/utils/import-esm.d.ts.map +1 -0
- package/dist/vite/plugins/utils/import-esm.js +22 -0
- package/dist/vite/plugins/utils/import-esm.js.map +1 -0
- package/dist/vite/plugins/utils/index.d.ts +3 -0
- package/dist/vite/plugins/utils/index.d.ts.map +1 -0
- package/dist/vite/plugins/utils/index.js +21 -0
- package/dist/vite/plugins/utils/index.js.map +1 -0
- package/dist/webpack/configs/optimization-config.d.ts.map +1 -1
- package/dist/webpack/configs/optimization-config.js +53 -24
- package/dist/webpack/configs/optimization-config.js.map +1 -1
- package/dist/webpack/configs/output-config.d.ts.map +1 -1
- package/dist/webpack/configs/output-config.js +0 -1
- package/dist/webpack/configs/output-config.js.map +1 -1
- package/dist/webpack/configs/plugins/assets-manifest-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/assets-manifest-plugin.js +11 -3
- package/dist/webpack/configs/plugins/assets-manifest-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/bundle-analyser-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/bundle-analyser-plugin.js +2 -21
- package/dist/webpack/configs/plugins/bundle-analyser-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/define-process-env-plugin.d.ts +5 -0
- package/dist/webpack/configs/plugins/define-process-env-plugin.d.ts.map +1 -0
- package/dist/webpack/configs/plugins/define-process-env-plugin.js +20 -0
- package/dist/webpack/configs/plugins/define-process-env-plugin.js.map +1 -0
- package/dist/webpack/configs/plugins/filter-warnings-plugin.d.ts +1 -1
- package/dist/webpack/configs/plugins/filter-warnings-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/filter-warnings-plugin.js +1 -4
- package/dist/webpack/configs/plugins/filter-warnings-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/empty-module.d.ts +2 -0
- package/dist/webpack/configs/plugins/ignore-plugin/empty-module.d.ts.map +1 -0
- package/dist/webpack/configs/plugins/ignore-plugin/empty-module.js +11 -0
- package/dist/webpack/configs/plugins/ignore-plugin/empty-module.js.map +1 -0
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.d.ts +26 -3
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.js +41 -10
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/index.d.ts +1 -0
- package/dist/webpack/configs/plugins/index.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/index.js +1 -0
- package/dist/webpack/configs/plugins/index.js.map +1 -1
- package/dist/webpack/configs/plugins/moment-locales-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/moment-locales-plugin.js +2 -5
- package/dist/webpack/configs/plugins/moment-locales-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins-config.d.ts.map +1 -1
- package/dist/webpack/configs/plugins-config.js +1 -0
- package/dist/webpack/configs/plugins-config.js.map +1 -1
- package/dist/webpack/configs/rules/font-rules.d.ts.map +1 -1
- package/dist/webpack/configs/rules/font-rules.js +2 -1
- package/dist/webpack/configs/rules/font-rules.js.map +1 -1
- package/dist/webpack/configs/rules/image-rules.d.ts.map +1 -1
- package/dist/webpack/configs/rules/image-rules.js +2 -1
- package/dist/webpack/configs/rules/image-rules.js.map +1 -1
- package/dist/webpack/create-webpack-config.d.ts.map +1 -1
- package/dist/webpack/create-webpack-config.js +8 -3
- package/dist/webpack/create-webpack-config.js.map +1 -1
- package/dist/webpack/create-webpack-configs.d.ts.map +1 -1
- package/dist/webpack/create-webpack-configs.js +4 -12
- package/dist/webpack/create-webpack-configs.js.map +1 -1
- package/dist/webpack/types.d.ts +1 -1
- package/dist/webpack/types.d.ts.map +1 -1
- package/dist/webpack/utils/create-webpack-build-context.d.ts.map +1 -1
- package/dist/webpack/utils/create-webpack-build-context.js +1 -2
- package/dist/webpack/utils/create-webpack-build-context.js.map +1 -1
- package/package.json +22 -18
- package/src/cli/commands/__tests__/build.test.ts +33 -5
- package/src/cli/commands/__tests__/bundle-vite.test.ts +50 -1
- package/src/cli/commands/__tests__/start.test.ts +17 -4
- package/src/cli/commands/build.ts +5 -6
- package/src/cli/commands/bundle-vite.ts +13 -0
- package/src/cli/commands/registry/build.ts +6 -1
- package/src/cli/commands/registry/command-registry.ts +0 -1
- package/src/cli/commands/registry/start.ts +6 -1
- package/src/cli/commands/review/rules/__tests__/require-compatible-typescript.test.ts +127 -0
- package/src/cli/commands/review/rules/index.ts +2 -0
- package/src/cli/commands/review/rules/require-compatible-typescript.ts +64 -0
- package/src/cli/commands/start.ts +4 -4
- package/src/cli/commands/test/runners/__tests__/vitest.test.ts +8 -1
- package/src/cli/commands/test/runners/vitest.ts +5 -3
- package/src/cli/index.ts +2 -2
- package/src/cli/utils/__tests__/get-bundle-command.test.ts +23 -0
- package/src/cli/utils/__tests__/get-exit-code.test.ts +41 -0
- package/src/cli/utils/__tests__/resolve-bundler.test.ts +64 -0
- package/src/cli/utils/get-bundle-command.ts +5 -0
- package/src/cli/utils/get-exit-code.ts +17 -0
- package/src/cli/utils/index.ts +3 -0
- package/src/cli/utils/resolve-bundler.ts +23 -0
- package/src/core/__tests__/bundle-report.test.ts +60 -0
- package/src/core/__tests__/create-extension-regexp.test.ts +32 -0
- package/src/core/__tests__/resolve-output-path.test.ts +45 -0
- package/src/core/__tests__/resolve-output-root.test.ts +37 -0
- package/src/core/__tests__/sort-shared-css.test.ts +39 -0
- package/src/core/bundle-report.ts +33 -0
- package/src/core/check-resource/__tests__/check-resource.test.ts +21 -7
- package/src/core/check-resource/__tests__/get-peer-dependency-meta.test.ts +70 -13
- package/src/core/check-resource/__tests__/is-resolvable.test.ts +20 -0
- package/src/core/check-resource/check-resource.ts +17 -16
- package/src/core/check-resource/get-peer-dependency-meta.ts +67 -4
- package/src/core/check-resource/index.ts +1 -1
- package/src/core/check-resource/is-resolvable.ts +19 -0
- package/src/core/check-resource/types.ts +2 -0
- package/src/core/chunk-patterns.ts +30 -0
- package/src/core/create-build-context.ts +2 -2
- package/src/core/create-extension-regexp.ts +7 -0
- package/src/core/get-process-env.ts +17 -0
- package/src/core/index.ts +8 -1
- package/src/core/moment-locales.ts +6 -0
- package/src/core/resolve-output-path.ts +10 -0
- package/src/core/resolve-output-root.ts +8 -0
- package/src/core/sort-shared-css.ts +7 -0
- package/src/core/types.ts +1 -1
- package/src/cypress/config/__tests__/vite-config.test.ts +72 -0
- package/src/cypress/config/index.ts +1 -0
- package/src/cypress/config/vite-config.ts +37 -0
- package/src/jest/__tests__/resolver.test.ts +42 -1
- package/src/jest/resolver.ts +17 -1
- package/src/storybook-config/__tests__/vite-final.test.ts +122 -0
- package/src/storybook-config/index.ts +1 -0
- package/src/storybook-config/vite-final.ts +65 -0
- package/src/utils/__tests__/get-configuration.test.ts +82 -5
- package/src/utils/__tests__/get-package-name.test.ts +57 -0
- package/src/utils/__tests__/validate-shared-dependencies.test.ts +50 -35
- package/src/utils/get-configuration.ts +50 -15
- package/src/utils/get-package-name.ts +8 -2
- package/src/utils/index.ts +1 -0
- package/src/utils/types.ts +1 -0
- package/src/utils/validate-shared-dependencies.ts +15 -1
- package/src/vite/__tests__/build-shared-dependencies.test.ts +13 -26
- package/src/vite/__tests__/validate-shared-dependencies.test.ts +30 -19
- package/src/vite/build-shared-dependencies.ts +3 -7
- package/src/vite/config/__tests__/asset-file-names.test.ts +40 -0
- package/src/vite/config/__tests__/base-config.test.ts +99 -31
- package/src/vite/config/__tests__/code-splitting.test.ts +34 -0
- package/src/vite/config/__tests__/create-css-config.test.ts +58 -0
- package/src/vite/config/__tests__/create-filtering-logger.test.ts +51 -0
- package/src/vite/config/__tests__/create-vite-build-context.test.ts +5 -2
- package/src/vite/config/__tests__/create-vite-config.test.ts +91 -13
- package/src/vite/config/__tests__/get-warmup-client-files.test.ts +20 -0
- package/src/vite/config/asset-file-names.ts +20 -0
- package/src/vite/config/base-config.ts +45 -37
- package/src/vite/config/code-splitting.ts +23 -0
- package/src/vite/config/create-css-config.ts +16 -0
- package/src/vite/config/create-filtering-logger.ts +34 -0
- package/src/vite/config/create-vite-build-context.ts +3 -5
- package/src/vite/config/create-vite-config.ts +45 -12
- package/src/vite/config/get-warmup-client-files.ts +13 -0
- package/src/vite/index.html +1 -0
- package/src/vite/plugins/__tests__/bundle-stat-plugin.test.ts +70 -0
- package/src/vite/plugins/__tests__/chain-source-maps-plugin.test.ts +58 -0
- package/src/vite/plugins/__tests__/clean-plugin.test.ts +121 -0
- package/src/vite/plugins/__tests__/design-system-guard-plugin.test.ts +83 -0
- package/src/vite/plugins/__tests__/html-template.test.ts +6 -0
- package/src/vite/plugins/__tests__/ignore-modules-plugin.test.ts +29 -7
- package/src/vite/plugins/__tests__/istanbul-plugin.test.ts +62 -0
- package/src/vite/plugins/__tests__/moment-locales-plugin.test.ts +104 -0
- package/src/vite/plugins/bundle-stat-plugin.ts +24 -0
- package/src/vite/plugins/chain-source-maps-plugin.ts +26 -0
- package/src/vite/plugins/clean-plugin.ts +46 -0
- package/src/vite/plugins/design-system-guard-plugin.ts +34 -0
- package/src/vite/plugins/ignore-modules-plugin.ts +36 -7
- package/src/vite/plugins/index.ts +7 -0
- package/src/vite/plugins/istanbul-plugin.ts +19 -0
- package/src/vite/plugins/magic-comments-plugin/__tests__/magic-comments-plugin.test.ts +105 -0
- package/src/vite/plugins/magic-comments-plugin/__tests__/parse-magic-comments.test.ts +40 -0
- package/src/vite/plugins/magic-comments-plugin/index.ts +1 -0
- package/src/vite/plugins/magic-comments-plugin/magic-comments-plugin.ts +63 -0
- package/src/vite/plugins/magic-comments-plugin/parse-magic-comments.ts +39 -0
- package/src/vite/plugins/metadata-plugin.ts +1 -1
- package/src/vite/plugins/moment-locales-plugin.ts +41 -0
- package/src/vite/plugins/shared-dependencies-plugin/__tests__/assemble-iife.test.ts +29 -0
- package/src/vite/plugins/shared-dependencies-plugin/__tests__/assert-no-dynamic-css.test.ts +113 -0
- package/src/vite/plugins/shared-dependencies-plugin/__tests__/flatten.test.ts +23 -0
- package/src/vite/plugins/{__tests__ → shared-dependencies-plugin/__tests__}/shared-dependencies-plugin.test.ts +38 -4
- package/src/vite/plugins/shared-dependencies-plugin/assemble-iife.ts +114 -0
- package/src/vite/plugins/shared-dependencies-plugin/assert-no-dynamic-css.ts +58 -0
- package/src/vite/plugins/shared-dependencies-plugin/flatten.ts +8 -0
- package/src/vite/plugins/shared-dependencies-plugin/index.ts +1 -0
- package/src/vite/plugins/{shared-dependencies-plugin.ts → shared-dependencies-plugin/shared-dependencies-plugin.ts} +24 -115
- package/src/vite/plugins/utils/import-esm.ts +15 -0
- package/src/vite/plugins/utils/index.ts +2 -0
- package/src/vite/rolldown-oxc.d.ts +20 -0
- package/src/webpack/__tests__/bundle-webpack.test.ts +8 -8
- package/src/webpack/__tests__/create-webpack-config-shared-dependencies.test.ts +54 -5
- package/src/webpack/__tests__/create-webpack-config-web-component.test.ts +81 -12
- package/src/webpack/__tests__/create-webpack-config.test.ts +92 -9
- package/src/webpack/configs/optimization-config.ts +47 -25
- package/src/webpack/configs/output-config.ts +1 -2
- package/src/webpack/configs/plugins/assets-manifest-plugin.ts +16 -4
- package/src/webpack/configs/plugins/bundle-analyser-plugin.ts +3 -25
- package/src/webpack/configs/plugins/define-process-env-plugin.ts +10 -0
- package/src/webpack/configs/plugins/filter-warnings-plugin.ts +1 -5
- package/src/webpack/configs/plugins/ignore-plugin/__tests__/ignore-plugin.test.ts +76 -24
- package/src/webpack/configs/plugins/ignore-plugin/empty-module.ts +7 -0
- package/src/webpack/configs/plugins/ignore-plugin/ignore-plugin.ts +59 -9
- package/src/webpack/configs/plugins/index.ts +1 -0
- package/src/webpack/configs/plugins/moment-locales-plugin.ts +2 -2
- package/src/webpack/configs/plugins-config.ts +2 -0
- package/src/webpack/configs/rules/font-rules.ts +2 -2
- package/src/webpack/configs/rules/image-rules.ts +2 -2
- package/src/webpack/create-webpack-config.ts +11 -4
- package/src/webpack/create-webpack-configs.ts +2 -8
- package/src/webpack/types.ts +1 -4
- package/src/webpack/utils/create-webpack-build-context.ts +1 -6
- package/tsconfig/base.json +1 -1
- package/tsconfig/types.d.ts +10 -0
- package/dist/core/get-output-path.d.ts +0 -3
- package/dist/core/get-output-path.d.ts.map +0 -1
- package/dist/core/get-output-path.js +0 -29
- package/dist/core/get-output-path.js.map +0 -1
- package/dist/vite/plugins/shared-dependencies-plugin.d.ts.map +0 -1
- package/dist/vite/plugins/shared-dependencies-plugin.js.map +0 -1
- package/src/core/__tests__/get-output-path.test.ts +0 -64
- package/src/core/get-output-path.ts +0 -15
- /package/dist/vite/plugins/{shared-dependencies-plugin.d.ts → shared-dependencies-plugin/shared-dependencies-plugin.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/startup",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "37.0.1",
|
|
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": {
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
],
|
|
48
48
|
"bin": {
|
|
49
49
|
"startup": "./bin/index.js",
|
|
50
|
+
"analyze": "./bin/analyze.js",
|
|
50
51
|
"cpx": "./bin/cpx.js",
|
|
51
52
|
"eslint": "./bin/eslint.js",
|
|
52
53
|
"jest": "./bin/jest.js",
|
|
@@ -85,7 +86,7 @@
|
|
|
85
86
|
"prepare": "node ./src/scripts/generate-bin-wrappers.js"
|
|
86
87
|
},
|
|
87
88
|
"devDependencies": {
|
|
88
|
-
"@swc/types": "^0.1.
|
|
89
|
+
"@swc/types": "^0.1.27",
|
|
89
90
|
"@types/cpx": "~1.5.5",
|
|
90
91
|
"@types/debug": "^4.1.12",
|
|
91
92
|
"@types/eslint": "~9.6.1",
|
|
@@ -102,16 +103,16 @@
|
|
|
102
103
|
"@jest/core": "~30.4.2",
|
|
103
104
|
"@jest/types": "~30.4.1",
|
|
104
105
|
"@jsdevtools/coverage-istanbul-loader": "^3.0.5",
|
|
105
|
-
"@servicetitan/eslint-config": "
|
|
106
|
-
"@servicetitan/install": "
|
|
107
|
-
"@servicetitan/startup-utils": "
|
|
108
|
-
"@servicetitan/stylelint-config": "
|
|
106
|
+
"@servicetitan/eslint-config": "37.0.1",
|
|
107
|
+
"@servicetitan/install": "37.0.1",
|
|
108
|
+
"@servicetitan/startup-utils": "37.0.1",
|
|
109
|
+
"@servicetitan/stylelint-config": "37.0.1",
|
|
109
110
|
"@svgr/webpack": "^8.1.0",
|
|
110
111
|
"@swc/cli": "^0.8.1",
|
|
111
|
-
"@swc/core": "1.15.
|
|
112
|
+
"@swc/core": "1.15.43",
|
|
112
113
|
"@types/debug": "^4.1.12",
|
|
113
114
|
"@types/jest": "~30.0.0",
|
|
114
|
-
"@vitest/coverage-v8": "^4.1.
|
|
115
|
+
"@vitest/coverage-v8": "^4.1.9",
|
|
115
116
|
"chalk": "~4.1.2",
|
|
116
117
|
"cli-table3": "^0.6.5",
|
|
117
118
|
"cpx2": "9.0.0",
|
|
@@ -119,6 +120,7 @@
|
|
|
119
120
|
"css-minimizer-webpack-plugin": "^8.0.0",
|
|
120
121
|
"debug": "^4.4.3",
|
|
121
122
|
"deepmerge": "~4.3.1",
|
|
123
|
+
"es-module-lexer": "^2.1.0",
|
|
122
124
|
"eslint": "~9.39.2",
|
|
123
125
|
"eta": "^4.6.0",
|
|
124
126
|
"execa": "~5.1.1",
|
|
@@ -133,39 +135,41 @@
|
|
|
133
135
|
"js-yaml": "~4.2.0",
|
|
134
136
|
"json5": "^2.2.3",
|
|
135
137
|
"lerna": "~9.0.7",
|
|
136
|
-
"less": "~4.6.
|
|
138
|
+
"less": "~4.6.6",
|
|
137
139
|
"less-loader": "~13.0.0",
|
|
138
140
|
"less-plugin-npm-import": "~2.1.0",
|
|
139
141
|
"lodash.kebabcase": "^4.1.1",
|
|
140
142
|
"lodash.memoize": "^4.1.2",
|
|
141
|
-
"memfs": "~4.57.
|
|
143
|
+
"memfs": "~4.57.8",
|
|
142
144
|
"mini-css-extract-plugin": "~2.10.2",
|
|
143
145
|
"moment-locales-webpack-plugin": "~1.2.0",
|
|
144
146
|
"multimatch": "~8.0.0",
|
|
145
147
|
"patch-package": "^8.0.1",
|
|
146
148
|
"portfinder": "~1.0.38",
|
|
147
149
|
"postcss": "~8.5.15",
|
|
148
|
-
"prettier": "~3.8.
|
|
149
|
-
"sass": "~1.
|
|
150
|
+
"prettier": "~3.8.4",
|
|
151
|
+
"sass": "~1.101.0",
|
|
150
152
|
"sass-loader": "~17.0.0",
|
|
151
|
-
"semver": "~7.8.
|
|
153
|
+
"semver": "~7.8.5",
|
|
152
154
|
"source-map-loader": "~5.0.0",
|
|
153
155
|
"style-loader": "~4.0.0",
|
|
154
|
-
"stylelint": "~
|
|
156
|
+
"stylelint": "~17.13.0",
|
|
155
157
|
"swc-loader": "^0.2.7",
|
|
156
158
|
"terminal-link": "^5.0.0",
|
|
157
159
|
"terser-webpack-plugin": "^5.6.1",
|
|
158
160
|
"ts-jest": "29.4.11",
|
|
159
161
|
"ts-node": "~10.9.2",
|
|
160
162
|
"typed-css-modules": "~0.9.1",
|
|
161
|
-
"typescript": "
|
|
163
|
+
"typescript": "6.0.3",
|
|
162
164
|
"vite": "^8.0.16",
|
|
165
|
+
"vite-bundle-analyzer": "^1.3.8",
|
|
166
|
+
"vite-plugin-istanbul": "^9.0.1",
|
|
163
167
|
"vite-plugin-svgr": "^5.2.0",
|
|
164
|
-
"vitest": "^4.1.
|
|
168
|
+
"vitest": "^4.1.9",
|
|
165
169
|
"webpack": "~5.107.2",
|
|
166
170
|
"webpack-assets-manifest": "~6.5.2",
|
|
167
171
|
"webpack-bundle-analyzer": "^5.3.0",
|
|
168
|
-
"webpack-dev-server": "^5.2.
|
|
172
|
+
"webpack-dev-server": "^5.2.5",
|
|
169
173
|
"webpack-filter-warnings-plugin": "~1.2.1",
|
|
170
174
|
"webpack-merge": "~6.0.1",
|
|
171
175
|
"webpack-remove-empty-scripts": "^1.1.1",
|
|
@@ -193,5 +197,5 @@
|
|
|
193
197
|
"cli": {
|
|
194
198
|
"webpack": false
|
|
195
199
|
},
|
|
196
|
-
"gitHead": "
|
|
200
|
+
"gitHead": "9a2e5579f88cf9895fd2948ce5d5810e976d20b0"
|
|
197
201
|
}
|
|
@@ -11,6 +11,7 @@ import { entry } from '../registry/build';
|
|
|
11
11
|
jest.mock('../../../utils', () => ({
|
|
12
12
|
...jest.requireActual('../../../utils'),
|
|
13
13
|
getPackages: jest.fn(),
|
|
14
|
+
getConfiguration: jest.fn(() => ({})),
|
|
14
15
|
}));
|
|
15
16
|
jest.mock('../../utils', () => ({
|
|
16
17
|
...jest.requireActual('../../utils'),
|
|
@@ -121,7 +122,7 @@ describe(`[startup] ${Build.name}`, () => {
|
|
|
121
122
|
await subject();
|
|
122
123
|
|
|
123
124
|
expect(lernaExec).toHaveBeenCalledWith({
|
|
124
|
-
'cmd': 'startup bundle-
|
|
125
|
+
'cmd': 'startup bundle-webpack',
|
|
125
126
|
'scope': packages.map(({ name }) => name),
|
|
126
127
|
'parallel': true,
|
|
127
128
|
'stream': true,
|
|
@@ -133,13 +134,25 @@ describe(`[startup] ${Build.name}`, () => {
|
|
|
133
134
|
await subject();
|
|
134
135
|
|
|
135
136
|
expect(lernaExec).toHaveBeenCalledWith({
|
|
136
|
-
'cmd': 'startup bundle-
|
|
137
|
+
'cmd': 'startup bundle-webpack',
|
|
137
138
|
'scope': packages.map(({ name }) => name),
|
|
138
139
|
'stream': true,
|
|
139
140
|
'--': [],
|
|
140
141
|
});
|
|
141
142
|
});
|
|
142
143
|
|
|
144
|
+
describe('with --bundler=vite', () => {
|
|
145
|
+
beforeEach(() => (args.bundler = 'vite'));
|
|
146
|
+
|
|
147
|
+
test('bundles with Vite', async () => {
|
|
148
|
+
await subject();
|
|
149
|
+
|
|
150
|
+
expect(lernaExec).toHaveBeenCalledWith(
|
|
151
|
+
expect.objectContaining({ cmd: 'startup bundle-vite' })
|
|
152
|
+
);
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
|
|
143
156
|
describe('with "code-coverage"', () => {
|
|
144
157
|
beforeEach(() => (args.codeCoverage = true));
|
|
145
158
|
|
|
@@ -148,7 +161,7 @@ describe(`[startup] ${Build.name}`, () => {
|
|
|
148
161
|
|
|
149
162
|
expect(lernaExec).toHaveBeenCalledWith(
|
|
150
163
|
expect.objectContaining({
|
|
151
|
-
'cmd': 'startup bundle-
|
|
164
|
+
'cmd': 'startup bundle-webpack',
|
|
152
165
|
'--': ['--code-coverage'],
|
|
153
166
|
})
|
|
154
167
|
);
|
|
@@ -163,13 +176,28 @@ describe(`[startup] ${Build.name}`, () => {
|
|
|
163
176
|
|
|
164
177
|
expect(lernaExec).toHaveBeenCalledWith(
|
|
165
178
|
expect.objectContaining({
|
|
166
|
-
'cmd': 'startup bundle-
|
|
179
|
+
'cmd': 'startup bundle-webpack',
|
|
167
180
|
'--': ['--stat'],
|
|
168
181
|
})
|
|
169
182
|
);
|
|
170
183
|
});
|
|
171
184
|
});
|
|
172
185
|
|
|
186
|
+
describe('with "preview"', () => {
|
|
187
|
+
beforeEach(() => (args.preview = true));
|
|
188
|
+
|
|
189
|
+
test('passes --preview to the bundler', async () => {
|
|
190
|
+
await subject();
|
|
191
|
+
|
|
192
|
+
expect(lernaExec).toHaveBeenCalledWith(
|
|
193
|
+
expect.objectContaining({
|
|
194
|
+
'cmd': 'startup bundle-webpack',
|
|
195
|
+
'--': ['--preview'],
|
|
196
|
+
})
|
|
197
|
+
);
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
|
|
173
201
|
describe('with "config"', () => {
|
|
174
202
|
beforeEach(() => (args.config = 'foo.config.js'));
|
|
175
203
|
|
|
@@ -178,7 +206,7 @@ describe(`[startup] ${Build.name}`, () => {
|
|
|
178
206
|
|
|
179
207
|
expect(lernaExec).toHaveBeenCalledWith(
|
|
180
208
|
expect.objectContaining({
|
|
181
|
-
'cmd': 'startup bundle-
|
|
209
|
+
'cmd': 'startup bundle-webpack',
|
|
182
210
|
'--': [`--config "${args.config}"`],
|
|
183
211
|
})
|
|
184
212
|
);
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { build, createServer, preview as previewServer } from 'vite';
|
|
2
2
|
import { getBuildName, stringifyConfig } from '../../../core';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
hasHeadlessBundle,
|
|
5
|
+
isExposeSharedDependencies,
|
|
6
|
+
isViteDevServerDisabled,
|
|
7
|
+
isWebComponent,
|
|
8
|
+
log,
|
|
9
|
+
} from '../../../utils';
|
|
4
10
|
import { buildSharedDependencies } from '../../../vite/build-shared-dependencies';
|
|
5
11
|
import { createViteConfig } from '../../../vite/config';
|
|
6
12
|
import { validateViteSharedDependencies } from '../../../vite/validate-shared-dependencies';
|
|
@@ -20,6 +26,7 @@ jest.mock('../../../utils', () => ({
|
|
|
20
26
|
...jest.requireActual('../../../utils'),
|
|
21
27
|
hasHeadlessBundle: jest.fn(() => false),
|
|
22
28
|
isExposeSharedDependencies: jest.fn(() => true),
|
|
29
|
+
isViteDevServerDisabled: jest.fn(() => false),
|
|
23
30
|
isWebComponent: jest.fn(() => false),
|
|
24
31
|
log: { text: jest.fn() },
|
|
25
32
|
}));
|
|
@@ -79,6 +86,18 @@ describe(BundleVite.name, () => {
|
|
|
79
86
|
expect(build).toHaveBeenCalledWith(viteConfig);
|
|
80
87
|
});
|
|
81
88
|
|
|
89
|
+
describe('with "stat"', () => {
|
|
90
|
+
beforeEach(() => (args.stat = true));
|
|
91
|
+
|
|
92
|
+
test('requests a bundle report', async () => {
|
|
93
|
+
await subject();
|
|
94
|
+
|
|
95
|
+
expect(createViteConfig).toHaveBeenCalledWith(
|
|
96
|
+
expect.objectContaining({ buildStat: true })
|
|
97
|
+
);
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
|
|
82
101
|
describe('with "printConfig"', () => {
|
|
83
102
|
beforeEach(() => (args.printConfig = true));
|
|
84
103
|
|
|
@@ -157,6 +176,36 @@ describe(BundleVite.name, () => {
|
|
|
157
176
|
expect(mockServer.listen).not.toHaveBeenCalled();
|
|
158
177
|
});
|
|
159
178
|
});
|
|
179
|
+
|
|
180
|
+
describe('when dev server disabled', () => {
|
|
181
|
+
const originalNodeEnv = process.env.NODE_ENV;
|
|
182
|
+
|
|
183
|
+
beforeEach(() => jest.mocked(isViteDevServerDisabled).mockReturnValue(true));
|
|
184
|
+
|
|
185
|
+
afterEach(() => {
|
|
186
|
+
process.env.NODE_ENV = originalNodeEnv;
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
test('builds to disk in watch mode', async () => {
|
|
190
|
+
await subject();
|
|
191
|
+
|
|
192
|
+
expect(build).toHaveBeenCalledWith(
|
|
193
|
+
expect.objectContaining({ build: { watch: {} } })
|
|
194
|
+
);
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
test('produces a development build', async () => {
|
|
198
|
+
await subject();
|
|
199
|
+
|
|
200
|
+
expect(process.env.NODE_ENV).toBe('development');
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
test('does not start a dev server', async () => {
|
|
204
|
+
await subject();
|
|
205
|
+
|
|
206
|
+
expect(createServer).not.toHaveBeenCalled();
|
|
207
|
+
});
|
|
208
|
+
});
|
|
160
209
|
});
|
|
161
210
|
|
|
162
211
|
describe('with "useWatchConfig"', () => {
|
|
@@ -7,6 +7,7 @@ import { Start } from '../start';
|
|
|
7
7
|
jest.mock('../../../utils', () => ({
|
|
8
8
|
...jest.requireActual('../../../utils'),
|
|
9
9
|
getPackages: jest.fn(),
|
|
10
|
+
getConfiguration: jest.fn(() => ({})),
|
|
10
11
|
}));
|
|
11
12
|
jest.mock('../../utils', () => ({
|
|
12
13
|
...jest.requireActual('../../utils'),
|
|
@@ -131,7 +132,7 @@ describe(`[startup] ${Start.name}`, () => {
|
|
|
131
132
|
await subject();
|
|
132
133
|
|
|
133
134
|
expect(lernaExec).toHaveBeenCalledWith({
|
|
134
|
-
'cmd': 'startup bundle-
|
|
135
|
+
'cmd': 'startup bundle-webpack',
|
|
135
136
|
'scope': packages.map(({ name }) => name),
|
|
136
137
|
'parallel': true,
|
|
137
138
|
'stream': true,
|
|
@@ -143,7 +144,7 @@ describe(`[startup] ${Start.name}`, () => {
|
|
|
143
144
|
await subject();
|
|
144
145
|
|
|
145
146
|
expect(lernaExec).toHaveBeenCalledWith({
|
|
146
|
-
'cmd': 'startup bundle-
|
|
147
|
+
'cmd': 'startup bundle-webpack',
|
|
147
148
|
'scope': packages.map(({ name }) => name),
|
|
148
149
|
'parallel': true,
|
|
149
150
|
'stream': true,
|
|
@@ -151,6 +152,18 @@ describe(`[startup] ${Start.name}`, () => {
|
|
|
151
152
|
});
|
|
152
153
|
});
|
|
153
154
|
|
|
155
|
+
describe('with --bundler=vite', () => {
|
|
156
|
+
beforeEach(() => (args.bundler = 'vite'));
|
|
157
|
+
|
|
158
|
+
test('bundles with Vite in watch mode', async () => {
|
|
159
|
+
await subject();
|
|
160
|
+
|
|
161
|
+
expect(lernaExec).toHaveBeenCalledWith(
|
|
162
|
+
expect.objectContaining({ cmd: 'startup bundle-vite' })
|
|
163
|
+
);
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
|
|
154
167
|
describe('with "code-coverage"', () => {
|
|
155
168
|
beforeEach(() => (args.codeCoverage = true));
|
|
156
169
|
|
|
@@ -159,7 +172,7 @@ describe(`[startup] ${Start.name}`, () => {
|
|
|
159
172
|
|
|
160
173
|
expect(lernaExec).toHaveBeenCalledWith(
|
|
161
174
|
expect.objectContaining({
|
|
162
|
-
'cmd': 'startup bundle-
|
|
175
|
+
'cmd': 'startup bundle-webpack',
|
|
163
176
|
'--': ['--watch', '--code-coverage'],
|
|
164
177
|
})
|
|
165
178
|
);
|
|
@@ -174,7 +187,7 @@ describe(`[startup] ${Start.name}`, () => {
|
|
|
174
187
|
|
|
175
188
|
expect(lernaExec).toHaveBeenCalledWith(
|
|
176
189
|
expect.objectContaining({
|
|
177
|
-
'cmd': 'startup bundle-
|
|
190
|
+
'cmd': 'startup bundle-webpack',
|
|
178
191
|
'--': ['--watch', `--config "${args.config}"`],
|
|
179
192
|
})
|
|
180
193
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getPackages, logErrors, PackageType } from '../../utils';
|
|
2
|
-
import { checkArgs, compile, lernaExec, ProcessTree, typeCheck } from '../utils';
|
|
2
|
+
import { checkArgs, compile, getBundleCommand, lernaExec, ProcessTree, 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';
|
|
@@ -20,8 +20,6 @@ export class Build extends Command<typeof entry> {
|
|
|
20
20
|
checkArgs(this.args, { obsolete: ['--esbuild', '--experimental-bundlers'] });
|
|
21
21
|
|
|
22
22
|
const useTsc = this.args.useTsc;
|
|
23
|
-
const useVite = this.args.useVite;
|
|
24
|
-
const cmd = useVite ? 'startup bundle-vite' : 'startup bundle-package';
|
|
25
23
|
|
|
26
24
|
const packages = getPackages({
|
|
27
25
|
scope: this.args.scope,
|
|
@@ -40,6 +38,7 @@ export class Build extends Command<typeof entry> {
|
|
|
40
38
|
const bundleScope = packages
|
|
41
39
|
.filter(({ type }) => type === PackageType.Bundle)
|
|
42
40
|
.map(({ name }) => name);
|
|
41
|
+
const bundleCmd = getBundleCommand(this.args);
|
|
43
42
|
const precompileScope = packages
|
|
44
43
|
.filter(({ scripts }) => !!scripts?.precompile)
|
|
45
44
|
.map(({ name }) => name);
|
|
@@ -78,7 +77,7 @@ export class Build extends Command<typeof entry> {
|
|
|
78
77
|
return Promise.resolve();
|
|
79
78
|
}
|
|
80
79
|
return lernaExec({
|
|
81
|
-
cmd,
|
|
80
|
+
'cmd': bundleCmd,
|
|
82
81
|
'scope': bundleScope,
|
|
83
82
|
'parallel': true,
|
|
84
83
|
'stream': true,
|
|
@@ -101,14 +100,14 @@ export class Build extends Command<typeof entry> {
|
|
|
101
100
|
}
|
|
102
101
|
|
|
103
102
|
return lernaExec({
|
|
104
|
-
cmd,
|
|
103
|
+
'cmd': bundleCmd,
|
|
105
104
|
'scope': bundleScope,
|
|
106
105
|
'stream': true,
|
|
107
106
|
'--': [
|
|
108
107
|
...[this.args.config ? `--config "${this.args.config}"` : undefined],
|
|
109
108
|
...[this.args.codeCoverage ? '--code-coverage' : undefined],
|
|
110
109
|
...[this.args.stat ? '--stat' : undefined],
|
|
111
|
-
...[
|
|
110
|
+
...[this.args.preview ? '--preview' : undefined],
|
|
112
111
|
].filter(item => !!item) as string[],
|
|
113
112
|
});
|
|
114
113
|
},
|
|
@@ -3,6 +3,7 @@ import { BuildContextOptions, getBuildName, stringifyConfig } from '../../core';
|
|
|
3
3
|
import {
|
|
4
4
|
hasHeadlessBundle,
|
|
5
5
|
isExposeSharedDependencies,
|
|
6
|
+
isViteDevServerDisabled,
|
|
6
7
|
isWebComponent,
|
|
7
8
|
log,
|
|
8
9
|
logErrors,
|
|
@@ -24,6 +25,7 @@ export class BundleVite extends Command<typeof entry> {
|
|
|
24
25
|
const options: BuildContextOptions = {
|
|
25
26
|
name: getBuildName(),
|
|
26
27
|
isProduction,
|
|
28
|
+
buildStat: this.args.stat,
|
|
27
29
|
};
|
|
28
30
|
|
|
29
31
|
if (this.args.printConfig) {
|
|
@@ -61,6 +63,17 @@ async function buildAndServe(
|
|
|
61
63
|
): Promise<void> {
|
|
62
64
|
const config = await createViteConfig(options);
|
|
63
65
|
if (watch) {
|
|
66
|
+
if (isViteDevServerDisabled()) {
|
|
67
|
+
/*
|
|
68
|
+
* Create a development build with no HTTP server, using Vite's watcher to rebuild
|
|
69
|
+
* on change. `vite build` forces NODE_ENV to production regardless of `mode`, because
|
|
70
|
+
* Vite treats the two as independent. Set NODE_ENV directly to get a development
|
|
71
|
+
* build; `mode` alone does not change it.
|
|
72
|
+
*/
|
|
73
|
+
process.env.NODE_ENV = 'development';
|
|
74
|
+
await build({ ...config, build: { ...config.build, watch: {} } });
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
64
77
|
await serve(config);
|
|
65
78
|
return;
|
|
66
79
|
}
|
|
@@ -5,6 +5,11 @@ export const entry = defineEntry({
|
|
|
5
5
|
description: 'Build project for production',
|
|
6
6
|
greedy: true,
|
|
7
7
|
options: {
|
|
8
|
+
bundler: {
|
|
9
|
+
choices: ['vite', 'webpack'] as const,
|
|
10
|
+
description: 'Bundler',
|
|
11
|
+
defaultDescription: 'webpack',
|
|
12
|
+
},
|
|
8
13
|
cdnPath: { string: true, description: 'Base url for application assets' },
|
|
9
14
|
codeCoverage: { boolean: true, description: 'Instrument code for coverage analysis?' },
|
|
10
15
|
config: { string: true, hidden: true, description: 'Use specified configuration' },
|
|
@@ -13,6 +18,6 @@ export const entry = defineEntry({
|
|
|
13
18
|
scope: { array: true, string: true, description: 'Packages to build' },
|
|
14
19
|
stat: { boolean: true, description: 'Generate bundle report?' },
|
|
15
20
|
useTsc: { boolean: true, description: 'Use tsc to compile packages?' },
|
|
16
|
-
useVite: { boolean: true, description: '
|
|
21
|
+
useVite: { boolean: true, hidden: true, description: 'Deprecated: use --bundler=vite' },
|
|
17
22
|
},
|
|
18
23
|
} satisfies CommandEntry);
|
|
@@ -64,7 +64,6 @@ function makeEntry<K extends CommandName, T extends CommandEntry>(
|
|
|
64
64
|
*/
|
|
65
65
|
export const commandRegistry = {
|
|
66
66
|
...makeEntry(CommandName.build, build),
|
|
67
|
-
...makeEntry(CommandName['bundle-package'], bundleWebpack, { path: 'bundle-webpack' }),
|
|
68
67
|
...makeEntry(CommandName['bundle-vite'], bundleVite),
|
|
69
68
|
...makeEntry(CommandName['bundle-webpack'], bundleWebpack),
|
|
70
69
|
...makeEntry(CommandName.clean, clean),
|
|
@@ -5,11 +5,16 @@ export const entry = defineEntry({
|
|
|
5
5
|
description: 'Run project in development mode',
|
|
6
6
|
greedy: true,
|
|
7
7
|
options: {
|
|
8
|
+
bundler: {
|
|
9
|
+
choices: ['vite', 'webpack'] as const,
|
|
10
|
+
description: 'Bundler',
|
|
11
|
+
defaultDescription: 'webpack',
|
|
12
|
+
},
|
|
8
13
|
codeCoverage: { boolean: true, description: 'Instrument code for coverage analysis?' },
|
|
9
14
|
config: { string: true, hidden: true, description: 'Use specified configuration' },
|
|
10
15
|
ignore: { array: true, string: true, description: 'Packages to skip' },
|
|
11
16
|
scope: { array: true, string: true, description: 'Packages to run and watch' },
|
|
12
17
|
useTsc: { boolean: true, description: 'Use tsc to compile packages?' },
|
|
13
|
-
useVite: { boolean: true, description: '
|
|
18
|
+
useVite: { boolean: true, hidden: true, description: 'Deprecated: use --bundler=vite' },
|
|
14
19
|
},
|
|
15
20
|
} satisfies CommandEntry);
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { execSync } from 'node:child_process';
|
|
3
|
+
import { expectCalls, MockPackageManager } from '../../__mocks__';
|
|
4
|
+
import { FixCategory, PackageError } from '../../types';
|
|
5
|
+
import { mockProject } from '../__mocks__';
|
|
6
|
+
import { RequireCompatibleTypescript } from '../require-compatible-typescript';
|
|
7
|
+
|
|
8
|
+
jest.mock('child_process', () => ({ execSync: jest.fn() }));
|
|
9
|
+
|
|
10
|
+
const STARTUP = '@servicetitan/startup';
|
|
11
|
+
const TYPESCRIPT = 'typescript';
|
|
12
|
+
const REQUIRED_VERSION = '6.0.3';
|
|
13
|
+
const OLDER_VERSION = '5.9.3';
|
|
14
|
+
|
|
15
|
+
describe(`[startup] Review ${RequireCompatibleTypescript.name}`, () => {
|
|
16
|
+
const id = 'require-compatible-typescript';
|
|
17
|
+
const rule = new RequireCompatibleTypescript();
|
|
18
|
+
const mockPackageManager = new MockPackageManager();
|
|
19
|
+
|
|
20
|
+
let requiredVersion: string | undefined;
|
|
21
|
+
let actualVersion: string | undefined;
|
|
22
|
+
|
|
23
|
+
beforeAll(() => {
|
|
24
|
+
jest.spyOn(mockPackageManager, 'getDeclaredVersion').mockImplementation(
|
|
25
|
+
({ declaredBy, dependency }) =>
|
|
26
|
+
declaredBy === STARTUP && dependency === TYPESCRIPT ? requiredVersion : undefined
|
|
27
|
+
);
|
|
28
|
+
jest.spyOn(mockPackageManager, 'getResolvedVersion').mockImplementation(({ dependency }) =>
|
|
29
|
+
dependency === TYPESCRIPT ? actualVersion : undefined
|
|
30
|
+
);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
beforeEach(() => {
|
|
34
|
+
requiredVersion = REQUIRED_VERSION;
|
|
35
|
+
actualVersion = undefined;
|
|
36
|
+
mockPackageManager.command = 'npm';
|
|
37
|
+
jest.clearAllMocks();
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const project = () => mockProject({ packageManager: mockPackageManager as any });
|
|
41
|
+
|
|
42
|
+
const subject = () => rule.run(project());
|
|
43
|
+
|
|
44
|
+
const fixSubject = () => rule.fix!(subject()!);
|
|
45
|
+
|
|
46
|
+
function itReturnsNothing() {
|
|
47
|
+
test('returns nothing', () => {
|
|
48
|
+
expect(subject()).toBeUndefined();
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function itReturnsError() {
|
|
53
|
+
test('returns error', () => {
|
|
54
|
+
expect(subject()).toEqual({
|
|
55
|
+
id,
|
|
56
|
+
message: `project's top-level "${TYPESCRIPT}" is older than the version required by ${STARTUP}`,
|
|
57
|
+
details: `${chalk.yellow(actualVersion)} is older than ${requiredVersion}`,
|
|
58
|
+
fixable: FixCategory.lockFile,
|
|
59
|
+
location: mockPackageManager.lockFileName,
|
|
60
|
+
data: { actualVersion, requiredVersion },
|
|
61
|
+
} satisfies PackageError);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
itReturnsNothing();
|
|
66
|
+
|
|
67
|
+
describe('when startup is not a dependency', () => {
|
|
68
|
+
beforeEach(() => {
|
|
69
|
+
requiredVersion = undefined;
|
|
70
|
+
actualVersion = REQUIRED_VERSION;
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
itReturnsNothing();
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
describe('when top-level typescript is older than startup requires', () => {
|
|
77
|
+
beforeEach(() => (actualVersion = OLDER_VERSION));
|
|
78
|
+
|
|
79
|
+
itReturnsError();
|
|
80
|
+
|
|
81
|
+
test('fixes error', () => {
|
|
82
|
+
fixSubject();
|
|
83
|
+
|
|
84
|
+
expectCalls(
|
|
85
|
+
...[
|
|
86
|
+
`npm pkg set dependencies["${TYPESCRIPT}"]="${REQUIRED_VERSION}"`,
|
|
87
|
+
'npx @servicetitan/install --fix --quiet',
|
|
88
|
+
`npm pkg delete dependencies["${TYPESCRIPT}"]`,
|
|
89
|
+
].map(command => [execSync, command, { stdio: 'inherit' }])
|
|
90
|
+
);
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
describe('when package manager is pnpm', () => {
|
|
94
|
+
beforeEach(() => (mockPackageManager.command = 'pnpm'));
|
|
95
|
+
|
|
96
|
+
itReturnsNothing();
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
describe('when top-level typescript equals the version startup requires', () => {
|
|
101
|
+
beforeEach(() => (actualVersion = REQUIRED_VERSION));
|
|
102
|
+
|
|
103
|
+
itReturnsNothing();
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
describe('when top-level typescript is newer than startup requires', () => {
|
|
107
|
+
beforeEach(() => (actualVersion = '6.1.0'));
|
|
108
|
+
|
|
109
|
+
itReturnsNothing();
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
describe('when startup declares typescript as a range', () => {
|
|
113
|
+
beforeEach(() => (requiredVersion = '^6.0.0'));
|
|
114
|
+
|
|
115
|
+
describe('when top-level typescript is below the range floor', () => {
|
|
116
|
+
beforeEach(() => (actualVersion = OLDER_VERSION));
|
|
117
|
+
|
|
118
|
+
itReturnsError();
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
describe('when top-level typescript is at the range floor', () => {
|
|
122
|
+
beforeEach(() => (actualVersion = '6.0.0'));
|
|
123
|
+
|
|
124
|
+
itReturnsNothing();
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
});
|
|
@@ -6,6 +6,7 @@ import { NoTypescriptEntryPoint } from './no-typescript-entry-point';
|
|
|
6
6
|
import { PreferOpenEndedPeerDependencies } from './prefer-open-ended-peer-dependencies';
|
|
7
7
|
import { RequireAllReactDependencies } from './require-all-react-dependencies';
|
|
8
8
|
import { RequireCompatibleLaunchDarklySdk } from './require-compatible-launch-darkly-sdk';
|
|
9
|
+
import { RequireCompatibleTypescript } from './require-compatible-typescript';
|
|
9
10
|
import { RequireExplicitSideEffects } from './require-explicit-side-effects';
|
|
10
11
|
import { RequireNpmrc } from './require-npmrc';
|
|
11
12
|
import { RequireOneAnvilUikitContribVersion } from './require-one-anvil-uikit-contrib-version';
|
|
@@ -24,6 +25,7 @@ export const rules: PackageRule[] = [
|
|
|
24
25
|
new RequireOneUikitVersion(),
|
|
25
26
|
new RequireProjectVersionInRootNodeModules(),
|
|
26
27
|
new RequireCompatibleLaunchDarklySdk(),
|
|
28
|
+
new RequireCompatibleTypescript(),
|
|
27
29
|
new NoDeprecatedContentBase(),
|
|
28
30
|
new NoDirectPeerDependencies(),
|
|
29
31
|
new NoDeprecatedStartupInstall(),
|