@servicetitan/startup 35.2.0-far-1776.1 → 35.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 (373) hide show
  1. package/dist/cli/commands/build.d.ts +2 -70
  2. package/dist/cli/commands/build.d.ts.map +1 -1
  3. package/dist/cli/commands/build.js +0 -49
  4. package/dist/cli/commands/build.js.map +1 -1
  5. package/dist/cli/commands/bundle-package.d.ts +2 -54
  6. package/dist/cli/commands/bundle-package.d.ts.map +1 -1
  7. package/dist/cli/commands/bundle-package.js +0 -40
  8. package/dist/cli/commands/bundle-package.js.map +1 -1
  9. package/dist/cli/commands/clean.d.ts +2 -3
  10. package/dist/cli/commands/clean.d.ts.map +1 -1
  11. package/dist/cli/commands/clean.js +0 -15
  12. package/dist/cli/commands/clean.js.map +1 -1
  13. package/dist/cli/commands/convert-eslint-config.d.ts +2 -3
  14. package/dist/cli/commands/convert-eslint-config.d.ts.map +1 -1
  15. package/dist/cli/commands/convert-eslint-config.js +0 -2
  16. package/dist/cli/commands/convert-eslint-config.js.map +1 -1
  17. package/dist/cli/commands/eslint.d.ts +2 -34
  18. package/dist/cli/commands/eslint.d.ts.map +1 -1
  19. package/dist/cli/commands/eslint.js +0 -30
  20. package/dist/cli/commands/eslint.js.map +1 -1
  21. package/dist/cli/commands/init.d.ts +2 -16
  22. package/dist/cli/commands/init.d.ts.map +1 -1
  23. package/dist/cli/commands/init.js +0 -22
  24. package/dist/cli/commands/init.js.map +1 -1
  25. package/dist/cli/commands/install.d.ts +2 -36
  26. package/dist/cli/commands/install.d.ts.map +1 -1
  27. package/dist/cli/commands/install.js +0 -32
  28. package/dist/cli/commands/install.js.map +1 -1
  29. package/dist/cli/commands/kendo-ui-license.d.ts +2 -3
  30. package/dist/cli/commands/kendo-ui-license.d.ts.map +1 -1
  31. package/dist/cli/commands/kendo-ui-license.js +0 -15
  32. package/dist/cli/commands/kendo-ui-license.js.map +1 -1
  33. package/dist/cli/commands/lint.d.ts +2 -70
  34. package/dist/cli/commands/lint.d.ts.map +1 -1
  35. package/dist/cli/commands/lint.js +0 -49
  36. package/dist/cli/commands/lint.js.map +1 -1
  37. package/dist/cli/commands/mfe-check.d.ts +2 -44
  38. package/dist/cli/commands/mfe-check.d.ts.map +1 -1
  39. package/dist/cli/commands/mfe-check.js +0 -36
  40. package/dist/cli/commands/mfe-check.js.map +1 -1
  41. package/dist/cli/commands/mfe-generate-metadata.d.ts +2 -16
  42. package/dist/cli/commands/mfe-generate-metadata.d.ts.map +1 -1
  43. package/dist/cli/commands/mfe-generate-metadata.js +1 -28
  44. package/dist/cli/commands/mfe-generate-metadata.js.map +1 -1
  45. package/dist/cli/commands/mfe-list.d.ts +2 -70
  46. package/dist/cli/commands/mfe-list.d.ts.map +1 -1
  47. package/dist/cli/commands/mfe-list.js +0 -49
  48. package/dist/cli/commands/mfe-list.js.map +1 -1
  49. package/dist/cli/commands/mfe-package-clean.d.ts +2 -53
  50. package/dist/cli/commands/mfe-package-clean.d.ts.map +1 -1
  51. package/dist/cli/commands/mfe-package-clean.js +3 -51
  52. package/dist/cli/commands/mfe-package-clean.js.map +1 -1
  53. package/dist/cli/commands/mfe-package-publish.d.ts +2 -91
  54. package/dist/cli/commands/mfe-package-publish.d.ts.map +1 -1
  55. package/dist/cli/commands/mfe-package-publish.js +3 -70
  56. package/dist/cli/commands/mfe-package-publish.js.map +1 -1
  57. package/dist/cli/commands/mfe-package-rollback.d.ts +2 -43
  58. package/dist/cli/commands/mfe-package-rollback.d.ts.map +1 -1
  59. package/dist/cli/commands/mfe-package-rollback.js +3 -46
  60. package/dist/cli/commands/mfe-package-rollback.js.map +1 -1
  61. package/dist/cli/commands/mfe-publish.d.ts +9 -47
  62. package/dist/cli/commands/mfe-publish.d.ts.map +1 -1
  63. package/dist/cli/commands/mfe-publish.js +0 -69
  64. package/dist/cli/commands/mfe-publish.js.map +1 -1
  65. package/dist/cli/commands/mfe-purge-cache.d.ts +2 -46
  66. package/dist/cli/commands/mfe-purge-cache.d.ts.map +1 -1
  67. package/dist/cli/commands/mfe-purge-cache.js +0 -36
  68. package/dist/cli/commands/mfe-purge-cache.js.map +1 -1
  69. package/dist/cli/commands/prepare-package.d.ts +2 -14
  70. package/dist/cli/commands/prepare-package.d.ts.map +1 -1
  71. package/dist/cli/commands/prepare-package.js +0 -20
  72. package/dist/cli/commands/prepare-package.js.map +1 -1
  73. package/dist/cli/commands/registry/build.d.ts +38 -0
  74. package/dist/cli/commands/registry/build.d.ts.map +1 -0
  75. package/dist/cli/commands/registry/build.js +50 -0
  76. package/dist/cli/commands/registry/build.js.map +1 -0
  77. package/dist/cli/commands/registry/bundle-package.d.ts +29 -0
  78. package/dist/cli/commands/registry/bundle-package.d.ts.map +1 -0
  79. package/dist/cli/commands/registry/bundle-package.js +41 -0
  80. package/dist/cli/commands/registry/bundle-package.js.map +1 -0
  81. package/dist/cli/commands/registry/clean.d.ts +5 -0
  82. package/dist/cli/commands/registry/clean.d.ts.map +1 -0
  83. package/dist/cli/commands/registry/clean.js +17 -0
  84. package/dist/cli/commands/registry/clean.js.map +1 -0
  85. package/dist/cli/commands/registry/command-registry.d.ts +509 -0
  86. package/dist/cli/commands/registry/command-registry.d.ts.map +1 -0
  87. package/dist/cli/commands/registry/command-registry.js +138 -0
  88. package/dist/cli/commands/registry/command-registry.js.map +1 -0
  89. package/dist/cli/commands/registry/convert-eslint-config.d.ts +5 -0
  90. package/dist/cli/commands/registry/convert-eslint-config.d.ts.map +1 -0
  91. package/dist/cli/commands/registry/convert-eslint-config.js +17 -0
  92. package/dist/cli/commands/registry/convert-eslint-config.js.map +1 -0
  93. package/dist/cli/commands/registry/define-entry.d.ts +7 -0
  94. package/dist/cli/commands/registry/define-entry.d.ts.map +1 -0
  95. package/dist/cli/commands/registry/define-entry.js +15 -0
  96. package/dist/cli/commands/registry/define-entry.js.map +1 -0
  97. package/dist/cli/commands/registry/eslint.d.ts +19 -0
  98. package/dist/cli/commands/registry/eslint.d.ts.map +1 -0
  99. package/dist/cli/commands/registry/eslint.js +31 -0
  100. package/dist/cli/commands/registry/eslint.js.map +1 -0
  101. package/dist/cli/commands/registry/index.d.ts +3 -0
  102. package/dist/cli/commands/registry/index.d.ts.map +1 -0
  103. package/dist/cli/commands/registry/index.js +13 -0
  104. package/dist/cli/commands/registry/index.js.map +1 -0
  105. package/dist/cli/commands/registry/init.d.ts +11 -0
  106. package/dist/cli/commands/registry/init.d.ts.map +1 -0
  107. package/dist/cli/commands/registry/init.js +23 -0
  108. package/dist/cli/commands/registry/init.js.map +1 -0
  109. package/dist/cli/commands/registry/install.d.ts +21 -0
  110. package/dist/cli/commands/registry/install.d.ts.map +1 -0
  111. package/dist/cli/commands/registry/install.js +33 -0
  112. package/dist/cli/commands/registry/install.js.map +1 -0
  113. package/dist/cli/commands/registry/kendo-ui-license.d.ts +5 -0
  114. package/dist/cli/commands/registry/kendo-ui-license.d.ts.map +1 -0
  115. package/dist/cli/commands/registry/kendo-ui-license.js +17 -0
  116. package/dist/cli/commands/registry/kendo-ui-license.js.map +1 -0
  117. package/dist/cli/commands/registry/lint.d.ts +38 -0
  118. package/dist/cli/commands/registry/lint.d.ts.map +1 -0
  119. package/dist/cli/commands/registry/lint.js +50 -0
  120. package/dist/cli/commands/registry/lint.js.map +1 -0
  121. package/dist/cli/commands/registry/mfe-check.d.ts +25 -0
  122. package/dist/cli/commands/registry/mfe-check.d.ts.map +1 -0
  123. package/dist/cli/commands/registry/mfe-check.js +37 -0
  124. package/dist/cli/commands/registry/mfe-check.js.map +1 -0
  125. package/dist/cli/commands/registry/mfe-generate-metadata.d.ts +11 -0
  126. package/dist/cli/commands/registry/mfe-generate-metadata.d.ts.map +1 -0
  127. package/dist/cli/commands/registry/mfe-generate-metadata.js +23 -0
  128. package/dist/cli/commands/registry/mfe-generate-metadata.js.map +1 -0
  129. package/dist/cli/commands/registry/mfe-list.d.ts +38 -0
  130. package/dist/cli/commands/registry/mfe-list.d.ts.map +1 -0
  131. package/dist/cli/commands/registry/mfe-list.js +50 -0
  132. package/dist/cli/commands/registry/mfe-list.js.map +1 -0
  133. package/dist/cli/commands/registry/mfe-package-clean.d.ts +29 -0
  134. package/dist/cli/commands/registry/mfe-package-clean.d.ts.map +1 -0
  135. package/dist/cli/commands/registry/mfe-package-clean.js +41 -0
  136. package/dist/cli/commands/registry/mfe-package-clean.js.map +1 -0
  137. package/dist/cli/commands/registry/mfe-package-publish.d.ts +48 -0
  138. package/dist/cli/commands/registry/mfe-package-publish.d.ts.map +1 -0
  139. package/dist/cli/commands/registry/mfe-package-publish.js +60 -0
  140. package/dist/cli/commands/registry/mfe-package-publish.js.map +1 -0
  141. package/dist/cli/commands/registry/mfe-package-rollback.d.ts +24 -0
  142. package/dist/cli/commands/registry/mfe-package-rollback.d.ts.map +1 -0
  143. package/dist/cli/commands/registry/mfe-package-rollback.js +36 -0
  144. package/dist/cli/commands/registry/mfe-package-rollback.js.map +1 -0
  145. package/dist/cli/commands/registry/mfe-publish.d.ts +24 -0
  146. package/dist/cli/commands/registry/mfe-publish.d.ts.map +1 -0
  147. package/dist/cli/commands/registry/mfe-publish.js +72 -0
  148. package/dist/cli/commands/registry/mfe-publish.js.map +1 -0
  149. package/dist/cli/commands/registry/mfe-purge-cache.d.ts +25 -0
  150. package/dist/cli/commands/registry/mfe-purge-cache.d.ts.map +1 -0
  151. package/dist/cli/commands/registry/mfe-purge-cache.js +37 -0
  152. package/dist/cli/commands/registry/mfe-purge-cache.js.map +1 -0
  153. package/dist/cli/commands/registry/prepare-package.d.ts +9 -0
  154. package/dist/cli/commands/registry/prepare-package.d.ts.map +1 -0
  155. package/dist/cli/commands/registry/prepare-package.js +21 -0
  156. package/dist/cli/commands/registry/prepare-package.js.map +1 -0
  157. package/dist/cli/commands/registry/review.d.ts +16 -0
  158. package/dist/cli/commands/registry/review.d.ts.map +1 -0
  159. package/dist/cli/commands/registry/review.js +28 -0
  160. package/dist/cli/commands/registry/review.js.map +1 -0
  161. package/dist/cli/commands/registry/start.d.ts +30 -0
  162. package/dist/cli/commands/registry/start.d.ts.map +1 -0
  163. package/dist/cli/commands/registry/start.js +42 -0
  164. package/dist/cli/commands/registry/start.js.map +1 -0
  165. package/dist/cli/commands/registry/stylelint.d.ts +19 -0
  166. package/dist/cli/commands/registry/stylelint.d.ts.map +1 -0
  167. package/dist/cli/commands/registry/stylelint.js +31 -0
  168. package/dist/cli/commands/registry/stylelint.js.map +1 -0
  169. package/dist/cli/commands/registry/styles-check.d.ts +2 -0
  170. package/dist/cli/commands/registry/styles-check.d.ts.map +1 -0
  171. package/dist/cli/commands/registry/styles-check.js +14 -0
  172. package/dist/cli/commands/registry/styles-check.js.map +1 -0
  173. package/dist/cli/commands/registry/task.d.ts +19 -0
  174. package/dist/cli/commands/registry/task.d.ts.map +1 -0
  175. package/dist/cli/commands/registry/task.js +31 -0
  176. package/dist/cli/commands/registry/task.js.map +1 -0
  177. package/dist/cli/commands/registry/test-command.d.ts +22 -0
  178. package/dist/cli/commands/registry/test-command.d.ts.map +1 -0
  179. package/dist/cli/commands/registry/test-command.js +38 -0
  180. package/dist/cli/commands/registry/test-command.js.map +1 -0
  181. package/dist/cli/commands/registry/upload-sourcemaps.d.ts +15 -0
  182. package/dist/cli/commands/registry/upload-sourcemaps.d.ts.map +1 -0
  183. package/dist/cli/commands/registry/upload-sourcemaps.js +27 -0
  184. package/dist/cli/commands/registry/upload-sourcemaps.js.map +1 -0
  185. package/dist/cli/commands/review/review.d.ts +2 -26
  186. package/dist/cli/commands/review/review.d.ts.map +1 -1
  187. package/dist/cli/commands/review/review.js +0 -14
  188. package/dist/cli/commands/review/review.js.map +1 -1
  189. package/dist/cli/commands/review/rules/require-compatible-launch-darkly-sdk.d.ts.map +1 -1
  190. package/dist/cli/commands/review/rules/require-compatible-launch-darkly-sdk.js +6 -6
  191. package/dist/cli/commands/review/rules/require-compatible-launch-darkly-sdk.js.map +1 -1
  192. package/dist/cli/commands/review/types.d.ts +5 -2
  193. package/dist/cli/commands/review/types.d.ts.map +1 -1
  194. package/dist/cli/commands/review/types.js.map +1 -1
  195. package/dist/cli/commands/run-task.d.ts +2 -34
  196. package/dist/cli/commands/run-task.d.ts.map +1 -1
  197. package/dist/cli/commands/run-task.js +0 -30
  198. package/dist/cli/commands/run-task.js.map +1 -1
  199. package/dist/cli/commands/start.d.ts +2 -54
  200. package/dist/cli/commands/start.d.ts.map +1 -1
  201. package/dist/cli/commands/start.js +0 -41
  202. package/dist/cli/commands/start.js.map +1 -1
  203. package/dist/cli/commands/stylelint.d.ts +2 -34
  204. package/dist/cli/commands/stylelint.d.ts.map +1 -1
  205. package/dist/cli/commands/stylelint.js +0 -30
  206. package/dist/cli/commands/stylelint.js.map +1 -1
  207. package/dist/cli/commands/styles-check.d.ts +2 -1
  208. package/dist/cli/commands/styles-check.d.ts.map +1 -1
  209. package/dist/cli/commands/styles-check.js.map +1 -1
  210. package/dist/cli/commands/test/tests.d.ts +2 -38
  211. package/dist/cli/commands/test/tests.d.ts.map +1 -1
  212. package/dist/cli/commands/test/tests.js +0 -36
  213. package/dist/cli/commands/test/tests.js.map +1 -1
  214. package/dist/cli/commands/types.d.ts +9 -7
  215. package/dist/cli/commands/types.d.ts.map +1 -1
  216. package/dist/cli/commands/types.js +0 -4
  217. package/dist/cli/commands/types.js.map +1 -1
  218. package/dist/cli/commands/upload-sourcemaps.d.ts +2 -26
  219. package/dist/cli/commands/upload-sourcemaps.d.ts.map +1 -1
  220. package/dist/cli/commands/upload-sourcemaps.js +0 -26
  221. package/dist/cli/commands/upload-sourcemaps.js.map +1 -1
  222. package/dist/cli/index.js +17 -16
  223. package/dist/cli/index.js.map +1 -1
  224. package/dist/cli/tasks/swc-compile-package/swc-compile-package.d.ts.map +1 -1
  225. package/dist/cli/tasks/swc-compile-package/swc-compile-package.js +1 -7
  226. package/dist/cli/tasks/swc-compile-package/swc-compile-package.js.map +1 -1
  227. package/dist/cli/utils/bundle.js +1 -1
  228. package/dist/cli/utils/bundle.js.map +1 -1
  229. package/dist/cli/utils/check-startup-location.d.ts +2 -2
  230. package/dist/cli/utils/check-startup-location.d.ts.map +1 -1
  231. package/dist/cli/utils/check-startup-location.js +1 -2
  232. package/dist/cli/utils/check-startup-location.js.map +1 -1
  233. package/dist/cli/utils/set-node-options.d.ts +3 -3
  234. package/dist/cli/utils/set-node-options.d.ts.map +1 -1
  235. package/dist/cli/utils/set-node-options.js +1 -2
  236. package/dist/cli/utils/set-node-options.js.map +1 -1
  237. package/dist/utils/find-up.js +4 -4
  238. package/dist/utils/find-up.js.map +1 -1
  239. package/dist/utils/get-package-data.d.ts.map +1 -1
  240. package/dist/utils/get-package-data.js +1 -28
  241. package/dist/utils/get-package-data.js.map +1 -1
  242. package/dist/utils/index.d.ts +0 -3
  243. package/dist/utils/index.d.ts.map +1 -1
  244. package/dist/utils/index.js +0 -3
  245. package/dist/utils/index.js.map +1 -1
  246. package/dist/webpack/configs/cache-config.d.ts.map +1 -1
  247. package/dist/webpack/configs/cache-config.js +14 -1
  248. package/dist/webpack/configs/cache-config.js.map +1 -1
  249. package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.d.ts.map +1 -1
  250. package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.js +11 -1
  251. package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.js.map +1 -1
  252. package/dist/webpack/configs/utils/get-web-components-version.d.ts.map +1 -1
  253. package/dist/webpack/configs/utils/get-web-components-version.js +7 -5
  254. package/dist/webpack/configs/utils/get-web-components-version.js.map +1 -1
  255. package/package.json +12 -17
  256. package/src/cli/commands/__tests__/build.test.ts +2 -1
  257. package/src/cli/commands/__tests__/clean.test.ts +2 -1
  258. package/src/cli/commands/__tests__/convert-eslint-config.test.ts +2 -1
  259. package/src/cli/commands/__tests__/init.test.ts +4 -3
  260. package/src/cli/commands/__tests__/install.test.ts +2 -1
  261. package/src/cli/commands/__tests__/kendo-ui-license.test.ts +3 -2
  262. package/src/cli/commands/__tests__/lint.test.ts +3 -1
  263. package/src/cli/commands/__tests__/mfe-check.test.ts +2 -1
  264. package/src/cli/commands/__tests__/mfe-generate-metadata.test.ts +2 -14
  265. package/src/cli/commands/__tests__/mfe-list.test.ts +2 -1
  266. package/src/cli/commands/__tests__/mfe-publish.test.ts +8 -7
  267. package/src/cli/commands/__tests__/start.test.ts +2 -1
  268. package/src/cli/commands/build.ts +3 -16
  269. package/src/cli/commands/bundle-package.ts +3 -12
  270. package/src/cli/commands/clean.ts +2 -4
  271. package/src/cli/commands/convert-eslint-config.ts +2 -4
  272. package/src/cli/commands/eslint.ts +3 -10
  273. package/src/cli/commands/init.ts +3 -10
  274. package/src/cli/commands/install.ts +3 -12
  275. package/src/cli/commands/kendo-ui-license.ts +2 -4
  276. package/src/cli/commands/lint.ts +3 -15
  277. package/src/cli/commands/mfe-check.ts +3 -28
  278. package/src/cli/commands/mfe-generate-metadata.ts +4 -19
  279. package/src/cli/commands/mfe-list.ts +3 -23
  280. package/src/cli/commands/mfe-package-clean.ts +3 -27
  281. package/src/cli/commands/mfe-package-publish.ts +3 -46
  282. package/src/cli/commands/mfe-package-rollback.ts +3 -26
  283. package/src/cli/commands/mfe-publish.ts +11 -73
  284. package/src/cli/commands/mfe-purge-cache.ts +3 -27
  285. package/src/cli/commands/prepare-package.ts +3 -7
  286. package/src/cli/commands/registry/__tests__/command-registry.test.ts +13 -0
  287. package/src/cli/commands/registry/build.ts +16 -0
  288. package/src/cli/commands/registry/bundle-package.ts +13 -0
  289. package/src/cli/commands/registry/clean.ts +7 -0
  290. package/src/cli/commands/registry/command-registry.ts +98 -0
  291. package/src/cli/commands/registry/convert-eslint-config.ts +7 -0
  292. package/src/cli/commands/registry/define-entry.ts +11 -0
  293. package/src/cli/commands/registry/eslint.ts +12 -0
  294. package/src/cli/commands/registry/index.ts +2 -0
  295. package/src/cli/commands/registry/init.ts +10 -0
  296. package/src/cli/commands/registry/install.ts +12 -0
  297. package/src/cli/commands/registry/kendo-ui-license.ts +7 -0
  298. package/src/cli/commands/registry/lint.ts +17 -0
  299. package/src/cli/commands/registry/mfe-check.ts +28 -0
  300. package/src/cli/commands/registry/mfe-generate-metadata.ts +13 -0
  301. package/src/cli/commands/registry/mfe-list.ts +25 -0
  302. package/src/cli/commands/registry/mfe-package-clean.ts +27 -0
  303. package/src/cli/commands/registry/mfe-package-publish.ts +46 -0
  304. package/src/cli/commands/registry/mfe-package-rollback.ts +26 -0
  305. package/src/cli/commands/registry/mfe-publish.ts +55 -0
  306. package/src/cli/commands/registry/mfe-purge-cache.ts +27 -0
  307. package/src/cli/commands/registry/prepare-package.ts +8 -0
  308. package/src/cli/commands/registry/review.ts +11 -0
  309. package/src/cli/commands/registry/start.ts +14 -0
  310. package/src/cli/commands/registry/stylelint.ts +12 -0
  311. package/src/cli/commands/registry/styles-check.ts +4 -0
  312. package/src/cli/commands/registry/task.ts +12 -0
  313. package/src/cli/commands/registry/test-command.ts +19 -0
  314. package/src/cli/commands/registry/upload-sourcemaps.ts +14 -0
  315. package/src/cli/commands/review/__tests__/review.test.ts +2 -1
  316. package/src/cli/commands/review/review.ts +3 -11
  317. package/src/cli/commands/review/rules/require-compatible-launch-darkly-sdk.ts +7 -2
  318. package/src/cli/commands/review/types.ts +8 -3
  319. package/src/cli/commands/run-task.ts +3 -10
  320. package/src/cli/commands/start.ts +3 -14
  321. package/src/cli/commands/stylelint.ts +3 -10
  322. package/src/cli/commands/styles-check.ts +2 -1
  323. package/src/cli/commands/test/__tests__/tests.test.ts +2 -1
  324. package/src/cli/commands/test/tests.ts +3 -16
  325. package/src/cli/commands/types.ts +8 -6
  326. package/src/cli/commands/upload-sourcemaps.ts +3 -13
  327. package/src/cli/index.ts +21 -20
  328. package/src/cli/tasks/swc-compile-package/__tests__/swc-compile-package.test.ts +1 -8
  329. package/src/cli/tasks/swc-compile-package/swc-compile-package.ts +1 -11
  330. package/src/cli/utils/__tests__/bundle.test.ts +17 -0
  331. package/src/cli/utils/__tests__/check-startup-location.test.ts +5 -17
  332. package/src/cli/utils/__tests__/set-node-options.test.ts +5 -19
  333. package/src/cli/utils/bundle.ts +1 -1
  334. package/src/cli/utils/check-startup-location.ts +5 -3
  335. package/src/cli/utils/set-node-options.ts +3 -4
  336. package/src/utils/__tests__/get-package-data.test.ts +26 -97
  337. package/src/utils/find-up.ts +1 -1
  338. package/src/utils/get-package-data.ts +2 -27
  339. package/src/utils/index.ts +0 -3
  340. package/src/webpack/configs/cache-config.ts +10 -1
  341. package/src/webpack/configs/utils/__tests__/get-launchdarkly-sdk-version.test.ts +8 -20
  342. package/src/webpack/configs/utils/__tests__/get-web-components-version.test.ts +10 -30
  343. package/src/webpack/configs/utils/get-launchdarkly-sdk-version.ts +12 -2
  344. package/src/webpack/configs/utils/get-web-components-version.ts +5 -8
  345. package/dist/cli/commands/get-command.d.ts +0 -4
  346. package/dist/cli/commands/get-command.d.ts.map +0 -1
  347. package/dist/cli/commands/get-command.js +0 -68
  348. package/dist/cli/commands/get-command.js.map +0 -1
  349. package/dist/cli/commands/index.d.ts +0 -15
  350. package/dist/cli/commands/index.d.ts.map +0 -1
  351. package/dist/cli/commands/index.js +0 -32
  352. package/dist/cli/commands/index.js.map +0 -1
  353. package/dist/utils/find-package-lock.d.ts +0 -2
  354. package/dist/utils/find-package-lock.d.ts.map +0 -1
  355. package/dist/utils/find-package-lock.js +0 -26
  356. package/dist/utils/find-package-lock.js.map +0 -1
  357. package/dist/utils/get-package-version.d.ts +0 -2
  358. package/dist/utils/get-package-version.d.ts.map +0 -1
  359. package/dist/utils/get-package-version.js +0 -26
  360. package/dist/utils/get-package-version.js.map +0 -1
  361. package/dist/utils/resolve-package-lock-entry.d.ts +0 -11
  362. package/dist/utils/resolve-package-lock-entry.d.ts.map +0 -1
  363. package/dist/utils/resolve-package-lock-entry.js +0 -21
  364. package/dist/utils/resolve-package-lock-entry.js.map +0 -1
  365. package/src/cli/commands/__tests__/get-command.test.ts +0 -19
  366. package/src/cli/commands/get-command.ts +0 -59
  367. package/src/cli/commands/index.ts +0 -14
  368. package/src/utils/__tests__/find-package-lock.test.ts +0 -35
  369. package/src/utils/__tests__/get-package-version.test.ts +0 -129
  370. package/src/utils/__tests__/resolve-package-lock-entry.test.ts +0 -99
  371. package/src/utils/find-package-lock.ts +0 -10
  372. package/src/utils/get-package-version.ts +0 -21
  373. package/src/utils/resolve-package-lock-entry.ts +0 -25
