@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
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { log, readJson } from '../../../utils';
|
|
2
|
+
import { npmTagVersion, npmView } from '../../utils';
|
|
3
|
+
import { MFEPackageRollback } from '../mfe-package-rollback';
|
|
4
|
+
|
|
5
|
+
jest.mock('yargs', () => jest.fn());
|
|
6
|
+
jest.mock('yargs/helpers', () => ({ hideBin: jest.fn() }));
|
|
7
|
+
jest.mock('../../../utils', () => ({
|
|
8
|
+
...jest.requireActual('../../../utils'),
|
|
9
|
+
log: {
|
|
10
|
+
error: jest.fn(),
|
|
11
|
+
info: jest.fn(),
|
|
12
|
+
warning: jest.fn(),
|
|
13
|
+
},
|
|
14
|
+
readJson: jest.fn(),
|
|
15
|
+
}));
|
|
16
|
+
jest.mock('../../utils', () => ({
|
|
17
|
+
...jest.requireActual('../../utils'),
|
|
18
|
+
npmTagVersion: jest.fn(),
|
|
19
|
+
npmView: jest.fn(),
|
|
20
|
+
}));
|
|
21
|
+
|
|
22
|
+
describe(`[startup] ${MFEPackageRollback.name}`, () => {
|
|
23
|
+
const registry = 'https://verdaccio.servicetitan.com';
|
|
24
|
+
const packageName = '@servicetitan/foo';
|
|
25
|
+
const tag = 'bar';
|
|
26
|
+
const rollbackTag = 'bar-rollback-1';
|
|
27
|
+
const currentVersion = '1.2.3';
|
|
28
|
+
const rollbackVersion = '1.2.2';
|
|
29
|
+
|
|
30
|
+
let args: ConstructorParameters<typeof MFEPackageRollback>[0];
|
|
31
|
+
let packageInfo: any;
|
|
32
|
+
|
|
33
|
+
beforeEach(() => {
|
|
34
|
+
args = { tag };
|
|
35
|
+
packageInfo = {
|
|
36
|
+
'dist-tags': {
|
|
37
|
+
[tag]: currentVersion,
|
|
38
|
+
[rollbackTag]: rollbackVersion,
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
jest.resetAllMocks();
|
|
43
|
+
jest.mocked(readJson).mockReturnValue({ name: packageName });
|
|
44
|
+
jest.mocked(npmView).mockReturnValue(packageInfo);
|
|
45
|
+
jest.mocked(npmTagVersion).mockResolvedValue(undefined);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const subject = async () => new MFEPackageRollback(args).execute();
|
|
49
|
+
|
|
50
|
+
function itReportsError(message: string | RegExp) {
|
|
51
|
+
test(`reports error: ${message}`, async () => {
|
|
52
|
+
jest.spyOn(process.stdout, 'write').mockImplementation(jest.fn()); // suppress error output
|
|
53
|
+
expect.assertions(1);
|
|
54
|
+
try {
|
|
55
|
+
await subject();
|
|
56
|
+
} catch (error: any) {
|
|
57
|
+
expect(error.message).toMatch(message);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
test('reads package name from package.json', async () => {
|
|
63
|
+
await subject();
|
|
64
|
+
|
|
65
|
+
expect(readJson).toHaveBeenCalledWith('package.json');
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
test('fetches package info from registry', async () => {
|
|
69
|
+
await subject();
|
|
70
|
+
|
|
71
|
+
expect(npmView).toHaveBeenCalledWith({
|
|
72
|
+
packageName,
|
|
73
|
+
registry,
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
test('logs rollback operations', async () => {
|
|
78
|
+
await subject();
|
|
79
|
+
|
|
80
|
+
expect(log.info).toHaveBeenCalledWith(`Rolling back ${packageName} for tag "${tag}"`);
|
|
81
|
+
expect(log.info).toHaveBeenCalledWith(
|
|
82
|
+
`Found rollback version ${rollbackVersion} for tag "${rollbackTag}"`
|
|
83
|
+
);
|
|
84
|
+
expect(log.info).toHaveBeenCalledWith(
|
|
85
|
+
`Current tag "${tag}" points to version ${currentVersion}`
|
|
86
|
+
);
|
|
87
|
+
expect(log.info).toHaveBeenCalledWith(
|
|
88
|
+
`Rolling back ${packageName} tag "${tag}" to version ${rollbackVersion}`
|
|
89
|
+
);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
test('tags rollback version with original tag', async () => {
|
|
93
|
+
await subject();
|
|
94
|
+
|
|
95
|
+
expect(npmTagVersion).toHaveBeenCalledWith({
|
|
96
|
+
packageName,
|
|
97
|
+
packageVersion: rollbackVersion,
|
|
98
|
+
registry,
|
|
99
|
+
tag,
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
describe('when package is not found in registry', () => {
|
|
104
|
+
beforeEach(() => {
|
|
105
|
+
jest.mocked(npmView).mockReturnValue(undefined);
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
itReportsError(`Package ${packageName} not found in registry`);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
describe('when rollback version is not found', () => {
|
|
112
|
+
beforeEach(() => {
|
|
113
|
+
packageInfo['dist-tags'] = { [tag]: currentVersion };
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
itReportsError(`No rollback version found for tag "${tag}" (looking for "${rollbackTag}")`);
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
describe('when tag and rollback tag both point to the same version', () => {
|
|
120
|
+
beforeEach(() => {
|
|
121
|
+
packageInfo['dist-tags'] = {
|
|
122
|
+
[tag]: rollbackVersion,
|
|
123
|
+
[rollbackTag]: rollbackVersion,
|
|
124
|
+
};
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
test('does nothing and logs message', async () => {
|
|
128
|
+
await subject();
|
|
129
|
+
|
|
130
|
+
expect(log.info).toHaveBeenCalledWith(
|
|
131
|
+
`Tags "${tag}" and "${rollbackTag}" both point to version ${rollbackVersion}, skipping rollback`
|
|
132
|
+
);
|
|
133
|
+
expect(npmTagVersion).not.toHaveBeenCalled();
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
describe('when tag does not exist', () => {
|
|
138
|
+
beforeEach(() => {
|
|
139
|
+
packageInfo['dist-tags'] = { [rollbackTag]: rollbackVersion };
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
test('does not log current tag points to version', async () => {
|
|
143
|
+
await subject();
|
|
144
|
+
|
|
145
|
+
expect(log.info).not.toHaveBeenCalledWith(
|
|
146
|
+
expect.stringContaining(`Current tag "${tag}" points to version`)
|
|
147
|
+
);
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
describe('with registry argument', () => {
|
|
152
|
+
const customRegistry = 'https://foo';
|
|
153
|
+
|
|
154
|
+
beforeEach(() => {
|
|
155
|
+
args.registry = customRegistry;
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
test('uses custom registry', async () => {
|
|
159
|
+
await subject();
|
|
160
|
+
|
|
161
|
+
expect(npmView).toHaveBeenCalledWith({
|
|
162
|
+
packageName,
|
|
163
|
+
registry: customRegistry,
|
|
164
|
+
});
|
|
165
|
+
expect(npmTagVersion).toHaveBeenCalledWith({
|
|
166
|
+
packageName,
|
|
167
|
+
packageVersion: rollbackVersion,
|
|
168
|
+
registry: customRegistry,
|
|
169
|
+
tag,
|
|
170
|
+
dry: undefined,
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
describe('with dry argument', () => {
|
|
176
|
+
beforeEach(() => {
|
|
177
|
+
args.dry = true;
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
test('does not call npmTagVersion', async () => {
|
|
181
|
+
await subject();
|
|
182
|
+
|
|
183
|
+
expect(npmTagVersion).not.toHaveBeenCalled();
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
test('logs message', async () => {
|
|
187
|
+
await subject();
|
|
188
|
+
|
|
189
|
+
expect(log.info).toHaveBeenCalledWith(
|
|
190
|
+
expect.stringContaining(
|
|
191
|
+
`(dry-run) Rolling back ${packageName} tag "${tag}" to version ${rollbackVersion}`
|
|
192
|
+
)
|
|
193
|
+
);
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
});
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { fs, vol } from 'memfs';
|
|
2
|
-
import { lernaExec } from '../../utils';
|
|
3
|
-
import { Package, PackageType, getPackages } from '../../../utils';
|
|
4
2
|
import { createPackage } from '../../../__mocks__';
|
|
5
|
-
|
|
3
|
+
import { Package, PackageType, getPackages } from '../../../utils';
|
|
4
|
+
import { lernaExec } from '../../utils';
|
|
6
5
|
import { MFEPackageClean } from '../mfe-package-clean';
|
|
7
6
|
import { MFEPackagePublish } from '../mfe-package-publish';
|
|
7
|
+
import { MFEPackageRollback } from '../mfe-package-rollback';
|
|
8
8
|
import { MFEPublish } from '../mfe-publish';
|
|
9
9
|
|
|
10
10
|
jest.mock('fs', () => fs);
|
|
11
|
+
jest.mock('yargs', () => jest.fn());
|
|
12
|
+
jest.mock('yargs/helpers', () => ({ hideBin: jest.fn() }));
|
|
13
|
+
|
|
11
14
|
jest.mock('../../utils');
|
|
12
15
|
jest.mock('../../../utils', () => ({
|
|
13
16
|
...jest.requireActual('../../../utils'),
|
|
@@ -143,6 +146,8 @@ describe(`[startup] ${MFEPublish.name}`, () => {
|
|
|
143
146
|
{ name: 'dry', value: true, expected: '--dry' },
|
|
144
147
|
{ name: 'force', value: true, expected: '--force' },
|
|
145
148
|
{ name: 'registry', value: 'https://foo' },
|
|
149
|
+
{ name: 'trackHistory', value: true, expected: '--track-history' },
|
|
150
|
+
{ name: 'trackHistory', value: false, expected: '--no-track-history' },
|
|
146
151
|
{ name: 'uploadSourcemaps', value: true, expected: '--upload-sourcemaps' },
|
|
147
152
|
{ name: 'uploadSourcemaps', value: false, expected: '--no-upload-sourcemaps' },
|
|
148
153
|
];
|
|
@@ -173,6 +178,48 @@ describe(`[startup] ${MFEPublish.name}`, () => {
|
|
|
173
178
|
});
|
|
174
179
|
});
|
|
175
180
|
|
|
181
|
+
describe('with "{rollback: true}"', () => {
|
|
182
|
+
beforeEach(() => {
|
|
183
|
+
args.rollback = true;
|
|
184
|
+
args.scope = packages.map(({ name }) => name);
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
test('runs rollback command', async () => {
|
|
188
|
+
await subject();
|
|
189
|
+
|
|
190
|
+
expect(lernaExec).toHaveBeenCalledWith(
|
|
191
|
+
expect.objectContaining({
|
|
192
|
+
cmd: 'startup mfe-package-rollback',
|
|
193
|
+
scope: [packages[0].name],
|
|
194
|
+
})
|
|
195
|
+
);
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
type ArgumentName = keyof typeof args;
|
|
199
|
+
const testArgs: { name: ArgumentName; value: any; expected?: string | string[] }[] = [
|
|
200
|
+
{ name: 'dry', value: true, expected: '--dry' },
|
|
201
|
+
{ name: 'registry', value: 'https://foo' },
|
|
202
|
+
{ name: 'tag', value: 'my-tag' },
|
|
203
|
+
{ name: 'tag', value: true, expected: [] }, // check ignores obsolete --tag with no name
|
|
204
|
+
];
|
|
205
|
+
|
|
206
|
+
describe.each(testArgs)('with "{$name: $value}"', ({ name, value, expected }) => {
|
|
207
|
+
beforeEach(() => (args[name] = value));
|
|
208
|
+
|
|
209
|
+
test(`runs rollback with "${expected ?? `--${name} ${value}`}"`, async () => {
|
|
210
|
+
await subject();
|
|
211
|
+
|
|
212
|
+
expect(lernaExec).toHaveBeenCalledWith(
|
|
213
|
+
expect.objectContaining({
|
|
214
|
+
'--': Array.isArray(expected)
|
|
215
|
+
? expected
|
|
216
|
+
: [expected ?? `--${name} ${value}`],
|
|
217
|
+
})
|
|
218
|
+
);
|
|
219
|
+
});
|
|
220
|
+
});
|
|
221
|
+
});
|
|
222
|
+
|
|
176
223
|
describe('with multiple packages', () => {
|
|
177
224
|
beforeEach(() => {
|
|
178
225
|
packages.push(
|
|
@@ -215,7 +262,7 @@ describe(`[startup] ${MFEPublish.name}`, () => {
|
|
|
215
262
|
describe('options', () => {
|
|
216
263
|
const subject = () => MFEPublish.options;
|
|
217
264
|
|
|
218
|
-
test('groups publish and
|
|
265
|
+
test('groups publish, clean, and rollback options', () => {
|
|
219
266
|
expect(subject()).toEqual(
|
|
220
267
|
expect.objectContaining({
|
|
221
268
|
...Object.fromEntries(
|
|
@@ -226,10 +273,23 @@ describe(`[startup] ${MFEPublish.name}`, () => {
|
|
|
226
273
|
),
|
|
227
274
|
...Object.fromEntries(
|
|
228
275
|
Object.entries(MFEPackageClean.options).map(([key, value]) => [
|
|
229
|
-
|
|
276
|
+
`${key}\u00A0`,
|
|
230
277
|
{ group: 'Clean Options:', ...value },
|
|
231
278
|
])
|
|
232
279
|
),
|
|
280
|
+
...Object.fromEntries(
|
|
281
|
+
Object.entries(MFEPackageRollback.options)
|
|
282
|
+
.filter(([key]) => key !== 'scope')
|
|
283
|
+
.map(([key, value]) => {
|
|
284
|
+
const optionProps = Object.fromEntries(
|
|
285
|
+
Object.entries(value).filter(([k]) => k !== 'required')
|
|
286
|
+
);
|
|
287
|
+
return [
|
|
288
|
+
`${key}\u00A0\u00A0`,
|
|
289
|
+
{ group: 'Rollback Options:', ...optionProps },
|
|
290
|
+
];
|
|
291
|
+
})
|
|
292
|
+
),
|
|
233
293
|
})
|
|
234
294
|
);
|
|
235
295
|
});
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { copyFiles } from '../../utils';
|
|
2
2
|
import { PreparePackage } from '../prepare-package';
|
|
3
3
|
|
|
4
|
+
jest.mock('yargs', () => jest.fn());
|
|
5
|
+
jest.mock('yargs/helpers', () => ({ hideBin: jest.fn() }));
|
|
6
|
+
|
|
4
7
|
jest.mock('../../utils', () => ({
|
|
5
8
|
...jest.requireActual('../../utils'),
|
|
6
9
|
copyFiles: jest.fn(),
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { Package, PackageType, getPackages, log } from '../../../utils';
|
|
2
1
|
import { createPackage } from '../../../__mocks__';
|
|
3
|
-
import {
|
|
4
|
-
|
|
2
|
+
import { Package, PackageType, getPackages, log } from '../../../utils';
|
|
3
|
+
import { compile, lernaExec, typeCheck, watchStdout } from '../../utils';
|
|
5
4
|
import { Start } from '../start';
|
|
6
5
|
|
|
6
|
+
jest.mock('yargs', () => jest.fn());
|
|
7
|
+
jest.mock('yargs/helpers', () => ({ hideBin: jest.fn() }));
|
|
8
|
+
|
|
7
9
|
jest.mock('../../../utils', () => ({
|
|
8
10
|
...jest.requireActual('../../../utils'),
|
|
9
11
|
getPackages: jest.fn(),
|
|
@@ -82,6 +84,25 @@ describe(`[startup] ${Start.name}`, () => {
|
|
|
82
84
|
});
|
|
83
85
|
}
|
|
84
86
|
|
|
87
|
+
function itRunsPrebuildScript() {
|
|
88
|
+
describe('when package has "precompile" script', () => {
|
|
89
|
+
beforeEach(() => {
|
|
90
|
+
packages[0].scripts = { precompile: 'foo' };
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
test('runs precompile script', async () => {
|
|
94
|
+
await subject();
|
|
95
|
+
|
|
96
|
+
expect(lernaExec).toHaveBeenCalledWith({
|
|
97
|
+
cmd: 'npm run precompile',
|
|
98
|
+
scope: [packages[0].name],
|
|
99
|
+
parallel: true,
|
|
100
|
+
stream: true,
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
85
106
|
test('command is greedy', () => {
|
|
86
107
|
expect(Start.greedy).toBe(true);
|
|
87
108
|
});
|
|
@@ -91,9 +112,10 @@ describe(`[startup] ${Start.name}`, () => {
|
|
|
91
112
|
|
|
92
113
|
itPreparesThePackages();
|
|
93
114
|
itRunsCompileAndTypeCheck();
|
|
115
|
+
itRunsPrebuildScript();
|
|
94
116
|
|
|
95
117
|
describe('with --use-tsc flag', () => {
|
|
96
|
-
beforeEach(() => (args
|
|
118
|
+
beforeEach(() => (args.useTsc = true));
|
|
97
119
|
|
|
98
120
|
itPreparesThePackages();
|
|
99
121
|
itRunsCompileAndTypeCheck({ useTsc: true });
|
|
@@ -105,6 +127,7 @@ describe(`[startup] ${Start.name}`, () => {
|
|
|
105
127
|
|
|
106
128
|
itPreparesThePackages();
|
|
107
129
|
itRunsCompileAndTypeCheck();
|
|
130
|
+
itRunsPrebuildScript();
|
|
108
131
|
|
|
109
132
|
test('bundles exposed dependencies', async () => {
|
|
110
133
|
await subject();
|
|
@@ -131,7 +154,7 @@ describe(`[startup] ${Start.name}`, () => {
|
|
|
131
154
|
});
|
|
132
155
|
|
|
133
156
|
describe('with "code-coverage"', () => {
|
|
134
|
-
beforeEach(() => (args
|
|
157
|
+
beforeEach(() => (args.codeCoverage = true));
|
|
135
158
|
|
|
136
159
|
test('enables code-coverage', async () => {
|
|
137
160
|
await subject();
|
|
@@ -162,7 +185,7 @@ describe(`[startup] ${Start.name}`, () => {
|
|
|
162
185
|
});
|
|
163
186
|
|
|
164
187
|
describe('with "scope"', () => {
|
|
165
|
-
beforeEach(() => (args.scope = 'foo'));
|
|
188
|
+
beforeEach(() => (args.scope = ['foo']));
|
|
166
189
|
|
|
167
190
|
test('selects scoped packages', async () => {
|
|
168
191
|
await subject();
|
|
@@ -174,7 +197,7 @@ describe(`[startup] ${Start.name}`, () => {
|
|
|
174
197
|
});
|
|
175
198
|
|
|
176
199
|
describe('with "ignore"', () => {
|
|
177
|
-
beforeEach(() => (args.ignore = 'foo'));
|
|
200
|
+
beforeEach(() => (args.ignore = ['foo']));
|
|
178
201
|
|
|
179
202
|
test('selectively ignores packages', async () => {
|
|
180
203
|
await subject();
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { fs, vol } from 'memfs';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import { getFolders, isBundle, isLegacy, isStyleCheckDisabled, log } from '../../../utils';
|
|
4
|
-
|
|
5
4
|
import { StylesCheck } from '../styles-check';
|
|
6
5
|
|
|
7
6
|
jest.mock('fs', () => fs);
|
|
@@ -25,7 +24,7 @@ describe(`[startup] ${StylesCheck.name}`, () => {
|
|
|
25
24
|
|
|
26
25
|
afterEach(() => vol.reset());
|
|
27
26
|
|
|
28
|
-
const subject = async () => new StylesCheck().execute();
|
|
27
|
+
const subject = async () => new StylesCheck({}).execute();
|
|
29
28
|
|
|
30
29
|
function itExitsSilently() {
|
|
31
30
|
test('exits silently', async () => {
|
|
@@ -9,6 +9,9 @@ import { UploadSourcemaps } from '../upload-sourcemaps';
|
|
|
9
9
|
jest.mock('@servicetitan/install');
|
|
10
10
|
jest.mock('fs', () => require('memfs').fs);
|
|
11
11
|
jest.mock('child_process', () => ({ execSync: jest.fn() }));
|
|
12
|
+
jest.mock('yargs', () => jest.fn());
|
|
13
|
+
jest.mock('yargs/helpers', () => ({ hideBin: jest.fn() }));
|
|
14
|
+
|
|
12
15
|
jest.mock('../../../utils', () => ({
|
|
13
16
|
...jest.requireActual('../../../utils'),
|
|
14
17
|
log: { info: jest.fn(), warning: jest.fn() },
|
|
@@ -106,12 +109,6 @@ describe(`[startup] ${UploadSourcemaps.name}`, () => {
|
|
|
106
109
|
});
|
|
107
110
|
});
|
|
108
111
|
|
|
109
|
-
describe('when --releaseVersion is omitted', () => {
|
|
110
|
-
beforeEach(() => delete (args as any).releaseVersion);
|
|
111
|
-
|
|
112
|
-
itThrowsError('--release-version is required');
|
|
113
|
-
});
|
|
114
|
-
|
|
115
112
|
describe('when package is not a web-component', () => {
|
|
116
113
|
beforeEach(() => {
|
|
117
114
|
volumeFromJSON({ 'package.json': { name: packageJSON.name } });
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { getPackages, logErrors, PackageType } from '../../utils';
|
|
2
|
-
import { checkArgs, compile, lernaExec,
|
|
2
|
+
import { checkArgs, compile, lernaExec, ProcessTree, typeCheck } from '../utils';
|
|
3
3
|
import { kendoUILicense } from './kendo-ui-license';
|
|
4
|
-
import { Command,
|
|
4
|
+
import { Command, CommandOptions } from './types';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
'
|
|
8
|
-
'code
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
'
|
|
14
|
-
}
|
|
6
|
+
const options = {
|
|
7
|
+
cdnPath: { string: true, description: 'Base url for application assets' },
|
|
8
|
+
codeCoverage: { boolean: true, description: 'Instrument code for coverage analysis?' },
|
|
9
|
+
config: { string: true, hidden: true, description: 'Use specified configuration' },
|
|
10
|
+
ignore: { array: true, string: true, description: 'Packages to skip' },
|
|
11
|
+
scope: { array: true, string: true, description: 'Packages to build' },
|
|
12
|
+
stat: { boolean: true, description: 'Generate bundle report?' },
|
|
13
|
+
useTsc: { boolean: true, description: 'Use tsc to compile packages?' },
|
|
14
|
+
} satisfies CommandOptions;
|
|
15
15
|
|
|
16
16
|
enum BuildProcesses {
|
|
17
|
+
Precompile,
|
|
17
18
|
Compile,
|
|
18
19
|
KendoUILicense,
|
|
19
20
|
PreparePackage,
|
|
@@ -22,24 +23,16 @@ enum BuildProcesses {
|
|
|
22
23
|
BundlePackage,
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
export class Build extends Command<
|
|
26
|
+
export class Build extends Command<typeof options> {
|
|
26
27
|
static readonly description = 'Build project for production';
|
|
27
28
|
static readonly greedy = true;
|
|
28
|
-
static readonly options =
|
|
29
|
-
'cdn-path': { string: true, description: 'Base url for application assets' },
|
|
30
|
-
'code-coverage': { boolean: true, description: 'Instrument code for coverage analysis?' },
|
|
31
|
-
'config': { string: true, hidden: true, description: 'Use specified configuration' },
|
|
32
|
-
'ignore': { array: true, description: 'Packages to skip' },
|
|
33
|
-
'scope': { array: true, description: 'Packages to build' },
|
|
34
|
-
'stat': { boolean: true, description: 'Generate bundle report?' },
|
|
35
|
-
'use-tsc': { boolean: true, description: 'Use tsc to compile packages?' },
|
|
36
|
-
};
|
|
29
|
+
static readonly options = options;
|
|
37
30
|
|
|
38
31
|
@logErrors
|
|
39
32
|
async execute() {
|
|
40
33
|
checkArgs(this.args, { obsolete: ['--esbuild', '--experimental-bundlers'] });
|
|
41
34
|
|
|
42
|
-
const useTsc = this.args
|
|
35
|
+
const useTsc = this.args.useTsc;
|
|
43
36
|
|
|
44
37
|
const packages = getPackages({
|
|
45
38
|
scope: this.args.scope,
|
|
@@ -50,18 +43,34 @@ export class Build extends Command<Args> {
|
|
|
50
43
|
return;
|
|
51
44
|
}
|
|
52
45
|
|
|
53
|
-
if (this.args
|
|
54
|
-
process.env.CLIENT_CDN_PATH = this.args
|
|
46
|
+
if (this.args.cdnPath) {
|
|
47
|
+
process.env.CLIENT_CDN_PATH = this.args.cdnPath;
|
|
55
48
|
}
|
|
56
49
|
|
|
57
50
|
const scope = packages.map(({ name }) => name);
|
|
58
51
|
const webpackScope = packages
|
|
59
52
|
.filter(({ type }) => type === PackageType.Webpack)
|
|
60
53
|
.map(({ name }) => name);
|
|
54
|
+
const precompileScope = packages
|
|
55
|
+
.filter(({ scripts }) => !!scripts?.precompile)
|
|
56
|
+
.map(({ name }) => name);
|
|
61
57
|
|
|
62
58
|
const processTree = new ProcessTree<typeof BuildProcesses>();
|
|
63
59
|
|
|
64
|
-
processTree.add(BuildProcesses.
|
|
60
|
+
processTree.add(BuildProcesses.Precompile, () => {
|
|
61
|
+
if (precompileScope.length === 0) {
|
|
62
|
+
return Promise.resolve();
|
|
63
|
+
}
|
|
64
|
+
return lernaExec({
|
|
65
|
+
cmd: 'npm run precompile',
|
|
66
|
+
scope: precompileScope,
|
|
67
|
+
parallel: true,
|
|
68
|
+
stream: true,
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
processTree.add(BuildProcesses.Compile, () => compile({ packages: scope, useTsc }), {
|
|
72
|
+
dependsOn: [BuildProcesses.Precompile],
|
|
73
|
+
});
|
|
65
74
|
processTree.add(BuildProcesses.KendoUILicense, () => kendoUILicense());
|
|
66
75
|
processTree.add(BuildProcesses.PreparePackage, () =>
|
|
67
76
|
lernaExec({
|
|
@@ -108,7 +117,7 @@ export class Build extends Command<Args> {
|
|
|
108
117
|
'stream': true,
|
|
109
118
|
'--': [
|
|
110
119
|
...[this.args.config ? `--config "${this.args.config}"` : undefined],
|
|
111
|
-
...[this.args
|
|
120
|
+
...[this.args.codeCoverage ? '--code-coverage' : undefined],
|
|
112
121
|
...[this.args.stat ? '--stat' : undefined],
|
|
113
122
|
].filter(item => !!item) as string[],
|
|
114
123
|
});
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { getTsConfig, log, logErrors } from '../../utils';
|
|
2
2
|
import { bundle, getModuleType } from '../utils';
|
|
3
|
-
import { Command,
|
|
3
|
+
import { Command, CommandOptions } from './types';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
codeCoverage
|
|
7
|
-
config
|
|
8
|
-
exposedDependencies
|
|
9
|
-
stat
|
|
10
|
-
useWatchConfig
|
|
11
|
-
watch
|
|
12
|
-
}
|
|
5
|
+
const options = {
|
|
6
|
+
codeCoverage: { boolean: true, hidden: true },
|
|
7
|
+
config: { string: true, hidden: true },
|
|
8
|
+
exposedDependencies: { boolean: true, hidden: true },
|
|
9
|
+
stat: { boolean: true, hidden: true },
|
|
10
|
+
useWatchConfig: { boolean: true, hidden: true },
|
|
11
|
+
watch: { boolean: true, hidden: true },
|
|
12
|
+
} satisfies CommandOptions;
|
|
13
13
|
|
|
14
|
-
export class BundlePackage extends Command<
|
|
14
|
+
export class BundlePackage extends Command<typeof options> {
|
|
15
|
+
static readonly options = options;
|
|
15
16
|
@logErrors
|
|
16
17
|
async execute() {
|
|
17
18
|
const {
|
|
@@ -1,22 +1,68 @@
|
|
|
1
|
-
import { exec, execSync } from 'child_process';
|
|
1
|
+
import { exec as execAsync, execSync } from 'node:child_process';
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { promisify } from 'node:util';
|
|
2
5
|
import { log, logErrors } from '../../utils';
|
|
6
|
+
import { ProcessTree } from '../utils/process-tree';
|
|
3
7
|
import { Command } from './types';
|
|
4
8
|
|
|
9
|
+
const exec = promisify(execAsync);
|
|
10
|
+
|
|
11
|
+
enum CleanProcesses {
|
|
12
|
+
ResetNx,
|
|
13
|
+
ClearJestCache,
|
|
14
|
+
ClearNpmCache,
|
|
15
|
+
ClearNpxCache,
|
|
16
|
+
CleanGitWorkingTree,
|
|
17
|
+
}
|
|
18
|
+
|
|
5
19
|
export class Clean extends Command {
|
|
20
|
+
static readonly allowRunFromGlobal = true;
|
|
6
21
|
static readonly description = 'Reset project to fresh state';
|
|
7
22
|
|
|
8
23
|
@logErrors
|
|
9
24
|
async execute() {
|
|
10
|
-
|
|
25
|
+
const processTree = new ProcessTree<typeof CleanProcesses>();
|
|
26
|
+
|
|
27
|
+
processTree.add(CleanProcesses.ResetNx, () => this.runCommand('npx nx reset'));
|
|
28
|
+
processTree.add(CleanProcesses.ClearJestCache, () =>
|
|
29
|
+
this.runCommand('npx jest --clearCache')
|
|
30
|
+
);
|
|
31
|
+
processTree.add(CleanProcesses.ClearNpmCache, () =>
|
|
32
|
+
this.runCommand('npm cache clear --force')
|
|
33
|
+
);
|
|
34
|
+
processTree.add(CleanProcesses.ClearNpxCache, () => this.clearNpxCache());
|
|
35
|
+
|
|
36
|
+
await processTree.run();
|
|
37
|
+
|
|
38
|
+
this.cleanGitWorkingTree();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
private async runCommand(command: string) {
|
|
42
|
+
try {
|
|
11
43
|
log.info(`Running: ${command}`);
|
|
12
|
-
|
|
13
|
-
})
|
|
44
|
+
await exec(command);
|
|
45
|
+
} catch (error) {
|
|
46
|
+
log.error(`Error running ${command}: ${error}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
14
49
|
|
|
50
|
+
private cleanGitWorkingTree() {
|
|
15
51
|
// Use exec() to avoid error when startup dependencies are deleted while startup is running
|
|
16
52
|
const command = 'git clean -fdX';
|
|
17
53
|
log.info(`Running: ${command}`);
|
|
18
54
|
exec(command);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
private async clearNpxCache() {
|
|
58
|
+
try {
|
|
59
|
+
const npmCacheDir = execSync('npm config get cache').toString().trim();
|
|
60
|
+
const npxCachePath = path.join(npmCacheDir, '_npx');
|
|
19
61
|
|
|
20
|
-
|
|
62
|
+
log.info('Clearing npx cache');
|
|
63
|
+
await fs.promises.rm(npxCachePath, { recursive: true, force: true });
|
|
64
|
+
} catch (error) {
|
|
65
|
+
log.error(`Error clearing npx cache: ${error}`);
|
|
66
|
+
}
|
|
21
67
|
}
|
|
22
68
|
}
|