@servicetitan/startup 38.0.0 → 38.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (395) 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 +22 -9
  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 +9 -0
  16. package/dist/cli/commands/command.d.ts.map +1 -0
  17. package/dist/cli/commands/command.js +35 -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.js +13 -4
  24. package/dist/cli/commands/init.js.map +1 -1
  25. package/dist/cli/commands/install.js +13 -4
  26. package/dist/cli/commands/install.js.map +1 -1
  27. package/dist/cli/commands/kendo-ui-license.js +13 -4
  28. package/dist/cli/commands/kendo-ui-license.js.map +1 -1
  29. package/dist/cli/commands/lint.js +13 -4
  30. package/dist/cli/commands/lint.js.map +1 -1
  31. package/dist/cli/commands/mfe-check.d.ts.map +1 -1
  32. package/dist/cli/commands/mfe-check.js +15 -7
  33. package/dist/cli/commands/mfe-check.js.map +1 -1
  34. package/dist/cli/commands/mfe-generate-metadata.js +13 -4
  35. package/dist/cli/commands/mfe-generate-metadata.js.map +1 -1
  36. package/dist/cli/commands/mfe-list.js +13 -4
  37. package/dist/cli/commands/mfe-list.js.map +1 -1
  38. package/dist/cli/commands/mfe-package-clean.js +13 -4
  39. package/dist/cli/commands/mfe-package-clean.js.map +1 -1
  40. package/dist/cli/commands/mfe-package-publish.js +13 -4
  41. package/dist/cli/commands/mfe-package-publish.js.map +1 -1
  42. package/dist/cli/commands/mfe-package-rollback.js +13 -4
  43. package/dist/cli/commands/mfe-package-rollback.js.map +1 -1
  44. package/dist/cli/commands/mfe-publish.js +13 -4
  45. package/dist/cli/commands/mfe-publish.js.map +1 -1
  46. package/dist/cli/commands/mfe-purge-cache.js +13 -4
  47. package/dist/cli/commands/mfe-purge-cache.js.map +1 -1
  48. package/dist/cli/commands/prepare-package.js +13 -4
  49. package/dist/cli/commands/prepare-package.js.map +1 -1
  50. package/dist/cli/commands/registry/build.d.ts +1 -1
  51. package/dist/cli/commands/registry/build.d.ts.map +1 -1
  52. package/dist/cli/commands/registry/build.js +3 -5
  53. package/dist/cli/commands/registry/build.js.map +1 -1
  54. package/dist/cli/commands/registry/bundle-package.d.ts +41 -0
  55. package/dist/cli/commands/registry/bundle-package.d.ts.map +1 -0
  56. package/dist/cli/commands/registry/bundle-package.js +54 -0
  57. package/dist/cli/commands/registry/bundle-package.js.map +1 -0
  58. package/dist/cli/commands/registry/command-registry.d.ts +42 -2
  59. package/dist/cli/commands/registry/command-registry.d.ts.map +1 -1
  60. package/dist/cli/commands/registry/command-registry.js +10 -19
  61. package/dist/cli/commands/registry/command-registry.js.map +1 -1
  62. package/dist/cli/commands/registry/start.d.ts +1 -1
  63. package/dist/cli/commands/registry/start.d.ts.map +1 -1
  64. package/dist/cli/commands/registry/start.js +3 -5
  65. package/dist/cli/commands/registry/start.js.map +1 -1
  66. package/dist/cli/commands/review/review.js +14 -7
  67. package/dist/cli/commands/review/review.js.map +1 -1
  68. package/dist/cli/commands/review/rules/no-deprecated-content-base.js +1 -3
  69. package/dist/cli/commands/review/rules/no-deprecated-content-base.js.map +1 -1
  70. package/dist/cli/commands/review/rules/no-direct-peer-dependencies.js +1 -3
  71. package/dist/cli/commands/review/rules/no-direct-peer-dependencies.js.map +1 -1
  72. package/dist/cli/commands/review/rules/no-typescript-entry-point.js +1 -3
  73. package/dist/cli/commands/review/rules/no-typescript-entry-point.js.map +1 -1
  74. package/dist/cli/commands/review/rules/prefer-open-ended-peer-dependencies.js +5 -12
  75. package/dist/cli/commands/review/rules/prefer-open-ended-peer-dependencies.js.map +1 -1
  76. package/dist/cli/commands/review/rules/require-compatible-launch-darkly-sdk.js +5 -12
  77. package/dist/cli/commands/review/rules/require-compatible-launch-darkly-sdk.js.map +1 -1
  78. package/dist/cli/commands/review/rules/require-explicit-side-effects.js +1 -3
  79. package/dist/cli/commands/review/rules/require-explicit-side-effects.js.map +1 -1
  80. package/dist/cli/commands/review/rules/require-one-collection-version.js +1 -3
  81. package/dist/cli/commands/review/rules/require-one-collection-version.js.map +1 -1
  82. package/dist/cli/commands/review/rules/require-servicetitan-scope.js +1 -3
  83. package/dist/cli/commands/review/rules/require-servicetitan-scope.js.map +1 -1
  84. package/dist/cli/commands/review/rules/require-tsconfig-references.js +1 -3
  85. package/dist/cli/commands/review/rules/require-tsconfig-references.js.map +1 -1
  86. package/dist/cli/commands/review/utils/compare-version.js +8 -19
  87. package/dist/cli/commands/review/utils/compare-version.js.map +1 -1
  88. package/dist/cli/commands/run-task.d.ts +1 -0
  89. package/dist/cli/commands/run-task.d.ts.map +1 -1
  90. package/dist/cli/commands/run-task.js +20 -6
  91. package/dist/cli/commands/run-task.js.map +1 -1
  92. package/dist/cli/commands/start.d.ts.map +1 -1
  93. package/dist/cli/commands/start.js +28 -13
  94. package/dist/cli/commands/start.js.map +1 -1
  95. package/dist/cli/commands/stylelint.js +13 -4
  96. package/dist/cli/commands/stylelint.js.map +1 -1
  97. package/dist/cli/commands/styles-check.js +13 -4
  98. package/dist/cli/commands/styles-check.js.map +1 -1
  99. package/dist/cli/commands/test/runners/jest.js +1 -3
  100. package/dist/cli/commands/test/runners/jest.js.map +1 -1
  101. package/dist/cli/commands/test/tests.js +13 -4
  102. package/dist/cli/commands/test/tests.js.map +1 -1
  103. package/dist/cli/commands/types.d.ts +1 -6
  104. package/dist/cli/commands/types.d.ts.map +1 -1
  105. package/dist/cli/commands/types.js +2 -20
  106. package/dist/cli/commands/types.js.map +1 -1
  107. package/dist/cli/commands/upload-sourcemaps.js +17 -13
  108. package/dist/cli/commands/upload-sourcemaps.js.map +1 -1
  109. package/dist/cli/index.js +1 -0
  110. package/dist/cli/index.js.map +1 -1
  111. package/dist/cli/tasks/cli-task.d.ts +3 -0
  112. package/dist/cli/tasks/cli-task.d.ts.map +1 -1
  113. package/dist/cli/tasks/cli-task.js +41 -9
  114. package/dist/cli/tasks/cli-task.js.map +1 -1
  115. package/dist/cli/tasks/swc-compile-package/get-swc-options.d.ts +9 -1
  116. package/dist/cli/tasks/swc-compile-package/get-swc-options.d.ts.map +1 -1
  117. package/dist/cli/tasks/swc-compile-package/get-swc-options.js +18 -2
  118. package/dist/cli/tasks/swc-compile-package/get-swc-options.js.map +1 -1
  119. package/dist/cli/tasks/swc-compile-package/swc-compile-package.d.ts +3 -1
  120. package/dist/cli/tasks/swc-compile-package/swc-compile-package.d.ts.map +1 -1
  121. package/dist/cli/tasks/swc-compile-package/swc-compile-package.js +17 -3
  122. package/dist/cli/tasks/swc-compile-package/swc-compile-package.js.map +1 -1
  123. package/dist/cli/tasks/task.d.ts +2 -1
  124. package/dist/cli/tasks/task.d.ts.map +1 -1
  125. package/dist/cli/tasks/task.js +6 -3
  126. package/dist/cli/tasks/task.js.map +1 -1
  127. package/dist/cli/tasks/tsc-compile/tsc-compile.js +1 -3
  128. package/dist/cli/tasks/tsc-compile/tsc-compile.js.map +1 -1
  129. package/dist/cli/utils/cli-npm.d.ts.map +1 -1
  130. package/dist/cli/utils/cli-npm.js +8 -1
  131. package/dist/cli/utils/cli-npm.js.map +1 -1
  132. package/dist/cli/utils/cli-os.d.ts +1 -0
  133. package/dist/cli/utils/cli-os.d.ts.map +1 -1
  134. package/dist/cli/utils/cli-os.js +20 -0
  135. package/dist/cli/utils/cli-os.js.map +1 -1
  136. package/dist/cli/utils/compile.d.ts.map +1 -1
  137. package/dist/cli/utils/compile.js +7 -4
  138. package/dist/cli/utils/compile.js.map +1 -1
  139. package/dist/cli/utils/copy-files.js +1 -0
  140. package/dist/cli/utils/copy-files.js.map +1 -1
  141. package/dist/cli/utils/index.d.ts +1 -1
  142. package/dist/cli/utils/index.d.ts.map +1 -1
  143. package/dist/cli/utils/index.js +1 -1
  144. package/dist/cli/utils/index.js.map +1 -1
  145. package/dist/cli/utils/process-tree.js +2 -6
  146. package/dist/cli/utils/process-tree.js.map +1 -1
  147. package/dist/cli/utils/resolve-bundler.d.ts.map +1 -1
  148. package/dist/cli/utils/resolve-bundler.js +2 -1
  149. package/dist/cli/utils/resolve-bundler.js.map +1 -1
  150. package/dist/cli/utils/ts-config.d.ts +1 -1
  151. package/dist/cli/utils/ts-config.d.ts.map +1 -1
  152. package/dist/cli/utils/ts-config.js +1 -3
  153. package/dist/cli/utils/ts-config.js.map +1 -1
  154. package/dist/cli/utils/with-exponential-backoff.d.ts +7 -0
  155. package/dist/cli/utils/with-exponential-backoff.d.ts.map +1 -0
  156. package/dist/cli/utils/with-exponential-backoff.js +28 -0
  157. package/dist/cli/utils/with-exponential-backoff.js.map +1 -0
  158. package/dist/core/constants.d.ts +2 -0
  159. package/dist/core/constants.d.ts.map +1 -1
  160. package/dist/core/constants.js +6 -1
  161. package/dist/core/constants.js.map +1 -1
  162. package/dist/postinstall.js +118 -0
  163. package/dist/scripts/generate-bin-wrappers.js +203 -0
  164. package/dist/storybook-config/swc.d.ts +6 -0
  165. package/dist/storybook-config/swc.d.ts.map +1 -1
  166. package/dist/storybook-config/webpack-final.d.ts.map +1 -1
  167. package/dist/storybook-config/webpack-final.js +2 -1
  168. package/dist/storybook-config/webpack-final.js.map +1 -1
  169. package/dist/utils/exit-when-parent-exits.d.ts +6 -0
  170. package/dist/utils/exit-when-parent-exits.d.ts.map +1 -0
  171. package/dist/utils/exit-when-parent-exits.js +37 -0
  172. package/dist/utils/exit-when-parent-exits.js.map +1 -0
  173. package/dist/utils/find-up.d.ts +1 -1
  174. package/dist/utils/find-up.d.ts.map +1 -1
  175. package/dist/utils/find-up.js +2 -2
  176. package/dist/utils/find-up.js.map +1 -1
  177. package/dist/utils/get-configuration.d.ts +6 -3
  178. package/dist/utils/get-configuration.d.ts.map +1 -1
  179. package/dist/utils/get-configuration.js +10 -2
  180. package/dist/utils/get-configuration.js.map +1 -1
  181. package/dist/utils/index.d.ts +1 -0
  182. package/dist/utils/index.d.ts.map +1 -1
  183. package/dist/utils/index.js +1 -0
  184. package/dist/utils/index.js.map +1 -1
  185. package/dist/utils/log.js +1 -3
  186. package/dist/utils/log.js.map +1 -1
  187. package/dist/vite/build-shared-dependencies.d.ts.map +1 -1
  188. package/dist/vite/build-shared-dependencies.js +2 -0
  189. package/dist/vite/build-shared-dependencies.js.map +1 -1
  190. package/dist/vite/config/base-config.d.ts.map +1 -1
  191. package/dist/vite/config/base-config.js +12 -1
  192. package/dist/vite/config/base-config.js.map +1 -1
  193. package/dist/vite/config/create-vite-config.js +7 -2
  194. package/dist/vite/config/create-vite-config.js.map +1 -1
  195. package/dist/vite/config/load-config-file.js +8 -19
  196. package/dist/vite/config/load-config-file.js.map +1 -1
  197. package/dist/vite/index.d.ts +2 -0
  198. package/dist/vite/index.d.ts.map +1 -1
  199. package/dist/vite/index.html +2 -2
  200. package/dist/vite/index.js +16 -0
  201. package/dist/vite/index.js.map +1 -1
  202. package/dist/vite/plugins/chain-source-maps-plugin.js +1 -1
  203. package/dist/vite/plugins/chain-source-maps-plugin.js.map +1 -1
  204. package/dist/vite/plugins/clean-plugin.js +1 -1
  205. package/dist/vite/plugins/clean-plugin.js.map +1 -1
  206. package/dist/vite/plugins/css-injector-plugin.js +1 -1
  207. package/dist/vite/plugins/css-injector-plugin.js.map +1 -1
  208. package/dist/vite/plugins/design-system-guard-plugin.d.ts.map +1 -1
  209. package/dist/vite/plugins/design-system-guard-plugin.js +10 -5
  210. package/dist/vite/plugins/design-system-guard-plugin.js.map +1 -1
  211. package/dist/vite/plugins/dev-server-routing-plugin.js +1 -1
  212. package/dist/vite/plugins/dev-server-routing-plugin.js.map +1 -1
  213. package/dist/vite/plugins/externals-plugin.d.ts.map +1 -1
  214. package/dist/vite/plugins/externals-plugin.js +11 -5
  215. package/dist/vite/plugins/externals-plugin.js.map +1 -1
  216. package/dist/vite/plugins/html-plugin.d.ts.map +1 -1
  217. package/dist/vite/plugins/html-plugin.js +5 -3
  218. package/dist/vite/plugins/html-plugin.js.map +1 -1
  219. package/dist/vite/plugins/ignore-modules-plugin.d.ts +2 -2
  220. package/dist/vite/plugins/ignore-modules-plugin.d.ts.map +1 -1
  221. package/dist/vite/plugins/ignore-modules-plugin.js +36 -24
  222. package/dist/vite/plugins/ignore-modules-plugin.js.map +1 -1
  223. package/dist/vite/plugins/index.d.ts +3 -0
  224. package/dist/vite/plugins/index.d.ts.map +1 -1
  225. package/dist/vite/plugins/index.js +3 -0
  226. package/dist/vite/plugins/index.js.map +1 -1
  227. package/dist/vite/plugins/less-tilde-plugin.d.ts +8 -0
  228. package/dist/vite/plugins/less-tilde-plugin.d.ts.map +1 -0
  229. package/dist/vite/plugins/less-tilde-plugin.js +53 -0
  230. package/dist/vite/plugins/less-tilde-plugin.js.map +1 -0
  231. package/dist/vite/plugins/magic-comments-plugin/magic-comments-plugin.js +1 -1
  232. package/dist/vite/plugins/magic-comments-plugin/magic-comments-plugin.js.map +1 -1
  233. package/dist/vite/plugins/metadata-plugin.js +1 -1
  234. package/dist/vite/plugins/metadata-plugin.js.map +1 -1
  235. package/dist/vite/plugins/moment-locales-plugin.d.ts +1 -1
  236. package/dist/vite/plugins/moment-locales-plugin.d.ts.map +1 -1
  237. package/dist/vite/plugins/moment-locales-plugin.js +30 -14
  238. package/dist/vite/plugins/moment-locales-plugin.js.map +1 -1
  239. package/dist/vite/plugins/react-refresh-plugin/index.d.ts +2 -0
  240. package/dist/vite/plugins/react-refresh-plugin/index.d.ts.map +1 -0
  241. package/dist/vite/plugins/react-refresh-plugin/index.js +20 -0
  242. package/dist/vite/plugins/react-refresh-plugin/index.js.map +1 -0
  243. package/dist/vite/plugins/react-refresh-plugin/react-refresh-plugin.d.ts +4 -0
  244. package/dist/vite/plugins/react-refresh-plugin/react-refresh-plugin.d.ts.map +1 -0
  245. package/dist/vite/plugins/react-refresh-plugin/react-refresh-plugin.js +143 -0
  246. package/dist/vite/plugins/react-refresh-plugin/react-refresh-plugin.js.map +1 -0
  247. package/dist/vite/plugins/react-refresh-plugin/refresh-runtime.js +113 -0
  248. package/dist/vite/plugins/shared-dependencies-plugin/shared-dependencies-plugin.d.ts.map +1 -1
  249. package/dist/vite/plugins/shared-dependencies-plugin/shared-dependencies-plugin.js +14 -11
  250. package/dist/vite/plugins/shared-dependencies-plugin/shared-dependencies-plugin.js.map +1 -1
  251. package/dist/vite/plugins/style-urls-plugin.js +1 -1
  252. package/dist/vite/plugins/style-urls-plugin.js.map +1 -1
  253. package/dist/vite/plugins/virtual-modules-plugin.d.ts.map +1 -1
  254. package/dist/vite/plugins/virtual-modules-plugin.js +9 -6
  255. package/dist/vite/plugins/virtual-modules-plugin.js.map +1 -1
  256. package/dist/vite/plugins/window-externals-plugin.d.ts +22 -0
  257. package/dist/vite/plugins/window-externals-plugin.d.ts.map +1 -0
  258. package/dist/vite/plugins/window-externals-plugin.js +74 -0
  259. package/dist/vite/plugins/window-externals-plugin.js.map +1 -0
  260. package/dist/webpack/bundle-webpack.d.ts.map +1 -1
  261. package/dist/webpack/bundle-webpack.js +6 -1
  262. package/dist/webpack/bundle-webpack.js.map +1 -1
  263. package/dist/webpack/configs/optimization-config.js +4 -4
  264. package/dist/webpack/configs/optimization-config.js.map +1 -1
  265. package/dist/webpack/configs/output-config.js +1 -1
  266. package/dist/webpack/configs/output-config.js.map +1 -1
  267. package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.js +1 -3
  268. package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.js.map +1 -1
  269. package/dist/webpack/loaders/expose-loader/__tests__/__mocks__/configuration.expose-loader.js +13 -0
  270. package/dist/webpack/loaders/expose-loader/__tests__/__mocks__/index.js +1 -0
  271. package/dist/webpack/utils/index.d.ts +1 -0
  272. package/dist/webpack/utils/index.d.ts.map +1 -1
  273. package/dist/webpack/utils/index.js +1 -0
  274. package/dist/webpack/utils/index.js.map +1 -1
  275. package/dist/webpack/utils/normalize-proxy-config.d.ts +6 -0
  276. package/dist/webpack/utils/normalize-proxy-config.d.ts.map +1 -0
  277. package/dist/webpack/utils/normalize-proxy-config.js +52 -0
  278. package/dist/webpack/utils/normalize-proxy-config.js.map +1 -0
  279. package/package.json +24 -21
  280. package/src/cli/commands/__tests__/build.test.ts +33 -19
  281. package/src/cli/commands/__tests__/bundle-package.test.ts +65 -0
  282. package/src/cli/commands/__tests__/command.test.ts +42 -0
  283. package/src/cli/commands/__tests__/mfe-check.test.ts +26 -5
  284. package/src/cli/commands/__tests__/run-task.test.ts +20 -1
  285. package/src/cli/commands/__tests__/start.test.ts +35 -15
  286. package/src/cli/commands/build.ts +6 -5
  287. package/src/cli/commands/bundle-package.ts +20 -0
  288. package/src/cli/commands/command.ts +14 -0
  289. package/src/cli/commands/mfe-check.ts +6 -10
  290. package/src/cli/commands/registry/build.ts +3 -2
  291. package/src/cli/commands/registry/bundle-package.ts +22 -0
  292. package/src/cli/commands/registry/command-registry.ts +2 -0
  293. package/src/cli/commands/registry/start.ts +3 -2
  294. package/src/cli/commands/run-task.ts +8 -2
  295. package/src/cli/commands/start.ts +9 -5
  296. package/src/cli/commands/types.ts +2 -6
  297. package/src/cli/index.ts +3 -0
  298. package/src/cli/tasks/__tests__/cli-task.test.ts +181 -69
  299. package/src/cli/tasks/__tests__/task.test.ts +40 -45
  300. package/src/cli/tasks/cli-task.ts +43 -2
  301. package/src/cli/tasks/swc-compile-package/__tests__/get-swc-options.test.ts +46 -4
  302. package/src/cli/tasks/swc-compile-package/__tests__/swc-compile-package.test.ts +25 -4
  303. package/src/cli/tasks/swc-compile-package/get-swc-options.ts +14 -1
  304. package/src/cli/tasks/swc-compile-package/swc-compile-package.ts +6 -2
  305. package/src/cli/tasks/task.ts +8 -2
  306. package/src/cli/tasks/tsc-compile/__tests__/tsc-compile.test.ts +8 -32
  307. package/src/cli/tasks/tsc-compile-package/__tests__/tsc-compile-package.test.ts +10 -19
  308. package/src/cli/utils/__tests__/cli-npm.test.ts +33 -0
  309. package/src/cli/utils/__tests__/cli-os.test.ts +86 -3
  310. package/src/cli/utils/__tests__/compile.test.ts +37 -2
  311. package/src/cli/utils/__tests__/copy-files.test.ts +1 -1
  312. package/src/cli/utils/__tests__/with-exponential-backoff.test.ts +119 -0
  313. package/src/cli/utils/cli-npm.ts +19 -4
  314. package/src/cli/utils/cli-os.ts +14 -0
  315. package/src/cli/utils/compile.ts +8 -1
  316. package/src/cli/utils/copy-files.ts +1 -1
  317. package/src/cli/utils/index.ts +1 -1
  318. package/src/cli/utils/resolve-bundler.ts +2 -1
  319. package/src/cli/utils/ts-config.ts +1 -1
  320. package/src/cli/utils/with-exponential-backoff.ts +28 -0
  321. package/src/core/constants.ts +2 -0
  322. package/src/storybook-config/__tests__/vite-final.test.ts +6 -0
  323. package/src/storybook-config/__tests__/webpack-final.test.ts +26 -12
  324. package/src/storybook-config/webpack-final.ts +10 -4
  325. package/src/utils/__tests__/exit-when-parent-exits.test.ts +87 -0
  326. package/src/utils/__tests__/find-up.test.ts +49 -0
  327. package/src/utils/__tests__/get-configuration.test.ts +62 -0
  328. package/src/utils/exit-when-parent-exits.ts +33 -0
  329. package/src/utils/find-up.ts +2 -2
  330. package/src/utils/get-configuration.ts +14 -5
  331. package/src/utils/index.ts +1 -0
  332. package/src/vite/__tests__/build-shared-dependencies.test.ts +39 -5
  333. package/src/vite/build-shared-dependencies.ts +2 -1
  334. package/src/vite/config/__tests__/base-config.test.ts +12 -4
  335. package/src/vite/config/__tests__/create-css-config.test.ts +2 -6
  336. package/src/vite/config/__tests__/create-vite-config.test.ts +6 -3
  337. package/src/vite/config/base-config.ts +13 -1
  338. package/src/vite/config/create-vite-config.ts +6 -3
  339. package/src/vite/index.html +2 -2
  340. package/src/vite/index.ts +2 -0
  341. package/src/vite/plugins/__tests__/chain-source-maps-plugin.test.ts +1 -1
  342. package/src/vite/plugins/__tests__/clean-plugin.test.ts +1 -1
  343. package/src/vite/plugins/__tests__/css-injector-plugin.test.ts +1 -1
  344. package/src/vite/plugins/__tests__/design-system-guard-plugin.test.ts +15 -3
  345. package/src/vite/plugins/__tests__/dev-server-routing-plugin.test.ts +1 -1
  346. package/src/vite/plugins/__tests__/externals-plugin.test.ts +24 -3
  347. package/src/vite/plugins/__tests__/html-plugin.test.ts +10 -3
  348. package/src/vite/plugins/__tests__/html-template.test.ts +10 -2
  349. package/src/vite/plugins/__tests__/ignore-modules-plugin.test.ts +30 -6
  350. package/src/vite/plugins/__tests__/less-tilde-plugin.test.ts +91 -0
  351. package/src/vite/plugins/__tests__/metadata-plugin.test.ts +1 -1
  352. package/src/vite/plugins/__tests__/moment-locales-plugin.test.ts +35 -25
  353. package/src/vite/plugins/__tests__/style-urls-plugin.test.ts +1 -1
  354. package/src/vite/plugins/__tests__/virtual-modules-plugin.test.ts +20 -9
  355. package/src/vite/plugins/__tests__/window-externals-plugin.test.ts +128 -0
  356. package/src/vite/plugins/chain-source-maps-plugin.ts +1 -1
  357. package/src/vite/plugins/clean-plugin.ts +1 -1
  358. package/src/vite/plugins/css-injector-plugin.ts +1 -1
  359. package/src/vite/plugins/design-system-guard-plugin.ts +11 -8
  360. package/src/vite/plugins/dev-server-routing-plugin.ts +1 -1
  361. package/src/vite/plugins/externals-plugin.ts +15 -6
  362. package/src/vite/plugins/html-plugin.ts +4 -2
  363. package/src/vite/plugins/ignore-modules-plugin.ts +32 -23
  364. package/src/vite/plugins/index.ts +3 -0
  365. package/src/vite/plugins/less-tilde-plugin.ts +64 -0
  366. package/src/vite/plugins/magic-comments-plugin/magic-comments-plugin.ts +1 -1
  367. package/src/vite/plugins/metadata-plugin.ts +1 -1
  368. package/src/vite/plugins/moment-locales-plugin.ts +24 -14
  369. package/src/vite/plugins/react-refresh-plugin/README.md +165 -0
  370. package/src/vite/plugins/react-refresh-plugin/__tests__/react-refresh-plugin.test.ts +366 -0
  371. package/src/vite/plugins/react-refresh-plugin/__tests__/refresh-runtime.test.ts +193 -0
  372. package/src/vite/plugins/react-refresh-plugin/index.ts +1 -0
  373. package/src/vite/plugins/react-refresh-plugin/react-refresh-plugin.ts +144 -0
  374. package/src/vite/plugins/react-refresh-plugin/refresh-runtime.js +113 -0
  375. package/src/vite/plugins/shared-dependencies-plugin/__tests__/shared-dependencies-plugin.test.ts +21 -16
  376. package/src/vite/plugins/shared-dependencies-plugin/shared-dependencies-plugin.ts +13 -12
  377. package/src/vite/plugins/style-urls-plugin.ts +1 -1
  378. package/src/vite/plugins/virtual-modules-plugin.ts +8 -7
  379. package/src/vite/plugins/window-externals-plugin.ts +94 -0
  380. package/src/webpack/__tests__/bundle-webpack.test.ts +32 -0
  381. package/src/webpack/__tests__/create-webpack-config-web-component.test.ts +17 -5
  382. package/src/webpack/__tests__/create-webpack-config.test.ts +10 -6
  383. package/src/webpack/bundle-webpack.ts +7 -1
  384. package/src/webpack/configs/optimization-config.ts +3 -3
  385. package/src/webpack/configs/output-config.ts +1 -1
  386. package/src/webpack/utils/__tests__/normalize-proxy-config.test.ts +121 -0
  387. package/src/webpack/utils/index.ts +1 -0
  388. package/src/webpack/utils/normalize-proxy-config.ts +59 -0
  389. package/tsconfig/types.d.ts +10 -0
  390. package/dist/cli/utils/get-bundle-command.d.ts +0 -3
  391. package/dist/cli/utils/get-bundle-command.d.ts.map +0 -1
  392. package/dist/cli/utils/get-bundle-command.js +0 -16
  393. package/dist/cli/utils/get-bundle-command.js.map +0 -1
  394. package/src/cli/utils/__tests__/get-bundle-command.test.ts +0 -23
  395. package/src/cli/utils/get-bundle-command.ts +0 -5
