@servicetitan/startup 33.1.0 → 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
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
import { isCI } from '@servicetitan/install';
|
|
2
|
-
import path from 'path';
|
|
3
2
|
import { execSync } from 'child_process';
|
|
3
|
+
import path from 'path';
|
|
4
4
|
import { getTsConfig, isWebComponent, log, logErrors, readJson } from '../../utils';
|
|
5
5
|
import { TSConfig } from '../utils';
|
|
6
|
-
import { Command,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
dry
|
|
10
|
-
releaseVersion:
|
|
11
|
-
|
|
6
|
+
import { Command, CommandOptions } from './types';
|
|
7
|
+
|
|
8
|
+
const options = {
|
|
9
|
+
dry: { boolean: true, description: 'Dry run mode' },
|
|
10
|
+
releaseVersion: {
|
|
11
|
+
string: true,
|
|
12
|
+
demandOption: true,
|
|
13
|
+
requiresArg: true,
|
|
14
|
+
description: 'Release version',
|
|
15
|
+
},
|
|
16
|
+
} satisfies CommandOptions;
|
|
12
17
|
|
|
13
18
|
interface PackageJson {
|
|
14
19
|
name: string;
|
|
15
20
|
}
|
|
16
21
|
|
|
17
|
-
export class UploadSourcemaps extends Command<
|
|
22
|
+
export class UploadSourcemaps extends Command<typeof options> {
|
|
23
|
+
static readonly options = options;
|
|
18
24
|
#outDir?: string;
|
|
19
25
|
#packageJson?: PackageJson;
|
|
20
26
|
|
|
@@ -41,10 +47,6 @@ export class UploadSourcemaps extends Command<Args> {
|
|
|
41
47
|
return false;
|
|
42
48
|
}
|
|
43
49
|
|
|
44
|
-
if (!this.args.releaseVersion) {
|
|
45
|
-
throw new Error('--release-version is required');
|
|
46
|
-
}
|
|
47
|
-
|
|
48
50
|
return true;
|
|
49
51
|
}
|
|
50
52
|
|
package/src/cli/index.ts
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
2
|
import execa from 'execa';
|
|
3
|
+
import kebabCase from 'lodash.kebabcase';
|
|
3
4
|
import path from 'path';
|
|
4
5
|
import yargs from 'yargs';
|
|
5
6
|
import { hideBin } from 'yargs/helpers';
|
|
6
7
|
import { CommandName, getStartupVersion, log } from '../utils';
|
|
7
8
|
import { Command, getCommand } from './commands';
|
|
8
|
-
import { setNodeOptions } from './utils';
|
|
9
|
+
import { checkStartupLocation, setNodeOptions } from './utils';
|
|
10
|
+
|
|
11
|
+
const yargsInstance = yargs(hideBin(process.argv));
|
|
9
12
|
|
|
10
13
|
Object.values(CommandName)
|
|
11
|
-
.reduce((y, name) => addCommand(name, y),
|
|
14
|
+
.reduce((y, name) => addCommand(name, y), yargsInstance)
|
|
12
15
|
.usage('Usage: startup <command> [options]')
|
|
13
16
|
.epilogue(
|
|
14
17
|
chalk.bold.cyan(`startup cli v${getStartupVersion()}\n`) +
|
|
@@ -24,7 +27,7 @@ Object.values(CommandName)
|
|
|
24
27
|
} as any,
|
|
25
28
|
})
|
|
26
29
|
.version()
|
|
27
|
-
.wrap(Math.min(100,
|
|
30
|
+
.wrap(Math.min(100, yargsInstance.terminalWidth()))
|
|
28
31
|
.help()
|
|
29
32
|
.parse();
|
|
30
33
|
|
|
@@ -35,7 +38,7 @@ function addCommand(name: CommandName, y: typeof yargs) {
|
|
|
35
38
|
const nameWithArgs = name + (_?.description ? ` ${_.description}` : '');
|
|
36
39
|
const groupedOptions = Object.entries(options).reduce(
|
|
37
40
|
(result, [key, value]) => {
|
|
38
|
-
result[key] = { group: 'Command Options:', ...value };
|
|
41
|
+
result[kebabCase(key)] = { group: 'Command Options:', ...value };
|
|
39
42
|
return result;
|
|
40
43
|
},
|
|
41
44
|
{} as NonNullable<typeof klass.options>
|
|
@@ -51,11 +54,12 @@ function addCommand(name: CommandName, y: typeof yargs) {
|
|
|
51
54
|
|
|
52
55
|
function handleCommand(name: CommandName, argv: any) {
|
|
53
56
|
const Command = getCommand(name)!;
|
|
57
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
58
|
+
const command = new Command({ ...argv, _: argv._.slice(1) });
|
|
54
59
|
|
|
55
60
|
checkNodeVersion();
|
|
61
|
+
checkStartupLocation(name, command);
|
|
56
62
|
|
|
57
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
58
|
-
const command = new Command({ ...argv, _: argv._.slice(1) });
|
|
59
63
|
if (setNodeOptions(name, command)) {
|
|
60
64
|
log.debug('run', `Running ${name} in child process with amended NODE_OPTIONS`);
|
|
61
65
|
execa(process.argv[0], process.argv.slice(1), { stdio: 'inherit' }).catch(reason => {
|
|
@@ -79,5 +83,5 @@ function checkNodeVersion() {
|
|
|
79
83
|
`error: node v${nodeVersion} detected, only even-numbered LTS versions ${engines.node} are supported`
|
|
80
84
|
);
|
|
81
85
|
log.text('See https://nodejs.org/en/download for LTS versions');
|
|
82
|
-
process.exit(
|
|
86
|
+
process.exit(1);
|
|
83
87
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { swcDir } from '@swc/cli';
|
|
2
|
-
import deepmerge from 'deepmerge';
|
|
3
2
|
import debounce from 'debounce';
|
|
3
|
+
import deepmerge from 'deepmerge';
|
|
4
4
|
import { fs, vol } from 'memfs';
|
|
5
5
|
import { getSwcCompilePackageConfiguration, log } from '../../../utils';
|
|
6
6
|
import { SwcCompilePackage } from '../swc-compile-package';
|
|
@@ -10,6 +10,8 @@ jest.mock('fs', () => fs);
|
|
|
10
10
|
jest.mock('@swc/cli', () => ({
|
|
11
11
|
swcDir: jest.fn(),
|
|
12
12
|
}));
|
|
13
|
+
jest.mock('yargs', () => jest.fn());
|
|
14
|
+
jest.mock('yargs/helpers', () => ({ hideBin: jest.fn() }));
|
|
13
15
|
|
|
14
16
|
jest.mock('../../../utils', () => ({
|
|
15
17
|
...jest.requireActual('../../../utils'),
|
|
@@ -14,6 +14,8 @@ jest.mock('execa', () =>
|
|
|
14
14
|
})
|
|
15
15
|
)
|
|
16
16
|
);
|
|
17
|
+
jest.mock('yargs', () => jest.fn());
|
|
18
|
+
jest.mock('yargs/helpers', () => ({ hideBin: jest.fn() }));
|
|
17
19
|
|
|
18
20
|
describe(`[startup] ${TscCompile.name} task`, () => {
|
|
19
21
|
let options: ConstructorParameters<typeof TscCompile>[0];
|
|
@@ -57,12 +59,10 @@ describe(`[startup] ${TscCompile.name} task`, () => {
|
|
|
57
59
|
caption: string,
|
|
58
60
|
{
|
|
59
61
|
watch = false,
|
|
60
|
-
typeCheckOnly = false,
|
|
61
62
|
tsConfigs,
|
|
62
63
|
stdio,
|
|
63
64
|
}: {
|
|
64
65
|
watch?: boolean;
|
|
65
|
-
typeCheckOnly?: boolean;
|
|
66
66
|
tsConfigs: string[];
|
|
67
67
|
stdio: string | string[];
|
|
68
68
|
}
|
|
@@ -78,7 +78,7 @@ describe(`[startup] ${TscCompile.name} task`, () => {
|
|
|
78
78
|
watch ? '-w' : undefined,
|
|
79
79
|
'--pretty',
|
|
80
80
|
'--preserveWatchOutput',
|
|
81
|
-
|
|
81
|
+
'--emitDeclarationOnly',
|
|
82
82
|
...tsConfigs.map(config => expect.stringContaining(path.normalize(config))),
|
|
83
83
|
].filter(item => item !== undefined)
|
|
84
84
|
),
|
|
@@ -106,16 +106,6 @@ describe(`[startup] ${TscCompile.name} task`, () => {
|
|
|
106
106
|
});
|
|
107
107
|
});
|
|
108
108
|
|
|
109
|
-
describe('with "typeCheckOnly" mode', () => {
|
|
110
|
-
beforeEach(() => (options = { typeCheckOnly: true }));
|
|
111
|
-
|
|
112
|
-
itRunsTsc('in "typeCheckOnly" mode', {
|
|
113
|
-
typeCheckOnly: true,
|
|
114
|
-
tsConfigs: ['foo/tsconfig.json', 'bar/tsconfig.json'],
|
|
115
|
-
stdio: 'inherit',
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
|
|
119
109
|
describe('with "scope"', () => {
|
|
120
110
|
beforeEach(() => (options = { scope: ['foo'] }));
|
|
121
111
|
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { Options, swcDir } from '@swc/cli';
|
|
2
2
|
import debounce from 'debounce';
|
|
3
3
|
import deepmerge from 'deepmerge';
|
|
4
|
-
|
|
5
4
|
import { getFolders, getSwcCompilePackageConfiguration, getTsConfig, log } from '../../utils';
|
|
6
|
-
import { CommandArgs } from '../commands';
|
|
7
5
|
import { TSConfig } from '../utils';
|
|
8
6
|
import { Task } from './task';
|
|
9
7
|
|
|
10
|
-
interface Args
|
|
8
|
+
interface Args {
|
|
11
9
|
watch?: boolean;
|
|
12
10
|
}
|
|
13
11
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { getPackages, getPackagesGraph, getTsConfig, log, Package, PackageType } from '../../utils';
|
|
2
|
-
import { CommandArgs } from '../commands';
|
|
3
2
|
import { CliTask } from './cli-task';
|
|
4
3
|
|
|
5
|
-
interface Args
|
|
4
|
+
interface Args {
|
|
6
5
|
ignore?: string | string[];
|
|
7
6
|
scope?: string | string[];
|
|
8
7
|
watch?: boolean;
|
|
@@ -3,6 +3,7 @@ import path from 'path';
|
|
|
3
3
|
import { getPortPromise } from 'portfinder';
|
|
4
4
|
import webpack from 'webpack';
|
|
5
5
|
import WebpackDevServer from 'webpack-dev-server';
|
|
6
|
+
import { createPackage } from '../../../__mocks__';
|
|
6
7
|
import {
|
|
7
8
|
getConfiguration,
|
|
8
9
|
getFolders,
|
|
@@ -12,8 +13,6 @@ import {
|
|
|
12
13
|
loadSharedDependencies,
|
|
13
14
|
} from '../../../utils';
|
|
14
15
|
import { createWebpackConfig } from '../../../webpack';
|
|
15
|
-
import { createPackage } from '../../../__mocks__';
|
|
16
|
-
|
|
17
16
|
import { bundle, webpackDevConfigFileName, webpackProdConfigFileName } from '../bundle';
|
|
18
17
|
|
|
19
18
|
jest.mock('fs', () => fs);
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { log } from '../../../utils';
|
|
2
|
+
import { Command } from '../../commands/types';
|
|
3
|
+
import { checkStartupLocation } from '../check-startup-location';
|
|
4
|
+
import { npmGetProjectRoot } from '../cli-npm';
|
|
5
|
+
|
|
6
|
+
jest.mock('../../../utils', () => ({
|
|
7
|
+
...jest.requireActual('../../../utils'),
|
|
8
|
+
log: { error: jest.fn() },
|
|
9
|
+
}));
|
|
10
|
+
jest.mock('../cli-npm');
|
|
11
|
+
|
|
12
|
+
class TestCommand extends Command {
|
|
13
|
+
async execute() {
|
|
14
|
+
// no-op
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
describe('[startup] Cli Utils', () => {
|
|
19
|
+
describe(checkStartupLocation.name, () => {
|
|
20
|
+
const originalSkipLocationCheck = process.env.SKIP_STARTUP_LOCATION_CHECK;
|
|
21
|
+
const commandName: any = 'test';
|
|
22
|
+
let mockCommand: Command;
|
|
23
|
+
|
|
24
|
+
beforeEach(() => {
|
|
25
|
+
jest.clearAllMocks();
|
|
26
|
+
jest.mocked(npmGetProjectRoot).mockReturnValue(process.cwd());
|
|
27
|
+
jest.spyOn(process, 'exit').mockImplementation(jest.fn() as any);
|
|
28
|
+
delete process.env.SKIP_STARTUP_LOCATION_CHECK;
|
|
29
|
+
mockCommand = new TestCommand({});
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
afterAll(() => {
|
|
33
|
+
if (originalSkipLocationCheck !== undefined) {
|
|
34
|
+
process.env.SKIP_STARTUP_LOCATION_CHECK = originalSkipLocationCheck;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const subject = () => checkStartupLocation(commandName, mockCommand);
|
|
39
|
+
|
|
40
|
+
function itDoesNothing() {
|
|
41
|
+
test('does nothing', () => {
|
|
42
|
+
subject();
|
|
43
|
+
|
|
44
|
+
expect(log.error).not.toHaveBeenCalled();
|
|
45
|
+
expect(process.exit).not.toHaveBeenCalled();
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
itDoesNothing();
|
|
50
|
+
|
|
51
|
+
test('sets process.env.SKIP_STARTUP_LOCATION_CHECK', () => {
|
|
52
|
+
subject();
|
|
53
|
+
|
|
54
|
+
expect(process.env.SKIP_STARTUP_LOCATION_CHECK).toBeDefined();
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
describe('when running from non-project directory', () => {
|
|
58
|
+
beforeEach(() => jest.mocked(npmGetProjectRoot).mockReturnValue('foo'));
|
|
59
|
+
|
|
60
|
+
test('logs error and exits process with error code', () => {
|
|
61
|
+
subject();
|
|
62
|
+
|
|
63
|
+
expect(log.error).toHaveBeenCalledWith(
|
|
64
|
+
`Error: ${commandName} must be run from the local @servicetitan/startup installation`
|
|
65
|
+
);
|
|
66
|
+
expect(process.exit).toHaveBeenCalledWith(1);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
describe('when command allows running from global location', () => {
|
|
70
|
+
beforeEach(() => {
|
|
71
|
+
(mockCommand.constructor as any).allowRunFromGlobal = true;
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
afterEach(() => {
|
|
75
|
+
delete (mockCommand.constructor as any).allowRunFromGlobal;
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
itDoesNothing();
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
describe('when parent process has already checked location', () => {
|
|
82
|
+
beforeEach(() => (process.env.SKIP_STARTUP_LOCATION_CHECK = 'true'));
|
|
83
|
+
|
|
84
|
+
itDoesNothing();
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
});
|
|
@@ -1,19 +1,27 @@
|
|
|
1
|
-
import { runCommand, runCommandOutput } from '../cli-os';
|
|
2
|
-
|
|
3
1
|
import {
|
|
4
2
|
npmGetPackageVersions,
|
|
5
3
|
npmGetPackageVersionsDetails,
|
|
4
|
+
npmGetProjectRoot,
|
|
6
5
|
npmPackageSet,
|
|
7
6
|
npmPublish,
|
|
7
|
+
npmRemoveTag,
|
|
8
8
|
npmTagVersion,
|
|
9
9
|
npmUnpublish,
|
|
10
10
|
npmView,
|
|
11
11
|
} from '../cli-npm';
|
|
12
|
+
import { runCommand, runCommandOutput } from '../cli-os';
|
|
12
13
|
|
|
13
14
|
jest.mock('../cli-os', () => ({
|
|
14
15
|
runCommand: jest.fn().mockResolvedValue(undefined),
|
|
15
16
|
runCommandOutput: jest.fn(),
|
|
16
17
|
}));
|
|
18
|
+
jest.mock('../../../utils', () => ({
|
|
19
|
+
...jest.requireActual('../../../utils'),
|
|
20
|
+
log: {
|
|
21
|
+
info: jest.fn(),
|
|
22
|
+
error: jest.fn(),
|
|
23
|
+
},
|
|
24
|
+
}));
|
|
17
25
|
|
|
18
26
|
describe('[startup] Cli Utils (Npm)', () => {
|
|
19
27
|
beforeEach(() => jest.resetAllMocks());
|
|
@@ -133,6 +141,26 @@ describe('[startup] Cli Utils (Npm)', () => {
|
|
|
133
141
|
});
|
|
134
142
|
});
|
|
135
143
|
|
|
144
|
+
describe(npmGetProjectRoot.name, () => {
|
|
145
|
+
const output = 'foo\n';
|
|
146
|
+
|
|
147
|
+
beforeEach(() => {
|
|
148
|
+
jest.mocked(runCommandOutput).mockReturnValue(output);
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
const subject = () => npmGetProjectRoot();
|
|
152
|
+
|
|
153
|
+
itRunsCommandOutput(subject, 'npm prefix', {
|
|
154
|
+
quiet: true,
|
|
155
|
+
stdio: ['inherit', 'pipe', 'ignore'],
|
|
156
|
+
timeout: 10000,
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
test('returns trimmed output', () => {
|
|
160
|
+
expect(subject()).toEqual(output.trim());
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
|
|
136
164
|
describe(npmPackageSet.name, () => {
|
|
137
165
|
let args: Parameters<typeof npmPackageSet>;
|
|
138
166
|
|
|
@@ -204,6 +232,27 @@ describe('[startup] Cli Utils (Npm)', () => {
|
|
|
204
232
|
});
|
|
205
233
|
});
|
|
206
234
|
|
|
235
|
+
describe(npmRemoveTag.name, () => {
|
|
236
|
+
let args: Parameters<typeof npmRemoveTag>[0];
|
|
237
|
+
|
|
238
|
+
beforeEach(() => {
|
|
239
|
+
args = {
|
|
240
|
+
packageName: '{packageName}',
|
|
241
|
+
tag: '{tag}',
|
|
242
|
+
};
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
const subject = () => npmRemoveTag(args);
|
|
246
|
+
|
|
247
|
+
itRunsCommand(subject, 'npm dist-tag rm {packageName} {tag}');
|
|
248
|
+
|
|
249
|
+
describe('with a registry', () => {
|
|
250
|
+
beforeEach(() => (args.registry = '{registry}'));
|
|
251
|
+
|
|
252
|
+
itRunsCommand(subject, 'npm dist-tag --registry={registry} rm {packageName} {tag}');
|
|
253
|
+
});
|
|
254
|
+
});
|
|
255
|
+
|
|
207
256
|
describe(npmView.name, () => {
|
|
208
257
|
const packageInfo = { name: 'foo', version: '1.0.0', versions: [], time: {} };
|
|
209
258
|
let args: Parameters<typeof npmView>[0];
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { execSync, spawn } from 'child_process';
|
|
2
|
-
|
|
3
|
-
import { runCommand, runCommandOutput } from '../cli-os';
|
|
4
2
|
import { log } from '../../../utils';
|
|
3
|
+
import { runCommand, runCommandOutput } from '../cli-os';
|
|
5
4
|
|
|
6
5
|
jest.mock('child_process', () => ({ execSync: jest.fn(), spawn: jest.fn() }));
|
|
7
6
|
jest.mock('../../../utils', () => ({ log: { info: jest.fn() } })); // suppress log output
|
|
@@ -5,7 +5,6 @@ import cpx from 'cpx2';
|
|
|
5
5
|
import fs from 'fs';
|
|
6
6
|
import { getFolders, log } from '../../../utils';
|
|
7
7
|
import * as compileSassModule from '../compile-sass';
|
|
8
|
-
|
|
9
8
|
import { copyFiles, styleExtensions, supportedExtensions } from '../copy-files';
|
|
10
9
|
|
|
11
10
|
jest.mock('cpx2', () => ({
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { isCI } from '@servicetitan/install';
|
|
2
2
|
import execa from 'execa';
|
|
3
|
-
|
|
4
3
|
import { log } from '../../../utils';
|
|
5
|
-
import { maybeCreateGitFolder } from '../maybe-create-git-folder';
|
|
6
4
|
import { lernaExec } from '../lerna-exec';
|
|
5
|
+
import { maybeCreateGitFolder } from '../maybe-create-git-folder';
|
|
7
6
|
|
|
8
7
|
jest.mock('@servicetitan/install');
|
|
9
8
|
jest.mock('execa');
|
package/src/cli/utils/bundle.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
+
import crypto from 'crypto';
|
|
1
2
|
import fs from 'fs';
|
|
2
3
|
import path from 'path';
|
|
3
|
-
import crypto from 'crypto';
|
|
4
4
|
import { getPortPromise } from 'portfinder';
|
|
5
|
-
|
|
6
5
|
import webpack, { Configuration } from 'webpack';
|
|
7
6
|
import WebpackDevServer from 'webpack-dev-server';
|
|
8
|
-
|
|
9
7
|
import {
|
|
10
8
|
getPackageName,
|
|
11
9
|
hasHeadlessBundle,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CommandName, log } from '../../utils';
|
|
2
|
+
import { Command } from '../commands';
|
|
3
|
+
import { npmGetProjectRoot } from './cli-npm';
|
|
4
|
+
|
|
5
|
+
export function checkStartupLocation(commandName: CommandName, command: Command) {
|
|
6
|
+
const allowRunFromGlobal = (command.constructor as typeof Command).allowRunFromGlobal;
|
|
7
|
+
if (allowRunFromGlobal || process.env.SKIP_STARTUP_LOCATION_CHECK) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const projectRoot = npmGetProjectRoot();
|
|
12
|
+
if (projectRoot && __dirname.startsWith(projectRoot)) {
|
|
13
|
+
process.env.SKIP_STARTUP_LOCATION_CHECK = 'true';
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
log.error(
|
|
18
|
+
`Error: ${commandName} must be run from the local @servicetitan/startup installation`
|
|
19
|
+
);
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
package/src/cli/utils/cli-npm.ts
CHANGED
|
@@ -42,6 +42,15 @@ export function npmGetPackageVersionsDetails(registry: string, packageName: stri
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
export function npmGetProjectRoot() {
|
|
46
|
+
return runCommandOutput('npm prefix', {
|
|
47
|
+
quiet: true,
|
|
48
|
+
// ignore stderr because any error here is fundamental and will be repeated elsewhere
|
|
49
|
+
stdio: ['inherit', 'pipe', 'ignore'],
|
|
50
|
+
timeout: NPM_TIMEOUT,
|
|
51
|
+
}).trim();
|
|
52
|
+
}
|
|
53
|
+
|
|
45
54
|
export async function npmUnpublish(registry: string, packageName: string, packageVersion: string) {
|
|
46
55
|
await runCommand(`npm unpublish ${packageName}@${packageVersion} --registry ${registry}`, {
|
|
47
56
|
timeout: NPM_TIMEOUT,
|
|
@@ -74,6 +83,19 @@ export async function npmTagVersion({
|
|
|
74
83
|
);
|
|
75
84
|
}
|
|
76
85
|
|
|
86
|
+
export async function npmRemoveTag({
|
|
87
|
+
packageName,
|
|
88
|
+
registry,
|
|
89
|
+
tag,
|
|
90
|
+
}: {
|
|
91
|
+
packageName: string;
|
|
92
|
+
registry?: string;
|
|
93
|
+
tag: string;
|
|
94
|
+
}) {
|
|
95
|
+
const registryFlag = registry ? `--registry=${registry} ` : '';
|
|
96
|
+
await runCommand(`npm dist-tag ${registryFlag}rm ${packageName} ${tag}`);
|
|
97
|
+
}
|
|
98
|
+
|
|
77
99
|
export interface NPMPackageInfo {
|
|
78
100
|
'name': string;
|
|
79
101
|
'version': string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const DRY_RUN_PREFIX = '(dry-run) ';
|
|
@@ -2,7 +2,6 @@ import cpx from 'cpx2';
|
|
|
2
2
|
import fs from 'fs';
|
|
3
3
|
import { glob } from 'glob';
|
|
4
4
|
import DtsCreator from 'typed-css-modules';
|
|
5
|
-
|
|
6
5
|
import { getFolders, log } from '../../utils';
|
|
7
6
|
import { compileLess } from './compile-less';
|
|
8
7
|
import { compileSass } from './compile-sass';
|
package/src/cli/utils/eslint.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { ESLint } from 'eslint';
|
|
2
|
-
|
|
3
2
|
import { getDestinationFolders, getESLintConfiguration, log } from '../../utils';
|
|
4
|
-
import { CommandArgs } from '../commands';
|
|
5
3
|
|
|
6
|
-
interface Args
|
|
4
|
+
interface Args {
|
|
7
5
|
fix?: boolean;
|
|
8
6
|
paths: string[];
|
|
9
7
|
}
|
package/src/cli/utils/index.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
export * from './bundle';
|
|
2
2
|
export * from './check-args';
|
|
3
|
+
export * from './check-startup-location';
|
|
3
4
|
export * from './cli-git';
|
|
4
5
|
export * from './cli-npm';
|
|
5
6
|
export * from './cli-os';
|
|
6
7
|
export * from './compile';
|
|
7
8
|
export * from './compile-less';
|
|
8
9
|
export * from './compile-sass';
|
|
10
|
+
export * from './constants';
|
|
9
11
|
export * from './copy-files';
|
|
10
12
|
export * from './eslint';
|
|
11
13
|
export * from './get-module-type';
|