@@ -0,0 +1,28 @@
1
+ import type { CommandEntry } from '../types';
2
+ import { defineEntry } from './define-entry';
3
+
4
+ export const entry = defineEntry({
5
+ allowRunFromGlobal: true,
6
+ description: 'Check MFE/host dependency compatibility',
7
+ options: {
8
+ metadata: {
9
+ description:
10
+ "Path to MFE's metadata.json file, can be generated with the 'mfe-generate-metadata' command",
11
+ string: true,
12
+ demandOption: true,
13
+ requiresArg: true,
14
+ },
15
+ hostPackageJson: {
16
+ description: 'Path(s) to host package.json files',
17
+ array: true,
18
+ string: true,
19
+ demandOption: true,
20
+ requiresArg: true,
21
+ },
22
+ json: {
23
+ description: 'Output results as JSON',
24
+ boolean: true,
25
+ default: false,
26
+ },
27
+ },
28
+ } satisfies CommandEntry);
@@ -0,0 +1,13 @@
1
+ import type { CommandEntry } from '../types';
2
+ import { defineEntry } from './define-entry';
3
+
4
+ export const entry = defineEntry({
5
+ allowRunFromGlobal: true,
6
+ description: 'Generate MFE metadata for compatibility checking',
7
+ options: {
8
+ output: {
9
+ description: 'Output file path (outputs to stdout if not specified)',
10
+ string: true,
11
+ },
12
+ },
13
+ } satisfies CommandEntry);
@@ -0,0 +1,25 @@
1
+ import type { CommandEntry } from '../types';
2
+ import { defineEntry } from './define-entry';
3
+
4
+ export const entry = defineEntry({
5
+ allowRunFromGlobal: true,
6
+ description: 'List published MFE packages',
7
+ options: {
8
+ /* eslint-disable @typescript-eslint/naming-convention */
9
+ _: { description: '[packageNames...]', array: true, string: true },
10
+ /* eslint-enable @typescript-eslint/naming-convention */
11
+ all: { boolean: true, description: 'List all published versions ' },
12
+ ignore: {
13
+ array: true,
14
+ string: true,
15
+ description: 'Exclude MFEs with names matching specified glob pattern ',
16
+ },
17
+ limit: {
18
+ number: true,
19
+ description: 'List only the specified number of published versions',
20
+ },
21
+ packageNames: { array: true, string: true, hidden: true },
22
+ registry: { string: true, hidden: true },
23
+ tagged: { boolean: true, description: 'List only tagged versions' },
24
+ },
25
+ } satisfies CommandEntry);
@@ -0,0 +1,27 @@
1
+ import type { CommandEntry } from '../types';
2
+ import { defineEntry } from './define-entry';
3
+
4
+ export const entry = defineEntry({
5
+ options: {
6
+ all: {
7
+ boolean: true,
8
+ description: 'Unpublish old versions from all branches',
9
+ defaultDescription: 'false',
10
+ },
11
+ branch: {
12
+ string: true,
13
+ description: 'Branch name of versions to unpublish',
14
+ defaultDescription: 'current git branch',
15
+ },
16
+ count: {
17
+ number: true,
18
+ description: 'Keep the specified number of old versions',
19
+ defaultDescription: '5',
20
+ },
21
+ dry: {
22
+ boolean: true,
23
+ description: 'Take no action and only log what would be unpublished',
24
+ },
25
+ registry: { string: true, hidden: true, description: 'Registry url' },
26
+ },
27
+ } satisfies CommandEntry);
@@ -0,0 +1,46 @@
1
+ import type { CommandEntry } from '../types';
2
+ import { defineEntry } from './define-entry';
3
+
4
+ export const entry = defineEntry({
5
+ options: {
6
+ branch: {
7
+ string: true,
8
+ description: 'Branch name to associate with published version',
9
+ defaultDescription: 'current git branch',
10
+ },
11
+ build: {
12
+ string: true,
13
+ description: 'Package version',
14
+ defaultDescription: '<branch_name>.<commit_hash>',
15
+ },
16
+ dry: {
17
+ boolean: true,
18
+ description: 'Take no action and only log what would be published',
19
+ },
20
+ force: {
21
+ boolean: true,
22
+ description: 'Force publishing from an unrecognized branch',
23
+ },
24
+ registry: { string: true, hidden: true, description: 'Registry url' },
25
+ trackHistory: {
26
+ boolean: true,
27
+ description: 'Tag the previous release, to support rollbacks',
28
+ defaultDescription: 'true',
29
+ hidden: true,
30
+ },
31
+ tag: {
32
+ string: true,
33
+ description: 'Tag to assign to published version',
34
+ },
35
+ uploadSourcemaps: {
36
+ boolean: true,
37
+ description: 'Upload source maps to Datadog?',
38
+ defaultDescription: 'true',
39
+ },
40
+ purgeCache: {
41
+ boolean: true,
42
+ description: 'Purge unpkg cache after publishing?',
43
+ defaultDescription: 'true',
44
+ },
45
+ },
46
+ } satisfies CommandEntry);
@@ -0,0 +1,26 @@
1
+ import type { CommandEntry } from '../types';
2
+ import { defineEntry } from './define-entry';
3
+
4
+ export const entry = defineEntry({
5
+ options: {
6
+ dry: {
7
+ boolean: true,
8
+ description: 'Take no action and only log what would be rolled back',
9
+ },
10
+ registry: {
11
+ string: true,
12
+ hidden: true,
13
+ description: 'Registry url',
14
+ },
15
+ tag: {
16
+ string: true,
17
+ description: 'The tag to rollback to its previous version',
18
+ required: true,
19
+ },
20
+ purgeCache: {
21
+ boolean: true,
22
+ description: 'Purge unpkg cache after rolling back?',
23
+ defaultDescription: 'true',
24
+ },
25
+ },
26
+ } satisfies CommandEntry);
@@ -0,0 +1,55 @@
1
+ import type { CommandEntry, CommandOptions } from '../types';
2
+ import { defineEntry } from './define-entry';
3
+ import { entry as mfePackageClean } from './mfe-package-clean';
4
+ import { entry as mfePackagePublish } from './mfe-package-publish';
5
+ import { entry as mfePackageRollback } from './mfe-package-rollback';
6
+
7
+ function publishOptions() {
8
+ return Object.entries(mfePackagePublish.options).reduce((result, [key, value]) => {
9
+ result[key] = { group: 'Publish Options:', ...value };
10
+ return result;
11
+ }, {} as CommandOptions);
12
+ }
13
+
14
+ function cleanOptions() {
15
+ // no-break space suffix prevents key collisions
16
+ return Object.entries(mfePackageClean.options).reduce((result, [key, value]) => {
17
+ result[`${key}\u00A0`] = { group: 'Clean Options:', ...value };
18
+ return result;
19
+ }, {} as CommandOptions);
20
+ }
21
+
22
+ function rollbackOptions() {
23
+ // double no-break space suffix prevents key collisions
24
+ return Object.entries(mfePackageRollback.options).reduce((result, [key, value]) => {
25
+ const optionProps = Object.fromEntries(
26
+ Object.entries(value).filter(([k]) => k !== 'required')
27
+ );
28
+ result[`${key}\u00A0\u00A0`] = { group: 'Rollback Options:', ...optionProps };
29
+ return result;
30
+ }, {} as CommandOptions);
31
+ }
32
+
33
+ export const entry = defineEntry({
34
+ description: 'Publish or unpublish MFE packages',
35
+ options: {
36
+ clean: { boolean: true, description: 'Unpublish old versions' },
37
+ concurrency: {
38
+ number: true,
39
+ description: 'Publish/unpublish the specified number of packages concurrently',
40
+ defaultDescription: '1',
41
+ },
42
+ rollback: {
43
+ boolean: true,
44
+ description: 'Rollback specified tag to the previous version',
45
+ },
46
+ scope: {
47
+ array: true,
48
+ string: true,
49
+ description: 'Publish/unpublish only the specified packages',
50
+ },
51
+ ...publishOptions(),
52
+ ...cleanOptions(),
53
+ ...rollbackOptions(),
54
+ },
55
+ } satisfies CommandEntry);
@@ -0,0 +1,27 @@
1
+ import type { CommandEntry } from '../types';
2
+ import { defineEntry } from './define-entry';
3
+
4
+ export const entry = defineEntry({
5
+ options: {
6
+ host: {
7
+ string: true,
8
+ description: 'Host URL to send purge requests to',
9
+ demandOption: true,
10
+ },
11
+ packageName: {
12
+ string: true,
13
+ description: 'Package name to purge',
14
+ demandOption: true,
15
+ },
16
+ tag: {
17
+ string: true,
18
+ description: 'Package tag to purge',
19
+ demandOption: true,
20
+ },
21
+ token: {
22
+ string: true,
23
+ description: 'X-Purge-Token header value',
24
+ defaultDescription: 'process.env.UNPKG_PURGE_TOKEN',
25
+ },
26
+ },
27
+ } satisfies CommandEntry);
@@ -0,0 +1,8 @@
1
+ import type { CommandEntry } from '../types';
2
+ import { defineEntry } from './define-entry';
3
+
4
+ export const entry = defineEntry({
5
+ options: {
6
+ watch: { boolean: true, hidden: true },
7
+ },
8
+ } satisfies CommandEntry);
@@ -0,0 +1,11 @@
1
+ import type { CommandEntry } from '../types';
2
+ import { defineEntry } from './define-entry';
3
+
4
+ export const entry = defineEntry({
5
+ allowRunFromGlobal: true,
6
+ description: 'Check project for configuration errors',
7
+ options: {
8
+ fix: { boolean: true, description: 'Fix detected problems' },
9
+ rule: { array: true, string: true, description: 'Limit checks to specified rule(s)' },
10
+ },
11
+ } satisfies CommandEntry);
@@ -0,0 +1,14 @@
1
+ import type { CommandEntry } from '../types';
2
+ import { defineEntry } from './define-entry';
3
+
4
+ export const entry = defineEntry({
5
+ description: 'Run project in development mode',
6
+ greedy: true,
7
+ options: {
8
+ codeCoverage: { boolean: true, description: 'Instrument code for coverage analysis?' },
9
+ config: { string: true, hidden: true, description: 'Use specified configuration' },
10
+ ignore: { array: true, string: true, description: 'Packages to skip' },
11
+ scope: { array: true, string: true, description: 'Packages to run and watch' },
12
+ useTsc: { boolean: true, description: 'Use tsc to compile packages?' },
13
+ },
14
+ } satisfies CommandEntry);
@@ -0,0 +1,12 @@
1
+ import type { CommandEntry } from '../types';
2
+ import { defineEntry } from './define-entry';
3
+
4
+ export const entry = defineEntry({
5
+ options: {
6
+ /* eslint-disable @typescript-eslint/naming-convention */
7
+ _: { description: '[paths...]', array: true, string: true },
8
+ /* eslint-enable @typescript-eslint/naming-convention */
9
+ fix: { boolean: true, hidden: true },
10
+ paths: { array: true, string: true, hidden: true },
11
+ },
12
+ } satisfies CommandEntry);
@@ -0,0 +1,4 @@
1
+ import type { CommandEntry } from '../types';
2
+ import { defineEntry } from './define-entry';
3
+
4
+ export const entry = defineEntry({} satisfies CommandEntry);
@@ -0,0 +1,12 @@
1
+ import type { CommandEntry } from '../types';
2
+ import { defineEntry } from './define-entry';
3
+
4
+ export const entry = defineEntry({
5
+ options: {
6
+ /* eslint-disable @typescript-eslint/naming-convention */
7
+ _: { description: '<taskName> [taskArgs...]', array: true, string: true },
8
+ /* eslint-enable @typescript-eslint/naming-convention */
9
+ taskName: { string: true, hidden: true },
10
+ taskArgs: { array: true, string: true, hidden: true },
11
+ },
12
+ } satisfies CommandEntry);
@@ -0,0 +1,19 @@
1
+ // NOTE: Not named test.ts to avoid being picked up by Jest as a test suite.
2
+ import type { CommandEntry } from '../types';
3
+ import { defineEntry } from './define-entry';
4
+
5
+ export const entry = defineEntry({
6
+ description: 'Run tests',
7
+ greedy: true,
8
+ options: {
9
+ /* eslint-disable @typescript-eslint/naming-convention */
10
+ _: { description: '[runnerArgs...]', array: true, string: true },
11
+ /* eslint-enable @typescript-eslint/naming-convention */
12
+ runner: {
13
+ choices: ['jest', 'vitest'] as const,
14
+ description: 'Test runner',
15
+ defaultDescription: 'jest',
16
+ },
17
+ runnerArgs: { array: true, string: true, hidden: true },
18
+ },
19
+ } satisfies CommandEntry);
@@ -0,0 +1,14 @@
1
+ import type { CommandEntry } from '../types';
2
+ import { defineEntry } from './define-entry';
3
+
4
+ export const entry = defineEntry({
5
+ options: {
6
+ dry: { boolean: true, description: 'Dry run mode' },
7
+ releaseVersion: {
8
+ string: true,
9
+ demandOption: true,
10
+ requiresArg: true,
11
+ description: 'Release version',
12
+ },
13
+ },
14
+ } satisfies CommandEntry);
@@ -5,6 +5,7 @@ import path from 'path';
5
5
  import terminalLink from 'terminal-link';
