@servicetitan/startup 38.0.0 → 38.2.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.
Files changed (429) hide show
  1. package/bin/js-yaml.js +2 -2
  2. package/dist/cli/commands/build.d.ts.map +1 -1
  3. package/dist/cli/commands/build.js +32 -10
  4. package/dist/cli/commands/build.js.map +1 -1
  5. package/dist/cli/commands/bundle-package.d.ts +6 -0
  6. package/dist/cli/commands/bundle-package.d.ts.map +1 -0
  7. package/dist/cli/commands/bundle-package.js +59 -0
  8. package/dist/cli/commands/bundle-package.js.map +1 -0
  9. package/dist/cli/commands/bundle-vite.js +13 -4
  10. package/dist/cli/commands/bundle-vite.js.map +1 -1
  11. package/dist/cli/commands/bundle-webpack.js +13 -4
  12. package/dist/cli/commands/bundle-webpack.js.map +1 -1
  13. package/dist/cli/commands/clean.js +13 -4
  14. package/dist/cli/commands/clean.js.map +1 -1
  15. package/dist/cli/commands/command.d.ts +13 -0
  16. package/dist/cli/commands/command.d.ts.map +1 -0
  17. package/dist/cli/commands/command.js +74 -0
  18. package/dist/cli/commands/command.js.map +1 -0
  19. package/dist/cli/commands/convert-eslint-config.js +14 -7
  20. package/dist/cli/commands/convert-eslint-config.js.map +1 -1
  21. package/dist/cli/commands/eslint.js +13 -4
  22. package/dist/cli/commands/eslint.js.map +1 -1
  23. package/dist/cli/commands/init.d.ts.map +1 -1
  24. package/dist/cli/commands/init.js +13 -5
  25. package/dist/cli/commands/init.js.map +1 -1
  26. package/dist/cli/commands/install.d.ts.map +1 -1
  27. package/dist/cli/commands/install.js +14 -21
  28. package/dist/cli/commands/install.js.map +1 -1
  29. package/dist/cli/commands/kendo-ui-license.js +13 -4
  30. package/dist/cli/commands/kendo-ui-license.js.map +1 -1
  31. package/dist/cli/commands/lint.js +13 -4
  32. package/dist/cli/commands/lint.js.map +1 -1
  33. package/dist/cli/commands/mfe-check.d.ts.map +1 -1
  34. package/dist/cli/commands/mfe-check.js +15 -7
  35. package/dist/cli/commands/mfe-check.js.map +1 -1
  36. package/dist/cli/commands/mfe-generate-metadata.js +13 -4
  37. package/dist/cli/commands/mfe-generate-metadata.js.map +1 -1
  38. package/dist/cli/commands/mfe-list.js +13 -4
  39. package/dist/cli/commands/mfe-list.js.map +1 -1
  40. package/dist/cli/commands/mfe-package-clean.js +13 -4
  41. package/dist/cli/commands/mfe-package-clean.js.map +1 -1
  42. package/dist/cli/commands/mfe-package-publish.js +13 -4
  43. package/dist/cli/commands/mfe-package-publish.js.map +1 -1
  44. package/dist/cli/commands/mfe-package-rollback.js +13 -4
  45. package/dist/cli/commands/mfe-package-rollback.js.map +1 -1
  46. package/dist/cli/commands/mfe-publish.js +13 -4
  47. package/dist/cli/commands/mfe-publish.js.map +1 -1
  48. package/dist/cli/commands/mfe-purge-cache.js +13 -4
  49. package/dist/cli/commands/mfe-purge-cache.js.map +1 -1
  50. package/dist/cli/commands/prepare-package.js +13 -4
  51. package/dist/cli/commands/prepare-package.js.map +1 -1
  52. package/dist/cli/commands/registry/build.d.ts +1 -1
  53. package/dist/cli/commands/registry/build.d.ts.map +1 -1
  54. package/dist/cli/commands/registry/build.js +3 -5
  55. package/dist/cli/commands/registry/build.js.map +1 -1
  56. package/dist/cli/commands/registry/bundle-package.d.ts +41 -0
  57. package/dist/cli/commands/registry/bundle-package.d.ts.map +1 -0
  58. package/dist/cli/commands/registry/bundle-package.js +54 -0
  59. package/dist/cli/commands/registry/bundle-package.js.map +1 -0
  60. package/dist/cli/commands/registry/command-registry.d.ts +42 -18
  61. package/dist/cli/commands/registry/command-registry.d.ts.map +1 -1
  62. package/dist/cli/commands/registry/command-registry.js +10 -19
  63. package/dist/cli/commands/registry/command-registry.js.map +1 -1
  64. package/dist/cli/commands/registry/install.d.ts +0 -16
  65. package/dist/cli/commands/registry/install.d.ts.map +1 -1
  66. package/dist/cli/commands/registry/install.js +1 -17
  67. package/dist/cli/commands/registry/install.js.map +1 -1
  68. package/dist/cli/commands/registry/start.d.ts +1 -1
  69. package/dist/cli/commands/registry/start.d.ts.map +1 -1
  70. package/dist/cli/commands/registry/start.js +3 -5
  71. package/dist/cli/commands/registry/start.js.map +1 -1
  72. package/dist/cli/commands/review/review.js +14 -7
  73. package/dist/cli/commands/review/review.js.map +1 -1
  74. package/dist/cli/commands/review/rules/no-deprecated-content-base.js +1 -3
  75. package/dist/cli/commands/review/rules/no-deprecated-content-base.js.map +1 -1
  76. package/dist/cli/commands/review/rules/no-direct-peer-dependencies.js +1 -3
  77. package/dist/cli/commands/review/rules/no-direct-peer-dependencies.js.map +1 -1
  78. package/dist/cli/commands/review/rules/no-typescript-entry-point.js +1 -3
  79. package/dist/cli/commands/review/rules/no-typescript-entry-point.js.map +1 -1
  80. package/dist/cli/commands/review/rules/prefer-open-ended-peer-dependencies.js +5 -12
  81. package/dist/cli/commands/review/rules/prefer-open-ended-peer-dependencies.js.map +1 -1
  82. package/dist/cli/commands/review/rules/require-compatible-launch-darkly-sdk.js +5 -12
  83. package/dist/cli/commands/review/rules/require-compatible-launch-darkly-sdk.js.map +1 -1
  84. package/dist/cli/commands/review/rules/require-explicit-side-effects.js +1 -3
  85. package/dist/cli/commands/review/rules/require-explicit-side-effects.js.map +1 -1
  86. package/dist/cli/commands/review/rules/require-one-collection-version.js +1 -3
  87. package/dist/cli/commands/review/rules/require-one-collection-version.js.map +1 -1
  88. package/dist/cli/commands/review/rules/require-servicetitan-scope.js +1 -3
  89. package/dist/cli/commands/review/rules/require-servicetitan-scope.js.map +1 -1
  90. package/dist/cli/commands/review/rules/require-tsconfig-references.js +1 -3
  91. package/dist/cli/commands/review/rules/require-tsconfig-references.js.map +1 -1
  92. package/dist/cli/commands/review/utils/compare-version.js +8 -19
  93. package/dist/cli/commands/review/utils/compare-version.js.map +1 -1
  94. package/dist/cli/commands/run-task.d.ts +1 -0
  95. package/dist/cli/commands/run-task.d.ts.map +1 -1
  96. package/dist/cli/commands/run-task.js +20 -6
  97. package/dist/cli/commands/run-task.js.map +1 -1
  98. package/dist/cli/commands/start.d.ts.map +1 -1
  99. package/dist/cli/commands/start.js +37 -14
  100. package/dist/cli/commands/start.js.map +1 -1
  101. package/dist/cli/commands/stylelint.js +13 -4
  102. package/dist/cli/commands/stylelint.js.map +1 -1
  103. package/dist/cli/commands/styles-check.js +13 -4
  104. package/dist/cli/commands/styles-check.js.map +1 -1
  105. package/dist/cli/commands/test/runners/jest.js +1 -3
  106. package/dist/cli/commands/test/runners/jest.js.map +1 -1
  107. package/dist/cli/commands/test/tests.js +13 -4
  108. package/dist/cli/commands/test/tests.js.map +1 -1
  109. package/dist/cli/commands/types.d.ts +1 -6
  110. package/dist/cli/commands/types.d.ts.map +1 -1
  111. package/dist/cli/commands/types.js +2 -20
  112. package/dist/cli/commands/types.js.map +1 -1
  113. package/dist/cli/commands/upload-sourcemaps.js +17 -13
  114. package/dist/cli/commands/upload-sourcemaps.js.map +1 -1
  115. package/dist/cli/index.js +1 -0
  116. package/dist/cli/index.js.map +1 -1
  117. package/dist/cli/tasks/cli-task.d.ts +3 -0
  118. package/dist/cli/tasks/cli-task.d.ts.map +1 -1
  119. package/dist/cli/tasks/cli-task.js +41 -9
  120. package/dist/cli/tasks/cli-task.js.map +1 -1
  121. package/dist/cli/tasks/swc-compile-package/get-swc-options.d.ts +9 -1
  122. package/dist/cli/tasks/swc-compile-package/get-swc-options.d.ts.map +1 -1
  123. package/dist/cli/tasks/swc-compile-package/get-swc-options.js +18 -2
  124. package/dist/cli/tasks/swc-compile-package/get-swc-options.js.map +1 -1
  125. package/dist/cli/tasks/swc-compile-package/swc-compile-package.d.ts +3 -1
  126. package/dist/cli/tasks/swc-compile-package/swc-compile-package.d.ts.map +1 -1
  127. package/dist/cli/tasks/swc-compile-package/swc-compile-package.js +17 -3
  128. package/dist/cli/tasks/swc-compile-package/swc-compile-package.js.map +1 -1
  129. package/dist/cli/tasks/task.d.ts +2 -1
  130. package/dist/cli/tasks/task.d.ts.map +1 -1
  131. package/dist/cli/tasks/task.js +6 -3
  132. package/dist/cli/tasks/task.js.map +1 -1
  133. package/dist/cli/tasks/tsc-compile/tsc-compile.js +1 -3
  134. package/dist/cli/tasks/tsc-compile/tsc-compile.js.map +1 -1
  135. package/dist/cli/utils/cli-git.d.ts +7 -0
  136. package/dist/cli/utils/cli-git.d.ts.map +1 -1
  137. package/dist/cli/utils/cli-git.js +30 -0
  138. package/dist/cli/utils/cli-git.js.map +1 -1
  139. package/dist/cli/utils/cli-npm.d.ts.map +1 -1
  140. package/dist/cli/utils/cli-npm.js +8 -1
  141. package/dist/cli/utils/cli-npm.js.map +1 -1
  142. package/dist/cli/utils/cli-os.d.ts +7 -1
  143. package/dist/cli/utils/cli-os.d.ts.map +1 -1
  144. package/dist/cli/utils/cli-os.js +42 -0
  145. package/dist/cli/utils/cli-os.js.map +1 -1
  146. package/dist/cli/utils/compile.d.ts.map +1 -1
  147. package/dist/cli/utils/compile.js +7 -4
  148. package/dist/cli/utils/compile.js.map +1 -1
  149. package/dist/cli/utils/copy-files.js +1 -0
  150. package/dist/cli/utils/copy-files.js.map +1 -1
  151. package/dist/cli/utils/index.d.ts +1 -1
  152. package/dist/cli/utils/index.d.ts.map +1 -1
  153. package/dist/cli/utils/index.js +1 -1
  154. package/dist/cli/utils/index.js.map +1 -1
  155. package/dist/cli/utils/process-tree.js +2 -6
  156. package/dist/cli/utils/process-tree.js.map +1 -1
  157. package/dist/cli/utils/resolve-bundler.d.ts.map +1 -1
  158. package/dist/cli/utils/resolve-bundler.js +2 -1
  159. package/dist/cli/utils/resolve-bundler.js.map +1 -1
  160. package/dist/cli/utils/ts-config.d.ts +1 -1
  161. package/dist/cli/utils/ts-config.d.ts.map +1 -1
  162. package/dist/cli/utils/ts-config.js +1 -3
  163. package/dist/cli/utils/ts-config.js.map +1 -1
  164. package/dist/cli/utils/with-exponential-backoff.d.ts +7 -0
  165. package/dist/cli/utils/with-exponential-backoff.d.ts.map +1 -0
  166. package/dist/cli/utils/with-exponential-backoff.js +28 -0
  167. package/dist/cli/utils/with-exponential-backoff.js.map +1 -0
  168. package/dist/core/constants.d.ts +2 -0
  169. package/dist/core/constants.d.ts.map +1 -1
  170. package/dist/core/constants.js +6 -1
  171. package/dist/core/constants.js.map +1 -1
  172. package/dist/postinstall.js +118 -0
  173. package/dist/scripts/generate-bin-wrappers.js +203 -0
  174. package/dist/storybook-config/swc.d.ts +6 -0
  175. package/dist/storybook-config/swc.d.ts.map +1 -1
  176. package/dist/storybook-config/webpack-final.d.ts.map +1 -1
  177. package/dist/storybook-config/webpack-final.js +2 -1
  178. package/dist/storybook-config/webpack-final.js.map +1 -1
  179. package/dist/telemetry/index.d.ts +3 -0
  180. package/dist/telemetry/index.d.ts.map +1 -0
  181. package/dist/telemetry/index.js +21 -0
  182. package/dist/telemetry/index.js.map +1 -0
  183. package/dist/telemetry/telemetry.d.ts +15 -0
  184. package/dist/telemetry/telemetry.d.ts.map +1 -0
  185. package/dist/telemetry/telemetry.js +176 -0
  186. package/dist/telemetry/telemetry.js.map +1 -0
  187. package/dist/utils/exit-when-parent-exits.d.ts +6 -0
  188. package/dist/utils/exit-when-parent-exits.d.ts.map +1 -0
  189. package/dist/utils/exit-when-parent-exits.js +37 -0
  190. package/dist/utils/exit-when-parent-exits.js.map +1 -0
  191. package/dist/utils/find-up.d.ts +1 -1
  192. package/dist/utils/find-up.d.ts.map +1 -1
  193. package/dist/utils/find-up.js +2 -2
  194. package/dist/utils/find-up.js.map +1 -1
  195. package/dist/utils/get-configuration.d.ts +6 -3
  196. package/dist/utils/get-configuration.d.ts.map +1 -1
  197. package/dist/utils/get-configuration.js +10 -2
  198. package/dist/utils/get-configuration.js.map +1 -1
  199. package/dist/utils/index.d.ts +1 -0
  200. package/dist/utils/index.d.ts.map +1 -1
  201. package/dist/utils/index.js +1 -0
  202. package/dist/utils/index.js.map +1 -1
  203. package/dist/utils/log.js +1 -3
  204. package/dist/utils/log.js.map +1 -1
  205. package/dist/vite/build-shared-dependencies.d.ts.map +1 -1
  206. package/dist/vite/build-shared-dependencies.js +2 -0
  207. package/dist/vite/build-shared-dependencies.js.map +1 -1
  208. package/dist/vite/config/base-config.d.ts.map +1 -1
  209. package/dist/vite/config/base-config.js +12 -1
  210. package/dist/vite/config/base-config.js.map +1 -1
  211. package/dist/vite/config/create-filtering-logger.d.ts.map +1 -1
  212. package/dist/vite/config/create-filtering-logger.js +6 -2
  213. package/dist/vite/config/create-filtering-logger.js.map +1 -1
  214. package/dist/vite/config/create-vite-config.js +7 -2
  215. package/dist/vite/config/create-vite-config.js.map +1 -1
  216. package/dist/vite/config/load-config-file.js +8 -19
  217. package/dist/vite/config/load-config-file.js.map +1 -1
  218. package/dist/vite/index.d.ts +2 -0
  219. package/dist/vite/index.d.ts.map +1 -1
  220. package/dist/vite/index.html +2 -2
  221. package/dist/vite/index.js +16 -0
  222. package/dist/vite/index.js.map +1 -1
  223. package/dist/vite/plugins/chain-source-maps-plugin.js +1 -1
  224. package/dist/vite/plugins/chain-source-maps-plugin.js.map +1 -1
  225. package/dist/vite/plugins/clean-plugin.js +1 -1
  226. package/dist/vite/plugins/clean-plugin.js.map +1 -1
  227. package/dist/vite/plugins/css-injector-plugin.js +1 -1
  228. package/dist/vite/plugins/css-injector-plugin.js.map +1 -1
  229. package/dist/vite/plugins/design-system-guard-plugin.d.ts.map +1 -1
  230. package/dist/vite/plugins/design-system-guard-plugin.js +10 -5
  231. package/dist/vite/plugins/design-system-guard-plugin.js.map +1 -1
  232. package/dist/vite/plugins/dev-server-routing-plugin.js +1 -1
  233. package/dist/vite/plugins/dev-server-routing-plugin.js.map +1 -1
  234. package/dist/vite/plugins/externals-plugin.d.ts.map +1 -1
  235. package/dist/vite/plugins/externals-plugin.js +11 -5
  236. package/dist/vite/plugins/externals-plugin.js.map +1 -1
  237. package/dist/vite/plugins/html-plugin.d.ts.map +1 -1
  238. package/dist/vite/plugins/html-plugin.js +5 -3
  239. package/dist/vite/plugins/html-plugin.js.map +1 -1
  240. package/dist/vite/plugins/ignore-modules-plugin.d.ts +2 -2
  241. package/dist/vite/plugins/ignore-modules-plugin.d.ts.map +1 -1
  242. package/dist/vite/plugins/ignore-modules-plugin.js +36 -24
  243. package/dist/vite/plugins/ignore-modules-plugin.js.map +1 -1
  244. package/dist/vite/plugins/index.d.ts +3 -0
  245. package/dist/vite/plugins/index.d.ts.map +1 -1
  246. package/dist/vite/plugins/index.js +3 -0
  247. package/dist/vite/plugins/index.js.map +1 -1
  248. package/dist/vite/plugins/less-tilde-plugin.d.ts +8 -0
  249. package/dist/vite/plugins/less-tilde-plugin.d.ts.map +1 -0
  250. package/dist/vite/plugins/less-tilde-plugin.js +53 -0
  251. package/dist/vite/plugins/less-tilde-plugin.js.map +1 -0
  252. package/dist/vite/plugins/magic-comments-plugin/magic-comments-plugin.js +1 -1
  253. package/dist/vite/plugins/magic-comments-plugin/magic-comments-plugin.js.map +1 -1
  254. package/dist/vite/plugins/metadata-plugin.js +1 -1
  255. package/dist/vite/plugins/metadata-plugin.js.map +1 -1
  256. package/dist/vite/plugins/moment-locales-plugin.d.ts +1 -1
  257. package/dist/vite/plugins/moment-locales-plugin.d.ts.map +1 -1
  258. package/dist/vite/plugins/moment-locales-plugin.js +30 -14
  259. package/dist/vite/plugins/moment-locales-plugin.js.map +1 -1
  260. package/dist/vite/plugins/react-refresh-plugin/index.d.ts +2 -0
  261. package/dist/vite/plugins/react-refresh-plugin/index.d.ts.map +1 -0
  262. package/dist/vite/plugins/react-refresh-plugin/index.js +20 -0
  263. package/dist/vite/plugins/react-refresh-plugin/index.js.map +1 -0
  264. package/dist/vite/plugins/react-refresh-plugin/react-refresh-plugin.d.ts +4 -0
  265. package/dist/vite/plugins/react-refresh-plugin/react-refresh-plugin.d.ts.map +1 -0
  266. package/dist/vite/plugins/react-refresh-plugin/react-refresh-plugin.js +143 -0
  267. package/dist/vite/plugins/react-refresh-plugin/react-refresh-plugin.js.map +1 -0
  268. package/dist/vite/plugins/react-refresh-plugin/refresh-runtime.js +113 -0
  269. package/dist/vite/plugins/shared-dependencies-plugin/shared-dependencies-plugin.d.ts.map +1 -1
  270. package/dist/vite/plugins/shared-dependencies-plugin/shared-dependencies-plugin.js +14 -11
  271. package/dist/vite/plugins/shared-dependencies-plugin/shared-dependencies-plugin.js.map +1 -1
  272. package/dist/vite/plugins/style-urls-plugin.js +1 -1
  273. package/dist/vite/plugins/style-urls-plugin.js.map +1 -1
  274. package/dist/vite/plugins/virtual-modules-plugin.d.ts.map +1 -1
  275. package/dist/vite/plugins/virtual-modules-plugin.js +9 -6
  276. package/dist/vite/plugins/virtual-modules-plugin.js.map +1 -1
  277. package/dist/vite/plugins/window-externals-plugin.d.ts +22 -0
  278. package/dist/vite/plugins/window-externals-plugin.d.ts.map +1 -0
  279. package/dist/vite/plugins/window-externals-plugin.js +74 -0
  280. package/dist/vite/plugins/window-externals-plugin.js.map +1 -0
  281. package/dist/webpack/bundle-webpack.d.ts.map +1 -1
  282. package/dist/webpack/bundle-webpack.js +6 -1
  283. package/dist/webpack/bundle-webpack.js.map +1 -1
  284. package/dist/webpack/configs/optimization-config.js +17 -12
  285. package/dist/webpack/configs/optimization-config.js.map +1 -1
  286. package/dist/webpack/configs/output-config.js +1 -1
  287. package/dist/webpack/configs/output-config.js.map +1 -1
  288. package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.js +1 -3
  289. package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.js.map +1 -1
  290. package/dist/webpack/loaders/expose-loader/__tests__/__mocks__/configuration.expose-loader.js +13 -0
  291. package/dist/webpack/loaders/expose-loader/__tests__/__mocks__/index.js +1 -0
  292. package/dist/webpack/utils/index.d.ts +1 -0
  293. package/dist/webpack/utils/index.d.ts.map +1 -1
  294. package/dist/webpack/utils/index.js +1 -0
  295. package/dist/webpack/utils/index.js.map +1 -1
  296. package/dist/webpack/utils/normalize-proxy-config.d.ts +6 -0
  297. package/dist/webpack/utils/normalize-proxy-config.d.ts.map +1 -0
  298. package/dist/webpack/utils/normalize-proxy-config.js +52 -0
  299. package/dist/webpack/utils/normalize-proxy-config.js.map +1 -0
  300. package/package.json +32 -26
  301. package/src/cli/commands/__tests__/build.test.ts +81 -20
  302. package/src/cli/commands/__tests__/bundle-package.test.ts +65 -0
  303. package/src/cli/commands/__tests__/command.test.ts +154 -0
  304. package/src/cli/commands/__tests__/init.test.ts +1 -1
  305. package/src/cli/commands/__tests__/install.test.ts +5 -72
  306. package/src/cli/commands/__tests__/mfe-check.test.ts +26 -5
  307. package/src/cli/commands/__tests__/run-task.test.ts +20 -1
  308. package/src/cli/commands/__tests__/start.test.ts +77 -16
  309. package/src/cli/commands/build.ts +15 -6
  310. package/src/cli/commands/bundle-package.ts +20 -0
  311. package/src/cli/commands/command.ts +64 -0
  312. package/src/cli/commands/init.ts +0 -1
  313. package/src/cli/commands/install.ts +5 -21
  314. package/src/cli/commands/mfe-check.ts +6 -10
  315. package/src/cli/commands/registry/build.ts +3 -2
  316. package/src/cli/commands/registry/bundle-package.ts +22 -0
  317. package/src/cli/commands/registry/command-registry.ts +2 -0
  318. package/src/cli/commands/registry/install.ts +1 -6
  319. package/src/cli/commands/registry/start.ts +3 -2
  320. package/src/cli/commands/run-task.ts +8 -2
  321. package/src/cli/commands/start.ts +17 -6
  322. package/src/cli/commands/types.ts +2 -6
  323. package/src/cli/index.ts +3 -0
  324. package/src/cli/tasks/__tests__/cli-task.test.ts +181 -69
  325. package/src/cli/tasks/__tests__/task.test.ts +40 -45
  326. package/src/cli/tasks/cli-task.ts +43 -2
  327. package/src/cli/tasks/swc-compile-package/__tests__/get-swc-options.test.ts +46 -4
  328. package/src/cli/tasks/swc-compile-package/__tests__/swc-compile-package.test.ts +25 -4
  329. package/src/cli/tasks/swc-compile-package/get-swc-options.ts +14 -1
  330. package/src/cli/tasks/swc-compile-package/swc-compile-package.ts +6 -2
  331. package/src/cli/tasks/task.ts +8 -2
  332. package/src/cli/tasks/tsc-compile/__tests__/tsc-compile.test.ts +8 -32
  333. package/src/cli/tasks/tsc-compile-package/__tests__/tsc-compile-package.test.ts +10 -19
  334. package/src/cli/utils/__tests__/cli-git.test.ts +54 -3
  335. package/src/cli/utils/__tests__/cli-npm.test.ts +33 -0
  336. package/src/cli/utils/__tests__/cli-os.test.ts +183 -4
  337. package/src/cli/utils/__tests__/compile.test.ts +37 -2
  338. package/src/cli/utils/__tests__/copy-files.test.ts +1 -1
  339. package/src/cli/utils/__tests__/with-exponential-backoff.test.ts +119 -0
  340. package/src/cli/utils/cli-git.ts +27 -1
  341. package/src/cli/utils/cli-npm.ts +19 -4
  342. package/src/cli/utils/cli-os.ts +44 -0
  343. package/src/cli/utils/compile.ts +8 -1
  344. package/src/cli/utils/copy-files.ts +1 -1
  345. package/src/cli/utils/index.ts +1 -1
  346. package/src/cli/utils/resolve-bundler.ts +2 -1
  347. package/src/cli/utils/ts-config.ts +1 -1
  348. package/src/cli/utils/with-exponential-backoff.ts +28 -0
  349. package/src/core/constants.ts +2 -0
  350. package/src/storybook-config/__tests__/vite-final.test.ts +6 -0
  351. package/src/storybook-config/__tests__/webpack-final.test.ts +26 -12
  352. package/src/storybook-config/webpack-final.ts +10 -4
  353. package/src/telemetry/__tests__/telemetry.test.ts +326 -0
  354. package/src/telemetry/index.ts +2 -0
  355. package/src/telemetry/telemetry.ts +134 -0
  356. package/src/utils/__tests__/exit-when-parent-exits.test.ts +87 -0
  357. package/src/utils/__tests__/find-up.test.ts +49 -0
  358. package/src/utils/__tests__/get-configuration.test.ts +62 -0
  359. package/src/utils/exit-when-parent-exits.ts +33 -0
  360. package/src/utils/find-up.ts +2 -2
  361. package/src/utils/get-configuration.ts +14 -5
  362. package/src/utils/index.ts +1 -0
  363. package/src/vite/__tests__/build-shared-dependencies.test.ts +39 -5
  364. package/src/vite/build-shared-dependencies.ts +2 -1
  365. package/src/vite/config/__tests__/base-config.test.ts +12 -4
  366. package/src/vite/config/__tests__/create-css-config.test.ts +2 -6
  367. package/src/vite/config/__tests__/create-filtering-logger.test.ts +3 -2
  368. package/src/vite/config/__tests__/create-vite-config.test.ts +6 -3
  369. package/src/vite/config/base-config.ts +13 -1
  370. package/src/vite/config/create-filtering-logger.ts +8 -2
  371. package/src/vite/config/create-vite-config.ts +6 -3
  372. package/src/vite/index.html +2 -2
  373. package/src/vite/index.ts +2 -0
  374. package/src/vite/plugins/__tests__/chain-source-maps-plugin.test.ts +1 -1
  375. package/src/vite/plugins/__tests__/clean-plugin.test.ts +1 -1
  376. package/src/vite/plugins/__tests__/css-injector-plugin.test.ts +1 -1
  377. package/src/vite/plugins/__tests__/design-system-guard-plugin.test.ts +15 -3
  378. package/src/vite/plugins/__tests__/dev-server-routing-plugin.test.ts +1 -1
  379. package/src/vite/plugins/__tests__/externals-plugin.test.ts +24 -3
  380. package/src/vite/plugins/__tests__/html-plugin.test.ts +10 -3
  381. package/src/vite/plugins/__tests__/html-template.test.ts +10 -2
  382. package/src/vite/plugins/__tests__/ignore-modules-plugin.test.ts +30 -6
  383. package/src/vite/plugins/__tests__/less-tilde-plugin.test.ts +91 -0
  384. package/src/vite/plugins/__tests__/metadata-plugin.test.ts +1 -1
  385. package/src/vite/plugins/__tests__/moment-locales-plugin.test.ts +35 -25
  386. package/src/vite/plugins/__tests__/style-urls-plugin.test.ts +1 -1
  387. package/src/vite/plugins/__tests__/virtual-modules-plugin.test.ts +20 -9
  388. package/src/vite/plugins/__tests__/window-externals-plugin.test.ts +128 -0
  389. package/src/vite/plugins/chain-source-maps-plugin.ts +1 -1
  390. package/src/vite/plugins/clean-plugin.ts +1 -1
  391. package/src/vite/plugins/css-injector-plugin.ts +1 -1
  392. package/src/vite/plugins/design-system-guard-plugin.ts +11 -8
  393. package/src/vite/plugins/dev-server-routing-plugin.ts +1 -1
  394. package/src/vite/plugins/externals-plugin.ts +15 -6
  395. package/src/vite/plugins/html-plugin.ts +4 -2
  396. package/src/vite/plugins/ignore-modules-plugin.ts +32 -23
  397. package/src/vite/plugins/index.ts +3 -0
  398. package/src/vite/plugins/less-tilde-plugin.ts +64 -0
  399. package/src/vite/plugins/magic-comments-plugin/magic-comments-plugin.ts +1 -1
  400. package/src/vite/plugins/metadata-plugin.ts +1 -1
  401. package/src/vite/plugins/moment-locales-plugin.ts +24 -14
  402. package/src/vite/plugins/react-refresh-plugin/README.md +165 -0
  403. package/src/vite/plugins/react-refresh-plugin/__tests__/react-refresh-plugin.test.ts +366 -0
  404. package/src/vite/plugins/react-refresh-plugin/__tests__/refresh-runtime.test.ts +193 -0
  405. package/src/vite/plugins/react-refresh-plugin/index.ts +1 -0
  406. package/src/vite/plugins/react-refresh-plugin/react-refresh-plugin.ts +144 -0
  407. package/src/vite/plugins/react-refresh-plugin/refresh-runtime.js +113 -0
  408. package/src/vite/plugins/shared-dependencies-plugin/__tests__/shared-dependencies-plugin.test.ts +21 -16
  409. package/src/vite/plugins/shared-dependencies-plugin/shared-dependencies-plugin.ts +13 -12
  410. package/src/vite/plugins/style-urls-plugin.ts +1 -1
  411. package/src/vite/plugins/virtual-modules-plugin.ts +8 -7
  412. package/src/vite/plugins/window-externals-plugin.ts +94 -0
  413. package/src/webpack/__tests__/bundle-webpack.test.ts +32 -0
  414. package/src/webpack/__tests__/create-webpack-config-shared-dependencies.test.ts +27 -1
  415. package/src/webpack/__tests__/create-webpack-config-web-component.test.ts +17 -5
  416. package/src/webpack/__tests__/create-webpack-config.test.ts +10 -6
  417. package/src/webpack/bundle-webpack.ts +7 -1
  418. package/src/webpack/configs/optimization-config.ts +22 -11
  419. package/src/webpack/configs/output-config.ts +1 -1
  420. package/src/webpack/utils/__tests__/normalize-proxy-config.test.ts +121 -0
  421. package/src/webpack/utils/index.ts +1 -0
  422. package/src/webpack/utils/normalize-proxy-config.ts +59 -0
  423. package/tsconfig/types.d.ts +10 -0
  424. package/dist/cli/utils/get-bundle-command.d.ts +0 -3
  425. package/dist/cli/utils/get-bundle-command.d.ts.map +0 -1
  426. package/dist/cli/utils/get-bundle-command.js +0 -16
  427. package/dist/cli/utils/get-bundle-command.js.map +0 -1
  428. package/src/cli/utils/__tests__/get-bundle-command.test.ts +0 -23
  429. package/src/cli/utils/get-bundle-command.ts +0 -5