@@ -9,6 +9,9 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
+ get killProcessTree () {
13
+ return killProcessTree;
14
+ },
12
15
  get runCommand () {
13
16
  return runCommand;
14
17
  },
@@ -71,5 +74,22 @@ function runCommandOutput(command, { quiet, ...execSyncOptions } = {}) {
71
74
  }
72
75
  return result;
73
76
  }
77
+ function killProcessTree(pid, signal = 'SIGKILL') {
78
+ try {
79
+ if (process.platform === 'win32') {
80
+ (0, _child_process.execFileSync)('taskkill', [
81
+ '/pid',
82
+ String(pid),
83
+ '/t',
84
+ '/f'
85
+ ]);
86
+ } else {
87
+ // negative pid targets the whole process group
88
+ process.kill(-pid, signal);
89
+ }
90
+ } catch (unused) {
91
+ // tree already gone
92
+ }
93
+ }
74
94
 
75
95
  //# sourceMappingURL=cli-os.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/cli/utils/cli-os.ts"],"sourcesContent":["import {\n execSync,\n ExecSyncOptionsWithBufferEncoding,\n spawn,\n SpawnOptionsWithoutStdio,\n} from 'child_process';\nimport { log } from '../../utils';\n\ntype RunCommandOptions = SpawnOptionsWithoutStdio & { quiet?: boolean };\n\nexport async function runCommand(\n command: string | (string | false)[],\n { quiet, ...spawnOptions }: RunCommandOptions = {}\n) {\n return new Promise<void>((resolve, reject) => {\n const commandArray: string[] = Array.isArray(command)\n ? command.reduce((acc, el) => (el ? [...acc, ...el.toString().split(' ')] : acc), [])\n : command.split(' ');\n const fullCommand = commandArray.join(' ');\n const commandName = commandArray.shift();\n\n if (!commandName) {\n reject(new Error('invalid command'));\n return;\n }\n\n if (!quiet) {\n log.info(`Running: ${fullCommand}`);\n }\n\n const proc = spawn(commandName, commandArray, {\n shell: process.platform === 'win32',\n ...spawnOptions,\n });\n\n proc.stdout.pipe(process.stdout);\n proc.stderr.pipe(process.stderr);\n\n proc.on('exit', function (code) {\n if (!quiet) {\n log.info(`command finished with code ${code}`, fullCommand);\n }\n\n if (code) {\n reject(new Error(`command exited with code: ${code}`));\n } else {\n resolve();\n }\n });\n proc.on('error', function (e) {\n reject(e);\n });\n });\n}\n\ntype RunCommandOutputOptions = ExecSyncOptionsWithBufferEncoding & { quiet?: boolean };\n\nexport function runCommandOutput(\n command: string | (string | false)[],\n { quiet, ...execSyncOptions }: RunCommandOutputOptions = {}\n) {\n const fullCommand = Array.isArray(command)\n ? command.reduce((acc, el) => (el ? [...acc, el.toString()] : acc), []).join(' ')\n : command;\n\n if (!fullCommand) {\n throw new Error();\n }\n\n if (!quiet) {\n log.info(`Running: ${fullCommand}`);\n }\n\n const result = execSync(fullCommand, execSyncOptions).toString();\n\n if (!quiet) {\n log.info('command finished', result.trim());\n }\n\n return result;\n}\n"],"names":["runCommand","runCommandOutput","command","quiet","spawnOptions","Promise","resolve","reject","commandArray","Array","isArray","reduce","acc","el","toString","split","fullCommand","join","commandName","shift","Error","log","info","proc","spawn","shell","process","platform","stdout","pipe","stderr","on","code","e","execSyncOptions","result","execSync","trim"],"mappings":";;;;;;;;;;;QAUsBA;eAAAA;;QA+CNC;eAAAA;;;+BApDT;uBACa;AAIb,eAAeD,WAClBE,OAAoC,EACpC,EAAEC,KAAK,EAAE,GAAGC,cAAiC,GAAG,CAAC,CAAC;IAElD,OAAO,IAAIC,QAAc,CAACC,SAASC;QAC/B,MAAMC,eAAyBC,MAAMC,OAAO,CAACR,WACvCA,QAAQS,MAAM,CAAC,CAACC,KAAKC,KAAQA,KAAK;mBAAID;mBAAQC,GAAGC,QAAQ,GAAGC,KAAK,CAAC;aAAK,GAAGH,KAAM,EAAE,IAClFV,QAAQa,KAAK,CAAC;QACpB,MAAMC,cAAcR,aAAaS,IAAI,CAAC;QACtC,MAAMC,cAAcV,aAAaW,KAAK;QAEtC,IAAI,CAACD,aAAa;YACdX,OAAO,IAAI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A,OAAOF;AACX"}
