@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,70 +1,96 @@
|
|
|
1
1
|
import { swcDir } from '@swc/cli';
|
|
2
|
-
import
|
|
2
|
+
import deepmerge from 'deepmerge';
|
|
3
3
|
|
|
4
|
+
import { compilerOptions as baseCompilerOptions } from '../../../tsconfig/base.json';
|
|
4
5
|
import { Task } from './task';
|
|
5
|
-
import { getFolders, log, readJson } from '../../utils';
|
|
6
|
+
import { getFolders, getSwcCompilePackageConfiguration, log, readJson } from '../../utils';
|
|
6
7
|
|
|
7
8
|
interface Args {
|
|
8
9
|
[key: string]: unknown;
|
|
9
10
|
watch?: boolean;
|
|
10
11
|
}
|
|
11
12
|
|
|
13
|
+
function toLowerCase(input: string | undefined): string | undefined {
|
|
14
|
+
return input?.toLowerCase();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function overwriteMerge(_destinationArray: unknown[], sourceArray: unknown[]) {
|
|
18
|
+
return sourceArray;
|
|
19
|
+
}
|
|
20
|
+
|
|
12
21
|
export class SwcCompilePackage extends Task {
|
|
13
22
|
constructor({ watch }: Args) {
|
|
14
23
|
super({ name: 'swc-compile-package', global: false, watch });
|
|
15
24
|
}
|
|
16
25
|
|
|
17
|
-
description() {
|
|
18
|
-
return 'Compiles TypeScript files to JavaScript with SWC within package folder';
|
|
19
|
-
}
|
|
20
|
-
|
|
21
26
|
async execute(): Promise<void> {
|
|
22
27
|
const { source, destination } = getFolders();
|
|
23
28
|
const compilerOptions = readJson('tsconfig.json').compilerOptions ?? {};
|
|
29
|
+
const packageConfig = getSwcCompilePackageConfiguration();
|
|
24
30
|
|
|
25
31
|
return new Promise((resolve, reject) => {
|
|
26
|
-
swcDir(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
swcDir(
|
|
33
|
+
deepmerge(
|
|
34
|
+
{
|
|
35
|
+
cliOptions: {
|
|
36
|
+
watch: this.watch,
|
|
37
|
+
outDir: destination,
|
|
38
|
+
stripLeadingPaths: true,
|
|
39
|
+
extensions: ['.ts', '.tsx'],
|
|
40
|
+
filenames: [source],
|
|
41
|
+
ignore: [
|
|
42
|
+
'**/*.d.ts',
|
|
43
|
+
'**/__tests__/*',
|
|
44
|
+
'**/*.test.*',
|
|
45
|
+
'**/__mocks__/*',
|
|
46
|
+
],
|
|
47
|
+
copyFiles: true,
|
|
40
48
|
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
49
|
+
swcOptions: {
|
|
50
|
+
jsc: {
|
|
51
|
+
parser: {
|
|
52
|
+
syntax: 'typescript',
|
|
53
|
+
tsx: true,
|
|
54
|
+
decorators: true,
|
|
55
|
+
},
|
|
56
|
+
target: baseCompilerOptions.target,
|
|
57
|
+
transform: {
|
|
58
|
+
legacyDecorator: baseCompilerOptions.experimentalDecorators,
|
|
59
|
+
decoratorMetadata: baseCompilerOptions.emitDecoratorMetadata,
|
|
60
|
+
react: {
|
|
61
|
+
runtime: 'automatic',
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
sourceMaps: baseCompilerOptions.sourceMap,
|
|
66
|
+
module: {
|
|
67
|
+
type:
|
|
68
|
+
toLowerCase(compilerOptions.module) === 'commonjs' ||
|
|
69
|
+
toLowerCase(compilerOptions.module) === 'nodenext'
|
|
70
|
+
? 'commonjs'
|
|
71
|
+
: 'es6',
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
callbacks: {
|
|
75
|
+
onSuccess: (e: { duration: number }) => {
|
|
76
|
+
this.logCompletionResults(this.taskTimer.add(e.duration));
|
|
77
|
+
if (!this.watch) {
|
|
78
|
+
resolve();
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
onFail: (e: { duration: number; reasons: Map<string, string> }) => {
|
|
82
|
+
log.text([...e.reasons.values()][0]);
|
|
83
|
+
this.logCompletionResults(this.taskTimer.add(e.duration));
|
|
84
|
+
if (!this.watch) {
|
|
85
|
+
reject(new Error('Compilation failed'));
|
|
86
|
+
}
|
|
87
|
+
},
|
|
45
88
|
},
|
|
46
89
|
},
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
},
|
|
52
|
-
callbacks: {
|
|
53
|
-
onSuccess: (e: { duration: number }) => {
|
|
54
|
-
this.logCompletionResults(this.taskTimer.add(e.duration));
|
|
55
|
-
if (!this.watch) {
|
|
56
|
-
resolve();
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
onFail: (e: { duration: number; reasons: Map<string, string> }) => {
|
|
60
|
-
log.text([...e.reasons.values()][0]);
|
|
61
|
-
this.logCompletionResults(this.taskTimer.add(e.duration));
|
|
62
|
-
if (!this.watch) {
|
|
63
|
-
reject(new Error('Compilation failed'));
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
});
|
|
90
|
+
packageConfig,
|
|
91
|
+
{ arrayMerge: overwriteMerge, clone: false }
|
|
92
|
+
)
|
|
93
|
+
);
|
|
68
94
|
});
|
|
69
95
|
}
|
|
70
96
|
}
|
package/src/cli/tasks/task.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { log, readJsonSafe } from '../../utils';
|
|
1
|
+
import { formatDuration, log, readJsonSafe } from '../../utils';
|
|
2
2
|
|
|
3
3
|
class TaskTimer {
|
|
4
4
|
private counter = 0;
|
|
@@ -85,17 +85,10 @@ export abstract class Task {
|
|
|
85
85
|
}) {
|
|
86
86
|
const enumerator = counter === 0 ? 'Initial ' : 'Subsequent ';
|
|
87
87
|
log.info(
|
|
88
|
-
`${this.watch ? enumerator : ''}${this.name} task completed in ${
|
|
88
|
+
`${this.watch ? enumerator : ''}${this.name} task completed in ${formatDuration(measure.duration)}`
|
|
89
89
|
);
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
private formatDuration(duration: number) {
|
|
93
|
-
if (duration < 1000) {
|
|
94
|
-
return `${duration.toFixed(0)}ms`;
|
|
95
|
-
}
|
|
96
|
-
return `${(duration / 1000).toFixed(2)}s`;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
92
|
private checkRunLocation() {
|
|
100
93
|
const packageJson = readJsonSafe('package.json');
|
|
101
94
|
if (!packageJson?.workspaces && this.global) {
|
|
@@ -106,7 +99,5 @@ export abstract class Task {
|
|
|
106
99
|
}
|
|
107
100
|
}
|
|
108
101
|
|
|
109
|
-
abstract description(): string;
|
|
110
|
-
|
|
111
102
|
abstract execute(): Promise<void>;
|
|
112
103
|
}
|
|
@@ -18,10 +18,6 @@ export class TscCompilePackage extends CliTask {
|
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
description() {
|
|
22
|
-
return 'Compiles TypeScript files to JavaScript with TSC within package folder';
|
|
23
|
-
}
|
|
24
|
-
|
|
25
21
|
async execute() {
|
|
26
22
|
const tsConfig = getTsConfig();
|
|
27
23
|
await this.runChildProcess(
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getPackages,
|
|
3
|
-
getPackagesGraph,
|
|
4
|
-
getTsConfig,
|
|
5
|
-
Package,
|
|
6
|
-
PackageType,
|
|
7
|
-
splitPackagesByType,
|
|
8
|
-
} from '../../utils';
|
|
1
|
+
import { getPackages, getPackagesGraph, getTsConfig, log, Package, PackageType } from '../../utils';
|
|
9
2
|
import { CliTask } from './cli-task';
|
|
10
3
|
|
|
11
4
|
interface Args {
|
|
@@ -13,7 +6,6 @@ interface Args {
|
|
|
13
6
|
ignore?: string | string[];
|
|
14
7
|
scope?: string | string[];
|
|
15
8
|
watch?: boolean;
|
|
16
|
-
typeCheckOnly?: boolean;
|
|
17
9
|
}
|
|
18
10
|
|
|
19
11
|
export class TscCompile extends CliTask {
|
|
@@ -29,15 +21,20 @@ export class TscCompile extends CliTask {
|
|
|
29
21
|
});
|
|
30
22
|
}
|
|
31
23
|
|
|
32
|
-
description() {
|
|
33
|
-
return 'Compiles one or more TypeScript projects with optional type checking';
|
|
34
|
-
}
|
|
35
|
-
|
|
36
24
|
async execute() {
|
|
37
|
-
const packages =
|
|
38
|
-
|
|
39
|
-
|
|
25
|
+
const packages = getPackages({
|
|
26
|
+
scope: this.args.scope,
|
|
27
|
+
ignore: this.args.ignore,
|
|
28
|
+
type: [PackageType.TSC, PackageType.Webpack],
|
|
29
|
+
});
|
|
30
|
+
|
|
40
31
|
const tsConfigs = collapsePackages(packages).map(({ location }) => getTsConfig(location));
|
|
32
|
+
|
|
33
|
+
log.debug(
|
|
34
|
+
'tsc-compile',
|
|
35
|
+
`${this.args.watch ? 'watching' : 'compiling'} ${tsConfigs.join(' ')}`
|
|
36
|
+
);
|
|
37
|
+
|
|
41
38
|
await this.runChildProcess(
|
|
42
39
|
'tsc',
|
|
43
40
|
[
|
|
@@ -45,7 +42,7 @@ export class TscCompile extends CliTask {
|
|
|
45
42
|
this.watch ? '-w' : undefined,
|
|
46
43
|
'--pretty',
|
|
47
44
|
'--preserveWatchOutput',
|
|
48
|
-
|
|
45
|
+
'--emitDeclarationOnly',
|
|
49
46
|
...tsConfigs,
|
|
50
47
|
].filter(i => i !== undefined)
|
|
51
48
|
);
|
package/src/cli/types/cpx2.d.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
declare module 'cpx2' {
|
|
2
|
-
|
|
2
|
+
import { WatchOptions } from '@types/cpx';
|
|
3
|
+
|
|
4
|
+
interface Cpx2WatchOptions extends WatchOptions {
|
|
5
|
+
ignore?: string | string[];
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export { copy, copySync } from '@types/cpx';
|
|
9
|
+
export function watch(source: string, dest: string, options?: Cpx2WatchOptions): Watcher;
|
|
3
10
|
}
|
|
@@ -73,7 +73,7 @@ describe('[startup] Cli Utils', () => {
|
|
|
73
73
|
|
|
74
74
|
beforeEach(() => {
|
|
75
75
|
vol.fromJSON(packageFS());
|
|
76
|
-
options =
|
|
76
|
+
options = undefined;
|
|
77
77
|
stdoutSpy = jest.spyOn(process.stdout, 'write').mockImplementation(jest.fn());
|
|
78
78
|
compiler.run = jest.fn(callback => callback(null, stats as any));
|
|
79
79
|
// Allows config file to be loaded with require(...)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { checkArgs } from '../check-args';
|
|
2
|
+
import { log } from '../../../utils';
|
|
3
|
+
|
|
4
|
+
jest.mock('../../../utils', () => ({ log: { warning: jest.fn() } }));
|
|
5
|
+
|
|
6
|
+
describe(checkArgs.name, () => {
|
|
7
|
+
let args: Parameters<typeof checkArgs>[0];
|
|
8
|
+
let options: Parameters<typeof checkArgs>[1];
|
|
9
|
+
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
args = { foo: true };
|
|
12
|
+
options = {};
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const subject = () => checkArgs(args, options);
|
|
16
|
+
|
|
17
|
+
test('logs nothing', () => {
|
|
18
|
+
subject();
|
|
19
|
+
|
|
20
|
+
expect(log.warning).not.toHaveBeenCalled();
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
describe('when argument is obsolete', () => {
|
|
24
|
+
beforeEach(() => (options = { obsolete: ['foo'] }));
|
|
25
|
+
|
|
26
|
+
test('logs warning', () => {
|
|
27
|
+
subject();
|
|
28
|
+
|
|
29
|
+
expect(log.warning).toHaveBeenCalledWith(
|
|
30
|
+
expect.stringMatching(/WARNING: \w+ option is obsolete and is ignored/)
|
|
31
|
+
);
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { lernaExec } from '../lerna-exec';
|
|
2
|
+
import { compile } from '../compile';
|
|
3
|
+
|
|
4
|
+
jest.mock('../lerna-exec', () => ({
|
|
5
|
+
lernaExec: jest.fn(),
|
|
6
|
+
}));
|
|
7
|
+
|
|
8
|
+
describe('[startup] Cli Utils', () => {
|
|
9
|
+
const packages = ['foo', 'bar'];
|
|
10
|
+
let args: Parameters<typeof compile>[0];
|
|
11
|
+
|
|
12
|
+
beforeEach(() => {
|
|
13
|
+
jest.clearAllMocks();
|
|
14
|
+
args = { packages };
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
function itRunsSwcCompilePackage({ watch }: { watch?: boolean } = {}) {
|
|
18
|
+
expect(lernaExec).toHaveBeenCalledWith({
|
|
19
|
+
cmd: 'startup task swc-compile-package',
|
|
20
|
+
parallel: true,
|
|
21
|
+
scope: packages,
|
|
22
|
+
stream: true,
|
|
23
|
+
stdio: watch ? ['inherit', 'pipe', 'inherit'] : 'inherit',
|
|
24
|
+
...(watch ? { '--': ['--watch'] } : {}),
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
describe(`${compile.name}`, () => {
|
|
29
|
+
const subject = async () => compile(args);
|
|
30
|
+
|
|
31
|
+
test('compiles packages', async () => {
|
|
32
|
+
await subject();
|
|
33
|
+
|
|
34
|
+
itRunsSwcCompilePackage();
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
describe('with "watch"', () => {
|
|
38
|
+
beforeEach(() => (args.watch = true));
|
|
39
|
+
|
|
40
|
+
test('compiles packages in watch mode', async () => {
|
|
41
|
+
await subject();
|
|
42
|
+
|
|
43
|
+
itRunsSwcCompilePackage({ watch: true });
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
describe('with "useTsc"', () => {
|
|
48
|
+
beforeEach(() => (args.useTsc = true));
|
|
49
|
+
|
|
50
|
+
test('runs tsc-compile-package', async () => {
|
|
51
|
+
await subject();
|
|
52
|
+
|
|
53
|
+
expect(lernaExec).toHaveBeenCalledWith(
|
|
54
|
+
expect.objectContaining({ cmd: 'startup task tsc-compile-package' })
|
|
55
|
+
);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
});
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jest-environment node
|
|
3
|
+
*/
|
|
4
|
+
import cpx from 'cpx2';
|
|
5
|
+
import fs from 'fs';
|
|
6
|
+
import { getFolders, log } from '../../../utils';
|
|
7
|
+
import * as compileSassModule from '../compile-sass';
|
|
8
|
+
|
|
9
|
+
import { assetExtensions, copyFiles, styleExtensions } from '../copy-files';
|
|
10
|
+
|
|
11
|
+
jest.mock('cpx2', () => ({
|
|
12
|
+
copy: jest.fn(),
|
|
13
|
+
watch: jest.fn(),
|
|
14
|
+
}));
|
|
15
|
+
jest.mock('../../../utils', () => ({
|
|
16
|
+
...jest.requireActual('../../../utils'),
|
|
17
|
+
getFolders: jest.fn(),
|
|
18
|
+
log: { debug: jest.fn(), info: jest.fn(), error: jest.fn() },
|
|
19
|
+
}));
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Note: These tests don't use memfs because the typed-css-modules package
|
|
23
|
+
* uses node: URLs to import the fs modules, which bypasses the memfs filesystem
|
|
24
|
+
* (as of memfs ~4.6.0). Also sass requires the jest-environment be set to "node".
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
describe(`[startup] cli utils (${copyFiles.name})`, () => {
|
|
28
|
+
const source = fs.mkdtempSync('src');
|
|
29
|
+
const destination = 'dist';
|
|
30
|
+
const files = `${source}/**/*.{${[...assetExtensions, ...styleExtensions].join(',')}}`;
|
|
31
|
+
let options: Parameters<typeof copyFiles>[0];
|
|
32
|
+
|
|
33
|
+
beforeEach(() => {
|
|
34
|
+
jest.resetAllMocks();
|
|
35
|
+
jest.mocked(getFolders).mockReturnValue({ source, destination });
|
|
36
|
+
fs.readdirSync(source).forEach(file => fs.rmSync(`${source}/${file}`));
|
|
37
|
+
|
|
38
|
+
options = {};
|
|
39
|
+
|
|
40
|
+
jest.mocked(cpx.watch).mockImplementation(() => {
|
|
41
|
+
const emitter: { on?: Function } = {};
|
|
42
|
+
emitter.on = jest.fn((_event: string, _handler: Function) => emitter);
|
|
43
|
+
return emitter;
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
afterAll(() => {
|
|
48
|
+
if (fs.existsSync(source)) {
|
|
49
|
+
fs.rmSync(source, { recursive: true });
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
function mockStylesModule(module: string, id = 'foo') {
|
|
54
|
+
const content = `.${id} { display: none; }`;
|
|
55
|
+
fs.writeFileSync(`${source}/${module}`, content);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function expectTypeDefinitions(module: string, id = 'foo') {
|
|
59
|
+
expect(fs.readFileSync(`${source}/${module}.d.ts`, 'utf8')).toContain(
|
|
60
|
+
`export const ${id}: string;`
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function getHandler(event: string) {
|
|
65
|
+
const emitter = jest.mocked(cpx.watch).mock.results[0].value;
|
|
66
|
+
const { calls } = jest.mocked(emitter.on).mock;
|
|
67
|
+
return calls.find(([name]: string[]) => name === event)[1] as Function;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const subject = async () => copyFiles(options);
|
|
71
|
+
|
|
72
|
+
test('copies assets and styles from source to destination', async () => {
|
|
73
|
+
await subject();
|
|
74
|
+
|
|
75
|
+
expect(cpx.copy).toHaveBeenCalledWith(files, destination);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
describe.each(styleExtensions)('with %s module', extension => {
|
|
79
|
+
const module = `foo.module.${extension}`;
|
|
80
|
+
|
|
81
|
+
beforeEach(() => mockStylesModule(module));
|
|
82
|
+
|
|
83
|
+
test(`generates types for ${extension} module`, async () => {
|
|
84
|
+
await subject();
|
|
85
|
+
|
|
86
|
+
expectTypeDefinitions(module);
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
describe('when an error occurs generating types', () => {
|
|
91
|
+
const errorMessage = 'Oops!';
|
|
92
|
+
|
|
93
|
+
beforeEach(() => {
|
|
94
|
+
mockStylesModule('foo.module.scss');
|
|
95
|
+
jest.spyOn(compileSassModule, 'compileSass').mockImplementation(() => {
|
|
96
|
+
throw new Error(errorMessage);
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
test('logs error', async () => {
|
|
101
|
+
await subject();
|
|
102
|
+
|
|
103
|
+
expect(log.error).toHaveBeenCalledWith(expect.stringContaining(errorMessage));
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
describe('with {watch: true}', () => {
|
|
108
|
+
beforeEach(() => (options = { watch: true }));
|
|
109
|
+
|
|
110
|
+
test('watches files', async () => {
|
|
111
|
+
await subject();
|
|
112
|
+
|
|
113
|
+
expect(cpx.watch).toHaveBeenCalledWith(
|
|
114
|
+
files,
|
|
115
|
+
destination,
|
|
116
|
+
expect.objectContaining({ initialCopy: false })
|
|
117
|
+
);
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
describe('when module is changed', () => {
|
|
121
|
+
const module = 'foo.module.scss';
|
|
122
|
+
|
|
123
|
+
beforeEach(async () => {
|
|
124
|
+
mockStylesModule(module);
|
|
125
|
+
await subject();
|
|
126
|
+
await getHandler('copy')({ srcPath: `${source}/${module}` });
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
test('generates types', () => {
|
|
130
|
+
expectTypeDefinitions(module);
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
describe('when an error occurs watching files', () => {
|
|
135
|
+
const errorMessage = 'Nope!';
|
|
136
|
+
|
|
137
|
+
beforeEach(async () => {
|
|
138
|
+
await subject();
|
|
139
|
+
await getHandler('watch-error')(new Error(errorMessage));
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
test('logs error', () => {
|
|
143
|
+
expect(log.error).toHaveBeenCalledWith(expect.stringContaining(errorMessage));
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
describe('when source location does not exist', () => {
|
|
149
|
+
beforeEach(() => fs.rmSync(source, { recursive: true }));
|
|
150
|
+
|
|
151
|
+
test('does not copy files', async () => {
|
|
152
|
+
await subject();
|
|
153
|
+
|
|
154
|
+
expect(cpx.copy).not.toHaveBeenCalledWith();
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
});
|
|
@@ -47,5 +47,24 @@ describe('[startup] Cli Utils', () => {
|
|
|
47
47
|
expect(subject()).toBe(module);
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
|
+
|
|
51
|
+
describe('when config extends relative path', () => {
|
|
52
|
+
const module = 'baz';
|
|
53
|
+
|
|
54
|
+
beforeEach(() => {
|
|
55
|
+
vol.fromJSON({
|
|
56
|
+
'base.json': JSON.stringify({
|
|
57
|
+
compilerOptions: { module },
|
|
58
|
+
}),
|
|
59
|
+
'foo/tsconfig.json': JSON.stringify({
|
|
60
|
+
extends: '../base.json',
|
|
61
|
+
}),
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
test("returns extended config's module", () => {
|
|
66
|
+
expect(subject('foo/tsconfig.json')).toBe(module);
|
|
67
|
+
});
|
|
68
|
+
});
|
|
50
69
|
});
|
|
51
70
|
});
|
|
@@ -5,6 +5,13 @@ import { lernaExec } from '../lerna-exec';
|
|
|
5
5
|
|
|
6
6
|
jest.mock('execa');
|
|
7
7
|
|
|
8
|
+
const AVAILABLE_PARALLELISM = 2;
|
|
9
|
+
|
|
10
|
+
jest.mock('node:os', () => ({
|
|
11
|
+
...jest.requireActual('node:os'),
|
|
12
|
+
availableParallelism: () => AVAILABLE_PARALLELISM,
|
|
13
|
+
}));
|
|
14
|
+
|
|
8
15
|
describe(`${lernaExec.name}`, () => {
|
|
9
16
|
let args: Parameters<typeof lernaExec>[0];
|
|
10
17
|
|
|
@@ -12,34 +19,60 @@ describe(`${lernaExec.name}`, () => {
|
|
|
12
19
|
jest.clearAllMocks();
|
|
13
20
|
jest.spyOn(log, 'info').mockImplementation(jest.fn()); // suppress log output
|
|
14
21
|
args = { cmd: 'foo' };
|
|
22
|
+
delete process.env.CI;
|
|
15
23
|
});
|
|
16
24
|
|
|
17
25
|
const subject = () => lernaExec(args);
|
|
18
26
|
|
|
19
27
|
function expectExecaCalledWith(commandLine: string) {
|
|
20
28
|
const [cmd, ...args] = commandLine.split(' ');
|
|
21
|
-
expect(execa).toHaveBeenCalledWith(cmd, args, {
|
|
29
|
+
expect(execa).toHaveBeenCalledWith(cmd, args, {
|
|
30
|
+
stdio: 'inherit',
|
|
31
|
+
env: {
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
33
|
+
FORCE_COLOR: 'true',
|
|
34
|
+
},
|
|
35
|
+
});
|
|
22
36
|
}
|
|
23
37
|
|
|
24
|
-
|
|
25
|
-
|
|
38
|
+
function itRunsLernaExec(option?: string) {
|
|
39
|
+
const optionString = option ? ` ${option}` : '';
|
|
40
|
+
test(`runs "lerna exec${optionString} -- {cmd}"`, () => {
|
|
41
|
+
subject();
|
|
26
42
|
|
|
27
|
-
|
|
28
|
-
|
|
43
|
+
expectExecaCalledWith(`lerna exec${optionString} -- ${args.cmd}`);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
itRunsLernaExec();
|
|
29
48
|
|
|
30
49
|
describe.each([
|
|
31
50
|
{ arg: { parallel: true }, option: '--parallel' },
|
|
32
51
|
{ arg: { stream: true }, option: '--stream' },
|
|
33
52
|
{ arg: { bail: false }, option: '--no-bail' },
|
|
34
|
-
{ arg: {
|
|
35
|
-
{ arg: {
|
|
53
|
+
{ arg: { parallel: 1 }, option: '--concurrency=1' },
|
|
54
|
+
{ arg: { parallel: 0 }, option: '--concurrency=0' },
|
|
36
55
|
] as { arg: Partial<typeof args>; option: string }[])('with $arg', ({ arg, option }) => {
|
|
37
|
-
beforeEach(() =>
|
|
56
|
+
beforeEach(() => {
|
|
57
|
+
Object.assign(args, arg);
|
|
58
|
+
});
|
|
38
59
|
|
|
39
|
-
|
|
40
|
-
|
|
60
|
+
itRunsLernaExec(option);
|
|
61
|
+
});
|
|
41
62
|
|
|
42
|
-
|
|
63
|
+
describe('when process.env.CI=true', () => {
|
|
64
|
+
beforeEach(() => {
|
|
65
|
+
process.env.CI = 'true';
|
|
66
|
+
});
|
|
67
|
+
describe.each([
|
|
68
|
+
{ arg: { parallel: true }, option: `--concurrency=${AVAILABLE_PARALLELISM}` },
|
|
69
|
+
{ arg: { parallel: 10 }, option: '--concurrency=10' },
|
|
70
|
+
] as { arg: Partial<typeof args>; option: string }[])('with $arg', ({ arg, option }) => {
|
|
71
|
+
beforeEach(() => {
|
|
72
|
+
Object.assign(args, arg);
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
itRunsLernaExec(option);
|
|
43
76
|
});
|
|
44
77
|
});
|
|
45
78
|
|
|
@@ -63,4 +96,18 @@ describe(`${lernaExec.name}`, () => {
|
|
|
63
96
|
expectExecaCalledWith(`lerna exec -- ${args.cmd} ${args['--']!.join(' ')}`);
|
|
64
97
|
});
|
|
65
98
|
});
|
|
99
|
+
|
|
100
|
+
describe('with "stdio"', () => {
|
|
101
|
+
beforeEach(() => (args.stdio = 'ignore'));
|
|
102
|
+
|
|
103
|
+
test('runs execa with stdio option', () => {
|
|
104
|
+
subject();
|
|
105
|
+
|
|
106
|
+
expect(execa).toHaveBeenCalledWith(
|
|
107
|
+
'lerna',
|
|
108
|
+
expect.any(Array),
|
|
109
|
+
expect.objectContaining({ stdio: args.stdio })
|
|
110
|
+
);
|
|
111
|
+
});
|
|
112
|
+
});
|
|
66
113
|
});
|