@servicetitan/startup 33.1.1 → 34.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/commands/build.d.ts +48 -22
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +72 -52
- package/dist/cli/commands/build.js.map +1 -1
- package/dist/cli/commands/bundle-package.d.ts +54 -10
- package/dist/cli/commands/bundle-package.d.ts.map +1 -1
- package/dist/cli/commands/bundle-package.js +40 -0
- package/dist/cli/commands/bundle-package.js.map +1 -1
- package/dist/cli/commands/clean.d.ts +4 -0
- package/dist/cli/commands/clean.d.ts.map +1 -1
- package/dist/cli/commands/clean.js +50 -16
- package/dist/cli/commands/clean.js.map +1 -1
- package/dist/cli/commands/convert-eslint-config.d.ts +1 -1
- package/dist/cli/commands/convert-eslint-config.d.ts.map +1 -1
- package/dist/cli/commands/convert-eslint-config.js +2 -15
- package/dist/cli/commands/convert-eslint-config.js.map +1 -1
- package/dist/cli/commands/eslint.d.ts +29 -7
- package/dist/cli/commands/eslint.d.ts.map +1 -1
- package/dist/cli/commands/eslint.js +18 -6
- package/dist/cli/commands/eslint.js.map +1 -1
- package/dist/cli/commands/get-command.d.ts.map +1 -1
- package/dist/cli/commands/get-command.js +6 -0
- package/dist/cli/commands/get-command.js.map +1 -1
- package/dist/cli/commands/index.d.ts +2 -2
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +2 -2
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.d.ts +10 -6
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +8 -6
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/install.d.ts +27 -15
- package/dist/cli/commands/install.d.ts.map +1 -1
- package/dist/cli/commands/install.js +18 -16
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/kendo-ui-license.d.ts +1 -0
- package/dist/cli/commands/kendo-ui-license.d.ts.map +1 -1
- package/dist/cli/commands/kendo-ui-license.js +1 -0
- package/dist/cli/commands/kendo-ui-license.js.map +1 -1
- package/dist/cli/commands/lint.d.ts +51 -17
- package/dist/cli/commands/lint.d.ts.map +1 -1
- package/dist/cli/commands/lint.js +36 -26
- package/dist/cli/commands/lint.js.map +1 -1
- package/dist/cli/commands/mfe-check.d.ts +52 -0
- package/dist/cli/commands/mfe-check.d.ts.map +1 -0
- package/dist/cli/commands/mfe-check.js +145 -0
- package/dist/cli/commands/mfe-check.js.map +1 -0
- package/dist/cli/commands/mfe-generate-metadata.d.ts +20 -0
- package/dist/cli/commands/mfe-generate-metadata.d.ts.map +1 -0
- package/dist/cli/commands/mfe-generate-metadata.js +93 -0
- package/dist/cli/commands/mfe-generate-metadata.js.map +1 -0
- package/dist/cli/commands/mfe-list.d.ts +52 -15
- package/dist/cli/commands/mfe-list.d.ts.map +1 -1
- package/dist/cli/commands/mfe-list.js +42 -29
- package/dist/cli/commands/mfe-list.js.map +1 -1
- package/dist/cli/commands/mfe-package-clean.d.ts +34 -15
- package/dist/cli/commands/mfe-package-clean.d.ts.map +1 -1
- package/dist/cli/commands/mfe-package-clean.js +43 -34
- package/dist/cli/commands/mfe-package-clean.js.map +1 -1
- package/dist/cli/commands/mfe-package-publish.d.ts +60 -22
- package/dist/cli/commands/mfe-package-publish.d.ts.map +1 -1
- package/dist/cli/commands/mfe-package-publish.js +137 -78
- package/dist/cli/commands/mfe-package-publish.js.map +1 -1
- package/dist/cli/commands/mfe-package-rollback.d.ts +40 -0
- package/dist/cli/commands/mfe-package-rollback.d.ts.map +1 -0
- package/dist/cli/commands/mfe-package-rollback.js +119 -0
- package/dist/cli/commands/mfe-package-rollback.js.map +1 -0
- package/dist/cli/commands/mfe-publish.d.ts +36 -11
- package/dist/cli/commands/mfe-publish.d.ts.map +1 -1
- package/dist/cli/commands/mfe-publish.js +72 -22
- package/dist/cli/commands/mfe-publish.js.map +1 -1
- package/dist/cli/commands/prepare-package.d.ts +14 -5
- package/dist/cli/commands/prepare-package.d.ts.map +1 -1
- package/dist/cli/commands/prepare-package.js +20 -0
- package/dist/cli/commands/prepare-package.js.map +1 -1
- package/dist/cli/commands/review/review.d.ts +17 -8
- package/dist/cli/commands/review/review.d.ts.map +1 -1
- package/dist/cli/commands/review/review.js +16 -21
- package/dist/cli/commands/review/review.js.map +1 -1
- package/dist/cli/commands/review/rules/index.d.ts.map +1 -1
- package/dist/cli/commands/review/rules/index.js +3 -1
- package/dist/cli/commands/review/rules/index.js.map +1 -1
- package/dist/cli/commands/review/rules/no-deprecated-content-base.js.map +1 -1
- 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 +4 -4
- package/dist/cli/commands/review/rules/require-compatible-launch-darkly-sdk.js.map +1 -1
- package/dist/cli/commands/review/rules/require-one-collection-version.js +1 -2
- package/dist/cli/commands/review/rules/require-one-collection-version.js.map +1 -1
- package/dist/cli/commands/review/rules/require-one-uikit-version.d.ts.map +1 -1
- package/dist/cli/commands/review/rules/require-one-uikit-version.js +1 -0
- package/dist/cli/commands/review/rules/require-one-uikit-version.js.map +1 -1
- package/dist/cli/commands/review/rules/require-project-version-in-root-node-modules.d.ts.map +1 -1
- package/dist/cli/commands/review/rules/require-project-version-in-root-node-modules.js +8 -8
- package/dist/cli/commands/review/rules/require-project-version-in-root-node-modules.js.map +1 -1
- package/dist/cli/commands/review/rules/require-tsconfig-references.d.ts +24 -0
- package/dist/cli/commands/review/rules/require-tsconfig-references.d.ts.map +1 -0
- package/dist/cli/commands/review/rules/require-tsconfig-references.js +146 -0
- package/dist/cli/commands/review/rules/require-tsconfig-references.js.map +1 -0
- package/dist/cli/commands/review/utils/collate-dependencies.js +1 -3
- package/dist/cli/commands/review/utils/collate-dependencies.js.map +1 -1
- package/dist/cli/commands/review/utils/compare-version.js +2 -2
- package/dist/cli/commands/review/utils/compare-version.js.map +1 -1
- package/dist/cli/commands/review/utils/set-version.js +1 -1
- package/dist/cli/commands/review/utils/set-version.js.map +1 -1
- package/dist/cli/commands/run-task.d.ts +29 -7
- package/dist/cli/commands/run-task.d.ts.map +1 -1
- package/dist/cli/commands/run-task.js +21 -8
- package/dist/cli/commands/run-task.js.map +1 -1
- package/dist/cli/commands/run-task.test.js +14 -2
- package/dist/cli/commands/run-task.test.js.map +1 -1
- package/dist/cli/commands/start.d.ts +38 -18
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +65 -45
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/stylelint.d.ts +29 -7
- package/dist/cli/commands/stylelint.d.ts.map +1 -1
- package/dist/cli/commands/stylelint.js +18 -6
- package/dist/cli/commands/stylelint.js.map +1 -1
- package/dist/cli/commands/test/runners/vitest.js +1 -1
- package/dist/cli/commands/test/runners/vitest.js.map +1 -1
- package/dist/cli/commands/test/tests.d.ts +25 -5
- package/dist/cli/commands/test/tests.d.ts.map +1 -1
- package/dist/cli/commands/test/tests.js +22 -14
- package/dist/cli/commands/test/tests.js.map +1 -1
- package/dist/cli/commands/types.d.ts +51 -10
- package/dist/cli/commands/types.d.ts.map +1 -1
- package/dist/cli/commands/types.js +1 -0
- package/dist/cli/commands/types.js.map +1 -1
- package/dist/cli/commands/upload-sourcemaps.d.ts +26 -6
- package/dist/cli/commands/upload-sourcemaps.d.ts.map +1 -1
- package/dist/cli/commands/upload-sourcemaps.js +27 -4
- package/dist/cli/commands/upload-sourcemaps.js.map +1 -1
- package/dist/cli/commands/utils.d.ts +4 -0
- package/dist/cli/commands/utils.d.ts.map +1 -0
- package/dist/cli/commands/utils.js +28 -0
- package/dist/cli/commands/utils.js.map +1 -0
- package/dist/cli/index.js +8 -5
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/tasks/cli-task.d.ts.map +1 -1
- package/dist/cli/tasks/cli-task.js +1 -1
- package/dist/cli/tasks/cli-task.js.map +1 -1
- package/dist/cli/tasks/swc-compile-package.d.ts +1 -2
- package/dist/cli/tasks/swc-compile-package.d.ts.map +1 -1
- package/dist/cli/tasks/swc-compile-package.js.map +1 -1
- package/dist/cli/tasks/tsc-compile-package.d.ts +1 -2
- package/dist/cli/tasks/tsc-compile-package.d.ts.map +1 -1
- package/dist/cli/tasks/tsc-compile-package.js.map +1 -1
- package/dist/cli/tasks/tsc-compile.d.ts +1 -2
- package/dist/cli/tasks/tsc-compile.d.ts.map +1 -1
- package/dist/cli/tasks/tsc-compile.js.map +1 -1
- package/dist/cli/utils/bundle.d.ts.map +1 -1
- package/dist/cli/utils/bundle.js +2 -2
- package/dist/cli/utils/bundle.js.map +1 -1
- package/dist/cli/utils/check-startup-location.d.ts +4 -0
- package/dist/cli/utils/check-startup-location.d.ts.map +1 -0
- package/dist/cli/utils/check-startup-location.js +27 -0
- package/dist/cli/utils/check-startup-location.js.map +1 -0
- package/dist/cli/utils/cli-npm.d.ts +6 -0
- package/dist/cli/utils/cli-npm.d.ts.map +1 -1
- package/dist/cli/utils/cli-npm.js +25 -3
- package/dist/cli/utils/cli-npm.js.map +1 -1
- package/dist/cli/utils/compile-less.js +1 -1
- package/dist/cli/utils/compile-less.js.map +1 -1
- package/dist/cli/utils/constants.d.ts +2 -0
- package/dist/cli/utils/constants.d.ts.map +1 -0
- package/dist/cli/utils/constants.js +13 -0
- package/dist/cli/utils/constants.js.map +1 -0
- package/dist/cli/utils/copy-files.d.ts.map +1 -1
- package/dist/cli/utils/copy-files.js.map +1 -1
- package/dist/cli/utils/eslint.d.ts +1 -2
- package/dist/cli/utils/eslint.d.ts.map +1 -1
- package/dist/cli/utils/eslint.js.map +1 -1
- package/dist/cli/utils/index.d.ts +2 -0
- package/dist/cli/utils/index.d.ts.map +1 -1
- package/dist/cli/utils/index.js +2 -0
- package/dist/cli/utils/index.js.map +1 -1
- package/dist/cli/utils/is-module-installed.js +1 -1
- package/dist/cli/utils/is-module-installed.js.map +1 -1
- package/dist/cli/utils/lerna-exec.d.ts.map +1 -1
- package/dist/cli/utils/lerna-exec.js +1 -3
- package/dist/cli/utils/lerna-exec.js.map +1 -1
- package/dist/cli/utils/process-tree.js.map +1 -1
- package/dist/cli/utils/set-node-options.js +2 -4
- package/dist/cli/utils/set-node-options.js.map +1 -1
- package/dist/cli/utils/stylelint.d.ts +1 -2
- package/dist/cli/utils/stylelint.d.ts.map +1 -1
- package/dist/cli/utils/stylelint.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/jest/resolver.js +2 -2
- package/dist/jest/resolver.js.map +1 -1
- package/dist/jest/svg-transformer.d.ts.map +1 -1
- package/dist/jest/svg-transformer.js.map +1 -1
- package/dist/utils/find-packages.js +1 -1
- package/dist/utils/find-packages.js.map +1 -1
- package/dist/utils/format-relative-date.js +1 -1
- package/dist/utils/format-relative-date.js.map +1 -1
- package/dist/utils/get-configuration.d.ts +3 -0
- package/dist/utils/get-configuration.d.ts.map +1 -1
- package/dist/utils/get-configuration.js +14 -11
- package/dist/utils/get-configuration.js.map +1 -1
- package/dist/utils/get-destination-folders.d.ts.map +1 -1
- package/dist/utils/get-destination-folders.js.map +1 -1
- package/dist/utils/get-folders.d.ts.map +1 -1
- package/dist/utils/get-folders.js.map +1 -1
- package/dist/utils/get-jest-config.js +1 -1
- package/dist/utils/get-jest-config.js.map +1 -1
- package/dist/utils/get-package-data.js +1 -1
- package/dist/utils/get-package-data.js.map +1 -1
- package/dist/utils/get-packages.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/load-shared-dependencies.js.map +1 -1
- package/dist/utils/prettify.d.ts +13 -0
- package/dist/utils/prettify.d.ts.map +1 -0
- package/dist/utils/prettify.js +48 -0
- package/dist/utils/prettify.js.map +1 -0
- package/dist/utils/read-json.js +1 -1
- package/dist/utils/read-json.js.map +1 -1
- package/dist/utils/transform-svg.js +2 -2
- package/dist/utils/transform-svg.js.map +1 -1
- package/dist/webpack/configs/cache-config.js +1 -1
- package/dist/webpack/configs/cache-config.js.map +1 -1
- package/dist/webpack/configs/optimization-config.js +3 -4
- package/dist/webpack/configs/optimization-config.js.map +1 -1
- package/dist/webpack/configs/output-config.js +1 -1
- package/dist/webpack/configs/output-config.js.map +1 -1
- package/dist/webpack/configs/plugins/assets-manifest-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/assets-manifest-plugin.js +5 -5
- 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 +1 -1
- package/dist/webpack/configs/plugins/bundle-analyser-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.js +6 -9
- package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/html-tags-plugin.js +1 -1
- package/dist/webpack/configs/plugins/html-tags-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/check-resource.js +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/check-resource.js.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/moment-locales-plugin.js +1 -1
- package/dist/webpack/configs/plugins/moment-locales-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/watch-run-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/watch-run-plugin.js.map +1 -1
- package/dist/webpack/configs/types.d.ts +1 -0
- package/dist/webpack/configs/types.d.ts.map +1 -1
- package/dist/webpack/configs/utils/build-metadata.d.ts +10 -0
- package/dist/webpack/configs/utils/build-metadata.d.ts.map +1 -0
- package/dist/webpack/configs/utils/build-metadata.js +50 -0
- package/dist/webpack/configs/utils/build-metadata.js.map +1 -0
- package/dist/webpack/configs/utils/generate-metadata.d.ts.map +1 -1
- package/dist/webpack/configs/utils/generate-metadata.js +5 -24
- package/dist/webpack/configs/utils/generate-metadata.js.map +1 -1
- package/dist/webpack/configs/utils/get-exposed-dependencies.d.ts +3 -0
- package/dist/webpack/configs/utils/get-exposed-dependencies.d.ts.map +1 -0
- package/dist/webpack/configs/utils/get-exposed-dependencies.js +21 -0
- package/dist/webpack/configs/utils/get-exposed-dependencies.js.map +1 -0
- package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.js +1 -1
- package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.js.map +1 -1
- package/dist/webpack/configs/utils/index.d.ts +1 -0
- package/dist/webpack/configs/utils/index.d.ts.map +1 -1
- package/dist/webpack/configs/utils/index.js +1 -0
- package/dist/webpack/configs/utils/index.js.map +1 -1
- package/dist/webpack/create-webpack-config.js +10 -4
- package/dist/webpack/create-webpack-config.js.map +1 -1
- package/dist/webpack/loaders/expose-loader/index.d.ts.map +1 -1
- package/dist/webpack/loaders/expose-loader/index.js.map +1 -1
- package/dist/webpack/loaders/expose-loader/runtime/get-global-this.js +1 -1
- package/dist/webpack/loaders/expose-loader/runtime/get-global-this.js.map +1 -1
- package/dist/webpack/loaders/expose-loader/utils/get-new-user-request.js +2 -2
- package/dist/webpack/loaders/expose-loader/utils/get-new-user-request.js.map +1 -1
- package/dist/webpack/utils/stringify-config.js +2 -2
- package/dist/webpack/utils/stringify-config.js.map +1 -1
- package/dist/webpack/utils/testing/get-compiler.d.ts.map +1 -1
- package/dist/webpack/utils/testing/get-compiler.js +1 -1
- package/dist/webpack/utils/testing/get-compiler.js.map +1 -1
- package/dist/webpack/utils/testing/get-errors.d.ts.map +1 -1
- package/dist/webpack/utils/testing/get-errors.js.map +1 -1
- package/dist/webpack/utils/testing/get-warnings.d.ts.map +1 -1
- package/dist/webpack/utils/testing/get-warnings.js.map +1 -1
- package/dist/webpack/utils/testing/read-asset.d.ts.map +1 -1
- package/dist/webpack/utils/testing/read-asset.js +1 -1
- package/dist/webpack/utils/testing/read-asset.js.map +1 -1
- package/dist/webpack/utils/testing/read-assets.d.ts.map +1 -1
- package/dist/webpack/utils/testing/read-assets.js.map +1 -1
- package/package.json +35 -41
- package/src/cli/commands/__tests__/build.test.ts +32 -9
- package/src/cli/commands/__tests__/bundle-package.test.ts +2 -1
- package/src/cli/commands/__tests__/clean.test.ts +99 -8
- package/src/cli/commands/__tests__/convert-eslint-config.test.ts +14 -9
- package/src/cli/commands/__tests__/eslint.test.ts +1 -1
- package/src/cli/commands/__tests__/get-command.test.ts +3 -1
- package/src/cli/commands/__tests__/init.test.ts +14 -1
- package/src/cli/commands/__tests__/install.test.ts +6 -2
- package/src/cli/commands/__tests__/kendo-ui-license.test.ts +7 -2
- package/src/cli/commands/__tests__/lint.test.ts +4 -2
- package/src/cli/commands/__tests__/mfe-check.test.ts +346 -0
- package/src/cli/commands/__tests__/mfe-generate-metadata.test.ts +160 -0
- package/src/cli/commands/__tests__/mfe-list.test.ts +8 -1
- package/src/cli/commands/__tests__/mfe-package-clean.test.ts +0 -1
- package/src/cli/commands/__tests__/mfe-package-publish.test.ts +322 -93
- package/src/cli/commands/__tests__/mfe-package-rollback.test.ts +196 -0
- package/src/cli/commands/__tests__/mfe-publish.test.ts +65 -5
- package/src/cli/commands/__tests__/prepare-package.test.ts +3 -0
- package/src/cli/commands/__tests__/start.test.ts +30 -7
- package/src/cli/commands/__tests__/stylelint.test.ts +1 -1
- package/src/cli/commands/__tests__/styles-check.test.ts +1 -2
- package/src/cli/commands/__tests__/upload-sourcemaps.test.ts +3 -6
- package/src/cli/commands/build.ts +35 -26
- package/src/cli/commands/bundle-package.ts +11 -10
- package/src/cli/commands/clean.ts +51 -5
- package/src/cli/commands/convert-eslint-config.ts +3 -12
- package/src/cli/commands/eslint.ts +9 -11
- package/src/cli/commands/get-command.ts +6 -1
- package/src/cli/commands/index.ts +2 -2
- package/src/cli/commands/init.ts +7 -9
- package/src/cli/commands/install.ts +11 -13
- package/src/cli/commands/kendo-ui-license.ts +1 -1
- package/src/cli/commands/lint.ts +12 -18
- package/src/cli/commands/mfe-check.ts +166 -0
- package/src/cli/commands/mfe-generate-metadata.ts +69 -0
- package/src/cli/commands/mfe-list.ts +28 -30
- package/src/cli/commands/mfe-package-clean.ts +29 -34
- package/src/cli/commands/mfe-package-publish.ts +153 -87
- package/src/cli/commands/mfe-package-rollback.ts +100 -0
- package/src/cli/commands/mfe-publish.ts +80 -27
- package/src/cli/commands/prepare-package.ts +6 -5
- package/src/cli/commands/review/__tests__/review.test.ts +18 -19
- package/src/cli/commands/review/review.ts +11 -20
- package/src/cli/commands/review/rules/__tests__/no-deprecated-content-base.test.ts +1 -1
- package/src/cli/commands/review/rules/__tests__/no-deprecated-startup-install.test.ts +0 -1
- package/src/cli/commands/review/rules/__tests__/no-direct-peer-dependencies.test.ts +1 -1
- package/src/cli/commands/review/rules/__tests__/no-typescript-entry-point.test.ts +0 -1
- package/src/cli/commands/review/rules/__tests__/require-all-react-dependencies.test.ts +0 -1
- package/src/cli/commands/review/rules/__tests__/require-compatible-launch-darkly-sdk.test.ts +2 -2
- package/src/cli/commands/review/rules/__tests__/require-explicit-side-effects.test.ts +0 -1
- package/src/cli/commands/review/rules/__tests__/require-npmrc.test.ts +0 -1
- package/src/cli/commands/review/rules/__tests__/require-one-anvil-uikit-contrib-version.test.ts +1 -2
- package/src/cli/commands/review/rules/__tests__/require-one-collection-version.test.ts +0 -1
- package/src/cli/commands/review/rules/__tests__/require-one-package-version.test.ts +0 -1
- package/src/cli/commands/review/rules/__tests__/require-one-react-version.test.ts +0 -1
- package/src/cli/commands/review/rules/__tests__/require-one-uikit-version.test.ts +1 -1
- package/src/cli/commands/review/rules/__tests__/require-project-version-in-root-node-modules.test.ts +2 -3
- package/src/cli/commands/review/rules/__tests__/require-servicetitan-scope.test.ts +0 -1
- package/src/cli/commands/review/rules/__tests__/require-tsconfig-references.test.ts +315 -0
- package/src/cli/commands/review/rules/index.ts +2 -0
- package/src/cli/commands/review/rules/require-compatible-launch-darkly-sdk.ts +1 -1
- package/src/cli/commands/review/rules/require-one-uikit-version.ts +1 -0
- package/src/cli/commands/review/rules/require-project-version-in-root-node-modules.ts +3 -3
- package/src/cli/commands/review/rules/require-tsconfig-references.ts +157 -0
- package/src/cli/commands/review/utils/__tests__/set-version.test.ts +0 -1
- package/src/cli/commands/run-task.test.ts +15 -3
- package/src/cli/commands/run-task.ts +12 -14
- package/src/cli/commands/start.ts +75 -59
- package/src/cli/commands/stylelint.ts +9 -11
- package/src/cli/commands/test/runners/__tests__/jest.test.ts +1 -2
- package/src/cli/commands/test/runners/vitest.ts +1 -1
- package/src/cli/commands/test/tests.ts +13 -15
- package/src/cli/commands/types.ts +53 -7
- package/src/cli/commands/upload-sourcemaps.ts +14 -12
- package/src/cli/commands/utils.ts +6 -0
- package/src/cli/index.ts +11 -7
- package/src/cli/tasks/__tests__/cli-task.test.ts +1 -1
- package/src/cli/tasks/__tests__/swc-compile-package.test.ts +3 -1
- package/src/cli/tasks/__tests__/tsc-compile-package.test.ts +2 -0
- package/src/cli/tasks/__tests__/tsc-compile.test.ts +3 -13
- package/src/cli/tasks/cli-task.ts +1 -1
- package/src/cli/tasks/swc-compile-package.ts +1 -3
- package/src/cli/tasks/tsc-compile-package.ts +1 -2
- package/src/cli/tasks/tsc-compile.ts +1 -2
- package/src/cli/utils/__tests__/bundle.test.ts +1 -2
- package/src/cli/utils/__tests__/check-args.test.ts +1 -1
- package/src/cli/utils/__tests__/check-startup-location.test.ts +88 -0
- package/src/cli/utils/__tests__/cli-git.test.ts +1 -2
- package/src/cli/utils/__tests__/cli-npm.test.ts +51 -2
- package/src/cli/utils/__tests__/cli-os.test.ts +1 -2
- package/src/cli/utils/__tests__/compile.test.ts +1 -1
- package/src/cli/utils/__tests__/copy-files.test.ts +0 -1
- package/src/cli/utils/__tests__/eslint.test.ts +1 -1
- package/src/cli/utils/__tests__/lerna-exec.test.ts +1 -2
- package/src/cli/utils/__tests__/maybe-create-git-folder.test.ts +0 -1
- package/src/cli/utils/__tests__/set-node-options.test.ts +0 -1
- package/src/cli/utils/__tests__/stylelint.test.ts +1 -1
- package/src/cli/utils/bundle.ts +1 -3
- package/src/cli/utils/check-startup-location.ts +21 -0
- package/src/cli/utils/cli-npm.ts +22 -0
- package/src/cli/utils/compile-less.ts +1 -1
- package/src/cli/utils/constants.ts +1 -0
- package/src/cli/utils/copy-files.ts +0 -1
- package/src/cli/utils/eslint.ts +1 -3
- package/src/cli/utils/index.ts +2 -0
- package/src/cli/utils/lerna-exec.ts +0 -1
- package/src/cli/utils/stylelint.ts +1 -2
- package/src/index.ts +1 -1
- package/src/jest/svg-transformer.ts +0 -1
- package/src/utils/__tests__/get-branch-configs.test.ts +0 -1
- package/src/utils/__tests__/get-configuration.test.ts +0 -1
- package/src/utils/__tests__/get-destination-folders.test.ts +1 -2
- package/src/utils/__tests__/get-folders.test.ts +0 -1
- package/src/utils/__tests__/get-jest-config.test.ts +1 -2
- package/src/utils/__tests__/get-package-data.test.ts +1 -2
- package/src/utils/__tests__/get-packages.test.ts +1 -1
- package/src/utils/__tests__/get-startup-version.test.ts +0 -1
- package/src/utils/__tests__/get-tsconfig.test.ts +0 -1
- package/src/utils/__tests__/load-shared-dependencies.test.ts +1 -1
- package/src/utils/__tests__/log.test.ts +1 -1
- package/src/utils/__tests__/prettify.test.ts +80 -0
- package/src/utils/__tests__/read-json.test.ts +0 -1
- package/src/utils/find-packages.ts +1 -1
- package/src/utils/get-configuration.ts +8 -7
- package/src/utils/get-destination-folders.ts +0 -1
- package/src/utils/get-folders.ts +0 -1
- package/src/utils/get-jest-config.ts +1 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/prettify.ts +36 -0
- package/src/webpack/__tests__/create-webpack-config-shared-dependencies.test.ts +6 -2
- package/src/webpack/__tests__/create-webpack-config-web-component.test.ts +7 -4
- package/src/webpack/__tests__/create-webpack-config.test.ts +8 -4
- package/src/webpack/configs/cache-config.ts +1 -1
- package/src/webpack/configs/plugins/assets-manifest-plugin.ts +1 -1
- package/src/webpack/configs/plugins/bundle-analyser-plugin.ts +2 -2
- package/src/webpack/configs/plugins/define-exposed-dependencies-plugin.ts +6 -15
- package/src/webpack/configs/plugins/ignore-plugin/__tests__/get-package-json.test.ts +1 -1
- package/src/webpack/configs/plugins/ignore-plugin/__tests__/is-optional-peer-dependency.test.ts +1 -1
- package/src/webpack/configs/plugins/ignore-plugin/ignore-plugin.ts +0 -1
- package/src/webpack/configs/plugins/watch-run-plugin.ts +0 -1
- package/src/webpack/configs/types.ts +1 -0
- package/src/webpack/configs/utils/__tests__/build-metadata.test.ts +71 -0
- package/src/webpack/configs/utils/__tests__/generate-metadata.test.ts +42 -46
- package/src/webpack/configs/utils/__tests__/get-exposed-dependencies.test.ts +39 -0
- package/src/webpack/configs/utils/__tests__/get-web-components-version.test.ts +0 -1
- package/src/webpack/configs/utils/build-metadata.ts +40 -0
- package/src/webpack/configs/utils/generate-metadata.ts +7 -21
- package/src/webpack/configs/utils/get-exposed-dependencies.ts +17 -0
- package/src/webpack/configs/utils/index.ts +1 -0
- package/src/webpack/create-webpack-config.ts +3 -3
- package/src/webpack/loaders/expose-loader/__tests__/index.test.ts +0 -2
- package/src/webpack/loaders/expose-loader/index.ts +0 -1
- package/src/webpack/utils/testing/get-compiler.ts +1 -3
- package/src/webpack/utils/testing/get-errors.ts +0 -1
- package/src/webpack/utils/testing/get-warnings.ts +0 -1
- package/src/webpack/utils/testing/read-asset.ts +1 -2
- package/src/webpack/utils/testing/read-assets.ts +0 -1
|
@@ -56,7 +56,7 @@ export class RequireCompatibleLaunchDarklySdk implements PackageRule {
|
|
|
56
56
|
|
|
57
57
|
[
|
|
58
58
|
`npm pkg set dependencies["${JS_CLIENT_SDK}"]=${targetVersion}`,
|
|
59
|
-
'npx
|
|
59
|
+
'npx @servicetitan/install --fix --quiet',
|
|
60
60
|
`npm pkg delete dependencies["${JS_CLIENT_SDK}"]`,
|
|
61
61
|
].forEach(command => execSync(command, { stdio: 'inherit' }));
|
|
62
62
|
}
|
|
@@ -16,6 +16,7 @@ const UIKIT_PACKAGES = [
|
|
|
16
16
|
'@servicetitan/react-ioc',
|
|
17
17
|
'@servicetitan/restrict-imports',
|
|
18
18
|
'@servicetitan/startup',
|
|
19
|
+
'@servicetitan/startup-utils',
|
|
19
20
|
'@servicetitan/stylelint-config',
|
|
20
21
|
'@servicetitan/suppress-warnings',
|
|
21
22
|
'@servicetitan/web-components',
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
|
+
import { execSync } from 'child_process';
|
|
2
3
|
import { satisfies } from 'semver';
|
|
4
|
+
import { log } from '../../../../utils';
|
|
3
5
|
import { FixCategory, PackageError, PackageRule, Project } from '../types';
|
|
4
6
|
import { applyFilter, getKey, getMaxVersion } from '../utils';
|
|
5
|
-
import { execSync } from 'child_process';
|
|
6
|
-
import { log } from '../../../../utils';
|
|
7
7
|
|
|
8
8
|
interface Mismatch {
|
|
9
9
|
name: string;
|
|
@@ -67,7 +67,7 @@ export class RequireProjectVersionInRootNodeModules implements PackageRule {
|
|
|
67
67
|
|
|
68
68
|
[
|
|
69
69
|
...entries.map(([name, version]) => `npm pkg set dependencies["${name}"]="${version}"`),
|
|
70
|
-
'npx
|
|
70
|
+
'npx @servicetitan/install --fix --quiet',
|
|
71
71
|
...entries.map(([name]) => `npm pkg delete dependencies["${name}"]`),
|
|
72
72
|
].forEach(command => execSync(command, { stdio: 'inherit' }));
|
|
73
73
|
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { globSync } from 'glob';
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { getTsConfig, prettifySync, readJsonSafe } from '../../../../utils';
|
|
5
|
+
import { FixCategory, Package, PackageError, PackageRule, Project } from '../types';
|
|
6
|
+
import { checkPackages } from '../utils';
|
|
7
|
+
|
|
8
|
+
interface TsConfig {
|
|
9
|
+
references?: { path: string }[];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface ErrorData {
|
|
13
|
+
tsconfigPath: string;
|
|
14
|
+
missingReference: string;
|
|
15
|
+
expectedPath: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type RuleError = PackageError<ErrorData>;
|
|
19
|
+
|
|
20
|
+
export class RequireTsconfigReferences implements PackageRule {
|
|
21
|
+
private packageNameToLocation!: Map<string, string>;
|
|
22
|
+
private locationToPackageName!: Map<string, string>;
|
|
23
|
+
private workspacePackageNames!: Set<string>;
|
|
24
|
+
|
|
25
|
+
get id() {
|
|
26
|
+
return 'require-tsconfig-references';
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
run(project: Project): RuleError[] {
|
|
30
|
+
this.packageNameToLocation = new Map(
|
|
31
|
+
project.packages.map(({ name, location }) => [name, location])
|
|
32
|
+
);
|
|
33
|
+
this.locationToPackageName = new Map(
|
|
34
|
+
project.packages.map(({ name, location }) => [path.resolve(location), name])
|
|
35
|
+
);
|
|
36
|
+
this.workspacePackageNames = new Set(project.packages.map(({ name }) => name));
|
|
37
|
+
|
|
38
|
+
return checkPackages(this, project, this.checkTsConfigReferences);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
fix({ data }: RuleError) {
|
|
42
|
+
if (!data) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const { tsconfigPath, expectedPath } = data;
|
|
47
|
+
const tsconfig = readJsonSafe<TsConfig>(tsconfigPath);
|
|
48
|
+
if (!tsconfig) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const references = tsconfig.references ?? [];
|
|
53
|
+
references.push({ path: expectedPath });
|
|
54
|
+
tsconfig.references = references;
|
|
55
|
+
|
|
56
|
+
fs.writeFileSync(tsconfigPath, JSON.stringify(tsconfig) + '\n', 'utf-8');
|
|
57
|
+
prettifySync(tsconfigPath);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
private getLocalDependencies(pkg: Package) {
|
|
61
|
+
const dependencies = {
|
|
62
|
+
...pkg.dependencies,
|
|
63
|
+
...pkg.devDependencies,
|
|
64
|
+
...pkg.peerDependencies,
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
return Object.keys(dependencies).filter(dependency =>
|
|
68
|
+
this.workspacePackageNames.has(dependency)
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
private normalizeTsConfigPath(filePath: string): string {
|
|
73
|
+
return filePath.endsWith('.json') ? filePath : `${filePath}.json`;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
private getTsConfigReferencedPackages(tsconfigPath: string) {
|
|
77
|
+
const config = readJsonSafe<TsConfig>(tsconfigPath);
|
|
78
|
+
if (!config?.references) {
|
|
79
|
+
return new Set<string>();
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const tsconfigDir = path.dirname(tsconfigPath);
|
|
83
|
+
const referencedPackages = new Set<string>();
|
|
84
|
+
|
|
85
|
+
for (const reference of config.references) {
|
|
86
|
+
const normalizedPath = this.normalizeTsConfigPath(reference.path);
|
|
87
|
+
const resolvedRefPath = path.resolve(tsconfigDir, normalizedPath);
|
|
88
|
+
const refDir = path.dirname(resolvedRefPath);
|
|
89
|
+
const packageName = this.locationToPackageName.get(refDir);
|
|
90
|
+
|
|
91
|
+
if (packageName) {
|
|
92
|
+
referencedPackages.add(packageName);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return referencedPackages;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
private getExpectedReferencePath(fromLocation: string, toLocation: string) {
|
|
100
|
+
const relativePath = path.relative(fromLocation, toLocation);
|
|
101
|
+
const tsconfigFile = getTsConfig(toLocation);
|
|
102
|
+
const tsconfigName = path.basename(tsconfigFile);
|
|
103
|
+
|
|
104
|
+
return path.join(relativePath, tsconfigName).replaceAll('\\', '/');
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
private collectTsConfigFiles(location: string): string[] {
|
|
108
|
+
const tsconfigFiles = globSync(['tsconfig.json', 'tsconfig.*.json'], {
|
|
109
|
+
absolute: false,
|
|
110
|
+
cwd: location,
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
return tsconfigFiles.map(tsconfigFile => path.join(location, tsconfigFile));
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
private findMissingDependencyReferences(
|
|
117
|
+
pkg: Package,
|
|
118
|
+
tsconfigPath: string,
|
|
119
|
+
localDependencies: string[]
|
|
120
|
+
): RuleError[] {
|
|
121
|
+
const referencedPackages = this.getTsConfigReferencedPackages(tsconfigPath);
|
|
122
|
+
|
|
123
|
+
return localDependencies
|
|
124
|
+
.filter(dependency => !referencedPackages.has(dependency))
|
|
125
|
+
.map(dependency => {
|
|
126
|
+
const dependencyLocation = this.packageNameToLocation.get(dependency)!;
|
|
127
|
+
|
|
128
|
+
return {
|
|
129
|
+
id: this.id,
|
|
130
|
+
message: `missing reference for dependency: ${dependency}`,
|
|
131
|
+
location: tsconfigPath,
|
|
132
|
+
fixable: FixCategory.normal,
|
|
133
|
+
data: {
|
|
134
|
+
tsconfigPath,
|
|
135
|
+
missingReference: dependency,
|
|
136
|
+
expectedPath: this.getExpectedReferencePath(
|
|
137
|
+
pkg.location,
|
|
138
|
+
dependencyLocation
|
|
139
|
+
),
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
private readonly checkTsConfigReferences = (pkg: Package) => {
|
|
146
|
+
if (pkg.location === '.') {
|
|
147
|
+
return [];
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const tsconfigFiles = this.collectTsConfigFiles(pkg.location);
|
|
151
|
+
const localDependencies = this.getLocalDependencies(pkg);
|
|
152
|
+
|
|
153
|
+
return tsconfigFiles.flatMap(tsconfigPath =>
|
|
154
|
+
this.findMissingDependencyReferences(pkg, tsconfigPath, localDependencies)
|
|
155
|
+
);
|
|
156
|
+
};
|
|
157
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { log } from '../../utils';
|
|
1
2
|
import { SwcCompilePackage } from '../tasks/swc-compile-package';
|
|
2
3
|
import { TscCompile } from '../tasks/tsc-compile';
|
|
3
4
|
import { TscCompilePackage } from '../tasks/tsc-compile-package';
|
|
4
|
-
|
|
5
5
|
import { RunTask } from './run-task';
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
jest.mock('yargs', () => jest.fn());
|
|
8
|
+
jest.mock('yargs/helpers', () => ({ hideBin: jest.fn() }));
|
|
7
9
|
|
|
8
10
|
jest.mock('../../utils', () => ({
|
|
9
11
|
...jest.requireActual('../../utils'),
|
|
@@ -40,13 +42,23 @@ describe(`[startup] ${RunTask.name}`, () => {
|
|
|
40
42
|
})
|
|
41
43
|
);
|
|
42
44
|
|
|
45
|
+
describe('with empty args', () => {
|
|
46
|
+
beforeEach(() => (args = {}));
|
|
47
|
+
|
|
48
|
+
test('logs error for undefined task', async () => {
|
|
49
|
+
await subject();
|
|
50
|
+
|
|
51
|
+
expect(log.error).toHaveBeenCalledWith('Unknown task: "undefined"');
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
|
|
43
55
|
describe('with unrecognized task', () => {
|
|
44
56
|
beforeEach(() => (args = { _: ['foo'] })); // eslint-disable-line @typescript-eslint/naming-convention
|
|
45
57
|
|
|
46
58
|
test('logs error', async () => {
|
|
47
59
|
await subject();
|
|
48
60
|
|
|
49
|
-
expect(log.error).toHaveBeenCalledWith(`Unknown task: "${args._[0]}"`);
|
|
61
|
+
expect(log.error).toHaveBeenCalledWith(`Unknown task: "${args._?.[0]}"`);
|
|
50
62
|
});
|
|
51
63
|
|
|
52
64
|
test('lists supported tasks', async () => {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
2
|
import { log, logErrors } from '../../utils';
|
|
3
3
|
import { SwcCompilePackage } from '../tasks/swc-compile-package';
|
|
4
|
-
import { TscCompilePackage } from '../tasks/tsc-compile-package';
|
|
5
|
-
import { TscCompile } from '../tasks/tsc-compile';
|
|
6
4
|
import { Task } from '../tasks/task';
|
|
7
|
-
import {
|
|
5
|
+
import { TscCompile } from '../tasks/tsc-compile';
|
|
6
|
+
import { TscCompilePackage } from '../tasks/tsc-compile-package';
|
|
7
|
+
import { Command, CommandOptions } from './types';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
_:
|
|
11
|
-
taskName
|
|
12
|
-
taskArgs
|
|
13
|
-
}
|
|
9
|
+
const options = {
|
|
10
|
+
_: { description: '<taskName> [taskArgs...]', array: true, string: true },
|
|
11
|
+
taskName: { string: true, hidden: true },
|
|
12
|
+
taskArgs: { array: true, string: true, hidden: true },
|
|
13
|
+
} satisfies CommandOptions;
|
|
14
14
|
|
|
15
15
|
const tasks: Record<string, new (args: { [key: string]: unknown }) => Task> = {
|
|
16
16
|
'tsc-compile-package': TscCompilePackage,
|
|
@@ -18,16 +18,14 @@ const tasks: Record<string, new (args: { [key: string]: unknown }) => Task> = {
|
|
|
18
18
|
'tsc-compile': TscCompile,
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
export class RunTask extends Command<
|
|
22
|
-
static readonly options =
|
|
23
|
-
_: { description: '<taskName> [taskArgs...]' },
|
|
24
|
-
};
|
|
21
|
+
export class RunTask extends Command<typeof options> {
|
|
22
|
+
static readonly options = options;
|
|
25
23
|
|
|
26
24
|
@logErrors
|
|
27
25
|
async execute() {
|
|
28
|
-
const { _, taskName = this.args._[0], taskArgs = [], ...restOptions } = this.args;
|
|
26
|
+
const { _ = [], taskName = this.args._?.[0], taskArgs = [], ...restOptions } = this.args;
|
|
29
27
|
|
|
30
|
-
if (taskName in tasks) {
|
|
28
|
+
if (taskName && taskName in tasks) {
|
|
31
29
|
await new tasks[taskName]({
|
|
32
30
|
_: [..._, ...taskArgs],
|
|
33
31
|
...restOptions,
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { getPackages, log, logErrors, PackageType } from '../../utils';
|
|
2
2
|
import {
|
|
3
3
|
checkArgs,
|
|
4
|
-
lernaExec,
|
|
5
4
|
compile,
|
|
6
|
-
|
|
5
|
+
lernaExec,
|
|
7
6
|
pipeStdout,
|
|
8
|
-
watchStdout,
|
|
9
7
|
ProcessTree,
|
|
8
|
+
typeCheck,
|
|
9
|
+
watchStdout,
|
|
10
10
|
} from '../utils';
|
|
11
|
-
import { Command,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
'
|
|
15
|
-
'
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
'
|
|
19
|
-
}
|
|
11
|
+
import { Command, CommandOptions } from './types';
|
|
12
|
+
|
|
13
|
+
const options = {
|
|
14
|
+
codeCoverage: { boolean: true, description: 'Instrument code for coverage analysis?' },
|
|
15
|
+
config: { string: true, hidden: true, description: 'Use specified configuration' },
|
|
16
|
+
ignore: { array: true, string: true, description: 'Packages to skip' },
|
|
17
|
+
scope: { array: true, string: true, description: 'Packages to run and watch' },
|
|
18
|
+
useTsc: { boolean: true, description: 'Use tsc to compile packages?' },
|
|
19
|
+
} satisfies CommandOptions;
|
|
20
20
|
|
|
21
21
|
enum StartProcesses {
|
|
22
|
+
Precompile,
|
|
22
23
|
Compile,
|
|
23
24
|
KendoUILicense,
|
|
24
25
|
PreparePackage,
|
|
@@ -28,22 +29,16 @@ enum StartProcesses {
|
|
|
28
29
|
BundlePackage,
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
export class Start extends Command<
|
|
32
|
+
export class Start extends Command<typeof options> {
|
|
32
33
|
static readonly description = 'Run project in development mode';
|
|
33
34
|
static readonly greedy = true;
|
|
34
|
-
static readonly options =
|
|
35
|
-
'config': { string: true, hidden: true, description: 'Use specified configuration' },
|
|
36
|
-
'code-coverage': { boolean: true, description: 'Instrument code for coverage analysis?' },
|
|
37
|
-
'ignore': { array: true, description: 'Packages to skip' },
|
|
38
|
-
'scope': { array: true, description: 'Packages to run and watch' },
|
|
39
|
-
'use-tsc': { boolean: true, description: 'Use tsc to compile packages?' },
|
|
40
|
-
};
|
|
35
|
+
static readonly options = options;
|
|
41
36
|
|
|
42
37
|
@logErrors
|
|
43
38
|
async execute() {
|
|
44
39
|
checkArgs(this.args, { obsolete: ['--esbuild', '--experimental-bundlers'] });
|
|
45
40
|
|
|
46
|
-
const useTsc = this.args
|
|
41
|
+
const useTsc = this.args.useTsc;
|
|
47
42
|
|
|
48
43
|
const packages = getPackages({
|
|
49
44
|
scope: this.args.scope,
|
|
@@ -58,52 +53,73 @@ export class Start extends Command<Args> {
|
|
|
58
53
|
const webpackScope = packages
|
|
59
54
|
.filter(({ type }) => type === PackageType.Webpack)
|
|
60
55
|
.map(({ name }) => name);
|
|
56
|
+
const precompileScope = packages
|
|
57
|
+
.filter(({ scripts }) => !!scripts?.precompile)
|
|
58
|
+
.map(({ name }) => name);
|
|
61
59
|
|
|
62
60
|
const processTree = new ProcessTree<typeof StartProcesses>();
|
|
63
61
|
|
|
64
|
-
processTree.add(StartProcesses.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
62
|
+
processTree.add(StartProcesses.Precompile, () => {
|
|
63
|
+
if (precompileScope.length === 0) {
|
|
64
|
+
return Promise.resolve();
|
|
65
|
+
}
|
|
66
|
+
return lernaExec({
|
|
67
|
+
cmd: 'npm run precompile',
|
|
68
|
+
scope: precompileScope,
|
|
69
|
+
parallel: true,
|
|
70
|
+
stream: true,
|
|
69
71
|
});
|
|
72
|
+
});
|
|
70
73
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
* Running the timer as a fallback
|
|
80
|
-
* In case there are no files in the package swc will not print out completion indicator
|
|
81
|
-
*/
|
|
82
|
-
timeout = setTimeout(() => {
|
|
83
|
-
log.warning('Compilation timeout exceeded. Proceeding without waiting.');
|
|
84
|
-
resolve();
|
|
85
|
-
unwatch();
|
|
86
|
-
}, 30000);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
const unwatch = watchStdout(
|
|
90
|
-
process,
|
|
91
|
-
useTsc
|
|
92
|
-
? 'Initial tsc-compile-package task completed'
|
|
93
|
-
: 'Initial swc-compile-package task completed',
|
|
94
|
-
count => {
|
|
95
|
-
counter += count;
|
|
74
|
+
processTree.add(
|
|
75
|
+
StartProcesses.Compile,
|
|
76
|
+
() => {
|
|
77
|
+
const process = compile({
|
|
78
|
+
packages: scope,
|
|
79
|
+
watch: true,
|
|
80
|
+
useTsc,
|
|
81
|
+
});
|
|
96
82
|
|
|
97
|
-
|
|
83
|
+
pipeStdout(process);
|
|
84
|
+
|
|
85
|
+
const onComplete = new Promise<void>(resolve => {
|
|
86
|
+
let counter = 0;
|
|
87
|
+
let timeout: NodeJS.Timeout;
|
|
88
|
+
|
|
89
|
+
if (!useTsc) {
|
|
90
|
+
/*
|
|
91
|
+
* Running the timer as a fallback
|
|
92
|
+
* In case there are no files in the package swc will not print out completion indicator
|
|
93
|
+
*/
|
|
94
|
+
timeout = setTimeout(() => {
|
|
95
|
+
log.warning(
|
|
96
|
+
'Compilation timeout exceeded. Proceeding without waiting.'
|
|
97
|
+
);
|
|
98
98
|
resolve();
|
|
99
|
-
|
|
100
|
-
}
|
|
99
|
+
unwatch();
|
|
100
|
+
}, 30000);
|
|
101
101
|
}
|
|
102
|
-
);
|
|
103
|
-
});
|
|
104
102
|
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
const unwatch = watchStdout(
|
|
104
|
+
process,
|
|
105
|
+
useTsc
|
|
106
|
+
? 'Initial tsc-compile-package task completed'
|
|
107
|
+
: 'Initial swc-compile-package task completed',
|
|
108
|
+
count => {
|
|
109
|
+
counter += count;
|
|
110
|
+
|
|
111
|
+
if (counter === scope.length) {
|
|
112
|
+
resolve();
|
|
113
|
+
clearTimeout(timeout);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
return { process, onComplete };
|
|
120
|
+
},
|
|
121
|
+
{ dependsOn: [StartProcesses.Precompile] }
|
|
122
|
+
);
|
|
107
123
|
processTree.add(StartProcesses.PreparePackage, () =>
|
|
108
124
|
lernaExec({
|
|
109
125
|
cmd: 'startup prepare-package',
|
|
@@ -158,7 +174,7 @@ export class Start extends Command<Args> {
|
|
|
158
174
|
'--': [
|
|
159
175
|
'--watch',
|
|
160
176
|
this.args.config ? `--config "${this.args.config}"` : undefined,
|
|
161
|
-
this.args
|
|
177
|
+
this.args.codeCoverage ? '--code-coverage' : undefined,
|
|
162
178
|
].filter(item => !!item) as string[],
|
|
163
179
|
});
|
|
164
180
|
},
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
2
|
import { logErrors } from '../../utils';
|
|
3
3
|
import { stylelint } from '../utils/stylelint';
|
|
4
|
-
import { Command,
|
|
4
|
+
import { Command, CommandOptions } from './types';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
_:
|
|
8
|
-
fix
|
|
9
|
-
paths
|
|
10
|
-
}
|
|
6
|
+
const options = {
|
|
7
|
+
_: { description: '[paths...]', array: true, string: true },
|
|
8
|
+
fix: { boolean: true, hidden: true },
|
|
9
|
+
paths: { array: true, string: true, hidden: true },
|
|
10
|
+
} satisfies CommandOptions;
|
|
11
11
|
|
|
12
|
-
export class Stylelint extends Command<
|
|
13
|
-
static readonly options =
|
|
14
|
-
_: { description: '[paths...]' },
|
|
15
|
-
};
|
|
12
|
+
export class Stylelint extends Command<typeof options> {
|
|
13
|
+
static readonly options = options;
|
|
16
14
|
|
|
17
15
|
@logErrors
|
|
18
16
|
async execute() {
|
|
@@ -20,7 +18,7 @@ export class Stylelint extends Command<Args> {
|
|
|
20
18
|
}
|
|
21
19
|
|
|
22
20
|
private get paths() {
|
|
23
|
-
const { _, paths = [] } = this.args;
|
|
21
|
+
const { _ = [], paths = [] } = this.args;
|
|
24
22
|
return [..._, ...paths];
|
|
25
23
|
}
|
|
26
24
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { runCLI } from '@jest/core';
|
|
2
|
-
|
|
3
|
-
import { Jest } from '../jest';
|
|
4
2
|
import { getJestConfigCLI } from '../../../../../utils';
|
|
3
|
+
import { Jest } from '../jest';
|
|
5
4
|
|
|
6
5
|
jest.mock('@jest/core', () => ({ runCLI: jest.fn() }));
|
|
7
6
|
jest.mock('../../../../../utils', () => ({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { configDefaults, coverageConfigDefaults, mergeConfig, ViteUserConfig } from 'vitest/config';
|
|
2
|
-
import {
|
|
2
|
+
import { parseCLI, resolveConfig, startVitest } from 'vitest/node';
|
|
3
3
|
import { getVitestConfiguration, log, omit } from '../../../../utils';
|
|
4
4
|
import svgTransformer from '../../../../vitest/svg-transformer';
|
|
5
5
|
|
|
@@ -1,34 +1,32 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
2
|
import { Config } from '@jest/types';
|
|
3
3
|
import { getConfiguration, logErrors } from '../../../utils';
|
|
4
|
-
import { Command } from '../types';
|
|
4
|
+
import { Command, CommandOptions } from '../types';
|
|
5
5
|
import { Jest, Vitest } from './runners';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
const options = {
|
|
8
|
+
_: { description: '[runnerArgs...]', array: true, string: true },
|
|
9
|
+
runner: {
|
|
10
|
+
choices: ['jest', 'vitest'] as const,
|
|
11
|
+
description: 'Test runner',
|
|
12
|
+
defaultDescription: 'jest',
|
|
13
|
+
},
|
|
14
|
+
runnerArgs: { array: true, string: true, hidden: true },
|
|
15
|
+
} satisfies CommandOptions;
|
|
11
16
|
|
|
12
17
|
/**
|
|
13
18
|
* This class is named "Tests" instead of "Test" because the corresponding
|
|
14
19
|
* "test.ts" would be interpreted as a test file.
|
|
15
20
|
*/
|
|
16
|
-
export class Tests extends Command<
|
|
21
|
+
export class Tests extends Command<typeof options, Config.Argv> {
|
|
17
22
|
static readonly description = 'Run tests';
|
|
18
23
|
static readonly greedy = true;
|
|
19
|
-
static readonly options =
|
|
20
|
-
_: { description: '[runnerArgs...]' },
|
|
21
|
-
runner: {
|
|
22
|
-
choices: ['jest', 'vitest'],
|
|
23
|
-
description: 'Test runner',
|
|
24
|
-
defaultDescription: 'jest',
|
|
25
|
-
},
|
|
26
|
-
};
|
|
24
|
+
static readonly options = options;
|
|
27
25
|
|
|
28
26
|
@logErrors
|
|
29
27
|
async execute() {
|
|
30
28
|
const {
|
|
31
|
-
_,
|
|
29
|
+
_ = [],
|
|
32
30
|
runner = getConfiguration().testRunner ?? 'jest',
|
|
33
31
|
runnerArgs = [],
|
|
34
32
|
...restOptions
|
|
@@ -1,15 +1,61 @@
|
|
|
1
|
-
import type { Options } from 'yargs';
|
|
1
|
+
import type { InferredOptionTypes, Options } from 'yargs';
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
export type CommandOptions = Record<string, Options>;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Expands a type by resolving any type aliases and intersections into a single object type.
|
|
7
|
+
*
|
|
8
|
+
* This is useful for flattening complex type compositions so their properties are materialized,
|
|
9
|
+
* especially when working with mapped types and conditional types.
|
|
10
|
+
*
|
|
11
|
+
* @template T - The type to expand.
|
|
12
|
+
* @example
|
|
13
|
+
* type Input = { a: string } & { b: number };
|
|
14
|
+
* type Output = Expand<Input>; // { a: string; b: number }
|
|
15
|
+
*/
|
|
16
|
+
type Expand<T> = T extends infer O ? { [K in keyof O]: O[K] } : never;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Transforms a type so that properties whose value type includes `undefined`
|
|
20
|
+
* become optional (`?:`), while properties that cannot be `undefined` remain required.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* type Input = { a: string; b: string | undefined; c?: number };
|
|
24
|
+
* type Output = UndefinedToOptional<Input>;
|
|
25
|
+
* // Results in: { a: string; b?: string | undefined; c?: number }
|
|
26
|
+
*/
|
|
27
|
+
type UndefinedToOptional<T> = {
|
|
28
|
+
[K in keyof T as undefined extends T[K] ? never : K]: T[K];
|
|
29
|
+
} & {
|
|
30
|
+
[K in keyof T as undefined extends T[K] ? K : never]?: T[K];
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Infers the command args type from a yargs options definition object.
|
|
35
|
+
* Makes properties optional unless demandOption is set to true.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* const options = {
|
|
39
|
+
* watch: { boolean: true, description: '...' },
|
|
40
|
+
* outputPath: { string: true, description: '...' },
|
|
41
|
+
* config: { string: true, demandOption: true, description: '...' },
|
|
42
|
+
* } satisfies CommandOptions;
|
|
43
|
+
*
|
|
44
|
+
* type Args = InferArgs<typeof options>;
|
|
45
|
+
* // Results in: { watch?: boolean; outputPath?: string; config: string; }
|
|
46
|
+
*/
|
|
47
|
+
export type InferArgs<T extends CommandOptions, U = unknown> = Expand<
|
|
48
|
+
UndefinedToOptional<InferredOptionTypes<T>>
|
|
49
|
+
> &
|
|
50
|
+
U;
|
|
6
51
|
|
|
7
|
-
export abstract class Command<T extends
|
|
52
|
+
export abstract class Command<T extends CommandOptions = CommandOptions, U = unknown> {
|
|
53
|
+
static readonly allowRunFromGlobal?: boolean;
|
|
8
54
|
static readonly description?: string;
|
|
9
55
|
static readonly greedy?: boolean;
|
|
10
|
-
static readonly options?:
|
|
56
|
+
static readonly options?: CommandOptions;
|
|
11
57
|
|
|
12
|
-
constructor(protected readonly args: T) {}
|
|
58
|
+
constructor(protected readonly args: InferArgs<T, U>) {}
|
|
13
59
|
|
|
14
60
|
abstract execute(): Promise<void>;
|
|
15
61
|
}
|