1
+ {"version":3,"sources":["../../../src/cli/utils/cli-os.ts"],"sourcesContent":["import {\n execFileSync,\n execSync,\n ExecSyncOptionsWithBufferEncoding,\n spawn,\n SpawnOptionsWithoutStdio,\n} from 'child_process';\nimport { log } from '../../utils';\n\ntype RunCommandOptions = SpawnOptionsWithoutStdio & { quiet?: boolean };\n\nexport async function runCommand(\n command: string | (string | false)[],\n { quiet, ...spawnOptions }: RunCommandOptions = {}\n) {\n return new Promise<void>((resolve, reject) => {\n const commandArray: string[] = Array.isArray(command)\n ? command.reduce((acc, el) => (el ? [...acc, ...el.toString().split(' ')] : acc), [])\n : command.split(' ');\n const fullCommand = commandArray.join(' ');\n const commandName = commandArray.shift();\n\n if (!commandName) {\n reject(new Error('invalid command'));\n return;\n }\n\n if (!quiet) {\n log.info(`Running: ${fullCommand}`);\n }\n\n const proc = spawn(commandName, commandArray, {\n shell: process.platform === 'win32',\n ...spawnOptions,\n });\n\n proc.stdout.pipe(process.stdout);\n proc.stderr.pipe(process.stderr);\n\n proc.on('exit', function (code) {\n if (!quiet) {\n log.info(`command finished with code ${code}`, fullCommand);\n }\n\n if (code) {\n reject(new Error(`command exited with code: ${code}`));\n } else {\n resolve();\n }\n });\n proc.on('error', function (e) {\n reject(e);\n });\n });\n}\n\ntype RunCommandOutputOptions = ExecSyncOptionsWithBufferEncoding & { quiet?: boolean };\n\nexport function runCommandOutput(\n command: string | (string | false)[],\n { quiet, ...execSyncOptions }: RunCommandOutputOptions = {}\n) {\n const fullCommand = Array.isArray(command)\n ? command.reduce((acc, el) => (el ? [...acc, el.toString()] : acc), []).join(' ')\n : command;\n\n if (!fullCommand) {\n throw new Error();\n }\n\n if (!quiet) {\n log.info(`Running: ${fullCommand}`);\n }\n\n const result = execSync(fullCommand, execSyncOptions).toString();\n\n if (!quiet) {\n log.info('command finished', result.trim());\n }\n\n return result;\n}\n\nexport function killProcessTree(pid: number, signal: NodeJS.Signals = 'SIGKILL') {\n try {\n if (process.platform === 'win32') {\n execFileSync('taskkill', ['/pid', String(pid), '/t', '/f']);\n } else {\n // negative pid targets the whole process group\n process.kill(-pid, signal);\n }\n } catch {\n // tree already gone\n }\n}\n"],"names":["killProcessTree","runCommand","runCommandOutput","command","quiet","spawnOptions","Promise","resolve","reject","commandArray","Array","isArray","reduce","acc","el","toString","split","fullCommand","join","commandName","shift","Error","log","info","proc","spawn","shell","process","platform","stdout","pipe","stderr","on","code","e","execSyncOptions","result","execSync","trim","pid","signal","execFileSync","String","kill"],"mappings":";;;;;;;;;;;QAmFgBA;eAAAA;;QAxEMC;eAAAA;;QA+CNC;eAAAA;;;+BApDT;uBACa;AAIb,eAAeD,WAClBE,OAAoC,EACpC,EAAEC,KAAK,EAAE,GAAGC,cAAiC,GAAG,CAAC,CAAC;IAElD,OAAO,IAAIC,QAAc,CAACC,SAASC;QAC/B,MAAMC,eAAyBC,MAAMC,OAAO,CAACR,WACvCA,QAAQS,MAAM,CAAC,CAACC,KAAKC,KAAQA,KAAK;mBAAID;mBAAQC,GAAGC,QAAQ,GAAGC,KAAK,CAAC;aAAK,GAAGH,KAAM,EAAE,IAClFV,QAAQa,KAAK,CAAC;QACpB,MAAMC,cAAcR,aAAaS,IAAI,CAAC;QACtC,MAAMC,cAAcV,aAAaW,KAAK;QAEtC,IAAI,CAACD,aAAa;YACdX,OAAO,IAAIa,MAAM;YACjB;QACJ;QAEA,IAAI,CAACjB,OAAO;YACRkB,UAAG,CAACC,IAAI,CAAC,CAAC,SAAS,EAAEN,aAAa;QACtC;QAEA,MAAMO,OAAOC,IAAAA,oBAAK,EAACN,aAAaV,cAAc;YAC1CiB,OAAOC,QAAQC,QAAQ,KAAK;YAC5B,GAAGvB,YAAY;QACnB;QAEAmB,KAAKK,MAAM,CAACC,IAAI,CAACH,QAAQE,MAAM;QAC/BL,KAAKO,MAAM,CAACD,IAAI,CAACH,QAAQI,MAAM;QAE/BP,KAAKQ,EAAE,CAAC,QAAQ,SAAUC,IAAI;YAC1B,IAAI,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],"names":[],"mappings":"AAGA,wBAAgB,OAAO,CAAC,EACpB,QAAQ,EACR,KAAa,EACb,MAAc,GACjB,EAAE;IACC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB,6CAUA"}
1
+ {"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/compile.ts"],"names":[],"mappings":"AAIA,wBAAgB,OAAO,CAAC,EACpB,QAAQ,EACR,KAAa,EACb,MAAc,GACjB,EAAE;IACC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB,6CAgBA"}
@@ -10,8 +10,13 @@ Object.defineProperty(exports, "compile", {
10
10
  });
