@servicetitan/startup 35.2.0-far-1776.1 → 35.3.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 +2 -70
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +0 -49
- package/dist/cli/commands/build.js.map +1 -1
- package/dist/cli/commands/bundle-package.d.ts +2 -54
- package/dist/cli/commands/bundle-package.d.ts.map +1 -1
- package/dist/cli/commands/bundle-package.js +0 -40
- package/dist/cli/commands/bundle-package.js.map +1 -1
- package/dist/cli/commands/clean.d.ts +2 -3
- package/dist/cli/commands/clean.d.ts.map +1 -1
- package/dist/cli/commands/clean.js +0 -15
- package/dist/cli/commands/clean.js.map +1 -1
- package/dist/cli/commands/convert-eslint-config.d.ts +2 -3
- package/dist/cli/commands/convert-eslint-config.d.ts.map +1 -1
- package/dist/cli/commands/convert-eslint-config.js +0 -2
- package/dist/cli/commands/convert-eslint-config.js.map +1 -1
- package/dist/cli/commands/eslint.d.ts +2 -34
- package/dist/cli/commands/eslint.d.ts.map +1 -1
- package/dist/cli/commands/eslint.js +0 -30
- package/dist/cli/commands/eslint.js.map +1 -1
- package/dist/cli/commands/init.d.ts +2 -16
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +0 -22
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/install.d.ts +2 -36
- package/dist/cli/commands/install.d.ts.map +1 -1
- package/dist/cli/commands/install.js +0 -32
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/kendo-ui-license.d.ts +2 -3
- package/dist/cli/commands/kendo-ui-license.d.ts.map +1 -1
- package/dist/cli/commands/kendo-ui-license.js +0 -15
- package/dist/cli/commands/kendo-ui-license.js.map +1 -1
- package/dist/cli/commands/lint.d.ts +2 -70
- package/dist/cli/commands/lint.d.ts.map +1 -1
- package/dist/cli/commands/lint.js +0 -49
- package/dist/cli/commands/lint.js.map +1 -1
- package/dist/cli/commands/mfe-check.d.ts +2 -44
- package/dist/cli/commands/mfe-check.d.ts.map +1 -1
- package/dist/cli/commands/mfe-check.js +0 -36
- package/dist/cli/commands/mfe-check.js.map +1 -1
- package/dist/cli/commands/mfe-generate-metadata.d.ts +2 -16
- package/dist/cli/commands/mfe-generate-metadata.d.ts.map +1 -1
- package/dist/cli/commands/mfe-generate-metadata.js +1 -28
- package/dist/cli/commands/mfe-generate-metadata.js.map +1 -1
- package/dist/cli/commands/mfe-list.d.ts +2 -70
- package/dist/cli/commands/mfe-list.d.ts.map +1 -1
- package/dist/cli/commands/mfe-list.js +0 -49
- package/dist/cli/commands/mfe-list.js.map +1 -1
- package/dist/cli/commands/mfe-package-clean.d.ts +2 -53
- package/dist/cli/commands/mfe-package-clean.d.ts.map +1 -1
- package/dist/cli/commands/mfe-package-clean.js +3 -51
- package/dist/cli/commands/mfe-package-clean.js.map +1 -1
- package/dist/cli/commands/mfe-package-publish.d.ts +2 -91
- package/dist/cli/commands/mfe-package-publish.d.ts.map +1 -1
- package/dist/cli/commands/mfe-package-publish.js +3 -70
- package/dist/cli/commands/mfe-package-publish.js.map +1 -1
- package/dist/cli/commands/mfe-package-rollback.d.ts +2 -43
- package/dist/cli/commands/mfe-package-rollback.d.ts.map +1 -1
- package/dist/cli/commands/mfe-package-rollback.js +3 -46
- package/dist/cli/commands/mfe-package-rollback.js.map +1 -1
- package/dist/cli/commands/mfe-publish.d.ts +9 -47
- package/dist/cli/commands/mfe-publish.d.ts.map +1 -1
- package/dist/cli/commands/mfe-publish.js +0 -69
- package/dist/cli/commands/mfe-publish.js.map +1 -1
- package/dist/cli/commands/mfe-purge-cache.d.ts +2 -46
- package/dist/cli/commands/mfe-purge-cache.d.ts.map +1 -1
- package/dist/cli/commands/mfe-purge-cache.js +0 -36
- package/dist/cli/commands/mfe-purge-cache.js.map +1 -1
- package/dist/cli/commands/prepare-package.d.ts +2 -14
- package/dist/cli/commands/prepare-package.d.ts.map +1 -1
- package/dist/cli/commands/prepare-package.js +0 -20
- package/dist/cli/commands/prepare-package.js.map +1 -1
- package/dist/cli/commands/registry/build.d.ts +38 -0
- package/dist/cli/commands/registry/build.d.ts.map +1 -0
- package/dist/cli/commands/registry/build.js +50 -0
- package/dist/cli/commands/registry/build.js.map +1 -0
- package/dist/cli/commands/registry/bundle-package.d.ts +29 -0
- package/dist/cli/commands/registry/bundle-package.d.ts.map +1 -0
- package/dist/cli/commands/registry/bundle-package.js +41 -0
- package/dist/cli/commands/registry/bundle-package.js.map +1 -0
- package/dist/cli/commands/registry/clean.d.ts +5 -0
- package/dist/cli/commands/registry/clean.d.ts.map +1 -0
- package/dist/cli/commands/registry/clean.js +17 -0
- package/dist/cli/commands/registry/clean.js.map +1 -0
- package/dist/cli/commands/registry/command-registry.d.ts +509 -0
- package/dist/cli/commands/registry/command-registry.d.ts.map +1 -0
- package/dist/cli/commands/registry/command-registry.js +138 -0
- package/dist/cli/commands/registry/command-registry.js.map +1 -0
- package/dist/cli/commands/registry/convert-eslint-config.d.ts +5 -0
- package/dist/cli/commands/registry/convert-eslint-config.d.ts.map +1 -0
- package/dist/cli/commands/registry/convert-eslint-config.js +17 -0
- package/dist/cli/commands/registry/convert-eslint-config.js.map +1 -0
- package/dist/cli/commands/registry/define-entry.d.ts +7 -0
- package/dist/cli/commands/registry/define-entry.d.ts.map +1 -0
- package/dist/cli/commands/registry/define-entry.js +15 -0
- package/dist/cli/commands/registry/define-entry.js.map +1 -0
- package/dist/cli/commands/registry/eslint.d.ts +19 -0
- package/dist/cli/commands/registry/eslint.d.ts.map +1 -0
- package/dist/cli/commands/registry/eslint.js +31 -0
- package/dist/cli/commands/registry/eslint.js.map +1 -0
- package/dist/cli/commands/registry/index.d.ts +3 -0
- package/dist/cli/commands/registry/index.d.ts.map +1 -0
- package/dist/cli/commands/registry/index.js +13 -0
- package/dist/cli/commands/registry/index.js.map +1 -0
- package/dist/cli/commands/registry/init.d.ts +11 -0
- package/dist/cli/commands/registry/init.d.ts.map +1 -0
- package/dist/cli/commands/registry/init.js +23 -0
- package/dist/cli/commands/registry/init.js.map +1 -0
- package/dist/cli/commands/registry/install.d.ts +21 -0
- package/dist/cli/commands/registry/install.d.ts.map +1 -0
- package/dist/cli/commands/registry/install.js +33 -0
- package/dist/cli/commands/registry/install.js.map +1 -0
- package/dist/cli/commands/registry/kendo-ui-license.d.ts +5 -0
- package/dist/cli/commands/registry/kendo-ui-license.d.ts.map +1 -0
- package/dist/cli/commands/registry/kendo-ui-license.js +17 -0
- package/dist/cli/commands/registry/kendo-ui-license.js.map +1 -0
- package/dist/cli/commands/registry/lint.d.ts +38 -0
- package/dist/cli/commands/registry/lint.d.ts.map +1 -0
- package/dist/cli/commands/registry/lint.js +50 -0
- package/dist/cli/commands/registry/lint.js.map +1 -0
- package/dist/cli/commands/registry/mfe-check.d.ts +25 -0
- package/dist/cli/commands/registry/mfe-check.d.ts.map +1 -0
- package/dist/cli/commands/registry/mfe-check.js +37 -0
- package/dist/cli/commands/registry/mfe-check.js.map +1 -0
- package/dist/cli/commands/registry/mfe-generate-metadata.d.ts +11 -0
- package/dist/cli/commands/registry/mfe-generate-metadata.d.ts.map +1 -0
- package/dist/cli/commands/registry/mfe-generate-metadata.js +23 -0
- package/dist/cli/commands/registry/mfe-generate-metadata.js.map +1 -0
- package/dist/cli/commands/registry/mfe-list.d.ts +38 -0
- package/dist/cli/commands/registry/mfe-list.d.ts.map +1 -0
- package/dist/cli/commands/registry/mfe-list.js +50 -0
- package/dist/cli/commands/registry/mfe-list.js.map +1 -0
- package/dist/cli/commands/registry/mfe-package-clean.d.ts +29 -0
- package/dist/cli/commands/registry/mfe-package-clean.d.ts.map +1 -0
- package/dist/cli/commands/registry/mfe-package-clean.js +41 -0
- package/dist/cli/commands/registry/mfe-package-clean.js.map +1 -0
- package/dist/cli/commands/registry/mfe-package-publish.d.ts +48 -0
- package/dist/cli/commands/registry/mfe-package-publish.d.ts.map +1 -0
- package/dist/cli/commands/registry/mfe-package-publish.js +60 -0
- package/dist/cli/commands/registry/mfe-package-publish.js.map +1 -0
- package/dist/cli/commands/registry/mfe-package-rollback.d.ts +24 -0
- package/dist/cli/commands/registry/mfe-package-rollback.d.ts.map +1 -0
- package/dist/cli/commands/registry/mfe-package-rollback.js +36 -0
- package/dist/cli/commands/registry/mfe-package-rollback.js.map +1 -0
- package/dist/cli/commands/registry/mfe-publish.d.ts +24 -0
- package/dist/cli/commands/registry/mfe-publish.d.ts.map +1 -0
- package/dist/cli/commands/registry/mfe-publish.js +72 -0
- package/dist/cli/commands/registry/mfe-publish.js.map +1 -0
- package/dist/cli/commands/registry/mfe-purge-cache.d.ts +25 -0
- package/dist/cli/commands/registry/mfe-purge-cache.d.ts.map +1 -0
- package/dist/cli/commands/registry/mfe-purge-cache.js +37 -0
- package/dist/cli/commands/registry/mfe-purge-cache.js.map +1 -0
- package/dist/cli/commands/registry/prepare-package.d.ts +9 -0
- package/dist/cli/commands/registry/prepare-package.d.ts.map +1 -0
- package/dist/cli/commands/registry/prepare-package.js +21 -0
- package/dist/cli/commands/registry/prepare-package.js.map +1 -0
- package/dist/cli/commands/registry/review.d.ts +16 -0
- package/dist/cli/commands/registry/review.d.ts.map +1 -0
- package/dist/cli/commands/registry/review.js +28 -0
- package/dist/cli/commands/registry/review.js.map +1 -0
- package/dist/cli/commands/registry/start.d.ts +30 -0
- package/dist/cli/commands/registry/start.d.ts.map +1 -0
- package/dist/cli/commands/registry/start.js +42 -0
- package/dist/cli/commands/registry/start.js.map +1 -0
- package/dist/cli/commands/registry/stylelint.d.ts +19 -0
- package/dist/cli/commands/registry/stylelint.d.ts.map +1 -0
- package/dist/cli/commands/registry/stylelint.js +31 -0
- package/dist/cli/commands/registry/stylelint.js.map +1 -0
- package/dist/cli/commands/registry/styles-check.d.ts +2 -0
- package/dist/cli/commands/registry/styles-check.d.ts.map +1 -0
- package/dist/cli/commands/registry/styles-check.js +14 -0
- package/dist/cli/commands/registry/styles-check.js.map +1 -0
- package/dist/cli/commands/registry/task.d.ts +19 -0
- package/dist/cli/commands/registry/task.d.ts.map +1 -0
- package/dist/cli/commands/registry/task.js +31 -0
- package/dist/cli/commands/registry/task.js.map +1 -0
- package/dist/cli/commands/registry/test-command.d.ts +22 -0
- package/dist/cli/commands/registry/test-command.d.ts.map +1 -0
- package/dist/cli/commands/registry/test-command.js +38 -0
- package/dist/cli/commands/registry/test-command.js.map +1 -0
- package/dist/cli/commands/registry/upload-sourcemaps.d.ts +15 -0
- package/dist/cli/commands/registry/upload-sourcemaps.d.ts.map +1 -0
- package/dist/cli/commands/registry/upload-sourcemaps.js +27 -0
- package/dist/cli/commands/registry/upload-sourcemaps.js.map +1 -0
- package/dist/cli/commands/review/review.d.ts +2 -26
- package/dist/cli/commands/review/review.d.ts.map +1 -1
- package/dist/cli/commands/review/review.js +0 -14
- package/dist/cli/commands/review/review.js.map +1 -1
- package/dist/cli/commands/review/rules/require-compatible-launch-darkly-sdk.d.ts.map +1 -1
- package/dist/cli/commands/review/rules/require-compatible-launch-darkly-sdk.js +6 -6
- package/dist/cli/commands/review/rules/require-compatible-launch-darkly-sdk.js.map +1 -1
- package/dist/cli/commands/review/types.d.ts +5 -2
- package/dist/cli/commands/review/types.d.ts.map +1 -1
- package/dist/cli/commands/review/types.js.map +1 -1
- package/dist/cli/commands/run-task.d.ts +2 -34
- package/dist/cli/commands/run-task.d.ts.map +1 -1
- package/dist/cli/commands/run-task.js +0 -30
- package/dist/cli/commands/run-task.js.map +1 -1
- package/dist/cli/commands/start.d.ts +2 -54
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +0 -41
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/stylelint.d.ts +2 -34
- package/dist/cli/commands/stylelint.d.ts.map +1 -1
- package/dist/cli/commands/stylelint.js +0 -30
- package/dist/cli/commands/stylelint.js.map +1 -1
- package/dist/cli/commands/styles-check.d.ts +2 -1
- package/dist/cli/commands/styles-check.d.ts.map +1 -1
- package/dist/cli/commands/styles-check.js.map +1 -1
- package/dist/cli/commands/test/tests.d.ts +2 -38
- package/dist/cli/commands/test/tests.d.ts.map +1 -1
- package/dist/cli/commands/test/tests.js +0 -36
- package/dist/cli/commands/test/tests.js.map +1 -1
- package/dist/cli/commands/types.d.ts +9 -7
- package/dist/cli/commands/types.d.ts.map +1 -1
- package/dist/cli/commands/types.js +0 -4
- package/dist/cli/commands/types.js.map +1 -1
- package/dist/cli/commands/upload-sourcemaps.d.ts +2 -26
- package/dist/cli/commands/upload-sourcemaps.d.ts.map +1 -1
- package/dist/cli/commands/upload-sourcemaps.js +0 -26
- package/dist/cli/commands/upload-sourcemaps.js.map +1 -1
- package/dist/cli/index.js +17 -16
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/tasks/swc-compile-package/swc-compile-package.d.ts.map +1 -1
- package/dist/cli/tasks/swc-compile-package/swc-compile-package.js +1 -7
- package/dist/cli/tasks/swc-compile-package/swc-compile-package.js.map +1 -1
- package/dist/cli/utils/bundle.js +1 -1
- package/dist/cli/utils/bundle.js.map +1 -1
- package/dist/cli/utils/check-startup-location.d.ts +2 -2
- package/dist/cli/utils/check-startup-location.d.ts.map +1 -1
- package/dist/cli/utils/check-startup-location.js +1 -2
- package/dist/cli/utils/check-startup-location.js.map +1 -1
- package/dist/cli/utils/set-node-options.d.ts +3 -3
- package/dist/cli/utils/set-node-options.d.ts.map +1 -1
- package/dist/cli/utils/set-node-options.js +1 -2
- package/dist/cli/utils/set-node-options.js.map +1 -1
- package/dist/cypress/config/index.d.ts.map +1 -0
- package/dist/cypress/config/index.js.map +1 -0
- package/dist/{cypress-config → cypress/config}/webpack-config.d.ts +1 -1
- package/dist/cypress/config/webpack-config.d.ts.map +1 -0
- package/dist/{cypress-config → cypress/config}/webpack-config.js +4 -4
- package/dist/cypress/config/webpack-config.js.map +1 -0
- package/dist/cypress/types/index.d.ts +9 -0
- package/dist/cypress/types/index.d.ts.map +1 -0
- package/dist/cypress/types/index.js +7 -0
- package/dist/cypress/types/index.js.map +1 -0
- package/dist/utils/find-up.js +4 -4
- package/dist/utils/find-up.js.map +1 -1
- package/dist/utils/get-package-data.d.ts.map +1 -1
- package/dist/utils/get-package-data.js +1 -28
- package/dist/utils/get-package-data.js.map +1 -1
- package/dist/utils/index.d.ts +0 -3
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +0 -3
- package/dist/utils/index.js.map +1 -1
- package/dist/webpack/configs/cache-config.d.ts.map +1 -1
- package/dist/webpack/configs/cache-config.js +14 -1
- package/dist/webpack/configs/cache-config.js.map +1 -1
- package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.d.ts.map +1 -1
- package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.js +11 -1
- package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.js.map +1 -1
- package/dist/webpack/configs/utils/get-web-components-version.d.ts.map +1 -1
- package/dist/webpack/configs/utils/get-web-components-version.js +7 -5
- package/dist/webpack/configs/utils/get-web-components-version.js.map +1 -1
- package/package.json +22 -20
- package/src/cli/commands/__tests__/build.test.ts +2 -1
- package/src/cli/commands/__tests__/clean.test.ts +2 -1
- package/src/cli/commands/__tests__/convert-eslint-config.test.ts +2 -1
- package/src/cli/commands/__tests__/init.test.ts +4 -3
- package/src/cli/commands/__tests__/install.test.ts +2 -1
- package/src/cli/commands/__tests__/kendo-ui-license.test.ts +3 -2
- package/src/cli/commands/__tests__/lint.test.ts +3 -1
- package/src/cli/commands/__tests__/mfe-check.test.ts +2 -1
- package/src/cli/commands/__tests__/mfe-generate-metadata.test.ts +2 -14
- package/src/cli/commands/__tests__/mfe-list.test.ts +2 -1
- package/src/cli/commands/__tests__/mfe-publish.test.ts +8 -7
- package/src/cli/commands/{run-task.test.ts → __tests__/run-task.test.ts} +8 -8
- package/src/cli/commands/__tests__/start.test.ts +2 -1
- package/src/cli/commands/build.ts +3 -16
- package/src/cli/commands/bundle-package.ts +3 -12
- package/src/cli/commands/clean.ts +2 -4
- package/src/cli/commands/convert-eslint-config.ts +2 -4
- package/src/cli/commands/eslint.ts +3 -10
- package/src/cli/commands/init.ts +3 -10
- package/src/cli/commands/install.ts +3 -12
- package/src/cli/commands/kendo-ui-license.ts +2 -4
- package/src/cli/commands/lint.ts +3 -15
- package/src/cli/commands/mfe-check.ts +3 -28
- package/src/cli/commands/mfe-generate-metadata.ts +4 -19
- package/src/cli/commands/mfe-list.ts +3 -23
- package/src/cli/commands/mfe-package-clean.ts +3 -27
- package/src/cli/commands/mfe-package-publish.ts +3 -46
- package/src/cli/commands/mfe-package-rollback.ts +3 -26
- package/src/cli/commands/mfe-publish.ts +11 -73
- package/src/cli/commands/mfe-purge-cache.ts +3 -27
- package/src/cli/commands/prepare-package.ts +3 -7
- package/src/cli/commands/registry/__tests__/command-registry.test.ts +13 -0
- package/src/cli/commands/registry/build.ts +16 -0
- package/src/cli/commands/registry/bundle-package.ts +13 -0
- package/src/cli/commands/registry/clean.ts +7 -0
- package/src/cli/commands/registry/command-registry.ts +98 -0
- package/src/cli/commands/registry/convert-eslint-config.ts +7 -0
- package/src/cli/commands/registry/define-entry.ts +11 -0
- package/src/cli/commands/registry/eslint.ts +12 -0
- package/src/cli/commands/registry/index.ts +2 -0
- package/src/cli/commands/registry/init.ts +10 -0
- package/src/cli/commands/registry/install.ts +12 -0
- package/src/cli/commands/registry/kendo-ui-license.ts +7 -0
- package/src/cli/commands/registry/lint.ts +17 -0
- package/src/cli/commands/registry/mfe-check.ts +28 -0
- package/src/cli/commands/registry/mfe-generate-metadata.ts +13 -0
- package/src/cli/commands/registry/mfe-list.ts +25 -0
- package/src/cli/commands/registry/mfe-package-clean.ts +27 -0
- package/src/cli/commands/registry/mfe-package-publish.ts +46 -0
- package/src/cli/commands/registry/mfe-package-rollback.ts +26 -0
- package/src/cli/commands/registry/mfe-publish.ts +55 -0
- package/src/cli/commands/registry/mfe-purge-cache.ts +27 -0
- package/src/cli/commands/registry/prepare-package.ts +8 -0
- package/src/cli/commands/registry/review.ts +11 -0
- package/src/cli/commands/registry/start.ts +14 -0
- package/src/cli/commands/registry/stylelint.ts +12 -0
- package/src/cli/commands/registry/styles-check.ts +4 -0
- package/src/cli/commands/registry/task.ts +12 -0
- package/src/cli/commands/registry/test-command.ts +19 -0
- package/src/cli/commands/registry/upload-sourcemaps.ts +14 -0
- package/src/cli/commands/review/__tests__/review.test.ts +2 -1
- package/src/cli/commands/review/review.ts +3 -11
- package/src/cli/commands/review/rules/require-compatible-launch-darkly-sdk.ts +7 -2
- package/src/cli/commands/review/types.ts +8 -3
- package/src/cli/commands/run-task.ts +3 -10
- package/src/cli/commands/start.ts +3 -14
- package/src/cli/commands/stylelint.ts +3 -10
- package/src/cli/commands/styles-check.ts +2 -1
- package/src/cli/commands/test/__tests__/tests.test.ts +2 -1
- package/src/cli/commands/test/tests.ts +3 -16
- package/src/cli/commands/types.ts +8 -6
- package/src/cli/commands/upload-sourcemaps.ts +3 -13
- package/src/cli/index.ts +21 -20
- package/src/cli/tasks/swc-compile-package/__tests__/swc-compile-package.test.ts +1 -8
- package/src/cli/tasks/swc-compile-package/swc-compile-package.ts +1 -11
- package/src/cli/utils/__tests__/bundle.test.ts +17 -0
- package/src/cli/utils/__tests__/check-startup-location.test.ts +5 -17
- package/src/cli/utils/__tests__/set-node-options.test.ts +5 -19
- package/src/cli/utils/bundle.ts +1 -1
- package/src/cli/utils/check-startup-location.ts +5 -3
- package/src/cli/utils/set-node-options.ts +3 -4
- package/src/{cypress-config → cypress/config}/__tests__/webpack-config.test.ts +6 -6
- package/src/{cypress-config → cypress/config}/webpack-config.ts +4 -4
- package/src/cypress/types/index.ts +11 -0
- package/src/utils/__tests__/get-package-data.test.ts +26 -97
- package/src/utils/find-up.ts +1 -1
- package/src/utils/get-package-data.ts +2 -27
- package/src/utils/index.ts +0 -3
- package/src/webpack/configs/cache-config.ts +10 -1
- package/src/webpack/configs/utils/__tests__/get-launchdarkly-sdk-version.test.ts +8 -20
- package/src/webpack/configs/utils/__tests__/get-web-components-version.test.ts +10 -30
- package/src/webpack/configs/utils/get-launchdarkly-sdk-version.ts +12 -2
- package/src/webpack/configs/utils/get-web-components-version.ts +5 -8
- package/dist/cli/commands/get-command.d.ts +0 -4
- package/dist/cli/commands/get-command.d.ts.map +0 -1
- package/dist/cli/commands/get-command.js +0 -68
- package/dist/cli/commands/get-command.js.map +0 -1
- package/dist/cli/commands/index.d.ts +0 -15
- package/dist/cli/commands/index.d.ts.map +0 -1
- package/dist/cli/commands/index.js +0 -32
- package/dist/cli/commands/index.js.map +0 -1
- package/dist/cli/commands/run-task.test.d.ts +0 -2
- package/dist/cli/commands/run-task.test.d.ts.map +0 -1
- package/dist/cli/commands/run-task.test.js +0 -65
- package/dist/cli/commands/run-task.test.js.map +0 -1
- package/dist/cypress-config/index.d.ts.map +0 -1
- package/dist/cypress-config/index.js.map +0 -1
- package/dist/cypress-config/webpack-config.d.ts.map +0 -1
- package/dist/cypress-config/webpack-config.js.map +0 -1
- package/dist/utils/find-package-lock.d.ts +0 -2
- package/dist/utils/find-package-lock.d.ts.map +0 -1
- package/dist/utils/find-package-lock.js +0 -26
- package/dist/utils/find-package-lock.js.map +0 -1
- package/dist/utils/get-package-version.d.ts +0 -2
- package/dist/utils/get-package-version.d.ts.map +0 -1
- package/dist/utils/get-package-version.js +0 -26
- package/dist/utils/get-package-version.js.map +0 -1
- package/dist/utils/resolve-package-lock-entry.d.ts +0 -11
- package/dist/utils/resolve-package-lock-entry.d.ts.map +0 -1
- package/dist/utils/resolve-package-lock-entry.js +0 -21
- package/dist/utils/resolve-package-lock-entry.js.map +0 -1
- package/src/cli/commands/__tests__/get-command.test.ts +0 -19
- package/src/cli/commands/get-command.ts +0 -59
- package/src/cli/commands/index.ts +0 -14
- package/src/utils/__tests__/find-package-lock.test.ts +0 -35
- package/src/utils/__tests__/get-package-version.test.ts +0 -129
- package/src/utils/__tests__/resolve-package-lock-entry.test.ts +0 -99
- package/src/utils/find-package-lock.ts +0 -10
- package/src/utils/get-package-version.ts +0 -21
- package/src/utils/resolve-package-lock-entry.ts +0 -25
- /package/dist/{cypress-config → cypress/config}/index.d.ts +0 -0
- /package/dist/{cypress-config → cypress/config}/index.js +0 -0
- /package/src/{cypress-config → cypress/config}/index.ts +0 -0
|
@@ -2,13 +2,8 @@
|
|
|
2
2
|
import { log, logErrors } from '../../utils';
|
|
3
3
|
import { SwcCompilePackage, TscCompile, TscCompilePackage } from '../tasks';
|
|
4
4
|
import { Task } from '../tasks/task';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
const options = {
|
|
8
|
-
_: { description: '<taskName> [taskArgs...]', array: true, string: true },
|
|
9
|
-
taskName: { string: true, hidden: true },
|
|
10
|
-
taskArgs: { array: true, string: true, hidden: true },
|
|
11
|
-
} satisfies CommandOptions;
|
|
5
|
+
import type { entry } from './registry/task';
|
|
6
|
+
import { Command } from './types';
|
|
12
7
|
|
|
13
8
|
const tasks: Record<string, new (args: { [key: string]: unknown }) => Task> = {
|
|
14
9
|
'tsc-compile-package': TscCompilePackage,
|
|
@@ -16,9 +11,7 @@ const tasks: Record<string, new (args: { [key: string]: unknown }) => Task> = {
|
|
|
16
11
|
'tsc-compile': TscCompile,
|
|
17
12
|
};
|
|
18
13
|
|
|
19
|
-
export class RunTask extends Command<typeof
|
|
20
|
-
static readonly options = options;
|
|
21
|
-
|
|
14
|
+
export class RunTask extends Command<typeof entry> {
|
|
22
15
|
@logErrors
|
|
23
16
|
async execute() {
|
|
24
17
|
const { _ = [], taskName = this.args._?.[0], taskArgs = [], ...restOptions } = this.args;
|
|
@@ -8,15 +8,8 @@ import {
|
|
|
8
8
|
typeCheck,
|
|
9
9
|
watchStdout,
|
|
10
10
|
} from '../utils';
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
const options = {
|
|
14
|
-
codeCoverage: { boolean: true, description: 'Instrument code for coverage analysis?' },
|
|
15
|
-
config: { string: true, hidden: true, description: 'Use specified configuration' },
|
|
16
|
-
ignore: { array: true, string: true, description: 'Packages to skip' },
|
|
17
|
-
scope: { array: true, string: true, description: 'Packages to run and watch' },
|
|
18
|
-
useTsc: { boolean: true, description: 'Use tsc to compile packages?' },
|
|
19
|
-
} satisfies CommandOptions;
|
|
11
|
+
import type { entry } from './registry/start';
|
|
12
|
+
import { Command } from './types';
|
|
20
13
|
|
|
21
14
|
enum StartProcesses {
|
|
22
15
|
Precompile,
|
|
@@ -29,11 +22,7 @@ enum StartProcesses {
|
|
|
29
22
|
BundlePackage,
|
|
30
23
|
}
|
|
31
24
|
|
|
32
|
-
export class Start extends Command<typeof
|
|
33
|
-
static readonly description = 'Run project in development mode';
|
|
34
|
-
static readonly greedy = true;
|
|
35
|
-
static readonly options = options;
|
|
36
|
-
|
|
25
|
+
export class Start extends Command<typeof entry> {
|
|
37
26
|
@logErrors
|
|
38
27
|
async execute() {
|
|
39
28
|
checkArgs(this.args, { obsolete: ['--esbuild', '--experimental-bundlers'] });
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
2
|
import { logErrors } from '../../utils';
|
|
3
3
|
import { stylelint } from '../utils/stylelint';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
const options = {
|
|
7
|
-
_: { description: '[paths...]', array: true, string: true },
|
|
8
|
-
fix: { boolean: true, hidden: true },
|
|
9
|
-
paths: { array: true, string: true, hidden: true },
|
|
10
|
-
} satisfies CommandOptions;
|
|
11
|
-
|
|
12
|
-
export class Stylelint extends Command<typeof options> {
|
|
13
|
-
static readonly options = options;
|
|
4
|
+
import type { entry } from './registry/stylelint';
|
|
5
|
+
import { Command } from './types';
|
|
14
6
|
|
|
7
|
+
export class Stylelint extends Command<typeof entry> {
|
|
15
8
|
@logErrors
|
|
16
9
|
async execute() {
|
|
17
10
|
await stylelint({ fix: this.args.fix, paths: this.paths });
|
|
@@ -2,6 +2,7 @@ import fs from 'fs';
|
|
|
2
2
|
import { glob } from 'glob';
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import { getFolders, isBundle, isLegacy, isStyleCheckDisabled, log, logErrors } from '../../utils';
|
|
5
|
+
import type { entry } from './registry/styles-check';
|
|
5
6
|
import { Command } from './types';
|
|
6
7
|
|
|
7
8
|
const patterns = [
|
|
@@ -10,7 +11,7 @@ const patterns = [
|
|
|
10
11
|
"@import '~@servicetitan/design-system/dist/system.min.css';",
|
|
11
12
|
];
|
|
12
13
|
|
|
13
|
-
export class StylesCheck extends Command {
|
|
14
|
+
export class StylesCheck extends Command<typeof entry> {
|
|
14
15
|
@logErrors
|
|
15
16
|
async execute() {
|
|
16
17
|
if (isLegacy() || !isBundle()) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getConfiguration } from '../../../../utils';
|
|
2
|
+
import { entry } from '../../registry/test-command';
|
|
2
3
|
import { Jest, Vitest } from '../runners';
|
|
3
4
|
import { Tests } from '../tests';
|
|
4
5
|
|
|
@@ -23,7 +24,7 @@ describe(`[startup] ${Tests.name}`, () => {
|
|
|
23
24
|
const subject = async () => new Tests(args).execute();
|
|
24
25
|
|
|
25
26
|
test('command is greedy', () => {
|
|
26
|
-
expect(
|
|
27
|
+
expect(entry.greedy).toBe(true);
|
|
27
28
|
});
|
|
28
29
|
|
|
29
30
|
function itRunsJest() {
|
|
@@ -1,28 +1,15 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
2
|
import { Config } from '@jest/types';
|
|
3
3
|
import { getConfiguration, logErrors } from '../../../utils';
|
|
4
|
-
import {
|
|
4
|
+
import type { entry } from '../registry/test-command';
|
|
5
|
+
import { Command } from '../types';
|
|
5
6
|
import { Jest, Vitest } from './runners';
|
|
6
7
|
|
|
7
|
-
const options = {
|
|
8
|
-
_: { description: '[runnerArgs...]', array: true, string: true },
|
|
9
|
-
runner: {
|
|
10
|
-
choices: ['jest', 'vitest'] as const,
|
|
11
|
-
description: 'Test runner',
|
|
12
|
-
defaultDescription: 'jest',
|
|
13
|
-
},
|
|
14
|
-
runnerArgs: { array: true, string: true, hidden: true },
|
|
15
|
-
} satisfies CommandOptions;
|
|
16
|
-
|
|
17
8
|
/**
|
|
18
9
|
* This class is named "Tests" instead of "Test" because the corresponding
|
|
19
10
|
* "test.ts" would be interpreted as a test file.
|
|
20
11
|
*/
|
|
21
|
-
export class Tests extends Command<typeof
|
|
22
|
-
static readonly description = 'Run tests';
|
|
23
|
-
static readonly greedy = true;
|
|
24
|
-
static readonly options = options;
|
|
25
|
-
|
|
12
|
+
export class Tests extends Command<typeof entry, Config.Argv> {
|
|
26
13
|
@logErrors
|
|
27
14
|
async execute() {
|
|
28
15
|
const {
|
|
@@ -49,13 +49,15 @@ export type InferArgs<T extends CommandOptions, U = unknown> = Expand<
|
|
|
49
49
|
> &
|
|
50
50
|
U;
|
|
51
51
|
|
|
52
|
-
export
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
export interface CommandEntry {
|
|
53
|
+
description?: string;
|
|
54
|
+
greedy?: boolean;
|
|
55
|
+
allowRunFromGlobal?: boolean;
|
|
56
|
+
options?: CommandOptions;
|
|
57
|
+
}
|
|
57
58
|
|
|
58
|
-
|
|
59
|
+
export abstract class Command<T extends CommandEntry = CommandEntry, U = unknown> {
|
|
60
|
+
constructor(protected readonly args: InferArgs<NonNullable<T['options']>, U>) {}
|
|
59
61
|
|
|
60
62
|
abstract execute(): Promise<void>;
|
|
61
63
|
}
|
|
@@ -3,24 +3,14 @@ import { execSync } from 'child_process';
|
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import { getTsConfig, isWebComponent, log, logErrors, readJson } from '../../utils';
|
|
5
5
|
import { TSConfig } from '../utils';
|
|
6
|
-
import {
|
|
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;
|
|
6
|
+
import type { entry } from './registry/upload-sourcemaps';
|
|
7
|
+
import { Command } from './types';
|
|
17
8
|
|
|
18
9
|
interface PackageJson {
|
|
19
10
|
name: string;
|
|
20
11
|
}
|
|
21
12
|
|
|
22
|
-
export class UploadSourcemaps extends Command<typeof
|
|
23
|
-
static readonly options = options;
|
|
13
|
+
export class UploadSourcemaps extends Command<typeof entry> {
|
|
24
14
|
#outDir?: string;
|
|
25
15
|
#packageJson?: PackageJson;
|
|
26
16
|
|
package/src/cli/index.ts
CHANGED
|
@@ -5,7 +5,8 @@ import path from 'path';
|
|
|
5
5
|
import yargs from 'yargs';
|
|
6
6
|
import { hideBin } from 'yargs/helpers';
|
|
7
7
|
import { CommandName, getStartupVersion, log } from '../utils';
|
|
8
|
-
import {
|
|
8
|
+
import { commandRegistry } from './commands/registry';
|
|
9
|
+
import type { CommandOptions } from './commands/types';
|
|
9
10
|
import { checkStartupLocation, setNodeOptions } from './utils';
|
|
10
11
|
|
|
11
12
|
const yargsInstance = yargs(hideBin(process.argv));
|
|
@@ -32,17 +33,15 @@ Object.values(CommandName)
|
|
|
32
33
|
.parse();
|
|
33
34
|
|
|
34
35
|
function addCommand(name: CommandName, y: typeof yargs) {
|
|
35
|
-
const
|
|
36
|
+
const entry = commandRegistry[name];
|
|
37
|
+
|
|
36
38
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
37
|
-
const { description, options: { _, ...options } = {} } =
|
|
39
|
+
const { description, options: { _, ...options } = {} } = entry;
|
|
38
40
|
const nameWithArgs = name + (_?.description ? ` ${_.description}` : '');
|
|
39
|
-
const groupedOptions = Object.entries(options).reduce(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
{} as NonNullable<typeof klass.options>
|
|
45
|
-
);
|
|
41
|
+
const groupedOptions = Object.entries(options).reduce((result, [key, value]) => {
|
|
42
|
+
result[kebabCase(key)] = { group: 'Command Options:', ...value };
|
|
43
|
+
return result;
|
|
44
|
+
}, {} as CommandOptions);
|
|
46
45
|
const handler = (argv: any) => handleCommand(name, argv);
|
|
47
46
|
if (description) {
|
|
48
47
|
y.command(nameWithArgs, description, groupedOptions, handler);
|
|
@@ -52,24 +51,26 @@ function addCommand(name: CommandName, y: typeof yargs) {
|
|
|
52
51
|
return y;
|
|
53
52
|
}
|
|
54
53
|
|
|
55
|
-
function handleCommand(name: CommandName, argv: any) {
|
|
56
|
-
const
|
|
57
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
58
|
-
const command = new Command({ ...argv, _: argv._.slice(1) });
|
|
54
|
+
async function handleCommand(name: CommandName, argv: any) {
|
|
55
|
+
const entry = commandRegistry[name];
|
|
59
56
|
|
|
60
57
|
checkNodeVersion();
|
|
61
|
-
checkStartupLocation(name,
|
|
58
|
+
checkStartupLocation(name, entry);
|
|
62
59
|
|
|
63
|
-
if (setNodeOptions(name,
|
|
60
|
+
if (setNodeOptions(name, entry)) {
|
|
64
61
|
log.debug('run', `Running ${name} in child process with amended NODE_OPTIONS`);
|
|
65
62
|
execa(process.argv[0], process.argv.slice(1), { stdio: 'inherit' }).catch(reason => {
|
|
66
63
|
process.exit(reason.exitCode);
|
|
67
64
|
});
|
|
68
|
-
|
|
69
|
-
command.execute().catch(() => {
|
|
70
|
-
process.exit(1);
|
|
71
|
-
});
|
|
65
|
+
return;
|
|
72
66
|
}
|
|
67
|
+
|
|
68
|
+
const CommandClass = await entry.load();
|
|
69
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
70
|
+
const command = new CommandClass({ ...argv, _: argv._.slice(1) });
|
|
71
|
+
command.execute().catch(() => {
|
|
72
|
+
process.exit(1);
|
|
73
|
+
});
|
|
73
74
|
}
|
|
74
75
|
|
|
75
76
|
function checkNodeVersion() {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { swcDir } from '@swc/cli';
|
|
2
|
-
import debounce from 'debounce';
|
|
3
2
|
import deepmerge from 'deepmerge';
|
|
4
3
|
import { fs, vol } from 'memfs';
|
|
5
4
|
import { getSwcCompilePackageConfiguration, log } from '../../../../utils';
|
|
@@ -7,7 +6,6 @@ import { TSConfig } from '../../../utils';
|
|
|
7
6
|
import { getSwcOptions } from '../get-swc-options';
|
|
8
7
|
import { SwcCompilePackage } from '../swc-compile-package';
|
|
9
8
|
|
|
10
|
-
jest.mock('debounce', () => jest.fn());
|
|
11
9
|
jest.mock('fs', () => fs);
|
|
12
10
|
jest.mock('@swc/cli', () => ({
|
|
13
11
|
swcDir: jest.fn(),
|
|
@@ -194,12 +192,7 @@ describe(`[startup] ${SwcCompilePackage.name} task`, () => {
|
|
|
194
192
|
});
|
|
195
193
|
|
|
196
194
|
describe('in watch mode', () => {
|
|
197
|
-
beforeEach(() =>
|
|
198
|
-
watch = true;
|
|
199
|
-
jest.mocked(debounce).mockImplementation((fn: Function) => {
|
|
200
|
-
return ((...args: any[]) => fn(...args)) as any;
|
|
201
|
-
});
|
|
202
|
-
});
|
|
195
|
+
beforeEach(() => (watch = true));
|
|
203
196
|
|
|
204
197
|
test('calls swcDir with watch=true', () => {
|
|
205
198
|
subject();
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Options } from '@swc/cli';
|
|
2
2
|
import { swcDir } from '@swc/cli';
|
|
3
|
-
import debounce from 'debounce';
|
|
4
3
|
import deepmerge from 'deepmerge';
|
|
5
4
|
import { getFolders, getSwcCompilePackageConfiguration, getTsConfig, log } from '../../../utils';
|
|
6
5
|
import { TSConfig } from '../../utils';
|
|
@@ -26,21 +25,12 @@ export class SwcCompilePackage extends Task {
|
|
|
26
25
|
/* istanbul ignore next: debug only */
|
|
27
26
|
log.debug('swc-compile-package:config', () => JSON.stringify(config, null, 2));
|
|
28
27
|
|
|
29
|
-
/*
|
|
30
|
-
* @swc/cli@0.5.0 doesn't implement "ignore" in watch mode so debounce
|
|
31
|
-
* noisy output. See https://servicetitan.atlassian.net/browse/FAR-1592
|
|
32
|
-
* and DEVELOPER_NOTES in file://./../../../package.json
|
|
33
|
-
*/
|
|
34
|
-
const logSuccessResults = this.watch
|
|
35
|
-
? debounce(this.logCompletionResults.bind(this), 200)
|
|
36
|
-
: this.logCompletionResults.bind(this);
|
|
37
|
-
|
|
38
28
|
return new Promise((resolve, reject) => {
|
|
39
29
|
swcDir({
|
|
40
30
|
...config,
|
|
41
31
|
callbacks: {
|
|
42
32
|
onSuccess: (e: { duration: number }) => {
|
|
43
|
-
|
|
33
|
+
this.logCompletionResults(this.taskTimer.add(e.duration));
|
|
44
34
|
if (!this.watch) {
|
|
45
35
|
resolve();
|
|
46
36
|
}
|
|
@@ -437,6 +437,23 @@ describe('[startup] Cli Utils', () => {
|
|
|
437
437
|
);
|
|
438
438
|
});
|
|
439
439
|
|
|
440
|
+
describe('with PORT environment variable', () => {
|
|
441
|
+
const port = '3456';
|
|
442
|
+
|
|
443
|
+
beforeEach(() => (process.env.PORT = port));
|
|
444
|
+
|
|
445
|
+
afterEach(() => delete process.env.PORT);
|
|
446
|
+
|
|
447
|
+
test('uses environment variable', async () => {
|
|
448
|
+
await subject();
|
|
449
|
+
|
|
450
|
+
expect(WebpackDevServer).toHaveBeenCalledWith(
|
|
451
|
+
expect.objectContaining({ port: Number(port) }),
|
|
452
|
+
expect.anything()
|
|
453
|
+
);
|
|
454
|
+
});
|
|
455
|
+
});
|
|
456
|
+
|
|
440
457
|
describe('with "emitExposedDependencies"', () => {
|
|
441
458
|
beforeEach(() => (options = { emitExposedDependencies: true }));
|
|
442
459
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { log } from '../../../utils';
|
|
2
|
-
import {
|
|
2
|
+
import { CommandEntry } from '../../commands/types';
|
|
3
3
|
import { checkStartupLocation } from '../check-startup-location';
|
|
4
4
|
import { npmGetProjectRoot } from '../cli-npm';
|
|
5
5
|
|
|
@@ -9,24 +9,18 @@ jest.mock('../../../utils', () => ({
|
|
|
9
9
|
}));
|
|
10
10
|
jest.mock('../cli-npm');
|
|
11
11
|
|
|
12
|
-
class TestCommand extends Command {
|
|
13
|
-
async execute() {
|
|
14
|
-
// no-op
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
12
|
describe('[startup] Cli Utils', () => {
|
|
19
13
|
describe(checkStartupLocation.name, () => {
|
|
20
14
|
const originalSkipLocationCheck = process.env.SKIP_STARTUP_LOCATION_CHECK;
|
|
21
15
|
const commandName: any = 'test';
|
|
22
|
-
let
|
|
16
|
+
let entry: CommandEntry | undefined;
|
|
23
17
|
|
|
24
18
|
beforeEach(() => {
|
|
25
19
|
jest.clearAllMocks();
|
|
26
20
|
jest.mocked(npmGetProjectRoot).mockReturnValue(process.cwd());
|
|
27
21
|
jest.spyOn(process, 'exit').mockImplementation(jest.fn() as any);
|
|
28
22
|
delete process.env.SKIP_STARTUP_LOCATION_CHECK;
|
|
29
|
-
|
|
23
|
+
entry = undefined;
|
|
30
24
|
});
|
|
31
25
|
|
|
32
26
|
afterAll(() => {
|
|
@@ -35,7 +29,7 @@ describe('[startup] Cli Utils', () => {
|
|
|
35
29
|
}
|
|
36
30
|
});
|
|
37
31
|
|
|
38
|
-
const subject = () => checkStartupLocation(commandName,
|
|
32
|
+
const subject = () => checkStartupLocation(commandName, entry);
|
|
39
33
|
|
|
40
34
|
function itDoesNothing() {
|
|
41
35
|
test('does nothing', () => {
|
|
@@ -67,13 +61,7 @@ describe('[startup] Cli Utils', () => {
|
|
|
67
61
|
});
|
|
68
62
|
|
|
69
63
|
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
|
-
});
|
|
64
|
+
beforeEach(() => (entry = { allowRunFromGlobal: true }));
|
|
77
65
|
|
|
78
66
|
itDoesNothing();
|
|
79
67
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import os from 'os';
|
|
2
2
|
import { getConfigurationSafe } from '../../../utils';
|
|
3
|
-
import {
|
|
3
|
+
import { CommandEntry } from '../../commands/types';
|
|
4
4
|
import { setNodeOptions } from '../set-node-options';
|
|
5
5
|
|
|
6
6
|
jest.mock('os', () => ({
|
|
@@ -12,37 +12,23 @@ jest.mock('../../../utils', () => ({
|
|
|
12
12
|
getConfigurationSafe: jest.fn(() => ({})),
|
|
13
13
|
}));
|
|
14
14
|
|
|
15
|
-
class MockCommand extends Command {
|
|
16
|
-
static get greedy() {
|
|
17
|
-
return true;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
async execute() {
|
|
21
|
-
return Promise.resolve();
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
15
|
describe(`[startup] utils:${setNodeOptions.name}`, () => {
|
|
26
16
|
const MB = 1024 * 1024;
|
|
27
17
|
const DEFAULT_SIZE = 8192;
|
|
28
18
|
const originalNodeOptions = process.env.NODE_OPTIONS;
|
|
29
19
|
const maxOldSpaceSize = `--max_old_space_size=${DEFAULT_SIZE}`;
|
|
30
20
|
const commandName: any = 'mock';
|
|
31
|
-
|
|
32
|
-
let greedy: boolean;
|
|
21
|
+
let entry: CommandEntry | undefined;
|
|
33
22
|
|
|
34
23
|
beforeEach(() => {
|
|
35
|
-
greedy = true;
|
|
36
24
|
delete process.env.NODE_OPTIONS;
|
|
37
25
|
(os.totalmem as jest.Mock).mockReturnValue(16384 * MB);
|
|
38
|
-
|
|
39
|
-
() => greedy
|
|
40
|
-
);
|
|
26
|
+
entry = { greedy: true };
|
|
41
27
|
});
|
|
42
28
|
|
|
43
29
|
afterAll(() => (process.env.NODE_OPTIONS = originalNodeOptions));
|
|
44
30
|
|
|
45
|
-
const subject = () => setNodeOptions(commandName,
|
|
31
|
+
const subject = () => setNodeOptions(commandName, entry);
|
|
46
32
|
|
|
47
33
|
test(`returns true and adds ${maxOldSpaceSize} to process.env.NODE_OPTIONS`, () => {
|
|
48
34
|
expect(subject()).toBe(true);
|
|
@@ -51,7 +37,7 @@ describe(`[startup] utils:${setNodeOptions.name}`, () => {
|
|
|
51
37
|
});
|
|
52
38
|
|
|
53
39
|
describe('when the command is not greedy', () => {
|
|
54
|
-
beforeEach(() => (
|
|
40
|
+
beforeEach(() => (entry = undefined));
|
|
55
41
|
|
|
56
42
|
test('returns false and does not set NODE_OPTIONS', () => {
|
|
57
43
|
expect(subject()).toBe(false);
|
package/src/cli/utils/bundle.ts
CHANGED
|
@@ -157,7 +157,7 @@ async function runServe({ devServer = {}, ...config }: Configuration) {
|
|
|
157
157
|
const compiler = createWebpackCompiler(config);
|
|
158
158
|
const host = devServer.host ?? 'localhost';
|
|
159
159
|
const port = await getPortPromise({
|
|
160
|
-
port: Number(devServer.port) || 8080,
|
|
160
|
+
port: Number(process.env.PORT) || Number(devServer.port) || 8080,
|
|
161
161
|
host,
|
|
162
162
|
});
|
|
163
163
|
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { CommandName, log } from '../../utils';
|
|
2
|
-
import {
|
|
2
|
+
import { CommandEntry } from '../commands/types';
|
|
3
3
|
import { npmGetProjectRoot } from './cli-npm';
|
|
4
4
|
|
|
5
|
-
export function checkStartupLocation(
|
|
6
|
-
|
|
5
|
+
export function checkStartupLocation(
|
|
6
|
+
commandName: CommandName,
|
|
7
|
+
{ allowRunFromGlobal }: CommandEntry = {}
|
|
8
|
+
) {
|
|
7
9
|
if (allowRunFromGlobal || process.env.SKIP_STARTUP_LOCATION_CHECK) {
|
|
8
10
|
return;
|
|
9
11
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import os from 'os';
|
|
2
2
|
import { CommandName, getConfigurationSafe } from '../../utils';
|
|
3
|
-
import {
|
|
3
|
+
import { CommandEntry } from '../commands/types';
|
|
4
4
|
|
|
5
5
|
const MAX_OLD_SPACE_SIZE_OPTION = 'max_old_space_size';
|
|
6
6
|
const DEFAULT_MAX_OLD_SPACE_SIZE_MB = 8192;
|
|
@@ -8,10 +8,10 @@ const MIN_REMAINING_MEMORY_MB = 512;
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Apply global defaults and custom CLI configuration to process.env.NODE_OPTIONS
|
|
11
|
-
* @param
|
|
11
|
+
* @param entry - the command's registry entry
|
|
12
12
|
* @returns whether process's NODE_OPTIONS were changed
|
|
13
13
|
*/
|
|
14
|
-
export function setNodeOptions(commandName: CommandName,
|
|
14
|
+
export function setNodeOptions(commandName: CommandName, { greedy }: CommandEntry = {}) {
|
|
15
15
|
const cliConfig = getConfigurationSafe();
|
|
16
16
|
const cmdConfig = cliConfig[commandName];
|
|
17
17
|
|
|
@@ -25,7 +25,6 @@ export function setNodeOptions(commandName: CommandName, command: Command) {
|
|
|
25
25
|
}, oldNodeOptions)
|
|
26
26
|
.trim();
|
|
27
27
|
|
|
28
|
-
const greedy = (command.constructor as typeof Command).greedy;
|
|
29
28
|
const newNodeOptions = ensureMaxOldSpaceSize(mergedOptions, greedy);
|
|
30
29
|
if (newNodeOptions !== oldNodeOptions) {
|
|
31
30
|
process.env.NODE_OPTIONS = newNodeOptions;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { fs, vol } from 'memfs';
|
|
2
|
-
import { getSwcOptions } from '
|
|
3
|
-
import { TSConfig } from '
|
|
4
|
-
import { getBaseTsConfig } from '
|
|
5
|
-
import { Overrides, rulesConfig } from '
|
|
2
|
+
import { getSwcOptions } from '../../../cli/tasks';
|
|
3
|
+
import { TSConfig } from '../../../cli/utils';
|
|
4
|
+
import { getBaseTsConfig } from '../../../utils';
|
|
5
|
+
import { Overrides, rulesConfig } from '../../../webpack/configs';
|
|
6
6
|
import { webpackConfig } from '../webpack-config';
|
|
7
7
|
|
|
8
8
|
jest.mock('fs', () => fs);
|
|
9
|
-
jest.mock('
|
|
10
|
-
jest.mock('
|
|
9
|
+
jest.mock('../../../webpack/configs');
|
|
10
|
+
jest.mock('../../../cli/tasks');
|
|
11
11
|
|
|
12
12
|
describe(`[startup/cypress-config] ${webpackConfig.name}`, () => {
|
|
13
13
|
const mockRules: any[] = [
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { inspect } from 'node:util';
|
|
2
2
|
import type { Configuration } from 'webpack';
|
|
3
3
|
import merge from 'webpack-merge';
|
|
4
|
-
import { getSwcOptions } from '
|
|
5
|
-
import { TSConfig } from '
|
|
6
|
-
import { getTsConfigWithFallback, log } from '
|
|
7
|
-
import { Context, Overrides, rulesConfig } from '
|
|
4
|
+
import { getSwcOptions } from '../../cli/tasks';
|
|
5
|
+
import { TSConfig } from '../../cli/utils';
|
|
6
|
+
import { getTsConfigWithFallback, log } from '../../utils';
|
|
7
|
+
import { Context, Overrides, rulesConfig } from '../../webpack/configs';
|
|
8
8
|
|
|
9
9
|
export function webpackConfig(overrides?: Overrides): Configuration {
|
|
10
10
|
const context = getContext();
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// @ts-expect-error Module is only exported, not used in this project
|
|
2
|
+
import type { mount } from 'cypress/react';
|
|
3
|
+
|
|
4
|
+
declare global {
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
6
|
+
namespace Cypress {
|
|
7
|
+
interface Chainable {
|
|
8
|
+
mount: typeof mount;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|