@servicetitan/startup 33.1.1 → 34.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/commands/build.d.ts +48 -22
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +72 -52
- package/dist/cli/commands/build.js.map +1 -1
- package/dist/cli/commands/bundle-package.d.ts +54 -10
- package/dist/cli/commands/bundle-package.d.ts.map +1 -1
- package/dist/cli/commands/bundle-package.js +40 -0
- package/dist/cli/commands/bundle-package.js.map +1 -1
- package/dist/cli/commands/clean.d.ts +4 -0
- package/dist/cli/commands/clean.d.ts.map +1 -1
- package/dist/cli/commands/clean.js +50 -16
- package/dist/cli/commands/clean.js.map +1 -1
- package/dist/cli/commands/convert-eslint-config.d.ts +1 -1
- package/dist/cli/commands/convert-eslint-config.d.ts.map +1 -1
- package/dist/cli/commands/convert-eslint-config.js +2 -15
- package/dist/cli/commands/convert-eslint-config.js.map +1 -1
- package/dist/cli/commands/eslint.d.ts +29 -7
- package/dist/cli/commands/eslint.d.ts.map +1 -1
- package/dist/cli/commands/eslint.js +18 -6
- package/dist/cli/commands/eslint.js.map +1 -1
- package/dist/cli/commands/get-command.d.ts.map +1 -1
- package/dist/cli/commands/get-command.js +6 -0
- package/dist/cli/commands/get-command.js.map +1 -1
- package/dist/cli/commands/index.d.ts +2 -2
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +2 -2
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.d.ts +10 -6
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +8 -6
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/install.d.ts +27 -15
- package/dist/cli/commands/install.d.ts.map +1 -1
- package/dist/cli/commands/install.js +18 -16
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/kendo-ui-license.d.ts +1 -0
- package/dist/cli/commands/kendo-ui-license.d.ts.map +1 -1
- package/dist/cli/commands/kendo-ui-license.js +1 -0
- package/dist/cli/commands/kendo-ui-license.js.map +1 -1
- package/dist/cli/commands/lint.d.ts +51 -17
- package/dist/cli/commands/lint.d.ts.map +1 -1
- package/dist/cli/commands/lint.js +36 -26
- package/dist/cli/commands/lint.js.map +1 -1
- package/dist/cli/commands/mfe-check.d.ts +52 -0
- package/dist/cli/commands/mfe-check.d.ts.map +1 -0
- package/dist/cli/commands/mfe-check.js +145 -0
- package/dist/cli/commands/mfe-check.js.map +1 -0
- package/dist/cli/commands/mfe-generate-metadata.d.ts +20 -0
- package/dist/cli/commands/mfe-generate-metadata.d.ts.map +1 -0
- package/dist/cli/commands/mfe-generate-metadata.js +93 -0
- package/dist/cli/commands/mfe-generate-metadata.js.map +1 -0
- package/dist/cli/commands/mfe-list.d.ts +52 -15
- package/dist/cli/commands/mfe-list.d.ts.map +1 -1
- package/dist/cli/commands/mfe-list.js +42 -29
- package/dist/cli/commands/mfe-list.js.map +1 -1
- package/dist/cli/commands/mfe-package-clean.d.ts +34 -15
- package/dist/cli/commands/mfe-package-clean.d.ts.map +1 -1
- package/dist/cli/commands/mfe-package-clean.js +43 -34
- package/dist/cli/commands/mfe-package-clean.js.map +1 -1
- package/dist/cli/commands/mfe-package-publish.d.ts +60 -22
- package/dist/cli/commands/mfe-package-publish.d.ts.map +1 -1
- package/dist/cli/commands/mfe-package-publish.js +137 -78
- package/dist/cli/commands/mfe-package-publish.js.map +1 -1
- package/dist/cli/commands/mfe-package-rollback.d.ts +40 -0
- package/dist/cli/commands/mfe-package-rollback.d.ts.map +1 -0
- package/dist/cli/commands/mfe-package-rollback.js +119 -0
- package/dist/cli/commands/mfe-package-rollback.js.map +1 -0
- package/dist/cli/commands/mfe-publish.d.ts +36 -11
- package/dist/cli/commands/mfe-publish.d.ts.map +1 -1
- package/dist/cli/commands/mfe-publish.js +72 -22
- package/dist/cli/commands/mfe-publish.js.map +1 -1
- package/dist/cli/commands/prepare-package.d.ts +14 -5
- package/dist/cli/commands/prepare-package.d.ts.map +1 -1
- package/dist/cli/commands/prepare-package.js +20 -0
- package/dist/cli/commands/prepare-package.js.map +1 -1
- package/dist/cli/commands/review/review.d.ts +17 -8
- package/dist/cli/commands/review/review.d.ts.map +1 -1
- package/dist/cli/commands/review/review.js +16 -21
- package/dist/cli/commands/review/review.js.map +1 -1
- package/dist/cli/commands/review/rules/index.d.ts.map +1 -1
- package/dist/cli/commands/review/rules/index.js +3 -1
- package/dist/cli/commands/review/rules/index.js.map +1 -1
- package/dist/cli/commands/review/rules/no-deprecated-content-base.js.map +1 -1
- package/dist/cli/commands/review/rules/prefer-open-ended-peer-dependencies.js.map +1 -1
- package/dist/cli/commands/review/rules/require-compatible-launch-darkly-sdk.js +4 -4
- package/dist/cli/commands/review/rules/require-compatible-launch-darkly-sdk.js.map +1 -1
- package/dist/cli/commands/review/rules/require-one-collection-version.js +1 -2
- package/dist/cli/commands/review/rules/require-one-collection-version.js.map +1 -1
- package/dist/cli/commands/review/rules/require-one-uikit-version.d.ts.map +1 -1
- package/dist/cli/commands/review/rules/require-one-uikit-version.js +1 -0
- package/dist/cli/commands/review/rules/require-one-uikit-version.js.map +1 -1
- package/dist/cli/commands/review/rules/require-project-version-in-root-node-modules.d.ts.map +1 -1
- package/dist/cli/commands/review/rules/require-project-version-in-root-node-modules.js +8 -8
- package/dist/cli/commands/review/rules/require-project-version-in-root-node-modules.js.map +1 -1
- package/dist/cli/commands/review/rules/require-tsconfig-references.d.ts +24 -0
- package/dist/cli/commands/review/rules/require-tsconfig-references.d.ts.map +1 -0
- package/dist/cli/commands/review/rules/require-tsconfig-references.js +146 -0
- package/dist/cli/commands/review/rules/require-tsconfig-references.js.map +1 -0
- package/dist/cli/commands/review/utils/collate-dependencies.js +1 -3
- package/dist/cli/commands/review/utils/collate-dependencies.js.map +1 -1
- package/dist/cli/commands/review/utils/compare-version.js +2 -2
- package/dist/cli/commands/review/utils/compare-version.js.map +1 -1
- package/dist/cli/commands/review/utils/set-version.js +1 -1
- package/dist/cli/commands/review/utils/set-version.js.map +1 -1
- package/dist/cli/commands/run-task.d.ts +29 -7
- package/dist/cli/commands/run-task.d.ts.map +1 -1
- package/dist/cli/commands/run-task.js +21 -8
- package/dist/cli/commands/run-task.js.map +1 -1
- package/dist/cli/commands/run-task.test.js +14 -2
- package/dist/cli/commands/run-task.test.js.map +1 -1
- package/dist/cli/commands/start.d.ts +38 -18
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +65 -45
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/stylelint.d.ts +29 -7
- package/dist/cli/commands/stylelint.d.ts.map +1 -1
- package/dist/cli/commands/stylelint.js +18 -6
- package/dist/cli/commands/stylelint.js.map +1 -1
- package/dist/cli/commands/test/runners/vitest.js +1 -1
- package/dist/cli/commands/test/runners/vitest.js.map +1 -1
- package/dist/cli/commands/test/tests.d.ts +25 -5
- package/dist/cli/commands/test/tests.d.ts.map +1 -1
- package/dist/cli/commands/test/tests.js +22 -14
- package/dist/cli/commands/test/tests.js.map +1 -1
- package/dist/cli/commands/types.d.ts +51 -10
- package/dist/cli/commands/types.d.ts.map +1 -1
- package/dist/cli/commands/types.js +1 -0
- package/dist/cli/commands/types.js.map +1 -1
- package/dist/cli/commands/upload-sourcemaps.d.ts +26 -6
- package/dist/cli/commands/upload-sourcemaps.d.ts.map +1 -1
- package/dist/cli/commands/upload-sourcemaps.js +27 -4
- package/dist/cli/commands/upload-sourcemaps.js.map +1 -1
- package/dist/cli/commands/utils.d.ts +4 -0
- package/dist/cli/commands/utils.d.ts.map +1 -0
- package/dist/cli/commands/utils.js +28 -0
- package/dist/cli/commands/utils.js.map +1 -0
- package/dist/cli/index.js +8 -5
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/tasks/cli-task.d.ts.map +1 -1
- package/dist/cli/tasks/cli-task.js +1 -1
- package/dist/cli/tasks/cli-task.js.map +1 -1
- package/dist/cli/tasks/swc-compile-package.d.ts +1 -2
- package/dist/cli/tasks/swc-compile-package.d.ts.map +1 -1
- package/dist/cli/tasks/swc-compile-package.js.map +1 -1
- package/dist/cli/tasks/tsc-compile-package.d.ts +1 -2
- package/dist/cli/tasks/tsc-compile-package.d.ts.map +1 -1
- package/dist/cli/tasks/tsc-compile-package.js.map +1 -1
- package/dist/cli/tasks/tsc-compile.d.ts +1 -2
- package/dist/cli/tasks/tsc-compile.d.ts.map +1 -1
- package/dist/cli/tasks/tsc-compile.js.map +1 -1
- package/dist/cli/utils/bundle.d.ts.map +1 -1
- package/dist/cli/utils/bundle.js +2 -2
- package/dist/cli/utils/bundle.js.map +1 -1
- package/dist/cli/utils/check-startup-location.d.ts +4 -0
- package/dist/cli/utils/check-startup-location.d.ts.map +1 -0
- package/dist/cli/utils/check-startup-location.js +27 -0
- package/dist/cli/utils/check-startup-location.js.map +1 -0
- package/dist/cli/utils/cli-npm.d.ts +6 -0
- package/dist/cli/utils/cli-npm.d.ts.map +1 -1
- package/dist/cli/utils/cli-npm.js +25 -3
- package/dist/cli/utils/cli-npm.js.map +1 -1
- package/dist/cli/utils/compile-less.js +1 -1
- package/dist/cli/utils/compile-less.js.map +1 -1
- package/dist/cli/utils/constants.d.ts +2 -0
- package/dist/cli/utils/constants.d.ts.map +1 -0
- package/dist/cli/utils/constants.js +13 -0
- package/dist/cli/utils/constants.js.map +1 -0
- package/dist/cli/utils/copy-files.d.ts.map +1 -1
- package/dist/cli/utils/copy-files.js.map +1 -1
- package/dist/cli/utils/eslint.d.ts +1 -2
- package/dist/cli/utils/eslint.d.ts.map +1 -1
- package/dist/cli/utils/eslint.js.map +1 -1
- package/dist/cli/utils/index.d.ts +2 -0
- package/dist/cli/utils/index.d.ts.map +1 -1
- package/dist/cli/utils/index.js +2 -0
- package/dist/cli/utils/index.js.map +1 -1
- package/dist/cli/utils/is-module-installed.js +1 -1
- package/dist/cli/utils/is-module-installed.js.map +1 -1
- package/dist/cli/utils/lerna-exec.d.ts.map +1 -1
- package/dist/cli/utils/lerna-exec.js +1 -3
- package/dist/cli/utils/lerna-exec.js.map +1 -1
- package/dist/cli/utils/process-tree.js.map +1 -1
- package/dist/cli/utils/set-node-options.js +2 -4
- package/dist/cli/utils/set-node-options.js.map +1 -1
- package/dist/cli/utils/stylelint.d.ts +1 -2
- package/dist/cli/utils/stylelint.d.ts.map +1 -1
- package/dist/cli/utils/stylelint.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/jest/resolver.js +2 -2
- package/dist/jest/resolver.js.map +1 -1
- package/dist/jest/svg-transformer.d.ts.map +1 -1
- package/dist/jest/svg-transformer.js.map +1 -1
- package/dist/utils/find-packages.js +1 -1
- package/dist/utils/find-packages.js.map +1 -1
- package/dist/utils/format-relative-date.js +1 -1
- package/dist/utils/format-relative-date.js.map +1 -1
- package/dist/utils/get-configuration.d.ts +3 -0
- package/dist/utils/get-configuration.d.ts.map +1 -1
- package/dist/utils/get-configuration.js +14 -11
- package/dist/utils/get-configuration.js.map +1 -1
- package/dist/utils/get-destination-folders.d.ts.map +1 -1
- package/dist/utils/get-destination-folders.js.map +1 -1
- package/dist/utils/get-folders.d.ts.map +1 -1
- package/dist/utils/get-folders.js.map +1 -1
- package/dist/utils/get-jest-config.js +1 -1
- package/dist/utils/get-jest-config.js.map +1 -1
- package/dist/utils/get-package-data.js +1 -1
- package/dist/utils/get-package-data.js.map +1 -1
- package/dist/utils/get-packages.js.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/load-shared-dependencies.js.map +1 -1
- package/dist/utils/prettify.d.ts +13 -0
- package/dist/utils/prettify.d.ts.map +1 -0
- package/dist/utils/prettify.js +48 -0
- package/dist/utils/prettify.js.map +1 -0
- package/dist/utils/read-json.js +1 -1
- package/dist/utils/read-json.js.map +1 -1
- package/dist/utils/transform-svg.js +2 -2
- package/dist/utils/transform-svg.js.map +1 -1
- package/dist/webpack/configs/cache-config.js +1 -1
- package/dist/webpack/configs/cache-config.js.map +1 -1
- package/dist/webpack/configs/optimization-config.js +3 -4
- package/dist/webpack/configs/optimization-config.js.map +1 -1
- package/dist/webpack/configs/output-config.js +1 -1
- package/dist/webpack/configs/output-config.js.map +1 -1
- package/dist/webpack/configs/plugins/assets-manifest-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/assets-manifest-plugin.js +5 -5
- package/dist/webpack/configs/plugins/assets-manifest-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/bundle-analyser-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/bundle-analyser-plugin.js +1 -1
- package/dist/webpack/configs/plugins/bundle-analyser-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.js +6 -9
- package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/html-tags-plugin.js +1 -1
- package/dist/webpack/configs/plugins/html-tags-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/check-resource.js +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/check-resource.js.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/moment-locales-plugin.js +1 -1
- package/dist/webpack/configs/plugins/moment-locales-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/watch-run-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/watch-run-plugin.js.map +1 -1
- package/dist/webpack/configs/types.d.ts +1 -0
- package/dist/webpack/configs/types.d.ts.map +1 -1
- package/dist/webpack/configs/utils/build-metadata.d.ts +10 -0
- package/dist/webpack/configs/utils/build-metadata.d.ts.map +1 -0
- package/dist/webpack/configs/utils/build-metadata.js +50 -0
- package/dist/webpack/configs/utils/build-metadata.js.map +1 -0
- package/dist/webpack/configs/utils/generate-metadata.d.ts.map +1 -1
- package/dist/webpack/configs/utils/generate-metadata.js +5 -24
- package/dist/webpack/configs/utils/generate-metadata.js.map +1 -1
- package/dist/webpack/configs/utils/get-exposed-dependencies.d.ts +3 -0
- package/dist/webpack/configs/utils/get-exposed-dependencies.d.ts.map +1 -0
- package/dist/webpack/configs/utils/get-exposed-dependencies.js +21 -0
- package/dist/webpack/configs/utils/get-exposed-dependencies.js.map +1 -0
- package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.js +1 -1
- package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.js.map +1 -1
- package/dist/webpack/configs/utils/index.d.ts +1 -0
- package/dist/webpack/configs/utils/index.d.ts.map +1 -1
- package/dist/webpack/configs/utils/index.js +1 -0
- package/dist/webpack/configs/utils/index.js.map +1 -1
- package/dist/webpack/create-webpack-config.js +10 -4
- package/dist/webpack/create-webpack-config.js.map +1 -1
- package/dist/webpack/loaders/expose-loader/index.d.ts.map +1 -1
- package/dist/webpack/loaders/expose-loader/index.js.map +1 -1
- package/dist/webpack/loaders/expose-loader/runtime/get-global-this.js +1 -1
- package/dist/webpack/loaders/expose-loader/runtime/get-global-this.js.map +1 -1
- package/dist/webpack/loaders/expose-loader/utils/get-new-user-request.js +2 -2
- package/dist/webpack/loaders/expose-loader/utils/get-new-user-request.js.map +1 -1
- package/dist/webpack/utils/stringify-config.js +2 -2
- package/dist/webpack/utils/stringify-config.js.map +1 -1
- package/dist/webpack/utils/testing/get-compiler.d.ts.map +1 -1
- package/dist/webpack/utils/testing/get-compiler.js +1 -1
- package/dist/webpack/utils/testing/get-compiler.js.map +1 -1
- package/dist/webpack/utils/testing/get-errors.d.ts.map +1 -1
- package/dist/webpack/utils/testing/get-errors.js.map +1 -1
- package/dist/webpack/utils/testing/get-warnings.d.ts.map +1 -1
- package/dist/webpack/utils/testing/get-warnings.js.map +1 -1
- package/dist/webpack/utils/testing/read-asset.d.ts.map +1 -1
- package/dist/webpack/utils/testing/read-asset.js +1 -1
- package/dist/webpack/utils/testing/read-asset.js.map +1 -1
- package/dist/webpack/utils/testing/read-assets.d.ts.map +1 -1
- package/dist/webpack/utils/testing/read-assets.js.map +1 -1
- package/package.json +35 -41
- package/src/cli/commands/__tests__/build.test.ts +32 -9
- package/src/cli/commands/__tests__/bundle-package.test.ts +2 -1
- package/src/cli/commands/__tests__/clean.test.ts +99 -8
- package/src/cli/commands/__tests__/convert-eslint-config.test.ts +14 -9
- package/src/cli/commands/__tests__/eslint.test.ts +1 -1
- package/src/cli/commands/__tests__/get-command.test.ts +3 -1
- package/src/cli/commands/__tests__/init.test.ts +14 -1
- package/src/cli/commands/__tests__/install.test.ts +6 -2
- package/src/cli/commands/__tests__/kendo-ui-license.test.ts +7 -2
- package/src/cli/commands/__tests__/lint.test.ts +4 -2
- package/src/cli/commands/__tests__/mfe-check.test.ts +346 -0
- package/src/cli/commands/__tests__/mfe-generate-metadata.test.ts +160 -0
- package/src/cli/commands/__tests__/mfe-list.test.ts +8 -1
- package/src/cli/commands/__tests__/mfe-package-clean.test.ts +0 -1
- package/src/cli/commands/__tests__/mfe-package-publish.test.ts +322 -93
- package/src/cli/commands/__tests__/mfe-package-rollback.test.ts +196 -0
- package/src/cli/commands/__tests__/mfe-publish.test.ts +65 -5
- package/src/cli/commands/__tests__/prepare-package.test.ts +3 -0
- package/src/cli/commands/__tests__/start.test.ts +30 -7
- package/src/cli/commands/__tests__/stylelint.test.ts +1 -1
- package/src/cli/commands/__tests__/styles-check.test.ts +1 -2
- package/src/cli/commands/__tests__/upload-sourcemaps.test.ts +3 -6
- package/src/cli/commands/build.ts +35 -26
- package/src/cli/commands/bundle-package.ts +11 -10
- package/src/cli/commands/clean.ts +51 -5
- package/src/cli/commands/convert-eslint-config.ts +3 -12
- package/src/cli/commands/eslint.ts +9 -11
- package/src/cli/commands/get-command.ts +6 -1
- package/src/cli/commands/index.ts +2 -2
- package/src/cli/commands/init.ts +7 -9
- package/src/cli/commands/install.ts +11 -13
- package/src/cli/commands/kendo-ui-license.ts +1 -1
- package/src/cli/commands/lint.ts +12 -18
- package/src/cli/commands/mfe-check.ts +166 -0
- package/src/cli/commands/mfe-generate-metadata.ts +69 -0
- package/src/cli/commands/mfe-list.ts +28 -30
- package/src/cli/commands/mfe-package-clean.ts +29 -34
- package/src/cli/commands/mfe-package-publish.ts +153 -87
- package/src/cli/commands/mfe-package-rollback.ts +100 -0
- package/src/cli/commands/mfe-publish.ts +80 -27
- package/src/cli/commands/prepare-package.ts +6 -5
- package/src/cli/commands/review/__tests__/review.test.ts +18 -19
- package/src/cli/commands/review/review.ts +11 -20
- package/src/cli/commands/review/rules/__tests__/no-deprecated-content-base.test.ts +1 -1
- package/src/cli/commands/review/rules/__tests__/no-deprecated-startup-install.test.ts +0 -1
- package/src/cli/commands/review/rules/__tests__/no-direct-peer-dependencies.test.ts +1 -1
- package/src/cli/commands/review/rules/__tests__/no-typescript-entry-point.test.ts +0 -1
- package/src/cli/commands/review/rules/__tests__/require-all-react-dependencies.test.ts +0 -1
- package/src/cli/commands/review/rules/__tests__/require-compatible-launch-darkly-sdk.test.ts +2 -2
- package/src/cli/commands/review/rules/__tests__/require-explicit-side-effects.test.ts +0 -1
- package/src/cli/commands/review/rules/__tests__/require-npmrc.test.ts +0 -1
- package/src/cli/commands/review/rules/__tests__/require-one-anvil-uikit-contrib-version.test.ts +1 -2
- package/src/cli/commands/review/rules/__tests__/require-one-collection-version.test.ts +0 -1
- package/src/cli/commands/review/rules/__tests__/require-one-package-version.test.ts +0 -1
- package/src/cli/commands/review/rules/__tests__/require-one-react-version.test.ts +0 -1
- package/src/cli/commands/review/rules/__tests__/require-one-uikit-version.test.ts +1 -1
- package/src/cli/commands/review/rules/__tests__/require-project-version-in-root-node-modules.test.ts +2 -3
- package/src/cli/commands/review/rules/__tests__/require-servicetitan-scope.test.ts +0 -1
- package/src/cli/commands/review/rules/__tests__/require-tsconfig-references.test.ts +315 -0
- package/src/cli/commands/review/rules/index.ts +2 -0
- package/src/cli/commands/review/rules/require-compatible-launch-darkly-sdk.ts +1 -1
- package/src/cli/commands/review/rules/require-one-uikit-version.ts +1 -0
- package/src/cli/commands/review/rules/require-project-version-in-root-node-modules.ts +3 -3
- package/src/cli/commands/review/rules/require-tsconfig-references.ts +157 -0
- package/src/cli/commands/review/utils/__tests__/set-version.test.ts +0 -1
- package/src/cli/commands/run-task.test.ts +15 -3
- package/src/cli/commands/run-task.ts +12 -14
- package/src/cli/commands/start.ts +75 -59
- package/src/cli/commands/stylelint.ts +9 -11
- package/src/cli/commands/test/runners/__tests__/jest.test.ts +1 -2
- package/src/cli/commands/test/runners/vitest.ts +1 -1
- package/src/cli/commands/test/tests.ts +13 -15
- package/src/cli/commands/types.ts +53 -7
- package/src/cli/commands/upload-sourcemaps.ts +14 -12
- package/src/cli/commands/utils.ts +6 -0
- package/src/cli/index.ts +11 -7
- package/src/cli/tasks/__tests__/cli-task.test.ts +1 -1
- package/src/cli/tasks/__tests__/swc-compile-package.test.ts +3 -1
- package/src/cli/tasks/__tests__/tsc-compile-package.test.ts +2 -0
- package/src/cli/tasks/__tests__/tsc-compile.test.ts +3 -13
- package/src/cli/tasks/cli-task.ts +1 -1
- package/src/cli/tasks/swc-compile-package.ts +1 -3
- package/src/cli/tasks/tsc-compile-package.ts +1 -2
- package/src/cli/tasks/tsc-compile.ts +1 -2
- package/src/cli/utils/__tests__/bundle.test.ts +1 -2
- package/src/cli/utils/__tests__/check-args.test.ts +1 -1
- package/src/cli/utils/__tests__/check-startup-location.test.ts +88 -0
- package/src/cli/utils/__tests__/cli-git.test.ts +1 -2
- package/src/cli/utils/__tests__/cli-npm.test.ts +51 -2
- package/src/cli/utils/__tests__/cli-os.test.ts +1 -2
- package/src/cli/utils/__tests__/compile.test.ts +1 -1
- package/src/cli/utils/__tests__/copy-files.test.ts +0 -1
- package/src/cli/utils/__tests__/eslint.test.ts +1 -1
- package/src/cli/utils/__tests__/lerna-exec.test.ts +1 -2
- package/src/cli/utils/__tests__/maybe-create-git-folder.test.ts +0 -1
- package/src/cli/utils/__tests__/set-node-options.test.ts +0 -1
- package/src/cli/utils/__tests__/stylelint.test.ts +1 -1
- package/src/cli/utils/bundle.ts +1 -3
- package/src/cli/utils/check-startup-location.ts +21 -0
- package/src/cli/utils/cli-npm.ts +22 -0
- package/src/cli/utils/compile-less.ts +1 -1
- package/src/cli/utils/constants.ts +1 -0
- package/src/cli/utils/copy-files.ts +0 -1
- package/src/cli/utils/eslint.ts +1 -3
- package/src/cli/utils/index.ts +2 -0
- package/src/cli/utils/lerna-exec.ts +0 -1
- package/src/cli/utils/stylelint.ts +1 -2
- package/src/index.ts +1 -1
- package/src/jest/svg-transformer.ts +0 -1
- package/src/utils/__tests__/get-branch-configs.test.ts +0 -1
- package/src/utils/__tests__/get-configuration.test.ts +0 -1
- package/src/utils/__tests__/get-destination-folders.test.ts +1 -2
- package/src/utils/__tests__/get-folders.test.ts +0 -1
- package/src/utils/__tests__/get-jest-config.test.ts +1 -2
- package/src/utils/__tests__/get-package-data.test.ts +1 -2
- package/src/utils/__tests__/get-packages.test.ts +1 -1
- package/src/utils/__tests__/get-startup-version.test.ts +0 -1
- package/src/utils/__tests__/get-tsconfig.test.ts +0 -1
- package/src/utils/__tests__/load-shared-dependencies.test.ts +1 -1
- package/src/utils/__tests__/log.test.ts +1 -1
- package/src/utils/__tests__/prettify.test.ts +80 -0
- package/src/utils/__tests__/read-json.test.ts +0 -1
- package/src/utils/find-packages.ts +1 -1
- package/src/utils/get-configuration.ts +8 -7
- package/src/utils/get-destination-folders.ts +0 -1
- package/src/utils/get-folders.ts +0 -1
- package/src/utils/get-jest-config.ts +1 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/prettify.ts +36 -0
- package/src/webpack/__tests__/create-webpack-config-shared-dependencies.test.ts +6 -2
- package/src/webpack/__tests__/create-webpack-config-web-component.test.ts +7 -4
- package/src/webpack/__tests__/create-webpack-config.test.ts +8 -4
- package/src/webpack/configs/cache-config.ts +1 -1
- package/src/webpack/configs/plugins/assets-manifest-plugin.ts +1 -1
- package/src/webpack/configs/plugins/bundle-analyser-plugin.ts +2 -2
- package/src/webpack/configs/plugins/define-exposed-dependencies-plugin.ts +6 -15
- package/src/webpack/configs/plugins/ignore-plugin/__tests__/get-package-json.test.ts +1 -1
- package/src/webpack/configs/plugins/ignore-plugin/__tests__/is-optional-peer-dependency.test.ts +1 -1
- package/src/webpack/configs/plugins/ignore-plugin/ignore-plugin.ts +0 -1
- package/src/webpack/configs/plugins/watch-run-plugin.ts +0 -1
- package/src/webpack/configs/types.ts +1 -0
- package/src/webpack/configs/utils/__tests__/build-metadata.test.ts +71 -0
- package/src/webpack/configs/utils/__tests__/generate-metadata.test.ts +42 -46
- package/src/webpack/configs/utils/__tests__/get-exposed-dependencies.test.ts +39 -0
- package/src/webpack/configs/utils/__tests__/get-web-components-version.test.ts +0 -1
- package/src/webpack/configs/utils/build-metadata.ts +40 -0
- package/src/webpack/configs/utils/generate-metadata.ts +7 -21
- package/src/webpack/configs/utils/get-exposed-dependencies.ts +17 -0
- package/src/webpack/configs/utils/index.ts +1 -0
- package/src/webpack/create-webpack-config.ts +3 -3
- package/src/webpack/loaders/expose-loader/__tests__/index.test.ts +0 -2
- package/src/webpack/loaders/expose-loader/index.ts +0 -1
- package/src/webpack/utils/testing/get-compiler.ts +1 -3
- package/src/webpack/utils/testing/get-errors.ts +0 -1
- package/src/webpack/utils/testing/get-warnings.ts +0 -1
- package/src/webpack/utils/testing/read-asset.ts +1 -2
- package/src/webpack/utils/testing/read-assets.ts +0 -1
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import execa from 'execa';
|
|
2
1
|
import fs from 'fs';
|
|
3
2
|
import { globSync } from 'glob';
|
|
4
3
|
import JSON5 from 'json5';
|
|
5
|
-
|
|
6
|
-
import { log, logErrors, toArray } from '../../utils';
|
|
4
|
+
import { log, logErrors, prettify, toArray } from '../../utils';
|
|
7
5
|
import { Command } from './types';
|
|
8
6
|
|
|
9
7
|
const oldConfigFile = '.eslintrc.json';
|
|
@@ -41,6 +39,7 @@ interface Recipe {
|
|
|
41
39
|
}
|
|
42
40
|
|
|
43
41
|
export class ConvertEslintConfig extends Command {
|
|
42
|
+
static readonly allowRunFromGlobal = true;
|
|
44
43
|
static readonly description = 'Convert v8.x eslintrc.json to v9.x flat config';
|
|
45
44
|
|
|
46
45
|
private static readonly recipes: Record<string, Recipe | null> = {
|
|
@@ -91,7 +90,7 @@ export class ConvertEslintConfig extends Command {
|
|
|
91
90
|
|
|
92
91
|
const json = this.readJson(oldConfigFile);
|
|
93
92
|
fs.writeFileSync(newConfigFile, this.convert(json), 'utf-8');
|
|
94
|
-
await
|
|
93
|
+
await prettify(newConfigFile);
|
|
95
94
|
|
|
96
95
|
log.success(`Created ${newConfigFile}`);
|
|
97
96
|
}
|
|
@@ -265,14 +264,6 @@ export class ConvertEslintConfig extends Command {
|
|
|
265
264
|
flatConfigs.push(JSON.stringify({ settings }));
|
|
266
265
|
}
|
|
267
266
|
|
|
268
|
-
private async prettify(filename: string) {
|
|
269
|
-
try {
|
|
270
|
-
await execa('npx', ['prettier', '-w', filename], { stdout: 'ignore' });
|
|
271
|
-
} catch (error: any) {
|
|
272
|
-
throw new Error(`prettier failed with exit code ${error.exitCode}`);
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
|
|
276
267
|
private readJson(filename: string) {
|
|
277
268
|
return JSON5.parse(fs.readFileSync(filename, 'utf8'));
|
|
278
269
|
}
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
2
|
import { logErrors } from '../../utils';
|
|
3
3
|
import { eslint } from '../utils';
|
|
4
|
-
import { Command,
|
|
4
|
+
import { Command, CommandOptions } from './types';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
_:
|
|
8
|
-
fix
|
|
9
|
-
paths
|
|
10
|
-
}
|
|
6
|
+
const options = {
|
|
7
|
+
_: { description: '[paths...]', array: true, string: true },
|
|
8
|
+
fix: { boolean: true, hidden: true },
|
|
9
|
+
paths: { array: true, string: true, hidden: true },
|
|
10
|
+
} satisfies CommandOptions;
|
|
11
11
|
|
|
12
|
-
export class ESLintCommand extends Command<
|
|
13
|
-
static readonly options =
|
|
14
|
-
_: { description: '[paths...]' },
|
|
15
|
-
};
|
|
12
|
+
export class ESLintCommand extends Command<typeof options> {
|
|
13
|
+
static readonly options = options;
|
|
16
14
|
|
|
17
15
|
@logErrors
|
|
18
16
|
async execute() {
|
|
@@ -20,7 +18,7 @@ export class ESLintCommand extends Command<Args> {
|
|
|
20
18
|
}
|
|
21
19
|
|
|
22
20
|
private get paths() {
|
|
23
|
-
const { _, paths = [] } = this.args;
|
|
21
|
+
const { _ = [], paths = [] } = this.args;
|
|
24
22
|
return [..._, ...paths];
|
|
25
23
|
}
|
|
26
24
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { CommandName } from '../../utils';
|
|
2
|
-
|
|
3
2
|
import { Build } from './build';
|
|
4
3
|
import { BundlePackage } from './bundle-package';
|
|
5
4
|
import { Clean } from './clean';
|
|
@@ -9,9 +8,12 @@ import { Init } from './init';
|
|
|
9
8
|
import { Install } from './install';
|
|
10
9
|
import { KendoUILicense } from './kendo-ui-license';
|
|
11
10
|
import { Lint } from './lint';
|
|
11
|
+
import { MfeCheck } from './mfe-check';
|
|
12
|
+
import { MfeGenerateMetadata } from './mfe-generate-metadata';
|
|
12
13
|
import { MFEList } from './mfe-list';
|
|
13
14
|
import { MFEPackageClean } from './mfe-package-clean';
|
|
14
15
|
import { MFEPackagePublish } from './mfe-package-publish';
|
|
16
|
+
import { MFEPackageRollback } from './mfe-package-rollback';
|
|
15
17
|
import { MFEPublish } from './mfe-publish';
|
|
16
18
|
import { PreparePackage } from './prepare-package';
|
|
17
19
|
import { Review } from './review';
|
|
@@ -33,9 +35,12 @@ const commands: Record<CommandName, Newable<Command>> = {
|
|
|
33
35
|
[CommandName.install]: Install,
|
|
34
36
|
[CommandName['kendo-ui-license']]: KendoUILicense,
|
|
35
37
|
[CommandName.lint]: Lint,
|
|
38
|
+
[CommandName['mfe-check']]: MfeCheck,
|
|
39
|
+
[CommandName['mfe-generate-metadata']]: MfeGenerateMetadata,
|
|
36
40
|
[CommandName['mfe-list']]: MFEList,
|
|
37
41
|
[CommandName['mfe-package-clean']]: MFEPackageClean,
|
|
38
42
|
[CommandName['mfe-package-publish']]: MFEPackagePublish,
|
|
43
|
+
[CommandName['mfe-package-rollback']]: MFEPackageRollback,
|
|
39
44
|
[CommandName['mfe-publish']]: MFEPublish,
|
|
40
45
|
[CommandName['prepare-package']]: PreparePackage,
|
|
41
46
|
[CommandName.review]: Review,
|
|
@@ -6,9 +6,9 @@ export * from './init';
|
|
|
6
6
|
export * from './install';
|
|
7
7
|
export * from './kendo-ui-license';
|
|
8
8
|
export * from './lint';
|
|
9
|
+
export * from './mfe-publish';
|
|
9
10
|
export * from './prepare-package';
|
|
10
11
|
export * from './start';
|
|
11
|
-
export * from './test';
|
|
12
12
|
export * from './styles-check';
|
|
13
|
-
export * from './
|
|
13
|
+
export * from './test';
|
|
14
14
|
export type * from './types';
|
package/src/cli/commands/init.ts
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
import { gitCloneRepo, gitIsReachable } from '@servicetitan/install';
|
|
2
2
|
import fs from 'fs';
|
|
3
3
|
import path from 'path';
|
|
4
|
-
|
|
5
4
|
import { log, logErrors } from '../../utils';
|
|
6
|
-
import { Command,
|
|
5
|
+
import { Command, CommandOptions } from './types';
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
output
|
|
10
|
-
}
|
|
7
|
+
const options = {
|
|
8
|
+
output: { string: true, description: 'Output path' },
|
|
9
|
+
} satisfies CommandOptions;
|
|
11
10
|
|
|
12
11
|
const REPO_NAME = 'frontend-example';
|
|
13
12
|
|
|
14
|
-
export class Init extends Command<
|
|
13
|
+
export class Init extends Command<typeof options> {
|
|
14
|
+
static readonly allowRunFromGlobal = true;
|
|
15
15
|
static readonly description = 'Create example project';
|
|
16
|
-
static readonly options =
|
|
17
|
-
output: { string: true, description: 'Output path' },
|
|
18
|
-
};
|
|
16
|
+
static readonly options = options;
|
|
19
17
|
|
|
20
18
|
@logErrors
|
|
21
19
|
async execute() {
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import { execSync } from 'child_process';
|
|
2
|
-
import { log, logErrors
|
|
3
|
-
import { Command,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
2
|
+
import { getStartupVersion, log, logErrors } from '../../utils';
|
|
3
|
+
import { Command, CommandOptions } from './types';
|
|
4
|
+
|
|
5
|
+
const options = {
|
|
6
|
+
fix: { boolean: true, description: 'Update and dedupe package-lock.json', hidden: true },
|
|
7
|
+
quiet: { boolean: true, description: 'Suppress output', hidden: true },
|
|
8
|
+
token: { boolean: true, description: 'Configure npm token' },
|
|
9
|
+
} satisfies CommandOptions;
|
|
9
10
|
|
|
10
|
-
export class Install extends Command<
|
|
11
|
+
export class Install extends Command<typeof options> {
|
|
12
|
+
static readonly allowRunFromGlobal = true;
|
|
11
13
|
static readonly description = 'Install project dependencies';
|
|
12
|
-
static readonly options =
|
|
13
|
-
fix: { boolean: true, describe: 'Update and dedupe package-lock.json', hidden: true },
|
|
14
|
-
quiet: { boolean: true, describe: 'Suppress output', hidden: true },
|
|
15
|
-
token: { boolean: true, describe: 'Configure npm token' },
|
|
16
|
-
};
|
|
14
|
+
static readonly options = options;
|
|
17
15
|
|
|
18
16
|
@logErrors
|
|
19
17
|
async execute() {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import execa from 'execa';
|
|
2
|
-
|
|
3
2
|
import { log, logErrors } from '../../utils';
|
|
4
3
|
import { isModuleInstalled } from '../utils';
|
|
5
4
|
import { Command } from './types';
|
|
@@ -30,6 +29,7 @@ const LICENSE = Buffer.from(ENCODED_LICENSE, 'base64').toString('ascii');
|
|
|
30
29
|
const LICENSING_PACKAGE = '@progress/kendo-licensing';
|
|
31
30
|
|
|
32
31
|
export class KendoUILicense extends Command {
|
|
32
|
+
static readonly allowRunFromGlobal = true;
|
|
33
33
|
static readonly description = 'Install KendoReact license key';
|
|
34
34
|
|
|
35
35
|
async execute() {
|
package/src/cli/commands/lint.ts
CHANGED
|
@@ -1,28 +1,22 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
2
|
import { getPackages, log, logErrors } from '../../utils';
|
|
3
|
-
import { Command, CommandArgs } from './types';
|
|
4
3
|
import { eslint, lernaExec } from '../utils';
|
|
5
4
|
import { stylelint } from '../utils/stylelint';
|
|
5
|
+
import { Command, CommandOptions } from './types';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
_:
|
|
9
|
-
fix
|
|
10
|
-
scope
|
|
11
|
-
ignore
|
|
12
|
-
parallel
|
|
13
|
-
paths
|
|
14
|
-
}
|
|
7
|
+
const options = {
|
|
8
|
+
_: { description: '[paths...]', array: true, string: true },
|
|
9
|
+
fix: { boolean: true, description: 'Apply fixes for issues?' },
|
|
10
|
+
scope: { array: true, string: true, hidden: true, description: 'Packages to lint' },
|
|
11
|
+
ignore: { array: true, string: true, hidden: true, description: 'Packages to skip' },
|
|
12
|
+
parallel: { boolean: true, hidden: true, description: 'Lint each package separately' },
|
|
13
|
+
paths: { array: true, string: true, hidden: true },
|
|
14
|
+
} satisfies CommandOptions;
|
|
15
15
|
|
|
16
|
-
export class Lint extends Command<
|
|
16
|
+
export class Lint extends Command<typeof options> {
|
|
17
17
|
static readonly description = 'Run eslint and stylelint';
|
|
18
18
|
static readonly greedy = true;
|
|
19
|
-
static readonly options =
|
|
20
|
-
_: { description: '[paths...]' },
|
|
21
|
-
fix: { boolean: true, description: 'Apply fixes for issues?' },
|
|
22
|
-
scope: { array: true, hidden: true, description: 'Packages to lint' },
|
|
23
|
-
ignore: { array: true, hidden: true, description: 'Packages to skip' },
|
|
24
|
-
parallel: { boolean: true, hidden: true, description: 'Lint each package separately' },
|
|
25
|
-
};
|
|
19
|
+
static readonly options = options;
|
|
26
20
|
|
|
27
21
|
async execute() {
|
|
28
22
|
await this.checkStyles();
|
|
@@ -76,7 +70,7 @@ export class Lint extends Command<Args> {
|
|
|
76
70
|
}
|
|
77
71
|
|
|
78
72
|
private get paths() {
|
|
79
|
-
const { _, paths = [] } = this.args;
|
|
73
|
+
const { _ = [], paths = [] } = this.args;
|
|
80
74
|
return [..._, ...paths];
|
|
81
75
|
}
|
|
82
76
|
}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { getVersionMismatches } from '@servicetitan/startup-utils';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import {
|
|
4
|
+
isWebComponent,
|
|
5
|
+
loadSharedDependencies,
|
|
6
|
+
log,
|
|
7
|
+
logErrors,
|
|
8
|
+
readJson,
|
|
9
|
+
toArray,
|
|
10
|
+
} from '../../utils';
|
|
11
|
+
import { Metadata } from '../../webpack/configs/types';
|
|
12
|
+
import { getExposedDependencies } from '../../webpack/configs/utils';
|
|
13
|
+
import { Command, CommandOptions } from './types';
|
|
14
|
+
|
|
15
|
+
interface HostPackageJSON {
|
|
16
|
+
name: string;
|
|
17
|
+
dependencies: Record<string, string>;
|
|
18
|
+
cli?: {
|
|
19
|
+
'web-component'?: boolean | string | object;
|
|
20
|
+
'webpack'?: {
|
|
21
|
+
'expose-shared-dependencies'?: boolean;
|
|
22
|
+
'shared-dependencies'?: Record<string, string>;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
interface CompatibilityResult {
|
|
28
|
+
name: string;
|
|
29
|
+
compatible: boolean;
|
|
30
|
+
bundleType: 'light' | 'full';
|
|
31
|
+
mismatches?: Record<string, { host: string; package: string }>;
|
|
32
|
+
isSharedDependenciesEnabled: boolean;
|
|
33
|
+
isHostMfe: boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const options = {
|
|
37
|
+
metadata: {
|
|
38
|
+
description:
|
|
39
|
+
"Path to MFE's metadata.json file, can be generated with the 'mfe-generate-metadata' command",
|
|
40
|
+
string: true,
|
|
41
|
+
demandOption: true,
|
|
42
|
+
requiresArg: true,
|
|
43
|
+
},
|
|
44
|
+
hostPackageJson: {
|
|
45
|
+
description: 'Path(s) to host package.json files',
|
|
46
|
+
array: true,
|
|
47
|
+
string: true,
|
|
48
|
+
demandOption: true,
|
|
49
|
+
requiresArg: true,
|
|
50
|
+
},
|
|
51
|
+
json: {
|
|
52
|
+
description: 'Output results as JSON',
|
|
53
|
+
boolean: true,
|
|
54
|
+
default: false,
|
|
55
|
+
},
|
|
56
|
+
} satisfies CommandOptions;
|
|
57
|
+
|
|
58
|
+
export class MfeCheck extends Command<typeof options> {
|
|
59
|
+
static readonly allowRunFromGlobal = true;
|
|
60
|
+
static readonly description = 'Check MFE/host dependency compatibility';
|
|
61
|
+
static readonly options = options;
|
|
62
|
+
|
|
63
|
+
@logErrors
|
|
64
|
+
async execute() {
|
|
65
|
+
const { metadata: metadataPath, hostPackageJson, json } = this.args;
|
|
66
|
+
const mfeMetadata = readJson<Metadata>(path.resolve(metadataPath));
|
|
67
|
+
const hostPackageJsonPaths = toArray(hostPackageJson);
|
|
68
|
+
const hostData = this.getHostPackageData(hostPackageJsonPaths);
|
|
69
|
+
const result = this.checkCompatibility(mfeMetadata, hostData);
|
|
70
|
+
|
|
71
|
+
if (json) {
|
|
72
|
+
this.outputJson(result);
|
|
73
|
+
} else {
|
|
74
|
+
this.outputHumanReadable(result);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (!result.compatible) {
|
|
78
|
+
process.exitCode = 1;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return Promise.resolve();
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
private getHostPackageData(packageJsonPaths: string[]): HostPackageJSON {
|
|
85
|
+
const packages = packageJsonPaths.map(packageJsonPath =>
|
|
86
|
+
readJson<HostPackageJSON>(path.resolve(packageJsonPath))
|
|
87
|
+
);
|
|
88
|
+
const mergedDependencies = packages.reduceRight<HostPackageJSON['dependencies']>(
|
|
89
|
+
(result, currentPackage) => Object.assign(result, currentPackage.dependencies),
|
|
90
|
+
{}
|
|
91
|
+
);
|
|
92
|
+
const mainPackage = packages[0];
|
|
93
|
+
|
|
94
|
+
return {
|
|
95
|
+
name: mainPackage.name,
|
|
96
|
+
cli: mainPackage.cli,
|
|
97
|
+
dependencies: mergedDependencies,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
private checkCompatibility(
|
|
102
|
+
mfeMetadata: Metadata,
|
|
103
|
+
hostData: HostPackageJSON
|
|
104
|
+
): CompatibilityResult {
|
|
105
|
+
const mfeSharedDependencies = mfeMetadata.sharedDependencies;
|
|
106
|
+
const hostSharedDependencies = loadSharedDependencies(
|
|
107
|
+
hostData.dependencies,
|
|
108
|
+
hostData.cli?.webpack?.['shared-dependencies']
|
|
109
|
+
);
|
|
110
|
+
const exposedDependencies = getExposedDependencies(
|
|
111
|
+
hostSharedDependencies,
|
|
112
|
+
hostData.dependencies
|
|
113
|
+
);
|
|
114
|
+
const mismatchResult = getVersionMismatches(
|
|
115
|
+
exposedDependencies,
|
|
116
|
+
mfeMetadata.dependencies,
|
|
117
|
+
mfeSharedDependencies
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
const isHostMfe = isWebComponent(hostData);
|
|
121
|
+
const isSharedDependenciesEnabled =
|
|
122
|
+
hostData.cli?.webpack?.['expose-shared-dependencies'] === true;
|
|
123
|
+
const compatible = !isHostMfe && !mismatchResult && isSharedDependenciesEnabled;
|
|
124
|
+
|
|
125
|
+
return {
|
|
126
|
+
name: mfeMetadata.name,
|
|
127
|
+
compatible,
|
|
128
|
+
bundleType: compatible ? 'light' : 'full',
|
|
129
|
+
isSharedDependenciesEnabled,
|
|
130
|
+
isHostMfe,
|
|
131
|
+
...(mismatchResult ? { mismatches: mismatchResult } : {}),
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
private outputJson(result: CompatibilityResult) {
|
|
136
|
+
process.stdout.write(JSON.stringify(result, null, 2) + '\n');
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
private outputHumanReadable(result: CompatibilityResult) {
|
|
140
|
+
log.info(`Checking ${result.name}...`);
|
|
141
|
+
|
|
142
|
+
if (result.isHostMfe) {
|
|
143
|
+
log.error('Skipping compatibility check because host is an MFE');
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (result.compatible) {
|
|
148
|
+
log.info('Compatible: light bundle can be used');
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
if (result.mismatches) {
|
|
153
|
+
log.error('Dependency mismatch found:');
|
|
154
|
+
|
|
155
|
+
for (const [dep, versions] of Object.entries(result.mismatches)) {
|
|
156
|
+
log.error(` ${dep}: host=${versions.host}, package=${versions.package}`);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
if (!result.isSharedDependenciesEnabled) {
|
|
161
|
+
log.error('expose-shared-dependencies is not enabled in host package.json');
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
log.error('Result: full bundle required');
|
|
165
|
+
}
|
|
166
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import {
|
|
4
|
+
getFolders,
|
|
5
|
+
getPackageData,
|
|
6
|
+
getPackageName,
|
|
7
|
+
isWebComponent,
|
|
8
|
+
loadSharedDependencies,
|
|
9
|
+
log,
|
|
10
|
+
logErrors,
|
|
11
|
+
} from '../../utils';
|
|
12
|
+
import { buildMetadata } from '../../webpack/configs/utils/build-metadata';
|
|
13
|
+
import { Command, CommandOptions } from './types';
|
|
14
|
+
|
|
15
|
+
const options = {
|
|
16
|
+
output: {
|
|
17
|
+
description: 'Output file path (outputs to stdout if not specified)',
|
|
18
|
+
string: true,
|
|
19
|
+
},
|
|
20
|
+
} satisfies CommandOptions;
|
|
21
|
+
|
|
22
|
+
export class MfeGenerateMetadata extends Command<typeof options> {
|
|
23
|
+
static readonly allowRunFromGlobal = true;
|
|
24
|
+
static readonly description = 'Generate MFE metadata for compatibility checking';
|
|
25
|
+
static readonly options = options;
|
|
26
|
+
|
|
27
|
+
@logErrors
|
|
28
|
+
async execute() {
|
|
29
|
+
if (!isWebComponent()) {
|
|
30
|
+
throw new Error('this command must be run inside a web-component directory');
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const { output } = this.args;
|
|
34
|
+
|
|
35
|
+
const { destination } = getFolders();
|
|
36
|
+
const name = getPackageName();
|
|
37
|
+
const packageData = getPackageData();
|
|
38
|
+
const sharedDependencies = loadSharedDependencies(
|
|
39
|
+
packageData.dependencies,
|
|
40
|
+
packageData.sharedDependencies
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
const metadata = buildMetadata({
|
|
44
|
+
destination,
|
|
45
|
+
name,
|
|
46
|
+
version: packageData.version,
|
|
47
|
+
dependencies: packageData.dependencies,
|
|
48
|
+
sharedDependencies,
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const jsonOutput = JSON.stringify(metadata, null, 2);
|
|
52
|
+
|
|
53
|
+
if (output) {
|
|
54
|
+
const outputPath = path.resolve(output);
|
|
55
|
+
const outputDir = path.dirname(outputPath);
|
|
56
|
+
|
|
57
|
+
if (!fs.existsSync(outputDir)) {
|
|
58
|
+
fs.mkdirSync(outputDir, { recursive: true });
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
fs.writeFileSync(outputPath, jsonOutput, 'utf8');
|
|
62
|
+
log.info(`Metadata written to ${outputPath}`);
|
|
63
|
+
} else {
|
|
64
|
+
process.stdout.write(jsonOutput + '\n');
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return Promise.resolve();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -11,38 +11,33 @@ import {
|
|
|
11
11
|
logErrors,
|
|
12
12
|
PackageType,
|
|
13
13
|
} from '../../utils';
|
|
14
|
-
import { Command, CommandArgs } from './types';
|
|
15
14
|
import { isTTY, NPMPackageInfo, npmView, runCommand } from '../utils';
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
15
|
+
import { Command, CommandOptions } from './types';
|
|
16
|
+
import { DEFAULT_MFE_REGISTRY } from './utils';
|
|
17
|
+
|
|
18
|
+
const options = {
|
|
19
|
+
_: { description: '[packageNames...]', array: true, string: true },
|
|
20
|
+
all: { boolean: true, description: 'List all published versions ' },
|
|
21
|
+
ignore: {
|
|
22
|
+
array: true,
|
|
23
|
+
string: true,
|
|
24
|
+
description: 'Exclude MFEs with names matching specified glob pattern ',
|
|
25
|
+
},
|
|
26
|
+
limit: {
|
|
27
|
+
number: true,
|
|
28
|
+
description: 'List only the specified number of published versions',
|
|
29
|
+
},
|
|
30
|
+
packageNames: { array: true, string: true, hidden: true },
|
|
31
|
+
registry: { string: true, hidden: true },
|
|
32
|
+
tagged: { boolean: true, description: 'List only tagged versions' },
|
|
33
|
+
} satisfies CommandOptions;
|
|
26
34
|
|
|
27
35
|
const collator = new Intl.Collator();
|
|
28
36
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
export class MFEList extends Command<Args> {
|
|
37
|
+
export class MFEList extends Command<typeof options> {
|
|
38
|
+
static readonly allowRunFromGlobal = true;
|
|
32
39
|
static readonly description = 'List published MFE packages';
|
|
33
|
-
static readonly options =
|
|
34
|
-
_: { description: '[packageNames...]' },
|
|
35
|
-
all: { boolean: true, description: 'List all published versions ' },
|
|
36
|
-
ignore: {
|
|
37
|
-
array: true,
|
|
38
|
-
description: 'Exclude MFEs with names matching specified glob pattern ',
|
|
39
|
-
},
|
|
40
|
-
limit: {
|
|
41
|
-
number: true,
|
|
42
|
-
description: 'List only the specified number of published versions',
|
|
43
|
-
},
|
|
44
|
-
tagged: { boolean: true, description: 'List only tagged versions' },
|
|
45
|
-
};
|
|
40
|
+
static readonly options = options;
|
|
46
41
|
|
|
47
42
|
@logErrors
|
|
48
43
|
async execute() {
|
|
@@ -130,7 +125,10 @@ export class MFEList extends Command<Args> {
|
|
|
130
125
|
}
|
|
131
126
|
|
|
132
127
|
private async login() {
|
|
133
|
-
if (
|
|
128
|
+
if (
|
|
129
|
+
this.registry !== DEFAULT_MFE_REGISTRY ||
|
|
130
|
+
npmWhoAmI({ registry: this.registry }) !== undefined
|
|
131
|
+
) {
|
|
134
132
|
return;
|
|
135
133
|
}
|
|
136
134
|
|
|
@@ -157,7 +155,7 @@ export class MFEList extends Command<Args> {
|
|
|
157
155
|
}
|
|
158
156
|
|
|
159
157
|
private get packageNames() {
|
|
160
|
-
const { _, packageNames = [] } = this.args;
|
|
158
|
+
const { _ = [], packageNames = [] } = this.args;
|
|
161
159
|
if (_.length || packageNames.length) {
|
|
162
160
|
return [..._, ...packageNames];
|
|
163
161
|
}
|
|
@@ -169,6 +167,6 @@ export class MFEList extends Command<Args> {
|
|
|
169
167
|
}
|
|
170
168
|
|
|
171
169
|
private get registry() {
|
|
172
|
-
return this.args.registry ??
|
|
170
|
+
return this.args.registry ?? DEFAULT_MFE_REGISTRY;
|
|
173
171
|
}
|
|
174
172
|
}
|
|
@@ -1,38 +1,33 @@
|
|
|
1
1
|
import { getBranchesConfigs, isWebComponent, log, logErrors, readJson } from '../../utils';
|
|
2
2
|
import { gitGetBranch, npmGetPackageVersionsDetails, npmUnpublish, Version } from '../utils';
|
|
3
|
-
import { Command,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
boolean: true,
|
|
32
|
-
description: 'Take no action and only log what would be unpublished',
|
|
33
|
-
},
|
|
34
|
-
registry: { string: true, hidden: true, description: 'Registry url' },
|
|
35
|
-
};
|
|
3
|
+
import { Command, CommandOptions } from './types';
|
|
4
|
+
import { DEFAULT_MFE_REGISTRY } from './utils';
|
|
5
|
+
|
|
6
|
+
export const mfePackageCleanOptions = {
|
|
7
|
+
all: {
|
|
8
|
+
boolean: true,
|
|
9
|
+
description: 'Unpublish old versions from all branches',
|
|
10
|
+
defaultDescription: 'false',
|
|
11
|
+
},
|
|
12
|
+
branch: {
|
|
13
|
+
string: true,
|
|
14
|
+
description: 'Branch name of versions to unpublish',
|
|
15
|
+
defaultDescription: 'current git branch',
|
|
16
|
+
},
|
|
17
|
+
count: {
|
|
18
|
+
number: true,
|
|
19
|
+
description: 'Keep the specified number of old versions',
|
|
20
|
+
defaultDescription: '5',
|
|
21
|
+
},
|
|
22
|
+
dry: {
|
|
23
|
+
boolean: true,
|
|
24
|
+
description: 'Take no action and only log what would be unpublished',
|
|
25
|
+
},
|
|
26
|
+
registry: { string: true, hidden: true, description: 'Registry url' },
|
|
27
|
+
} satisfies CommandOptions;
|
|
28
|
+
|
|
29
|
+
export class MFEPackageClean extends Command<typeof mfePackageCleanOptions> {
|
|
30
|
+
static readonly options = mfePackageCleanOptions;
|
|
36
31
|
|
|
37
32
|
@logErrors
|
|
38
33
|
async execute() {
|
|
@@ -109,7 +104,7 @@ export class MFEPackageClean extends Command<Args> {
|
|
|
109
104
|
branches = [gitGetBranch()];
|
|
110
105
|
}
|
|
111
106
|
|
|
112
|
-
const registry = this.args.registry ??
|
|
107
|
+
const registry = this.args.registry ?? DEFAULT_MFE_REGISTRY;
|
|
113
108
|
|
|
114
109
|
return { count, registry, branches };
|
|
115
110
|
}
|