11
11
  const _utils = require("../../utils");
12
12
  const _lernaexec = require("./lerna-exec");
13
+ const _resolvebundler = require("./resolve-bundler");
13
14
  function compile({ packages, watch = false, useTsc = false }) {
14
15
  _utils.log.info('Compiling TypeScript files...');
16
+ const options = [
17
+ watch && '--watch',
18
+ watch && !useTsc && (0, _resolvebundler.resolveBundler)({}) === 'vite' && '--react-refresh'
19
+ ].filter((option)=>typeof option === 'string');
15
20
  return (0, _lernaexec.lernaExec)({
16
21
  cmd: useTsc ? 'startup task tsc-compile-package' : 'startup task swc-compile-package',
17
22
  parallel: true,
@@ -22,10 +27,8 @@ function compile({ packages, watch = false, useTsc = false }) {
22
27
  'pipe',
23
28
  'inherit'
24
29
  ] : 'inherit',
25
- ...watch ? {
26
- '--': [
27
- '--watch'
28
- ]
30
+ ...options.length ? {
31
+ '--': options
29
32
  } : {}
30
33
  });
31
34
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/cli/utils/compile.ts"],"sourcesContent":["import { log } from '../../utils';\nimport { lernaExec } from './lerna-exec';\n\nexport function compile({\n packages,\n watch = false,\n useTsc = false,\n}: {\n packages: string[];\n watch?: boolean;\n useTsc?: boolean;\n}) {\n log.info('Compiling TypeScript files...');\n return lernaExec({\n cmd: useTsc ? 'startup task tsc-compile-package' : 'startup task swc-compile-package',\n parallel: true,\n scope: packages,\n stream: true,\n stdio: watch ? ['inherit', 'pipe', 'inherit'] : 'inherit',\n ...(watch ? { '--': ['--watch'] } : {}),\n });\n}\n"],"names":["compile","packages","watch","useTsc","log","info","lernaExec","cmd","parallel","scope","stream","stdio"],"mappings":";;;;+BAGgBA;;;eAAAA;;;uBAHI;2BACM;AAEnB,SAASA,QAAQ,EACpBC,QAAQ,EACRC,QAAQ,KAAK,EACbC,SAAS,KAAK,EAKjB;IACGC,UAAG,CAACC,IAAI,CAAC;IACT,OAAOC,IAAAA,oBAAS,EAAC;QACbC,KAAKJ,SAAS,qCAAqC;QACnDK,UAAU;QACVC,OAAOR;QACPS,QAAQ;QACRC,OAAOT,QAAQ;YAAC;YAAW;YAAQ;SAAU,GAAG;QAChD,GAAIA,QAAQ;YAAE,MAAM;gBAAC;aAAU;QAAC,IAAI,CAAC,CAAC;IAC1C;AACJ"}
1
+ {"version":3,"sources":["../../../src/cli/utils/compile.ts"],"sourcesContent":["import { log } from '../../utils';\nimport { lernaExec } from './lerna-exec';\nimport { resolveBundler } from './resolve-bundler';\n\nexport function compile({\n packages,\n watch = false,\n useTsc = false,\n}: {\n packages: string[];\n watch?: boolean;\n useTsc?: boolean;\n}) {\n log.info('Compiling TypeScript files...');\n\n const options = [\n watch && '--watch',\n watch && !useTsc && resolveBundler({}) === 'vite' && '--react-refresh',\n ].filter(option => typeof option === 'string');\n\n return lernaExec({\n cmd: useTsc ? 'startup task tsc-compile-package' : 'startup task swc-compile-package',\n parallel: true,\n scope: packages,\n stream: true,\n stdio: watch ? ['inherit', 'pipe', 'inherit'] : 'inherit',\n ...(options.length ? { '--': options } : {}),\n });\n}\n"],"names":["compile","packages","watch","useTsc","log","info","options","resolveBundler","filter","option","lernaExec","cmd","parallel","scope","stream","stdio","length"],"mappings":";;;;+BAIgBA;;;eAAAA;;;uBAJI;2BACM;gCACK;AAExB,SAASA,QAAQ,EACpBC,QAAQ,EACRC,QAAQ,KAAK,EACbC,SAAS,KAAK,EAKjB;IACGC,UAAG,CAACC,IAAI,CAAC;IAET,MAAMC,UAAU;QACZJ,SAAS;QACTA,SAAS,CAACC,UAAUI,IAAAA,8BAAc,EAAC,CAAC,OAAO,UAAU;KACxD,CAACC,MAAM,CAACC,CAAAA,SAAU,OAAOA,WAAW;IAErC,OAAOC,IAAAA,oBAAS,EAAC;QACbC,KAAKR,SAAS,qCAAqC;QACnDS,UAAU;QACVC,OAAOZ;QACPa,QAAQ;QACRC,OAAOb,QAAQ;YAAC;YAAW;YAAQ;SAAU,GAAG;QAChD,GAAII,QAAQU,MAAM,GAAG;YAAE,MAAMV;QAAQ,IAAI,CAAC,CAAC;IAC/C;AACJ"}
@@ -44,6 +44,7 @@ const assetExtensions = [
44
44
  ];
45
45
  const resourceExtensions = [
46
46
  'html',
47
+ 'js',
47
48
  'json'
48
49
  ];
49
50
  const styleExtensions = [
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/cli/utils/copy-files.ts"],"sourcesContent":["import cpx from 'cpx2';\nimport fs from 'fs';\nimport { glob } from 'glob';\nimport DtsCreator from 'typed-css-modules';\nimport { getFolders, log } from '../../utils';\nimport { compileLess } from './compile-less';\nimport { compileSass } from './compile-sass';\n\nconst assetExtensions = ['eot', 'gif', 'jpg', 'otf', 'png', 'svg', 'ttf', 'woff', 'woff2'];\nconst resourceExtensions = ['html', 'json'];\nexport const styleExtensions = ['css', 'less', 'scss'];\nconst styleTypeDefinitionExtensions = styleExtensions.map(ext => `${ext}.d.ts`);\n\nexport const supportedExtensions = [\n assetExtensions,\n resourceExtensions,\n styleExtensions,\n styleTypeDefinitionExtensions,\n].flat();\n\nconst styleModuleRegex = new RegExp(`\\\\.module\\\\.(${styleExtensions.join('|')})$`);\n\ninterface CopyFilesOptions {\n watch?: boolean;\n}\n\nexport async function copyFiles({ watch }: CopyFilesOptions) {\n const { source, destination } = getFolders();\n if (!fs.existsSync(source)) {\n return;\n }\n\n const filesPattern = `${source}/**/*.{${supportedExtensions.join()}}`;\n const creator = new DtsCreator({ camelCase: true, namedExports: true });\n const generateDefinitions = async (file: string) => {\n try {\n const css = await compile(file);\n const content = await creator.create(file, css, !!watch);\n await content.writeFile();\n } catch (error) {\n log.error(String(error));\n }\n };\n\n if (!watch) {\n const modulesPattern = `${source}/**/*.module.{${styleExtensions.join()}}`;\n log.info(`Generating types for ${modulesPattern}`);\n const modules = await glob(modulesPattern);\n await Promise.all(modules.map(generateDefinitions));\n\n log.info(`Copying ${filesPattern} -> ${destination}`);\n cpx.copySync(filesPattern, destination);\n\n return;\n }\n\n log.info(`Watching ${filesPattern} -> ${destination}`);\n cpx.watch(filesPattern, destination, {\n initialCopy: false,\n // Optimization so cpx2 doesn't waste resources watching irrelevant files\n ignore: ['__tests__', '__mocks__', '*.*', ...supportedExtensions.map(ext => `!*.${ext}`)],\n })\n .on('copy', async ({ srcPath, dstPath }: { srcPath: string; dstPath: string }) => {\n log.info(`Copied ${srcPath} -> ${dstPath}`);\n if (styleModuleRegex.test(srcPath)) {\n log.info(`Generating types for ${srcPath}`);\n await generateDefinitions(srcPath);\n }\n })\n .on('watch-error', (error: unknown) => log.error(String(error)));\n\n /* istanbul ignore next: not executed in test environment */\n if (process.env.NODE_ENV !== 'test') {\n await new Promise<void>(() => {});\n }\n}\n\nasync function compile(filePath: string) {\n if (filePath.endsWith('.less')) {\n return compileLess(filePath);\n }\n if (filePath.endsWith('.scss')) {\n return compileSass(filePath);\n }\n}\n"],"names":["copyFiles","styleExtensions","supportedExtensions","assetExtensions","resourceExtensions","styleTypeDefinitionExtensions","map","ext","flat","styleModuleRegex","RegExp","join","watch","source","destination","getFolders","fs","existsSync","filesPattern","creator","DtsCreator","camelCase","namedExports","generateDefinitions","file","css","compile","content","create","writeFile","error","log","String","modulesPattern","info","modules","glob","Promise","all","cpx","copySync","initialCopy","ignore","on","srcPath","dstPath","test","process","env","NODE_ENV","filePath","endsWith","compileLess","compileSass"],"mappings":";;;;;;;;;;;QA0BsBA;eAAAA;;QAhBTC;eAAAA;;QAGAC;eAAAA;;;6DAbG;2DACD;sBACM;wEACE;uBACS;6BACJ;6BACA;;;;;;AAE5B,MAAMC,kBAAkB;IAAC;IAAO;IAAO;IAAO;IAAO;IAAO;IAAO;IAAO;IAAQ;CAAQ;AAC1F,MAAMC,qBAAqB;IAAC;IAAQ;CAAO;AACpC,MAAMH,kBAAkB;IAAC;IAAO;IAAQ;CAAO;AACtD,MAAMI,gCAAgCJ,gBAAgBK,GAAG,CAACC,CAAAA,MAAO,GAAGA,IAAI,KAAK,CAAC;AAEvE,MAAML,sBAAsB;IAC/BC;IACAC;IACAH;IACAI;CACH,CAACG,IAAI;AAEN,MAAMC,mBAAmB,IAAIC,OAAO,CAAC,aAAa,EAAET,gBAAgBU,IAAI,CAAC,KAAK,EAAE,CAAC;AAM1E,eAAeX,UAAU,EAAEY,KAAK,EAAoB;IACvD,MAAM,EAAEC,MAAM,EAAEC,WAAW,EAAE,GAAGC,IAAAA,iBAAU;IAC1C,IAAI,CAACC,WAAE,CAACC,UAAU,CAACJ,SAAS;QACxB;IACJ;IAEA,MAAMK,eAAe,GAAGL,OAAO,OAAO,EAAEX,oBAAoBS,IAAI,GAAG,CAAC,CAAC;IACrE,MAAMQ,UAAU,IAAIC,wBAAU,CAAC;QAAEC,WAAW;QAAMC,cAAc;IAAK;IACrE,MAAMC,sBAAsB,OAAOC;QAC/B,IAAI;YACA,MAAMC,MAAM,MAAMC,QAAQF;YAC1B,MAAMG,UAAU,MAAMR,QAAQS,MAAM,CAACJ,MAAMC,KAAK,CAAC,CAACb;YAClD,MAAMe,QAAQE,SAAS;QAC3B,EAAE,OAAOC,OAAO;YACZC,UAAG,CAACD,KAAK,CAACE,OAAOF;QACrB;IACJ;IAEA,IAAI,CAAClB,OAAO;QACR,MAAMqB,iBAAiB,GAAG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Q,CAAC,UAAU;QAC5B,OAAOE,IAAAA,wBAAW,EAACH;IACvB;AACJ"}
1
+ {"version":3,"sources":["../../../src/cli/utils/copy-files.ts"],"sourcesContent":["import cpx from 'cpx2';\nimport fs from 'fs';\nimport { glob } from 'glob';\nimport DtsCreator from 'typed-css-modules';\nimport { getFolders, log } from '../../utils';\nimport { compileLess } from './compile-less';\nimport { compileSass } from './compile-sass';\n\nconst assetExtensions = ['eot', 'gif', 'jpg', 'otf', 'png', 'svg', 'ttf', 'woff', 'woff2'];\nconst resourceExtensions = ['html', 'js', 'json'];\nexport const styleExtensions = ['css', 'less', 'scss'];\nconst styleTypeDefinitionExtensions = styleExtensions.map(ext => `${ext}.d.ts`);\n\nexport const supportedExtensions = [\n assetExtensions,\n resourceExtensions,\n styleExtensions,\n styleTypeDefinitionExtensions,\n].flat();\n\nconst styleModuleRegex = new RegExp(`\\\\.module\\\\.(${styleExtensions.join('|')})$`);\n\ninterface CopyFilesOptions {\n watch?: boolean;\n}\n\nexport async function copyFiles({ watch }: CopyFilesOptions) {\n const { source, destination } = getFolders();\n if (!fs.existsSync(source)) {\n return;\n }\n\n const filesPattern = `${source}/**/*.{${supportedExtensions.join()}}`;\n const creator = new DtsCreator({ camelCase: true, namedExports: true });\n const generateDefinitions = async (file: string) => {\n try {\n const css = await compile(file);\n const content = await creator.create(file, css, !!watch);\n await content.writeFile();\n } catch (error) {\n log.error(String(error));\n }\n };\n\n if (!watch) {\n const modulesPattern = `${source}/**/*.module.{${styleExtensions.join()}}`;\n log.info(`Generating types for ${modulesPattern}`);\n const modules = await glob(modulesPattern);\n await Promise.all(modules.map(generateDefinitions));\n\n log.info(`Copying ${filesPattern} -> ${destination}`);\n cpx.copySync(filesPattern, destination);\n\n return;\n }\n\n log.info(`Watching ${filesPattern} -> ${destination}`);\n cpx.watch(filesPattern, destination, {\n initialCopy: false,\n // Optimization so cpx2 doesn't waste resources watching irrelevant files\n ignore: ['__tests__', '__mocks__', '*.*', ...supportedExtensions.map(ext => `!*.${ext}`)],\n })\n .on('copy', async ({ srcPath, dstPath }: { srcPath: string; dstPath: string }) => {\n log.info(`Copied ${srcPath} -> ${dstPath}`);\n if (styleModuleRegex.test(srcPath)) {\n log.info(`Generating types for ${srcPath}`);\n await generateDefinitions(srcPath);\n }\n })\n .on('watch-error', (error: unknown) => log.error(String(error)));\n\n /* istanbul ignore next: not executed in test environment */\n if (process.env.NODE_ENV !== 'test') {\n await new Promise<void>(() => {});\n }\n}\n\nasync function compile(filePath: string) {\n if (filePath.endsWith('.less')) {\n return compileLess(filePath);\n }\n if (filePath.endsWith('.scss')) {\n return compileSass(filePath);\n }\n}\n"],"names":["copyFiles","styleExtensions","supportedExtensions","assetExtensions","resourceExtensions","styleTypeDefinitionExtensions","map","ext","flat","styleModuleRegex","RegExp","join","watch","source","destination","getFolders","fs","existsSync","filesPattern","creator","DtsCreator","camelCase","namedExports","generateDefinitions","file","css","compile","content","create","writeFile","error","log","String","modulesPattern","info","modules","glob","Promise","all","cpx","copySync","initialCopy","ignore","on","srcPath","dstPath","test","process","env","NODE_ENV","filePath","endsWith","compileLess","compileSass"],"mappings":";;;;;;;;;;;QA0BsBA;eAAAA;;QAhBTC;eAAAA;;QAGAC;eAAAA;;;6DAbG;2DACD;sBACM;wEACE;uBACS;6BACJ;6BACA;;;;;;AAE5B,MAAMC,kBAAkB;IAAC;IAAO;IAAO;IAAO;IAAO;IAAO;IAAO;IAAO;IAAQ;CAAQ;AAC1F,MAAMC,qBAAqB;IAAC;IAAQ;IAAM;CAAO;AAC1C,MAAMH,kBAAkB;IAAC;IAAO;IAAQ;CAAO;AACtD,MAAMI,gCAAgCJ,gBAAgBK,GAAG,CAACC,CAAAA,MAAO,GAAGA,IAAI,KAAK,CAAC;AAEvE,MAAML,sBAAsB;IAC/BC;IACAC;IACAH;IACAI;CACH,CAACG,IAAI;AAEN,MAAMC,mBAAmB,IAAIC,OAAO,CAAC,aAAa,EAAET,gBAAgBU,IAAI,CAAC,KAAK,EAA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AAG,EAAEA,KAAK;SAAE;IAC7F,GACKoC,EAAE,CAAC,QAAQ,OAAO,EAAEC,OAAO,EAAEC,OAAO,EAAwC;QACzEd,UAAG,CAACG,IAAI,CAAC,CAAC,OAAO,EAAEU,QAAQ,IAAI,EAAEC,SAAS;QAC1C,IAAIpC,iBAAiBqC,IAAI,CAACF,UAAU;YAChCb,UAAG,CAACG,IAAI,CAAC,CAAC,qBAAqB,EAAEU,SAAS;YAC1C,MAAMrB,oBAAoBqB;QAC9B;IACJ,GACCD,EAAE,CAAC,eAAe,CAACb,QAAmBC,UAAG,CAACD,KAAK,CAACE,OAAOF;IAE5D,0DAA0D,GAC1D,IAAIiB,QAAQC,GAAG,CAACC,QAAQ,KAAK,QAAQ;QACjC,MAAM,IAAIZ,QAAc,KAAO;IACnC;AACJ;AAEA,eAAeX,QAAQwB,QAAgB;IACnC,IAAIA,SAASC,QAAQ,CAAC,UAAU;QAC5B,OAAOC,IAAAA,wBAAW,EAACF;IACvB;IACA,IAAIA,SAASC,QAAQ,CAAC,UAAU;QAC5B,OAAOE,IAAAA,wBAAW,EAACH;IACvB;AACJ"}
@@ -6,7 +6,6 @@ export * from './cli-os';
6
6
  export * from './compile';
7
7
  export * from './constants';
8
8
  export * from './eslint';
9
- export * from './get-bundle-command';
10
9
  export * from './get-exit-code';
11
10
  export * from './get-module-type';
12
11
  export * from './is-module-installed';
@@ -21,4 +20,5 @@ export * from './set-node-options';
21
20
  export * from './ts-config';
22
21
  export * from './type-check';
23
22
  export * from './watch-stdout';
23
+ export * from './with-exponential-backoff';
24
24
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,0BAA0B,CAAC;AACzC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAW1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,0BAA0B,CAAC;AACzC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAW1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC"}
@@ -10,7 +10,6 @@ _export_star(require("./cli-os"), exports);
10
10
  _export_star(require("./compile"), exports);
11
11
  _export_star(require("./constants"), exports);
12
12
  _export_star(require("./eslint"), exports);
13
- _export_star(require("./get-bundle-command"), exports);
14
13
  _export_star(require("./get-exit-code"), exports);
15
14
  _export_star(require("./get-module-type"), exports);
16
15
  _export_star(require("./is-module-installed"), exports);
@@ -25,6 +24,7 @@ _export_star(require("./set-node-options"), exports);
25
24
  _export_star(require("./ts-config"), exports);
26
25
  _export_star(require("./type-check"), exports);
27
26
  _export_star(require("./watch-stdout"), exports);
27
+ _export_star(require("./with-exponential-backoff"), exports);
28
28
  function _export_star(from, to) {
29
29
  Object.keys(from).forEach(function(k) {
30
30
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/cli/utils/index.ts"],"sourcesContent":["export * from './check-args';\nexport * from './check-startup-location';\nexport * from './cli-git';\nexport * from './cli-npm';\nexport * from './cli-os';\nexport * from './compile';\n/*\n * These modules eagerly load heavy dependencies (less, sass). Importing them\n * from the barrel causes every test that touches cli/utils to pay that cost\n * and spams \"Less has finished and no sheets were loaded\" in test output.\n * Import directly from the module instead (e.g., import { copyFiles } from './copy-files').\n *\n * export * from './compile-less';\n * export * from './compile-sass';\n * export * from './copy-files';\n */\nexport * from './constants';\nexport * from './eslint';\nexport * from './get-bundle-command';\nexport * from './get-exit-code';\nexport * from './get-module-type';\nexport * from './is-module-installed';\nexport * from './is-tty';\nexport * from './lerna-exec';\nexport * from './maybe-create-git-folder';\nexport * from './pipe-stdout';\nexport * from './process-tree';\nexport * from './publish';\nexport * from './resolve-bundler';\nexport * from './set-node-options';\n// Don't export ./stylelint, it breaks tests using the default \"jsdom\" environment\nexport * from './ts-config';\nexport * from './type-check';\nexport * from './watch-stdout';\n"],"names":[],"mappings":";;;;qBAAc;qBACA;qBACA;qBACA;qBACA;qBACA;qBAWA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBAEA;qBACA;qBACA"}
1
+ {"version":3,"sources":["../../../src/cli/utils/index.ts"],"sourcesContent":["export * from './check-args';\nexport * from './check-startup-location';\nexport * from './cli-git';\nexport * from './cli-npm';\nexport * from './cli-os';\nexport * from './compile';\n/*\n * These modules eagerly load heavy dependencies (less, sass). Importing them\n * from the barrel causes every test that touches cli/utils to pay that cost\n * and spams \"Less has finished and no sheets were loaded\" in test output.\n * Import directly from the module instead (e.g., import { copyFiles } from './copy-files').\n *\n * export * from './compile-less';\n * export * from './compile-sass';\n * export * from './copy-files';\n */\nexport * from './constants';\nexport * from './eslint';\nexport * from './get-exit-code';\nexport * from './get-module-type';\nexport * from './is-module-installed';\nexport * from './is-tty';\nexport * from './lerna-exec';\nexport * from './maybe-create-git-folder';\nexport * from './pipe-stdout';\nexport * from './process-tree';\nexport * from './publish';\nexport * from './resolve-bundler';\nexport * from './set-node-options';\n// Don't export ./stylelint, it breaks tests using the default \"jsdom\" environment\nexport * from './ts-config';\nexport * from './type-check';\nexport * from './watch-stdout';\nexport * from './with-exponential-backoff';\n"],"names":[],"mappings":";;;;qBAAc;qBACA;qBACA;qBACA;qBACA;qBACA;qBAWA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBAEA;qBACA;qBACA;qBACA"}
@@ -14,15 +14,11 @@ function _check_private_redeclaration(obj, privateCollection) {
14
14
  }
15
15
  }
16
16
  function _class_apply_descriptor_get(receiver, descriptor) {
17
- if (descriptor.get) {
18
- return descriptor.get.call(receiver);
19
- }
17
+ if (descriptor.get) return descriptor.get.call(receiver);
20
18
  return descriptor.value;
21
19
  }
22
20
  function _class_extract_field_descriptor(receiver, privateMap, action) {
23
- if (!privateMap.has(receiver)) {
24
- throw new TypeError("attempted to " + action + " private field on non-instance");
25
- }
21
+ if (!privateMap.has(receiver)) throw new TypeError("attempted to " + action + " private field on non-instance");
26
22
  return privateMap.get(receiver);
27
23
  }
28
24
  function _class_private_field_get(receiver, privateMap) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/cli/utils/process-tree.ts"],"sourcesContent":["interface HandlerResultObject {\n process: Promise<unknown>;\n onComplete?: Promise<unknown>;\n}\n\nexport type HandlerResult = HandlerResultObject | Promise<unknown>;\n\nfunction isHandlerResultObject(result: HandlerResult): result is HandlerResultObject {\n return 'process' in result;\n}\n\nexport class ProcessTree<T extends Record<any, any> = never> {\n readonly #entries: Map<\n T,\n {\n handler: () => HandlerResult;\n dependsOn: T[keyof T][];\n process?: Promise<unknown>;\n onComplete?: Promise<unknown>;\n }\n > = new Map();\n\n add(\n name: T[keyof T],\n handler: () => HandlerResult,\n {\n dependsOn = [],\n }: {\n dependsOn?: T[keyof T][];\n } = {}\n ) {\n dependsOn.forEach(item => {\n if (!this.#entries.has(item)) {\n throw new Error(`Unknown process dependency: ${item}`);\n }\n });\n this.#entries.set(name, { handler, dependsOn });\n }\n\n run() {\n [...this.#entries.keys()].forEach(item => {\n const entry = this.#entries.get(item)!;\n\n const handlerResult = Promise.all(\n entry.dependsOn.map(item => this.#entries.get(item)!.onComplete).filter(el => !!el)\n ).then(() => ({ result: entry.handler() }));\n\n entry.process = handlerResult.then(({ result }) =>\n isHandlerResultObject(result) ? result.process : result\n );\n entry.onComplete = handlerResult.then(({ result }) =>\n isHandlerResultObject(result) ? (result.onComplete ?? result.process) : result\n );\n });\n return Promise.all(\n [...this.#entries.values()].map(item => item.process).filter(el => !!el)\n );\n }\n}\n"],"names":["ProcessTree","isHandlerResultObject","result","add","name","handler","dependsOn","forEach","item","has","Error","set","run","keys","entry","get","handlerResult","Promise","all","map","onComplete","filter","el","then","process","values","Map"],"mappings":";;;;+BAWaA;;;eAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAJb,SAASC,sBAAsBC,MAAqB;IAChD,OAAO,aAAaA;AACxB;IAGa;AADN,MAAMF;IAWTG,IACIC,IAAgB,EAChBC,OAA4B,EAC5B,EACIC,YAAY,EAAE,EAGjB,GAAG,CAAC,CAAC,EACR;QACEA,UAAUC,OAAO,CAACC,CAAAA;YACd,IAAI,CAAC,yBAAA,IAAI,EAAC,UAASC,GAAG,CAACD,OAAO;gBAC1B,MAAM,IAAIE,MAAM,CAAC,4BAA4B,EAAEF,MAAM;YACzD;QACJ;QACA,yBAAA,IAAI,EAAC,UAASG,GAAG,CAACP,MAAM;YAAEC;YAASC;QAAU;IACjD;IAEAM,MAAM;QACF;eAAI,yBAAA,IAAI,EAAC,UAASC,IAAI;SAAG,CAACN,OAAO,CAACC,CAAAA;YAC9B,MAAMM,QAAQ,yBAAA,IAAI,EAAC,UAASC,GAAG,CAACP;YAEhC,MAAMQ,gBAAgBC,QAAQC,GAAG,CAC7BJ,MAAMR,SAAS,CAACa,GAAG,CAACX,CAAAA,OAAQ,yBAAA,IAAI,EAAC,UAASO,GAAG,CAACP,MAAOY,UAAU,EAAEC,MAAM,CAACC,CAAAA,KAAM,CAAC,CAACA,KAClFC,IAAI,CAAC,IAAO,CAAA;oBAAErB,QAAQY,MAAMT,OAAO;gBAAG,CAAA;YAExCS,MAAMU,OAAO,GAAGR,cAAcO,IAAI,CAAC,CAAC,EAAErB,MAAM,EAAE,GAC1CD,sBAAsBC,UAAUA,OAAOsB,OAAO,GAAGtB;YAErDY,MAAMM,UAAU,GAAGJ,cAAcO,IAAI,CAAC,CAAC,EAAErB,MAAM,EAAE;oBACZA;uBAAjCD,sBAAsBC,WAAWA,qBAAAA,OAAOkB,UAAU,cAAjBlB,gCAAAA,qBAAqBA,OAAOsB,OAAO,GAAItB;;QAEhF;QACA,OAAOe,QAAQC,GAAG,CACd;eAAI,yBAAA,IAAI,EAAC,UAASO,MAAM;SAAG,CAACN,GAAG,CAACX,CAAAA,OAAQA,KAAKgB,OAAO,EAAEH,MAAM,CAACC,CAAAA,KAAM,CAAC,CAACA;IAE7E;;QA7CA,gCAAS;;mBAQL,IAAII;;;AAsCZ"}
1
+ {"version":3,"sources":["../../../src/cli/utils/process-tree.ts"],"sourcesContent":["interface HandlerResultObject {\n process: Promise<unknown>;\n onComplete?: Promise<unknown>;\n}\n\nexport type HandlerResult = HandlerResultObject | Promise<unknown>;\n\nfunction isHandlerResultObject(result: HandlerResult): result is HandlerResultObject {\n return 'process' in result;\n}\n\nexport class ProcessTree<T extends Record<any, any> = never> {\n readonly #entries: Map<\n T,\n {\n handler: () => HandlerResult;\n dependsOn: T[keyof T][];\n process?: Promise<unknown>;\n onComplete?: Promise<unknown>;\n }\n > = new Map();\n\n add(\n name: T[keyof T],\n handler: () => HandlerResult,\n {\n dependsOn = [],\n }: {\n dependsOn?: T[keyof T][];\n } = {}\n ) {\n dependsOn.forEach(item => {\n if (!this.#entries.has(item)) {\n throw new Error(`Unknown process dependency: ${item}`);\n }\n });\n this.#entries.set(name, { handler, dependsOn });\n }\n\n run() {\n [...this.#entries.keys()].forEach(item => {\n const entry = this.#entries.get(item)!;\n\n const handlerResult = Promise.all(\n entry.dependsOn.map(item => this.#entries.get(item)!.onComplete).filter(el => !!el)\n ).then(() => ({ result: entry.handler() }));\n\n entry.process = handlerResult.then(({ result }) =>\n isHandlerResultObject(result) ? result.process : result\n );\n entry.onComplete = handlerResult.then(({ result }) =>\n isHandlerResultObject(result) ? (result.onComplete ?? result.process) : result\n );\n });\n return Promise.all(\n [...this.#entries.values()].map(item => item.process).filter(el => !!el)\n );\n }\n}\n"],"names":["ProcessTree","isHandlerResultObject","result","add","name","handler","dependsOn","forEach","item","has","Error","set","run","keys","entry","get","handlerResult","Promise","all","map","onComplete","filter","el","then","process","values","Map"],"mappings":";;;;+BAWaA;;;eAAAA;;;;;;;;;;;;;;;;;;;;;;;;AAJb,SAASC,sBAAsBC,MAAqB;IAChD,OAAO,aAAaA;AACxB;IAGa;AADN,MAAMF;IAWTG,IACIC,IAAgB,EAChBC,OAA4B,EAC5B,EACIC,YAAY,EAAE,EAGjB,GAAG,CAAC,CAAC,EACR;QACEA,UAAUC,OAAO,CAACC,CAAAA;YACd,IAAI,CAAC,yBAAA,IAAI,EAAC,UAASC,GAAG,CAACD,OAAO;gBAC1B,MAAM,IAAIE,M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AAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAMD,wBAAgB,cAAc,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAWzD"}
1
+ {"version":3,"file":"resolve-bundler.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/resolve-bundler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,OAAO,EAAyB,MAAM,aAAa,CAAC;AAElE,UAAU,WAAW;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAMD,wBAAgB,cAAc,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAWzD"}
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "resolveBundler", {
8
8
  return resolveBundler;
9
9
  }
10
10
  });
11
+ const _core = require("../../core");
11
12
  const _utils = require("../../utils");
12
13
  function resolveBundler(args) {
13
14
  var _getConfiguration_bundler;
@@ -18,7 +19,7 @@ function resolveBundler(args) {
18
19
  _utils.log.warning('--use-vite is deprecated. Use --bundler=vite instead.');
19
20
  return 'vite';
20
21
  }
21
- return (_getConfiguration_bundler = (0, _utils.getConfiguration)().bundler) !== null && _getConfiguration_bundler !== void 0 ? _getConfiguration_bundler : 'webpack';
22
+ return (_getConfiguration_bundler = (0, _utils.getConfiguration)().bundler) !== null && _getConfiguration_bundler !== void 0 ? _getConfiguration_bundler : _core.bundleConstants.defaultBundler;
22
23
  }
23
24
 
24
25
  //# sourceMappingURL=resolve-bundler.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/cli/utils/resolve-bundler.ts"],"sourcesContent":["import { type Bundler, getConfiguration, log } from '../../utils';\n\ninterface BundlerArgs {\n bundler?: Bundler;\n useVite?: boolean;\n}\n\n/*\n * Resolves the bundler from the --bundler flag, then the deprecated --use-vite\n * flag, then the cli.bundler package.json config, then the webpack default.\n */\nexport function resolveBundler(args: BundlerArgs): Bundler {\n if (args.bundler) {\n return args.bundler;\n }\n\n if (args.useVite) {\n log.warning('--use-vite is deprecated. Use --bundler=vite instead.');\n return 'vite';\n }\n\n return getConfiguration().bundler ?? 'webpack';\n}\n"],"names":["resolveBundler","args","getConfiguration","bundler","useVite","log","warning"],"mappings":";;;;+BAWgBA;;;eAAAA;;;uBAXoC;AAW7C,SAASA,eAAeC,IAAiB;QAUrCC;IATP,IAAID,KAAKE,OAAO,EAAE;QACd,OAAOF,KAAKE,OAAO;IACvB;IAEA,IAAIF,KAAKG,OAAO,EAAE;QACdC,UAAG,CAACC,OAAO,CAAC;QACZ,OAAO;IACX;IAEA,QAAOJ,4BAAAA,IAAAA,uBAAgB,IAAGC,OAAO,cAA1BD,uCAAAA,4BAA8B;AACzC"}
1
+ {"version":3,"sources":["../../../src/cli/utils/resolve-bundler.ts"],"sourcesContent":["import { bundleConstants } from '../../core';\nimport { type Bundler, getConfiguration, log } from '../../utils';\n\ninterface BundlerArgs {\n bundler?: Bundler;\n useVite?: boolean;\n}\n\n/*\n * Resolves the bundler from the --bundler flag, then the deprecated --use-vite\n * flag, then the cli.bundler package.json config, then the webpack default.\n */\nexport function resolveBundler(args: BundlerArgs): Bundler {\n if (args.bundler) {\n return args.bundler;\n }\n\n if (args.useVite) {\n log.warning('--use-vite is deprecated. Use --bundler=vite instead.');\n return 'vite';\n }\n\n return getConfiguration().bundler ?? bundleConstants.defaultBundler;\n}\n"],"names":["resolveBundler","args","getConfiguration","bundler","useVite","log","warning","bundleConstants","defaultBundler"],"mappings":";;;;+BAYgBA;;;eAAAA;;;sBAZgB;uBACoB;AAW7C,SAASA,eAAeC,IAAiB;QAUrCC;IATP,IAAID,KAAKE,OAAO,EAAE;QACd,OAAOF,KAAKE,OAAO;IACvB;IAEA,IAAIF,KAAKG,OAAO,EAAE;QACdC,UAAG,CAACC,OAAO,CAAC;QACZ,OAAO;IACX;IAEA,QAAOJ,4BAAAA,IAAAA,uBAAgB,IAAGC,OAAO,cAA1BD,uCAAAA,4BAA8BK,qBAAe,CAACC,cAAc;AACvE"}
@@ -1,5 +1,5 @@
1
1
  export declare class TSConfig {
2
- private readonly configPath;
2
+ readonly configPath: string;
3
3
  private readonly json;
4
4
  constructor(configPath: string);
5
5
  getValue<T>(key: string, defaultValue: T): NoInfer<T>;
@@ -1 +1 @@
1
- {"version":3,"file":"ts-config.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/ts-config.ts"],"names":[],"mappings":"AAIA,qBAAa,QAAQ;IAGL,OAAO,CAAC,QAAQ,CAAC,UAAU;IAFvC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAmB;gBAEX,UAAU,EAAE,MAAM;IAK/C,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IACrD,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS;IAOzD,OAAO,CAAC,gBAAgB;IAkBxB,OAAO,CAAC,cAAc;IAetB,OAAO,CAAC,OAAO;CAUlB"}
1
+ {"version":3,"file":"ts-config.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/ts-config.ts"],"names":[],"mappings":"AAIA,qBAAa,QAAQ;IAGL,QAAQ,CAAC,UAAU,EAAE,MAAM;IAFvC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAmB;gBAEnB,UAAU,EAAE,MAAM;IAKvC,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IACrD,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS;IAOzD,OAAO,CAAC,gBAAgB;IAkBxB,OAAO,CAAC,cAAc;IAetB,OAAO,CAAC,OAAO;CAUlB"}
@@ -19,9 +19,7 @@ function _define_property(obj, key, value) {
19
19
  configurable: true,
20
20
  writable: true
21
21
  });
22
- } else {
23
- obj[key] = value;
24
- }
22
+ } else obj[key] = value;
25
23
  return obj;
26
24
  }
27
25
  function _interop_require_default(obj) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/cli/utils/ts-config.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport { readJson } from '../../utils';\n\nexport class TSConfig {\n private readonly json: Map<string, any>;\n\n constructor(private readonly configPath: string) {\n this.json = new Map();\n }\n\n // Overload signatures\n getValue<T>(key: string, defaultValue: T): NoInfer<T>;\n getValue<T>(key: string, defaultValue?: T): T | undefined;\n\n // Implementation signature\n getValue<T>(key: string, defaultValue?: T) {\n return this.getValueInternal<T>(this.configPath, key.split('.'), defaultValue);\n }\n\n private getValueInternal<T>(configPath: string, key: string[], defaultValue?: T): T {\n const config = this.getJson<{ extends?: string }>(configPath);\n const value = key.reduce<any>((result, el) => {\n return result && typeof result === 'object' ? result[el] : undefined;\n }, config);\n\n if (value !== undefined) {\n return value;\n }\n\n const extendsPath = this.getExtendsPath(configPath, config);\n if (extendsPath) {\n return this.getValueInternal(extendsPath, key, defaultValue);\n }\n\n return defaultValue as T;\n }\n\n private getExtendsPath(configPath: string, config: { extends?: string }) {\n if (!config.extends) {\n return;\n }\n\n if (!/^\\.?\\.\\//.test(config.extends)) {\n return require.resolve(config.extends);\n }\n\n const dir = path.dirname(configPath);\n return [config.extends, `${config.extends}.json`]\n .map(name => path.join(dir, name))\n .find(fs.existsSync);\n }\n\n private getJson<T>(configPath: string): T {\n let result: T = this.json.get(configPath);\n\n if (!result) {\n result = readJson<T>(configPath);\n this.json.set(configPath, result);\n }\n\n return result;\n }\n}\n"],"names":["TSConfig","getValue","key","defaultValue","getValueInternal","configPath","split","config","getJson","value","reduce","result","el","undefined","extendsPath","getExtendsPath","extends","test","require","resolve","dir","path","dirname","map","name","join","find","fs","existsSync","json","get","readJson","set","Map"],"mappings":";;;;+BAIaA;;;eAAAA;;;2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AAI,CAACwB,IAAI,CAACG,GAAG,CAAC3B,YAAYM;QAC9B;QAEA,OAAOA;IACX;IAvDA,YAAY,AAAiBN,UAAkB,CAAE;;QAFjD,uBAAiBwB,QAAjB,KAAA;aAE6BxB,aAAAA;QACzB,IAAI,CAACwB,IAAI,GAAG,IAAII;IACpB;AAsDJ"}
1
+ {"version":3,"sources":["../../../src/cli/utils/ts-config.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport { readJson } from '../../utils';\n\nexport class TSConfig {\n private readonly json: Map<string, any>;\n\n constructor(readonly configPath: string) {\n this.json = new Map();\n }\n\n // Overload signatures\n getValue<T>(key: string, defaultValue: T): NoInfer<T>;\n getValue<T>(key: string, defaultValue?: T): T | undefined;\n\n // Implementation signature\n getValue<T>(key: string, defaultValue?: T) {\n return this.getValueInternal<T>(this.configPath, key.split('.'), defaultValue);\n }\n\n private getValueInternal<T>(configPath: string, key: string[], defaultValue?: T): T {\n const config = this.getJson<{ extends?: string }>(configPath);\n const value = key.reduce<any>((result, el) => {\n return result && typeof result === 'object' ? result[el] : undefined;\n }, config);\n\n if (value !== undefined) {\n return value;\n }\n\n const extendsPath = this.getExtendsPath(configPath, config);\n if (extendsPath) {\n return this.getValueInternal(extendsPath, key, defaultValue);\n }\n\n return defaultValue as T;\n }\n\n private getExtendsPath(configPath: string, config: { extends?: string }) {\n if (!config.extends) {\n return;\n }\n\n if (!/^\\.?\\.\\//.test(config.extends)) {\n return require.resolve(config.extends);\n }\n\n const dir = path.dirname(configPath);\n return [config.extends, `${config.extends}.json`]\n .map(name => path.join(dir, name))\n .find(fs.existsSync);\n }\n\n private getJson<T>(configPath: string): T {\n let result: T = this.json.get(configPath);\n\n if (!result) {\n result = readJson<T>(configPath);\n this.json.set(configPath, result);\n }\n\n return result;\n }\n}\n"],"names":["TSConfig","getValue","key","defaultValue","getValueInternal","configPath","split","config","getJson","value","reduce","result","el","undefined","extendsPath","getExtendsPath","extends","test","require","resolve","dir","path","dirname","map","name","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AAI,CAACM,QAAQ;YACTA,SAASoB,IAAAA,eAAQ,EAAI1B;YACrB,IAAI,CAACwB,IAAI,CAACG,GAAG,CAAC3B,YAAYM;QAC9B;QAEA,OAAOA;IACX;IAvDA,YAAY,AAASN,UAAkB,CAAE;;QAFzC,uBAAiBwB,QAAjB,KAAA;aAEqBxB,aAAAA;QACjB,IAAI,CAACwB,IAAI,GAAG,IAAII;IACpB;AAsDJ"}
@@ -0,0 +1,7 @@
1
+ export interface WithExponentialBackoffConfig {
2
+ initialDelay?: number;
3
+ maxRetries?: number;
4
+ onRetry?: (delay: number, error: unknown) => void;
5
+ }
6
+ export declare function withExponentialBackoff<T>(callback: () => Promise<T>, config?: WithExponentialBackoffConfig): Promise<T>;
7
+ //# sourceMappingURL=with-exponential-backoff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with-exponential-backoff.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/with-exponential-backoff.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,4BAA4B;IACzC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACrD;AAED,wBAAsB,sBAAsB,CAAC,CAAC,EAC1C,QAAQ,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAC1B,MAAM,GAAE,4BAAiC,GAC1C,OAAO,CAAC,CAAC,CAAC,CAkBZ"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "withExponentialBackoff", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return withExponentialBackoff;
9
+ }
10
+ });
11
+ async function withExponentialBackoff(callback, config = {}) {
12
+ const { initialDelay = 500, maxRetries = 5, onRetry } = config;
13
+ const attempt = async (attemptNumber, delay)=>{
14
+ try {
15
+ return await callback();
16
+ } catch (error) {
17
+ if (attemptNumber >= maxRetries) {
18
+ throw error;
19
+ }
20
+ onRetry === null || onRetry === void 0 ? void 0 : onRetry(delay, error);
21
+ await new Promise((resolve)=>setTimeout(resolve, delay));
22
+ return attempt(attemptNumber + 1, delay * 2);
23
+ }
24
+ };
25
+ return attempt(1, initialDelay);
26
+ }
27
+
28
+ //# sourceMappingURL=with-exponential-backoff.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/cli/utils/with-exponential-backoff.ts"],"sourcesContent":["export interface WithExponentialBackoffConfig {\n initialDelay?: number;\n maxRetries?: number;\n onRetry?: (delay: number, error: unknown) => void;\n}\n\nexport async function withExponentialBackoff<T>(\n callback: () => Promise<T>,\n config: WithExponentialBackoffConfig = {}\n): Promise<T> {\n const { initialDelay = 500, maxRetries = 5, onRetry } = config;\n\n const attempt = async (attemptNumber: number, delay: number): Promise<T> => {\n try {\n return await callback();\n } catch (error) {\n if (attemptNumber >= maxRetries) {\n throw error;\n }\n\n onRetry?.(delay, error);\n await new Promise(resolve => setTimeout(resolve, delay));\n return attempt(attemptNumber + 1, delay * 2);\n }\n };\n\n return attempt(1, initialDelay);\n}\n"],"names":["withExponentialBackoff","callback","config","initialDelay","maxRetries","onRetry","attempt","attemptNumber","delay","error","Promise","resolve","setTimeout"],"mappings":";;;;+BAMsBA;;;eAAAA;;;AAAf,eAAeA,uBAClBC,QAA0B,EAC1BC,SAAuC,CAAC,CAAC;IAEzC,MAAM,EAAEC,eAAe,GAAG,EAAEC,aAAa,CAAC,EAAEC,OAAO,EAAE,GAAGH;IAExD,MAAMI,UAAU,OAAOC,eAAuBC;QAC1C,IAAI;YACA,OAAO,MAAMP;QACjB,EAAE,OAAOQ,OAAO;YACZ,IAAIF,iBAAiBH,YAAY;gBAC7B,MAAMK;YACV;YAEAJ,oBAAAA,8BAAAA,QAAUG,OAAOC;YACjB,MAAM,IAAIC,QAAQC,CAAAA,UAAWC,WAAWD,SAASH;YACjD,OAAOF,QAAQC,gBAAgB,GAAGC,QAAQ;QAC9C;IACJ;IAEA,OAAOF,QAAQ,GAAGH;AACtB"}
@@ -13,5 +13,7 @@ export declare const bundleConstants: {
13
13
  readonly production: "production";
14
14
  readonly development: "development";
15
15
  };
16
+ readonly bundlers: readonly ["vite", "webpack"];
17
+ readonly defaultBundler: "webpack";
16
18
  };
