@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
package/src/cli/utils/bundle.ts
CHANGED
|
@@ -13,8 +13,6 @@ interface Options {
|
|
|
13
13
|
buildStat?: boolean;
|
|
14
14
|
codeCoverage?: boolean;
|
|
15
15
|
config?: string;
|
|
16
|
-
esbuild?: boolean;
|
|
17
|
-
experimentalBundlers?: boolean;
|
|
18
16
|
}
|
|
19
17
|
|
|
20
18
|
function getName() {
|
|
@@ -36,9 +34,8 @@ export async function bundle(options: Options = {}) {
|
|
|
36
34
|
const mode = 'production';
|
|
37
35
|
const fallback = `./${webpackProdConfigFileName}`;
|
|
38
36
|
const config = readWebpackConfig({ ...options, fallback });
|
|
39
|
-
const { buildStat, codeCoverage
|
|
40
|
-
|
|
41
|
-
const webpackOptions = { name, buildStat, codeCoverage, esbuild, experimentalBundlers };
|
|
37
|
+
const { buildStat, codeCoverage } = options;
|
|
38
|
+
const webpackOptions = { name, buildStat, codeCoverage };
|
|
42
39
|
|
|
43
40
|
if (isWebComponent()) {
|
|
44
41
|
const webpackConfig: Overrides = {
|
|
@@ -61,8 +58,7 @@ export async function bundleWatch(options: Options = {}) {
|
|
|
61
58
|
const name = getName();
|
|
62
59
|
const mode = 'development';
|
|
63
60
|
const config = readWebpackConfig({ ...options, fallback: `./${webpackDevConfigFileName}` });
|
|
64
|
-
const { codeCoverage
|
|
65
|
-
const configOverrides = { codeCoverage, esbuild, experimentalBundlers, name };
|
|
61
|
+
const configOverrides = { codeCoverage: options.codeCoverage, name };
|
|
66
62
|
|
|
67
63
|
if (isWebComponent()) {
|
|
68
64
|
const webpackConfig: Overrides = {
|
|
@@ -71,12 +67,7 @@ export async function bundleWatch(options: Options = {}) {
|
|
|
71
67
|
};
|
|
72
68
|
|
|
73
69
|
return Promise.all([
|
|
74
|
-
runWatch(
|
|
75
|
-
createWebpackConfig(webpackConfig, {
|
|
76
|
-
embed: true,
|
|
77
|
-
...configOverrides,
|
|
78
|
-
})
|
|
79
|
-
),
|
|
70
|
+
runWatch(createWebpackConfig(webpackConfig, { embed: true, ...configOverrides })),
|
|
80
71
|
isDevServerDisabled()
|
|
81
72
|
? runWatch(createWebpackConfig(webpackConfig, configOverrides))
|
|
82
73
|
: runServe(createWebpackConfig(webpackConfig, configOverrides)),
|
|
@@ -86,11 +77,7 @@ export async function bundleWatch(options: Options = {}) {
|
|
|
86
77
|
const webpackConfig =
|
|
87
78
|
config ?? createWebpackConfig({ configuration: { mode } }, configOverrides);
|
|
88
79
|
|
|
89
|
-
|
|
90
|
-
return runWatch(webpackConfig);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
return runServe(webpackConfig);
|
|
80
|
+
return isDevServerDisabled() ? runWatch(webpackConfig) : runServe(webpackConfig);
|
|
94
81
|
}
|
|
95
82
|
|
|
96
83
|
function readWebpackConfig({ config, fallback }: Options & { fallback: string }) {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { log } from '../../utils';
|
|
2
|
+
|
|
3
|
+
interface Options {
|
|
4
|
+
obsolete?: string[];
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function checkArgs(args: Record<string, any>, { obsolete }: Options) {
|
|
8
|
+
obsolete?.forEach(arg => {
|
|
9
|
+
if (args[arg.replace(/^--/, '')]) {
|
|
10
|
+
log.warning(`WARNING: ${arg} option is obsolete and is ignored`);
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { log } from '../../utils';
|
|
2
|
+
import { lernaExec } from './lerna-exec';
|
|
3
|
+
|
|
4
|
+
export function compile({
|
|
5
|
+
packages,
|
|
6
|
+
watch = false,
|
|
7
|
+
useTsc = false,
|
|
8
|
+
}: {
|
|
9
|
+
packages: string[];
|
|
10
|
+
watch?: boolean;
|
|
11
|
+
useTsc?: boolean;
|
|
12
|
+
}) {
|
|
13
|
+
log.info('Compiling TypeScript files...');
|
|
14
|
+
return lernaExec({
|
|
15
|
+
cmd: useTsc ? 'startup task tsc-compile-package' : 'startup task swc-compile-package',
|
|
16
|
+
parallel: true,
|
|
17
|
+
scope: packages,
|
|
18
|
+
stream: true,
|
|
19
|
+
stdio: watch ? ['inherit', 'pipe', 'inherit'] : 'inherit',
|
|
20
|
+
...(watch ? { '--': ['--watch'] } : {}),
|
|
21
|
+
});
|
|
22
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import cpx from 'cpx2';
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import { glob } from 'glob';
|
|
4
|
+
import DtsCreator from 'typed-css-modules';
|
|
5
|
+
|
|
6
|
+
import { getFolders, log } from '../../utils';
|
|
7
|
+
import { compileLess } from './compile-less';
|
|
8
|
+
import { compileSass } from './compile-sass';
|
|
9
|
+
|
|
10
|
+
export const assetExtensions = ['eot', 'gif', 'jpg', 'otf', 'png', 'svg', 'ttf', 'woff', 'woff2'];
|
|
11
|
+
export const styleExtensions = ['css', 'less', 'scss'];
|
|
12
|
+
|
|
13
|
+
const styleModuleRegex = new RegExp(`\\.module\\.(${styleExtensions.join('|')})$`);
|
|
14
|
+
|
|
15
|
+
interface CopyFilesOptions {
|
|
16
|
+
watch?: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export async function copyFiles({ watch }: CopyFilesOptions) {
|
|
20
|
+
const { source, destination } = getFolders();
|
|
21
|
+
if (!fs.existsSync(source)) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const filesPattern = `${source}/**/*.{${[...assetExtensions, ...styleExtensions].join()}}`;
|
|
26
|
+
const creator = new DtsCreator({ camelCase: true, namedExports: true });
|
|
27
|
+
const generateDefinitions = async (file: string) => {
|
|
28
|
+
try {
|
|
29
|
+
const css = await compile(file);
|
|
30
|
+
const content = await creator.create(file, css, !!watch);
|
|
31
|
+
await content.writeFile();
|
|
32
|
+
} catch (error) {
|
|
33
|
+
log.error(String(error));
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
if (!watch) {
|
|
38
|
+
log.info(`Copying ${filesPattern} -> ${destination}`);
|
|
39
|
+
cpx.copy(filesPattern, destination);
|
|
40
|
+
|
|
41
|
+
const modulesPattern = `${source}/**/*.module.{${styleExtensions.join()}}`;
|
|
42
|
+
log.info(`Generating types for ${modulesPattern}`);
|
|
43
|
+
const modules = await glob(modulesPattern);
|
|
44
|
+
await Promise.all(modules.map(generateDefinitions));
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
log.info(`Watching ${filesPattern} -> ${destination}`);
|
|
49
|
+
cpx.watch(filesPattern, destination, {
|
|
50
|
+
initialCopy: false,
|
|
51
|
+
// Optimization so cpx2 doesn't waste resources watching irrelevant files
|
|
52
|
+
ignore: ['__tests__', '__mocks__', '**/*.ts', '**/*.tsx'],
|
|
53
|
+
})
|
|
54
|
+
.on('copy', async ({ srcPath, dstPath }: { srcPath: string; dstPath: string }) => {
|
|
55
|
+
log.info(`Copied ${srcPath} -> ${dstPath}`);
|
|
56
|
+
if (styleModuleRegex.test(srcPath)) {
|
|
57
|
+
log.info(`Generating types for ${srcPath}`);
|
|
58
|
+
await generateDefinitions(srcPath);
|
|
59
|
+
}
|
|
60
|
+
})
|
|
61
|
+
.on('watch-error', (error: unknown) => log.error(String(error)));
|
|
62
|
+
|
|
63
|
+
/* istanbul ignore next: not executed in test environment */
|
|
64
|
+
if (process.env.NODE_ENV !== 'test') {
|
|
65
|
+
await new Promise<void>(() => {});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async function compile(filePath: string) {
|
|
70
|
+
if (filePath.endsWith('.less')) {
|
|
71
|
+
return compileLess(filePath);
|
|
72
|
+
}
|
|
73
|
+
if (filePath.endsWith('.scss')) {
|
|
74
|
+
return compileSass(filePath);
|
|
75
|
+
}
|
|
76
|
+
}
|
package/src/cli/utils/eslint.ts
CHANGED
|
@@ -3,7 +3,7 @@ import path from 'path';
|
|
|
3
3
|
import { readJson } from '../../utils';
|
|
4
4
|
|
|
5
5
|
export function getModuleType(configPath: string): string {
|
|
6
|
-
const config = readJson(configPath);
|
|
6
|
+
const config = readJson<{ compilerOptions?: { module: string }; extends?: string }>(configPath);
|
|
7
7
|
|
|
8
8
|
if (config.compilerOptions?.module) {
|
|
9
9
|
return config.compilerOptions.module.toLowerCase();
|
|
@@ -11,11 +11,9 @@ export function getModuleType(configPath: string): string {
|
|
|
11
11
|
|
|
12
12
|
if (config.extends) {
|
|
13
13
|
return getModuleType(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
: config.extends
|
|
18
|
-
)
|
|
14
|
+
/^\.?\.\//.test(config.extends)
|
|
15
|
+
? path.join(path.dirname(configPath), config.extends)
|
|
16
|
+
: require.resolve(config.extends)
|
|
19
17
|
);
|
|
20
18
|
}
|
|
21
19
|
|
package/src/cli/utils/index.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
export const assetExtensions = ['eot', 'gif', 'jpg', 'otf', 'png', 'svg', 'ttf', 'woff', 'woff2'];
|
|
2
|
-
export const styleExtensions = ['css', 'less', 'scss'];
|
|
3
|
-
|
|
4
|
-
export * from './assets-copy';
|
|
5
1
|
export * from './bundle';
|
|
2
|
+
export * from './check-args';
|
|
3
|
+
export * from './compile';
|
|
6
4
|
export * from './compile-less';
|
|
7
5
|
export * from './compile-sass';
|
|
6
|
+
export * from './copy-files';
|
|
8
7
|
export * from './eslint';
|
|
9
8
|
export * from './get-module-type';
|
|
10
9
|
export * from './is-module-installed';
|
|
11
10
|
export * from './lerna-exec';
|
|
11
|
+
export * from './pipe-stdout';
|
|
12
|
+
export * from './process-tree';
|
|
12
13
|
export * from './set-node-options';
|
|
13
|
-
export * from './styles-copy';
|
|
14
14
|
export * from './tcm';
|
|
15
|
-
export * from './
|
|
15
|
+
export * from './type-check';
|
|
16
|
+
export * from './watch-stdout';
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import execa from 'execa';
|
|
1
|
+
import execa, { StdioOption } from 'execa';
|
|
2
|
+
import os from 'node:os';
|
|
3
|
+
|
|
2
4
|
import { log } from '../../utils';
|
|
3
5
|
|
|
4
6
|
interface Args {
|
|
5
7
|
'bail'?: boolean;
|
|
6
8
|
'cmd': string;
|
|
7
|
-
'concurrency'?: number;
|
|
8
9
|
'scope'?: string[];
|
|
9
10
|
'stream'?: boolean;
|
|
10
|
-
'parallel'?: boolean;
|
|
11
|
+
'parallel'?: boolean | number;
|
|
11
12
|
'--'?: string[];
|
|
13
|
+
'stdio'?: 'pipe' | 'ignore' | 'inherit' | readonly StdioOption[];
|
|
12
14
|
}
|
|
13
15
|
|
|
14
|
-
export
|
|
16
|
+
export function lernaExec(args: Args) {
|
|
15
17
|
const lernaArguments = [
|
|
16
18
|
'exec',
|
|
17
19
|
...getOptions(args),
|
|
@@ -20,7 +22,13 @@ export async function lernaExec(args: Args) {
|
|
|
20
22
|
...(args['--'] ?? []).flatMap(arg => arg.split(' ')),
|
|
21
23
|
];
|
|
22
24
|
log.info(`Running ${[args.cmd, ...(args['--'] ?? [])].join(' ')}`);
|
|
23
|
-
|
|
25
|
+
return execa('lerna', lernaArguments, {
|
|
26
|
+
stdio: args.stdio ?? 'inherit',
|
|
27
|
+
env: {
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
29
|
+
FORCE_COLOR: 'true',
|
|
30
|
+
},
|
|
31
|
+
});
|
|
24
32
|
}
|
|
25
33
|
|
|
26
34
|
function getOptions(args: Args) {
|
|
@@ -28,14 +36,13 @@ function getOptions(args: Args) {
|
|
|
28
36
|
if (args.bail === false) {
|
|
29
37
|
result.push('--no-bail');
|
|
30
38
|
}
|
|
31
|
-
if (args.parallel) {
|
|
32
|
-
result.push('--parallel');
|
|
39
|
+
if (args.parallel === true) {
|
|
40
|
+
result.push(process.env.CI ? `--concurrency=${os.availableParallelism()}` : '--parallel');
|
|
41
|
+
} else if (typeof args.parallel === 'number') {
|
|
42
|
+
result.push(`--concurrency=${args.parallel}`);
|
|
33
43
|
}
|
|
34
44
|
if (args.stream) {
|
|
35
45
|
result.push('--stream');
|
|
36
46
|
}
|
|
37
|
-
if (typeof args.concurrency === 'number') {
|
|
38
|
-
result.push(`--concurrency=${args.concurrency}`);
|
|
39
|
-
}
|
|
40
47
|
return result;
|
|
41
48
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import execa from 'execa';
|
|
2
|
+
|
|
3
|
+
export function pipeStdout(proc: execa.ExecaChildProcess) {
|
|
4
|
+
function stdoutHandler(data: Uint8Array | string) {
|
|
5
|
+
process.stdout.write(data);
|
|
6
|
+
}
|
|
7
|
+
proc.stdout!.on('data', stdoutHandler);
|
|
8
|
+
|
|
9
|
+
return () => proc.stdout!.off('data', stdoutHandler);
|
|
10
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
interface HandlerResultObject {
|
|
2
|
+
process: Promise<unknown>;
|
|
3
|
+
onComplete?: Promise<unknown>;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export type HandlerResult = HandlerResultObject | Promise<unknown>;
|
|
7
|
+
|
|
8
|
+
function isHandlerResultObject(result: HandlerResult): result is HandlerResultObject {
|
|
9
|
+
return 'process' in result;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export class ProcessTree<T extends Record<any, any> = never> {
|
|
13
|
+
readonly #entries: Map<
|
|
14
|
+
T,
|
|
15
|
+
{
|
|
16
|
+
handler: () => HandlerResult;
|
|
17
|
+
dependsOn: T[keyof T][];
|
|
18
|
+
process?: Promise<unknown>;
|
|
19
|
+
onComplete?: Promise<unknown>;
|
|
20
|
+
}
|
|
21
|
+
> = new Map();
|
|
22
|
+
|
|
23
|
+
add(
|
|
24
|
+
name: T[keyof T],
|
|
25
|
+
handler: () => HandlerResult,
|
|
26
|
+
{
|
|
27
|
+
dependsOn = [],
|
|
28
|
+
}: {
|
|
29
|
+
dependsOn?: T[keyof T][];
|
|
30
|
+
} = {}
|
|
31
|
+
) {
|
|
32
|
+
dependsOn.forEach(item => {
|
|
33
|
+
if (!this.#entries.has(item)) {
|
|
34
|
+
throw new Error(`Unknown process dependency: ${item}`);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
this.#entries.set(name, { handler, dependsOn });
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
run() {
|
|
41
|
+
[...this.#entries.keys()].forEach(item => {
|
|
42
|
+
const entry = this.#entries.get(item)!;
|
|
43
|
+
|
|
44
|
+
const handlerResult = Promise.all(
|
|
45
|
+
entry.dependsOn.map(item => this.#entries.get(item)!.onComplete)
|
|
46
|
+
).then(() => ({ result: entry.handler() }));
|
|
47
|
+
|
|
48
|
+
entry.process = handlerResult.then(({ result }) =>
|
|
49
|
+
isHandlerResultObject(result) ? result.process : result
|
|
50
|
+
);
|
|
51
|
+
entry.onComplete = handlerResult.then(({ result }) =>
|
|
52
|
+
isHandlerResultObject(result) ? (result.onComplete ?? result.process) : result
|
|
53
|
+
);
|
|
54
|
+
});
|
|
55
|
+
return Promise.all([...this.#entries.values()].map(item => item.process));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import os from 'os';
|
|
2
2
|
import { CommandName, NodeConfiguration, getConfigurationSafe } from '../../utils';
|
|
3
|
+
import { Command } from '../commands';
|
|
3
4
|
|
|
4
5
|
const MAX_OLD_SPACE_SIZE_OPTION = 'max_old_space_size';
|
|
5
6
|
const DEFAULT_MAX_OLD_SPACE_SIZE_MB = 8192;
|
|
@@ -10,21 +11,21 @@ const MIN_REMAINING_MEMORY_MB = 512;
|
|
|
10
11
|
* @param command - the command being executed
|
|
11
12
|
* @returns whether process's NODE_OPTIONS were changed
|
|
12
13
|
*/
|
|
13
|
-
export function setNodeOptions(command:
|
|
14
|
+
export function setNodeOptions(commandName: CommandName, command: Command) {
|
|
14
15
|
const cliConfig = getConfigurationSafe();
|
|
15
|
-
const cmdConfig: NodeConfiguration = cliConfig[
|
|
16
|
+
const cmdConfig: NodeConfiguration = cliConfig[commandName];
|
|
16
17
|
|
|
17
|
-
const
|
|
18
|
-
const
|
|
18
|
+
const cliNodeOptions = cliConfig.NODE_OPTIONS ?? [];
|
|
19
|
+
const cmdNodeOptions = cmdConfig?.NODE_OPTIONS ?? [];
|
|
19
20
|
const oldNodeOptions = process.env.NODE_OPTIONS ?? '';
|
|
20
21
|
|
|
21
|
-
const mergedOptions = [cmdNodeOptions, cliNodeOptions]
|
|
22
|
-
.reduce((result,
|
|
23
|
-
return result.includes(
|
|
22
|
+
const mergedOptions = [...cmdNodeOptions, ...cliNodeOptions]
|
|
23
|
+
.reduce((result, option) => {
|
|
24
|
+
return result.includes(option) ? result : `${result} ${option}`;
|
|
24
25
|
}, oldNodeOptions)
|
|
25
26
|
.trim();
|
|
26
27
|
|
|
27
|
-
const newNodeOptions = ensureMaxOldSpaceSize(mergedOptions);
|
|
28
|
+
const newNodeOptions = ensureMaxOldSpaceSize(mergedOptions, command.greedy);
|
|
28
29
|
if (newNodeOptions !== oldNodeOptions) {
|
|
29
30
|
process.env.NODE_OPTIONS = newNodeOptions;
|
|
30
31
|
return true;
|
|
@@ -33,10 +34,12 @@ export function setNodeOptions(command: CommandName) {
|
|
|
33
34
|
return false;
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
function ensureMaxOldSpaceSize(nodeOptions: string) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
function ensureMaxOldSpaceSize(nodeOptions: string, greedy?: boolean) {
|
|
38
|
+
if (!greedy || nodeOptions.includes(MAX_OLD_SPACE_SIZE_OPTION)) {
|
|
39
|
+
return nodeOptions;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return `--${MAX_OLD_SPACE_SIZE_OPTION}=${getMaxOldSpaceSize()} ${nodeOptions}`.trim();
|
|
40
43
|
}
|
|
41
44
|
|
|
42
45
|
function getMaxOldSpaceSize() {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const styleExtensions = ['css', 'less', 'scss'];
|
package/src/cli/utils/tcm.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { glob } from 'glob';
|
|
2
2
|
import chokidar from 'chokidar';
|
|
3
|
-
|
|
4
3
|
import DtsCreator from 'typed-css-modules';
|
|
5
4
|
|
|
6
5
|
import { getFolders, log } from '../../utils';
|
|
7
|
-
import { compileLess
|
|
6
|
+
import { compileLess } from './compile-less';
|
|
7
|
+
import { compileSass } from './compile-sass';
|
|
8
|
+
import { styleExtensions } from './style-extensions';
|
|
8
9
|
|
|
9
10
|
interface RunOptions {
|
|
10
11
|
watch?: boolean;
|
|
@@ -19,19 +20,15 @@ async function compile(filePath: string) {
|
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
async function
|
|
23
|
+
export async function tcm({ watch }: RunOptions = {}) {
|
|
23
24
|
const source = getFolders().source.replace(/\\/g, '/');
|
|
24
25
|
const filesPattern = `${source}/**/*.module.{${styleExtensions.join()}}`;
|
|
26
|
+
const creator = new DtsCreator({ camelCase: true, namedExports: true });
|
|
25
27
|
|
|
26
|
-
const
|
|
27
|
-
camelCase: true,
|
|
28
|
-
namedExports: true,
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
const writeFile = async (filePath: string) => {
|
|
28
|
+
const generateDefinitions = async (file: string) => {
|
|
32
29
|
try {
|
|
33
|
-
const
|
|
34
|
-
const content = await creator.create(
|
|
30
|
+
const css = await compile(file);
|
|
31
|
+
const content = await creator.create(file, css, !!watch);
|
|
35
32
|
await content.writeFile();
|
|
36
33
|
} catch (error) {
|
|
37
34
|
log.error(String(error));
|
|
@@ -39,25 +36,18 @@ async function run({ watch }: RunOptions = {}) {
|
|
|
39
36
|
};
|
|
40
37
|
|
|
41
38
|
if (!watch) {
|
|
39
|
+
log.info(`Generating types for ${filesPattern}`);
|
|
42
40
|
const files = await glob(filesPattern);
|
|
43
|
-
await Promise.all(files.map(
|
|
41
|
+
await Promise.all(files.map(generateDefinitions));
|
|
44
42
|
return;
|
|
45
43
|
}
|
|
46
44
|
|
|
47
|
-
log.info(
|
|
45
|
+
log.info(`Watching to generate types for ${filesPattern}`);
|
|
48
46
|
|
|
49
|
-
|
|
50
|
-
const watcher = chokidar.watch(source, {
|
|
51
|
-
ignored: (path, stats) => !!stats?.isFile() && !stylesRegex.test(path),
|
|
52
|
-
ignoreInitial: true,
|
|
53
|
-
});
|
|
54
|
-
const callback = async (path: string) => {
|
|
47
|
+
watchFiles(source, async (path: string) => {
|
|
55
48
|
log.debug('tcm', `Compiling ${path}`);
|
|
56
|
-
await
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
watcher.on('add', callback);
|
|
60
|
-
watcher.on('change', callback);
|
|
49
|
+
await generateDefinitions(path);
|
|
50
|
+
});
|
|
61
51
|
|
|
62
52
|
/* istanbul ignore next: not executed in test environment */
|
|
63
53
|
if (process.env.NODE_ENV !== 'test') {
|
|
@@ -65,12 +55,12 @@ async function run({ watch }: RunOptions = {}) {
|
|
|
65
55
|
}
|
|
66
56
|
}
|
|
67
57
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
58
|
+
function watchFiles(source: string, callback: (path: string) => Promise<void>) {
|
|
59
|
+
const stylesRegex = new RegExp(`\\.module\\.(${styleExtensions.join('|')})$`);
|
|
60
|
+
const watcher = chokidar.watch(source, {
|
|
61
|
+
ignored: (path, stats) => !!stats?.isFile() && !stylesRegex.test(path),
|
|
62
|
+
ignoreInitial: true,
|
|
63
|
+
});
|
|
64
|
+
watcher.on('add', callback);
|
|
65
|
+
watcher.on('change', callback);
|
|
76
66
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import execa from 'execa';
|
|
2
|
+
import { log } from '../../utils';
|
|
3
|
+
|
|
4
|
+
export function typeCheck({
|
|
5
|
+
packages,
|
|
6
|
+
watch = false,
|
|
7
|
+
}: {
|
|
8
|
+
packages: string[];
|
|
9
|
+
watch?: boolean;
|
|
10
|
+
useTsc?: boolean;
|
|
11
|
+
}) {
|
|
12
|
+
log.info('Type checking TypeScript files...');
|
|
13
|
+
const tscCompileOptions = packages.map(name => `--scope=${name}`);
|
|
14
|
+
return execa(
|
|
15
|
+
'startup',
|
|
16
|
+
['task', 'tsc-compile', ...tscCompileOptions, ...(watch ? ['--watch'] : [])],
|
|
17
|
+
{ stdio: 'inherit' }
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import execa from 'execa';
|
|
2
|
+
|
|
3
|
+
export function watchStdout(
|
|
4
|
+
proc: execa.ExecaChildProcess,
|
|
5
|
+
indicator: string | undefined,
|
|
6
|
+
handler: (count: number) => void
|
|
7
|
+
) {
|
|
8
|
+
if (!indicator) {
|
|
9
|
+
return () => {};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function stdoutHandler(data: Uint8Array | string) {
|
|
13
|
+
const dataStr = data.toString();
|
|
14
|
+
const match = dataStr.match(new RegExp(indicator!, 'gm'));
|
|
15
|
+
|
|
16
|
+
if (match !== null) {
|
|
17
|
+
handler(match.length);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
proc.stdout!.on('data', stdoutHandler);
|
|
22
|
+
|
|
23
|
+
return () => proc.stdout!.off('data', stdoutHandler);
|
|
24
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { formatDuration } from '../format-duration';
|
|
2
|
+
|
|
3
|
+
describe('[startup] Utils', () => {
|
|
4
|
+
describe(formatDuration.name, () => {
|
|
5
|
+
const SECOND = 1000;
|
|
6
|
+
const MINUTE = 60 * SECOND;
|
|
7
|
+
|
|
8
|
+
test.each([
|
|
9
|
+
[0, '0ms'],
|
|
10
|
+
[SECOND - 1, '999ms'],
|
|
11
|
+
[SECOND, '1.00s'],
|
|
12
|
+
[SECOND + SECOND / 10, '1.10s'],
|
|
13
|
+
[MINUTE - SECOND, '59.00s'],
|
|
14
|
+
[MINUTE, '1m 0s'],
|
|
15
|
+
[MINUTE + SECOND - 1, '1m 1s'],
|
|
16
|
+
[5 * MINUTE + 20 * SECOND + SECOND / 2 - 1, '5m 20s'],
|
|
17
|
+
[60 * MINUTE, '60m 0s'],
|
|
18
|
+
])('%p -> %p', (duration, expected) => {
|
|
19
|
+
expect(formatDuration(duration)).toBe(expected);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
getConfigurationSafe,
|
|
7
7
|
getESLintConfiguration,
|
|
8
8
|
getJestConfiguration,
|
|
9
|
+
getReviewConfiguration,
|
|
9
10
|
getStylelintConfiguration,
|
|
10
11
|
getWebComponentBranchConfigs,
|
|
11
12
|
getWebComponentConfiguration,
|
|
@@ -18,6 +19,7 @@ import {
|
|
|
18
19
|
isStyleCheckDisabled,
|
|
19
20
|
isWebComponent,
|
|
20
21
|
} from '../get-configuration';
|
|
22
|
+
import { log } from '../log';
|
|
21
23
|
|
|
22
24
|
jest.mock('fs', () => fs);
|
|
23
25
|
|
|
@@ -170,6 +172,22 @@ describe('[startup] Utils', () => {
|
|
|
170
172
|
});
|
|
171
173
|
});
|
|
172
174
|
|
|
175
|
+
describe(`${getReviewConfiguration.name}`, () => {
|
|
176
|
+
const subject = () => getReviewConfiguration();
|
|
177
|
+
|
|
178
|
+
itReturns(subject, {});
|
|
179
|
+
|
|
180
|
+
describe('with "cli.review"', () => {
|
|
181
|
+
const content = { cli: { review: { rules: { foo: 'off' } } } };
|
|
182
|
+
|
|
183
|
+
beforeEach(() => mockPackageJson(content));
|
|
184
|
+
|
|
185
|
+
test('return "cli.review"', () => {
|
|
186
|
+
expect(subject()).toEqual(content.cli.review);
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
});
|
|
190
|
+
|
|
173
191
|
describe(`${getStylelintConfiguration.name}`, () => {
|
|
174
192
|
const subject = () => getStylelintConfiguration();
|
|
175
193
|
|
|
@@ -246,8 +264,26 @@ describe('[startup] Utils', () => {
|
|
|
246
264
|
});
|
|
247
265
|
});
|
|
248
266
|
|
|
249
|
-
|
|
250
|
-
|
|
267
|
+
function itReturnsConfigFromPath() {
|
|
268
|
+
test('returns config from path', () => {
|
|
269
|
+
expect(subject()).toEqual(configJSON);
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
itReturnsConfigFromPath();
|
|
274
|
+
|
|
275
|
+
describe('when path does not exist', () => {
|
|
276
|
+
beforeEach(() => fs.rmSync(configPath));
|
|
277
|
+
|
|
278
|
+
test('logs warning and returns undefined', () => {
|
|
279
|
+
const logSpy = jest.spyOn(log, 'warning');
|
|
280
|
+
|
|
281
|
+
expect(subject()).toBeUndefined();
|
|
282
|
+
|
|
283
|
+
expect(logSpy).toHaveBeenCalledWith(
|
|
284
|
+
`could not find web-component configuration: "${configPath}"`
|
|
285
|
+
);
|
|
286
|
+
});
|
|
251
287
|
});
|
|
252
288
|
|
|
253
289
|
describe('with a location', () => {
|
|
@@ -271,6 +307,12 @@ describe('[startup] Utils', () => {
|
|
|
271
307
|
expect(subject()).toEqual(locationConfigJSON);
|
|
272
308
|
});
|
|
273
309
|
});
|
|
310
|
+
|
|
311
|
+
describe('with path inside config object', () => {
|
|
312
|
+
beforeEach(() => (locationOrJson = { cli }));
|
|
313
|
+
|
|
314
|
+
itReturnsConfigFromPath();
|
|
315
|
+
});
|
|
274
316
|
});
|
|
275
317
|
});
|
|
276
318
|
|