@servicetitan/startup 30.3.0 → 31.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/bin/index.js +5 -6
- package/dist/cli/commands/build.d.ts +10 -3
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +124 -48
- package/dist/cli/commands/build.js.map +1 -1
- package/dist/cli/commands/bundle-package.d.ts +0 -2
- package/dist/cli/commands/bundle-package.d.ts.map +1 -1
- package/dist/cli/commands/bundle-package.js +54 -36
- package/dist/cli/commands/bundle-package.js.map +1 -1
- package/dist/cli/commands/clean.d.ts +6 -0
- package/dist/cli/commands/clean.d.ts.map +1 -0
- package/dist/cli/commands/clean.js +55 -0
- package/dist/cli/commands/clean.js.map +1 -0
- package/dist/cli/commands/convert-eslint-config.js +163 -107
- package/dist/cli/commands/convert-eslint-config.js.map +1 -1
- package/dist/cli/commands/eslint.d.ts.map +1 -1
- package/dist/cli/commands/eslint.js +43 -24
- 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 +50 -53
- package/dist/cli/commands/get-command.js.map +1 -1
- package/dist/cli/commands/get-user-commands.js +21 -11
- package/dist/cli/commands/get-user-commands.js.map +1 -1
- package/dist/cli/commands/index.d.ts +1 -1
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +31 -30
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.js +74 -48
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/install.d.ts +8 -1
- package/dist/cli/commands/install.d.ts.map +1 -1
- package/dist/cli/commands/install.js +61 -23
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/kendo-ui-license.js +48 -31
- package/dist/cli/commands/kendo-ui-license.js.map +1 -1
- package/dist/cli/commands/lint.d.ts +3 -1
- package/dist/cli/commands/lint.d.ts.map +1 -1
- package/dist/cli/commands/lint.js +112 -73
- package/dist/cli/commands/lint.js.map +1 -1
- package/dist/cli/commands/mfe-package-clean.js +80 -57
- package/dist/cli/commands/mfe-package-clean.js.map +1 -1
- package/dist/cli/commands/mfe-package-publish.d.ts +1 -0
- package/dist/cli/commands/mfe-package-publish.d.ts.map +1 -1
- package/dist/cli/commands/mfe-package-publish.js +124 -70
- package/dist/cli/commands/mfe-package-publish.js.map +1 -1
- package/dist/cli/commands/mfe-publish.d.ts.map +1 -1
- package/dist/cli/commands/mfe-publish.js +83 -48
- package/dist/cli/commands/mfe-publish.js.map +1 -1
- package/dist/cli/commands/prepare-package.d.ts +3 -2
- package/dist/cli/commands/prepare-package.d.ts.map +1 -1
- package/dist/cli/commands/prepare-package.js +44 -32
- package/dist/cli/commands/prepare-package.js.map +1 -1
- package/dist/cli/commands/review/__mocks__/expect-calls.d.ts +23 -0
- package/dist/cli/commands/review/__mocks__/expect-calls.d.ts.map +1 -0
- package/dist/cli/commands/review/__mocks__/index.d.ts +2 -0
- package/dist/cli/commands/review/__mocks__/index.d.ts.map +1 -0
- package/dist/cli/commands/review/index.d.ts +3 -0
- package/dist/cli/commands/review/index.d.ts.map +1 -0
- package/dist/cli/commands/review/index.js +20 -0
- package/dist/cli/commands/review/index.js.map +1 -0
- package/dist/cli/commands/review/review.d.ts +28 -0
- package/dist/cli/commands/review/review.d.ts.map +1 -0
- package/dist/cli/commands/review/review.js +239 -0
- package/dist/cli/commands/review/review.js.map +1 -0
- package/dist/cli/commands/review/rules/__mocks__/index.d.ts +4 -0
- package/dist/cli/commands/review/rules/__mocks__/index.d.ts.map +1 -0
- package/dist/cli/commands/review/rules/__mocks__/mock-config.d.ts +7 -0
- package/dist/cli/commands/review/rules/__mocks__/mock-config.d.ts.map +1 -0
- package/dist/cli/commands/review/rules/__mocks__/mock-packages.d.ts +21 -0
- package/dist/cli/commands/review/rules/__mocks__/mock-packages.d.ts.map +1 -0
- package/dist/cli/commands/review/rules/__mocks__/mock-project.d.ts +3 -0
- package/dist/cli/commands/review/rules/__mocks__/mock-project.d.ts.map +1 -0
- package/dist/cli/commands/review/rules/index.d.ts +3 -0
- package/dist/cli/commands/review/rules/index.d.ts.map +1 -0
- package/dist/cli/commands/review/rules/index.js +30 -0
- package/dist/cli/commands/review/rules/index.js.map +1 -0
- package/dist/cli/commands/review/rules/no-typescript-entry-point.d.ts +14 -0
- package/dist/cli/commands/review/rules/no-typescript-entry-point.d.ts.map +1 -0
- package/dist/cli/commands/review/rules/no-typescript-entry-point.js +89 -0
- package/dist/cli/commands/review/rules/no-typescript-entry-point.js.map +1 -0
- package/dist/cli/commands/review/rules/require-explicit-side-effects.d.ts +7 -0
- package/dist/cli/commands/review/rules/require-explicit-side-effects.d.ts.map +1 -0
- package/dist/cli/commands/review/rules/require-explicit-side-effects.js +37 -0
- package/dist/cli/commands/review/rules/require-explicit-side-effects.js.map +1 -0
- package/dist/cli/commands/review/rules/require-npmrc.d.ts +7 -0
- package/dist/cli/commands/review/rules/require-npmrc.d.ts.map +1 -0
- package/dist/cli/commands/review/rules/require-npmrc.js +38 -0
- package/dist/cli/commands/review/rules/require-npmrc.js.map +1 -0
- package/dist/cli/commands/review/rules/require-one-anvil-uikit-contrib-version.d.ts +5 -0
- package/dist/cli/commands/review/rules/require-one-anvil-uikit-contrib-version.d.ts.map +1 -0
- package/dist/cli/commands/review/rules/require-one-anvil-uikit-contrib-version.js +33 -0
- package/dist/cli/commands/review/rules/require-one-anvil-uikit-contrib-version.js.map +1 -0
- package/dist/cli/commands/review/rules/require-one-collection-version.d.ts +45 -0
- package/dist/cli/commands/review/rules/require-one-collection-version.d.ts.map +1 -0
- package/dist/cli/commands/review/rules/require-one-collection-version.js +140 -0
- package/dist/cli/commands/review/rules/require-one-collection-version.js.map +1 -0
- package/dist/cli/commands/review/rules/require-one-package-version.d.ts +20 -0
- package/dist/cli/commands/review/rules/require-one-package-version.d.ts.map +1 -0
- package/dist/cli/commands/review/rules/require-one-package-version.js +70 -0
- package/dist/cli/commands/review/rules/require-one-package-version.js.map +1 -0
- package/dist/cli/commands/review/rules/require-one-uikit-version.d.ts +5 -0
- package/dist/cli/commands/review/rules/require-one-uikit-version.d.ts.map +1 -0
- package/dist/cli/commands/review/rules/require-one-uikit-version.js +40 -0
- package/dist/cli/commands/review/rules/require-one-uikit-version.js.map +1 -0
- package/dist/cli/commands/review/rules/require-project-version-in-root-node-modules.d.ts +19 -0
- package/dist/cli/commands/review/rules/require-project-version-in-root-node-modules.d.ts.map +1 -0
- package/dist/cli/commands/review/rules/require-project-version-in-root-node-modules.js +103 -0
- package/dist/cli/commands/review/rules/require-project-version-in-root-node-modules.js.map +1 -0
- package/dist/cli/commands/review/rules/require-servicetitan-scope.d.ts +7 -0
- package/dist/cli/commands/review/rules/require-servicetitan-scope.d.ts.map +1 -0
- package/dist/cli/commands/review/rules/require-servicetitan-scope.js +37 -0
- package/dist/cli/commands/review/rules/require-servicetitan-scope.js.map +1 -0
- package/dist/cli/commands/review/types.d.ts +72 -0
- package/dist/cli/commands/review/types.d.ts.map +1 -0
- package/dist/cli/commands/review/types.js +36 -0
- package/dist/cli/commands/review/types.js.map +1 -0
- package/dist/cli/commands/review/utils/apply-filter.d.ts +3 -0
- package/dist/cli/commands/review/utils/apply-filter.d.ts.map +1 -0
- package/dist/cli/commands/review/utils/apply-filter.js +20 -0
- package/dist/cli/commands/review/utils/apply-filter.js.map +1 -0
- package/dist/cli/commands/review/utils/collate-dependencies.d.ts +29 -0
- package/dist/cli/commands/review/utils/collate-dependencies.d.ts.map +1 -0
- package/dist/cli/commands/review/utils/collate-dependencies.js +31 -0
- package/dist/cli/commands/review/utils/collate-dependencies.js.map +1 -0
- package/dist/cli/commands/review/utils/compare-version.d.ts +9 -0
- package/dist/cli/commands/review/utils/compare-version.d.ts.map +1 -0
- package/dist/cli/commands/review/utils/compare-version.js +137 -0
- package/dist/cli/commands/review/utils/compare-version.js.map +1 -0
- package/dist/cli/commands/review/utils/format-depends-on.d.ts +2 -0
- package/dist/cli/commands/review/utils/format-depends-on.d.ts.map +1 -0
- package/dist/cli/commands/review/utils/format-depends-on.js +21 -0
- package/dist/cli/commands/review/utils/format-depends-on.js.map +1 -0
- package/dist/cli/commands/review/utils/format-location.d.ts +2 -0
- package/dist/cli/commands/review/utils/format-location.d.ts.map +1 -0
- package/dist/cli/commands/review/utils/format-location.js +25 -0
- package/dist/cli/commands/review/utils/format-location.js.map +1 -0
- package/dist/cli/commands/review/utils/get-key.d.ts +3 -0
- package/dist/cli/commands/review/utils/get-key.d.ts.map +1 -0
- package/dist/cli/commands/review/utils/get-key.js +20 -0
- package/dist/cli/commands/review/utils/get-key.js.map +1 -0
- package/dist/cli/commands/review/utils/get-max-version.d.ts +2 -0
- package/dist/cli/commands/review/utils/get-max-version.d.ts.map +1 -0
- package/dist/cli/commands/review/utils/get-max-version.js +16 -0
- package/dist/cli/commands/review/utils/get-max-version.js.map +1 -0
- package/dist/cli/commands/review/utils/indent.d.ts +2 -0
- package/dist/cli/commands/review/utils/indent.d.ts.map +1 -0
- package/dist/cli/commands/review/utils/indent.js +17 -0
- package/dist/cli/commands/review/utils/indent.js.map +1 -0
- package/dist/cli/commands/review/utils/index.d.ts +14 -0
- package/dist/cli/commands/review/utils/index.d.ts.map +1 -0
- package/dist/cli/commands/review/utils/index.js +32 -0
- package/dist/cli/commands/review/utils/index.js.map +1 -0
- package/dist/cli/commands/review/utils/is-library.d.ts +3 -0
- package/dist/cli/commands/review/utils/is-library.d.ts.map +1 -0
- package/dist/cli/commands/review/utils/is-library.js +15 -0
- package/dist/cli/commands/review/utils/is-library.js.map +1 -0
- package/dist/cli/commands/review/utils/name-to-location.d.ts +3 -0
- package/dist/cli/commands/review/utils/name-to-location.d.ts.map +1 -0
- package/dist/cli/commands/review/utils/name-to-location.js +18 -0
- package/dist/cli/commands/review/utils/name-to-location.js.map +1 -0
- package/dist/cli/commands/review/utils/pluralize.d.ts +2 -0
- package/dist/cli/commands/review/utils/pluralize.d.ts.map +1 -0
- package/dist/cli/commands/review/utils/pluralize.js +15 -0
- package/dist/cli/commands/review/utils/pluralize.js.map +1 -0
- package/dist/cli/commands/review/utils/set-version.d.ts +10 -0
- package/dist/cli/commands/review/utils/set-version.d.ts.map +1 -0
- package/dist/cli/commands/review/utils/set-version.js +33 -0
- package/dist/cli/commands/review/utils/set-version.js.map +1 -0
- package/dist/cli/commands/review/utils/summarize.d.ts +11 -0
- package/dist/cli/commands/review/utils/summarize.d.ts.map +1 -0
- package/dist/cli/commands/review/utils/summarize.js +30 -0
- package/dist/cli/commands/review/utils/summarize.js.map +1 -0
- package/dist/cli/commands/run-task.js +50 -31
- package/dist/cli/commands/run-task.js.map +1 -1
- package/dist/cli/commands/run-task.test.d.ts +2 -0
- package/dist/cli/commands/run-task.test.d.ts.map +1 -0
- package/dist/cli/commands/start.d.ts +11 -3
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +166 -69
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/styles-check.js +73 -59
- package/dist/cli/commands/styles-check.js.map +1 -1
- package/dist/cli/commands/tests.d.ts +1 -0
- package/dist/cli/commands/tests.d.ts.map +1 -1
- package/dist/cli/commands/tests.js +45 -28
- package/dist/cli/commands/tests.js.map +1 -1
- package/dist/cli/commands/types.d.ts +1 -0
- package/dist/cli/commands/types.d.ts.map +1 -1
- package/dist/cli/commands/types.js +4 -1
- package/dist/cli/commands/types.js.map +1 -1
- package/dist/cli/index.js +43 -34
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/tasks/cli-task.d.ts +0 -1
- package/dist/cli/tasks/cli-task.d.ts.map +1 -1
- package/dist/cli/tasks/cli-task.js +52 -41
- package/dist/cli/tasks/cli-task.js.map +1 -1
- package/dist/cli/tasks/swc-compile-package.d.ts +0 -1
- package/dist/cli/tasks/swc-compile-package.d.ts.map +1 -1
- package/dist/cli/tasks/swc-compile-package.js +75 -34
- package/dist/cli/tasks/swc-compile-package.js.map +1 -1
- package/dist/cli/tasks/task.d.ts +0 -2
- package/dist/cli/tasks/task.d.ts.map +1 -1
- package/dist/cli/tasks/task.js +60 -65
- package/dist/cli/tasks/task.js.map +1 -1
- package/dist/cli/tasks/tsc-compile-package.d.ts +0 -1
- package/dist/cli/tasks/tsc-compile-package.d.ts.map +1 -1
- package/dist/cli/tasks/tsc-compile-package.js +26 -22
- package/dist/cli/tasks/tsc-compile-package.js.map +1 -1
- package/dist/cli/tasks/tsc-compile.d.ts +0 -2
- package/dist/cli/tasks/tsc-compile.d.ts.map +1 -1
- package/dist/cli/tasks/tsc-compile.js +51 -31
- package/dist/cli/tasks/tsc-compile.js.map +1 -1
- package/dist/cli/utils/bundle.d.ts +0 -2
- package/dist/cli/utils/bundle.d.ts.map +1 -1
- package/dist/cli/utils/bundle.js +118 -70
- package/dist/cli/utils/bundle.js.map +1 -1
- package/dist/cli/utils/check-args.d.ts +6 -0
- package/dist/cli/utils/check-args.d.ts.map +1 -0
- package/dist/cli/utils/check-args.js +20 -0
- package/dist/cli/utils/check-args.js.map +1 -0
- package/dist/cli/utils/cli-git.js +23 -9
- package/dist/cli/utils/cli-git.js.map +1 -1
- package/dist/cli/utils/cli-npm.js +62 -23
- package/dist/cli/utils/cli-npm.js.map +1 -1
- package/dist/cli/utils/cli-os.js +34 -33
- package/dist/cli/utils/cli-os.js.map +1 -1
- package/dist/cli/utils/compile-less.d.ts.map +1 -1
- package/dist/cli/utils/compile-less.js +27 -11
- package/dist/cli/utils/compile-less.js.map +1 -1
- package/dist/cli/utils/compile-sass.d.ts.map +1 -1
- package/dist/cli/utils/compile-sass.js +25 -9
- package/dist/cli/utils/compile-sass.js.map +1 -1
- package/dist/cli/utils/compile.d.ts +6 -0
- package/dist/cli/utils/compile.d.ts.map +1 -0
- package/dist/cli/utils/compile.js +33 -0
- package/dist/cli/utils/compile.js.map +1 -0
- package/dist/cli/utils/copy-files.d.ts +8 -0
- package/dist/cli/utils/copy-files.d.ts.map +1 -0
- package/dist/cli/utils/copy-files.js +112 -0
- package/dist/cli/utils/copy-files.js.map +1 -0
- package/dist/cli/utils/eslint.d.ts.map +1 -1
- package/dist/cli/utils/eslint.js +22 -12
- package/dist/cli/utils/eslint.js.map +1 -1
- package/dist/cli/utils/get-module-type.d.ts.map +1 -1
- package/dist/cli/utils/get-module-type.js +21 -13
- package/dist/cli/utils/get-module-type.js.map +1 -1
- package/dist/cli/utils/index.d.ts +7 -5
- package/dist/cli/utils/index.d.ts.map +1 -1
- package/dist/cli/utils/index.js +33 -30
- package/dist/cli/utils/index.js.map +1 -1
- package/dist/cli/utils/is-module-installed.js +11 -4
- package/dist/cli/utils/is-module-installed.js.map +1 -1
- package/dist/cli/utils/lerna-exec.d.ts +4 -3
- package/dist/cli/utils/lerna-exec.d.ts.map +1 -1
- package/dist/cli/utils/lerna-exec.js +40 -19
- package/dist/cli/utils/lerna-exec.js.map +1 -1
- package/dist/cli/utils/maybe-create-git-folder.js +20 -18
- package/dist/cli/utils/maybe-create-git-folder.js.map +1 -1
- package/dist/cli/utils/pipe-stdout.d.ts +3 -0
- package/dist/cli/utils/pipe-stdout.d.ts.map +1 -0
- package/dist/cli/utils/pipe-stdout.js +19 -0
- package/dist/cli/utils/pipe-stdout.js.map +1 -0
- package/dist/cli/utils/process-tree.d.ts +14 -0
- package/dist/cli/utils/process-tree.d.ts.map +1 -0
- package/dist/cli/utils/process-tree.js +78 -0
- package/dist/cli/utils/process-tree.js.map +1 -0
- package/dist/cli/utils/publish.js +12 -6
- package/dist/cli/utils/publish.js.map +1 -1
- package/dist/cli/utils/set-node-options.d.ts +2 -1
- package/dist/cli/utils/set-node-options.d.ts.map +1 -1
- package/dist/cli/utils/set-node-options.js +39 -30
- package/dist/cli/utils/set-node-options.js.map +1 -1
- package/dist/cli/utils/style-extensions.d.ts +2 -0
- package/dist/cli/utils/style-extensions.d.ts.map +1 -0
- package/dist/cli/utils/style-extensions.js +17 -0
- package/dist/cli/utils/style-extensions.js.map +1 -0
- package/dist/cli/utils/tcm.d.ts +5 -2
- package/dist/cli/utils/tcm.d.ts.map +1 -1
- package/dist/cli/utils/tcm.js +51 -46
- package/dist/cli/utils/tcm.js.map +1 -1
- package/dist/cli/utils/type-check.d.ts +7 -0
- package/dist/cli/utils/type-check.d.ts.map +1 -0
- package/dist/cli/utils/type-check.js +33 -0
- package/dist/cli/utils/type-check.js.map +1 -0
- package/dist/cli/utils/watch-stdout.d.ts +3 -0
- package/dist/cli/utils/watch-stdout.d.ts.map +1 -0
- package/dist/cli/utils/watch-stdout.js +26 -0
- package/dist/cli/utils/watch-stdout.js.map +1 -0
- package/dist/index.js +20 -18
- package/dist/index.js.map +1 -1
- package/dist/jest/index.js +12 -4
- package/dist/jest/index.js.map +1 -1
- package/dist/utils/debug.js +23 -11
- package/dist/utils/debug.js.map +1 -1
- package/dist/utils/find-packages.d.ts.map +1 -1
- package/dist/utils/find-packages.js +46 -34
- package/dist/utils/find-packages.js.map +1 -1
- package/dist/utils/format-duration.d.ts +2 -0
- package/dist/utils/format-duration.d.ts.map +1 -0
- package/dist/utils/format-duration.js +24 -0
- package/dist/utils/format-duration.js.map +1 -0
- package/dist/utils/get-branch-configs.js +24 -8
- package/dist/utils/get-branch-configs.js.map +1 -1
- package/dist/utils/get-configuration.d.ts +10 -2
- package/dist/utils/get-configuration.d.ts.map +1 -1
- package/dist/utils/get-configuration.js +120 -52
- package/dist/utils/get-configuration.js.map +1 -1
- package/dist/utils/get-destination-folders.js +25 -18
- package/dist/utils/get-destination-folders.js.map +1 -1
- package/dist/utils/get-folders.d.ts +2 -2
- package/dist/utils/get-folders.d.ts.map +1 -1
- package/dist/utils/get-folders.js +20 -13
- package/dist/utils/get-folders.js.map +1 -1
- package/dist/utils/get-jest-config.js +65 -38
- package/dist/utils/get-jest-config.js.map +1 -1
- package/dist/utils/get-package-data.js +26 -12
- package/dist/utils/get-package-data.js.map +1 -1
- package/dist/utils/get-package-name.js +18 -8
- package/dist/utils/get-package-name.js.map +1 -1
- package/dist/utils/get-packages.d.ts +1 -1
- package/dist/utils/get-packages.d.ts.map +1 -1
- package/dist/utils/get-packages.js +72 -57
- package/dist/utils/get-packages.js.map +1 -1
- package/dist/utils/get-startup-version.js +18 -8
- package/dist/utils/get-startup-version.js.map +1 -1
- package/dist/utils/get-tsconfig.js +19 -12
- package/dist/utils/get-tsconfig.js.map +1 -1
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +34 -29
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/load-shared-dependencies.js +23 -17
- package/dist/utils/load-shared-dependencies.js.map +1 -1
- package/dist/utils/log-errors.d.ts +2 -0
- package/dist/utils/log-errors.d.ts.map +1 -0
- package/dist/utils/log-errors.js +36 -0
- package/dist/utils/log-errors.js.map +1 -0
- package/dist/utils/log.d.ts +0 -1
- package/dist/utils/log.d.ts.map +1 -1
- package/dist/utils/log.js +38 -43
- package/dist/utils/log.js.map +1 -1
- package/dist/utils/pick.js +11 -3
- package/dist/utils/pick.js.map +1 -1
- package/dist/utils/read-json.js +27 -11
- package/dist/utils/read-json.js.map +1 -1
- package/dist/utils/to-array.js +13 -3
- package/dist/utils/to-array.js.map +1 -1
- package/dist/webpack/__mocks__/file-rules.d.ts.map +1 -1
- package/dist/webpack/configs/amd-config.js +13 -3
- package/dist/webpack/configs/amd-config.js.map +1 -1
- package/dist/webpack/configs/cache-config.js +20 -9
- package/dist/webpack/configs/cache-config.js.map +1 -1
- package/dist/webpack/configs/dev-server-config.d.ts +1 -1
- package/dist/webpack/configs/dev-server-config.d.ts.map +1 -1
- package/dist/webpack/configs/dev-server-config.js +47 -45
- package/dist/webpack/configs/dev-server-config.js.map +1 -1
- package/dist/webpack/configs/devtool-config.js +16 -7
- package/dist/webpack/configs/devtool-config.js.map +1 -1
- package/dist/webpack/configs/entry.config.d.ts.map +1 -1
- package/dist/webpack/configs/entry.config.js +28 -7
- package/dist/webpack/configs/entry.config.js.map +1 -1
- package/dist/webpack/configs/externals-config.js +17 -7
- package/dist/webpack/configs/externals-config.js.map +1 -1
- package/dist/webpack/configs/index.d.ts +2 -1
- package/dist/webpack/configs/index.d.ts.map +1 -1
- package/dist/webpack/configs/index.js +30 -28
- package/dist/webpack/configs/index.js.map +1 -1
- package/dist/webpack/configs/loaders/css-loader.js +22 -14
- package/dist/webpack/configs/loaders/css-loader.js.map +1 -1
- package/dist/webpack/configs/loaders/index.d.ts +1 -1
- package/dist/webpack/configs/loaders/index.d.ts.map +1 -1
- package/dist/webpack/configs/loaders/index.js +20 -19
- package/dist/webpack/configs/loaders/index.js.map +1 -1
- package/dist/webpack/configs/loaders/less-loader.js +18 -3
- package/dist/webpack/configs/loaders/less-loader.js.map +1 -1
- package/dist/webpack/configs/loaders/style-loader.js +23 -8
- package/dist/webpack/configs/loaders/style-loader.js.map +1 -1
- package/dist/webpack/configs/loaders/types.js +4 -1
- package/dist/webpack/configs/loaders/types.js.map +1 -1
- package/dist/webpack/configs/module-config.js +17 -5
- package/dist/webpack/configs/module-config.js.map +1 -1
- package/dist/webpack/configs/optimization-config.js +54 -28
- package/dist/webpack/configs/optimization-config.js.map +1 -1
- package/dist/webpack/configs/output-config.js +26 -12
- package/dist/webpack/configs/output-config.js.map +1 -1
- package/dist/webpack/configs/plugins/assets-manifest-plugin.js +23 -14
- package/dist/webpack/configs/plugins/assets-manifest-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/bundle-analyser-plugin.js +19 -9
- package/dist/webpack/configs/plugins/bundle-analyser-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.js +19 -11
- package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/define-exposed-instance-dependencies-plugin.js +17 -7
- package/dist/webpack/configs/plugins/define-exposed-instance-dependencies-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/define-web-component-name-plugin.js +13 -5
- package/dist/webpack/configs/plugins/define-web-component-name-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/filter-warnings-plugin.js +11 -3
- package/dist/webpack/configs/plugins/filter-warnings-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/html-plugin.js +28 -20
- package/dist/webpack/configs/plugins/html-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/check-resource.js +24 -13
- package/dist/webpack/configs/plugins/ignore-plugin/check-resource.js.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/get-package-json.js +26 -16
- package/dist/webpack/configs/plugins/ignore-plugin/get-package-json.js.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.js +15 -6
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/index.js +18 -16
- package/dist/webpack/configs/plugins/ignore-plugin/index.js.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-peer-dependency.js +22 -12
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-peer-dependency.js.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-react-dom-peer-dependency.js +11 -4
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-react-dom-peer-dependency.js.map +1 -1
- package/dist/webpack/configs/plugins/index.d.ts +0 -2
- package/dist/webpack/configs/plugins/index.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/index.js +29 -29
- package/dist/webpack/configs/plugins/index.js.map +1 -1
- package/dist/webpack/configs/plugins/mini-css-extract-plugin.js +23 -12
- package/dist/webpack/configs/plugins/mini-css-extract-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/moment-locales-plugin.js +18 -8
- package/dist/webpack/configs/plugins/moment-locales-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/virtual-modules-plugin.js +32 -22
- package/dist/webpack/configs/plugins/virtual-modules-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/watch-run-plugin.js +23 -15
- package/dist/webpack/configs/plugins/watch-run-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins-config.d.ts.map +1 -1
- package/dist/webpack/configs/plugins-config.js +27 -21
- package/dist/webpack/configs/plugins-config.js.map +1 -1
- package/dist/webpack/configs/resolve-config.js +16 -4
- package/dist/webpack/configs/resolve-config.js.map +1 -1
- package/dist/webpack/configs/rules/css-rules.js +43 -18
- package/dist/webpack/configs/rules/css-rules.js.map +1 -1
- package/dist/webpack/configs/rules/font-rules.js +13 -5
- package/dist/webpack/configs/rules/font-rules.js.map +1 -1
- package/dist/webpack/configs/rules/image-rules.js +13 -5
- package/dist/webpack/configs/rules/image-rules.js.map +1 -1
- package/dist/webpack/configs/rules/index.d.ts +0 -1
- package/dist/webpack/configs/rules/index.d.ts.map +1 -1
- package/dist/webpack/configs/rules/index.js +24 -23
- package/dist/webpack/configs/rules/index.js.map +1 -1
- package/dist/webpack/configs/rules/js-rules.d.ts +1 -1
- package/dist/webpack/configs/rules/js-rules.d.ts.map +1 -1
- package/dist/webpack/configs/rules/js-rules.js +47 -7
- package/dist/webpack/configs/rules/js-rules.js.map +1 -1
- package/dist/webpack/configs/rules/less-rules.js +25 -9
- package/dist/webpack/configs/rules/less-rules.js.map +1 -1
- package/dist/webpack/configs/rules/scss-rules.js +25 -9
- package/dist/webpack/configs/rules/scss-rules.js.map +1 -1
- package/dist/webpack/configs/rules/svg-rules.js +40 -20
- package/dist/webpack/configs/rules/svg-rules.js.map +1 -1
- package/dist/webpack/configs/rules-config.d.ts.map +1 -1
- package/dist/webpack/configs/rules-config.js +34 -19
- package/dist/webpack/configs/rules-config.js.map +1 -1
- package/dist/webpack/configs/stats-config.js +14 -4
- package/dist/webpack/configs/stats-config.js.map +1 -1
- package/dist/webpack/configs/types.d.ts +1 -3
- package/dist/webpack/configs/types.d.ts.map +1 -1
- package/dist/webpack/configs/types.js +4 -1
- package/dist/webpack/configs/types.js.map +1 -1
- package/dist/webpack/configs/utils/generate-metadata.js +40 -22
- package/dist/webpack/configs/utils/generate-metadata.js.map +1 -1
- package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.js +20 -11
- package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.js.map +1 -1
- package/dist/webpack/configs/utils/get-web-components-version.js +18 -8
- package/dist/webpack/configs/utils/get-web-components-version.js.map +1 -1
- package/dist/webpack/configs/utils/index.js +18 -16
- package/dist/webpack/configs/utils/index.js.map +1 -1
- package/dist/webpack/configs/watch-options-config.d.ts +6 -0
- package/dist/webpack/configs/watch-options-config.d.ts.map +1 -0
- package/dist/webpack/configs/watch-options-config.js +24 -0
- package/dist/webpack/configs/watch-options-config.js.map +1 -0
- package/dist/webpack/create-webpack-config.d.ts.map +1 -1
- package/dist/webpack/create-webpack-config.js +62 -50
- package/dist/webpack/create-webpack-config.js.map +1 -1
- package/dist/webpack/index.d.ts +1 -1
- package/dist/webpack/index.d.ts.map +1 -1
- package/dist/webpack/index.js +18 -17
- package/dist/webpack/index.js.map +1 -1
- package/dist/webpack/loaders/expose-loader/index.js +15 -15
- package/dist/webpack/loaders/expose-loader/index.js.map +1 -1
- package/dist/webpack/loaders/expose-loader/runtime/get-global-this.js +5 -6
- package/dist/webpack/loaders/expose-loader/runtime/get-global-this.js.map +1 -1
- package/dist/webpack/loaders/expose-loader/utils/contextify-request.js +20 -13
- package/dist/webpack/loaders/expose-loader/utils/contextify-request.js.map +1 -1
- package/dist/webpack/loaders/expose-loader/utils/get-new-user-request.js +22 -11
- package/dist/webpack/loaders/expose-loader/utils/get-new-user-request.js.map +1 -1
- package/dist/webpack/loaders/expose-loader/utils/index.js +20 -18
- package/dist/webpack/loaders/expose-loader/utils/index.js.map +1 -1
- package/dist/webpack/loaders/expose-loader/utils/stringify-request.js +20 -12
- package/dist/webpack/loaders/expose-loader/utils/stringify-request.js.map +1 -1
- package/dist/webpack/types.d.ts +0 -4
- package/dist/webpack/types.d.ts.map +1 -1
- package/dist/webpack/types.js +4 -1
- package/dist/webpack/types.js.map +1 -1
- package/dist/webpack/utils/feature-cohort.js +17 -12
- package/dist/webpack/utils/feature-cohort.js.map +1 -1
- package/dist/webpack/utils/get-caller-filename.js +14 -7
- package/dist/webpack/utils/get-caller-filename.js.map +1 -1
- package/dist/webpack/utils/{bundle.d.ts → get-module-entry-path.d.ts} +1 -1
- package/dist/webpack/utils/get-module-entry-path.d.ts.map +1 -0
- package/dist/webpack/utils/get-module-entry-path.js +21 -0
- package/dist/webpack/utils/get-module-entry-path.js.map +1 -0
- package/dist/webpack/utils/hash-mod.js +16 -11
- package/dist/webpack/utils/hash-mod.js.map +1 -1
- package/dist/webpack/utils/index.d.ts +1 -1
- package/dist/webpack/utils/index.d.ts.map +1 -1
- package/dist/webpack/utils/index.js +21 -19
- package/dist/webpack/utils/index.js.map +1 -1
- package/dist/webpack/utils/split-by-entry.js +17 -7
- package/dist/webpack/utils/split-by-entry.js.map +1 -1
- package/dist/webpack/utils/testing/compile.js +12 -4
- package/dist/webpack/utils/testing/compile.js.map +1 -1
- package/dist/webpack/utils/testing/execute.js +26 -13
- package/dist/webpack/utils/testing/execute.js.map +1 -1
- package/dist/webpack/utils/testing/get-compiler.js +34 -24
- package/dist/webpack/utils/testing/get-compiler.js.map +1 -1
- package/dist/webpack/utils/testing/get-errors.js +12 -4
- package/dist/webpack/utils/testing/get-errors.js.map +1 -1
- package/dist/webpack/utils/testing/get-module-source.js +18 -5
- package/dist/webpack/utils/testing/get-module-source.js.map +1 -1
- package/dist/webpack/utils/testing/get-warnings.js +12 -4
- package/dist/webpack/utils/testing/get-warnings.js.map +1 -1
- package/dist/webpack/utils/testing/index.js +28 -20
- package/dist/webpack/utils/testing/index.js.map +1 -1
- package/dist/webpack/utils/testing/normalize-errors.js +11 -3
- package/dist/webpack/utils/testing/normalize-errors.js.map +1 -1
- package/dist/webpack/utils/testing/read-asset.js +20 -11
- package/dist/webpack/utils/testing/read-asset.js.map +1 -1
- package/dist/webpack/utils/testing/read-assets.js +13 -5
- package/dist/webpack/utils/testing/read-assets.js.map +1 -1
- package/package.json +20 -20
- package/src/cli/commands/__tests__/build.test.ts +69 -44
- package/src/cli/commands/__tests__/clean.test.ts +32 -0
- package/src/cli/commands/__tests__/install.test.ts +50 -8
- package/src/cli/commands/__tests__/kendo-ui-license.test.ts +5 -5
- package/src/cli/commands/__tests__/lint.test.ts +4 -0
- package/src/cli/commands/__tests__/mfe-package-publish.test.ts +21 -2
- package/src/cli/commands/__tests__/mfe-publish.test.ts +19 -23
- package/src/cli/commands/__tests__/prepare-package.test.ts +17 -36
- package/src/cli/commands/__tests__/start.test.ts +81 -44
- package/src/cli/commands/__tests__/tests.test.ts +4 -0
- package/src/cli/commands/build.ts +73 -35
- package/src/cli/commands/bundle-package.ts +0 -4
- package/src/cli/commands/clean.ts +24 -0
- package/src/cli/commands/eslint.ts +1 -1
- package/src/cli/commands/get-command.ts +25 -35
- package/src/cli/commands/index.ts +1 -1
- package/src/cli/commands/install.ts +29 -8
- package/src/cli/commands/lint.ts +22 -17
- package/src/cli/commands/mfe-package-publish.ts +22 -5
- package/src/cli/commands/mfe-publish.ts +5 -18
- package/src/cli/commands/prepare-package.ts +8 -12
- package/src/cli/commands/review/__mocks__/expect-calls.ts +48 -0
- package/src/cli/commands/review/__mocks__/index.ts +1 -0
- package/src/cli/commands/review/__tests__/review.test.ts +483 -0
- package/src/cli/commands/review/index.ts +3 -0
- package/src/cli/commands/review/review.ts +247 -0
- package/src/cli/commands/review/rules/__mocks__/index.ts +3 -0
- package/src/cli/commands/review/rules/__mocks__/mock-config.ts +14 -0
- package/src/cli/commands/review/rules/__mocks__/mock-packages.ts +41 -0
- package/src/cli/commands/review/rules/__mocks__/mock-project.ts +11 -0
- package/src/cli/commands/review/rules/__tests__/no-typescript-entry-point.test.ts +166 -0
- package/src/cli/commands/review/rules/__tests__/require-explicit-side-effects.test.ts +113 -0
- package/src/cli/commands/review/rules/__tests__/require-npmrc.test.ts +71 -0
- package/src/cli/commands/review/rules/__tests__/require-one-anvil-uikit-contrib-version.test.ts +33 -0
- package/src/cli/commands/review/rules/__tests__/require-one-collection-version.test.ts +155 -0
- package/src/cli/commands/review/rules/__tests__/require-one-package-version.test.ts +135 -0
- package/src/cli/commands/review/rules/__tests__/require-one-uikit-version.ts +40 -0
- package/src/cli/commands/review/rules/__tests__/require-project-version-in-root-node-modules.test.ts +186 -0
- package/src/cli/commands/review/rules/__tests__/require-servicetitan-scope.test.ts +83 -0
- package/src/cli/commands/review/rules/index.ts +20 -0
- package/src/cli/commands/review/rules/no-typescript-entry-point.ts +78 -0
- package/src/cli/commands/review/rules/require-explicit-side-effects.ts +31 -0
- package/src/cli/commands/review/rules/require-npmrc.ts +27 -0
- package/src/cli/commands/review/rules/require-one-anvil-uikit-contrib-version.ts +20 -0
- package/src/cli/commands/review/rules/require-one-collection-version.ts +169 -0
- package/src/cli/commands/review/rules/require-one-package-version.ts +76 -0
- package/src/cli/commands/review/rules/require-one-uikit-version.ts +27 -0
- package/src/cli/commands/review/rules/require-project-version-in-root-node-modules.ts +104 -0
- package/src/cli/commands/review/rules/require-servicetitan-scope.ts +27 -0
- package/src/cli/commands/review/types.ts +72 -0
- package/src/cli/commands/review/utils/__tests__/compare-version.test.ts +73 -0
- package/src/cli/commands/review/utils/__tests__/get-max-version.test.ts +17 -0
- package/src/cli/commands/review/utils/__tests__/indent.test.ts +41 -0
- package/src/cli/commands/review/utils/__tests__/name-to-location.test.ts +39 -0
- package/src/cli/commands/review/utils/__tests__/set-version.test.ts +84 -0
- package/src/cli/commands/review/utils/apply-filter.ts +14 -0
- package/src/cli/commands/review/utils/collate-dependencies.ts +46 -0
- package/src/cli/commands/review/utils/compare-version.ts +82 -0
- package/src/cli/commands/review/utils/format-depends-on.ts +11 -0
- package/src/cli/commands/review/utils/format-location.ts +8 -0
- package/src/cli/commands/review/utils/get-key.ts +10 -0
- package/src/cli/commands/review/utils/get-max-version.ts +5 -0
- package/src/cli/commands/review/utils/indent.ts +8 -0
- package/src/cli/commands/review/utils/index.ts +13 -0
- package/src/cli/commands/review/utils/is-library.ts +5 -0
- package/src/cli/commands/review/utils/name-to-location.ts +7 -0
- package/src/cli/commands/review/utils/pluralize.ts +3 -0
- package/src/cli/commands/review/utils/set-version.ts +26 -0
- package/src/cli/commands/review/utils/summarize.ts +21 -0
- package/src/cli/commands/run-task.test.ts +60 -0
- package/src/cli/commands/start.ts +130 -55
- package/src/cli/commands/tests.ts +2 -0
- package/src/cli/commands/types.ts +1 -0
- package/src/cli/index.ts +4 -4
- package/src/cli/tasks/__tests__/cli-task.test.ts +16 -4
- package/src/cli/tasks/__tests__/{swc-compile.test.ts → swc-compile-package.test.ts} +75 -36
- package/src/cli/tasks/__tests__/tsc-compile-package.test.ts +1 -0
- package/src/cli/tasks/__tests__/tsc-compile.test.ts +12 -23
- package/src/cli/tasks/cli-task.ts +12 -18
- package/src/cli/tasks/swc-cli.d.ts +12 -1
- package/src/cli/tasks/swc-compile-package.ts +71 -45
- package/src/cli/tasks/task.ts +2 -11
- package/src/cli/tasks/tsc-compile-package.ts +0 -4
- package/src/cli/tasks/tsc-compile.ts +14 -17
- package/src/cli/types/cpx2.d.ts +8 -1
- package/src/cli/utils/__tests__/bundle.test.ts +1 -1
- package/src/cli/utils/__tests__/check-args.test.ts +34 -0
- package/src/cli/utils/__tests__/compile.test.ts +59 -0
- package/src/cli/utils/__tests__/copy-files.test.ts +157 -0
- package/src/cli/utils/__tests__/get-module-type.test.ts +19 -0
- package/src/cli/utils/__tests__/lerna-exec.test.ts +58 -11
- package/src/cli/utils/__tests__/pipe-stdout.test.ts +39 -0
- package/src/cli/utils/__tests__/process-tree.test.ts +175 -0
- package/src/cli/utils/__tests__/set-node-options.test.ts +51 -6
- package/src/cli/utils/__tests__/tcm.test.ts +90 -86
- package/src/cli/utils/__tests__/type-check.test.ts +47 -0
- package/src/cli/utils/__tests__/watch-stdout.test.ts +68 -0
- package/src/cli/utils/bundle.ts +5 -18
- package/src/cli/utils/check-args.ts +13 -0
- package/src/cli/utils/compile-less.ts +0 -1
- package/src/cli/utils/compile-sass.ts +0 -1
- package/src/cli/utils/compile.ts +22 -0
- package/src/cli/utils/copy-files.ts +76 -0
- package/src/cli/utils/eslint.ts +1 -0
- package/src/cli/utils/get-module-type.ts +4 -6
- package/src/cli/utils/index.ts +7 -6
- package/src/cli/utils/lerna-exec.ts +17 -10
- package/src/cli/utils/pipe-stdout.ts +10 -0
- package/src/cli/utils/process-tree.ts +57 -0
- package/src/cli/utils/set-node-options.ts +15 -12
- package/src/cli/utils/style-extensions.ts +1 -0
- package/src/cli/utils/tcm.ts +22 -32
- package/src/cli/utils/type-check.ts +19 -0
- package/src/cli/utils/watch-stdout.ts +24 -0
- package/src/utils/__tests__/format-duration.test.ts +22 -0
- package/src/utils/__tests__/get-configuration.test.ts +44 -2
- package/src/utils/__tests__/get-packages.test.ts +58 -49
- package/src/utils/__tests__/log-errors.test.ts +102 -0
- package/src/utils/__tests__/log.test.ts +1 -86
- package/src/utils/find-packages.ts +12 -6
- package/src/utils/format-duration.ts +13 -0
- package/src/utils/get-configuration.ts +19 -5
- package/src/utils/get-folders.ts +3 -1
- package/src/utils/get-packages.ts +9 -16
- package/src/utils/index.ts +3 -0
- package/src/utils/log-errors.ts +29 -0
- package/src/utils/log.ts +0 -26
- package/src/webpack/__mocks__/file-rules.ts +0 -5
- package/src/webpack/__tests__/create-webpack-config-web-component.test.ts +4 -5
- package/src/webpack/__tests__/create-webpack-config.test.ts +33 -112
- package/src/webpack/configs/dev-server-config.ts +4 -27
- package/src/webpack/configs/devtool-config.ts +2 -2
- package/src/webpack/configs/entry.config.ts +7 -2
- package/src/webpack/configs/index.ts +2 -1
- package/src/webpack/configs/loaders/index.ts +1 -1
- package/src/webpack/configs/optimization-config.ts +2 -2
- package/src/webpack/configs/plugins/index.ts +0 -2
- package/src/webpack/configs/plugins/virtual-modules-plugin.ts +3 -3
- package/src/webpack/configs/plugins-config.ts +0 -4
- package/src/webpack/configs/resolve-config.ts +1 -1
- package/src/webpack/configs/rules/index.ts +0 -1
- package/src/webpack/configs/rules/js-rules.ts +27 -2
- package/src/webpack/configs/rules-config.ts +1 -11
- package/src/webpack/configs/types.ts +1 -3
- package/src/webpack/configs/watch-options-config.ts +17 -0
- package/src/webpack/create-webpack-config.ts +3 -4
- package/src/webpack/index.ts +1 -1
- package/src/webpack/types.ts +0 -4
- package/src/webpack/utils/index.ts +1 -1
- package/dist/__mocks__/create-package.js +0 -17
- package/dist/__mocks__/create-package.js.map +0 -1
- package/dist/__mocks__/index.js +0 -18
- package/dist/__mocks__/index.js.map +0 -1
- package/dist/cli/utils/assets-copy.d.ts +0 -3
- package/dist/cli/utils/assets-copy.d.ts.map +0 -1
- package/dist/cli/utils/assets-copy.js +0 -25
- package/dist/cli/utils/assets-copy.js.map +0 -1
- package/dist/cli/utils/styles-copy.d.ts +0 -3
- package/dist/cli/utils/styles-copy.d.ts.map +0 -1
- package/dist/cli/utils/styles-copy.js +0 -25
- package/dist/cli/utils/styles-copy.js.map +0 -1
- package/dist/cli/utils/tsc.d.ts +0 -5
- package/dist/cli/utils/tsc.d.ts.map +0 -1
- package/dist/cli/utils/tsc.js +0 -37
- package/dist/cli/utils/tsc.js.map +0 -1
- package/dist/webpack/__mocks__/file-rules.js +0 -79
- package/dist/webpack/__mocks__/file-rules.js.map +0 -1
- package/dist/webpack/__mocks__/index.js +0 -19
- package/dist/webpack/__mocks__/index.js.map +0 -1
- package/dist/webpack/__mocks__/style-rules.js +0 -124
- package/dist/webpack/__mocks__/style-rules.js.map +0 -1
- package/dist/webpack/configs/plugins/provide-react-plugin.d.ts +0 -4
- package/dist/webpack/configs/plugins/provide-react-plugin.d.ts.map +0 -1
- package/dist/webpack/configs/plugins/provide-react-plugin.js +0 -13
- package/dist/webpack/configs/plugins/provide-react-plugin.js.map +0 -1
- package/dist/webpack/configs/plugins/ts-checker-plugin.d.ts +0 -4
- package/dist/webpack/configs/plugins/ts-checker-plugin.d.ts.map +0 -1
- package/dist/webpack/configs/plugins/ts-checker-plugin.js +0 -30
- package/dist/webpack/configs/plugins/ts-checker-plugin.js.map +0 -1
- package/dist/webpack/configs/rules/tsx-rules.d.ts +0 -4
- package/dist/webpack/configs/rules/tsx-rules.d.ts.map +0 -1
- package/dist/webpack/configs/rules/tsx-rules.js +0 -44
- package/dist/webpack/configs/rules/tsx-rules.js.map +0 -1
- package/dist/webpack/utils/bundle.d.ts.map +0 -1
- package/dist/webpack/utils/bundle.js +0 -19
- package/dist/webpack/utils/bundle.js.map +0 -1
- package/src/cli/utils/__tests__/assets-copy.test.ts +0 -52
- package/src/cli/utils/__tests__/styles-copy.test.ts +0 -52
- package/src/cli/utils/__tests__/tsc.test.ts +0 -63
- package/src/cli/utils/assets-copy.ts +0 -23
- package/src/cli/utils/styles-copy.ts +0 -23
- package/src/cli/utils/tsc.ts +0 -38
- package/src/webpack/configs/plugins/provide-react-plugin.ts +0 -12
- package/src/webpack/configs/plugins/ts-checker-plugin.ts +0 -33
- package/src/webpack/configs/rules/tsx-rules.ts +0 -48
- /package/src/webpack/utils/{bundle.ts → get-module-entry-path.ts} +0 -0
|
@@ -1,46 +1,58 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "PreparePackage", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return PreparePackage;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _utils = require("../../utils");
|
|
12
|
+
const _utils1 = require("../utils");
|
|
13
|
+
function _define_property(obj, key, value) {
|
|
14
|
+
if (key in obj) {
|
|
15
|
+
Object.defineProperty(obj, key, {
|
|
16
|
+
value: value,
|
|
17
|
+
enumerable: true,
|
|
18
|
+
configurable: true,
|
|
19
|
+
writable: true
|
|
20
|
+
});
|
|
21
|
+
} else {
|
|
22
|
+
obj[key] = value;
|
|
23
|
+
}
|
|
24
|
+
return obj;
|
|
25
|
+
}
|
|
26
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
3
27
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
28
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for
|
|
29
|
+
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;
|
|
6
30
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
}
|
|
8
|
-
|
|
31
|
+
}
|
|
32
|
+
function _ts_metadata(k, v) {
|
|
9
33
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
}
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.PreparePackage = void 0;
|
|
13
|
-
const utils_1 = require("../../utils");
|
|
14
|
-
const utils_2 = require("../utils");
|
|
34
|
+
}
|
|
15
35
|
class PreparePackage {
|
|
16
|
-
constructor(args) {
|
|
17
|
-
Object.defineProperty(this, "args", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
configurable: true,
|
|
20
|
-
writable: true,
|
|
21
|
-
value: args
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
36
|
description() {
|
|
25
37
|
return undefined;
|
|
26
38
|
}
|
|
27
39
|
async execute() {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
await (this.args['copy-files'] ? (0, _utils1.copyFiles)({
|
|
41
|
+
watch: this.args.watch
|
|
42
|
+
}) : (0, _utils1.tcm)({
|
|
43
|
+
watch: this.args.watch
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
constructor(args){
|
|
47
|
+
_define_property(this, "args", void 0);
|
|
48
|
+
this.args = args;
|
|
37
49
|
}
|
|
38
50
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
__metadata("design:returntype", Promise)
|
|
51
|
+
_ts_decorate([
|
|
52
|
+
_utils.logErrors,
|
|
53
|
+
_ts_metadata("design:type", Function),
|
|
54
|
+
_ts_metadata("design:paramtypes", []),
|
|
55
|
+
_ts_metadata("design:returntype", Promise)
|
|
45
56
|
], PreparePackage.prototype, "execute", null);
|
|
57
|
+
|
|
46
58
|
//# sourceMappingURL=prepare-package.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../src/cli/commands/prepare-package.ts"],"sourcesContent":["import { logErrors } from '../../utils';\nimport { copyFiles, tcm } from '../utils';\nimport { Command } from './types';\n\ninterface Args {\n 'watch'?: boolean;\n 'copy-files'?: boolean;\n}\n\nexport class PreparePackage implements Command {\n constructor(private args: Args) {}\n\n description() {\n return undefined;\n }\n\n @logErrors\n async execute() {\n await (this.args['copy-files']\n ? copyFiles({ watch: this.args.watch })\n : tcm({ watch: this.args.watch }));\n }\n}\n"],"names":["PreparePackage","description","undefined","execute","args","copyFiles","watch","tcm","constructor"],"mappings":";;;;+BASaA;;;eAAAA;;;uBATa;wBACK;;;;;;;;;;;;;;;;;;;;;;;AAQxB,MAAMA;IAGTC,cAAc;QACV,OAAOC;IACX;IAEA,MACMC,UAAU;QACZ,MAAO,CAAA,IAAI,CAACC,IAAI,CAAC,aAAa,GACxBC,IAAAA,iBAAS,EAAC;YAAEC,OAAO,IAAI,CAACF,IAAI,CAACE,KAAK;QAAC,KACnCC,IAAAA,WAAG,EAAC;YAAED,OAAO,IAAI,CAACF,IAAI,CAACE,KAAK;QAAC,EAAC;IACxC;IAXAE,YAAY,AAAQJ,IAAU,CAAE;;aAAZA,OAAAA;IAAa;AAYrC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Asserts that a sequence of mock function calls occurred in the specified order,
|
|
3
|
+
* with the specified arguments for each call.
|
|
4
|
+
*
|
|
5
|
+
* Each argument to this function should be either:
|
|
6
|
+
* - a mock function (jest.Mock), or
|
|
7
|
+
* - an array where the first element is a mock function and the rest are the expected arguments for that call.
|
|
8
|
+
*
|
|
9
|
+
* For each call, this function checks:
|
|
10
|
+
* - The mock was called with the expected arguments (if provided).
|
|
11
|
+
* - The call order is strictly increasing (i.e., each call happened after the previous one).
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* expectCalls(
|
|
15
|
+
* [mockA, 1, 2],
|
|
16
|
+
* [mockB, 'foo'],
|
|
17
|
+
* mockC
|
|
18
|
+
* );
|
|
19
|
+
*
|
|
20
|
+
* @param {...any[]} calls - Sequence of [mockFn, ...args] or mockFn to check call order and arguments.
|
|
21
|
+
*/
|
|
22
|
+
export declare function expectCalls(...calls: any[]): void;
|
|
23
|
+
//# sourceMappingURL=expect-calls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expect-calls.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/review/__mocks__/expect-calls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,wBAAgB,WAAW,CAAC,GAAG,KAAK,EAAE,GAAG,EAAE,QAqB1C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/review/__mocks__/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/review/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AAEzB,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
_export_star(require("./review"), exports);
|
|
6
|
+
function _export_star(from, to) {
|
|
7
|
+
Object.keys(from).forEach(function(k) {
|
|
8
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
9
|
+
Object.defineProperty(to, k, {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function() {
|
|
12
|
+
return from[k];
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
return from;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/cli/commands/review/index.ts"],"sourcesContent":["export * from './review';\n\nexport type { ReviewConfiguration } from './types';\n"],"names":[],"mappings":";;;;qBAAc"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Command } from '../types';
|
|
2
|
+
interface Args {
|
|
3
|
+
fix?: boolean;
|
|
4
|
+
rule?: string | string[];
|
|
5
|
+
}
|
|
6
|
+
export declare class Review implements Command {
|
|
7
|
+
private readonly args;
|
|
8
|
+
private readonly severityToLabel;
|
|
9
|
+
private readonly levelToSeverity;
|
|
10
|
+
constructor(args: Args);
|
|
11
|
+
description(): string;
|
|
12
|
+
execute(): Promise<void>;
|
|
13
|
+
private createProject;
|
|
14
|
+
private debug;
|
|
15
|
+
private findErrors;
|
|
16
|
+
private fixErrors;
|
|
17
|
+
private formatError;
|
|
18
|
+
private reportErrors;
|
|
19
|
+
private reportSummary;
|
|
20
|
+
private runRules;
|
|
21
|
+
private runRule;
|
|
22
|
+
private transform;
|
|
23
|
+
private getLevel;
|
|
24
|
+
private getLink;
|
|
25
|
+
private getSelectedRules;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=review.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/review/review.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAwBnC,UAAU,IAAI;IACV,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC5B;AAED,qBAAa,MAAO,YAAW,OAAO;IAWtB,OAAO,CAAC,QAAQ,CAAC,IAAI;IAVjC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAG9B;IAEF,OAAO,CAAC,QAAQ,CAAC,eAAe,CAG9B;gBAE2B,IAAI,EAAE,IAAI;IAEvC,WAAW;IAKL,OAAO;IAMb,OAAO,CAAC,aAAa;IAuBrB,OAAO,CAAC,KAAK;IAKb,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,SAAS;IAyCjB,OAAO,CAAC,WAAW;IAUnB,OAAO,CAAC,YAAY;IAoBpB,OAAO,CAAC,aAAa;IAmBrB,OAAO,CAAC,QAAQ;IAShB,OAAO,CAAC,OAAO;IASf,OAAO,CAAC,SAAS;IAKjB,OAAO,CAAC,QAAQ;IAShB,OAAO,CAAC,OAAO;IAKf,OAAO,CAAC,gBAAgB;CAU3B"}
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "Review", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return Review;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _chalk = /*#__PURE__*/ _interop_require_default(require("chalk"));
|
|
12
|
+
const _child_process = require("child_process");
|
|
13
|
+
const _terminallink = /*#__PURE__*/ _interop_require_default(require("terminal-link"));
|
|
14
|
+
const _utils = require("../../../utils");
|
|
15
|
+
const _types = require("./types");
|
|
16
|
+
const _utils1 = require("./utils");
|
|
17
|
+
const _rules = require("./rules");
|
|
18
|
+
function _define_property(obj, key, value) {
|
|
19
|
+
if (key in obj) {
|
|
20
|
+
Object.defineProperty(obj, key, {
|
|
21
|
+
value: value,
|
|
22
|
+
enumerable: true,
|
|
23
|
+
configurable: true,
|
|
24
|
+
writable: true
|
|
25
|
+
});
|
|
26
|
+
} else {
|
|
27
|
+
obj[key] = value;
|
|
28
|
+
}
|
|
29
|
+
return obj;
|
|
30
|
+
}
|
|
31
|
+
function _interop_require_default(obj) {
|
|
32
|
+
return obj && obj.__esModule ? obj : {
|
|
33
|
+
default: obj
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
37
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
38
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
39
|
+
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;
|
|
40
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
41
|
+
}
|
|
42
|
+
function _ts_metadata(k, v) {
|
|
43
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
44
|
+
}
|
|
45
|
+
const collator = new Intl.Collator();
|
|
46
|
+
class Review {
|
|
47
|
+
description() {
|
|
48
|
+
return 'check project for configuration errors';
|
|
49
|
+
}
|
|
50
|
+
async execute() {
|
|
51
|
+
const errors = this.args.fix ? this.fixErrors() : this.findErrors();
|
|
52
|
+
const summary = this.reportErrors(errors);
|
|
53
|
+
return summary.error > 0 ? Promise.reject() : Promise.resolve();
|
|
54
|
+
}
|
|
55
|
+
createProject() {
|
|
56
|
+
const root = (0, _utils.readJsonSafe)('package.json');
|
|
57
|
+
if (!(root === null || root === void 0 ? void 0 : root.workspaces)) {
|
|
58
|
+
throw new Error('this command must be run from the workspace root directory');
|
|
59
|
+
}
|
|
60
|
+
const packageLock = (0, _utils.readJsonSafe)('package-lock.json');
|
|
61
|
+
if (!(packageLock === null || packageLock === void 0 ? void 0 : packageLock.packages)) {
|
|
62
|
+
throw new Error('this command must be run with valid package-lock.json');
|
|
63
|
+
}
|
|
64
|
+
root.location = '.'; // identifies the root package.json for rules that care
|
|
65
|
+
packageLock.location = './package-lock.json';
|
|
66
|
+
const config = (0, _utils.getReviewConfiguration)();
|
|
67
|
+
const packages = [
|
|
68
|
+
root,
|
|
69
|
+
...(0, _utils.findPackages)()
|
|
70
|
+
];
|
|
71
|
+
const dependencies = sortByKey((0, _utils1.collateDependencies)(packages));
|
|
72
|
+
this.debug('review:packages', packages);
|
|
73
|
+
this.debug('review:dependencies', dependencies);
|
|
74
|
+
return {
|
|
75
|
+
config,
|
|
76
|
+
dependencies,
|
|
77
|
+
packageLock,
|
|
78
|
+
packages
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
debug(namespace, data) {
|
|
82
|
+
/* istanbul ignore next: debug only */ _utils.log.debug(namespace, ()=>data && JSON.stringify(data, null, 2));
|
|
83
|
+
}
|
|
84
|
+
findErrors(project) {
|
|
85
|
+
const errors = this.runRules(project !== null && project !== void 0 ? project : this.createProject());
|
|
86
|
+
this.debug('review:errors', errors);
|
|
87
|
+
return errors;
|
|
88
|
+
}
|
|
89
|
+
fixErrors() {
|
|
90
|
+
const rulesById = _rules.rules.reduce((result, rule)=>{
|
|
91
|
+
result[rule.id] = rule;
|
|
92
|
+
return result;
|
|
93
|
+
}, {});
|
|
94
|
+
let project = this.createProject();
|
|
95
|
+
let errors = this.findErrors(project);
|
|
96
|
+
let totalFixed = 0;
|
|
97
|
+
for (const category of [
|
|
98
|
+
_types.FixCategory.isolated,
|
|
99
|
+
_types.FixCategory.normal,
|
|
100
|
+
_types.FixCategory.lockFile
|
|
101
|
+
]){
|
|
102
|
+
const fixable = errors.filter(({ fixable })=>fixable === category);
|
|
103
|
+
if (fixable.length === 0) {
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
fixable.forEach((error)=>{
|
|
107
|
+
const rule = rulesById[error.id];
|
|
108
|
+
if (rule.fix) {
|
|
109
|
+
_utils.log.text(`Fixing ${this.formatError({
|
|
110
|
+
...error,
|
|
111
|
+
details: '',
|
|
112
|
+
location: ''
|
|
113
|
+
})}`);
|
|
114
|
+
rule.fix(error, project);
|
|
115
|
+
totalFixed += 1;
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
(0, _child_process.execSync)('npx startup install --fix --quiet', {
|
|
119
|
+
stdio: 'inherit'
|
|
120
|
+
});
|
|
121
|
+
project = this.createProject();
|
|
122
|
+
errors = this.findErrors(project);
|
|
123
|
+
}
|
|
124
|
+
if (totalFixed > 0) {
|
|
125
|
+
let summary = `Fixed ${(0, _utils1.pluralize)(totalFixed, 'problem')}`;
|
|
126
|
+
if (errors.length) {
|
|
127
|
+
summary = `${summary}, ${(0, _utils1.pluralize)(errors.length, 'problem remains', 'problems remain')}:\n`;
|
|
128
|
+
}
|
|
129
|
+
_utils.log.info(summary);
|
|
130
|
+
}
|
|
131
|
+
return errors;
|
|
132
|
+
}
|
|
133
|
+
formatError(error) {
|
|
134
|
+
const { location, message, severity = _types.ErrorSeverity.error } = error;
|
|
135
|
+
const label = (0, _utils1.indent)(this.severityToLabel[severity], location ? 1 : 0);
|
|
136
|
+
const details = error.details ? `\n${(0, _utils1.indent)(error.details, location ? 2 : 1)}` : '';
|
|
137
|
+
const link = this.getLink(error);
|
|
138
|
+
return `${label} ${message} ${link}${details}`;
|
|
139
|
+
}
|
|
140
|
+
reportErrors(errors) {
|
|
141
|
+
let prevLocation;
|
|
142
|
+
errors.forEach((error, index)=>{
|
|
143
|
+
const { location } = error;
|
|
144
|
+
if (index > 0 && (!location || location !== prevLocation)) {
|
|
145
|
+
_utils.log.text('');
|
|
146
|
+
}
|
|
147
|
+
if (location && location !== prevLocation) {
|
|
148
|
+
_utils.log.text(_chalk.default.underline((0, _utils1.formatLocation)(location)));
|
|
149
|
+
prevLocation = location;
|
|
150
|
+
}
|
|
151
|
+
_utils.log.text(this.formatError(error));
|
|
152
|
+
});
|
|
153
|
+
const summary = (0, _utils1.summarize)(errors);
|
|
154
|
+
this.reportSummary(summary);
|
|
155
|
+
return summary;
|
|
156
|
+
}
|
|
157
|
+
reportSummary({ error, warning, fixable }) {
|
|
158
|
+
if (error + warning === 0) {
|
|
159
|
+
return _utils.log.success('0 problems');
|
|
160
|
+
}
|
|
161
|
+
_utils.log.text('');
|
|
162
|
+
const severity = error ? 'error' : 'warning';
|
|
163
|
+
_utils.log[severity](`${(0, _utils1.pluralize)(error + warning, 'problem')} (${(0, _utils1.pluralize)(error, 'error')}, ${(0, _utils1.pluralize)(warning, 'warning')})`);
|
|
164
|
+
if (fixable.error + fixable.warning > 0) {
|
|
165
|
+
_utils.log[severity](`${(0, _utils1.pluralize)(fixable.error, 'error')} and ${(0, _utils1.pluralize)(fixable.warning, 'warning')} potentially fixable with --fix option`);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
runRules(project) {
|
|
169
|
+
const selected = this.getSelectedRules();
|
|
170
|
+
return _rules.rules.filter(({ id })=>!selected || selected.has(id)).flatMap((rule)=>this.runRule(rule, project)).filter((error)=>!!error).sort(compareError);
|
|
171
|
+
}
|
|
172
|
+
runRule(rule, project) {
|
|
173
|
+
var _project_config_rules;
|
|
174
|
+
const level = this.getLevel((_project_config_rules = project.config.rules) === null || _project_config_rules === void 0 ? void 0 : _project_config_rules[rule.id]);
|
|
175
|
+
if (level === 'off') {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
return this.transform(rule.run(project), level);
|
|
179
|
+
}
|
|
180
|
+
transform(errors, level) {
|
|
181
|
+
const severity = level && this.levelToSeverity[level];
|
|
182
|
+
return errors && severity ? (0, _utils.toArray)(errors).map((error)=>({
|
|
183
|
+
...error,
|
|
184
|
+
severity
|
|
185
|
+
})) : errors;
|
|
186
|
+
}
|
|
187
|
+
getLevel(config) {
|
|
188
|
+
if (typeof config === 'string') {
|
|
189
|
+
return config;
|
|
190
|
+
}
|
|
191
|
+
if (Array.isArray(config) && typeof config[0] === 'string') {
|
|
192
|
+
return config[0];
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
getLink({ id }) {
|
|
196
|
+
const url = `https://docs.st.dev/docs/frontend/uikit/startup/review#${id}`;
|
|
197
|
+
return _chalk.default.dim((0, _terminallink.default)(id, url));
|
|
198
|
+
}
|
|
199
|
+
getSelectedRules() {
|
|
200
|
+
const rule = this.args.rule;
|
|
201
|
+
if (typeof rule === 'string' && rule) {
|
|
202
|
+
return new Set([
|
|
203
|
+
rule
|
|
204
|
+
]);
|
|
205
|
+
}
|
|
206
|
+
if (Array.isArray(rule)) {
|
|
207
|
+
return new Set(rule.filter((id)=>!!id));
|
|
208
|
+
}
|
|
209
|
+
return undefined;
|
|
210
|
+
}
|
|
211
|
+
constructor(args){
|
|
212
|
+
_define_property(this, "args", void 0);
|
|
213
|
+
_define_property(this, "severityToLabel", void 0);
|
|
214
|
+
_define_property(this, "levelToSeverity", void 0);
|
|
215
|
+
this.args = args;
|
|
216
|
+
this.severityToLabel = {
|
|
217
|
+
[_types.ErrorSeverity.warning]: _chalk.default.yellow('warning'),
|
|
218
|
+
[_types.ErrorSeverity.error]: _chalk.default.red('error')
|
|
219
|
+
};
|
|
220
|
+
this.levelToSeverity = {
|
|
221
|
+
warn: _types.ErrorSeverity.warning,
|
|
222
|
+
error: _types.ErrorSeverity.error
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
_ts_decorate([
|
|
227
|
+
_utils.logErrors,
|
|
228
|
+
_ts_metadata("design:type", Function),
|
|
229
|
+
_ts_metadata("design:paramtypes", []),
|
|
230
|
+
_ts_metadata("design:returntype", Promise)
|
|
231
|
+
], Review.prototype, "execute", null);
|
|
232
|
+
function compareError({ location: locationA = '', severity: severityA = _types.ErrorSeverity.error }, { location: locationB = '', severity: severityB = _types.ErrorSeverity.error }) {
|
|
233
|
+
return locationA === locationB ? severityA - severityB : collator.compare(locationA, locationB);
|
|
234
|
+
}
|
|
235
|
+
function sortByKey(obj) {
|
|
236
|
+
return Object.fromEntries(Object.entries(obj).sort(([a], [b])=>collator.compare(a, b)));
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
//# sourceMappingURL=review.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/cli/commands/review/review.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { execSync } from 'child_process';\nimport terminalLink from 'terminal-link';\nimport {\n findPackages,\n getReviewConfiguration,\n log,\n logErrors,\n readJsonSafe,\n toArray,\n} from '../../../utils';\nimport { Command } from '../types';\n\nimport {\n ErrorSeverity,\n FixCategory,\n Level,\n Package,\n PackageError,\n PackageRule,\n Project,\n RuleConfiguration,\n} from './types';\nimport {\n collateDependencies,\n ErrorSummary,\n formatLocation,\n indent,\n pluralize,\n summarize,\n} from './utils';\nimport { rules } from './rules';\n\nconst collator = new Intl.Collator();\n\ninterface Args {\n fix?: boolean;\n rule?: string | string[];\n}\n\nexport class Review implements Command {\n private readonly severityToLabel: Record<ErrorSeverity, string> = {\n [ErrorSeverity.warning]: chalk.yellow('warning'),\n [ErrorSeverity.error]: chalk.red('error'),\n };\n\n private readonly levelToSeverity: Partial<Record<Level, ErrorSeverity>> = {\n warn: ErrorSeverity.warning,\n error: ErrorSeverity.error,\n };\n\n constructor(private readonly args: Args) {}\n\n description() {\n return 'check project for configuration errors';\n }\n\n @logErrors\n async execute() {\n const errors = this.args.fix ? this.fixErrors() : this.findErrors();\n const summary = this.reportErrors(errors);\n return summary.error > 0 ? Promise.reject() : Promise.resolve();\n }\n\n private createProject(): Project {\n const root = readJsonSafe('package.json');\n if (!root?.workspaces) {\n throw new Error('this command must be run from the workspace root directory');\n }\n\n const packageLock = readJsonSafe<Project['packageLock']>('package-lock.json');\n if (!packageLock?.packages) {\n throw new Error('this command must be run with valid package-lock.json');\n }\n\n root.location = '.'; // identifies the root package.json for rules that care\n packageLock.location = './package-lock.json';\n\n const config = getReviewConfiguration();\n const packages: Package[] = [root, ...findPackages()];\n const dependencies = sortByKey(collateDependencies(packages));\n this.debug('review:packages', packages);\n this.debug('review:dependencies', dependencies);\n\n return { config, dependencies, packageLock, packages };\n }\n\n private debug(namespace: string, data: any) {\n /* istanbul ignore next: debug only */\n log.debug(namespace, () => data && JSON.stringify(data, null, 2));\n }\n\n private findErrors(project?: Project) {\n const errors = this.runRules(project ?? this.createProject());\n this.debug('review:errors', errors);\n return errors;\n }\n\n private fixErrors() {\n const rulesById = rules.reduce<Record<string, PackageRule>>((result, rule) => {\n result[rule.id] = rule;\n return result;\n }, {});\n\n let project = this.createProject();\n let errors = this.findErrors(project);\n let totalFixed = 0;\n\n for (const category of [FixCategory.isolated, FixCategory.normal, FixCategory.lockFile]) {\n const fixable = errors.filter(({ fixable }) => fixable === category);\n if (fixable.length === 0) {\n continue;\n }\n\n fixable.forEach(error => {\n const rule = rulesById[error.id];\n if (rule.fix) {\n log.text(`Fixing ${this.formatError({ ...error, details: '', location: '' })}`);\n rule.fix(error, project);\n totalFixed += 1;\n }\n });\n\n execSync('npx startup install --fix --quiet', { stdio: 'inherit' });\n project = this.createProject();\n errors = this.findErrors(project);\n }\n\n if (totalFixed > 0) {\n let summary = `Fixed ${pluralize(totalFixed, 'problem')}`;\n if (errors.length) {\n summary = `${summary}, ${pluralize(errors.length, 'problem remains', 'problems remain')}:\\n`;\n }\n log.info(summary);\n }\n\n return errors;\n }\n\n private formatError(error: PackageError) {\n const { location, message, severity = ErrorSeverity.error } = error;\n\n const label = indent(this.severityToLabel[severity], location ? 1 : 0);\n const details = error.details ? `\\n${indent(error.details, location ? 2 : 1)}` : '';\n const link = this.getLink(error);\n\n return `${label} ${message} ${link}${details}`;\n }\n\n private reportErrors(errors: PackageError[]) {\n let prevLocation: string | undefined;\n\n errors.forEach((error, index) => {\n const { location } = error;\n if (index > 0 && (!location || location !== prevLocation)) {\n log.text('');\n }\n if (location && location !== prevLocation) {\n log.text(chalk.underline(formatLocation(location)));\n prevLocation = location;\n }\n log.text(this.formatError(error));\n });\n\n const summary = summarize(errors);\n this.reportSummary(summary);\n return summary;\n }\n\n private reportSummary({ error, warning, fixable }: ErrorSummary) {\n if (error + warning === 0) {\n return log.success('0 problems');\n }\n\n log.text('');\n\n const severity = error ? 'error' : 'warning';\n log[severity](\n `${pluralize(error + warning, 'problem')} (${pluralize(error, 'error')}, ${pluralize(warning, 'warning')})`\n );\n\n if (fixable.error + fixable.warning > 0) {\n log[severity](\n `${pluralize(fixable.error, 'error')} and ${pluralize(fixable.warning, 'warning')} potentially fixable with --fix option`\n );\n }\n }\n\n private runRules(project: Project): PackageError[] {\n const selected = this.getSelectedRules();\n return rules\n .filter(({ id }) => !selected || selected.has(id))\n .flatMap(rule => this.runRule(rule, project))\n .filter(error => !!error)\n .sort(compareError);\n }\n\n private runRule(rule: PackageRule, project: Project) {\n const level = this.getLevel(project.config.rules?.[rule.id]);\n if (level === 'off') {\n return;\n }\n\n return this.transform(rule.run(project), level);\n }\n\n private transform(errors?: PackageError | PackageError[], level?: 'error' | 'warn') {\n const severity = level && this.levelToSeverity[level];\n return errors && severity ? toArray(errors).map(error => ({ ...error, severity })) : errors;\n }\n\n private getLevel(config?: RuleConfiguration) {\n if (typeof config === 'string') {\n return config;\n }\n if (Array.isArray(config) && typeof config[0] === 'string') {\n return config[0];\n }\n }\n\n private getLink({ id }: PackageError) {\n const url = `https://docs.st.dev/docs/frontend/uikit/startup/review#${id}`;\n return chalk.dim(terminalLink(id, url));\n }\n\n private getSelectedRules() {\n const rule = this.args.rule;\n if (typeof rule === 'string' && rule) {\n return new Set([rule]);\n }\n if (Array.isArray(rule)) {\n return new Set(rule.filter(id => !!id));\n }\n return undefined;\n }\n}\n\nfunction compareError(\n { location: locationA = '', severity: severityA = ErrorSeverity.error }: PackageError,\n { location: locationB = '', severity: severityB = ErrorSeverity.error }: PackageError\n) {\n return locationA === locationB ? severityA - severityB : collator.compare(locationA, locationB);\n}\n\nfunction sortByKey<T>(obj: Record<string, T>): Record<string, T> {\n return Object.fromEntries(Object.entries(obj).sort(([a], [b]) => collator.compare(a, b)));\n}\n"],"names":["Review","collator","Intl","Collator","description","execute","errors","args","fix","fixErrors","findErrors","summary","reportErrors","error","Promise","reject","resolve","createProject","root","readJsonSafe","workspaces","Error","packageLock","packages","location","config","getReviewConfiguration","findPackages","dependencies","sortByKey","collateDependencies","debug","namespace","data","log","JSON","stringify","project","runRules","rulesById","rules","reduce","result","rule","id","totalFixed","category","FixCategory","isolated","normal","lockFile","fixable","filter","length","forEach","text","formatError","details","execSync","stdio","pluralize","info","message","severity","ErrorSeverity","label","indent","severityToLabel","link","getLink","prevLocation","index","chalk","underline","formatLocation","summarize","reportSummary","warning","success","selected","getSelectedRules","has","flatMap","runRule","sort","compareError","level","getLevel","transform","run","levelToSeverity","toArray","map","Array","isArray","url","dim","terminalLink","Set","undefined","constructor","yellow","red","warn","locationA","severityA","locationB","severityB","compare","obj","Object","fromEntries","entries","a","b"],"mappings":";;;;+BAwCaA;;;eAAAA;;;8DAxCK;+BACO;qEACA;uBAQlB;uBAYA;wBAQA;uBACe;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtB,MAAMC,WAAW,IAAIC,KAAKC,QAAQ;AAO3B,MAAMH;IAaTI,cAAc;QACV,OAAO;IACX;IAEA,MACMC,UAAU;QACZ,MAAMC,SAAS,IAAI,CAACC,IAAI,CAACC,GAAG,GAAG,IAAI,CAACC,SAAS,KAAK,IAAI,CAACC,UAAU;QACjE,MAAMC,UAAU,IAAI,CAACC,YAAY,CAACN;QAClC,OAAOK,QAAQE,KAAK,GAAG,IAAIC,QAAQC,MAAM,KAAKD,QAAQE,OAAO;IACjE;IAEQC,gBAAyB;QAC7B,MAAMC,OAAOC,IAAAA,mBAAY,EAAC;QAC1B,IAAI,EAACD,iBAAAA,2B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C,EAAE,GAAKjH,SAAS2G,OAAO,CAACK,GAAGC;AACzF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/cli/commands/review/rules/__mocks__/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock-config.d.ts","sourceRoot":"","sources":["../../../../../../src/cli/commands/review/rules/__mocks__/mock-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,wBAAgB,UAAU,CAAC,EACvB,EAAE,EACF,KAAe,EACf,OAAY,GACf,EAAE;IACC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACzB,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC9B,GAAG,mBAAmB,CAEtB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Dependencies, Package } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Generates an array of mock Package objects based on a dependencies map.
|
|
4
|
+
*
|
|
5
|
+
* Each dependency entry can specify multiple versions, and each version can be used by multiple package names.
|
|
6
|
+
* The resulting packages will have their dependencies set accordingly.
|
|
7
|
+
*
|
|
8
|
+
* @param {Dependencies} dependencies - An object mapping dependency names to version maps,
|
|
9
|
+
* where each version maps to an array of package names that depend on that version.
|
|
10
|
+
*
|
|
11
|
+
* @returns {Package[]} An array of Package objects with the specified dependencies.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* const deps = {
|
|
15
|
+
* lodash: { '4.17.21': ['foo', 'bar'], '4.17.20': ['baz'] }
|
|
16
|
+
* };
|
|
17
|
+
* const pkgs = mockPackages(deps);
|
|
18
|
+
* // pkgs will include packages 'foo', 'bar', and 'baz' with appropriate lodash dependencies.
|
|
19
|
+
*/
|
|
20
|
+
export declare function mockPackages(dependencies: Dependencies): Package[];
|
|
21
|
+
//# sourceMappingURL=mock-packages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock-packages.d.ts","sourceRoot":"","sources":["../../../../../../src/cli/commands/review/rules/__mocks__/mock-packages.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEpD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,EAAE,CAmBlE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock-project.d.ts","sourceRoot":"","sources":["../../../../../../src/cli/commands/review/rules/__mocks__/mock-project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAQ9D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/review/rules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAUvC,eAAO,MAAM,KAAK,EAAE,WAAW,EAS9B,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "rules", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return rules;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _notypescriptentrypoint = require("./no-typescript-entry-point");
|
|
12
|
+
const _requireexplicitsideeffects = require("./require-explicit-side-effects");
|
|
13
|
+
const _requirenpmrc = require("./require-npmrc");
|
|
14
|
+
const _requireoneanviluikitcontribversion = require("./require-one-anvil-uikit-contrib-version");
|
|
15
|
+
const _requireonepackageversion = require("./require-one-package-version");
|
|
16
|
+
const _requireoneuikitversion = require("./require-one-uikit-version");
|
|
17
|
+
const _requireprojectversioninrootnodemodules = require("./require-project-version-in-root-node-modules");
|
|
18
|
+
const _requireservicetitanscope = require("./require-servicetitan-scope");
|
|
19
|
+
const rules = [
|
|
20
|
+
new _requireonepackageversion.RequireOnePackageVersion(),
|
|
21
|
+
new _requireoneuikitversion.RequireOneUikitVersion(),
|
|
22
|
+
new _requireoneanviluikitcontribversion.RequireOneAnvilUikitContribVersion(),
|
|
23
|
+
new _requireprojectversioninrootnodemodules.RequireProjectVersionInRootNodeModules(),
|
|
24
|
+
new _notypescriptentrypoint.NoTypescriptEntryPoint(),
|
|
25
|
+
new _requireservicetitanscope.RequireServiceTitanScope(),
|
|
26
|
+
new _requireexplicitsideeffects.RequireExplicitSideEffects(),
|
|
27
|
+
new _requirenpmrc.RequireNpmrc()
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/cli/commands/review/rules/index.ts"],"sourcesContent":["import { PackageRule } from '../types';\nimport { NoTypescriptEntryPoint } from './no-typescript-entry-point';\nimport { RequireExplicitSideEffects } from './require-explicit-side-effects';\nimport { RequireNpmrc } from './require-npmrc';\nimport { RequireOneAnvilUikitContribVersion } from './require-one-anvil-uikit-contrib-version';\nimport { RequireOnePackageVersion } from './require-one-package-version';\nimport { RequireOneUikitVersion } from './require-one-uikit-version';\nimport { RequireProjectVersionInRootNodeModules } from './require-project-version-in-root-node-modules';\nimport { RequireServiceTitanScope } from './require-servicetitan-scope';\n\nexport const rules: PackageRule[] = [\n new RequireOnePackageVersion(),\n new RequireOneUikitVersion(),\n new RequireOneAnvilUikitContribVersion(),\n new RequireProjectVersionInRootNodeModules(),\n new NoTypescriptEntryPoint(),\n new RequireServiceTitanScope(),\n new RequireExplicitSideEffects(),\n new RequireNpmrc(),\n];\n"],"names":["rules","RequireOnePackageVersion","RequireOneUikitVersion","RequireOneAnvilUikitContribVersion","RequireProjectVersionInRootNodeModules","NoTypescriptEntryPoint","RequireServiceTitanScope","RequireExplicitSideEffects","RequireNpmrc"],"mappings":";;;;+BAUaA;;;eAAAA;;;wCAT0B;4CACI;8BACd;oDACsB;0CACV;wCACF;wDACgB;0CACd;AAElC,MAAMA,QAAuB;IAChC,IAAIC,kDAAwB;IAC5B,IAAIC,8CAAsB;IAC1B,IAAIC,sEAAkC;IACtC,IAAIC,8EAAsC;IAC1C,IAAIC,8CAAsB;IAC1B,IAAIC,kDAAwB;IAC5B,IAAIC,sDAA0B;IAC9B,IAAIC,0BAAY;CACnB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PackageError, PackageRule, Project } from '../types';
|
|
2
|
+
interface ErrorData {
|
|
3
|
+
key: string;
|
|
4
|
+
value: string;
|
|
5
|
+
}
|
|
6
|
+
export declare class NoTypescriptEntryPoint implements PackageRule {
|
|
7
|
+
get id(): string;
|
|
8
|
+
run({ config, packages }: Project): PackageError<ErrorData>[];
|
|
9
|
+
fix({ data, location }: PackageError<ErrorData>): void;
|
|
10
|
+
private checkEntryPoints;
|
|
11
|
+
private isTypescriptEntryPoint;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=no-typescript-entry-point.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-typescript-entry-point.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/review/rules/no-typescript-entry-point.ts"],"names":[],"mappings":"AAGA,OAAO,EAAwB,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGpF,UAAU,SAAS;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,sBAAuB,YAAW,WAAW;IACtD,IAAI,EAAE,WAEL;IAED,GAAG,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,OAAO,GAAG,YAAY,CAAC,SAAS,CAAC,EAAE;IAO7D,GAAG,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,YAAY,CAAC,SAAS,CAAC;IAc/C,OAAO,CAAC,gBAAgB;IAqCxB,OAAO,CAAC,sBAAsB;CAGjC"}
|