17
19
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/core/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;CAelB,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/core/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;CAiBlB,CAAC"}
@@ -22,7 +22,12 @@ const bundleConstants = {
22
22
  mode: {
23
23
  production: 'production',
24
24
  development: 'development'
25
- }
25
+ },
26
+ bundlers: [
27
+ 'vite',
28
+ 'webpack'
29
+ ],
30
+ defaultBundler: 'webpack'
26
31
  };
27
32
 
28
33
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/core/constants.ts"],"sourcesContent":["export const bundleConstants = {\n cssModules: {\n classnameTemplate: {\n production: '[local]__[hash:base64:5]',\n development: '[path][name]__[local]',\n },\n localsConvention: 'camelCaseOnly',\n },\n less: {\n math: 'always',\n },\n mode: {\n production: 'production',\n development: 'development',\n },\n} as const;\n"],"names":["bundleConstants","cssModules","classnameTemplate","production","development","localsConvention","less","math","mode"],"mappings":";;;;+BAAaA;;;eAAAA;;;AAAN,MAAMA,kBAAkB;IAC3BC,YAAY;QACRC,mBAAmB;YACfC,YAAY;YACZC,aAAa;QACjB;QACAC,kBAAkB;IACtB;IACAC,MAAM;QACFC,MAAM;IACV;IACAC,MAAM;QACFL,YAAY;QACZC,aAAa;IACjB;AACJ"}
1
+ {"version":3,"sources":["../../src/core/constants.ts"],"sourcesContent":["export const bundleConstants = {\n cssModules: {\n classnameTemplate: {\n production: '[local]__[hash:base64:5]',\n development: '[path][name]__[local]',\n },\n localsConvention: 'camelCaseOnly',\n },\n less: {\n math: 'always',\n },\n mode: {\n production: 'production',\n development: 'development',\n },\n bundlers: ['vite', 'webpack'],\n defaultBundler: 'webpack',\n} as const;\n"],"names":["bundleConstants","cssModules","classnameTemplate","production","development","localsConvention","less","math","mode","bundlers","defaultBundler"],"mappings":";;;;+BAAaA;;;eAAAA;;;AAAN,MAAMA,kBAAkB;IAC3BC,YAAY;QACRC,mBAAmB;YACfC,YAAY;YACZC,aAAa;QACjB;QACAC,kBAAkB;IACtB;IACAC,MAAM;QACFC,MAAM;IACV;IACAC,MAAM;QACFL,YAAY;QACZC,aAAa;IACjB;IACAK,UAAU;QAAC;QAAQ;KAAU;IAC7BC,gBAAgB;AACpB"}
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Applies patch-package patches after startup is installed in a consumer project.
3
+ *
4
+ * Under npm, patch-package finds packages directly in node_modules/. Under pnpm,
5
+ * packages live in the .pnpm store and aren't at their expected node_modules/<pkg>
6
+ * paths. This script bridges the gap by creating temporary symlinks so
7
+ * patch-package can locate and patch them, then cleans up the symlinks afterward.
8
+ *
9
+ * Only runs when startup is installed inside a project directory (not globally
10
+ * or in an npx cache). Failures are logged as warnings to avoid blocking installs.
11
+ */
12
+ const { execFileSync } = require('child_process');
13
+ const fs = require('fs');
14
+ const path = require('path');
15
+
16
+ /**
17
+ * Parse patch filenames and resolve each package's install location in the
18
+ * .pnpm store. Returns an array of { pkg, link, target } for packages that
19
+ * need a temporary symlink (i.e., not already at node_modules/<pkg>).
20
+ *
21
+ * Expected filename format (patch-package convention):
22
+ * <name>+<version>.patch — e.g., jsdom+26.1.0.patch
23
+ * <name>+<version>.dev.patch — e.g., jsdom+26.1.0.dev.patch
24
+ * @<scope>+<name>+<version>.patch — e.g., @babel+core+7.28.5.patch
25
+ */
26
+ function getPnpmPatchTargets(cwd, patchDir) {
27
+ const pnpmDir = path.join(cwd, 'node_modules', '.pnpm');
28
+ if (!fs.existsSync(pnpmDir)) {
29
+ return [];
30
+ }
31
+
32
+ const targets = [];
33
+ for (const file of fs.readdirSync(patchDir).filter(f => f.endsWith('.patch'))) {
34
+ const match = file.match(/^(?<name>.+)\+\d/);
35
+ if (!match?.groups) {
36
+ continue;
37
+ }
38
+
39
+ const { name } = match.groups;
40
+ const pkg = name.replace(/\+/, '/'); // @scope+name -> @scope/name
41
+ const link = path.join(cwd, 'node_modules', pkg);
42
+ if (fs.existsSync(link)) {
43
+ // already exists
44
+ continue;
45
+ }
46
+
47
+ const entry = fs.readdirSync(pnpmDir).find(e => e.startsWith(`${name}@`));
48
+ if (!entry) {
49
+ // package not installed (e.g., .dev patch in production install)
50
+ continue;
51
+ }
52
+
53
+ targets.push({
54
+ pkg,
55
+ link,
56
+ target: path.join(pnpmDir, entry, 'node_modules', pkg),
57
+ });
58
+ }
59
+ return targets;
60
+ }
61
+
62
+ /*
63
+ * For pnpm, patch-package can't find packages because they live in the .pnpm
64
+ * store instead of node_modules/<pkg>. We create temporary symlinks so
65
+ * patch-package can find them, then clean up after.
66
+ */
67
+ function addPnpmSymlinks(targets) {
68
+ for (const { link, target } of targets) {
69
+ fs.mkdirSync(path.dirname(link), { recursive: true });
70
+ fs.symlinkSync(target, link);
71
+ }
72
+ }
73
+
74
+ function removePnpmSymlinks(targets) {
75
+ for (const { link } of targets) {
76
+ fs.unlinkSync(link);
77
+ }
78
+ }
79
+
80
+ function main() {
81
+ const cwd = process.env.INIT_CWD;
82
+ const patchDir = path.resolve('patches');
83
+ const relativePatchDir = path.relative(cwd, patchDir);
84
+ const isInstalledInCurrentDirectory = patchDir.startsWith(path.resolve(cwd));
85
+
86
+ // Only apply patches when installed in project (as opposed to globally or in npx cache)
87
+ if (!fs.existsSync('package.json') || !isInstalledInCurrentDirectory) {
88
+ return;
89
+ }
90
+
91
+ const patchTargets = getPnpmPatchTargets(cwd, patchDir);
92
+ addPnpmSymlinks(patchTargets);
93
+ try {
94
+ execFileSync('patch-package', ['--error-on-fail', '--patch-dir', relativePatchDir], {
95
+ cwd,
96
+ shell: process.platform === 'win32',
97
+ stdio: 'inherit',
98
+ });
99
+ } finally {
100
+ removePnpmSymlinks(patchTargets);
101
+ }
102
+ }
103
+
104
+ // Only run when executed directly (e.g., `node postinstall.js`), not when imported (e.g., in tests).
105
+ /* istanbul ignore next */
106
+ if (require.main === module) {
107
+ try {
108
+ main();
109
+ } catch (e) {
110
+ /*
111
+ * To avoid disrupting workflows only log warning when postinstall fails.
112
+ * To see detailed error, run npm with --foreground-scripts option.
113
+ */
114
+ console.warn(`postinstall failed`, e); // eslint-disable-line no-console
115
+ }
116
+ }
117
+
118
+ module.exports = { main };