@@ -2,9 +2,11 @@
2
2
  * @jest-environment node
3
3
  */
4
4
  import { createPackage } from '../../../__mocks__';
5
- import { Package, PackageType, getPackages, log } from '../../../utils';
6
- import { compile, lernaExec, typeCheck } from '../../utils';
5
+ import { Attributes } from '../../../telemetry';
6
+ import { getConfiguration, getPackages, log, Package, PackageType } from '../../../utils';
7
+ import { compile, lernaExec, ProcessTree, typeCheck } from '../../utils';
7
8
  import { Build } from '../build';
9
+ import { Command } from '../command';
8
10
  import { kendoUILicense } from '../kendo-ui-license';
9
11
  import { entry } from '../registry/build';
10
12
 
@@ -25,14 +27,25 @@ jest.mock('../kendo-ui-license', () => ({
25
27
  }));
26
28
 
27
29
  describe(`[startup] ${Build.name}`, () => {
30
+ const commandProto = Command.prototype as unknown as {
31
+ recordStart: (command: string, attributes?: Attributes) => void;
32
+ recordEnd: (error?: unknown) => Promise<void>;
33
+ };
34
+
28
35
  let args: ConstructorParameters<typeof Build>[0];
29
36
  let packages: Package[];
37
+ let recordStart: jest.SpyInstance;
38
+ let recordEnd: jest.SpyInstance;
30
39
 
31
40
  beforeEach(() => {
32
41
  args = {};
33
42
  packages = [];
43
+ jest.restoreAllMocks();
34
44
  jest.clearAllMocks();
45
+ jest.mocked(getConfiguration).mockReturnValue({});
35
46
  jest.mocked(getPackages).mockImplementation(() => packages);
47
+ recordStart = jest.spyOn(commandProto, 'recordStart').mockImplementation(() => {});
48
+ recordEnd = jest.spyOn(commandProto, 'recordEnd').mockResolvedValue(undefined);
36
49
  });
37
50
 
38
51
  const subject = async () => new Build(args).execute();
@@ -105,7 +118,7 @@ describe(`[startup] ${Build.name}`, () => {
105
118
  });
106
119
  });