6
6
  import type { ProjectPackage } from '../../../../utils';
7
7
  import { findPackages, getReviewConfiguration, log } from '../../../../utils';
8
+ import { entry } from '../../registry/review';
8
9
  import { expectCalls } from '../__mocks__';
9
10
  import { Review } from '../review';
10
11
  import { rules } from '../rules';
@@ -61,7 +62,7 @@ describe(`[startup] ${Review.name}`, () => {
61
62
  }
62
63
 
63
64
  test('allows running from global location', () => {
64
- expect(Review.allowRunFromGlobal).toBe(true);
65
+ expect(entry.allowRunFromGlobal).toBe(true);
65
66
  });
66
67
 
67
68
  describe('when not run from workspace root', () => {
@@ -9,7 +9,8 @@ import {
9
9
  readJsonSafe,
10
10
  toArray,
11
11
  } from '../../../utils';
12
- import { Command, CommandOptions } from '../types';
12
+ import type { entry } from '../registry/review';
13
+ import { Command } from '../types';
13
14
  import { rules } from './rules';
14
15
  import {
15
16
  ErrorSeverity,
@@ -32,16 +33,7 @@ import {
32
33
 
33
34
  const collator = new Intl.Collator();
34
35
 
35
- const options = {
36
- fix: { boolean: true, description: 'Fix detected problems' },
37
- rule: { array: true, string: true, description: 'Limit checks to specified rule(s)' },
38
- } satisfies CommandOptions;
39
-
40
- export class Review extends Command<typeof options> {
41
- static readonly allowRunFromGlobal = true;
42
- static readonly description = 'Check project for configuration errors';
43
- static readonly options = options;
44
-
36
+ export class Review extends Command<typeof entry> {
45
37
  private readonly severityToLabel: Record<ErrorSeverity, string> = {
46
38
  [ErrorSeverity.warning]: chalk.yellow('warning'),
47
39
  [ErrorSeverity.error]: chalk.red('error'),
@@ -1,7 +1,6 @@
1
1
  import chalk from 'chalk';
2
2
  import { execSync } from 'child_process';
3
3
  import { satisfies } from 'semver';
4
- import { resolvePackageLockEntry } from '../../../../utils';
5
4
  import { FixCategory, Package, PackageError, PackageRule, Project } from '../types';
6
5
  import { applyFilter, checkPackages, setVersion } from '../utils';
7
6
 
@@ -122,7 +121,13 @@ export class RequireCompatibleLaunchDarklySdk implements PackageRule {
122
121
  dependency: string;
123
122
  }) {
124
123
  const { packages } = this.#project.packageLock;
125
- return resolvePackageLockEntry(packages, dependency, packageName);
124
+ return (
125
+ (packageName
126
+ ? packages[`node_modules/${packageName}/node_modules/${dependency}`]
127
+ : undefined) ??
128
+ packages[`node_modules/${dependency}`] ??
129
+ {}
130
+ );
126
131
  }
127
132
 
128
133
  private getTargetJsClientSdkVersion(packageName?: string) {
@@ -1,5 +1,3 @@
1
- import { PackageLockPackages } from '../../../utils';
2
-
3
1
  export abstract class PackageRule {
4
2
  abstract get id(): string;
5
3
  abstract run(project: Project): PackageError | PackageError[] | undefined;
@@ -11,7 +9,14 @@ export interface Project {
11
9
  dependencies: Dependencies;
12
10
  // Only using this subset of package-lock.json
13
11
  packageLock: {
14
- packages: PackageLockPackages;
12
+ packages: Record<
13
+ string,
14
+ {
15
+ version: string;
16
+ dependencies?: Record<string, string>;
17
+ peerDependencies?: Record<string, string>;
18
+ }
19
+ >;
15
20
  location: string;
16
21
  };
17
22
  packages: Package[];
@@ -2,13 +2,8 @@
2
2
  import { log, logErrors } from '../../utils';
3
3
  import { SwcCompilePackage, TscCompile, TscCompilePackage } from '../tasks';
4
4
  import { Task } from '../tasks/task';
5
- import { Command, CommandOptions } from './types';
6
-
7
- const options = {
8
- _: { description: '<taskName> [taskArgs...]', array: true, string: true },
9
- taskName: { string: true, hidden: true },
10
- taskArgs: { array: true, string: true, hidden: true },
11
- } satisfies CommandOptions;
5
+ import type { entry } from './registry/task';
6
+ import { Command } from './types';
12
7
 
13
8
  const tasks: Record<string, new (args: { [key: string]: unknown }) => Task> = {
14
9
  'tsc-compile-package': TscCompilePackage,
@@ -16,9 +11,7 @@ const tasks: Record<string, new (args: { [key: string]: unknown }) => Task> = {
16
11
  'tsc-compile': TscCompile,
17
12
  };
18
13
 
19
- export class RunTask extends Command<typeof options> {
20
- static readonly options = options;
21
-
14
+ export class RunTask extends Command<typeof entry> {
22
15
  @logErrors
23
16
  async execute() {
24
17
  const { _ = [], taskName = this.args._?.[0], taskArgs = [], ...restOptions } = this.args;
@@ -8,15 +8,8 @@ import {
8
8
  typeCheck,
9
9
  watchStdout,
10
10
  } from '../utils';
11
- import { Command, CommandOptions } from './types';
12
-
13
- const options = {
14
- codeCoverage: { boolean: true, description: 'Instrument code for coverage analysis?' },
15
- config: { string: true, hidden: true, description: 'Use specified configuration' },
16
- ignore: { array: true, string: true, description: 'Packages to skip' },
17
- scope: { array: true, string: true, description: 'Packages to run and watch' },
18
- useTsc: { boolean: true, description: 'Use tsc to compile packages?' },
19
- } satisfies CommandOptions;
11
+ import type { entry } from './registry/start';
12
+ import { Command } from './types';
20
13
 
21
14
  enum StartProcesses {
22
15
  Precompile,
@@ -29,11 +22,7 @@ enum StartProcesses {
29
22
  BundlePackage,
30
23
  }
31
24
 
32
- export class Start extends Command<typeof options> {
33
- static readonly description = 'Run project in development mode';
34
- static readonly greedy = true;
35
- static readonly options = options;
36
-
25
+ export class Start extends Command<typeof entry> {
37
26
  @logErrors
38
27
  async execute() {
39
28
  checkArgs(this.args, { obsolete: ['--esbuild', '--experimental-bundlers'] });
@@ -1,17 +1,10 @@
1
1
  /* eslint-disable @typescript-eslint/naming-convention */
2
2
  import { logErrors } from '../../utils';
3
3
  import { stylelint } from '../utils/stylelint';
4
- import { Command, CommandOptions } from './types';
5
-
6
- const options = {
7
- _: { description: '[paths...]', array: true, string: true },
8
- fix: { boolean: true, hidden: true },
9
- paths: { array: true, string: true, hidden: true },
10
- } satisfies CommandOptions;
11
-
12
- export class Stylelint extends Command<typeof options> {
13
- static readonly options = options;
4
+ import type { entry } from './registry/stylelint';
5
+ import { Command } from './types';
14
6
 
7
+ export class Stylelint extends Command<typeof entry> {
15
8
  @logErrors
16
9
  async execute() {
17
10
  await stylelint({ fix: this.args.fix, paths: this.paths });
@@ -2,6 +2,7 @@ import fs from 'fs';
2
2
  import { glob } from 'glob';
3
3
  import path from 'path';
4
4
  import { getFolders, isBundle, isLegacy, isStyleCheckDisabled, log, logErrors } from '../../utils';
5
+ import type { entry } from './registry/styles-check';
5
6
  import { Command } from './types';
6
7
 
7
8
  const patterns = [
@@ -10,7 +11,7 @@ const patterns = [
10
11
  "@import '~@servicetitan/design-system/dist/system.min.css';",
11
12
  ];
12
13
 
13
- export class StylesCheck extends Command {
14
+ export class StylesCheck extends Command<typeof entry> {
14
15
  @logErrors
15
16
  async execute() {
16
17
  if (isLegacy() || !isBundle()) {
@@ -1,4 +1,5 @@
1
1
  import { getConfiguration } from '../../../../utils';
2
+ import { entry } from '../../registry/test-command';
2
3
  import { Jest, Vitest } from '../runners';
3
4
  import { Tests } from '../tests';
4
5
 
@@ -23,7 +24,7 @@ describe(`[startup] ${Tests.name}`, () => {
23
24
  const subject = async () => new Tests(args).execute();
24
25
 
25
26
  test('command is greedy', () => {
26
- expect(Tests.greedy).toBe(true);
27
+ expect(entry.greedy).toBe(true);
27
28
  });
28
29
 
29
30
  function itRunsJest() {
@@ -1,28 +1,15 @@
1
1
  /* eslint-disable @typescript-eslint/naming-convention */
2
2
  import { Config } from '@jest/types';
3
3
  import { getConfiguration, logErrors } from '../../../utils';
4
- import { Command, CommandOptions } from '../types';
4
+ import type { entry } from '../registry/test-command';
5
+ import { Command } from '../types';
5
6
  import { Jest, Vitest } from './runners';
6
7
 
7
- const options = {
8
- _: { description: '[runnerArgs...]', array: true, string: true },
9
- runner: {
10
- choices: ['jest', 'vitest'] as const,
11
- description: 'Test runner',
12
- defaultDescription: 'jest',
13
- },
14
- runnerArgs: { array: true, string: true, hidden: true },
15
- } satisfies CommandOptions;
16
-
17
8
  /**
18
9
  * This class is named "Tests" instead of "Test" because the corresponding
19
10
  * "test.ts" would be interpreted as a test file.
20
11
  */
21
- export class Tests extends Command<typeof options, Config.Argv> {
22
- static readonly description = 'Run tests';
23
- static readonly greedy = true;
24
- static readonly options = options;
25
-
12
+ export class Tests extends Command<typeof entry, Config.Argv> {
26
13
  @logErrors
27
14
  async execute() {
28
15
  const {
@@ -49,13 +49,15 @@ export type InferArgs<T extends CommandOptions, U = unknown> = Expand<
49
49
  > &
50
50
  U;
51
51
 
52
- export abstract class Command<T extends CommandOptions = CommandOptions, U = unknown> {
53
- static readonly allowRunFromGlobal?: boolean;
54
- static readonly description?: string;
55
- static readonly greedy?: boolean;
56
- static readonly options?: CommandOptions;
52
+ export interface CommandEntry {
53
+ description?: string;
54
+ greedy?: boolean;
55
+ allowRunFromGlobal?: boolean;
56
+ options?: CommandOptions;
57
+ }
57
58
 
58
- constructor(protected readonly args: InferArgs<T, U>) {}
59
+ export abstract class Command<T extends CommandEntry = CommandEntry, U = unknown> {
60
+ constructor(protected readonly args: InferArgs<NonNullable<T['options']>, U>) {}
59
61
 
60
62
  abstract execute(): Promise<void>;
61
63
  }
@@ -3,24 +3,14 @@ import { execSync } from 'child_process';
3
3
  import path from 'path';
4
4
  import { getTsConfig, isWebComponent, log, logErrors, readJson } from '../../utils';
5
5
  import { TSConfig } from '../utils';
6
- import { Command, CommandOptions } from './types';
7
-
8
- const options = {
9
- dry: { boolean: true, description: 'Dry run mode' },
10
- releaseVersion: {
11
- string: true,
12
- demandOption: true,
13
- requiresArg: true,
14
- description: 'Release version',
15
- },
16
- } satisfies CommandOptions;
6
+ import type { entry } from './registry/upload-sourcemaps';
7
+ import { Command } from './types';
17
8
 
18
9
  interface PackageJson {
19
10
  name: string;
20
11
  }
21
12
 
22
- export class UploadSourcemaps extends Command<typeof options> {
23
- static readonly options = options;
13
+ export class UploadSourcemaps extends Command<typeof entry> {
24
14
  #outDir?: string;
25
15
  #packageJson?: PackageJson;
26
16