@servicetitan/startup 33.1.0 → 34.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/commands/build.d.ts +48 -22
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +72 -52
- package/dist/cli/commands/build.js.map +1 -1
- package/dist/cli/commands/bundle-package.d.ts +54 -10
- package/dist/cli/commands/bundle-package.d.ts.map +1 -1
- package/dist/cli/commands/bundle-package.js +40 -0
- package/dist/cli/commands/bundle-package.js.map +1 -1
- package/dist/cli/commands/clean.d.ts +4 -0
- package/dist/cli/commands/clean.d.ts.map +1 -1
- package/dist/cli/commands/clean.js +50 -16
- package/dist/cli/commands/clean.js.map +1 -1
- package/dist/cli/commands/convert-eslint-config.d.ts +1 -1
- package/dist/cli/commands/convert-eslint-config.d.ts.map +1 -1
- package/dist/cli/commands/convert-eslint-config.js +2 -15
- package/dist/cli/commands/convert-eslint-config.js.map +1 -1
- package/dist/cli/commands/eslint.d.ts +29 -7
- package/dist/cli/commands/eslint.d.ts.map +1 -1
- package/dist/cli/commands/eslint.js +18 -6
- package/dist/cli/commands/eslint.js.map +1 -1
- package/dist/cli/commands/get-command.d.ts.map +1 -1
- package/dist/cli/commands/get-command.js +6 -0
- package/dist/cli/commands/get-command.js.map +1 -1
- package/dist/cli/commands/index.d.ts +2 -2
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +2 -2
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.d.ts +10 -6
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +8 -6
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/install.d.ts +27 -15
- package/dist/cli/commands/install.d.ts.map +1 -1
- package/dist/cli/commands/install.js +18 -16
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/kendo-ui-license.d.ts +1 -0
- package/dist/cli/commands/kendo-ui-license.d.ts.map +1 -1
- package/dist/cli/commands/kendo-ui-license.js +1 -0
- package/dist/cli/commands/kendo-ui-license.js.map +1 -1
- package/dist/cli/commands/lint.d.ts +51 -17
- package/dist/cli/commands/lint.d.ts.map +1 -1
- package/dist/cli/commands/lint.js +36 -26
- package/dist/cli/commands/lint.js.map +1 -1
- package/dist/cli/commands/mfe-check.d.ts +52 -0
- package/dist/cli/commands/mfe-check.d.ts.map +1 -0
- package/dist/cli/commands/mfe-check.js +145 -0
- package/dist/cli/commands/mfe-check.js.map +1 -0
- package/dist/cli/commands/mfe-generate-metadata.d.ts +20 -0
- package/dist/cli/commands/mfe-generate-metadata.d.ts.map +1 -0
- package/dist/cli/commands/mfe-generate-metadata.js +93 -0
- package/dist/cli/commands/mfe-generate-metadata.js.map +1 -0
- package/dist/cli/commands/mfe-list.d.ts +52 -15
- package/dist/cli/commands/mfe-list.d.ts.map +1 -1
- package/dist/cli/commands/mfe-list.js +42 -29
- package/dist/cli/commands/mfe-list.js.map +1 -1
- package/dist/cli/commands/mfe-package-clean.d.ts +34 -15
- package/dist/cli/commands/mfe-package-clean.d.ts.map +1 -1
- package/dist/cli/commands/mfe-package-clean.js +43 -34
- package/dist/cli/commands/mfe-package-clean.js.map +1 -1
- package/dist/cli/commands/mfe-package-publish.d.ts +60 -22
- package/dist/cli/commands/mfe-package-publish.d.ts.map +1 -1
- package/dist/cli/commands/mfe-package-publish.js +137 -78
- package/dist/cli/commands/mfe-package-publish.js.map +1 -1
- package/dist/cli/commands/mfe-package-rollback.d.ts +40 -0
- package/dist/cli/commands/mfe-package-rollback.d.ts.map +1 -0
- package/dist/cli/commands/mfe-package-rollback.js +119 -0
- package/dist/cli/commands/mfe-package-rollback.js.map +1 -0
- package/dist/cli/commands/mfe-publish.d.ts +36 -11
- package/dist/cli/commands/mfe-publish.d.ts.map +1 -1
- package/dist/cli/commands/mfe-publish.js +72 -22
- package/dist/cli/commands/mfe-publish.js.map +1 -1
- package/dist/cli/commands/prepare-package.d.ts +14 -5
- package/dist/cli/commands/prepare-package.d.ts.map +1 -1
- package/dist/cli/commands/prepare-package.js +20 -0
- package/dist/cli/commands/prepare-package.js.map +1 -1
- package/dist/cli/commands/review/review.d.ts +17 -8
- package/dist/cli/commands/review/review.d.ts.map +1 -1
- package/dist/cli/commands/review/review.js +16 -21
- package/dist/cli/commands/review/review.js.map +1 -1
- package/dist/cli/commands/review/rules/index.d.ts.map +1 -1
- package/dist/cli/commands/review/rules/index.js +3 -1
- package/dist/cli/commands/review/rules/index.js.map +1 -1
- package/dist/cli/commands/review/rules/no-deprecated-content-base.js.map +1 -1
- package/dist/cli/commands/review/rules/prefer-open-ended-peer-dependencies.js.map +1 -1
- package/dist/cli/commands/review/rules/require-compatible-launch-darkly-sdk.js +4 -4
- package/dist/cli/commands/review/rules/require-compatible-launch-darkly-sdk.js.map +1 -1
- package/dist/cli/commands/review/rules/require-one-collection-version.js +1 -2
- package/dist/cli/commands/review/rules/require-one-collection-version.js.map +1 -1
- package/dist/cli/commands/review/rules/require-one-uikit-version.d.ts.map +1 -1
- package/dist/cli/commands/review/rules/require-one-uikit-version.js +1 -0
- package/dist/cli/commands/review/rules/require-one-uikit-version.js.map +1 -1
- package/dist/cli/commands/review/rules/require-project-version-in-root-node-modules.d.ts.map +1 -1
- package/dist/cli/commands/review/rules/require-project-version-in-root-node-modules.js +8 -8
- package/dist/cli/commands/review/rules/require-project-version-in-root-node-modules.js.map +1 -1
- package/dist/cli/commands/review/rules/require-tsconfig-references.d.ts +24 -0
- package/dist/cli/commands/review/rules/require-tsconfig-references.d.ts.map +1 -0
- package/dist/cli/commands/review/rules/require-tsconfig-references.js +146 -0
- package/dist/cli/commands/review/rules/require-tsconfig-references.js.map +1 -0
- package/dist/cli/commands/review/utils/collate-dependencies.js +1 -3
- package/dist/cli/commands/review/utils/collate-dependencies.js.map +1 -1
- package/dist/cli/commands/review/utils/compare-version.js +2 -2
- package/dist/cli/commands/review/utils/compare-version.js.map +1 -1
- package/dist/cli/commands/review/utils/set-version.js +1 -1
- package/dist/cli/commands/review/utils/set-version.js.map +1 -1
- package/dist/cli/commands/run-task.d.ts +29 -7
- package/dist/cli/commands/run-task.d.ts.map +1 -1
- package/dist/cli/commands/run-task.js +21 -8
- package/dist/cli/commands/run-task.js.map +1 -1
- package/dist/cli/commands/run-task.test.js +14 -2
- package/dist/cli/commands/run-task.test.js.map +1 -1
- package/dist/cli/commands/start.d.ts +38 -18
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +65 -45
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/stylelint.d.ts +29 -7
- package/dist/cli/commands/stylelint.d.ts.map +1 -1
- package/dist/cli/commands/stylelint.js +18 -6
- package/dist/cli/commands/stylelint.js.map +1 -1
- package/dist/cli/commands/test/runners/vitest.js +1 -1
- package/dist/cli/commands/test/runners/vitest.js.map +1 -1
- package/dist/cli/commands/test/tests.d.ts +25 -5
- package/dist/cli/commands/test/tests.d.ts.map +1 -1
- package/dist/cli/commands/test/tests.js +22 -14
- package/dist/cli/commands/test/tests.js.map +1 -1
- package/dist/cli/commands/types.d.ts +51 -10
- package/dist/cli/commands/types.d.ts.map +1 -1
- package/dist/cli/commands/types.js +1 -0
- package/dist/cli/commands/types.js.map +1 -1
- package/dist/cli/commands/upload-sourcemaps.d.ts +26 -6
- package/dist/cli/commands/upload-sourcemaps.d.ts.map +1 -1
- package/dist/cli/commands/upload-sourcemaps.js +27 -4
- package/dist/cli/commands/upload-sourcemaps.js.map +1 -1
- package/dist/cli/commands/utils.d.ts +4 -0
- package/dist/cli/commands/utils.d.ts.map +1 -0
- package/dist/cli/commands/utils.js +28 -0
- package/dist/cli/commands/utils.js.map +1 -0
- package/dist/cli/index.js +8 -5
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/tasks/cli-task.d.ts.map +1 -1
- package/dist/cli/tasks/cli-task.js +1 -1
- package/dist/cli/tasks/cli-task.js.map +1 -1
- package/dist/cli/tasks/swc-compile-package.d.ts +1 -2
- package/dist/cli/tasks/swc-compile-package.d.ts.map +1 -1
- package/dist/cli/tasks/swc-compile-package.js.map +1 -1
- package/dist/cli/tasks/tsc-compile-package.d.ts +1 -2
- package/dist/cli/tasks/tsc-compile-package.d.ts.map +1 -1
- package/dist/cli/tasks/tsc-compile-package.js.map +1 -1
- package/dist/cli/tasks/tsc-compile.d.ts +1 -2
- package/dist/cli/tasks/tsc-compile.d.ts.map +1 -1
- package/dist/cli/tasks/tsc-compile.js.map +1 -1
- package/dist/cli/utils/bundle.d.ts.map +1 -1
- package/dist/cli/utils/bundle.js +2 -2
- package/dist/cli/utils/bundle.js.map +1 -1
- package/dist/cli/utils/check-startup-location.d.ts +4 -0
- package/dist/cli/utils/check-startup-location.d.ts.map +1 -0
- package/dist/cli/utils/check-startup-location.js +27 -0
- package/dist/cli/utils/check-startup-location.js.map +1 -0
- package/dist/cli/utils/cli-npm.d.ts +6 -0
- package/dist/cli/utils/cli-npm.d.ts.map +1 -1
- package/dist/cli/utils/cli-npm.js +25 -3
- package/dist/cli/utils/cli-npm.js.map +1 -1
- package/dist/cli/utils/compile-less.js +1 -1
- package/dist/cli/utils/compile-less.js.map +1 -1
- package/dist/cli/utils/constants.d.ts +2 -0
- package/dist/cli/utils/constants.d.ts.map +1 -0
- package/dist/cli/utils/constants.js +13 -0
- package/dist/cli/utils/constants.js.map +1 -0
- package/dist/cli/utils/copy-files.d.ts.map +1 -1
- package/dist/cli/utils/copy-files.js.map +1 -1
- package/dist/cli/utils/eslint.d.ts +1 -2
- package/dist/cli/utils/eslint.d.ts.map +1 -1
- package/dist/cli/utils/eslint.js.map +1 -1
- package/dist/cli/utils/index.d.ts +2 -0
- package/dist/cli/utils/index.d.ts.map +1 -1
- package/dist/cli/utils/index.js +2 -0
- package/dist/cli/utils/index.js.map +1 -1
- package/dist/cli/utils/is-module-installed.js +1 -1
- package/dist/cli/utils/is-module-installed.js.map +1 -1
- package/dist/cli/utils/lerna-exec.d.ts.map +1 -1
- package/dist/cli/utils/lerna-exec.js +1 -3
- package/dist/cli/utils/lerna-exec.js.map +1 -1
- package/dist/cli/utils/process-tree.js.map +1 -1
- package/dist/cli/utils/set-node-options.js +2 -4
- package/dist/cli/utils/set-node-options.js.map +1 -1
- package/dist/cli/utils/stylelint.d.ts +1 -2
- package/dist/cli/utils/stylelint.d.ts.map +1 -1
- package/dist/cli/utils/stylelint.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/jest/resolver.js +2 -2
- package/dist/jest/resolver.js.map +1 -1
- package/dist/jest/svg-transformer.d.ts.map +1 -1
- package/dist/jest/svg-transformer.js.map +1 -1
- package/dist/utils/find-packages.js +1 -1
- package/dist/utils/find-packages.js.map +1 -1
- package/dist/utils/format-relative-date.js +1 -1
- package/dist/utils/format-relative-date.js.map +1 -1
- package/dist/utils/get-configuration.d.ts +3 -0
- package/dist/utils/get-configuration.d.ts.map +1 -1
- package/dist/utils/get-configuration.js +14 -11
- package/dist/utils/get-configuration.js.map +1 -1
- package/dist/utils/get-destination-folders.d.ts.map +1 -1
- package/dist/utils/get-destination-folders.js.map +1 -1
- package/dist/utils/get-folders.d.ts.map +1 -1
- package/dist/utils/get-folders.js.map +1 -1
- package/dist/utils/get-jest-config.js +1 -1
- package/dist/utils/get-jest-config.js.map +1 -1
- package/dist/utils/get-package-data.js +1 -1
- package/dist/utils/get-package-data.js.map +1 -1
- package/dist/utils/get-packages.js.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/load-shared-dependencies.js.map +1 -1
- package/dist/utils/prettify.d.ts +13 -0
- package/dist/utils/prettify.d.ts.map +1 -0
- package/dist/utils/prettify.js +48 -0
- package/dist/utils/prettify.js.map +1 -0
- package/dist/utils/read-json.js +1 -1
- package/dist/utils/read-json.js.map +1 -1
- package/dist/utils/transform-svg.js +2 -2
- package/dist/utils/transform-svg.js.map +1 -1
- package/dist/webpack/configs/cache-config.js +1 -1
- package/dist/webpack/configs/cache-config.js.map +1 -1
- package/dist/webpack/configs/optimization-config.js +3 -4
- package/dist/webpack/configs/optimization-config.js.map +1 -1
- package/dist/webpack/configs/output-config.js +1 -1
- package/dist/webpack/configs/output-config.js.map +1 -1
- package/dist/webpack/configs/plugins/assets-manifest-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/assets-manifest-plugin.js +5 -5
- package/dist/webpack/configs/plugins/assets-manifest-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/bundle-analyser-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/bundle-analyser-plugin.js +1 -1
- package/dist/webpack/configs/plugins/bundle-analyser-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.js +6 -9
- package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/html-tags-plugin.js +1 -1
- package/dist/webpack/configs/plugins/html-tags-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/check-resource.js +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/check-resource.js.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/moment-locales-plugin.js +1 -1
- package/dist/webpack/configs/plugins/moment-locales-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/watch-run-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/watch-run-plugin.js.map +1 -1
- package/dist/webpack/configs/types.d.ts +1 -0
- package/dist/webpack/configs/types.d.ts.map +1 -1
- package/dist/webpack/configs/utils/build-metadata.d.ts +10 -0
- package/dist/webpack/configs/utils/build-metadata.d.ts.map +1 -0
- package/dist/webpack/configs/utils/build-metadata.js +50 -0
- package/dist/webpack/configs/utils/build-metadata.js.map +1 -0
- package/dist/webpack/configs/utils/generate-metadata.d.ts.map +1 -1
- package/dist/webpack/configs/utils/generate-metadata.js +5 -24
- package/dist/webpack/configs/utils/generate-metadata.js.map +1 -1
- package/dist/webpack/configs/utils/get-exposed-dependencies.d.ts +3 -0
- package/dist/webpack/configs/utils/get-exposed-dependencies.d.ts.map +1 -0
- package/dist/webpack/configs/utils/get-exposed-dependencies.js +21 -0
- package/dist/webpack/configs/utils/get-exposed-dependencies.js.map +1 -0
- package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.js +1 -1
- package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.js.map +1 -1
- package/dist/webpack/configs/utils/index.d.ts +1 -0
- package/dist/webpack/configs/utils/index.d.ts.map +1 -1
- package/dist/webpack/configs/utils/index.js +1 -0
- package/dist/webpack/configs/utils/index.js.map +1 -1
- package/dist/webpack/create-webpack-config.js +10 -4
- package/dist/webpack/create-webpack-config.js.map +1 -1
- package/dist/webpack/loaders/expose-loader/index.d.ts.map +1 -1
- package/dist/webpack/loaders/expose-loader/index.js.map +1 -1
- package/dist/webpack/loaders/expose-loader/runtime/get-global-this.js +1 -1
- package/dist/webpack/loaders/expose-loader/runtime/get-global-this.js.map +1 -1
- package/dist/webpack/loaders/expose-loader/utils/get-new-user-request.js +2 -2
- package/dist/webpack/loaders/expose-loader/utils/get-new-user-request.js.map +1 -1
- package/dist/webpack/utils/stringify-config.js +2 -2
- package/dist/webpack/utils/stringify-config.js.map +1 -1
- package/dist/webpack/utils/testing/get-compiler.d.ts.map +1 -1
- package/dist/webpack/utils/testing/get-compiler.js +1 -1
- package/dist/webpack/utils/testing/get-compiler.js.map +1 -1
- package/dist/webpack/utils/testing/get-errors.d.ts.map +1 -1
- package/dist/webpack/utils/testing/get-errors.js.map +1 -1
- package/dist/webpack/utils/testing/get-warnings.d.ts.map +1 -1
- package/dist/webpack/utils/testing/get-warnings.js.map +1 -1
- package/dist/webpack/utils/testing/read-asset.d.ts.map +1 -1
- package/dist/webpack/utils/testing/read-asset.js +1 -1
- package/dist/webpack/utils/testing/read-asset.js.map +1 -1
- package/dist/webpack/utils/testing/read-assets.d.ts.map +1 -1
- package/dist/webpack/utils/testing/read-assets.js.map +1 -1
- package/package.json +35 -41
- package/src/cli/commands/__tests__/build.test.ts +32 -9
- package/src/cli/commands/__tests__/bundle-package.test.ts +2 -1
- package/src/cli/commands/__tests__/clean.test.ts +99 -8
- package/src/cli/commands/__tests__/convert-eslint-config.test.ts +14 -9
- package/src/cli/commands/__tests__/eslint.test.ts +1 -1
- package/src/cli/commands/__tests__/get-command.test.ts +3 -1
- package/src/cli/commands/__tests__/init.test.ts +14 -1
- package/src/cli/commands/__tests__/install.test.ts +6 -2
- package/src/cli/commands/__tests__/kendo-ui-license.test.ts +7 -2
- package/src/cli/commands/__tests__/lint.test.ts +4 -2
- package/src/cli/commands/__tests__/mfe-check.test.ts +346 -0
- package/src/cli/commands/__tests__/mfe-generate-metadata.test.ts +160 -0
- package/src/cli/commands/__tests__/mfe-list.test.ts +8 -1
- package/src/cli/commands/__tests__/mfe-package-clean.test.ts +0 -1
- package/src/cli/commands/__tests__/mfe-package-publish.test.ts +322 -93
- package/src/cli/commands/__tests__/mfe-package-rollback.test.ts +196 -0
- package/src/cli/commands/__tests__/mfe-publish.test.ts +65 -5
- package/src/cli/commands/__tests__/prepare-package.test.ts +3 -0
- package/src/cli/commands/__tests__/start.test.ts +30 -7
- package/src/cli/commands/__tests__/stylelint.test.ts +1 -1
- package/src/cli/commands/__tests__/styles-check.test.ts +1 -2
- package/src/cli/commands/__tests__/upload-sourcemaps.test.ts +3 -6
- package/src/cli/commands/build.ts +35 -26
- package/src/cli/commands/bundle-package.ts +11 -10
- package/src/cli/commands/clean.ts +51 -5
- package/src/cli/commands/convert-eslint-config.ts +3 -12
- package/src/cli/commands/eslint.ts +9 -11
- package/src/cli/commands/get-command.ts +6 -1
- package/src/cli/commands/index.ts +2 -2
- package/src/cli/commands/init.ts +7 -9
- package/src/cli/commands/install.ts +11 -13
- package/src/cli/commands/kendo-ui-license.ts +1 -1
- package/src/cli/commands/lint.ts +12 -18
- package/src/cli/commands/mfe-check.ts +166 -0
- package/src/cli/commands/mfe-generate-metadata.ts +69 -0
- package/src/cli/commands/mfe-list.ts +28 -30
- package/src/cli/commands/mfe-package-clean.ts +29 -34
- package/src/cli/commands/mfe-package-publish.ts +153 -87
- package/src/cli/commands/mfe-package-rollback.ts +100 -0
- package/src/cli/commands/mfe-publish.ts +80 -27
- package/src/cli/commands/prepare-package.ts +6 -5
- package/src/cli/commands/review/__tests__/review.test.ts +18 -19
- package/src/cli/commands/review/review.ts +11 -20
- package/src/cli/commands/review/rules/__tests__/no-deprecated-content-base.test.ts +1 -1
- package/src/cli/commands/review/rules/__tests__/no-deprecated-startup-install.test.ts +0 -1
- package/src/cli/commands/review/rules/__tests__/no-direct-peer-dependencies.test.ts +1 -1
- package/src/cli/commands/review/rules/__tests__/no-typescript-entry-point.test.ts +0 -1
- package/src/cli/commands/review/rules/__tests__/require-all-react-dependencies.test.ts +0 -1
- package/src/cli/commands/review/rules/__tests__/require-compatible-launch-darkly-sdk.test.ts +2 -2
- package/src/cli/commands/review/rules/__tests__/require-explicit-side-effects.test.ts +0 -1
- package/src/cli/commands/review/rules/__tests__/require-npmrc.test.ts +0 -1
- package/src/cli/commands/review/rules/__tests__/require-one-anvil-uikit-contrib-version.test.ts +1 -2
- package/src/cli/commands/review/rules/__tests__/require-one-collection-version.test.ts +0 -1
- package/src/cli/commands/review/rules/__tests__/require-one-package-version.test.ts +0 -1
- package/src/cli/commands/review/rules/__tests__/require-one-react-version.test.ts +0 -1
- package/src/cli/commands/review/rules/__tests__/require-one-uikit-version.test.ts +1 -1
- package/src/cli/commands/review/rules/__tests__/require-project-version-in-root-node-modules.test.ts +2 -3
- package/src/cli/commands/review/rules/__tests__/require-servicetitan-scope.test.ts +0 -1
- package/src/cli/commands/review/rules/__tests__/require-tsconfig-references.test.ts +315 -0
- package/src/cli/commands/review/rules/index.ts +2 -0
- package/src/cli/commands/review/rules/require-compatible-launch-darkly-sdk.ts +1 -1
- package/src/cli/commands/review/rules/require-one-uikit-version.ts +1 -0
- package/src/cli/commands/review/rules/require-project-version-in-root-node-modules.ts +3 -3
- package/src/cli/commands/review/rules/require-tsconfig-references.ts +157 -0
- package/src/cli/commands/review/utils/__tests__/set-version.test.ts +0 -1
- package/src/cli/commands/run-task.test.ts +15 -3
- package/src/cli/commands/run-task.ts +12 -14
- package/src/cli/commands/start.ts +75 -59
- package/src/cli/commands/stylelint.ts +9 -11
- package/src/cli/commands/test/runners/__tests__/jest.test.ts +1 -2
- package/src/cli/commands/test/runners/vitest.ts +1 -1
- package/src/cli/commands/test/tests.ts +13 -15
- package/src/cli/commands/types.ts +53 -7
- package/src/cli/commands/upload-sourcemaps.ts +14 -12
- package/src/cli/commands/utils.ts +6 -0
- package/src/cli/index.ts +11 -7
- package/src/cli/tasks/__tests__/cli-task.test.ts +1 -1
- package/src/cli/tasks/__tests__/swc-compile-package.test.ts +3 -1
- package/src/cli/tasks/__tests__/tsc-compile-package.test.ts +2 -0
- package/src/cli/tasks/__tests__/tsc-compile.test.ts +3 -13
- package/src/cli/tasks/cli-task.ts +1 -1
- package/src/cli/tasks/swc-compile-package.ts +1 -3
- package/src/cli/tasks/tsc-compile-package.ts +1 -2
- package/src/cli/tasks/tsc-compile.ts +1 -2
- package/src/cli/utils/__tests__/bundle.test.ts +1 -2
- package/src/cli/utils/__tests__/check-args.test.ts +1 -1
- package/src/cli/utils/__tests__/check-startup-location.test.ts +88 -0
- package/src/cli/utils/__tests__/cli-git.test.ts +1 -2
- package/src/cli/utils/__tests__/cli-npm.test.ts +51 -2
- package/src/cli/utils/__tests__/cli-os.test.ts +1 -2
- package/src/cli/utils/__tests__/compile.test.ts +1 -1
- package/src/cli/utils/__tests__/copy-files.test.ts +0 -1
- package/src/cli/utils/__tests__/eslint.test.ts +1 -1
- package/src/cli/utils/__tests__/lerna-exec.test.ts +1 -2
- package/src/cli/utils/__tests__/maybe-create-git-folder.test.ts +0 -1
- package/src/cli/utils/__tests__/set-node-options.test.ts +0 -1
- package/src/cli/utils/__tests__/stylelint.test.ts +1 -1
- package/src/cli/utils/bundle.ts +1 -3
- package/src/cli/utils/check-startup-location.ts +21 -0
- package/src/cli/utils/cli-npm.ts +22 -0
- package/src/cli/utils/compile-less.ts +1 -1
- package/src/cli/utils/constants.ts +1 -0
- package/src/cli/utils/copy-files.ts +0 -1
- package/src/cli/utils/eslint.ts +1 -3
- package/src/cli/utils/index.ts +2 -0
- package/src/cli/utils/lerna-exec.ts +0 -1
- package/src/cli/utils/stylelint.ts +1 -2
- package/src/index.ts +1 -1
- package/src/jest/svg-transformer.ts +0 -1
- package/src/utils/__tests__/get-branch-configs.test.ts +0 -1
- package/src/utils/__tests__/get-configuration.test.ts +0 -1
- package/src/utils/__tests__/get-destination-folders.test.ts +1 -2
- package/src/utils/__tests__/get-folders.test.ts +0 -1
- package/src/utils/__tests__/get-jest-config.test.ts +1 -2
- package/src/utils/__tests__/get-package-data.test.ts +1 -2
- package/src/utils/__tests__/get-packages.test.ts +1 -1
- package/src/utils/__tests__/get-startup-version.test.ts +0 -1
- package/src/utils/__tests__/get-tsconfig.test.ts +0 -1
- package/src/utils/__tests__/load-shared-dependencies.test.ts +1 -1
- package/src/utils/__tests__/log.test.ts +1 -1
- package/src/utils/__tests__/prettify.test.ts +80 -0
- package/src/utils/__tests__/read-json.test.ts +0 -1
- package/src/utils/find-packages.ts +1 -1
- package/src/utils/get-configuration.ts +8 -7
- package/src/utils/get-destination-folders.ts +0 -1
- package/src/utils/get-folders.ts +0 -1
- package/src/utils/get-jest-config.ts +1 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/prettify.ts +36 -0
- package/src/webpack/__tests__/create-webpack-config-shared-dependencies.test.ts +6 -2
- package/src/webpack/__tests__/create-webpack-config-web-component.test.ts +7 -4
- package/src/webpack/__tests__/create-webpack-config.test.ts +8 -4
- package/src/webpack/configs/cache-config.ts +1 -1
- package/src/webpack/configs/plugins/assets-manifest-plugin.ts +1 -1
- package/src/webpack/configs/plugins/bundle-analyser-plugin.ts +2 -2
- package/src/webpack/configs/plugins/define-exposed-dependencies-plugin.ts +6 -15
- package/src/webpack/configs/plugins/ignore-plugin/__tests__/get-package-json.test.ts +1 -1
- package/src/webpack/configs/plugins/ignore-plugin/__tests__/is-optional-peer-dependency.test.ts +1 -1
- package/src/webpack/configs/plugins/ignore-plugin/ignore-plugin.ts +0 -1
- package/src/webpack/configs/plugins/watch-run-plugin.ts +0 -1
- package/src/webpack/configs/types.ts +1 -0
- package/src/webpack/configs/utils/__tests__/build-metadata.test.ts +71 -0
- package/src/webpack/configs/utils/__tests__/generate-metadata.test.ts +42 -46
- package/src/webpack/configs/utils/__tests__/get-exposed-dependencies.test.ts +39 -0
- package/src/webpack/configs/utils/__tests__/get-web-components-version.test.ts +0 -1
- package/src/webpack/configs/utils/build-metadata.ts +40 -0
- package/src/webpack/configs/utils/generate-metadata.ts +7 -21
- package/src/webpack/configs/utils/get-exposed-dependencies.ts +17 -0
- package/src/webpack/configs/utils/index.ts +1 -0
- package/src/webpack/create-webpack-config.ts +3 -3
- package/src/webpack/loaders/expose-loader/__tests__/index.test.ts +0 -2
- package/src/webpack/loaders/expose-loader/index.ts +0 -1
- package/src/webpack/utils/testing/get-compiler.ts +1 -3
- package/src/webpack/utils/testing/get-errors.ts +0 -1
- package/src/webpack/utils/testing/get-warnings.ts +0 -1
- package/src/webpack/utils/testing/read-asset.ts +1 -2
- package/src/webpack/utils/testing/read-assets.ts +0 -1
|
@@ -1,38 +1,72 @@
|
|
|
1
|
-
import { Command
|
|
2
|
-
|
|
3
|
-
_:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { Command } from './types';
|
|
2
|
+
declare const options: {
|
|
3
|
+
_: {
|
|
4
|
+
description: string;
|
|
5
|
+
array: true;
|
|
6
|
+
string: true;
|
|
7
|
+
};
|
|
8
|
+
fix: {
|
|
9
|
+
boolean: true;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
scope: {
|
|
13
|
+
array: true;
|
|
14
|
+
string: true;
|
|
15
|
+
hidden: true;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
ignore: {
|
|
19
|
+
array: true;
|
|
20
|
+
string: true;
|
|
21
|
+
hidden: true;
|
|
22
|
+
description: string;
|
|
23
|
+
};
|
|
24
|
+
parallel: {
|
|
25
|
+
boolean: true;
|
|
26
|
+
hidden: true;
|
|
27
|
+
description: string;
|
|
28
|
+
};
|
|
29
|
+
paths: {
|
|
30
|
+
array: true;
|
|
31
|
+
string: true;
|
|
32
|
+
hidden: true;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export declare class Lint extends Command<typeof options> {
|
|
11
36
|
static readonly description = "Run eslint and stylelint";
|
|
12
37
|
static readonly greedy = true;
|
|
13
38
|
static readonly options: {
|
|
14
39
|
_: {
|
|
15
40
|
description: string;
|
|
41
|
+
array: true;
|
|
42
|
+
string: true;
|
|
16
43
|
};
|
|
17
44
|
fix: {
|
|
18
|
-
boolean:
|
|
45
|
+
boolean: true;
|
|
19
46
|
description: string;
|
|
20
47
|
};
|
|
21
48
|
scope: {
|
|
22
|
-
array:
|
|
23
|
-
|
|
49
|
+
array: true;
|
|
50
|
+
string: true;
|
|
51
|
+
hidden: true;
|
|
24
52
|
description: string;
|
|
25
53
|
};
|
|
26
54
|
ignore: {
|
|
27
|
-
array:
|
|
28
|
-
|
|
55
|
+
array: true;
|
|
56
|
+
string: true;
|
|
57
|
+
hidden: true;
|
|
29
58
|
description: string;
|
|
30
59
|
};
|
|
31
60
|
parallel: {
|
|
32
|
-
boolean:
|
|
33
|
-
hidden:
|
|
61
|
+
boolean: true;
|
|
62
|
+
hidden: true;
|
|
34
63
|
description: string;
|
|
35
64
|
};
|
|
65
|
+
paths: {
|
|
66
|
+
array: true;
|
|
67
|
+
string: true;
|
|
68
|
+
hidden: true;
|
|
69
|
+
};
|
|
36
70
|
};
|
|
37
71
|
execute(): Promise<void>;
|
|
38
72
|
private eslint;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/lint.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/lint.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAkB,MAAM,SAAS,CAAC;AAElD,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOa,CAAC;AAE3B,qBAAa,IAAK,SAAQ,OAAO,CAAC,OAAO,OAAO,CAAC;IAC7C,MAAM,CAAC,QAAQ,CAAC,WAAW,8BAA8B;IACzD,MAAM,CAAC,QAAQ,CAAC,MAAM,QAAQ;IAC9B,MAAM,CAAC,QAAQ,CAAC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAW;IAE5B,OAAO;YAOC,MAAM;YAoBN,SAAS;YAMT,WAAW;IAYzB,OAAO,CAAC,iBAAiB;IAMzB,OAAO,KAAK,KAAK,GAGhB;CACJ"}
|
|
@@ -9,9 +9,9 @@ Object.defineProperty(exports, "Lint", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _utils = require("../../utils");
|
|
12
|
-
const _types = require("./types");
|
|
13
12
|
const _utils1 = require("../utils");
|
|
14
13
|
const _stylelint = require("../utils/stylelint");
|
|
14
|
+
const _types = require("./types");
|
|
15
15
|
function _define_property(obj, key, value) {
|
|
16
16
|
if (key in obj) {
|
|
17
17
|
Object.defineProperty(obj, key, {
|
|
@@ -34,6 +34,39 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
34
34
|
function _ts_metadata(k, v) {
|
|
35
35
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
36
36
|
}
|
|
37
|
+
const options = {
|
|
38
|
+
_: {
|
|
39
|
+
description: '[paths...]',
|
|
40
|
+
array: true,
|
|
41
|
+
string: true
|
|
42
|
+
},
|
|
43
|
+
fix: {
|
|
44
|
+
boolean: true,
|
|
45
|
+
description: 'Apply fixes for issues?'
|
|
46
|
+
},
|
|
47
|
+
scope: {
|
|
48
|
+
array: true,
|
|
49
|
+
string: true,
|
|
50
|
+
hidden: true,
|
|
51
|
+
description: 'Packages to lint'
|
|
52
|
+
},
|
|
53
|
+
ignore: {
|
|
54
|
+
array: true,
|
|
55
|
+
string: true,
|
|
56
|
+
hidden: true,
|
|
57
|
+
description: 'Packages to skip'
|
|
58
|
+
},
|
|
59
|
+
parallel: {
|
|
60
|
+
boolean: true,
|
|
61
|
+
hidden: true,
|
|
62
|
+
description: 'Lint each package separately'
|
|
63
|
+
},
|
|
64
|
+
paths: {
|
|
65
|
+
array: true,
|
|
66
|
+
string: true,
|
|
67
|
+
hidden: true
|
|
68
|
+
}
|
|
69
|
+
};
|
|
37
70
|
class Lint extends _types.Command {
|
|
38
71
|
async execute() {
|
|
39
72
|
await this.checkStyles();
|
|
@@ -89,7 +122,7 @@ class Lint extends _types.Command {
|
|
|
89
122
|
return !this.paths.length && (parallel || (scope === null || scope === void 0 ? void 0 : scope.length) || (ignore === null || ignore === void 0 ? void 0 : ignore.length));
|
|
90
123
|
}
|
|
91
124
|
get paths() {
|
|
92
|
-
const { _, paths = [] } = this.args;
|
|
125
|
+
const { _ = [], paths = [] } = this.args;
|
|
93
126
|
return [
|
|
94
127
|
..._,
|
|
95
128
|
...paths
|
|
@@ -98,30 +131,7 @@ class Lint extends _types.Command {
|
|
|
98
131
|
}
|
|
99
132
|
_define_property(Lint, "description", 'Run eslint and stylelint');
|
|
100
133
|
_define_property(Lint, "greedy", true);
|
|
101
|
-
_define_property(Lint, "options",
|
|
102
|
-
_: {
|
|
103
|
-
description: '[paths...]'
|
|
104
|
-
},
|
|
105
|
-
fix: {
|
|
106
|
-
boolean: true,
|
|
107
|
-
description: 'Apply fixes for issues?'
|
|
108
|
-
},
|
|
109
|
-
scope: {
|
|
110
|
-
array: true,
|
|
111
|
-
hidden: true,
|
|
112
|
-
description: 'Packages to lint'
|
|
113
|
-
},
|
|
114
|
-
ignore: {
|
|
115
|
-
array: true,
|
|
116
|
-
hidden: true,
|
|
117
|
-
description: 'Packages to skip'
|
|
118
|
-
},
|
|
119
|
-
parallel: {
|
|
120
|
-
boolean: true,
|
|
121
|
-
hidden: true,
|
|
122
|
-
description: 'Lint each package separately'
|
|
123
|
-
}
|
|
124
|
-
});
|
|
134
|
+
_define_property(Lint, "options", options);
|
|
125
135
|
_ts_decorate([
|
|
126
136
|
_utils.logErrors,
|
|
127
137
|
_ts_metadata("design:type", Function),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/cli/commands/lint.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport { getPackages, log, logErrors } from '../../utils';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/cli/commands/lint.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport { getPackages, log, logErrors } from '../../utils';\nimport { eslint, lernaExec } from '../utils';\nimport { stylelint } from '../utils/stylelint';\nimport { Command, CommandOptions } from './types';\n\nconst options = {\n _: { description: '[paths...]', array: true, string: true },\n fix: { boolean: true, description: 'Apply fixes for issues?' },\n scope: { array: true, string: true, hidden: true, description: 'Packages to lint' },\n ignore: { array: true, string: true, hidden: true, description: 'Packages to skip' },\n parallel: { boolean: true, hidden: true, description: 'Lint each package separately' },\n paths: { array: true, string: true, hidden: true },\n} satisfies CommandOptions;\n\nexport class Lint extends Command<typeof options> {\n static readonly description = 'Run eslint and stylelint';\n static readonly greedy = true;\n static readonly options = options;\n\n async execute() {\n await this.checkStyles();\n await this.eslint();\n await this.stylelint();\n }\n\n @logErrors\n private async eslint() {\n if (this.useParallelESLint()) {\n const { fix, ignore, scope } = this.args;\n const packages = getPackages({ scope, ignore });\n const args = fix ? ['--fix'] : [];\n\n await lernaExec({\n 'cmd': 'startup eslint',\n 'scope': packages.map(({ name }) => name),\n 'bail': false,\n '--': args,\n });\n return;\n }\n\n log.info('Running eslint...');\n await eslint({ fix: this.args.fix, paths: this.paths });\n }\n\n @logErrors\n private async stylelint() {\n log.info('Running stylelint...');\n await stylelint({ fix: this.args.fix, paths: this.paths });\n }\n\n @logErrors\n private async checkStyles() {\n const { ignore, scope } = this.args;\n\n const packages = ignore || scope ? getPackages({ ignore, scope }) : undefined;\n\n await lernaExec({\n cmd: 'startup styles-check',\n scope: packages?.map(({ name }) => name),\n stream: true,\n });\n }\n\n private useParallelESLint() {\n const { parallel, scope, ignore } = this.args;\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n return !this.paths.length && (parallel || scope?.length || ignore?.length);\n }\n\n private get paths() {\n const { _ = [], paths = [] } = this.args;\n return [..._, ...paths];\n }\n}\n"],"names":["Lint","options","_","description","array","string","fix","boolean","scope","hidden","ignore","parallel","paths","Command","execute","checkStyles","eslint","stylelint","useParallelESLint","args","packages","getPackages","lernaExec","map","name","log","info","undefined","cmd","stream","length","greedy"],"mappings":"AAAA,uDAAuD;;;;+BAe1CA;;;eAAAA;;;uBAd+B;wBACV;2BACR;uBACc;;;;;;;;;;;;;;;;;;;;;;;AAExC,MAAMC,UAAU;IACZC,GAAG;QAAEC,aAAa;QAAcC,OAAO;QAAMC,QAAQ;IAAK;IAC1DC,KAAK;QAAEC,SAAS;QAAMJ,aAAa;IAA0B;IAC7DK,OAAO;QAAEJ,OAAO;QAAMC,QAAQ;QAAMI,QAAQ;QAAMN,aAAa;IAAmB;IAClFO,QAAQ;QAAEN,OAAO;QAAMC,QAAQ;QAAMI,QAAQ;QAAMN,aAAa;IAAmB;IACnFQ,UAAU;QAAEJ,SAAS;QAAME,QAAQ;QAAMN,aAAa;IAA+B;IACrFS,OAAO;QAAER,OAAO;QAAMC,QAAQ;QAAMI,QAAQ;IAAK;AACrD;AAEO,MAAMT,aAAaa,cAAO;IAK7B,MAAMC,UAAU;QACZ,MAAM,IAAI,CAACC,WAAW;QACtB,MAAM,IAAI,CAACC,MAAM;QACjB,MAAM,IAAI,CAACC,SAAS;IACxB;IAEA,MACcD,SAAS;QACnB,IAAI,IAAI,CAACE,iBAAiB,IAAI;YAC1B,MAAM,EAAEZ,GAAG,EAAEI,MAAM,EAAEF,KAAK,EAAE,GAAG,IAAI,CAACW,IAAI;YACxC,MAAMC,WAAWC,IAAAA,kBAAW,EAAC;gBAAEb;gBAAOE;YAAO;YAC7C,MAAMS,OAAOb,MAAM;gBAAC;aAAQ,GAAG,EAAE;YAEjC,MAAMgB,IAAAA,iBAAS,EAAC;gBACZ,OAAO;gBACP,SAASF,SAASG,GAAG,CAAC,CAAC,EAAEC,IAAI,EAAE,GAAKA;gBACpC,QAAQ;gBACR,MAAML;YACV;YACA;QACJ;QAEAM,UAAG,CAACC,IAAI,CAAC;QACT,MAAMV,IAAAA,cAAM,EAAC;YAAEV,KAAK,IAAI,CAACa,IAAI,CAACb,GAAG;YAAEM,OAAO,IAAI,CAACA,KAAK;QAAC;IACzD;IAEA,MACcK,YAAY;QACtBQ,UAAG,CAACC,IAAI,CAAC;QACT,MAAMT,IAAAA,oBAAS,EAAC;YAAEX,KAAK,IAAI,CAACa,IAAI,CAACb,GAAG;YAAEM,OAAO,IAAI,CAACA,KAAK;QAAC;IAC5D;IAEA,MACcG,cAAc;QACxB,MAAM,EAAEL,MAAM,EAAEF,KAAK,EAAE,GAAG,IAAI,CAACW,IAAI;QAEnC,MAAMC,WAAWV,UAAUF,QAAQa,IAAAA,kBAAW,EAAC;YAAEX;YAAQF;QAAM,KAAKmB;QAEpE,MAAML,IAAAA,iBAAS,EAAC;YACZM,KAAK;YACLpB,KAAK,EAAEY,qBAAAA,+BAAAA,SAAUG,GAAG,CAAC,CAAC,EAAEC,IAAI,EAAE,GAAKA;YACnCK,QAAQ;QACZ;IACJ;IAEQX,oBAAoB;QACxB,MAAM,EAAEP,QAAQ,EAAEH,KAAK,EAAEE,MAAM,EAAE,GAAG,IAAI,CAACS,IAAI;QAC7C,wEAAwE;QACxE,OAAO,CAAC,IAAI,CAACP,KAAK,CAACkB,MAAM,IAAKnB,CAAAA,aAAYH,kBAAAA,4BAAAA,MAAOsB,MAAM,MAAIpB,mBAAAA,6BAAAA,OAAQoB,MAAM,CAAD;IAC5E;IAEA,IAAYlB,QAAQ;QAChB,MAAM,EAAEV,IAAI,EAAE,EAAEU,QAAQ,EAAE,EAAE,GAAG,IAAI,CAACO,IAAI;QACxC,OAAO;eAAIjB;eAAMU;SAAM;IAC3B;AACJ;AA3DI,iBADSZ,MACOG,eAAc;AAC9B,iBAFSH,MAEO+B,UAAS;AACzB,iBAHS/B,MAGOC,WAAUA"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Command } from './types';
|
|
2
|
+
declare const options: {
|
|
3
|
+
metadata: {
|
|
4
|
+
description: string;
|
|
5
|
+
string: true;
|
|
6
|
+
demandOption: true;
|
|
7
|
+
requiresArg: true;
|
|
8
|
+
};
|
|
9
|
+
hostPackageJson: {
|
|
10
|
+
description: string;
|
|
11
|
+
array: true;
|
|
12
|
+
string: true;
|
|
13
|
+
demandOption: true;
|
|
14
|
+
requiresArg: true;
|
|
15
|
+
};
|
|
16
|
+
json: {
|
|
17
|
+
description: string;
|
|
18
|
+
boolean: true;
|
|
19
|
+
default: boolean;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export declare class MfeCheck extends Command<typeof options> {
|
|
23
|
+
static readonly allowRunFromGlobal = true;
|
|
24
|
+
static readonly description = "Check MFE/host dependency compatibility";
|
|
25
|
+
static readonly options: {
|
|
26
|
+
metadata: {
|
|
27
|
+
description: string;
|
|
28
|
+
string: true;
|
|
29
|
+
demandOption: true;
|
|
30
|
+
requiresArg: true;
|
|
31
|
+
};
|
|
32
|
+
hostPackageJson: {
|
|
33
|
+
description: string;
|
|
34
|
+
array: true;
|
|
35
|
+
string: true;
|
|
36
|
+
demandOption: true;
|
|
37
|
+
requiresArg: true;
|
|
38
|
+
};
|
|
39
|
+
json: {
|
|
40
|
+
description: string;
|
|
41
|
+
boolean: true;
|
|
42
|
+
default: boolean;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
execute(): Promise<void>;
|
|
46
|
+
private getHostPackageData;
|
|
47
|
+
private checkCompatibility;
|
|
48
|
+
private outputJson;
|
|
49
|
+
private outputHumanReadable;
|
|
50
|
+
}
|
|
51
|
+
export {};
|
|
52
|
+
//# sourceMappingURL=mfe-check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mfe-check.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/mfe-check.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,OAAO,EAAkB,MAAM,SAAS,CAAC;AAuBlD,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;CAoBa,CAAC;AAE3B,qBAAa,QAAS,SAAQ,OAAO,CAAC,OAAO,OAAO,CAAC;IACjD,MAAM,CAAC,QAAQ,CAAC,kBAAkB,QAAQ;IAC1C,MAAM,CAAC,QAAQ,CAAC,WAAW,6CAA6C;IACxE,MAAM,CAAC,QAAQ,CAAC,OAAO;;;;;;;;;;;;;;;;;;;MAAW;IAG5B,OAAO;IAoBb,OAAO,CAAC,kBAAkB;IAiB1B,OAAO,CAAC,kBAAkB;IAkC1B,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,mBAAmB;CA2B9B"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "MfeCheck", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return MfeCheck;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _startuputils = require("@servicetitan/startup-utils");
|
|
12
|
+
const _nodepath = /*#__PURE__*/ _interop_require_default(require("node:path"));
|
|
13
|
+
const _utils = require("../../utils");
|
|
14
|
+
const _utils1 = require("../../webpack/configs/utils");
|
|
15
|
+
const _types = require("./types");
|
|
16
|
+
function _define_property(obj, key, value) {
|
|
17
|
+
if (key in obj) {
|
|
18
|
+
Object.defineProperty(obj, key, {
|
|
19
|
+
value: value,
|
|
20
|
+
enumerable: true,
|
|
21
|
+
configurable: true,
|
|
22
|
+
writable: true
|
|
23
|
+
});
|
|
24
|
+
} else {
|
|
25
|
+
obj[key] = value;
|
|
26
|
+
}
|
|
27
|
+
return obj;
|
|
28
|
+
}
|
|
29
|
+
function _interop_require_default(obj) {
|
|
30
|
+
return obj && obj.__esModule ? obj : {
|
|
31
|
+
default: obj
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
35
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
36
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
37
|
+
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
38
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
39
|
+
}
|
|
40
|
+
function _ts_metadata(k, v) {
|
|
41
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
42
|
+
}
|
|
43
|
+
const options = {
|
|
44
|
+
metadata: {
|
|
45
|
+
description: "Path to MFE's metadata.json file, can be generated with the 'mfe-generate-metadata' command",
|
|
46
|
+
string: true,
|
|
47
|
+
demandOption: true,
|
|
48
|
+
requiresArg: true
|
|
49
|
+
},
|
|
50
|
+
hostPackageJson: {
|
|
51
|
+
description: 'Path(s) to host package.json files',
|
|
52
|
+
array: true,
|
|
53
|
+
string: true,
|
|
54
|
+
demandOption: true,
|
|
55
|
+
requiresArg: true
|
|
56
|
+
},
|
|
57
|
+
json: {
|
|
58
|
+
description: 'Output results as JSON',
|
|
59
|
+
boolean: true,
|
|
60
|
+
default: false
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
class MfeCheck extends _types.Command {
|
|
64
|
+
async execute() {
|
|
65
|
+
const { metadata: metadataPath, hostPackageJson, json } = this.args;
|
|
66
|
+
const mfeMetadata = (0, _utils.readJson)(_nodepath.default.resolve(metadataPath));
|
|
67
|
+
const hostPackageJsonPaths = (0, _utils.toArray)(hostPackageJson);
|
|
68
|
+
const hostData = this.getHostPackageData(hostPackageJsonPaths);
|
|
69
|
+
const result = this.checkCompatibility(mfeMetadata, hostData);
|
|
70
|
+
if (json) {
|
|
71
|
+
this.outputJson(result);
|
|
72
|
+
} else {
|
|
73
|
+
this.outputHumanReadable(result);
|
|
74
|
+
}
|
|
75
|
+
if (!result.compatible) {
|
|
76
|
+
process.exitCode = 1;
|
|
77
|
+
}
|
|
78
|
+
return Promise.resolve();
|
|
79
|
+
}
|
|
80
|
+
getHostPackageData(packageJsonPaths) {
|
|
81
|
+
const packages = packageJsonPaths.map((packageJsonPath)=>(0, _utils.readJson)(_nodepath.default.resolve(packageJsonPath)));
|
|
82
|
+
const mergedDependencies = packages.reduceRight((result, currentPackage)=>Object.assign(result, currentPackage.dependencies), {});
|
|
83
|
+
const mainPackage = packages[0];
|
|
84
|
+
return {
|
|
85
|
+
name: mainPackage.name,
|
|
86
|
+
cli: mainPackage.cli,
|
|
87
|
+
dependencies: mergedDependencies
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
checkCompatibility(mfeMetadata, hostData) {
|
|
91
|
+
var _hostData_cli_webpack, _hostData_cli, _hostData_cli_webpack1, _hostData_cli1;
|
|
92
|
+
const mfeSharedDependencies = mfeMetadata.sharedDependencies;
|
|
93
|
+
const hostSharedDependencies = (0, _utils.loadSharedDependencies)(hostData.dependencies, (_hostData_cli = hostData.cli) === null || _hostData_cli === void 0 ? void 0 : (_hostData_cli_webpack = _hostData_cli.webpack) === null || _hostData_cli_webpack === void 0 ? void 0 : _hostData_cli_webpack['shared-dependencies']);
|
|
94
|
+
const exposedDependencies = (0, _utils1.getExposedDependencies)(hostSharedDependencies, hostData.dependencies);
|
|
95
|
+
const mismatchResult = (0, _startuputils.getVersionMismatches)(exposedDependencies, mfeMetadata.dependencies, mfeSharedDependencies);
|
|
96
|
+
const isHostMfe = (0, _utils.isWebComponent)(hostData);
|
|
97
|
+
const isSharedDependenciesEnabled = ((_hostData_cli1 = hostData.cli) === null || _hostData_cli1 === void 0 ? void 0 : (_hostData_cli_webpack1 = _hostData_cli1.webpack) === null || _hostData_cli_webpack1 === void 0 ? void 0 : _hostData_cli_webpack1['expose-shared-dependencies']) === true;
|
|
98
|
+
const compatible = !isHostMfe && !mismatchResult && isSharedDependenciesEnabled;
|
|
99
|
+
return {
|
|
100
|
+
name: mfeMetadata.name,
|
|
101
|
+
compatible,
|
|
102
|
+
bundleType: compatible ? 'light' : 'full',
|
|
103
|
+
isSharedDependenciesEnabled,
|
|
104
|
+
isHostMfe,
|
|
105
|
+
...mismatchResult ? {
|
|
106
|
+
mismatches: mismatchResult
|
|
107
|
+
} : {}
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
outputJson(result) {
|
|
111
|
+
process.stdout.write(JSON.stringify(result, null, 2) + '\n');
|
|
112
|
+
}
|
|
113
|
+
outputHumanReadable(result) {
|
|
114
|
+
_utils.log.info(`Checking ${result.name}...`);
|
|
115
|
+
if (result.isHostMfe) {
|
|
116
|
+
_utils.log.error('Skipping compatibility check because host is an MFE');
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
if (result.compatible) {
|
|
120
|
+
_utils.log.info('Compatible: light bundle can be used');
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
if (result.mismatches) {
|
|
124
|
+
_utils.log.error('Dependency mismatch found:');
|
|
125
|
+
for (const [dep, versions] of Object.entries(result.mismatches)){
|
|
126
|
+
_utils.log.error(` ${dep}: host=${versions.host}, package=${versions.package}`);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
if (!result.isSharedDependenciesEnabled) {
|
|
130
|
+
_utils.log.error('expose-shared-dependencies is not enabled in host package.json');
|
|
131
|
+
}
|
|
132
|
+
_utils.log.error('Result: full bundle required');
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
_define_property(MfeCheck, "allowRunFromGlobal", true);
|
|
136
|
+
_define_property(MfeCheck, "description", 'Check MFE/host dependency compatibility');
|
|
137
|
+
_define_property(MfeCheck, "options", options);
|
|
138
|
+
_ts_decorate([
|
|
139
|
+
_utils.logErrors,
|
|
140
|
+
_ts_metadata("design:type", Function),
|
|
141
|
+
_ts_metadata("design:paramtypes", []),
|
|
142
|
+
_ts_metadata("design:returntype", Promise)
|
|
143
|
+
], MfeCheck.prototype, "execute", null);
|
|
144
|
+
|
|
145
|
+
//# sourceMappingURL=mfe-check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/cli/commands/mfe-check.ts"],"sourcesContent":["import { getVersionMismatches } from '@servicetitan/startup-utils';\nimport path from 'node:path';\nimport {\n isWebComponent,\n loadSharedDependencies,\n log,\n logErrors,\n readJson,\n toArray,\n} from '../../utils';\nimport { Metadata } from '../../webpack/configs/types';\nimport { getExposedDependencies } from '../../webpack/configs/utils';\nimport { Command, CommandOptions } from './types';\n\ninterface HostPackageJSON {\n name: string;\n dependencies: Record<string, string>;\n cli?: {\n 'web-component'?: boolean | string | object;\n 'webpack'?: {\n 'expose-shared-dependencies'?: boolean;\n 'shared-dependencies'?: Record<string, string>;\n };\n };\n}\n\ninterface CompatibilityResult {\n name: string;\n compatible: boolean;\n bundleType: 'light' | 'full';\n mismatches?: Record<string, { host: string; package: string }>;\n isSharedDependenciesEnabled: boolean;\n isHostMfe: boolean;\n}\n\nconst options = {\n metadata: {\n description:\n \"Path to MFE's metadata.json file, can be generated with the 'mfe-generate-metadata' command\",\n string: true,\n demandOption: true,\n requiresArg: true,\n },\n hostPackageJson: {\n description: 'Path(s) to host package.json files',\n array: true,\n string: true,\n demandOption: true,\n requiresArg: true,\n },\n json: {\n description: 'Output results as JSON',\n boolean: true,\n default: false,\n },\n} satisfies CommandOptions;\n\nexport class MfeCheck extends Command<typeof options> {\n static readonly allowRunFromGlobal = true;\n static readonly description = 'Check MFE/host dependency compatibility';\n static readonly options = options;\n\n @logErrors\n async execute() {\n const { metadata: metadataPath, hostPackageJson, json } = this.args;\n const mfeMetadata = readJson<Metadata>(path.resolve(metadataPath));\n const hostPackageJsonPaths = toArray(hostPackageJson);\n const hostData = this.getHostPackageData(hostPackageJsonPaths);\n const result = this.checkCompatibility(mfeMetadata, hostData);\n\n if (json) {\n this.outputJson(result);\n } else {\n this.outputHumanReadable(result);\n }\n\n if (!result.compatible) {\n process.exitCode = 1;\n }\n\n return Promise.resolve();\n }\n\n private getHostPackageData(packageJsonPaths: string[]): HostPackageJSON {\n const packages = packageJsonPaths.map(packageJsonPath =>\n readJson<HostPackageJSON>(path.resolve(packageJsonPath))\n );\n const mergedDependencies = packages.reduceRight<HostPackageJSON['dependencies']>(\n (result, currentPackage) => Object.assign(result, currentPackage.dependencies),\n {}\n );\n const mainPackage = packages[0];\n\n return {\n name: mainPackage.name,\n cli: mainPackage.cli,\n dependencies: mergedDependencies,\n };\n }\n\n private checkCompatibility(\n mfeMetadata: Metadata,\n hostData: HostPackageJSON\n ): CompatibilityResult {\n const mfeSharedDependencies = mfeMetadata.sharedDependencies;\n const hostSharedDependencies = loadSharedDependencies(\n hostData.dependencies,\n hostData.cli?.webpack?.['shared-dependencies']\n );\n const exposedDependencies = getExposedDependencies(\n hostSharedDependencies,\n hostData.dependencies\n );\n const mismatchResult = getVersionMismatches(\n exposedDependencies,\n mfeMetadata.dependencies,\n mfeSharedDependencies\n );\n\n const isHostMfe = isWebComponent(hostData);\n const isSharedDependenciesEnabled =\n hostData.cli?.webpack?.['expose-shared-dependencies'] === true;\n const compatible = !isHostMfe && !mismatchResult && isSharedDependenciesEnabled;\n\n return {\n name: mfeMetadata.name,\n compatible,\n bundleType: compatible ? 'light' : 'full',\n isSharedDependenciesEnabled,\n isHostMfe,\n ...(mismatchResult ? { mismatches: mismatchResult } : {}),\n };\n }\n\n private outputJson(result: CompatibilityResult) {\n process.stdout.write(JSON.stringify(result, null, 2) + '\\n');\n }\n\n private outputHumanReadable(result: CompatibilityResult) {\n log.info(`Checking ${result.name}...`);\n\n if (result.isHostMfe) {\n log.error('Skipping compatibility check because host is an MFE');\n return;\n }\n\n if (result.compatible) {\n log.info('Compatible: light bundle can be used');\n return;\n }\n\n if (result.mismatches) {\n log.error('Dependency mismatch found:');\n\n for (const [dep, versions] of Object.entries(result.mismatches)) {\n log.error(` ${dep}: host=${versions.host}, package=${versions.package}`);\n }\n }\n\n if (!result.isSharedDependenciesEnabled) {\n log.error('expose-shared-dependencies is not enabled in host package.json');\n }\n\n log.error('Result: full bundle required');\n }\n}\n"],"names":["MfeCheck","options","metadata","description","string","demandOption","requiresArg","hostPackageJson","array","json","boolean","default","Command","execute","metadataPath","args","mfeMetadata","readJson","path","resolve","hostPackageJsonPaths","toArray","hostData","getHostPackageData","result","checkCompatibility","outputJson","outputHumanReadable","compatible","process","exitCode","Promise","packageJsonPaths","packages","map","packageJsonPath","mergedDependencies","reduceRight","currentPackage","Object","assign","dependencies","mainPackage","name","cli","mfeSharedDependencies","sharedDependencies","hostSharedDependencies","loadSharedDependencies","webpack","exposedDependencies","getExposedDependencies","mismatchResult","getVersionMismatches","isHostMfe","isWebComponent","isSharedDependenciesEnabled","bundleType","mismatches","stdout","write","JSON","stringify","log","info","error","dep","versions","entries","host","package","allowRunFromGlobal"],"mappings":";;;;+BAyDaA;;;eAAAA;;;8BAzDwB;iEACpB;uBAQV;wBAEgC;uBACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBxC,MAAMC,UAAU;IACZC,UAAU;QACNC,aACI;QACJC,QAAQ;QACRC,cAAc;QACdC,aAAa;IACjB;IACAC,iBAAiB;QACbJ,aAAa;QACbK,OAAO;QACPJ,QAAQ;QACRC,cAAc;QACdC,aAAa;IACjB;IACAG,MAAM;QACFN,aAAa;QACbO,SAAS;QACTC,SAAS;IACb;AACJ;AAEO,MAAMX,iBAAiBY,cAAO;IAKjC,MACMC,UAAU;QACZ,MAAM,EAAEX,UAAUY,YAAY,EAAEP,eAAe,EAAEE,IAAI,EAAE,GAAG,IAAI,CAACM,IAAI;QACnE,MAAMC,cAAcC,IAAAA,eAAQ,EAAWC,iBAAI,CAACC,OAAO,CAACL;QACpD,MAAMM,uBAAuBC,IAAAA,cAAO,EAACd;QACrC,MAAMe,WAAW,IAAI,CAACC,kBAAkB,CAACH;QACzC,MAAMI,SAAS,IAAI,CAACC,kBAAkB,CAACT,aAAaM;QAEpD,IAAIb,MAAM;YACN,IAAI,CAACiB,UAAU,CAACF;QACpB,OAAO;YACH,IAAI,CAACG,mBAAmB,CAACH;QAC7B;QAEA,IAAI,CAACA,OAAOI,UAAU,EAAE;YACpBC,QAAQC,QAAQ,GAAG;QACvB;QAEA,OAAOC,QAAQZ,OAAO;IAC1B;IAEQI,mBAAmBS,gBAA0B,EAAmB;QACpE,MAAMC,WAAWD,iBAAiBE,GAAG,CAACC,CAAAA,kBAClClB,IAAAA,eAAQ,EAAkBC,iBAAI,CAACC,OAAO,CAACgB;QAE3C,MAAMC,qBAAqBH,SAASI,WAAW,CAC3C,CAACb,QAAQc,iBAAmBC,OAAOC,MAAM,CAAChB,QAAQc,eAAeG,YAAY,GAC7E,CAAC;QAEL,MAAMC,cAAcT,QAAQ,CAAC,EAAE;QAE/B,OAAO;YACHU,MAAMD,YAAYC,IAAI;YACtBC,KAAKF,YAAYE,GAAG;YACpBH,cAAcL;QAClB;IACJ;IAEQX,mBACJT,WAAqB,EACrBM,QAAyB,EACN;YAIfA,uBAAAA,eAcAA,wBAAAA;QAjBJ,MAAMuB,wBAAwB7B,YAAY8B,kBAAkB;QAC5D,MAAMC,yBAAyBC,IAAAA,6BAAsB,EACjD1B,SAASmB,YAAY,GACrBnB,gBAAAA,SAASsB,GAAG,cAAZtB,qCAAAA,wBAAAA,cAAc2B,OAAO,cAArB3B,4CAAAA,qBAAuB,CAAC,sBAAsB;QAElD,MAAM4B,sBAAsBC,IAAAA,8BAAsB,EAC9CJ,wBACAzB,SAASmB,YAAY;QAEzB,MAAMW,iBAAiBC,IAAAA,kCAAoB,EACvCH,qBACAlC,YAAYyB,YAAY,EACxBI;QAGJ,MAAMS,YAAYC,IAAAA,qBAAc,EAACjC;QACjC,MAAMkC,8BACFlC,EAAAA,iBAAAA,SAASsB,GAAG,cAAZtB,sCAAAA,yBAAAA,eAAc2B,OAAO,cAArB3B,6CAAAA,sBAAuB,CAAC,6BAA6B,MAAK;QAC9D,MAAMM,aAAa,CAAC0B,aAAa,CAACF,kBAAkBI;QAEpD,OAAO;YACHb,MAAM3B,YAAY2B,IAAI;YACtBf;YACA6B,YAAY7B,aAAa,UAAU;YACnC4B;YACAF;YACA,GAAIF,iBAAiB;gBAAEM,YAAYN;YAAe,IAAI,CAAC,CAAC;QAC5D;IACJ;IAEQ1B,WAAWF,MAA2B,EAAE;QAC5CK,QAAQ8B,MAAM,CAACC,KAAK,CAACC,KAAKC,SAAS,CAACtC,QAAQ,MAAM,KAAK;IAC3D;IAEQG,oBAAoBH,MAA2B,EAAE;QACrDuC,UAAG,CAACC,IAAI,CAAC,CAAC,SAAS,EAAExC,OAAOmB,IAAI,CAAC,GAAG,CAAC;QAErC,IAAInB,OAAO8B,SAAS,EAAE;YAClBS,UAAG,CAACE,KAAK,CAAC;YACV;QACJ;QAEA,IAAIzC,OAAOI,UAAU,EAAE;YACnBmC,UAAG,CAACC,IAAI,CAAC;YACT;QACJ;QAEA,IAAIxC,OAAOkC,UAAU,EAAE;YACnBK,UAAG,CAACE,KAAK,CAAC;YAEV,KAAK,MAAM,CAACC,KAAKC,SAAS,IAAI5B,OAAO6B,OAAO,CAAC5C,OAAOkC,UAAU,EAAG;gBAC7DK,UAAG,CAACE,KAAK,CAAC,CAAC,EAAE,EAAEC,IAAI,OAAO,EAAEC,SAASE,IAAI,CAAC,UAAU,EAAEF,SAASG,OAAO,EAAE;YAC5E;QACJ;QAEA,IAAI,CAAC9C,OAAOgC,2BAA2B,EAAE;YACrCO,UAAG,CAACE,KAAK,CAAC;QACd;QAEAF,UAAG,CAACE,KAAK,CAAC;IACd;AACJ;AA3GI,iBADSjE,UACOuE,sBAAqB;AACrC,iBAFSvE,UAEOG,eAAc;AAC9B,iBAHSH,UAGOC,WAAUA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Command } from './types';
|
|
2
|
+
declare const options: {
|
|
3
|
+
output: {
|
|
4
|
+
description: string;
|
|
5
|
+
string: true;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export declare class MfeGenerateMetadata extends Command<typeof options> {
|
|
9
|
+
static readonly allowRunFromGlobal = true;
|
|
10
|
+
static readonly description = "Generate MFE metadata for compatibility checking";
|
|
11
|
+
static readonly options: {
|
|
12
|
+
output: {
|
|
13
|
+
description: string;
|
|
14
|
+
string: true;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
execute(): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=mfe-generate-metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mfe-generate-metadata.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/mfe-generate-metadata.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,OAAO,EAAkB,MAAM,SAAS,CAAC;AAElD,QAAA,MAAM,OAAO;;;;;CAKa,CAAC;AAE3B,qBAAa,mBAAoB,SAAQ,OAAO,CAAC,OAAO,OAAO,CAAC;IAC5D,MAAM,CAAC,QAAQ,CAAC,kBAAkB,QAAQ;IAC1C,MAAM,CAAC,QAAQ,CAAC,WAAW,sDAAsD;IACjF,MAAM,CAAC,QAAQ,CAAC,OAAO;;;;;MAAW;IAG5B,OAAO;CAyChB"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "MfeGenerateMetadata", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return MfeGenerateMetadata;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _nodefs = /*#__PURE__*/ _interop_require_default(require("node:fs"));
|
|
12
|
+
const _nodepath = /*#__PURE__*/ _interop_require_default(require("node:path"));
|
|
13
|
+
const _utils = require("../../utils");
|
|
14
|
+
const _buildmetadata = require("../../webpack/configs/utils/build-metadata");
|
|
15
|
+
const _types = require("./types");
|
|
16
|
+
function _define_property(obj, key, value) {
|
|
17
|
+
if (key in obj) {
|
|
18
|
+
Object.defineProperty(obj, key, {
|
|
19
|
+
value: value,
|
|
20
|
+
enumerable: true,
|
|
21
|
+
configurable: true,
|
|
22
|
+
writable: true
|
|
23
|
+
});
|
|
24
|
+
} else {
|
|
25
|
+
obj[key] = value;
|
|
26
|
+
}
|
|
27
|
+
return obj;
|
|
28
|
+
}
|
|
29
|
+
function _interop_require_default(obj) {
|
|
30
|
+
return obj && obj.__esModule ? obj : {
|
|
31
|
+
default: obj
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
35
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
36
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
37
|
+
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
38
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
39
|
+
}
|
|
40
|
+
function _ts_metadata(k, v) {
|
|
41
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
42
|
+
}
|
|
43
|
+
const options = {
|
|
44
|
+
output: {
|
|
45
|
+
description: 'Output file path (outputs to stdout if not specified)',
|
|
46
|
+
string: true
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
class MfeGenerateMetadata extends _types.Command {
|
|
50
|
+
async execute() {
|
|
51
|
+
if (!(0, _utils.isWebComponent)()) {
|
|
52
|
+
throw new Error('this command must be run inside a web-component directory');
|
|
53
|
+
}
|
|
54
|
+
const { output } = this.args;
|
|
55
|
+
const { destination } = (0, _utils.getFolders)();
|
|
56
|
+
const name = (0, _utils.getPackageName)();
|
|
57
|
+
const packageData = (0, _utils.getPackageData)();
|
|
58
|
+
const sharedDependencies = (0, _utils.loadSharedDependencies)(packageData.dependencies, packageData.sharedDependencies);
|
|
59
|
+
const metadata = (0, _buildmetadata.buildMetadata)({
|
|
60
|
+
destination,
|
|
61
|
+
name,
|
|
62
|
+
version: packageData.version,
|
|
63
|
+
dependencies: packageData.dependencies,
|
|
64
|
+
sharedDependencies
|
|
65
|
+
});
|
|
66
|
+
const jsonOutput = JSON.stringify(metadata, null, 2);
|
|
67
|
+
if (output) {
|
|
68
|
+
const outputPath = _nodepath.default.resolve(output);
|
|
69
|
+
const outputDir = _nodepath.default.dirname(outputPath);
|
|
70
|
+
if (!_nodefs.default.existsSync(outputDir)) {
|
|
71
|
+
_nodefs.default.mkdirSync(outputDir, {
|
|
72
|
+
recursive: true
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
_nodefs.default.writeFileSync(outputPath, jsonOutput, 'utf8');
|
|
76
|
+
_utils.log.info(`Metadata written to ${outputPath}`);
|
|
77
|
+
} else {
|
|
78
|
+
process.stdout.write(jsonOutput + '\n');
|
|
79
|
+
}
|
|
80
|
+
return Promise.resolve();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
_define_property(MfeGenerateMetadata, "allowRunFromGlobal", true);
|
|
84
|
+
_define_property(MfeGenerateMetadata, "description", 'Generate MFE metadata for compatibility checking');
|
|
85
|
+
_define_property(MfeGenerateMetadata, "options", options);
|
|
86
|
+
_ts_decorate([
|
|
87
|
+
_utils.logErrors,
|
|
88
|
+
_ts_metadata("design:type", Function),
|
|
89
|
+
_ts_metadata("design:paramtypes", []),
|
|
90
|
+
_ts_metadata("design:returntype", Promise)
|
|
91
|
+
], MfeGenerateMetadata.prototype, "execute", null);
|
|
92
|
+
|
|
93
|
+
//# sourceMappingURL=mfe-generate-metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/cli/commands/mfe-generate-metadata.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\nimport {\n getFolders,\n getPackageData,\n getPackageName,\n isWebComponent,\n loadSharedDependencies,\n log,\n logErrors,\n} from '../../utils';\nimport { buildMetadata } from '../../webpack/configs/utils/build-metadata';\nimport { Command, CommandOptions } from './types';\n\nconst options = {\n output: {\n description: 'Output file path (outputs to stdout if not specified)',\n string: true,\n },\n} satisfies CommandOptions;\n\nexport class MfeGenerateMetadata extends Command<typeof options> {\n static readonly allowRunFromGlobal = true;\n static readonly description = 'Generate MFE metadata for compatibility checking';\n static readonly options = options;\n\n @logErrors\n async execute() {\n if (!isWebComponent()) {\n throw new Error('this command must be run inside a web-component directory');\n }\n\n const { output } = this.args;\n\n const { destination } = getFolders();\n const name = getPackageName();\n const packageData = getPackageData();\n const sharedDependencies = loadSharedDependencies(\n packageData.dependencies,\n packageData.sharedDependencies\n );\n\n const metadata = buildMetadata({\n destination,\n name,\n version: packageData.version,\n dependencies: packageData.dependencies,\n sharedDependencies,\n });\n\n const jsonOutput = JSON.stringify(metadata, null, 2);\n\n if (output) {\n const outputPath = path.resolve(output);\n const outputDir = path.dirname(outputPath);\n\n if (!fs.existsSync(outputDir)) {\n fs.mkdirSync(outputDir, { recursive: true });\n }\n\n fs.writeFileSync(outputPath, jsonOutput, 'utf8');\n log.info(`Metadata written to ${outputPath}`);\n } else {\n process.stdout.write(jsonOutput + '\\n');\n }\n\n return Promise.resolve();\n }\n}\n"],"names":["MfeGenerateMetadata","options","output","description","string","Command","execute","isWebComponent","Error","args","destination","getFolders","name","getPackageName","packageData","getPackageData","sharedDependencies","loadSharedDependencies","dependencies","metadata","buildMetadata","version","jsonOutput","JSON","stringify","outputPath","path","resolve","outputDir","dirname","fs","existsSync","mkdirSync","recursive","writeFileSync","log","info","process","stdout","write","Promise","allowRunFromGlobal"],"mappings":";;;;+BAqBaA;;;eAAAA;;;+DArBE;iEACE;uBASV;+BACuB;uBACU;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAExC,MAAMC,UAAU;IACZC,QAAQ;QACJC,aAAa;QACbC,QAAQ;IACZ;AACJ;AAEO,MAAMJ,4BAA4BK,cAAO;IAK5C,MACMC,UAAU;QACZ,IAAI,CAACC,IAAAA,qBAAc,KAAI;YACnB,MAAM,IAAIC,MAAM;QACpB;QAEA,MAAM,EAAEN,MAAM,EAAE,GAAG,IAAI,CAACO,IAAI;QAE5B,MAAM,EAAEC,WAAW,EAAE,GAAGC,IAAAA,iBAAU;QAClC,MAAMC,OAAOC,IAAAA,qBAAc;QAC3B,MAAMC,cAAcC,IAAAA,qBAAc;QAClC,MAAMC,qBAAqBC,IAAAA,6BAAsB,EAC7CH,YAAYI,YAAY,EACxBJ,YAAYE,kBAAkB;QAGlC,MAAMG,WAAWC,IAAAA,4BAAa,EAAC;YAC3BV;YACAE;YACAS,SAASP,YAAYO,OAAO;YAC5BH,cAAcJ,YAAYI,YAAY;YACtCF;QACJ;QAEA,MAAMM,aAAaC,KAAKC,SAAS,CAACL,UAAU,MAAM;QAElD,IAAIjB,QAAQ;YACR,MAAMuB,aAAaC,iBAAI,CAACC,OAAO,CAACzB;YAChC,MAAM0B,YAAYF,iBAAI,CAACG,OAAO,CAACJ;YAE/B,IAAI,CAACK,eAAE,CAACC,UAAU,CAACH,YAAY;gBAC3BE,eAAE,CAACE,SAAS,CAACJ,WAAW;oBAAEK,WAAW;gBAAK;YAC9C;YAEAH,eAAE,CAACI,aAAa,CAACT,YAAYH,YAAY;YACzCa,UAAG,CAACC,IAAI,CAAC,CAAC,oBAAoB,EAAEX,YAAY;QAChD,OAAO;YACHY,QAAQC,MAAM,CAACC,KAAK,CAACjB,aAAa;QACtC;QAEA,OAAOkB,QAAQb,OAAO;IAC1B;AACJ;AA9CI,iBADS3B,qBACOyC,sBAAqB;AACrC,iBAFSzC,qBAEOG,eAAc;AAC9B,iBAHSH,qBAGOC,WAAUA"}
|
|
@@ -1,33 +1,70 @@
|
|
|
1
|
-
import { Command
|
|
2
|
-
|
|
3
|
-
_:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { Command } from './types';
|
|
2
|
+
declare const options: {
|
|
3
|
+
_: {
|
|
4
|
+
description: string;
|
|
5
|
+
array: true;
|
|
6
|
+
string: true;
|
|
7
|
+
};
|
|
8
|
+
all: {
|
|
9
|
+
boolean: true;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
ignore: {
|
|
13
|
+
array: true;
|
|
14
|
+
string: true;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
limit: {
|
|
18
|
+
number: true;
|
|
19
|
+
description: string;
|
|
20
|
+
};
|
|
21
|
+
packageNames: {
|
|
22
|
+
array: true;
|
|
23
|
+
string: true;
|
|
24
|
+
hidden: true;
|
|
25
|
+
};
|
|
26
|
+
registry: {
|
|
27
|
+
string: true;
|
|
28
|
+
hidden: true;
|
|
29
|
+
};
|
|
30
|
+
tagged: {
|
|
31
|
+
boolean: true;
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export declare class MFEList extends Command<typeof options> {
|
|
36
|
+
static readonly allowRunFromGlobal = true;
|
|
12
37
|
static readonly description = "List published MFE packages";
|
|
13
38
|
static readonly options: {
|
|
14
39
|
_: {
|
|
15
40
|
description: string;
|
|
41
|
+
array: true;
|
|
42
|
+
string: true;
|
|
16
43
|
};
|
|
17
44
|
all: {
|
|
18
|
-
boolean:
|
|
45
|
+
boolean: true;
|
|
19
46
|
description: string;
|
|
20
47
|
};
|
|
21
48
|
ignore: {
|
|
22
|
-
array:
|
|
49
|
+
array: true;
|
|
50
|
+
string: true;
|
|
23
51
|
description: string;
|
|
24
52
|
};
|
|
25
53
|
limit: {
|
|
26
|
-
number:
|
|
54
|
+
number: true;
|
|
27
55
|
description: string;
|
|
28
56
|
};
|
|
57
|
+
packageNames: {
|
|
58
|
+
array: true;
|
|
59
|
+
string: true;
|
|
60
|
+
hidden: true;
|
|
61
|
+
};
|
|
62
|
+
registry: {
|
|
63
|
+
string: true;
|
|
64
|
+
hidden: true;
|
|
65
|
+
};
|
|
29
66
|
tagged: {
|
|
30
|
-
boolean:
|
|
67
|
+
boolean: true;
|
|
31
68
|
description: string;
|
|
32
69
|
};
|
|
33
70
|
};
|