@servicetitan/startup 30.3.1 → 31.1.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 +119 -49
- 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 +1 -1
- package/dist/cli/commands/prepare-package.d.ts.map +1 -1
- package/dist/cli/commands/prepare-package.js +43 -33
- package/dist/cli/commands/prepare-package.js.map +1 -1
- 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/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/run-task.test.js +59 -0
- package/dist/cli/commands/run-task.test.js.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 +158 -70
- 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-cli.d.js +3 -0
- package/dist/cli/tasks/swc-cli.d.js.map +1 -0
- 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 +78 -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/types/cpx2.d.js +3 -0
- package/dist/cli/types/cpx2.d.js.map +1 -0
- package/dist/cli/utils/bundle.d.ts +2 -4
- package/dist/cli/utils/bundle.d.ts.map +1 -1
- package/dist/cli/utils/bundle.js +136 -74
- 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 +119 -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 +12 -18
- package/dist/cli/utils/get-module-type.js.map +1 -1
- package/dist/cli/utils/index.d.ts +8 -6
- 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/ts-config.d.ts +11 -0
- package/dist/cli/utils/ts-config.d.ts.map +1 -0
- package/dist/cli/utils/ts-config.js +80 -0
- package/dist/cli/utils/ts-config.js.map +1 -0
- 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 +11 -2
- package/dist/utils/get-configuration.d.ts.map +1 -1
- package/dist/utils/get-configuration.js +134 -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/configs/amd-config.js +13 -3
- package/dist/webpack/configs/amd-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 -2
- package/dist/webpack/configs/index.d.ts.map +1 -1
- package/dist/webpack/configs/index.js +29 -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 +60 -34
- package/dist/webpack/configs/optimization-config.js.map +1 -1
- package/dist/webpack/configs/output-config.d.ts.map +1 -1
- package/dist/webpack/configs/output-config.js +28 -13
- 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.d.ts +1 -1
- package/dist/webpack/configs/plugins/html-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/html-plugin.js +30 -22
- 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 +44 -24
- 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.d.ts.map +1 -1
- package/dist/webpack/configs/utils/generate-metadata.js +44 -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 +61 -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 +1 -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/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/index.d.ts +1 -2
- package/dist/webpack/utils/index.d.ts.map +1 -1
- package/dist/webpack/utils/index.js +20 -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 +22 -23
- package/src/cli/commands/__tests__/build.test.ts +66 -43
- 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 +6 -48
- package/src/cli/commands/__tests__/start.test.ts +77 -42
- package/src/cli/commands/__tests__/tests.test.ts +4 -0
- package/src/cli/commands/build.ts +71 -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 +5 -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 +128 -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-package.test.ts +290 -0
- 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 +73 -46
- 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 +49 -8
- 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__/type-check.test.ts +47 -0
- package/src/cli/utils/__tests__/watch-stdout.test.ts +68 -0
- package/src/cli/utils/bundle.ts +32 -23
- 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 +86 -0
- package/src/cli/utils/eslint.ts +1 -0
- package/src/cli/utils/get-module-type.ts +2 -20
- package/src/cli/utils/index.ts +8 -7
- 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/ts-config.ts +64 -0
- 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 +64 -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 +31 -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-shared-dependencies.test.ts +0 -1
- package/src/webpack/__tests__/create-webpack-config-web-component.test.ts +21 -33
- package/src/webpack/__tests__/create-webpack-config.test.ts +60 -150
- 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 -2
- package/src/webpack/configs/loaders/index.ts +1 -1
- package/src/webpack/configs/optimization-config.ts +8 -8
- package/src/webpack/configs/output-config.ts +4 -2
- package/src/webpack/configs/plugins/html-plugin.ts +5 -2
- package/src/webpack/configs/plugins/index.ts +0 -2
- package/src/webpack/configs/plugins/virtual-modules-plugin.ts +18 -5
- 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/utils/__tests__/generate-metadata.test.ts +3 -1
- package/src/webpack/configs/utils/generate-metadata.ts +6 -1
- package/src/webpack/configs/watch-options-config.ts +17 -0
- package/src/webpack/create-webpack-config.ts +3 -6
- package/src/webpack/index.ts +1 -1
- package/src/webpack/types.ts +1 -4
- package/src/webpack/utils/index.ts +1 -2
- package/dist/__mocks__/create-package.d.ts +0 -3
- package/dist/__mocks__/create-package.d.ts.map +0 -1
- package/dist/__mocks__/create-package.js +0 -17
- package/dist/__mocks__/create-package.js.map +0 -1
- package/dist/__mocks__/index.d.ts +0 -2
- package/dist/__mocks__/index.d.ts.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/tcm.d.ts +0 -3
- package/dist/cli/utils/tcm.d.ts.map +0 -1
- package/dist/cli/utils/tcm.js +0 -67
- package/dist/cli/utils/tcm.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.d.ts +0 -3
- package/dist/webpack/__mocks__/file-rules.d.ts.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.d.ts +0 -3
- package/dist/webpack/__mocks__/index.d.ts.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.d.ts +0 -8
- package/dist/webpack/__mocks__/style-rules.d.ts.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/cache-config.d.ts +0 -6
- package/dist/webpack/configs/cache-config.d.ts.map +0 -1
- package/dist/webpack/configs/cache-config.js +0 -23
- package/dist/webpack/configs/cache-config.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/dist/webpack/utils/feature-cohort.d.ts +0 -5
- package/dist/webpack/utils/feature-cohort.d.ts.map +0 -1
- package/dist/webpack/utils/feature-cohort.js +0 -21
- package/dist/webpack/utils/feature-cohort.js.map +0 -1
- package/dist/webpack/utils/hash-mod.d.ts +0 -9
- package/dist/webpack/utils/hash-mod.d.ts.map +0 -1
- package/dist/webpack/utils/hash-mod.js +0 -34
- package/dist/webpack/utils/hash-mod.js.map +0 -1
- package/src/cli/tasks/__tests__/swc-compile.test.ts +0 -192
- 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__/tcm.test.ts +0 -191
- 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/tcm.ts +0 -76
- package/src/cli/utils/tsc.ts +0 -38
- package/src/webpack/configs/cache-config.ts +0 -25
- 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/feature-cohort.ts +0 -19
- package/src/webpack/utils/hash-mod.ts +0 -32
- /package/src/webpack/utils/{bundle.ts → get-module-entry-path.ts} +0 -0
|
@@ -17,12 +17,11 @@ import {
|
|
|
17
17
|
} from '../../utils';
|
|
18
18
|
import { webComponentStyleRules } from '../__mocks__';
|
|
19
19
|
import { generateMetadata } from '../configs/utils';
|
|
20
|
-
import {
|
|
20
|
+
import { getCallerFile, splitByEntry } from '../utils';
|
|
21
21
|
|
|
22
22
|
import { createWebpackConfig } from '../index';
|
|
23
23
|
|
|
24
24
|
jest.mock('fs', () => fs);
|
|
25
|
-
jest.mock('fork-ts-checker-webpack-plugin', () => jest.fn());
|
|
26
25
|
jest.mock('html-webpack-plugin', () => jest.fn());
|
|
27
26
|
jest.mock('mini-css-extract-plugin', () =>
|
|
28
27
|
Object.assign(jest.fn(), { loader: 'MiniCssExtractPlugin.loader' })
|
|
@@ -46,7 +45,6 @@ jest.mock('../../utils', () => ({
|
|
|
46
45
|
jest.mock('../configs/utils/generate-metadata');
|
|
47
46
|
jest.mock('../utils', () => ({
|
|
48
47
|
...jest.requireActual('../utils'),
|
|
49
|
-
featureCohort: jest.fn(),
|
|
50
48
|
getCallerFile: jest.fn(),
|
|
51
49
|
}));
|
|
52
50
|
|
|
@@ -57,14 +55,14 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
57
55
|
const packageVersion = '1.0.0';
|
|
58
56
|
const packageJson = 'package.json';
|
|
59
57
|
const tsConfig = 'tsconfig.build.json';
|
|
60
|
-
const designSystemPath = () => path.join(process.cwd(), `${
|
|
58
|
+
const designSystemPath = () => path.join(process.cwd(), `${destination}/design-system.css`);
|
|
61
59
|
const designSystemCode = [
|
|
62
60
|
`@import '~@servicetitan/tokens/core/tokens.css';`,
|
|
63
61
|
`@import '~@servicetitan/anvil-fonts/dist/css/anvil-fonts.css';`,
|
|
64
62
|
`@import '~@servicetitan/design-system/dist/system.min.css';`,
|
|
65
63
|
].join('\n');
|
|
66
64
|
|
|
67
|
-
const indexPath = () => path.join(process.cwd(), `${
|
|
65
|
+
const indexPath = () => path.join(process.cwd(), `${destination}/index`);
|
|
68
66
|
const indexCode = ({
|
|
69
67
|
embed = false,
|
|
70
68
|
legacyRoot = false,
|
|
@@ -264,7 +262,7 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
264
262
|
beforeEach(() => {
|
|
265
263
|
vol.fromJSON({
|
|
266
264
|
[packageJson]: JSON.stringify({ name: packageName }),
|
|
267
|
-
[`${
|
|
265
|
+
[`${destination}/design-system.css`]: '',
|
|
268
266
|
});
|
|
269
267
|
});
|
|
270
268
|
|
|
@@ -323,6 +321,22 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
323
321
|
});
|
|
324
322
|
});
|
|
325
323
|
|
|
324
|
+
describe('when headless option is set to true', () => {
|
|
325
|
+
beforeEach(() => (options.headless = true));
|
|
326
|
+
|
|
327
|
+
test(`omits design system and registers headless`, () => {
|
|
328
|
+
expect(subject().plugins).toContainEqual(
|
|
329
|
+
new VirtualModulesPlugin({
|
|
330
|
+
[indexPath()]: [
|
|
331
|
+
"import { registerHeadless } from '@servicetitan/web-components';",
|
|
332
|
+
"import { connectedCallback, disconnectedCallback } from './headless';",
|
|
333
|
+
'registerHeadless(connectedCallback, disconnectedCallback);',
|
|
334
|
+
].join('\n'),
|
|
335
|
+
})
|
|
336
|
+
);
|
|
337
|
+
});
|
|
338
|
+
});
|
|
339
|
+
|
|
326
340
|
describe.each([webpackDevConfigFileName, webpackProdConfigFileName])(
|
|
327
341
|
'when invoked from "%s"',
|
|
328
342
|
configFileName => {
|
|
@@ -334,39 +348,13 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
334
348
|
}
|
|
335
349
|
);
|
|
336
350
|
|
|
337
|
-
describe('when featureCohort is active', () => {
|
|
338
|
-
beforeEach(() => {
|
|
339
|
-
jest.mocked(featureCohort).mockImplementation((_: number[], fn: Function) => fn());
|
|
340
|
-
});
|
|
341
|
-
|
|
342
|
-
test('configures "cache"', () => {
|
|
343
|
-
expect(subject().cache).toEqual({
|
|
344
|
-
type: 'filesystem',
|
|
345
|
-
name: `${packageName}__full`,
|
|
346
|
-
profile: true,
|
|
347
|
-
});
|
|
348
|
-
});
|
|
349
|
-
|
|
350
|
-
describe('when embed option is set to true', () => {
|
|
351
|
-
beforeEach(() => (options.embed = true));
|
|
352
|
-
|
|
353
|
-
test('changes "cache.name" suffix to "__light"', () => {
|
|
354
|
-
expect(subject().cache).toEqual(
|
|
355
|
-
expect.objectContaining({
|
|
356
|
-
name: `${packageName}__light`,
|
|
357
|
-
})
|
|
358
|
-
);
|
|
359
|
-
});
|
|
360
|
-
});
|
|
361
|
-
});
|
|
362
|
-
|
|
363
351
|
describe('when mode is production', () => {
|
|
364
352
|
beforeEach(() =>
|
|
365
353
|
Object.assign((overrides.configuration ??= {}), { mode: 'production' })
|
|
366
354
|
);
|
|
367
355
|
|
|
368
356
|
test('configures "devtool"', () => {
|
|
369
|
-
expect(subject().devtool).toBe(
|
|
357
|
+
expect(subject().devtool).toBe('source-map');
|
|
370
358
|
});
|
|
371
359
|
|
|
372
360
|
test('configures "optimization.splitChunks.cacheGroups"', () => {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import CssMinimizerWebpackPlugin from 'css-minimizer-webpack-plugin';
|
|
2
|
-
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
|
|
3
2
|
import HtmlWebpackPlugin from 'html-webpack-plugin';
|
|
4
3
|
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
|
5
4
|
import { fs, vol } from 'memfs';
|
|
@@ -15,7 +14,6 @@ import { argv } from 'yargs';
|
|
|
15
14
|
|
|
16
15
|
import {
|
|
17
16
|
Package,
|
|
18
|
-
PackageType,
|
|
19
17
|
WebpackConfiguration,
|
|
20
18
|
getConfiguration,
|
|
21
19
|
getFolders,
|
|
@@ -30,15 +28,13 @@ import {
|
|
|
30
28
|
loadSharedDependencies,
|
|
31
29
|
log,
|
|
32
30
|
} from '../../utils';
|
|
33
|
-
import { createPackage } from '../../__mocks__';
|
|
34
31
|
import { fileRules, productionStyleRules, styleRules } from '../__mocks__';
|
|
35
|
-
import {
|
|
32
|
+
import { splitByEntry } from '../utils';
|
|
36
33
|
|
|
37
34
|
import { createWebpackConfig } from '../index';
|
|
38
35
|
|
|
39
36
|
jest.mock('fs', () => fs);
|
|
40
37
|
jest.mock('css-minimizer-webpack-plugin', () => jest.fn());
|
|
41
|
-
jest.mock('fork-ts-checker-webpack-plugin', () => jest.fn());
|
|
42
38
|
jest.mock('html-webpack-plugin', () => jest.fn());
|
|
43
39
|
jest.mock('mini-css-extract-plugin', () =>
|
|
44
40
|
Object.assign(jest.fn(), { loader: 'MiniCssExtractPlugin.loader' })
|
|
@@ -71,10 +67,6 @@ jest.mock('../../utils', () => ({
|
|
|
71
67
|
loadSharedDependencies: jest.fn(),
|
|
72
68
|
log: { debug: jest.fn(), info: jest.fn(), warning: jest.fn() },
|
|
73
69
|
}));
|
|
74
|
-
jest.mock('../utils', () => ({
|
|
75
|
-
...jest.requireActual('../utils'),
|
|
76
|
-
featureCohort: jest.fn(),
|
|
77
|
-
}));
|
|
78
70
|
|
|
79
71
|
describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
80
72
|
const source = 'src';
|
|
@@ -110,7 +102,6 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
110
102
|
packages = [];
|
|
111
103
|
overrides = {
|
|
112
104
|
plugins: {
|
|
113
|
-
ForkTsCheckerWebpackPlugin: { logger: 'webpack-infrastructure' },
|
|
114
105
|
HtmlWebpackPlugin: { favicon: 'foo' },
|
|
115
106
|
MiniCssExtractPlugin: { attributes: { foo: 'bar' } },
|
|
116
107
|
},
|
|
@@ -126,9 +117,6 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
126
117
|
jest.mocked(MiniCssExtractPlugin).mockImplementation(mockPlugIn('MiniCssExtractPlugin'));
|
|
127
118
|
jest.mocked(BundleAnalyzerPlugin).mockImplementation(mockPlugIn('BundleAnalyzerPlugin'));
|
|
128
119
|
jest.mocked(FilterWarningsPlugin).mockImplementation(mockPlugIn('FilterWarningsPlugin'));
|
|
129
|
-
jest.mocked(ForkTsCheckerWebpackPlugin).mockImplementation(
|
|
130
|
-
mockPlugIn('ForkTsCheckerWebpackPlugin')
|
|
131
|
-
);
|
|
132
120
|
jest.mocked(HtmlWebpackPlugin).mockImplementation(mockPlugIn('HtmlWebpackPlugin'));
|
|
133
121
|
jest.mocked(IgnorePlugin).mockImplementation(mockPlugIn('IgnorePlugin'));
|
|
134
122
|
jest.mocked(MomentLocalesPlugin).mockImplementation(mockPlugIn('MomentLocalesPlugin'));
|
|
@@ -164,11 +152,11 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
164
152
|
const subject = () => createWebpackConfig(overrides, options);
|
|
165
153
|
|
|
166
154
|
test('configures "entry"', () => {
|
|
167
|
-
expect(subject().entry).toEqual({ main: [`./${
|
|
155
|
+
expect(subject().entry).toEqual({ main: [`./${destination}/index`] });
|
|
168
156
|
});
|
|
169
157
|
|
|
170
158
|
test('configures "resolve"', () => {
|
|
171
|
-
expect(subject().resolve).toEqual({ extensions: ['.js'
|
|
159
|
+
expect(subject().resolve).toEqual({ extensions: ['.js'] });
|
|
172
160
|
});
|
|
173
161
|
|
|
174
162
|
test('configures "devtool"', () => {
|
|
@@ -180,9 +168,7 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
180
168
|
});
|
|
181
169
|
|
|
182
170
|
test('configures "output.path"', () => {
|
|
183
|
-
expect(subject().output!.path).toEqual(
|
|
184
|
-
expect.stringContaining(path.join(destination, 'bundle'))
|
|
185
|
-
);
|
|
171
|
+
expect(subject().output!.path).toEqual(path.join(process.cwd(), destination, 'bundle'));
|
|
186
172
|
});
|
|
187
173
|
|
|
188
174
|
test('configures "optimization"', () => {
|
|
@@ -322,23 +308,9 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
322
308
|
});
|
|
323
309
|
});
|
|
324
310
|
|
|
325
|
-
test('configures "watchOptions"', () => {
|
|
326
|
-
expect(subject().watchOptions).toEqual({
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
describe('with subordinate TSC packages', () => {
|
|
330
|
-
beforeEach(() => {
|
|
331
|
-
packages = [
|
|
332
|
-
createPackage({ name: 'bar', type: PackageType.TSC }),
|
|
333
|
-
createPackage({ name: 'baz', type: PackageType.Webpack }),
|
|
334
|
-
];
|
|
335
|
-
});
|
|
336
|
-
|
|
337
|
-
test('configures "watchOptions" to ignore TSC source files', () => {
|
|
338
|
-
const ignored = packages
|
|
339
|
-
.filter(({ type }) => type === PackageType.TSC)
|
|
340
|
-
.map(({ location }) => path.join(location, getFolders(location).source));
|
|
341
|
-
expect(subject().watchOptions).toEqual({ ignored });
|
|
311
|
+
test('configures "watchOptions" to ignore source folder', () => {
|
|
312
|
+
expect(subject().watchOptions).toEqual({
|
|
313
|
+
ignored: ['**/node_modules'],
|
|
342
314
|
});
|
|
343
315
|
});
|
|
344
316
|
|
|
@@ -359,85 +331,38 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
359
331
|
});
|
|
360
332
|
|
|
361
333
|
function itConfiguresCodeCoverage() {
|
|
362
|
-
test('configures ".
|
|
334
|
+
test('configures ".js" rules to use coverage-istanbul-loader', () => {
|
|
363
335
|
expect(subject().module?.rules).toEqual(
|
|
364
336
|
expect.arrayContaining([
|
|
365
337
|
expect.objectContaining({
|
|
366
|
-
|
|
367
|
-
|
|
338
|
+
enforce: 'post',
|
|
339
|
+
test: /\.js$/,
|
|
340
|
+
include: [path.resolve(destination)],
|
|
341
|
+
exclude: /node_modules/,
|
|
342
|
+
use: expect.objectContaining({
|
|
343
|
+
loader: '@jsdevtools/coverage-istanbul-loader',
|
|
344
|
+
options: {
|
|
345
|
+
compact: false,
|
|
346
|
+
produceSourceMap: true,
|
|
347
|
+
},
|
|
348
|
+
}),
|
|
368
349
|
}),
|
|
369
350
|
])
|
|
370
351
|
);
|
|
371
352
|
});
|
|
372
353
|
}
|
|
373
|
-
|
|
374
|
-
test('configures ".tsx" rules to use esbuild-loader', () => {
|
|
375
|
-
expect(subject().module?.rules).toContainEqual({
|
|
376
|
-
test: /\.tsx?$/,
|
|
377
|
-
exclude: /node_modules/,
|
|
378
|
-
use: [{ loader: 'esbuild-loader', options: { target: 'es2018' } }],
|
|
379
|
-
});
|
|
380
|
-
});
|
|
381
|
-
}
|
|
382
|
-
function itConfiguresSwcLoader() {
|
|
383
|
-
test('configures ".tsx" rules to use swc-loader', () => {
|
|
384
|
-
expect(subject().module?.rules).toContainEqual({
|
|
385
|
-
test: /\.tsx?$/,
|
|
386
|
-
exclude: /node_modules/,
|
|
387
|
-
use: [
|
|
388
|
-
{
|
|
389
|
-
loader: 'swc-loader',
|
|
390
|
-
options: {
|
|
391
|
-
jsc: {
|
|
392
|
-
parser: { syntax: 'typescript', tsx: true, decorators: true },
|
|
393
|
-
target: 'es2018',
|
|
394
|
-
transform: { legacyDecorator: true, decoratorMetadata: true },
|
|
395
|
-
},
|
|
396
|
-
},
|
|
397
|
-
},
|
|
398
|
-
],
|
|
399
|
-
});
|
|
400
|
-
});
|
|
401
|
-
}
|
|
402
|
-
function itConfiguresReactToLoadAutomatically() {
|
|
403
|
-
test('configures React to load automatically', () => {
|
|
404
|
-
expect(subject().plugins).toContainEqual(new ProvidePlugin({ React: 'react' }));
|
|
405
|
-
});
|
|
406
|
-
}
|
|
354
|
+
|
|
407
355
|
describe('with --code-coverage command line argument', () => {
|
|
408
356
|
beforeEach(() => Object.assign(argv, { 'code-coverage': true }));
|
|
409
357
|
itConfiguresCodeCoverage();
|
|
410
358
|
});
|
|
411
|
-
|
|
359
|
+
|
|
360
|
+
describe('when codeCoverage is turned on', () => {
|
|
412
361
|
beforeEach(() => {
|
|
413
362
|
options = { codeCoverage: true };
|
|
414
363
|
});
|
|
415
364
|
itConfiguresCodeCoverage();
|
|
416
365
|
});
|
|
417
|
-
describe('with --esbuild command line argument', () => {
|
|
418
|
-
beforeEach(() => Object.assign(argv, { esbuild: true }));
|
|
419
|
-
itConfiguresESBuildLoader();
|
|
420
|
-
itConfiguresReactToLoadAutomatically();
|
|
421
|
-
});
|
|
422
|
-
describe('with esbuild option', () => {
|
|
423
|
-
beforeEach(() => {
|
|
424
|
-
options = { esbuild: true };
|
|
425
|
-
});
|
|
426
|
-
itConfiguresESBuildLoader();
|
|
427
|
-
itConfiguresReactToLoadAutomatically();
|
|
428
|
-
});
|
|
429
|
-
describe('with experimental-bundlers option', () => {
|
|
430
|
-
beforeEach(() => {
|
|
431
|
-
options = { experimentalBundlers: true };
|
|
432
|
-
});
|
|
433
|
-
itConfiguresSwcLoader();
|
|
434
|
-
itConfiguresReactToLoadAutomatically();
|
|
435
|
-
});
|
|
436
|
-
describe('with --experimental-bundlers command line argument', () => {
|
|
437
|
-
beforeEach(() => Object.assign(argv, { 'experimental-bundlers': true }));
|
|
438
|
-
itConfiguresSwcLoader();
|
|
439
|
-
itConfiguresReactToLoadAutomatically();
|
|
440
|
-
});
|
|
441
366
|
|
|
442
367
|
test('configures ".css" rule to exclude .module.css files', () => {
|
|
443
368
|
const cssRule: any = subject().module?.rules?.find(({ test: regexp }: { test: RegExp }) =>
|
|
@@ -454,26 +379,6 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
454
379
|
);
|
|
455
380
|
});
|
|
456
381
|
|
|
457
|
-
test('configures ForkTsCheckerWebpackPlugin plugin', () => {
|
|
458
|
-
expect(subject().plugins).toContainEqual(
|
|
459
|
-
new ForkTsCheckerWebpackPlugin({
|
|
460
|
-
typescript: {
|
|
461
|
-
configFile: tsConfig,
|
|
462
|
-
configOverwrite: {
|
|
463
|
-
exclude: [
|
|
464
|
-
'**/__tests__/**/*',
|
|
465
|
-
'**/__mocks__/**/*',
|
|
466
|
-
'**/*.test.*',
|
|
467
|
-
'**/*.stories.tsx',
|
|
468
|
-
],
|
|
469
|
-
references: [],
|
|
470
|
-
},
|
|
471
|
-
},
|
|
472
|
-
...overrides.plugins?.ForkTsCheckerWebpackPlugin,
|
|
473
|
-
})
|
|
474
|
-
);
|
|
475
|
-
});
|
|
476
|
-
|
|
477
382
|
test('configures FilterWarningsPlugin plugin', () => {
|
|
478
383
|
expect(subject().plugins).toContainEqual(
|
|
479
384
|
new FilterWarningsPlugin({
|
|
@@ -560,6 +465,27 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
560
465
|
);
|
|
561
466
|
});
|
|
562
467
|
});
|
|
468
|
+
|
|
469
|
+
describe('headless option is true', () => {
|
|
470
|
+
beforeEach(() => setOptions({ headless: true }));
|
|
471
|
+
|
|
472
|
+
test('configures "output.path"', () => {
|
|
473
|
+
expect(subject().output!.path).toEqual(
|
|
474
|
+
path.join(process.cwd(), destination, 'bundle', 'headless')
|
|
475
|
+
);
|
|
476
|
+
});
|
|
477
|
+
|
|
478
|
+
describe('when mode is "production"', () => {
|
|
479
|
+
beforeEach(() => {
|
|
480
|
+
overrides.configuration ??= {};
|
|
481
|
+
Object.assign(overrides.configuration, { mode: 'production' });
|
|
482
|
+
});
|
|
483
|
+
|
|
484
|
+
test('omits optimization.runtimeChunk', () => {
|
|
485
|
+
expect(subject().optimization?.runtimeChunk).toBeUndefined();
|
|
486
|
+
});
|
|
487
|
+
});
|
|
488
|
+
});
|
|
563
489
|
});
|
|
564
490
|
});
|
|
565
491
|
|
|
@@ -576,40 +502,14 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
576
502
|
)
|
|
577
503
|
);
|
|
578
504
|
});
|
|
579
|
-
});
|
|
580
|
-
|
|
581
|
-
describe('when featureCohort is active', () => {
|
|
582
|
-
beforeEach(() => {
|
|
583
|
-
jest.mocked(featureCohort).mockImplementation((_: number[], fn: Function) => fn());
|
|
584
|
-
});
|
|
585
|
-
|
|
586
|
-
test('configures "cache"', () => {
|
|
587
|
-
expect(subject().cache).toEqual({
|
|
588
|
-
type: 'filesystem',
|
|
589
|
-
name: packageName,
|
|
590
|
-
profile: true,
|
|
591
|
-
});
|
|
592
|
-
});
|
|
593
505
|
|
|
594
506
|
describe('when package is web component', () => {
|
|
595
507
|
beforeEach(() => jest.mocked(isWebComponent).mockReturnValue(true));
|
|
596
508
|
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
name: `${packageName}${suffix}`,
|
|
602
|
-
})
|
|
603
|
-
);
|
|
604
|
-
});
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
itAppendsSuffixToPackageName('__full');
|
|
608
|
-
|
|
609
|
-
describe('when embed option is set to true', () => {
|
|
610
|
-
beforeEach(() => setOptions({ embed: true }));
|
|
611
|
-
|
|
612
|
-
itAppendsSuffixToPackageName('__light');
|
|
509
|
+
test('configures "output.path"', () => {
|
|
510
|
+
expect(subject().output!.path).toEqual(
|
|
511
|
+
path.join(process.cwd(), destination, 'bundle', 'light')
|
|
512
|
+
);
|
|
613
513
|
});
|
|
614
514
|
});
|
|
615
515
|
});
|
|
@@ -663,9 +563,7 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
663
563
|
]);
|
|
664
564
|
});
|
|
665
565
|
|
|
666
|
-
|
|
667
|
-
beforeEach(() => (configuration = { webpack: { minify: { css: false, js: false } } }));
|
|
668
|
-
|
|
566
|
+
function itTurnsOffMinimizer() {
|
|
669
567
|
test('changes "optimization.minimize" to false', () => {
|
|
670
568
|
expect(subject().optimization?.minimize).toBe(false);
|
|
671
569
|
});
|
|
@@ -673,6 +571,18 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
673
571
|
test('omits "optimization.minimizer"', () => {
|
|
674
572
|
expect(subject().optimization?.minimizer).toBeUndefined();
|
|
675
573
|
});
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
describe('when minification is turned off', () => {
|
|
577
|
+
beforeEach(() => (configuration = { webpack: { minify: { css: false, js: false } } }));
|
|
578
|
+
|
|
579
|
+
itTurnsOffMinimizer();
|
|
580
|
+
});
|
|
581
|
+
|
|
582
|
+
describe('when codeCoverage is turned on', () => {
|
|
583
|
+
beforeEach(() => (options = { codeCoverage: true }));
|
|
584
|
+
|
|
585
|
+
itTurnsOffMinimizer();
|
|
676
586
|
});
|
|
677
587
|
|
|
678
588
|
describe('with CSS minification options', () => {
|
|
@@ -2,11 +2,7 @@ import fs from 'fs';
|
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import { Configuration } from 'webpack';
|
|
4
4
|
import {
|
|
5
|
-
PackageType,
|
|
6
5
|
allowedWebpackDevServerOptions,
|
|
7
|
-
getFolders,
|
|
8
|
-
getPackageName,
|
|
9
|
-
getPackages,
|
|
10
6
|
getWebpackConfiguration,
|
|
11
7
|
isDevServerDisabled,
|
|
12
8
|
log,
|
|
@@ -16,19 +12,13 @@ import { statsConfig } from './stats-config';
|
|
|
16
12
|
import { Context, Overrides } from './types';
|
|
17
13
|
|
|
18
14
|
type DevServerConfig = NonNullable<Configuration['devServer']>;
|
|
19
|
-
type
|
|
20
|
-
type Result = Pick<Configuration, 'devServer' | 'watchOptions'> | undefined;
|
|
15
|
+
type Result = Pick<Configuration, 'devServer'> | undefined;
|
|
21
16
|
|
|
22
17
|
export function devServerConfig(context: Context, overrides: Overrides): Result {
|
|
23
|
-
if (context.isProduction) {
|
|
18
|
+
if (context.isProduction || isDevServerDisabled()) {
|
|
24
19
|
return;
|
|
25
20
|
}
|
|
26
21
|
|
|
27
|
-
const watchOptions = watchOptionsConfig();
|
|
28
|
-
if (isDevServerDisabled()) {
|
|
29
|
-
return { watchOptions };
|
|
30
|
-
}
|
|
31
|
-
|
|
32
22
|
const devServer = {
|
|
33
23
|
hot: false,
|
|
34
24
|
port: 8080,
|
|
@@ -42,8 +32,8 @@ export function devServerConfig(context: Context, overrides: Overrides): Result
|
|
|
42
32
|
};
|
|
43
33
|
|
|
44
34
|
/* istanbul ignore next: debug only */
|
|
45
|
-
log.debug('dev-server-config', () => JSON.stringify({ devServer
|
|
46
|
-
return { devServer
|
|
35
|
+
log.debug('dev-server-config', () => JSON.stringify({ devServer }, null, 2));
|
|
36
|
+
return { devServer };
|
|
47
37
|
}
|
|
48
38
|
|
|
49
39
|
function getDevServerConfig() {
|
|
@@ -75,19 +65,6 @@ function getDevServerConfig() {
|
|
|
75
65
|
return { ...result, ...webpack.devServer } as Partial<DevServerConfig>;
|
|
76
66
|
}
|
|
77
67
|
|
|
78
|
-
function watchOptionsConfig(): WatchOptionsConfig {
|
|
79
|
-
const ignored = getPackages({ scope: getPackageName() })
|
|
80
|
-
.filter(({ type }) => type === PackageType.TSC)
|
|
81
|
-
.map(({ location }) => path.join(location, getFolders(location).source));
|
|
82
|
-
|
|
83
|
-
/*
|
|
84
|
-
* NOTE: Don't return empty ignored array. It triggered a bug that caused
|
|
85
|
-
* webpack to ignore all files
|
|
86
|
-
*/
|
|
87
|
-
|
|
88
|
-
return ignored.length ? { ignored } : {};
|
|
89
|
-
}
|
|
90
|
-
|
|
91
68
|
const CONTENT_BASE_DEPRECATION_WARNING = `
|
|
92
69
|
DEPRECATION WARNING: webpack.contentBase in package.json is deprecated.
|
|
93
70
|
Use webpack.static instead.
|
|
@@ -5,11 +5,11 @@ type Config = Configuration['devtool'];
|
|
|
5
5
|
type Result = Pick<Configuration, 'devtool'>;
|
|
6
6
|
|
|
7
7
|
export function devtoolConfig(context: Context, _: Overrides): Result {
|
|
8
|
-
const { isProduction
|
|
8
|
+
const { isProduction } = context;
|
|
9
9
|
let devtool: Config;
|
|
10
10
|
|
|
11
11
|
if (isProduction) {
|
|
12
|
-
devtool =
|
|
12
|
+
devtool = 'source-map';
|
|
13
13
|
} else {
|
|
14
14
|
devtool = 'cheap-module-source-map';
|
|
15
15
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
1
2
|
import { Configuration } from 'webpack';
|
|
2
3
|
import { getModuleEntryPath } from '../utils';
|
|
3
4
|
import { Context, Overrides } from './types';
|
|
@@ -6,9 +7,13 @@ type Config = Configuration['entry'];
|
|
|
6
7
|
type Result = Pick<Configuration, 'entry'>;
|
|
7
8
|
|
|
8
9
|
export function entryConfig(context: Context, _: Overrides): Result {
|
|
9
|
-
const { isExposeSharedDependencies, sharedDependencies, source } = context;
|
|
10
|
+
const { destination, isExposeSharedDependencies, sharedDependencies, source } = context;
|
|
10
11
|
|
|
11
|
-
const
|
|
12
|
+
const index = fs.existsSync(`./${source}/index.js`)
|
|
13
|
+
? `./${source}/index`
|
|
14
|
+
: `./${destination}/index`;
|
|
15
|
+
|
|
16
|
+
const entry: Config = { main: [index] };
|
|
12
17
|
|
|
13
18
|
if (isExposeSharedDependencies) {
|
|
14
19
|
(entry.main as string[]).push(...Object.keys(sharedDependencies).map(getModuleEntryPath));
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export * from './amd-config';
|
|
2
|
-
export * from './cache-config';
|
|
3
2
|
export * from './dev-server-config';
|
|
4
3
|
export * from './devtool-config';
|
|
5
4
|
export * from './entry.config';
|
|
@@ -10,4 +9,5 @@ export * from './output-config';
|
|
|
10
9
|
export * from './plugins-config';
|
|
11
10
|
export * from './resolve-config';
|
|
12
11
|
export * from './stats-config';
|
|
13
|
-
export * from './types';
|
|
12
|
+
export type * from './types';
|
|
13
|
+
export * from './watch-options-config';
|
|
@@ -8,7 +8,7 @@ type ConfigWithCacheGroups = Config & { splitChunks: { cacheGroups: Record<strin
|
|
|
8
8
|
type Result = Pick<Configuration, 'optimization'>;
|
|
9
9
|
|
|
10
10
|
export function optimizationConfig(context: Context, _: Overrides): Result {
|
|
11
|
-
const { isProduction } = context;
|
|
11
|
+
const { headless, isProduction } = context;
|
|
12
12
|
|
|
13
13
|
const optimization: ConfigWithCacheGroups = {
|
|
14
14
|
chunkIds: isProduction ? 'deterministic' : 'named',
|
|
@@ -17,7 +17,7 @@ export function optimizationConfig(context: Context, _: Overrides): Result {
|
|
|
17
17
|
splitChunks: { cacheGroups: {} },
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
if (isProduction) {
|
|
20
|
+
if (!headless && isProduction) {
|
|
21
21
|
optimization.runtimeChunk = 'single';
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -29,14 +29,14 @@ export function optimizationConfig(context: Context, _: Overrides): Result {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
function minimizeConfig(optimization: ConfigWithCacheGroups, context: Context) {
|
|
32
|
-
const { isProduction } = context;
|
|
32
|
+
const { isProduction, codeCoverage } = context;
|
|
33
33
|
if (!isProduction) {
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
const minifyJs = context.minify?.js ?? true;
|
|
38
38
|
const minifyCss = context.minify?.css ?? true;
|
|
39
|
-
optimization.minimize = !!minifyJs || !!minifyCss;
|
|
39
|
+
optimization.minimize = !codeCoverage && (!!minifyJs || !!minifyCss);
|
|
40
40
|
if (!optimization.minimize) {
|
|
41
41
|
return;
|
|
42
42
|
}
|
|
@@ -58,8 +58,8 @@ function minimizeConfig(optimization: ConfigWithCacheGroups, context: Context) {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
function sharedDependenciesConfig(optimization: ConfigWithCacheGroups, context: Context) {
|
|
61
|
-
const { isExposeSharedDependencies } = context;
|
|
62
|
-
if (!isExposeSharedDependencies) {
|
|
61
|
+
const { headless, isExposeSharedDependencies } = context;
|
|
62
|
+
if (!isExposeSharedDependencies || headless) {
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
65
|
|
|
@@ -80,8 +80,8 @@ function sharedDependenciesConfig(optimization: ConfigWithCacheGroups, context:
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
function webComponentConfig(optimization: ConfigWithCacheGroups, context: Context) {
|
|
83
|
-
const { isWebComponent, isProduction } = context;
|
|
84
|
-
if (!isWebComponent) {
|
|
83
|
+
const { headless, isWebComponent, isProduction } = context;
|
|
84
|
+
if (!isWebComponent || headless) {
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
87
87
|
|
|
@@ -6,12 +6,14 @@ type Config = Configuration['output'];
|
|
|
6
6
|
type Result = Pick<Configuration, 'output'>;
|
|
7
7
|
|
|
8
8
|
export function outputConfig(context: Context, _: Overrides): Result {
|
|
9
|
-
const { destination, embed, isProduction, isWebComponent, name } = context;
|
|
9
|
+
const { destination, embed, headless, isProduction, isWebComponent, name } = context;
|
|
10
|
+
|
|
11
|
+
const bundleDir = headless ? 'headless' : embed ? 'light' : 'full';
|
|
10
12
|
|
|
11
13
|
const output: Config = {
|
|
12
14
|
filename: '[name].bundle.js',
|
|
13
15
|
path: isWebComponent
|
|
14
|
-
? path.join(process.cwd(), `${destination}/bundle/${
|
|
16
|
+
? path.join(process.cwd(), `${destination}/bundle/${bundleDir}`)
|
|
15
17
|
: path.join(process.cwd(), `${destination}/bundle`),
|
|
16
18
|
};
|
|
17
19
|
|
|
@@ -3,10 +3,13 @@ import HtmlWebpackPlugin, { Options as HtmlWebpackPluginOptions } from 'html-web
|
|
|
3
3
|
import { splitByEntry } from '../../utils';
|
|
4
4
|
import { Context, Overrides } from '../types';
|
|
5
5
|
|
|
6
|
-
export function htmlPlugin(
|
|
6
|
+
export function htmlPlugin(
|
|
7
|
+
{ embed, headless, isWebComponent, name }: Context,
|
|
8
|
+
{ plugins }: Overrides
|
|
9
|
+
) {
|
|
7
10
|
const { HtmlWebpackPlugin: htmlWebpackPluginOptions = {} } = plugins ?? {};
|
|
8
11
|
|
|
9
|
-
if (embed) {
|
|
12
|
+
if (embed || headless) {
|
|
10
13
|
return;
|
|
11
14
|
}
|
|
12
15
|
|
|
@@ -8,7 +8,5 @@ export * from './html-plugin';
|
|
|
8
8
|
export * from './ignore-plugin';
|
|
9
9
|
export * from './mini-css-extract-plugin';
|
|
10
10
|
export * from './moment-locales-plugin';
|
|
11
|
-
export * from './provide-react-plugin';
|
|
12
|
-
export * from './ts-checker-plugin';
|
|
13
11
|
export * from './virtual-modules-plugin';
|
|
14
12
|
export * from './watch-run-plugin';
|