@servicetitan/startup 35.2.0-far-1776.1 → 35.3.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 (398) 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/cypress/config/index.d.ts.map +1 -0
  238. package/dist/cypress/config/index.js.map +1 -0
  239. package/dist/{cypress-config → cypress/config}/webpack-config.d.ts +1 -1
  240. package/dist/cypress/config/webpack-config.d.ts.map +1 -0
  241. package/dist/{cypress-config → cypress/config}/webpack-config.js +4 -4
  242. package/dist/cypress/config/webpack-config.js.map +1 -0
  243. package/dist/cypress/types/index.d.ts +9 -0
  244. package/dist/cypress/types/index.d.ts.map +1 -0
  245. package/dist/cypress/types/index.js +7 -0
  246. package/dist/cypress/types/index.js.map +1 -0
  247. package/dist/utils/find-up.js +4 -4
  248. package/dist/utils/find-up.js.map +1 -1
  249. package/dist/utils/get-package-data.d.ts.map +1 -1
  250. package/dist/utils/get-package-data.js +1 -28
  251. package/dist/utils/get-package-data.js.map +1 -1
  252. package/dist/utils/index.d.ts +0 -3
  253. package/dist/utils/index.d.ts.map +1 -1
  254. package/dist/utils/index.js +0 -3
  255. package/dist/utils/index.js.map +1 -1
  256. package/dist/webpack/configs/cache-config.d.ts.map +1 -1
  257. package/dist/webpack/configs/cache-config.js +14 -1
  258. package/dist/webpack/configs/cache-config.js.map +1 -1
  259. package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.d.ts.map +1 -1
  260. package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.js +11 -1
  261. package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.js.map +1 -1
  262. package/dist/webpack/configs/utils/get-web-components-version.d.ts.map +1 -1
  263. package/dist/webpack/configs/utils/get-web-components-version.js +7 -5
  264. package/dist/webpack/configs/utils/get-web-components-version.js.map +1 -1
  265. package/package.json +22 -20
  266. package/src/cli/commands/__tests__/build.test.ts +2 -1
  267. package/src/cli/commands/__tests__/clean.test.ts +2 -1
  268. package/src/cli/commands/__tests__/convert-eslint-config.test.ts +2 -1
  269. package/src/cli/commands/__tests__/init.test.ts +4 -3
  270. package/src/cli/commands/__tests__/install.test.ts +2 -1
  271. package/src/cli/commands/__tests__/kendo-ui-license.test.ts +3 -2
  272. package/src/cli/commands/__tests__/lint.test.ts +3 -1
  273. package/src/cli/commands/__tests__/mfe-check.test.ts +2 -1
  274. package/src/cli/commands/__tests__/mfe-generate-metadata.test.ts +2 -14
  275. package/src/cli/commands/__tests__/mfe-list.test.ts +2 -1
  276. package/src/cli/commands/__tests__/mfe-publish.test.ts +8 -7
  277. package/src/cli/commands/{run-task.test.ts → __tests__/run-task.test.ts} +8 -8
  278. package/src/cli/commands/__tests__/start.test.ts +2 -1
  279. package/src/cli/commands/build.ts +3 -16
  280. package/src/cli/commands/bundle-package.ts +3 -12
  281. package/src/cli/commands/clean.ts +2 -4
  282. package/src/cli/commands/convert-eslint-config.ts +2 -4
  283. package/src/cli/commands/eslint.ts +3 -10
  284. package/src/cli/commands/init.ts +3 -10
  285. package/src/cli/commands/install.ts +3 -12
  286. package/src/cli/commands/kendo-ui-license.ts +2 -4
  287. package/src/cli/commands/lint.ts +3 -15
  288. package/src/cli/commands/mfe-check.ts +3 -28
  289. package/src/cli/commands/mfe-generate-metadata.ts +4 -19
  290. package/src/cli/commands/mfe-list.ts +3 -23
  291. package/src/cli/commands/mfe-package-clean.ts +3 -27
  292. package/src/cli/commands/mfe-package-publish.ts +3 -46
  293. package/src/cli/commands/mfe-package-rollback.ts +3 -26
  294. package/src/cli/commands/mfe-publish.ts +11 -73
  295. package/src/cli/commands/mfe-purge-cache.ts +3 -27
  296. package/src/cli/commands/prepare-package.ts +3 -7
  297. package/src/cli/commands/registry/__tests__/command-registry.test.ts +13 -0
  298. package/src/cli/commands/registry/build.ts +16 -0
  299. package/src/cli/commands/registry/bundle-package.ts +13 -0
  300. package/src/cli/commands/registry/clean.ts +7 -0
  301. package/src/cli/commands/registry/command-registry.ts +98 -0
  302. package/src/cli/commands/registry/convert-eslint-config.ts +7 -0
  303. package/src/cli/commands/registry/define-entry.ts +11 -0
  304. package/src/cli/commands/registry/eslint.ts +12 -0
  305. package/src/cli/commands/registry/index.ts +2 -0
  306. package/src/cli/commands/registry/init.ts +10 -0
  307. package/src/cli/commands/registry/install.ts +12 -0
  308. package/src/cli/commands/registry/kendo-ui-license.ts +7 -0
  309. package/src/cli/commands/registry/lint.ts +17 -0
  310. package/src/cli/commands/registry/mfe-check.ts +28 -0
  311. package/src/cli/commands/registry/mfe-generate-metadata.ts +13 -0
  312. package/src/cli/commands/registry/mfe-list.ts +25 -0
  313. package/src/cli/commands/registry/mfe-package-clean.ts +27 -0
  314. package/src/cli/commands/registry/mfe-package-publish.ts +46 -0
  315. package/src/cli/commands/registry/mfe-package-rollback.ts +26 -0
  316. package/src/cli/commands/registry/mfe-publish.ts +55 -0
  317. package/src/cli/commands/registry/mfe-purge-cache.ts +27 -0
  318. package/src/cli/commands/registry/prepare-package.ts +8 -0
  319. package/src/cli/commands/registry/review.ts +11 -0
  320. package/src/cli/commands/registry/start.ts +14 -0
  321. package/src/cli/commands/registry/stylelint.ts +12 -0
  322. package/src/cli/commands/registry/styles-check.ts +4 -0
  323. package/src/cli/commands/registry/task.ts +12 -0
  324. package/src/cli/commands/registry/test-command.ts +19 -0
  325. package/src/cli/commands/registry/upload-sourcemaps.ts +14 -0
  326. package/src/cli/commands/review/__tests__/review.test.ts +2 -1
  327. package/src/cli/commands/review/review.ts +3 -11
  328. package/src/cli/commands/review/rules/require-compatible-launch-darkly-sdk.ts +7 -2
  329. package/src/cli/commands/review/types.ts +8 -3
  330. package/src/cli/commands/run-task.ts +3 -10
  331. package/src/cli/commands/start.ts +3 -14
  332. package/src/cli/commands/stylelint.ts +3 -10
  333. package/src/cli/commands/styles-check.ts +2 -1
  334. package/src/cli/commands/test/__tests__/tests.test.ts +2 -1
  335. package/src/cli/commands/test/tests.ts +3 -16
  336. package/src/cli/commands/types.ts +8 -6
  337. package/src/cli/commands/upload-sourcemaps.ts +3 -13
  338. package/src/cli/index.ts +21 -20
  339. package/src/cli/tasks/swc-compile-package/__tests__/swc-compile-package.test.ts +1 -8
  340. package/src/cli/tasks/swc-compile-package/swc-compile-package.ts +1 -11
  341. package/src/cli/utils/__tests__/bundle.test.ts +17 -0
  342. package/src/cli/utils/__tests__/check-startup-location.test.ts +5 -17
  343. package/src/cli/utils/__tests__/set-node-options.test.ts +5 -19
  344. package/src/cli/utils/bundle.ts +1 -1
  345. package/src/cli/utils/check-startup-location.ts +5 -3
  346. package/src/cli/utils/set-node-options.ts +3 -4
  347. package/src/{cypress-config → cypress/config}/__tests__/webpack-config.test.ts +6 -6
  348. package/src/{cypress-config → cypress/config}/webpack-config.ts +4 -4
  349. package/src/cypress/types/index.ts +11 -0
  350. package/src/utils/__tests__/get-package-data.test.ts +26 -97
  351. package/src/utils/find-up.ts +1 -1
  352. package/src/utils/get-package-data.ts +2 -27
  353. package/src/utils/index.ts +0 -3
  354. package/src/webpack/configs/cache-config.ts +10 -1
  355. package/src/webpack/configs/utils/__tests__/get-launchdarkly-sdk-version.test.ts +8 -20
  356. package/src/webpack/configs/utils/__tests__/get-web-components-version.test.ts +10 -30
  357. package/src/webpack/configs/utils/get-launchdarkly-sdk-version.ts +12 -2
  358. package/src/webpack/configs/utils/get-web-components-version.ts +5 -8
  359. package/dist/cli/commands/get-command.d.ts +0 -4
  360. package/dist/cli/commands/get-command.d.ts.map +0 -1
  361. package/dist/cli/commands/get-command.js +0 -68
  362. package/dist/cli/commands/get-command.js.map +0 -1
  363. package/dist/cli/commands/index.d.ts +0 -15
  364. package/dist/cli/commands/index.d.ts.map +0 -1
  365. package/dist/cli/commands/index.js +0 -32
  366. package/dist/cli/commands/index.js.map +0 -1
  367. package/dist/cli/commands/run-task.test.d.ts +0 -2
  368. package/dist/cli/commands/run-task.test.d.ts.map +0 -1
  369. package/dist/cli/commands/run-task.test.js +0 -65
  370. package/dist/cli/commands/run-task.test.js.map +0 -1
  371. package/dist/cypress-config/index.d.ts.map +0 -1
  372. package/dist/cypress-config/index.js.map +0 -1
  373. package/dist/cypress-config/webpack-config.d.ts.map +0 -1
  374. package/dist/cypress-config/webpack-config.js.map +0 -1
  375. package/dist/utils/find-package-lock.d.ts +0 -2
  376. package/dist/utils/find-package-lock.d.ts.map +0 -1
  377. package/dist/utils/find-package-lock.js +0 -26
  378. package/dist/utils/find-package-lock.js.map +0 -1
  379. package/dist/utils/get-package-version.d.ts +0 -2
  380. package/dist/utils/get-package-version.d.ts.map +0 -1
  381. package/dist/utils/get-package-version.js +0 -26
  382. package/dist/utils/get-package-version.js.map +0 -1
  383. package/dist/utils/resolve-package-lock-entry.d.ts +0 -11
  384. package/dist/utils/resolve-package-lock-entry.d.ts.map +0 -1
  385. package/dist/utils/resolve-package-lock-entry.js +0 -21
  386. package/dist/utils/resolve-package-lock-entry.js.map +0 -1
  387. package/src/cli/commands/__tests__/get-command.test.ts +0 -19
  388. package/src/cli/commands/get-command.ts +0 -59
  389. package/src/cli/commands/index.ts +0 -14
  390. package/src/utils/__tests__/find-package-lock.test.ts +0 -35
  391. package/src/utils/__tests__/get-package-version.test.ts +0 -129
  392. package/src/utils/__tests__/resolve-package-lock-entry.test.ts +0 -99
  393. package/src/utils/find-package-lock.ts +0 -10
  394. package/src/utils/get-package-version.ts +0 -21
  395. package/src/utils/resolve-package-lock-entry.ts +0 -25
  396. /package/dist/{cypress-config → cypress/config}/index.d.ts +0 -0
  397. /package/dist/{cypress-config → cypress/config}/index.js +0 -0
  398. /package/src/{cypress-config → cypress/config}/index.ts +0 -0
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "findPackageLock", {
6
- enumerable: true,
7
- get: function() {
8
- return findPackageLock;
9
- }
10
- });
11
- const _nodefs = /*#__PURE__*/ _interop_require_default(require("node:fs"));
12
- const _nodepath = /*#__PURE__*/ _interop_require_default(require("node:path"));
13
- const _findup = require("./find-up");
14
- function _interop_require_default(obj) {
15
- return obj && obj.__esModule ? obj : {
16
- default: obj
17
- };
18
- }
19
- function findPackageLock() {
20
- return (0, _findup.findUp)((directory)=>{
21
- const lockFile = _nodepath.default.resolve(directory, 'package-lock.json');
22
- return _nodefs.default.existsSync(lockFile) ? lockFile : undefined;
23
- });
24
- }
25
-
26
- //# sourceMappingURL=find-package-lock.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/find-package-lock.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\nimport { findUp } from './find-up';\n\nexport function findPackageLock() {\n return findUp(directory => {\n const lockFile = path.resolve(directory, 'package-lock.json');\n return fs.existsSync(lockFile) ? lockFile : undefined;\n });\n}\n"],"names":["findPackageLock","findUp","directory","lockFile","path","resolve","fs","existsSync","undefined"],"mappings":";;;;+BAIgBA;;;eAAAA;;;+DAJD;iEACE;wBACM;;;;;;AAEhB,SAASA;IACZ,OAAOC,IAAAA,cAAM,EAACC,CAAAA;QACV,MAAMC,WAAWC,iBAAI,CAACC,OAAO,CAACH,WAAW;QACzC,OAAOI,eAAE,CAACC,UAAU,CAACJ,YAAYA,WAAWK;IAChD;AACJ"}
@@ -1,2 +0,0 @@
1
- export declare function getPackageVersion(packageName: string): string | undefined;
2
- //# sourceMappingURL=get-package-version.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-package-version.d.ts","sourceRoot":"","sources":["../../src/utils/get-package-version.ts"],"names":[],"mappings":"AAQA,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,sBAYpD"}
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "getPackageVersion", {
6
- enumerable: true,
7
- get: function() {
8
- return getPackageVersion;
9
- }
10
- });
11
- const _findpackagelock = require("./find-package-lock");
12
- const _readjson = require("./read-json");
13
- const _resolvepackagelockentry = require("./resolve-package-lock-entry");
14
- function getPackageVersion(packageName) {
15
- const lockFilePath = (0, _findpackagelock.findPackageLock)();
16
- if (!lockFilePath) {
17
- return undefined;
18
- }
19
- const lockFile = (0, _readjson.readJsonSafe)(lockFilePath);
20
- if (!lockFile) {
21
- return undefined;
22
- }
23
- return (0, _resolvepackagelockentry.resolvePackageLockEntry)(lockFile.packages, packageName).version;
24
- }
25
-
26
- //# sourceMappingURL=get-package-version.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/get-package-version.ts"],"sourcesContent":["import { findPackageLock } from './find-package-lock';\nimport { readJsonSafe } from './read-json';\nimport { PackageLockPackages, resolvePackageLockEntry } from './resolve-package-lock-entry';\n\ninterface PackageLock {\n packages: PackageLockPackages;\n}\n\nexport function getPackageVersion(packageName: string) {\n const lockFilePath = findPackageLock();\n if (!lockFilePath) {\n return undefined;\n }\n\n const lockFile = readJsonSafe<PackageLock>(lockFilePath);\n if (!lockFile) {\n return undefined;\n }\n\n return resolvePackageLockEntry(lockFile.packages, packageName).version;\n}\n"],"names":["getPackageVersion","packageName","lockFilePath","findPackageLock","undefined","lockFile","readJsonSafe","resolvePackageLockEntry","packages","version"],"mappings":";;;;+BAQgBA;;;eAAAA;;;iCARgB;0BACH;yCACgC;AAMtD,SAASA,kBAAkBC,WAAmB;IACjD,MAAMC,eAAeC,IAAAA,gCAAe;IACpC,IAAI,CAACD,cAAc;QACf,OAAOE;IACX;IAEA,MAAMC,WAAWC,IAAAA,sBAAY,EAAcJ;IAC3C,IAAI,CAACG,UAAU;QACX,OAAOD;IACX;IAEA,OAAOG,IAAAA,gDAAuB,EAACF,SAASG,QAAQ,EAAEP,aAAaQ,OAAO;AAC1E"}
@@ -1,11 +0,0 @@
1
- interface PackageLockEntry {
2
- version?: string;
3
- resolved?: string;
4
- link?: boolean;
5
- dependencies?: Record<string, string>;
6
- peerDependencies?: Record<string, string>;
7
- }
8
- export type PackageLockPackages = Record<string, PackageLockEntry>;
9
- export declare function resolvePackageLockEntry(packages: PackageLockPackages | undefined, packageName: string, scope?: string): PackageLockEntry;
10
- export {};
11
- //# sourceMappingURL=resolve-package-lock-entry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve-package-lock-entry.d.ts","sourceRoot":"","sources":["../../src/utils/resolve-package-lock-entry.ts"],"names":[],"mappings":"AAAA,UAAU,gBAAgB;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7C;AAED,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAEnE,wBAAgB,uBAAuB,CACnC,QAAQ,EAAE,mBAAmB,GAAG,SAAS,EACzC,WAAW,EAAE,MAAM,EACnB,KAAK,CAAC,EAAE,MAAM,oBAWjB"}
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "resolvePackageLockEntry", {
6
- enumerable: true,
7
- get: function() {
8
- return resolvePackageLockEntry;
9
- }
10
- });
11
- function resolvePackageLockEntry(packages, packageName, scope) {
12
- var _ref;
13
- const entry = (_ref = scope ? packages === null || packages === void 0 ? void 0 : packages[`node_modules/${scope}/node_modules/${packageName}`] : undefined) !== null && _ref !== void 0 ? _ref : packages === null || packages === void 0 ? void 0 : packages[`node_modules/${packageName}`];
14
- if ((entry === null || entry === void 0 ? void 0 : entry.link) && entry.resolved) {
15
- var _ref1;
16
- return (_ref1 = packages === null || packages === void 0 ? void 0 : packages[entry.resolved]) !== null && _ref1 !== void 0 ? _ref1 : {};
17
- }
18
- return entry !== null && entry !== void 0 ? entry : {};
19
- }
20
-
21
- //# sourceMappingURL=resolve-package-lock-entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/resolve-package-lock-entry.ts"],"sourcesContent":["interface PackageLockEntry {\n version?: string;\n resolved?: string;\n link?: boolean;\n dependencies?: Record<string, string>;\n peerDependencies?: Record<string, string>;\n}\n\nexport type PackageLockPackages = Record<string, PackageLockEntry>;\n\nexport function resolvePackageLockEntry(\n packages: PackageLockPackages | undefined,\n packageName: string,\n scope?: string\n) {\n const entry =\n (scope ? packages?.[`node_modules/${scope}/node_modules/${packageName}`] : undefined) ??\n packages?.[`node_modules/${packageName}`];\n\n if (entry?.link && entry.resolved) {\n return packages?.[entry.resolved] ?? {};\n }\n\n return entry ?? {};\n}\n"],"names":["resolvePackageLockEntry","packages","packageName","scope","entry","undefined","link","resolved"],"mappings":";;;;+BAUgBA;;;eAAAA;;;AAAT,SAASA,wBACZC,QAAyC,EACzCC,WAAmB,EACnBC,KAAc;QAGTA;IADL,MAAMC,SACDD,OAAAA,QAAQF,qBAAAA,+BAAAA,QAAU,CAAC,CAAC,aAAa,EAAEE,MAAM,cAAc,EAAED,aAAa,CAAC,GAAGG,uBAA1EF,kBAAAA,OACDF,qBAAAA,+BAAAA,QAAU,CAAC,CAAC,aAAa,EAAEC,aAAa,CAAC;IAE7C,IAAIE,CAAAA,kBAAAA,4BAAAA,MAAOE,IAAI,KAAIF,MAAMG,QAAQ,EAAE;;QAC/B,gBAAON,qBAAAA,+BAAAA,QAAU,CAACG,MAAMG,QAAQ,CAAC,yCAAI,CAAC;IAC1C;IAEA,OAAOH,kBAAAA,mBAAAA,QAAS,CAAC;AACrB"}
@@ -1,19 +0,0 @@
1
- /**
2
- * @jest-environment node
3
- */
4
- import { CommandName } from '../../../utils';
5
- import { getCommand } from '../get-command';
6
-
7
- describe(`${getCommand.name}`, () => {
8
- const subject = (name: CommandName) => getCommand(name);
9
-
10
- test('retrieves known commands', () => {
11
- Object.values(CommandName).forEach(name => {
12
- expect(subject(name)).toBeDefined();
13
- });
14
- });
15
-
16
- test('returns undefined when command is unknown', () => {
17
- expect(subject('foo' as CommandName)).toBeUndefined();
18
- });
19
- });
@@ -1,59 +0,0 @@
1
- import { CommandName } from '../../utils';
2
- import { Build } from './build';
3
- import { BundlePackage } from './bundle-package';
4
- import { Clean } from './clean';
5
- import { ConvertEslintConfig } from './convert-eslint-config';
6
- import { ESLintCommand } from './eslint';
7
- import { Init } from './init';
8
- import { Install } from './install';
9
- import { KendoUILicense } from './kendo-ui-license';
10
- import { Lint } from './lint';
11
- import { MfeCheck } from './mfe-check';
12
- import { MfeGenerateMetadata } from './mfe-generate-metadata';
13
- import { MFEList } from './mfe-list';
14
- import { MFEPackageClean } from './mfe-package-clean';
15
- import { MFEPackagePublish } from './mfe-package-publish';
16
- import { MFEPackageRollback } from './mfe-package-rollback';
17
- import { MFEPublish } from './mfe-publish';
18
- import { MFEPurgeCache } from './mfe-purge-cache';
19
- import { PreparePackage } from './prepare-package';
20
- import { Review } from './review';
21
- import { RunTask } from './run-task';
22
- import { Start } from './start';
23
- import { Stylelint } from './stylelint';
24
- import { StylesCheck } from './styles-check';
25
- import { Tests } from './test';
26
- import { Command, Newable } from './types';
27
- import { UploadSourcemaps } from './upload-sourcemaps';
28
-
29
- const commands: Record<CommandName, Newable<Command>> = {
30
- [CommandName.build]: Build,
31
- [CommandName['bundle-package']]: BundlePackage,
32
- [CommandName['convert-eslint-config']]: ConvertEslintConfig,
33
- [CommandName.clean]: Clean,
34
- [CommandName.eslint]: ESLintCommand,
35
- [CommandName.init]: Init,
36
- [CommandName.install]: Install,
37
- [CommandName['kendo-ui-license']]: KendoUILicense,
38
- [CommandName.lint]: Lint,
39
- [CommandName['mfe-check']]: MfeCheck,
40
- [CommandName['mfe-generate-metadata']]: MfeGenerateMetadata,
41
- [CommandName['mfe-list']]: MFEList,
42
- [CommandName['mfe-package-clean']]: MFEPackageClean,
43
- [CommandName['mfe-package-publish']]: MFEPackagePublish,
44
- [CommandName['mfe-package-rollback']]: MFEPackageRollback,
45
- [CommandName['mfe-publish']]: MFEPublish,
46
- [CommandName['mfe-purge-cache']]: MFEPurgeCache,
47
- [CommandName['prepare-package']]: PreparePackage,
48
- [CommandName.review]: Review,
49
- [CommandName.start]: Start,
50
- [CommandName.stylelint]: Stylelint,
51
- [CommandName['styles-check']]: StylesCheck,
52
- [CommandName.test]: Tests,
53
- [CommandName.task]: RunTask,
54
- [CommandName['upload-sourcemaps']]: UploadSourcemaps,
55
- };
56
-
57
- export function getCommand(name: CommandName): Newable<Command> | undefined {
58
- return commands[name];
59
- }
@@ -1,14 +0,0 @@
1
- export * from './build';
2
- export * from './bundle-package';
3
- export * from './eslint';
4
- export * from './get-command';
5
- export * from './init';
6
- export * from './install';
7
- export * from './kendo-ui-license';
8
- export * from './lint';
9
- export * from './mfe-publish';
10
- export * from './prepare-package';
11
- export * from './start';
12
- export * from './styles-check';
13
- export * from './test';
14
- export type * from './types';
@@ -1,35 +0,0 @@
1
- import { fs, vol } from 'memfs';
2
- import path from 'node:path';
3
- import { findPackageLock } from '../find-package-lock';
4
-
5
- jest.mock('fs', () => fs);
6
-
7
- describe(`[startup] ${findPackageLock.name}`, () => {
8
- afterEach(() => vol.reset());
9
-
10
- const subject = () => findPackageLock();
11
-
12
- describe('when package-lock.json exists in cwd', () => {
13
- beforeEach(() => {
14
- vol.fromJSON({ './package-lock.json': '{}' });
15
- });
16
-
17
- test('returns path', () => {
18
- expect(subject()).toBe(path.resolve('./package-lock.json'));
19
- });
20
- });
21
-
22
- describe('when package-lock.json exists in parent directory', () => {
23
- beforeEach(() => {
24
- vol.fromJSON({ '../package-lock.json': '{}' });
25
- });
26
-
27
- test('returns path', () => {
28
- expect(subject()).toBe(path.resolve('../package-lock.json'));
29
- });
30
- });
31
-
32
- test('returns undefined when no package-lock.json exists', () => {
33
- expect(subject()).toBeUndefined();
34
- });
35
- });
@@ -1,129 +0,0 @@
1
- import { fs, vol } from 'memfs';
2
- import { getPackageVersion } from '../get-package-version';
3
-
4
- jest.mock('fs', () => fs);
5
-
6
- describe(`[startup] ${getPackageVersion.name}`, () => {
7
- afterEach(() => vol.reset());
8
-
9
- const subject = (packageName: string) => getPackageVersion(packageName);
10
-
11
- beforeEach(() => {
12
- vol.fromJSON({
13
- './package-lock.json': JSON.stringify({
14
- packages: {
15
- 'node_modules/@servicetitan/web-components': { version: '1.2.3' },
16
- },
17
- }),
18
- });
19
- });
20
-
21
- test('returns version for a found package', () => {
22
- expect(subject('@servicetitan/web-components')).toBe('1.2.3');
23
- });
24
-
25
- describe('when package is not in lock file', () => {
26
- beforeEach(() => {
27
- vol.fromJSON({
28
- './package-lock.json': JSON.stringify({
29
- packages: {},
30
- }),
31
- });
32
- });
33
-
34
- test('returns undefined', () => {
35
- expect(subject('nonexistent-package')).toBeUndefined();
36
- });
37
- });
38
-
39
- describe('when package is a linked workspace package', () => {
40
- beforeEach(() => {
41
- vol.fromJSON({
42
- './package-lock.json': JSON.stringify({
43
- packages: {
44
- 'node_modules/@servicetitan/web-components': {
45
- resolved: 'packages/web-components',
46
- link: true,
47
- },
48
- 'packages/web-components': {
49
- version: '35.1.0',
50
- },
51
- },
52
- }),
53
- });
54
- });
55
-
56
- test('follows link to resolve version from source path', () => {
57
- expect(subject('@servicetitan/web-components')).toBe('35.1.0');
58
- });
59
- });
60
-
61
- describe('when entry has link but no resolved path', () => {
62
- beforeEach(() => {
63
- vol.fromJSON({
64
- './package-lock.json': JSON.stringify({
65
- packages: {
66
- 'node_modules/some-package': { link: true, version: '1.0.0' },
67
- },
68
- }),
69
- });
70
- });
71
-
72
- test('returns entry version', () => {
73
- expect(subject('some-package')).toBe('1.0.0');
74
- });
75
- });
76
-
77
- describe('when linked package resolved path does not exist in packages', () => {
78
- beforeEach(() => {
79
- vol.fromJSON({
80
- './package-lock.json': JSON.stringify({
81
- packages: {
82
- 'node_modules/some-package': {
83
- resolved: 'packages/some-package',
84
- link: true,
85
- },
86
- },
87
- }),
88
- });
89
- });
90
-
91
- test('returns undefined', () => {
92
- expect(subject('some-package')).toBeUndefined();
93
- });
94
- });
95
-
96
- describe('when lock file contains invalid JSON', () => {
97
- beforeEach(() => {
98
- vol.fromJSON({
99
- './package-lock.json': 'not valid json',
100
- });
101
- });
102
-
103
- test('returns undefined', () => {
104
- expect(subject('some-package')).toBeUndefined();
105
- });
106
- });
107
-
108
- describe('when lock file has no packages property', () => {
109
- beforeEach(() => {
110
- vol.fromJSON({
111
- './package-lock.json': JSON.stringify({}),
112
- });
113
- });
114
-
115
- test('returns undefined', () => {
116
- expect(subject('some-package')).toBeUndefined();
117
- });
118
- });
119
-
120
- describe('when package-lock.json does not exist', () => {
121
- beforeEach(() => {
122
- fs.rmSync('package-lock.json');
123
- });
124
-
125
- test('returns undefined', () => {
126
- expect(subject('@servicetitan/web-components')).toBeUndefined();
127
- });
128
- });
129
- });
@@ -1,99 +0,0 @@
1
- import { PackageLockPackages, resolvePackageLockEntry } from '../resolve-package-lock-entry';
2
-
3
- describe(`[startup] ${resolvePackageLockEntry.name}`, () => {
4
- let packages: PackageLockPackages;
5
- let packageName: string;
6
- let scope: string | undefined;
7
-
8
- beforeEach(() => {
9
- packages = {};
10
- packageName = 'foo';
11
- });
12
-
13
- const subject = () => resolvePackageLockEntry(packages, packageName, scope);
14
-
15
- describe('when package exists at top level', () => {
16
- beforeEach(() => {
17
- packages['node_modules/foo'] = { version: '1.0.0' };
18
- });
19
-
20
- test('resolves the entry', () => {
21
- expect(subject()).toEqual({ version: '1.0.0' });
22
- });
23
- });
24
-
25
- describe('when package exists both at top level and under a scope', () => {
26
- beforeEach(() => {
27
- packages['node_modules/foo'] = { version: '1.0.0' };
28
- packages['node_modules/parent/node_modules/foo'] = { version: '2.0.0' };
29
- scope = undefined;
30
- });
31
-
32
- describe('when scope is provided', () => {
33
- beforeEach(() => {
34
- scope = 'parent';
35
- });
36
-
37
- test('resolves scoped entry', () => {
38
- expect(subject()).toEqual({ version: '2.0.0' });
39
- });
40
- });
41
-
42
- test('resolves top-level entry', () => {
43
- expect(subject()).toEqual({ version: '1.0.0' });
44
- });
45
- });
46
-
47
- describe('when package has dependencies and peerDependencies', () => {
48
- beforeEach(() => {
49
- packages['node_modules/foo'] = {
50
- version: '1.0.0',
51
- dependencies: { bar: '^1.0.0' },
52
- peerDependencies: { baz: '>=2.0.0' },
53
- };
54
- });
55
-
56
- test('returns the full entry', () => {
57
- expect(subject()).toEqual({
58
- version: '1.0.0',
59
- dependencies: { bar: '^1.0.0' },
60
- peerDependencies: { baz: '>=2.0.0' },
61
- });
62
- });
63
- });
64
-
65
- describe('when package is a linked workspace package', () => {
66
- beforeEach(() => {
67
- packages['node_modules/foo'] = { link: true, resolved: 'packages/foo' };
68
- packages['packages/foo'] = { version: '3.0.0' };
69
- });
70
-
71
- test('follows link to resolved path', () => {
72
- expect(subject()).toEqual({ version: '3.0.0' });
73
- });
74
-
75
- describe('when resolved entry does not exist', () => {
76
- beforeEach(() => {
77
- delete packages['packages/foo'];
78
- });
79
-
80
- test('returns empty object', () => {
81
- expect(subject()).toEqual({});
82
- });
83
- });
84
-
85
- describe('when resolved property is missing', () => {
86
- beforeEach(() => {
87
- delete packages['node_modules/foo'].resolved;
88
- });
89
-
90
- test('returns the entry as-is', () => {
91
- expect(subject()).toEqual({ link: true });
92
- });
93
- });
94
- });
95
-
96
- test('returns empty object', () => {
97
- expect(subject()).toEqual({});
98
- });
99
- });
@@ -1,10 +0,0 @@
1
- import fs from 'node:fs';
2
- import path from 'node:path';
3
- import { findUp } from './find-up';
4
-
5
- export function findPackageLock() {
6
- return findUp(directory => {
7
- const lockFile = path.resolve(directory, 'package-lock.json');
8
- return fs.existsSync(lockFile) ? lockFile : undefined;
9
- });
10
- }
@@ -1,21 +0,0 @@
1
- import { findPackageLock } from './find-package-lock';
2
- import { readJsonSafe } from './read-json';
3
- import { PackageLockPackages, resolvePackageLockEntry } from './resolve-package-lock-entry';
4
-
5
- interface PackageLock {
6
- packages: PackageLockPackages;
7
- }
8
-
9
- export function getPackageVersion(packageName: string) {
10
- const lockFilePath = findPackageLock();
11
- if (!lockFilePath) {
12
- return undefined;
13
- }
14
-
15
- const lockFile = readJsonSafe<PackageLock>(lockFilePath);
16
- if (!lockFile) {
17
- return undefined;
18
- }
19
-
20
- return resolvePackageLockEntry(lockFile.packages, packageName).version;
21
- }
@@ -1,25 +0,0 @@
1
- interface PackageLockEntry {
2
- version?: string;
3
- resolved?: string;
4
- link?: boolean;
5
- dependencies?: Record<string, string>;
6
- peerDependencies?: Record<string, string>;
7
- }
8
-
9
- export type PackageLockPackages = Record<string, PackageLockEntry>;
10
-
11
- export function resolvePackageLockEntry(
12
- packages: PackageLockPackages | undefined,
13
- packageName: string,
14
- scope?: string
15
- ) {
16
- const entry =
17
- (scope ? packages?.[`node_modules/${scope}/node_modules/${packageName}`] : undefined) ??
18
- packages?.[`node_modules/${packageName}`];
19
-
20
- if (entry?.link && entry.resolved) {
21
- return packages?.[entry.resolved] ?? {};
22
- }
23
-
24
- return entry ?? {};
25
- }
File without changes