107
120
 
108
- describe('with Webpack package', () => {
121
+ describe('with bundle package', () => {
109
122
  beforeEach(() => packages.push(createPackage({ type: PackageType.Bundle })));
110
123
 
111
124
  itPreparesThePackage();
@@ -122,11 +135,11 @@ describe(`[startup] ${Build.name}`, () => {
122
135
  await subject();
123
136
 
124
137
  expect(lernaExec).toHaveBeenCalledWith({
125
- 'cmd': 'startup bundle-webpack',
138
+ 'cmd': 'startup bundle-package',
126
139
  'scope': packages.map(({ name }) => name),
127
140
  'parallel': true,
128
141
  'stream': true,
129
- '--': ['--exposed-dependencies'],
142
+ '--': ['--exposed-dependencies', '--bundler webpack'],
130
143
  });
131
144
  });
132
145
 
@@ -134,23 +147,36 @@ describe(`[startup] ${Build.name}`, () => {
134
147
  await subject();
135
148
 
136
149
  expect(lernaExec).toHaveBeenCalledWith({
137
- 'cmd': 'startup bundle-webpack',
150
+ 'cmd': 'startup bundle-package',
138
151
  'scope': packages.map(({ name }) => name),
139
152
  'stream': true,
140
- '--': [],
153
+ '--': ['--bundler webpack'],
141
154
  });
142
155
  });
143
156
 
144
- describe('with --bundler=vite', () => {
145
- beforeEach(() => (args.bundler = 'vite'));
146
-
147
- test('bundles with Vite', async () => {
157
+ function itBundlesWithVite() {
158
+ test('bundles with vite', async () => {
148
159
  await subject();
149
160
 
150
161
  expect(lernaExec).toHaveBeenCalledWith(
151
- expect.objectContaining({ cmd: 'startup bundle-vite' })
162
+ expect.objectContaining({
163
+ 'cmd': 'startup bundle-package',
164
+ '--': ['--bundler vite'],
165
+ })
152
166
  );
153
167
  });
168
+ }
169
+
170
+ describe('with --bundler=vite', () => {
171
+ beforeEach(() => (args.bundler = 'vite'));
172
+
173
+ itBundlesWithVite();
174
+ });
175
+
176
+ describe('with cli.bundler set to vite', () => {
177
+ beforeEach(() => jest.mocked(getConfiguration).mockReturnValue({ bundler: 'vite' }));
178
+
179
+ itBundlesWithVite();
154
180
  });
155
181
 
156
182
  describe('with "code-coverage"', () => {
@@ -161,8 +187,8 @@ describe(`[startup] ${Build.name}`, () => {
161
187
 
162
188
  expect(lernaExec).toHaveBeenCalledWith(
163
189
  expect.objectContaining({
164
- 'cmd': 'startup bundle-webpack',
165
- '--': ['--code-coverage'],
190
+ 'cmd': 'startup bundle-package',
191
+ '--': ['--code-coverage', '--bundler webpack'],
166
192
  })
167
193
  );
168
194
  });
@@ -176,8 +202,8 @@ describe(`[startup] ${Build.name}`, () => {
176
202
 
177
203
  expect(lernaExec).toHaveBeenCalledWith(
178
204
  expect.objectContaining({
179
- 'cmd': 'startup bundle-webpack',
180
- '--': ['--stat'],
205
+ 'cmd': 'startup bundle-package',
206
+ '--': ['--stat', '--bundler webpack'],
181
207
  })
182
208
  );
183
209
  });
@@ -191,8 +217,8 @@ describe(`[startup] ${Build.name}`, () => {
191
217
 
192
218
  expect(lernaExec).toHaveBeenCalledWith(
193
219
  expect.objectContaining({
194
- 'cmd': 'startup bundle-webpack',
195
- '--': ['--preview'],
220
+ 'cmd': 'startup bundle-package',
221
+ '--': ['--preview', '--bundler webpack'],
196
222
  })
197
223
  );
198
224
  });
@@ -206,8 +232,8 @@ describe(`[startup] ${Build.name}`, () => {
206
232
 
207
233
  expect(lernaExec).toHaveBeenCalledWith(
208
234
  expect.objectContaining({
209
- 'cmd': 'startup bundle-webpack',
210
- '--': [`--config "${args.config}"`],
235
+ 'cmd': 'startup bundle-package',
236
+ '--': [`--config "${args.config}"`, '--bundler webpack'],
211
237
  })
212
238
  );
213
239
  });
@@ -226,6 +252,41 @@ describe(`[startup] ${Build.name}`, () => {
226
252
  });
227
253
  });
228
254
 
255
+ describe('telemetry', () => {
256
+ beforeEach(() => packages.push(createPackage({ type: PackageType.TSC })));
257
+
258
+ test('records the command start', async () => {
259
+ await subject();
260
+
261
+ expect(recordStart).toHaveBeenCalledWith('build', { bundler: expect.any(String) });
262
+ });
263
+
264
+ test('records the command completion', async () => {
265
+ await subject();
266
+
267
+ expect(recordEnd).toHaveBeenCalledWith();
268
+ });
269
+
270
+ describe('when the build fails', () => {
271
+ const error = new Error('bundle failed');
272
+
273
+ beforeEach(() => {
274
+ jest.spyOn(log, 'error').mockImplementation(jest.fn());
275
+ jest.spyOn(ProcessTree.prototype, 'run').mockRejectedValue(error);
276
+ });
277
+
278
+ test('records the failure', async () => {
279
+ await subject().catch(() => {});
280
+
281
+ expect(recordEnd).toHaveBeenCalledWith(error);
282
+ });
283
+
284
+ test('propagates the error', async () => {
285
+ await expect(subject()).rejects.toBe(error);
286
+ });
287
+ });
288
+ });
289
+
229
290
  describe('with "scope"', () => {
230
291
  beforeEach(() => (args.scope = ['foo']));
231
292
 
@@ -0,0 +1,65 @@
1
+ import { getConfiguration } from '../../../utils';
2
+ import { BundlePackage } from '../bundle-package';
3
+ import { BundleVite } from '../bundle-vite';
4
+ import { BundleWebpack } from '../bundle-webpack';
5
+
6
+ jest.mock('../../../utils', () => ({
7
+ ...jest.requireActual('../../../utils'),
8
+ getConfiguration: jest.fn(() => ({})),
9
+ }));
10
+ jest.mock('../bundle-vite', () => ({ BundleVite: jest.fn(() => ({ execute: jest.fn() })) }));
11
+ jest.mock('../bundle-webpack', () => ({ BundleWebpack: jest.fn(() => ({ execute: jest.fn() })) }));
12
+
13
+ describe(`[startup] ${BundlePackage.name}`, () => {
14
+ let args: ConstructorParameters<typeof BundlePackage>[0];
15
+
16
+ const subject = () => new BundlePackage(args).execute();
17
+
18
+ beforeEach(() => {
19
+ jest.clearAllMocks();
20
+ args = { exposedDependencies: true };
21
+ jest.mocked(getConfiguration).mockReturnValue({});
22
+ });
23
+
24
+ function itBundlesWithWebpack() {
25
+ test('bundles with webpack', async () => {
26
+ await subject();
27
+
28
+ expect(BundleWebpack).toHaveBeenCalledWith(args);
29
+ });
30
+ }
31
+
32
+ function itBundlesWithVite() {
33
+ test('bundles with vite', async () => {
34
+ await subject();
35
+
36
+ expect(BundleVite).toHaveBeenCalledWith(args);
37
+ });
38
+ }
39
+
40
+ itBundlesWithWebpack();
41
+
42
+ describe('with --bundler=vite', () => {
43
+ beforeEach(() => (args = { bundler: 'vite' }));
44
+
45
+ itBundlesWithVite();
46
+
47
+ describe('with cli.bundler set to webpack', () => {
48
+ beforeEach(() => jest.mocked(getConfiguration).mockReturnValue({ bundler: 'webpack' }));
49
+
50
+ itBundlesWithWebpack();
51
+ });
52
+ });
53
+
54
+ describe('with cli.bundler set to vite', () => {
55
+ beforeEach(() => jest.mocked(getConfiguration).mockReturnValue({ bundler: 'vite' }));
56
+
57
+ itBundlesWithVite();
58
+
59
+ describe('with --bundler=webpack', () => {
60
+ beforeEach(() => (args = { bundler: 'webpack' }));
61
+
62
+ itBundlesWithVite();
63
+ });
64
+ });
65
+ });
@@ -0,0 +1,154 @@
1
+ import { Attributes, telemetry } from '../../../telemetry';
2
+ import { exitWhenParentExits } from '../../../utils';
3
+ import { Command } from '../command';
4
+
5
+ jest.mock('../../../telemetry', () => ({
6
+ telemetry: {
7
+ info: jest.fn(),
8
+ error: jest.fn(),
9
+ flush: jest.fn(() => Promise.resolve()),
10
+ },
11
+ }));
12
+ jest.mock('../../../utils', () => ({
13
+ exitWhenParentExits: jest.fn(),
14
+ }));
15
+
16
+ class MockCommand extends Command {
17
+ execute() {
18
+ return Promise.resolve();
19
+ }
20
+
21
+ recordStart(command: string, attributes?: Attributes): void {
22
+ return super.recordStart(command, attributes);
23
+ }
24
+
25
+ recordEnd(error?: unknown): Promise<void> {
26
+ return super.recordEnd(error);
27
+ }
28
+ }
29
+
30
+ describe(`[startup] ${Command.name} entity`, () => {
31
+ const name: any = 'mock-command';
32
+ const commandName = 'build';
33
+ const attributes: Attributes = { bundler: 'vite' };
34
+
35
+ let args: any;
36
+
37
+ beforeEach(() => {
38
+ jest.clearAllMocks();
39
+ args = {};
40
+ });
41
+
42
+ describe('watchForParentExit', () => {
43
+ const subject = () => new MockCommand(args).watchForParentExit(name);
44
+
45
+ test('does not watch for the parent process to exit', () => {
46
+ subject();
47
+
48
+ expect(exitWhenParentExits).not.toHaveBeenCalled();
49
+ });
50
+
51
+ describe('with watch: true', () => {
52
+ beforeEach(() => (args = { watch: true }));
53
+
54
+ test('watches for the parent process to exit', () => {
55
+ subject();
56
+
57
+ expect(exitWhenParentExits).toHaveBeenCalledWith(name);
58
+ });
59
+ });
60
+ });
61
+
62
+ describe('recordStart', () => {
63
+ let command: MockCommand;
64
+
65
+ beforeEach(() => (command = new MockCommand(args)));
66
+
67
+ const subject = () => command.recordStart(commandName, attributes);
68
+
69
+ test('emits a command.started event with the attributes', () => {
70
+ subject();
71
+
72
+ expect(telemetry.info).toHaveBeenCalledWith(
73
+ 'command.started',
74
+ expect.objectContaining({
75
+ ...attributes,
76
+ command: commandName,
77
+ runId: expect.any(String),
78
+ })
79
+ );
80
+ });
81
+
82
+ describe('when a run is already active', () => {
83
+ beforeEach(() => command.recordStart(commandName, attributes));
84
+
85
+ test('does not start a second run', () => {
86
+ subject();
87
+
88
+ expect(telemetry.info).toHaveBeenCalledTimes(1);
89
+ });
90
+ });
91
+ });
92
+
93
+ describe('recordEnd', () => {
94
+ let error: unknown;
95
+ let command: MockCommand;
96
+
97
+ beforeEach(() => {
98
+ error = undefined;
99
+ command = new MockCommand(args);
100
+ });
101
+
102
+ const subject = () => command.recordEnd(error);
103
+
104
+ test('does not emit anything', async () => {
105
+ await subject();
106
+
107
+ expect(telemetry.info).not.toHaveBeenCalled();
108
+ expect(telemetry.error).not.toHaveBeenCalled();
109
+ });
110
+
111
+ describe('when called after recordStart', () => {
112
+ beforeEach(() => command.recordStart(commandName, attributes));
113
+
114
+ test('emits a command.finished event with a duration', async () => {
115
+ await subject();
116
+
117
+ expect(telemetry.info).toHaveBeenCalledWith(
118
+ 'command.finished',
119
+ expect.objectContaining({
120
+ ...attributes,
121
+ command: commandName,
122
+ runId: expect.any(String),
123
+ duration: expect.any(Number),
124
+ })
125
+ );
126
+ });
127
+
128
+ test('flushes pending telemetry', async () => {
129
+ await subject();
130
+
131
+ expect(telemetry.flush).toHaveBeenCalled();
132
+ });
133
+
134
+ describe('with an error', () => {
135
+ beforeEach(() => (error = new Error('boom')));
136
+
137
+ test('emits a command.finished error event', async () => {
138
+ await subject();
139
+
140
+ expect(telemetry.error).toHaveBeenCalledWith(
141
+ 'command.finished',
142
+ error,
143
+ expect.objectContaining({
144
+ ...attributes,
145
+ command: commandName,
146
+ runId: expect.any(String),
147
+ duration: expect.any(Number),
148
+ })
149
+ );
150
+ });
151
+ });
152
+ });
153
+ });
154
+ });
@@ -40,7 +40,7 @@ describe(`[startup] ${Init.name}`, () => {
40
40
  force: true,
41
41
  });
42
42
  expect(fs.rmSync).toHaveBeenCalledWith(path.join(cwd, '.github', 'CODEOWNERS'));
43
- expect(fs.rmSync).toHaveBeenCalledWith(path.join(cwd, 'package-lock.json'));
43
+ expect(fs.rmSync).not.toHaveBeenCalledWith(path.join(cwd, 'package-lock.json'));
44
44
  });
45
45
 
46
46
  describe('when cloning fails', () => {
@@ -1,83 +1,16 @@
1
- import { execSync } from 'child_process';
2
- import { getStartupVersion } from '../../../core';
3
- import { log } from '../../../utils';
4
1
  import { Install } from '../install';
5
2
  import { entry } from '../registry/install';
6
3
 
7
- jest.mock('child_process', () => ({ execSync: jest.fn() }));
8
- jest.mock('../../../core', () => ({
9
- ...jest.requireActual('../../../core'),
10
- getStartupVersion: jest.fn(),
11
- }));
12
- jest.mock('../../../utils', () => ({
13
- ...jest.requireActual('../../../utils'),
14
- log: { debug: jest.fn(), info: jest.fn() }, // suppress log output
15
- }));
16
-
17
4
  describe(`${Install.name}`, () => {
18
- const startupVersion = '1.2.3';
19
- let args: ConstructorParameters<typeof Install>[0];
20
-
21
- beforeEach(() => {
22
- args = {};
23
- jest.clearAllMocks();
24
- jest.mocked(getStartupVersion).mockReturnValue(startupVersion);
25
- });
26
-
27
- const subject = async () => new Install(args).execute();
5
+ const subject = async () => new Install({}).execute();
28
6
 
29
7
  test('allows running from global location', () => {
30
8
  expect(entry.allowRunFromGlobal).toBe(true);
31
9
  });
32
10
 
33
- test('runs install', async () => {
34
- await subject();
35
-
36
- expect(execSync).toHaveBeenCalledWith(`npx --yes @servicetitan/install`, {
37
- stdio: 'inherit',
38
- });
39
- });
40
-
41
- const keys = ['fix', 'quiet', 'token'] satisfies (keyof typeof args)[];
42
- describe.each(keys)('with --%s', option => {
43
- beforeEach(() => (args[option] = true));
44
-
45
- test(`runs install with --${option}`, async () => {
46
- await subject();
47
-
48
- expect(execSync).toHaveBeenCalledWith(
49
- expect.stringContaining(`--${option}`),
50
- expect.anything()
51
- );
52
- });
53
- });
54
-
55
- describe('with --no-token', () => {
56
- beforeEach(() => (args.token = false));
57
-
58
- test('runs install with --no-token', async () => {
59
- await subject();
60
-
61
- expect(execSync).toHaveBeenCalledWith(
62
- expect.stringContaining('--no-token'),
63
- expect.anything()
64
- );
65
- });
66
- });
67
-
68
- test('logs progress', async () => {
69
- await subject();
70
-
71
- expect(log.info).toHaveBeenCalledWith(`startup cli v${startupVersion}`);
72
- });
73
-
74
- describe('with --quiet', () => {
75
- beforeEach(() => (args = { quiet: true }));
76
-
77
- test('does not log progress', async () => {
78
- await subject();
79
-
80
- expect(log.info).not.toHaveBeenCalled();
81
- });
11
+ test('throws guidance pointing to @servicetitan/install', async () => {
12
+ await expect(subject()).rejects.toThrow(
13
+ 'The `startup install` command has been removed. Run `npx --yes @servicetitan/install` directly instead.'
14
+ );
82
15
  });
83
16
  });
@@ -83,6 +83,14 @@ describe(`[startup] ${MfeCheck.name}`, () => {
83
83
  });
84
84
  }
85
85
 
86
+ function itReportsCompatibleLightBundle() {
87
+ test('outputs human-readable compatible message', async () => {
88
+ await subject();
89
+
90
+ expect(utils.log.info).toHaveBeenCalledWith('Compatible: light bundle can be used');
91
+ });
92
+ }
93
+
86
94
  test('allows running from global location', () => {
87
95
  expect(entry.allowRunFromGlobal).toBe(true);
88
96
  });
@@ -97,11 +105,7 @@ describe(`[startup] ${MfeCheck.name}`, () => {
97
105
  });
98
106
  });
99
107
 
100
- test('outputs human-readable compatible message', async () => {
101
- await subject();
102
-
103
- expect(utils.log.info).toHaveBeenCalledWith('Compatible: light bundle can be used');
104
- });
108
+ itReportsCompatibleLightBundle();
105
109
 
106
110
  test('does not set exit code', async () => {
107
111
  await subject();
@@ -131,6 +135,23 @@ describe(`[startup] ${MfeCheck.name}`, () => {
131
135
  });
132
136
  });
133
137
  });
138
+
139
+ describe('when host enables expose-shared-dependencies at the top level of cli', () => {
140
+ beforeEach(() => {
141
+ vol.fromJSON({
142
+ '/path/to/host/package.json': JSON.stringify({
143
+ name: 'host-app',
144
+ dependencies: mockMetadata.dependencies,
145
+ cli: {
146
+ 'expose-shared-dependencies': true,
147
+ 'shared-dependencies': mockMetadata.sharedDependencies,
148
+ },
149
+ }),
150
+ });
151
+ });
152
+
153
+ itReportsCompatibleLightBundle();
154
+ });
134
155
  });
135
156
 
136
157
  describe('when incompatible', () => {
@@ -1,9 +1,10 @@
1
- import { log } from '../../../utils';
1
+ import { exitWhenParentExits, log } from '../../../utils';
2
2
  import { SwcCompilePackage, TscCompile, TscCompilePackage } from '../../tasks';
3
3
  import { RunTask } from '../run-task';
4
4
 
5
5
  jest.mock('../../../utils', () => ({
6
6
  ...jest.requireActual('../../../utils'),
7
+ exitWhenParentExits: jest.fn(),
7
8
  log: { error: jest.fn(), text: jest.fn() },
8
9
  }));
9
10
  jest.mock('../../tasks/swc-compile-package');
@@ -34,9 +35,27 @@ describe(`[startup] ${RunTask.name}`, () => {
34
35
 
35
36
  expect(jest.mocked(task).mock.instances[0].execute).toHaveBeenCalled();
36
37
  });
38
+
39
+ test(`watches ${task.name} for the parent process to exit`, async () => {
40
+ await subject();
41
+
42
+ expect(jest.mocked(task).mock.instances[0].watchForParentExit).toHaveBeenCalled();
43
+ });
37
44
  })
38
45
  );
39
46
 
47
+ describe('watchForParentExit', () => {
48
+ beforeEach(() => (args = {}));
49
+
50
+ const subject = () => new RunTask(args).watchForParentExit();
51
+
52
+ test('does not watch for the parent process to exit', () => {
53
+ subject();
54
+
55
+ expect(exitWhenParentExits).not.toHaveBeenCalled();
56
+ });
57
+ });
58
+
40
59
  describe('with empty args', () => {
41
60
  beforeEach(() => (args = {}));
42
61