@xylabs/ts-scripts-yarn3 3.15.16 → 4.0.0-rc.10

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 (353) hide show
  1. package/dist/actions/compile.mjs +3 -2
  2. package/dist/actions/compile.mjs.map +1 -1
  3. package/dist/actions/index.mjs +96 -287
  4. package/dist/actions/index.mjs.map +1 -1
  5. package/dist/actions/package/compile/compile.mjs +57 -259
  6. package/dist/actions/package/compile/compile.mjs.map +1 -1
  7. package/dist/actions/package/compile/index.mjs +57 -259
  8. package/dist/actions/package/compile/index.mjs.map +1 -1
  9. package/dist/actions/package/compile/packageCompileTsc.mjs +1 -1
  10. package/dist/actions/package/compile/packageCompileTsc.mjs.map +1 -1
  11. package/dist/actions/package/compile/packageCompileTscTypes.mjs +2 -36
  12. package/dist/actions/package/compile/packageCompileTscTypes.mjs.map +1 -1
  13. package/dist/actions/package/compile/packageCompileTsup.mjs +54 -339
  14. package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -1
  15. package/dist/actions/package/index.mjs +72 -277
  16. package/dist/actions/package/index.mjs.map +1 -1
  17. package/dist/actions/package/recompile.mjs +58 -263
  18. package/dist/actions/package/recompile.mjs.map +1 -1
  19. package/dist/actions/recompile.mjs +14 -1
  20. package/dist/actions/recompile.mjs.map +1 -1
  21. package/dist/bin/package/compile-only.mjs +59 -261
  22. package/dist/bin/package/compile-only.mjs.map +1 -1
  23. package/dist/bin/package/compile-tsup.mjs +56 -341
  24. package/dist/bin/package/compile-tsup.mjs.map +1 -1
  25. package/dist/bin/package/compile.mjs +59 -261
  26. package/dist/bin/package/compile.mjs.map +1 -1
  27. package/dist/bin/package/recompile.mjs +60 -265
  28. package/dist/bin/package/recompile.mjs.map +1 -1
  29. package/dist/bin/xy-ts.mjs +17 -3
  30. package/dist/bin/xy-ts.mjs.map +1 -1
  31. package/dist/bin/xy.mjs +17 -3
  32. package/dist/bin/xy.mjs.map +1 -1
  33. package/dist/index.d.ts +1 -1
  34. package/dist/index.mjs +106 -297
  35. package/dist/index.mjs.map +1 -1
  36. package/dist/xy/index.mjs +17 -3
  37. package/dist/xy/index.mjs.map +1 -1
  38. package/dist/xy/xy.mjs +17 -3
  39. package/dist/xy/xy.mjs.map +1 -1
  40. package/dist/xy/xyBuildCommands.mjs +17 -3
  41. package/dist/xy/xyBuildCommands.mjs.map +1 -1
  42. package/package.json +10 -20
  43. package/src/actions/compile.ts +2 -2
  44. package/src/actions/package/compile/XyConfig.ts +2 -2
  45. package/src/actions/package/compile/packageCompileTsc.ts +1 -1
  46. package/src/actions/package/compile/packageCompileTscTypes.ts +3 -8
  47. package/src/actions/package/compile/packageCompileTsup.ts +54 -130
  48. package/src/actions/package/recompile.ts +1 -1
  49. package/src/actions/recompile.ts +2 -1
  50. package/tsup.config.ts +1 -1
  51. package/dist/actions/build.cjs +0 -208
  52. package/dist/actions/build.cjs.map +0 -1
  53. package/dist/actions/clean-docs.cjs +0 -74
  54. package/dist/actions/clean-docs.cjs.map +0 -1
  55. package/dist/actions/clean-eslint.cjs +0 -53
  56. package/dist/actions/clean-eslint.cjs.map +0 -1
  57. package/dist/actions/clean-jest.cjs +0 -147
  58. package/dist/actions/clean-jest.cjs.map +0 -1
  59. package/dist/actions/clean.cjs +0 -192
  60. package/dist/actions/clean.cjs.map +0 -1
  61. package/dist/actions/compile.cjs +0 -217
  62. package/dist/actions/compile.cjs.map +0 -1
  63. package/dist/actions/copy-assets.cjs +0 -121
  64. package/dist/actions/copy-assets.cjs.map +0 -1
  65. package/dist/actions/cycle.cjs +0 -156
  66. package/dist/actions/cycle.cjs.map +0 -1
  67. package/dist/actions/dead.cjs +0 -148
  68. package/dist/actions/dead.cjs.map +0 -1
  69. package/dist/actions/deploy-major.cjs +0 -160
  70. package/dist/actions/deploy-major.cjs.map +0 -1
  71. package/dist/actions/deploy-minor.cjs +0 -160
  72. package/dist/actions/deploy-minor.cjs.map +0 -1
  73. package/dist/actions/deploy-next.cjs +0 -160
  74. package/dist/actions/deploy-next.cjs.map +0 -1
  75. package/dist/actions/deploy.cjs +0 -160
  76. package/dist/actions/deploy.cjs.map +0 -1
  77. package/dist/actions/deps.cjs +0 -205
  78. package/dist/actions/deps.cjs.map +0 -1
  79. package/dist/actions/dupdeps.cjs +0 -226
  80. package/dist/actions/dupdeps.cjs.map +0 -1
  81. package/dist/actions/fix.cjs +0 -149
  82. package/dist/actions/fix.cjs.map +0 -1
  83. package/dist/actions/gen-docs.cjs +0 -186
  84. package/dist/actions/gen-docs.cjs.map +0 -1
  85. package/dist/actions/gitignore-gen.cjs +0 -138
  86. package/dist/actions/gitignore-gen.cjs.map +0 -1
  87. package/dist/actions/gitlint-fix.cjs +0 -69
  88. package/dist/actions/gitlint-fix.cjs.map +0 -1
  89. package/dist/actions/gitlint.cjs +0 -84
  90. package/dist/actions/gitlint.cjs.map +0 -1
  91. package/dist/actions/index.cjs +0 -2600
  92. package/dist/actions/index.cjs.map +0 -1
  93. package/dist/actions/license.cjs +0 -133
  94. package/dist/actions/license.cjs.map +0 -1
  95. package/dist/actions/lint-clean.cjs +0 -227
  96. package/dist/actions/lint-clean.cjs.map +0 -1
  97. package/dist/actions/lint-profile.cjs +0 -153
  98. package/dist/actions/lint-profile.cjs.map +0 -1
  99. package/dist/actions/lint.cjs +0 -217
  100. package/dist/actions/lint.cjs.map +0 -1
  101. package/dist/actions/npmignore-gen.cjs +0 -138
  102. package/dist/actions/npmignore-gen.cjs.map +0 -1
  103. package/dist/actions/package/clean-outputs.cjs +0 -56
  104. package/dist/actions/package/clean-outputs.cjs.map +0 -1
  105. package/dist/actions/package/clean-typescript.cjs +0 -56
  106. package/dist/actions/package/clean-typescript.cjs.map +0 -1
  107. package/dist/actions/package/clean.cjs +0 -83
  108. package/dist/actions/package/clean.cjs.map +0 -1
  109. package/dist/actions/package/compile/XyConfig.cjs +0 -19
  110. package/dist/actions/package/compile/XyConfig.cjs.map +0 -1
  111. package/dist/actions/package/compile/buildEntries.cjs +0 -68
  112. package/dist/actions/package/compile/buildEntries.cjs.map +0 -1
  113. package/dist/actions/package/compile/compile.cjs +0 -565
  114. package/dist/actions/package/compile/compile.cjs.map +0 -1
  115. package/dist/actions/package/compile/copyTypeFiles.cjs +0 -60
  116. package/dist/actions/package/compile/copyTypeFiles.cjs.map +0 -1
  117. package/dist/actions/package/compile/getCompilerOptions.cjs +0 -67
  118. package/dist/actions/package/compile/getCompilerOptions.cjs.map +0 -1
  119. package/dist/actions/package/compile/index.cjs +0 -571
  120. package/dist/actions/package/compile/index.cjs.map +0 -1
  121. package/dist/actions/package/compile/inputs.cjs +0 -79
  122. package/dist/actions/package/compile/inputs.cjs.map +0 -1
  123. package/dist/actions/package/compile/packageCompileTsc.cjs +0 -164
  124. package/dist/actions/package/compile/packageCompileTsc.cjs.map +0 -1
  125. package/dist/actions/package/compile/packageCompileTscTypes.cjs +0 -199
  126. package/dist/actions/package/compile/packageCompileTscTypes.cjs.map +0 -1
  127. package/dist/actions/package/compile/packageCompileTsup.cjs +0 -521
  128. package/dist/actions/package/compile/packageCompileTsup.cjs.map +0 -1
  129. package/dist/actions/package/copy-assets.cjs +0 -88
  130. package/dist/actions/package/copy-assets.cjs.map +0 -1
  131. package/dist/actions/package/deps.cjs +0 -214
  132. package/dist/actions/package/deps.cjs.map +0 -1
  133. package/dist/actions/package/gen-docs.cjs +0 -148
  134. package/dist/actions/package/gen-docs.cjs.map +0 -1
  135. package/dist/actions/package/index.cjs +0 -968
  136. package/dist/actions/package/index.cjs.map +0 -1
  137. package/dist/actions/package/publint.cjs +0 -80
  138. package/dist/actions/package/publint.cjs.map +0 -1
  139. package/dist/actions/package/recompile.cjs +0 -617
  140. package/dist/actions/package/recompile.cjs.map +0 -1
  141. package/dist/actions/publint.cjs +0 -237
  142. package/dist/actions/publint.cjs.map +0 -1
  143. package/dist/actions/rebuild.cjs +0 -148
  144. package/dist/actions/rebuild.cjs.map +0 -1
  145. package/dist/actions/recompile.cjs +0 -232
  146. package/dist/actions/recompile.cjs.map +0 -1
  147. package/dist/actions/reinstall.cjs +0 -183
  148. package/dist/actions/reinstall.cjs.map +0 -1
  149. package/dist/actions/relint.cjs +0 -185
  150. package/dist/actions/relint.cjs.map +0 -1
  151. package/dist/actions/retest.cjs +0 -154
  152. package/dist/actions/retest.cjs.map +0 -1
  153. package/dist/actions/sonar.cjs +0 -149
  154. package/dist/actions/sonar.cjs.map +0 -1
  155. package/dist/actions/statics.cjs +0 -234
  156. package/dist/actions/statics.cjs.map +0 -1
  157. package/dist/actions/test.cjs +0 -147
  158. package/dist/actions/test.cjs.map +0 -1
  159. package/dist/actions/up.cjs +0 -144
  160. package/dist/actions/up.cjs.map +0 -1
  161. package/dist/actions/updo.cjs +0 -152
  162. package/dist/actions/updo.cjs.map +0 -1
  163. package/dist/actions/upplug.cjs +0 -172
  164. package/dist/actions/upplug.cjs.map +0 -1
  165. package/dist/actions/upyarn.cjs +0 -148
  166. package/dist/actions/upyarn.cjs.map +0 -1
  167. package/dist/actions/yarn3only.cjs +0 -106
  168. package/dist/actions/yarn3only.cjs.map +0 -1
  169. package/dist/bin/build.cjs +0 -39
  170. package/dist/bin/build.cjs.map +0 -1
  171. package/dist/bin/clean.cjs +0 -39
  172. package/dist/bin/clean.cjs.map +0 -1
  173. package/dist/bin/compile-only.cjs +0 -39
  174. package/dist/bin/compile-only.cjs.map +0 -1
  175. package/dist/bin/compile.cjs +0 -39
  176. package/dist/bin/compile.cjs.map +0 -1
  177. package/dist/bin/cycle.cjs +0 -39
  178. package/dist/bin/cycle.cjs.map +0 -1
  179. package/dist/bin/dead.cjs +0 -39
  180. package/dist/bin/dead.cjs.map +0 -1
  181. package/dist/bin/deploy-major.cjs +0 -39
  182. package/dist/bin/deploy-major.cjs.map +0 -1
  183. package/dist/bin/deploy-minor.cjs +0 -39
  184. package/dist/bin/deploy-minor.cjs.map +0 -1
  185. package/dist/bin/deploy-next.cjs +0 -39
  186. package/dist/bin/deploy-next.cjs.map +0 -1
  187. package/dist/bin/deploy.cjs +0 -39
  188. package/dist/bin/deploy.cjs.map +0 -1
  189. package/dist/bin/deps.cjs +0 -39
  190. package/dist/bin/deps.cjs.map +0 -1
  191. package/dist/bin/fix.cjs +0 -39
  192. package/dist/bin/fix.cjs.map +0 -1
  193. package/dist/bin/gen-docs.cjs +0 -39
  194. package/dist/bin/gen-docs.cjs.map +0 -1
  195. package/dist/bin/gitlint-fix.cjs +0 -39
  196. package/dist/bin/gitlint-fix.cjs.map +0 -1
  197. package/dist/bin/gitlint.cjs +0 -39
  198. package/dist/bin/gitlint.cjs.map +0 -1
  199. package/dist/bin/license.cjs +0 -39
  200. package/dist/bin/license.cjs.map +0 -1
  201. package/dist/bin/lint-clean.cjs +0 -39
  202. package/dist/bin/lint-clean.cjs.map +0 -1
  203. package/dist/bin/lint-fast.cjs +0 -39
  204. package/dist/bin/lint-fast.cjs.map +0 -1
  205. package/dist/bin/lint-profile.cjs +0 -39
  206. package/dist/bin/lint-profile.cjs.map +0 -1
  207. package/dist/bin/lint.cjs +0 -39
  208. package/dist/bin/lint.cjs.map +0 -1
  209. package/dist/bin/package/clean-outputs.cjs +0 -51
  210. package/dist/bin/package/clean-outputs.cjs.map +0 -1
  211. package/dist/bin/package/clean-typescript.cjs +0 -51
  212. package/dist/bin/package/clean-typescript.cjs.map +0 -1
  213. package/dist/bin/package/clean.cjs +0 -76
  214. package/dist/bin/package/clean.cjs.map +0 -1
  215. package/dist/bin/package/compile-only.cjs +0 -564
  216. package/dist/bin/package/compile-only.cjs.map +0 -1
  217. package/dist/bin/package/compile-tsup.cjs +0 -519
  218. package/dist/bin/package/compile-tsup.cjs.map +0 -1
  219. package/dist/bin/package/compile.cjs +0 -567
  220. package/dist/bin/package/compile.cjs.map +0 -1
  221. package/dist/bin/package/copy-assets-cjs.cjs +0 -86
  222. package/dist/bin/package/copy-assets-cjs.cjs.map +0 -1
  223. package/dist/bin/package/copy-assets-esm.cjs +0 -86
  224. package/dist/bin/package/copy-assets-esm.cjs.map +0 -1
  225. package/dist/bin/package/deps.cjs +0 -208
  226. package/dist/bin/package/deps.cjs.map +0 -1
  227. package/dist/bin/package/gen-docs.cjs +0 -143
  228. package/dist/bin/package/gen-docs.cjs.map +0 -1
  229. package/dist/bin/package/publint.cjs +0 -77
  230. package/dist/bin/package/publint.cjs.map +0 -1
  231. package/dist/bin/package/recompile.cjs +0 -611
  232. package/dist/bin/package/recompile.cjs.map +0 -1
  233. package/dist/bin/publint.cjs +0 -39
  234. package/dist/bin/publint.cjs.map +0 -1
  235. package/dist/bin/rebuild.cjs +0 -39
  236. package/dist/bin/rebuild.cjs.map +0 -1
  237. package/dist/bin/recompile.cjs +0 -39
  238. package/dist/bin/recompile.cjs.map +0 -1
  239. package/dist/bin/reinstall.cjs +0 -39
  240. package/dist/bin/reinstall.cjs.map +0 -1
  241. package/dist/bin/relint.cjs +0 -39
  242. package/dist/bin/relint.cjs.map +0 -1
  243. package/dist/bin/sonar.cjs +0 -39
  244. package/dist/bin/sonar.cjs.map +0 -1
  245. package/dist/bin/test.cjs +0 -39
  246. package/dist/bin/test.cjs.map +0 -1
  247. package/dist/bin/up.cjs +0 -39
  248. package/dist/bin/up.cjs.map +0 -1
  249. package/dist/bin/updo.cjs +0 -39
  250. package/dist/bin/updo.cjs.map +0 -1
  251. package/dist/bin/upplug.cjs +0 -39
  252. package/dist/bin/upplug.cjs.map +0 -1
  253. package/dist/bin/upyarn.cjs +0 -39
  254. package/dist/bin/upyarn.cjs.map +0 -1
  255. package/dist/bin/xy-ts.cjs +0 -1890
  256. package/dist/bin/xy-ts.cjs.map +0 -1
  257. package/dist/bin/xy.cjs +0 -1890
  258. package/dist/bin/xy.cjs.map +0 -1
  259. package/dist/bin/yarn3only.cjs +0 -39
  260. package/dist/bin/yarn3only.cjs.map +0 -1
  261. package/dist/index.cjs +0 -3129
  262. package/dist/index.cjs.map +0 -1
  263. package/dist/index.d.cts +0 -359
  264. package/dist/lib/checkResult.cjs +0 -52
  265. package/dist/lib/checkResult.cjs.map +0 -1
  266. package/dist/lib/createBuildConfig.cjs +0 -93
  267. package/dist/lib/createBuildConfig.cjs.map +0 -1
  268. package/dist/lib/defaultBuildConfig.cjs +0 -52
  269. package/dist/lib/defaultBuildConfig.cjs.map +0 -1
  270. package/dist/lib/dependencies/DuplicateDetector.cjs +0 -124
  271. package/dist/lib/dependencies/DuplicateDetector.cjs.map +0 -1
  272. package/dist/lib/dependencies/detectDuplicateDependencies.cjs +0 -207
  273. package/dist/lib/dependencies/detectDuplicateDependencies.cjs.map +0 -1
  274. package/dist/lib/dependencies/index.cjs +0 -211
  275. package/dist/lib/dependencies/index.cjs.map +0 -1
  276. package/dist/lib/file/ReadFileSyncOptions.cjs +0 -33
  277. package/dist/lib/file/ReadFileSyncOptions.cjs.map +0 -1
  278. package/dist/lib/file/constants.cjs +0 -34
  279. package/dist/lib/file/constants.cjs.map +0 -1
  280. package/dist/lib/file/fileLines.cjs +0 -58
  281. package/dist/lib/file/fileLines.cjs.map +0 -1
  282. package/dist/lib/file/index.cjs +0 -74
  283. package/dist/lib/file/index.cjs.map +0 -1
  284. package/dist/lib/file/tryReadFileSync.cjs +0 -42
  285. package/dist/lib/file/tryReadFileSync.cjs.map +0 -1
  286. package/dist/lib/generateIgnoreFiles.cjs +0 -132
  287. package/dist/lib/generateIgnoreFiles.cjs.map +0 -1
  288. package/dist/lib/index.cjs +0 -614
  289. package/dist/lib/index.cjs.map +0 -1
  290. package/dist/lib/jsonFormatters.cjs +0 -37
  291. package/dist/lib/jsonFormatters.cjs.map +0 -1
  292. package/dist/lib/loadConfig.cjs +0 -59
  293. package/dist/lib/loadConfig.cjs.map +0 -1
  294. package/dist/lib/parsedPackageJSON.cjs +0 -37
  295. package/dist/lib/parsedPackageJSON.cjs.map +0 -1
  296. package/dist/lib/processEx.cjs +0 -72
  297. package/dist/lib/processEx.cjs.map +0 -1
  298. package/dist/lib/runSteps.cjs +0 -134
  299. package/dist/lib/runSteps.cjs.map +0 -1
  300. package/dist/lib/runStepsAsync.cjs +0 -147
  301. package/dist/lib/runStepsAsync.cjs.map +0 -1
  302. package/dist/lib/runXy.cjs +0 -150
  303. package/dist/lib/runXy.cjs.map +0 -1
  304. package/dist/lib/runXyWithWarning.cjs +0 -49
  305. package/dist/lib/runXyWithWarning.cjs.map +0 -1
  306. package/dist/lib/safeExit.cjs +0 -100
  307. package/dist/lib/safeExit.cjs.map +0 -1
  308. package/dist/lib/string/empty.cjs +0 -35
  309. package/dist/lib/string/empty.cjs.map +0 -1
  310. package/dist/lib/string/index.cjs +0 -45
  311. package/dist/lib/string/index.cjs.map +0 -1
  312. package/dist/lib/string/union.cjs +0 -35
  313. package/dist/lib/string/union.cjs.map +0 -1
  314. package/dist/lib/withErrnoException.cjs +0 -41
  315. package/dist/lib/withErrnoException.cjs.map +0 -1
  316. package/dist/lib/withError.cjs +0 -34
  317. package/dist/lib/withError.cjs.map +0 -1
  318. package/dist/lib/yarn/index.cjs +0 -93
  319. package/dist/lib/yarn/index.cjs.map +0 -1
  320. package/dist/lib/yarn/isYarnVersionOrGreater.cjs +0 -52
  321. package/dist/lib/yarn/isYarnVersionOrGreater.cjs.map +0 -1
  322. package/dist/lib/yarn/workspace/Workspace.cjs +0 -19
  323. package/dist/lib/yarn/workspace/Workspace.cjs.map +0 -1
  324. package/dist/lib/yarn/workspace/index.cjs +0 -60
  325. package/dist/lib/yarn/workspace/index.cjs.map +0 -1
  326. package/dist/lib/yarn/workspace/yarnWorkspace.cjs +0 -58
  327. package/dist/lib/yarn/workspace/yarnWorkspace.cjs.map +0 -1
  328. package/dist/lib/yarn/workspace/yarnWorkspaces.cjs +0 -49
  329. package/dist/lib/yarn/workspace/yarnWorkspaces.cjs.map +0 -1
  330. package/dist/lib/yarn/yarnInitCwd.cjs +0 -35
  331. package/dist/lib/yarn/yarnInitCwd.cjs.map +0 -1
  332. package/dist/loadPackageConfig.cjs +0 -39
  333. package/dist/loadPackageConfig.cjs.map +0 -1
  334. package/dist/types.d.cjs +0 -2
  335. package/dist/types.d.cjs.map +0 -1
  336. package/dist/xy/index.cjs +0 -1909
  337. package/dist/xy/index.cjs.map +0 -1
  338. package/dist/xy/param.cjs +0 -36
  339. package/dist/xy/param.cjs.map +0 -1
  340. package/dist/xy/xy.cjs +0 -1895
  341. package/dist/xy/xy.cjs.map +0 -1
  342. package/dist/xy/xyBuildCommands.cjs +0 -595
  343. package/dist/xy/xyBuildCommands.cjs.map +0 -1
  344. package/dist/xy/xyCommonCommands.cjs +0 -723
  345. package/dist/xy/xyCommonCommands.cjs.map +0 -1
  346. package/dist/xy/xyDeployCommands.cjs +0 -263
  347. package/dist/xy/xyDeployCommands.cjs.map +0 -1
  348. package/dist/xy/xyInstallCommands.cjs +0 -508
  349. package/dist/xy/xyInstallCommands.cjs.map +0 -1
  350. package/dist/xy/xyLintCommands.cjs +0 -466
  351. package/dist/xy/xyLintCommands.cjs.map +0 -1
  352. package/dist/xy/xyParseOptions.cjs +0 -84
  353. package/dist/xy/xyParseOptions.cjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/lib/index.ts","../../src/lib/checkResult.ts","../../src/lib/createBuildConfig.ts","../../src/lib/defaultBuildConfig.ts","../../src/lib/dependencies/detectDuplicateDependencies.ts","../../src/lib/processEx.ts","../../src/lib/withError.ts","../../src/lib/withErrnoException.ts","../../src/lib/safeExit.ts","../../src/lib/dependencies/DuplicateDetector.ts","../../src/lib/jsonFormatters.ts","../../src/lib/file/constants.ts","../../src/lib/file/fileLines.ts","../../src/lib/string/empty.ts","../../src/lib/string/union.ts","../../src/lib/file/ReadFileSyncOptions.ts","../../src/lib/file/tryReadFileSync.ts","../../src/lib/generateIgnoreFiles.ts","../../src/lib/yarn/isYarnVersionOrGreater.ts","../../src/lib/yarn/workspace/yarnWorkspaces.ts","../../src/lib/yarn/workspace/yarnWorkspace.ts","../../src/lib/yarn/yarnInitCwd.ts","../../src/lib/loadConfig.ts","../../src/lib/parsedPackageJSON.ts","../../src/lib/runSteps.ts","../../src/lib/runStepsAsync.ts","../../src/lib/runXy.ts","../../src/lib/runXyWithWarning.ts"],"sourcesContent":["export * from './checkResult.ts'\nexport * from './createBuildConfig.ts'\nexport * from './defaultBuildConfig.ts'\nexport * from './dependencies/index.ts'\nexport * from './file/index.ts'\nexport * from './generateIgnoreFiles.ts'\nexport * from './jsonFormatters.ts'\nexport * from './loadConfig.ts'\nexport * from './parsedPackageJSON.ts'\nexport * from './processEx.ts'\nexport * from './runSteps.ts'\nexport * from './runStepsAsync.ts'\nexport * from './runXy.ts'\nexport * from './runXyWithWarning.ts'\nexport * from './safeExit.ts'\nexport * from './string/index.ts'\nexport * from './withErrnoException.ts'\nexport * from './withError.ts'\nexport * from './yarn/index.ts'\n","import chalk from 'chalk'\n\nexport const checkResult = (name: string, result: number, level: 'error' | 'warn' = 'error', exitOnFail = false) => {\n if (result) {\n const exiting = exitOnFail ? '[Exiting Process]' : '[Continuing]'\n const chalkFunc = level === 'error' ? chalk.red : chalk.yellow\n console[level](chalkFunc(`${name} had ${result} failures ${exiting}`))\n if (exitOnFail) {\n process.exit(result)\n }\n }\n}\n","import { readFileSync } from 'node:fs'\n\nimport { defaultBuildConfig } from './defaultBuildConfig.ts'\n\nconst getGeneralTypescriptConfig = (location: string) => {\n let generalConfig: string | undefined\n try {\n generalConfig = readFileSync(`${location}/tsconfig.json`, { encoding: 'utf8' })\n } catch {\n return false\n }\n return JSON.parse(generalConfig)\n}\n\nexport const createBuildConfig = (\n location: string,\n module: 'ESNext' | 'CommonJS',\n target: 'ESNext' | 'ES6',\n outDirSuffix: string,\n): Record<string, unknown> | undefined => {\n const generalConfigObject = getGeneralTypescriptConfig(location)\n if (generalConfigObject === false) {\n return undefined\n }\n return {\n ...generalConfigObject,\n compilerOptions: {\n ...defaultBuildConfig.compilerOptions,\n ...generalConfigObject.compilerOptions,\n module,\n outDir: `./${generalConfigObject.compilerOptions?.outDir ?? 'dist'}/${outDirSuffix}`,\n target,\n },\n exclude: [...(generalConfigObject.exclude ?? []), ...defaultBuildConfig.exclude],\n include: [...(generalConfigObject.include ?? []), ...defaultBuildConfig.include],\n }\n}\n","export const defaultBuildConfig = {\n compilerOptions: {\n rootDir: 'src',\n rootDirs: ['package.json'],\n },\n exclude: ['**/build', '**/dist', '**/node_modules', '**/*.spec.*', '**/*.spec', '**/*.stories.*', '**/*.example.*', '**/spec/*', '**/stories/*'],\n include: ['src'],\n}\n","import { execSync } from 'node:child_process'\n\nimport { safeExit } from '../safeExit.ts'\nimport { DuplicateDetector } from './DuplicateDetector.ts'\n\nexport const detectDuplicateDependencies = (depsFromPackageJSON?: string[], DefaultDependencies?: string[]) => {\n let exitCode = 0\n\n const dependencies = depsFromPackageJSON?.length ? depsFromPackageJSON : DefaultDependencies\n\n return safeExit(() => {\n if (dependencies) {\n for (const dependency of dependencies) {\n let output: string\n\n try {\n const cmd = `yarn why ${dependency} --json`\n output = execSync(cmd).toString()\n } catch (e) {\n console.error(`Error running yarn why: ${e}`)\n exitCode = 1\n continue\n }\n\n if (output) {\n exitCode = new DuplicateDetector(output, dependency).detect()\n } else {\n console.log(`${dependency} - N/A`)\n if (depsFromPackageJSON) {\n exitCode = 1\n console.log(`🚨 Library ${dependency} was requested in package.json but not found`)\n }\n }\n }\n return exitCode\n } else {\n console.log('🚨 No dependencies where passed')\n return exitCode\n }\n })\n}\n","import chalk from 'chalk'\n\nimport { withErrnoException } from './withErrnoException.ts'\nimport { withError } from './withError.ts'\n\nexport const processEx = (ex: unknown) => {\n const error = typeof ex === 'string' ? new Error(ex) : ex\n const exitCode\n = withErrnoException(error, (error) => {\n if (error.code === 'ENOENT') {\n console.error(chalk.red(`'${error.path}' not found.`))\n } else {\n console.error(chalk.red(`Errno: ${error.code}`))\n }\n return error.errno ?? -1\n })\n ?? withError(error, (error) => {\n console.error(chalk.red(`${error.name}: ${error.message}`))\n return -1\n })\n ?? (() => {\n console.error(chalk.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`))\n return -1\n })()\n // This allows us to use a previously set exit code\n process.exit(process.exitCode ?? exitCode)\n}\n","export const withError = <T extends Error = Error>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ex: any,\n closure: (error: T) => number,\n predicate = (ex: T) => ex.name !== undefined && ex.message !== undefined,\n) => {\n return predicate(ex as T) ? closure(ex as T) : undefined\n}\n","import { withError } from './withError.ts'\n\nexport const withErrnoException = <T extends NodeJS.ErrnoException = NodeJS.ErrnoException>(ex: unknown, closure: (error: T) => number) => {\n return withError<T>(ex, closure, (ex: unknown) => (ex as NodeJS.ErrnoException).errno !== undefined)\n}\n","/** Catch child process a crash and returns the code */\n\nimport { processEx } from './processEx.ts'\n\nconst safeExit = (func: () => number, exitOnFail = true): number => {\n try {\n const result = func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nconst safeExitAsync = async (func: () => Promise<number>, exitOnFail = true): Promise<number> => {\n try {\n const result = await func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nexport { safeExit, safeExitAsync }\n","import { EOL } from 'node:os'\n\nimport chalk from 'chalk'\n// eslint-disable-next-line import/no-internal-modules\nimport uniq from 'lodash/uniq.js'\n\nimport { multiLineToJSONArray } from '../jsonFormatters.ts'\n\ninterface ChildFields {\n descriptor: string\n locator: string\n}\n\nconst trimVirtualMeta = (value: string): string => {\n const virtualParts = value.split('virtual:')\n if (virtualParts.length > 1) {\n const hashParts = virtualParts[1].split('#')\n return virtualParts[0] + hashParts[1]\n } else {\n return value\n }\n}\n\nconst trimObjectDependencyVirtualMeta = (obj: Record<string, ChildFields>): Record<string, ChildFields> => {\n const resultObj: Record<string, ChildFields> = {}\n for (const [key, value] of Object.entries(obj)) {\n resultObj[trimVirtualMeta(key)] = {\n descriptor: trimVirtualMeta(value.descriptor),\n locator: trimVirtualMeta(value.locator),\n }\n }\n return resultObj\n}\n\nconst trimDependencyVirtualMeta = (dependencies: DependencyEntries): DependencyEntries => {\n return dependencies.map((dependency) => {\n return { children: trimObjectDependencyVirtualMeta(dependency.children), value: trimVirtualMeta(dependency.value) }\n })\n}\n\ninterface DependencyEntry {\n children: Record<string, ChildFields>\n value: string\n}\n\ntype DependencyEntries = DependencyEntry[]\n\ninterface Results {\n currentVersion: string | undefined\n dependency: string\n duplicateVersions: string[]\n}\n\nexport class DuplicateDetector {\n private dependency: string\n private dependencyEntries: DependencyEntries\n\n constructor(output: string, dependency: string) {\n this.dependency = dependency\n this.dependencyEntries = trimDependencyVirtualMeta(multiLineToJSONArray(output))\n }\n\n detect() {\n // eslint-disable-next-line unicorn/no-array-reduce\n const result = this.dependencyEntries.reduce(this.detectReducer, this.resultsFactory(this.dependency))\n if (result.duplicateVersions.length > 0) {\n console.log(chalk.yellow(`${EOL}Duplicates found for: ${this.dependency}`))\n const duplicateVersions = result.duplicateVersions.toString().replaceAll(',', `${EOL} `)\n console.log(chalk.grey(` ${duplicateVersions}`, EOL))\n return 1\n } else {\n console.log(`${this.dependency} - OK`)\n return 0\n }\n }\n\n private detectReducer(acc: Results, entry: DependencyEntry) {\n const version = Object.entries(entry.children).map(([k]) => k)[0]\n\n if (!acc.currentVersion) {\n acc.currentVersion = version\n return acc\n }\n\n if (acc.currentVersion && acc.currentVersion !== version && !version.includes('@virtual:')) {\n // if first duplicate, push the current version as the first duplicate\n if (acc.duplicateVersions.length === 0) {\n acc.duplicateVersions.push(acc.currentVersion)\n }\n acc.duplicateVersions.push(version)\n acc.duplicateVersions = uniq(acc.duplicateVersions)\n }\n return acc\n }\n\n private resultsFactory = (dependency: string): Results => ({ currentVersion: undefined, dependency, duplicateVersions: [] })\n}\n","export const multiLineToJSONArray = (output: string) => {\n const withCommas = output.replaceAll('\\r\\n', '').replaceAll('\\n', ',')\n const cleanCollection = withCommas.slice(0, Math.max(0, withCommas.length - 1))\n const collection = `[${cleanCollection}]`\n return JSON.parse(collection)\n}\n","export const WINDOWS_NEWLINE_REGEX = /\\r\\n/g\nexport const CROSS_PLATFORM_NEWLINE = '\\n'\n","import { existsSync, PathLike, readFileSync, WriteFileOptions, writeFileSync } from 'node:fs'\n\nimport { notEmpty } from '../string/index.ts'\nimport { CROSS_PLATFORM_NEWLINE, WINDOWS_NEWLINE_REGEX } from './constants.ts'\nimport { defaultReadFileSyncOptions, ReadFileSyncOptions } from './ReadFileSyncOptions.ts'\n\nexport const readLines = (uri: PathLike, options: ReadFileSyncOptions = defaultReadFileSyncOptions): string[] =>\n existsSync(uri) ? readFileSync(uri, options).replace(WINDOWS_NEWLINE_REGEX, CROSS_PLATFORM_NEWLINE).split(CROSS_PLATFORM_NEWLINE) : []\n\nexport const readNonEmptyLines = (uri: PathLike, options: ReadFileSyncOptions = defaultReadFileSyncOptions): string[] =>\n readLines(uri, options).filter(notEmpty)\n\nexport const writeLines = (uri: PathLike, lines: string[], options: WriteFileOptions = defaultReadFileSyncOptions) => {\n const existing = existsSync(uri) ? readFileSync(uri, options) : undefined\n const desired = lines.join(CROSS_PLATFORM_NEWLINE)\n // Check if the file is different before writing\n if (existing !== desired) writeFileSync(uri, desired, options)\n}\n","export const empty = (value?: string | undefined): boolean => value?.trim().length === 0\nexport const notEmpty = (value?: string | undefined): boolean => !empty(value)\n","export const union = (a: string[], b: string[]): Set<string> => new Set([...new Set(a), ...new Set(b)])\n","export type ReadFileSyncOptions = BufferEncoding | { encoding: BufferEncoding; flags?: string }\n\nexport const defaultReadFileSyncOptions: ReadFileSyncOptions = { encoding: 'utf8' }\n","import { existsSync, PathLike, readFileSync } from 'node:fs'\n\nimport { defaultReadFileSyncOptions, ReadFileSyncOptions } from './ReadFileSyncOptions.ts'\n\nexport const tryReadFileSync = (uri: PathLike, options: ReadFileSyncOptions = defaultReadFileSyncOptions): string | undefined => {\n return existsSync(uri) ? readFileSync(uri, options) : undefined\n}\n","import chalk from 'chalk'\n\nimport { readNonEmptyLines, writeLines } from './file/index.ts'\nimport { union } from './string/index.ts'\nimport { INIT_CWD, yarnWorkspace, yarnWorkspaces } from './yarn/index.ts'\n\nconst mergeEntries = (a: string[], b: string[]): string[] => [...union(a, b)].sort()\n\nexport const generateIgnoreFiles = (filename: string, pkg?: string) => {\n console.log(chalk.green(`Generate ${filename} Files`))\n const cwd = INIT_CWD() ?? '.'\n const workspaces = pkg ? [yarnWorkspace(pkg)] : yarnWorkspaces()\n const readEntries = (location: string): string[] => readNonEmptyLines(`${location}/${filename}`)\n const writeEntries = (location: string, entries: string[]) => writeLines(`${location}/${filename}`, entries)\n const results = workspaces.map(({ location, name }) => {\n try {\n writeEntries(location, mergeEntries(readEntries(cwd), readEntries(location)))\n return 0\n } catch (ex) {\n const error = ex as Error\n console.error(`Generate ${filename} Files [${name}] [${error.message}]`)\n return 1\n }\n })\n const succeeded = results.every(result => result === 0)\n return succeeded ? 0 : 1\n}\n","import { spawnSync } from 'node:child_process'\n\nexport const isYarnVersionOrGreater = (major: number, minor?: number, patch?: number): [boolean, string] => {\n const result = spawnSync('yarn', ['-v'], { encoding: 'utf8', shell: true })\n const version = result.stdout.toString().replaceAll('\\n', '')\n const versionNumbers = version.split('.').map(ver => Number.parseInt(ver))\n const majorDelta = versionNumbers[0] - major\n const minorDelta = versionNumbers[1] - (minor ?? versionNumbers[1])\n const patchDelta = versionNumbers[2] - (patch ?? versionNumbers[2])\n\n const majorOk = majorDelta >= 0\n const minorOk = majorDelta > 0 || minorDelta >= 0\n const patchOk = majorDelta > 0 || minorDelta > 0 || patchDelta >= 0\n\n return [majorOk && minorOk && patchOk, version]\n}\n","import { spawnSync } from 'node:child_process'\n\nimport { Workspace } from './Workspace.ts'\n\nexport const yarnWorkspaces = (): Workspace[] => {\n const result = spawnSync('yarn', ['workspaces', 'list', '--json', '--recursive'], { encoding: 'utf8', shell: true })\n if (result.error) {\n throw result.error\n }\n return (\n result.stdout\n .toString()\n // NOTE: This probably doesn't work on Windows\n // TODO: Replace /r/n with /n first\n .split('\\n')\n .slice(0, -1)\n .map((item) => {\n return JSON.parse(item)\n })\n )\n}\n","import { Workspace } from './Workspace.ts'\nimport { yarnWorkspaces } from './yarnWorkspaces.ts'\n\nexport const yarnWorkspace = (pkg: string): Workspace => {\n const workspace = yarnWorkspaces().find(({ name }) => name === pkg)\n if (!workspace) throw new Error(`Workspace ${pkg} not found`)\n return workspace\n}\n","export const INIT_CWD = () => {\n if (!process.env.INIT_CWD) console.error('Missing INIT_CWD')\n return process.env.INIT_CWD\n}\n","import chalk from 'chalk'\nimport { cosmiconfig } from 'cosmiconfig'\n// eslint-disable-next-line import/no-internal-modules\nimport merge from 'lodash/merge.js'\n\nlet config: Record<string, unknown>\n\nexport const loadConfig = async <T extends object>(params?: T): Promise<T> => {\n if (config) {\n return merge({}, config, params)\n }\n\n const cosmicConfigResult = await cosmiconfig('xy', { cache: true }).search()\n config = cosmicConfigResult?.config\n const configFilePath = cosmicConfigResult?.filepath\n if (configFilePath) {\n console.log(chalk.gray(`Loading config from ${configFilePath}`))\n }\n return merge({}, config, params)\n}\n","import { readFileSync } from 'node:fs'\n\nexport const parsedPackageJSON = (path?: string) => {\n const pathToPackageJSON = path ?? process.env.npm_package_json ?? ''\n const packageJSON = readFileSync(pathToPackageJSON).toString()\n return JSON.parse(packageJSON)\n}\n","import { spawnSync, SpawnSyncOptionsWithBufferEncoding } from 'node:child_process'\nimport { existsSync } from 'node:fs'\n\nimport chalk from 'chalk'\n\nimport { checkResult } from './checkResult.ts'\nimport { safeExit } from './safeExit.ts'\n\nexport type ScriptStep =\n | [/* command */ 'yarn' | 'node' | 'ts-node-script' | 'tsc' | 'jest', /* arg */ string | string[]]\n | [/* command */ string, /* arg */ string | string[], /* config */ SpawnSyncOptionsWithBufferEncoding]\n\nexport const runSteps = (name: string, steps: ScriptStep[], exitOnFail = true, messages?: string[]): number => {\n return safeExit(() => {\n const pkgName = process.env.npm_package_name\n console.log(chalk.green(`${name} [${pkgName}]`))\n let totalStatus = 0\n for (const [i, [command, args, config]] of steps.entries()) {\n if (messages?.[i]) {\n console.log(chalk.gray(messages?.[i]))\n }\n const argList = Array.isArray(args) ? args : args.split(' ')\n if (command === 'node' && !existsSync(argList[0])) {\n throw new Error(`File not found [${argList[0]}]`)\n }\n const status\n = spawnSync(command, Array.isArray(args) ? args : args.split(' '), {\n ...config,\n encoding: 'utf8',\n env: { FORCE_COLOR: '3', ...process.env },\n shell: true,\n stdio: 'inherit',\n }).status ?? 0\n checkResult(name, status, 'error', exitOnFail)\n totalStatus += status ?? 0\n }\n return totalStatus\n }, !!exitOnFail)\n}\n","import { spawn } from 'node:child_process'\nimport { existsSync } from 'node:fs'\n\nimport chalk from 'chalk'\n\nimport { checkResult } from './checkResult.ts'\nimport { ScriptStep } from './runSteps.ts'\nimport { safeExitAsync } from './safeExit.ts'\n\nexport const runStepAsync = (name: string, step: ScriptStep, exitOnFail = true, message?: string) => {\n return new Promise<number>((resolve) => {\n const [command, args, config] = step\n if (message) {\n console.log(chalk.gray(message))\n }\n const argList = Array.isArray(args) ? args : args.split(' ')\n if (command === 'node' && !existsSync(argList[0])) {\n throw new Error(`File not found [${argList[0]}]`)\n }\n spawn(command, Array.isArray(args) ? args : args.split(' '), {\n ...config,\n env: { FORCE_COLOR: '3', ...process.env },\n shell: true,\n stdio: 'inherit',\n }).on('close', (code) => {\n if (code) {\n console.error(\n chalk.red(\n `Command Exited With Non-Zero Result [${chalk.gray(code)}] | ${chalk.yellow(command)} ${chalk.white(\n Array.isArray(args) ? args.join(' ') : args,\n )}`,\n ),\n )\n checkResult(name, code, 'error', exitOnFail)\n resolve(code)\n } else {\n resolve(0)\n }\n })\n })\n}\n\nexport const runStepsAsync = async (name: string, steps: ScriptStep[], exitOnFail = true, messages?: string[]) => {\n return await safeExitAsync(async () => {\n const pkgName = process.env.npm_package_name\n console.log(chalk.green(`${name} [${pkgName}]`))\n let result = 0\n for (const [i, step] of steps.entries()) {\n result += await runStepAsync(name, step, exitOnFail, messages?.[i])\n }\n return result\n })\n}\n","import { runSteps } from './runSteps.ts'\n\nexport const runXy = (command: string) => {\n return runSteps(`XY [${command}]`, [['yarn', ['xy', command, ...process.argv.filter((value, index) => (index > 1 ? value : undefined))]]])\n}\n","import chalk from 'chalk'\n\nexport const runXyWithWarning = (command: string) => {\n const commandString = `yarn ${command}`\n const commandXyString = `yarn xy ${command}`\n console.warn(chalk.yellow(`WARNING: [${chalk.white(commandString)}] is deprecated for XY Labs Scripts.`))\n console.warn(chalk.gray(`Did you mean [${chalk.magenta(commandXyString)}]?`))\n return 1\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA,mBAAkB;AAEX,IAAMA,cAAc,wBAACC,MAAcC,QAAgBC,QAA0B,SAASC,aAAa,UAAK;AAC7G,MAAIF,QAAQ;AACV,UAAMG,UAAUD,aAAa,sBAAsB;AACnD,UAAME,YAAYH,UAAU,UAAUI,aAAAA,QAAMC,MAAMD,aAAAA,QAAME;AACxDC,YAAQP,KAAAA,EAAOG,UAAU,GAAGL,IAAAA,QAAYC,MAAAA,aAAmBG,OAAAA,EAAS,CAAA;AACpE,QAAID,YAAY;AACdO,cAAQC,KAAKV,MAAAA;IACf;EACF;AACF,GAT2B;;;ACF3B,qBAA6B;;;ACAtB,IAAMW,qBAAqB;EAChCC,iBAAiB;IACfC,SAAS;IACTC,UAAU;MAAC;;EACb;EACAC,SAAS;IAAC;IAAY;IAAW;IAAmB;IAAe;IAAa;IAAkB;IAAkB;IAAa;;EACjIC,SAAS;IAAC;;AACZ;;;ADHA,IAAMC,6BAA6B,wBAACC,aAAAA;AAClC,MAAIC;AACJ,MAAI;AACFA,wBAAgBC,6BAAa,GAAGF,QAAAA,kBAA0B;MAAEG,UAAU;IAAO,CAAA;EAC/E,QAAQ;AACN,WAAO;EACT;AACA,SAAOC,KAAKC,MAAMJ,aAAAA;AACpB,GARmC;AAU5B,IAAMK,oBAAoB,wBAC/BN,UACAO,SACAC,QACAC,iBAAAA;AAEA,QAAMC,sBAAsBX,2BAA2BC,Q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k","red","yellow","console","process","exit","defaultBuildConfig","compilerOptions","rootDir","rootDirs","exclude","include","getGeneralTypescriptConfig","location","generalConfig","readFileSync","encoding","JSON","parse","createBuildConfig","module","target","outDirSuffix","generalConfigObject","undefined","compilerOptions","defaultBuildConfig","outDir","exclude","include","import_chalk","withError","ex","closure","predicate","name","undefined","message","withErrnoException","ex","closure","withError","errno","undefined","processEx","ex","error","Error","exitCode","withErrnoException","code","console","chalk","red","path","errno","withError","name","message","JSON","stringify","process","exit","safeExit","func","exitOnFail","result","process","exit","ex","processEx","safeExitAsync","import_chalk","multiLineToJSONArray","output","withCommas","replaceAll","cleanCollection","slice","Math","max","length","collection","JSON","parse","trimVirtualMeta","value","virtualParts","split","length","hashParts","trimObjectDependencyVirtualMeta","obj","resultObj","key","Object","entries","descriptor","locator","trimDependencyVirtualMeta","dependencies","map","dependency","children","DuplicateDetector","dependencyEntries","constructor","output","multiLineToJSONArray","detect","result","reduce","detectReducer","resultsFactory","duplicateVersions","console","log","chalk","yellow","EOL","toString","replaceAll","grey","acc","entry","version","k","currentVersion","includes","push","uniq","undefined","detectDuplicateDependencies","depsFromPackageJSON","DefaultDependencies","exitCode","dependencies","length","safeExit","dependency","output","cmd","execSync","toString","e","console","error","DuplicateDetector","detect","log","WINDOWS_NEWLINE_REGEX","CROSS_PLATFORM_NEWLINE","import_node_fs","empty","value","trim","length","notEmpty","union","a","b","Set","defaultReadFileSyncOptions","encoding","readLines","uri","options","defaultReadFileSyncOptions","existsSync","readFileSync","replace","WINDOWS_NEWLINE_REGEX","CROSS_PLATFORM_NEWLINE","split","readNonEmptyLines","filter","notEmpty","writeLines","lines","existing","undefined","desired","join","writeFileSync","import_node_fs","tryReadFileSync","uri","options","defaultReadFileSyncOptions","existsSync","readFileSync","undefined","import_chalk","import_node_child_process","isYarnVersionOrGreater","major","minor","patch","result","spawnSync","encoding","shell","version","stdout","toString","replaceAll","versionNumbers","split","map","ver","Number","parseInt","majorDelta","minorDelta","patchDelta","majorOk","minorOk","patchOk","import_node_child_process","yarnWorkspaces","result","spawnSync","encoding","shell","error","stdout","toString","split","slice","map","item","JSON","parse","yarnWorkspace","pkg","workspace","yarnWorkspaces","find","name","Error","INIT_CWD","process","env","console","error","mergeEntries","a","b","union","sort","generateIgnoreFiles","filename","pkg","console","log","chalk","green","cwd","INIT_CWD","workspaces","yarnWorkspace","yarnWorkspaces","readEntries","location","readNonEmptyLines","writeEntries","entries","writeLines","results","map","name","ex","error","message","succeeded","every","result","import_chalk","config","loadConfig","params","merge","cosmicConfigResult","cosmiconfig","cache","search","configFilePath","filepath","console","log","chalk","gray","import_node_fs","parsedPackageJSON","path","pathToPackageJSON","process","env","npm_package_json","packageJSON","readFileSync","toString","JSON","parse","import_node_child_process","import_node_fs","import_chalk","runSteps","name","steps","exitOnFail","messages","safeExit","pkgName","process","env","npm_package_name","console","log","chalk","green","totalStatus","i","command","args","config","entries","gray","argList","Array","isArray","split","existsSync","Error","status","spawnSync","encoding","FORCE_COLOR","shell","stdio","checkResult","import_node_child_process","import_node_fs","import_chalk","runStepAsync","name","step","exitOnFail","message","Promise","resolve","command","args","config","console","log","chalk","gray","argList","Array","isArray","split","existsSync","Error","spawn","env","FORCE_COLOR","process","shell","stdio","on","code","error","red","yellow","white","join","checkResult","runStepsAsync","steps","messages","safeExitAsync","pkgName","npm_package_name","green","result","i","entries","runXy","command","runSteps","process","argv","filter","value","index","undefined","import_chalk","runXyWithWarning","command","commandString","commandXyString","console","warn","chalk","yellow","white","gray","magenta"]}
@@ -1,37 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
-
21
- // src/lib/jsonFormatters.ts
22
- var jsonFormatters_exports = {};
23
- __export(jsonFormatters_exports, {
24
- multiLineToJSONArray: () => multiLineToJSONArray
25
- });
26
- module.exports = __toCommonJS(jsonFormatters_exports);
27
- var multiLineToJSONArray = /* @__PURE__ */ __name((output) => {
28
- const withCommas = output.replaceAll("\r\n", "").replaceAll("\n", ",");
29
- const cleanCollection = withCommas.slice(0, Math.max(0, withCommas.length - 1));
30
- const collection = `[${cleanCollection}]`;
31
- return JSON.parse(collection);
32
- }, "multiLineToJSONArray");
33
- // Annotate the CommonJS export names for ESM import in node:
34
- 0 && (module.exports = {
35
- multiLineToJSONArray
36
- });
37
- //# sourceMappingURL=jsonFormatters.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/lib/jsonFormatters.ts"],"sourcesContent":["export const multiLineToJSONArray = (output: string) => {\n const withCommas = output.replaceAll('\\r\\n', '').replaceAll('\\n', ',')\n const cleanCollection = withCommas.slice(0, Math.max(0, withCommas.length - 1))\n const collection = `[${cleanCollection}]`\n return JSON.parse(collection)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;AAAO,IAAMA,uBAAuB,wBAACC,WAAAA;AACnC,QAAMC,aAAaD,OAAOE,WAAW,QAAQ,EAAA,EAAIA,WAAW,MAAM,GAAA;AAClE,QAAMC,kBAAkBF,WAAWG,MAAM,GAAGC,KAAKC,IAAI,GAAGL,WAAWM,SAAS,CAAA,CAAA;AAC5E,QAAMC,aAAa,IAAIL,eAAAA;AACvB,SAAOM,KAAKC,MAAMF,UAAAA;AACpB,GALoC;","names":["multiLineToJSONArray","output","withCommas","replaceAll","cleanCollection","slice","Math","max","length","collection","JSON","parse"]}
@@ -1,59 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
9
- var __export = (target, all) => {
10
- for (var name in all)
11
- __defProp(target, name, { get: all[name], enumerable: true });
12
- };
13
- var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from))
16
- if (!__hasOwnProp.call(to, key) && key !== except)
17
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
- }
19
- return to;
20
- };
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
- mod
28
- ));
29
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
-
31
- // src/lib/loadConfig.ts
32
- var loadConfig_exports = {};
33
- __export(loadConfig_exports, {
34
- loadConfig: () => loadConfig
35
- });
36
- module.exports = __toCommonJS(loadConfig_exports);
37
- var import_chalk = __toESM(require("chalk"), 1);
38
- var import_cosmiconfig = require("cosmiconfig");
39
- var import_merge = __toESM(require("lodash/merge.js"), 1);
40
- var config;
41
- var loadConfig = /* @__PURE__ */ __name(async (params) => {
42
- if (config) {
43
- return (0, import_merge.default)({}, config, params);
44
- }
45
- const cosmicConfigResult = await (0, import_cosmiconfig.cosmiconfig)("xy", {
46
- cache: true
47
- }).search();
48
- config = cosmicConfigResult?.config;
49
- const configFilePath = cosmicConfigResult?.filepath;
50
- if (configFilePath) {
51
- console.log(import_chalk.default.gray(`Loading config from ${configFilePath}`));
52
- }
53
- return (0, import_merge.default)({}, config, params);
54
- }, "loadConfig");
55
- // Annotate the CommonJS export names for ESM import in node:
56
- 0 && (module.exports = {
57
- loadConfig
58
- });
59
- //# sourceMappingURL=loadConfig.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/lib/loadConfig.ts"],"sourcesContent":["import chalk from 'chalk'\nimport { cosmiconfig } from 'cosmiconfig'\n// eslint-disable-next-line import/no-internal-modules\nimport merge from 'lodash/merge.js'\n\nlet config: Record<string, unknown>\n\nexport const loadConfig = async <T extends object>(params?: T): Promise<T> => {\n if (config) {\n return merge({}, config, params)\n }\n\n const cosmicConfigResult = await cosmiconfig('xy', { cache: true }).search()\n config = cosmicConfigResult?.config\n const configFilePath = cosmicConfigResult?.filepath\n if (configFilePath) {\n console.log(chalk.gray(`Loading config from ${configFilePath}`))\n }\n return merge({}, config, params)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;mBAAkB;AAClB,yBAA4B;AAE5B,mBAAkB;AAElB,IAAIA;AAEG,IAAMC,aAAa,8BAAyBC,WAAAA;AACjD,MAAIF,QAAQ;AACV,eAAOG,aAAAA,SAAM,CAAC,GAAGH,QAAQE,MAAAA;EAC3B;AAEA,QAAME,qBAAqB,UAAMC,gCAAY,MAAM;IAAEC,OAAO;EAAK,CAAA,EAAGC,OAAM;AAC1EP,WAASI,oBAAoBJ;AAC7B,QAAMQ,iBAAiBJ,oBAAoBK;AAC3C,MAAID,gBAAgB;AAClBE,YAAQC,IAAIC,aAAAA,QAAMC,KAAK,uBAAuBL,cAAAA,EAAgB,CAAA;EAChE;AACA,aAAOL,aAAAA,SAAM,CAAC,GAAGH,QAAQE,MAAAA;AAC3B,GAZ0B;","names":["config","loadConfig","params","merge","cosmicConfigResult","cosmiconfig","cache","search","configFilePath","filepath","console","log","chalk","gray"]}
@@ -1,37 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
-
21
- // src/lib/parsedPackageJSON.ts
22
- var parsedPackageJSON_exports = {};
23
- __export(parsedPackageJSON_exports, {
24
- parsedPackageJSON: () => parsedPackageJSON
25
- });
26
- module.exports = __toCommonJS(parsedPackageJSON_exports);
27
- var import_node_fs = require("fs");
28
- var parsedPackageJSON = /* @__PURE__ */ __name((path) => {
29
- const pathToPackageJSON = path ?? process.env.npm_package_json ?? "";
30
- const packageJSON = (0, import_node_fs.readFileSync)(pathToPackageJSON).toString();
31
- return JSON.parse(packageJSON);
32
- }, "parsedPackageJSON");
33
- // Annotate the CommonJS export names for ESM import in node:
34
- 0 && (module.exports = {
35
- parsedPackageJSON
36
- });
37
- //# sourceMappingURL=parsedPackageJSON.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/lib/parsedPackageJSON.ts"],"sourcesContent":["import { readFileSync } from 'node:fs'\n\nexport const parsedPackageJSON = (path?: string) => {\n const pathToPackageJSON = path ?? process.env.npm_package_json ?? ''\n const packageJSON = readFileSync(pathToPackageJSON).toString()\n return JSON.parse(packageJSON)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;qBAA6B;AAEtB,IAAMA,oBAAoB,wBAACC,SAAAA;AAChC,QAAMC,oBAAoBD,QAAQE,QAAQC,IAAIC,oBAAoB;AAClE,QAAMC,kBAAcC,6BAAaL,iBAAAA,EAAmBM,SAAQ;AAC5D,SAAOC,KAAKC,MAAMJ,WAAAA;AACpB,GAJiC;","names":["parsedPackageJSON","path","pathToPackageJSON","process","env","npm_package_json","packageJSON","readFileSync","toString","JSON","parse"]}
@@ -1,72 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
9
- var __export = (target, all) => {
10
- for (var name in all)
11
- __defProp(target, name, { get: all[name], enumerable: true });
12
- };
13
- var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from))
16
- if (!__hasOwnProp.call(to, key) && key !== except)
17
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
- }
19
- return to;
20
- };
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
- mod
28
- ));
29
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
-
31
- // src/lib/processEx.ts
32
- var processEx_exports = {};
33
- __export(processEx_exports, {
34
- processEx: () => processEx
35
- });
36
- module.exports = __toCommonJS(processEx_exports);
37
- var import_chalk = __toESM(require("chalk"), 1);
38
-
39
- // src/lib/withError.ts
40
- var withError = /* @__PURE__ */ __name((ex, closure, predicate = (ex2) => ex2.name !== void 0 && ex2.message !== void 0) => {
41
- return predicate(ex) ? closure(ex) : void 0;
42
- }, "withError");
43
-
44
- // src/lib/withErrnoException.ts
45
- var withErrnoException = /* @__PURE__ */ __name((ex, closure) => {
46
- return withError(ex, closure, (ex2) => ex2.errno !== void 0);
47
- }, "withErrnoException");
48
-
49
- // src/lib/processEx.ts
50
- var processEx = /* @__PURE__ */ __name((ex) => {
51
- const error = typeof ex === "string" ? new Error(ex) : ex;
52
- const exitCode = withErrnoException(error, (error2) => {
53
- if (error2.code === "ENOENT") {
54
- console.error(import_chalk.default.red(`'${error2.path}' not found.`));
55
- } else {
56
- console.error(import_chalk.default.red(`Errno: ${error2.code}`));
57
- }
58
- return error2.errno ?? -1;
59
- }) ?? withError(error, (error2) => {
60
- console.error(import_chalk.default.red(`${error2.name}: ${error2.message}`));
61
- return -1;
62
- }) ?? (() => {
63
- console.error(import_chalk.default.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`));
64
- return -1;
65
- })();
66
- process.exit(process.exitCode ?? exitCode);
67
- }, "processEx");
68
- // Annotate the CommonJS export names for ESM import in node:
69
- 0 && (module.exports = {
70
- processEx
71
- });
72
- //# sourceMappingURL=processEx.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/lib/processEx.ts","../../src/lib/withError.ts","../../src/lib/withErrnoException.ts"],"sourcesContent":["import chalk from 'chalk'\n\nimport { withErrnoException } from './withErrnoException.ts'\nimport { withError } from './withError.ts'\n\nexport const processEx = (ex: unknown) => {\n const error = typeof ex === 'string' ? new Error(ex) : ex\n const exitCode\n = withErrnoException(error, (error) => {\n if (error.code === 'ENOENT') {\n console.error(chalk.red(`'${error.path}' not found.`))\n } else {\n console.error(chalk.red(`Errno: ${error.code}`))\n }\n return error.errno ?? -1\n })\n ?? withError(error, (error) => {\n console.error(chalk.red(`${error.name}: ${error.message}`))\n return -1\n })\n ?? (() => {\n console.error(chalk.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`))\n return -1\n })()\n // This allows us to use a previously set exit code\n process.exit(process.exitCode ?? exitCode)\n}\n","export const withError = <T extends Error = Error>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ex: any,\n closure: (error: T) => number,\n predicate = (ex: T) => ex.name !== undefined && ex.message !== undefined,\n) => {\n return predicate(ex as T) ? closure(ex as T) : undefined\n}\n","import { withError } from './withError.ts'\n\nexport const withErrnoException = <T extends NodeJS.ErrnoException = NodeJS.ErrnoException>(ex: unknown, closure: (error: T) => number) => {\n return withError<T>(ex, closure, (ex: unknown) => (ex as NodeJS.ErrnoException).errno !== undefined)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;mBAAkB;;;ACAX,IAAMA,YAAY,wBAEvBC,IACAC,SACAC,YAAY,CAACF,QAAUA,IAAGG,SAASC,UAAaJ,IAAGK,YAAYD,WAAS;AAExE,SAAOF,UAAUF,EAAAA,IAAWC,QAAQD,EAAAA,IAAWI;AACjD,GAPyB;;;ACElB,IAAME,qBAAqB,wBAA0DC,IAAaC,YAAAA;AACvG,SAAOC,UAAaF,IAAIC,SAAS,CAACD,QAAiBA,IAA6BG,UAAUC,MAAAA;AAC5F,GAFkC;;;AFG3B,IAAMC,YAAY,wBAACC,OAAAA;AACxB,QAAMC,QAAQ,OAAOD,OAAO,WAAW,IAAIE,MAAMF,EAAAA,IAAMA;AACvD,QAAMG,WACFC,mBAAmBH,OAAO,CAACA,WAAAA;AAC3B,QAAIA,OAAMI,SAAS,UAAU;AAC3BC,cAAQL,MAAMM,aAAAA,QAAMC,IAAI,IAAIP,OAAMQ,IAAI,cAAc,CAAA;IACtD,OAAO;AACLH,cAAQL,MAAMM,aAAAA,QAAMC,IAAI,UAAUP,OAAMI,IAAI,EAAE,CAAA;IAChD;AACA,WAAOJ,OAAMS,SAAS;EACxB,CAAA,KACGC,UAAUV,OAAO,CAACA,WAAAA;AACnBK,YAAQL,MAAMM,aAAAA,QAAMC,IAAI,GAAGP,OAAMW,IAAI,KAAKX,OAAMY,OAAO,EAAE,CAAA;AACzD,WAAO;EACT,CAAA,MACI,MAAA;AACFP,YAAQL,MAAMM,aAAAA,QAAMC,IAAI,qBAAqBM,KAAKC,UAAUf,IAAI,MAAM,CAAA,CAAA,EAAI,CAAA;AAC1E,WAAO;EACT,GAAA;AAEFgB,UAAQC,KAAKD,QAAQb,YAAYA,QAAAA;AACnC,GArByB;","names":["withError","ex","closure","predicate","name","undefined","message","withErrnoException","ex","closure","withError","errno","undefined","processEx","ex","error","Error","exitCode","withErrnoException","code","console","chalk","red","path","errno","withError","name","message","JSON","stringify","process","exit"]}
@@ -1,134 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
9
- var __export = (target, all) => {
10
- for (var name in all)
11
- __defProp(target, name, { get: all[name], enumerable: true });
12
- };
13
- var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from))
16
- if (!__hasOwnProp.call(to, key) && key !== except)
17
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
- }
19
- return to;
20
- };
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
- mod
28
- ));
29
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
-
31
- // src/lib/runSteps.ts
32
- var runSteps_exports = {};
33
- __export(runSteps_exports, {
34
- runSteps: () => runSteps
35
- });
36
- module.exports = __toCommonJS(runSteps_exports);
37
- var import_node_child_process = require("child_process");
38
- var import_node_fs = require("fs");
39
- var import_chalk3 = __toESM(require("chalk"), 1);
40
-
41
- // src/lib/checkResult.ts
42
- var import_chalk = __toESM(require("chalk"), 1);
43
- var checkResult = /* @__PURE__ */ __name((name, result, level = "error", exitOnFail = false) => {
44
- if (result) {
45
- const exiting = exitOnFail ? "[Exiting Process]" : "[Continuing]";
46
- const chalkFunc = level === "error" ? import_chalk.default.red : import_chalk.default.yellow;
47
- console[level](chalkFunc(`${name} had ${result} failures ${exiting}`));
48
- if (exitOnFail) {
49
- process.exit(result);
50
- }
51
- }
52
- }, "checkResult");
53
-
54
- // src/lib/processEx.ts
55
- var import_chalk2 = __toESM(require("chalk"), 1);
56
-
57
- // src/lib/withError.ts
58
- var withError = /* @__PURE__ */ __name((ex, closure, predicate = (ex2) => ex2.name !== void 0 && ex2.message !== void 0) => {
59
- return predicate(ex) ? closure(ex) : void 0;
60
- }, "withError");
61
-
62
- // src/lib/withErrnoException.ts
63
- var withErrnoException = /* @__PURE__ */ __name((ex, closure) => {
64
- return withError(ex, closure, (ex2) => ex2.errno !== void 0);
65
- }, "withErrnoException");
66
-
67
- // src/lib/processEx.ts
68
- var processEx = /* @__PURE__ */ __name((ex) => {
69
- const error = typeof ex === "string" ? new Error(ex) : ex;
70
- const exitCode = withErrnoException(error, (error2) => {
71
- if (error2.code === "ENOENT") {
72
- console.error(import_chalk2.default.red(`'${error2.path}' not found.`));
73
- } else {
74
- console.error(import_chalk2.default.red(`Errno: ${error2.code}`));
75
- }
76
- return error2.errno ?? -1;
77
- }) ?? withError(error, (error2) => {
78
- console.error(import_chalk2.default.red(`${error2.name}: ${error2.message}`));
79
- return -1;
80
- }) ?? (() => {
81
- console.error(import_chalk2.default.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`));
82
- return -1;
83
- })();
84
- process.exit(process.exitCode ?? exitCode);
85
- }, "processEx");
86
-
87
- // src/lib/safeExit.ts
88
- var safeExit = /* @__PURE__ */ __name((func, exitOnFail = true) => {
89
- try {
90
- const result = func();
91
- if (result && exitOnFail) {
92
- process.exit(result);
93
- }
94
- return result;
95
- } catch (ex) {
96
- return processEx(ex);
97
- }
98
- }, "safeExit");
99
-
100
- // src/lib/runSteps.ts
101
- var runSteps = /* @__PURE__ */ __name((name, steps, exitOnFail = true, messages) => {
102
- return safeExit(() => {
103
- const pkgName = process.env.npm_package_name;
104
- console.log(import_chalk3.default.green(`${name} [${pkgName}]`));
105
- let totalStatus = 0;
106
- for (const [i, [command, args, config]] of steps.entries()) {
107
- if (messages?.[i]) {
108
- console.log(import_chalk3.default.gray(messages?.[i]));
109
- }
110
- const argList = Array.isArray(args) ? args : args.split(" ");
111
- if (command === "node" && !(0, import_node_fs.existsSync)(argList[0])) {
112
- throw new Error(`File not found [${argList[0]}]`);
113
- }
114
- const status = (0, import_node_child_process.spawnSync)(command, Array.isArray(args) ? args : args.split(" "), {
115
- ...config,
116
- encoding: "utf8",
117
- env: {
118
- FORCE_COLOR: "3",
119
- ...process.env
120
- },
121
- shell: true,
122
- stdio: "inherit"
123
- }).status ?? 0;
124
- checkResult(name, status, "error", exitOnFail);
125
- totalStatus += status ?? 0;
126
- }
127
- return totalStatus;
128
- }, !!exitOnFail);
129
- }, "runSteps");
130
- // Annotate the CommonJS export names for ESM import in node:
131
- 0 && (module.exports = {
132
- runSteps
133
- });
134
- //# sourceMappingURL=runSteps.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/lib/runSteps.ts","../../src/lib/checkResult.ts","../../src/lib/processEx.ts","../../src/lib/withError.ts","../../src/lib/withErrnoException.ts","../../src/lib/safeExit.ts"],"sourcesContent":["import { spawnSync, SpawnSyncOptionsWithBufferEncoding } from 'node:child_process'\nimport { existsSync } from 'node:fs'\n\nimport chalk from 'chalk'\n\nimport { checkResult } from './checkResult.ts'\nimport { safeExit } from './safeExit.ts'\n\nexport type ScriptStep =\n | [/* command */ 'yarn' | 'node' | 'ts-node-script' | 'tsc' | 'jest', /* arg */ string | string[]]\n | [/* command */ string, /* arg */ string | string[], /* config */ SpawnSyncOptionsWithBufferEncoding]\n\nexport const runSteps = (name: string, steps: ScriptStep[], exitOnFail = true, messages?: string[]): number => {\n return safeExit(() => {\n const pkgName = process.env.npm_package_name\n console.log(chalk.green(`${name} [${pkgName}]`))\n let totalStatus = 0\n for (const [i, [command, args, config]] of steps.entries()) {\n if (messages?.[i]) {\n console.log(chalk.gray(messages?.[i]))\n }\n const argList = Array.isArray(args) ? args : args.split(' ')\n if (command === 'node' && !existsSync(argList[0])) {\n throw new Error(`File not found [${argList[0]}]`)\n }\n const status\n = spawnSync(command, Array.isArray(args) ? args : args.split(' '), {\n ...config,\n encoding: 'utf8',\n env: { FORCE_COLOR: '3', ...process.env },\n shell: true,\n stdio: 'inherit',\n }).status ?? 0\n checkResult(name, status, 'error', exitOnFail)\n totalStatus += status ?? 0\n }\n return totalStatus\n }, !!exitOnFail)\n}\n","import chalk from 'chalk'\n\nexport const checkResult = (name: string, result: number, level: 'error' | 'warn' = 'error', exitOnFail = false) => {\n if (result) {\n const exiting = exitOnFail ? '[Exiting Process]' : '[Continuing]'\n const chalkFunc = level === 'error' ? chalk.red : chalk.yellow\n console[level](chalkFunc(`${name} had ${result} failures ${exiting}`))\n if (exitOnFail) {\n process.exit(result)\n }\n }\n}\n","import chalk from 'chalk'\n\nimport { withErrnoException } from './withErrnoException.ts'\nimport { withError } from './withError.ts'\n\nexport const processEx = (ex: unknown) => {\n const error = typeof ex === 'string' ? new Error(ex) : ex\n const exitCode\n = withErrnoException(error, (error) => {\n if (error.code === 'ENOENT') {\n console.error(chalk.red(`'${error.path}' not found.`))\n } else {\n console.error(chalk.red(`Errno: ${error.code}`))\n }\n return error.errno ?? -1\n })\n ?? withError(error, (error) => {\n console.error(chalk.red(`${error.name}: ${error.message}`))\n return -1\n })\n ?? (() => {\n console.error(chalk.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`))\n return -1\n })()\n // This allows us to use a previously set exit code\n process.exit(process.exitCode ?? exitCode)\n}\n","export const withError = <T extends Error = Error>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ex: any,\n closure: (error: T) => number,\n predicate = (ex: T) => ex.name !== undefined && ex.message !== undefined,\n) => {\n return predicate(ex as T) ? closure(ex as T) : undefined\n}\n","import { withError } from './withError.ts'\n\nexport const withErrnoException = <T extends NodeJS.ErrnoException = NodeJS.ErrnoException>(ex: unknown, closure: (error: T) => number) => {\n return withError<T>(ex, closure, (ex: unknown) => (ex as NodeJS.ErrnoException).errno !== undefined)\n}\n","/** Catch child process a crash and returns the code */\n\nimport { processEx } from './processEx.ts'\n\nconst safeExit = (func: () => number, exitOnFail = true): number => {\n try {\n const result = func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nconst safeExitAsync = async (func: () => Promise<number>, exitOnFail = true): Promise<number> => {\n try {\n const result = await func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nexport { safeExit, safeExitAsync }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;gCAA8D;AAC9D,qBAA2B;AAE3B,IAAAA,gBAAkB;;;ACHlB,mBAAkB;AAEX,IAAMC,cAAc,wBAACC,MAAcC,QAAgBC,QAA0B,SAASC,aAAa,U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AQ,SAASxB,UAAAA;AACnCW,qBAAea,UAAU;IAC3B;AACA,WAAOb;EACT,GAAG,CAAC,CAACX,UAAAA;AACP,GA1BwB;","names":["import_chalk","checkResult","name","result","level","exitOnFail","exiting","chalkFunc","chalk","red","yellow","console","process","exit","import_chalk","withError","ex","closure","predicate","name","undefined","message","withErrnoException","ex","closure","withError","errno","undefined","processEx","ex","error","Error","exitCode","withErrnoException","code","console","chalk","red","path","errno","withError","name","message","JSON","stringify","process","exit","safeExit","func","exitOnFail","result","process","exit","ex","processEx","runSteps","name","steps","exitOnFail","messages","safeExit","pkgName","process","env","npm_package_name","console","log","chalk","green","totalStatus","i","command","args","config","entries","gray","argList","Array","isArray","split","existsSync","Error","status","spawnSync","encoding","FORCE_COLOR","shell","stdio","checkResult"]}
@@ -1,147 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
9
- var __export = (target, all) => {
10
- for (var name in all)
11
- __defProp(target, name, { get: all[name], enumerable: true });
12
- };
13
- var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from))
16
- if (!__hasOwnProp.call(to, key) && key !== except)
17
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
- }
19
- return to;
20
- };
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
- mod
28
- ));
29
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
-
31
- // src/lib/runStepsAsync.ts
32
- var runStepsAsync_exports = {};
33
- __export(runStepsAsync_exports, {
34
- runStepAsync: () => runStepAsync,
35
- runStepsAsync: () => runStepsAsync
36
- });
37
- module.exports = __toCommonJS(runStepsAsync_exports);
38
- var import_node_child_process = require("child_process");
39
- var import_node_fs = require("fs");
40
- var import_chalk3 = __toESM(require("chalk"), 1);
41
-
42
- // src/lib/checkResult.ts
43
- var import_chalk = __toESM(require("chalk"), 1);
44
- var checkResult = /* @__PURE__ */ __name((name, result, level = "error", exitOnFail = false) => {
45
- if (result) {
46
- const exiting = exitOnFail ? "[Exiting Process]" : "[Continuing]";
47
- const chalkFunc = level === "error" ? import_chalk.default.red : import_chalk.default.yellow;
48
- console[level](chalkFunc(`${name} had ${result} failures ${exiting}`));
49
- if (exitOnFail) {
50
- process.exit(result);
51
- }
52
- }
53
- }, "checkResult");
54
-
55
- // src/lib/processEx.ts
56
- var import_chalk2 = __toESM(require("chalk"), 1);
57
-
58
- // src/lib/withError.ts
59
- var withError = /* @__PURE__ */ __name((ex, closure, predicate = (ex2) => ex2.name !== void 0 && ex2.message !== void 0) => {
60
- return predicate(ex) ? closure(ex) : void 0;
61
- }, "withError");
62
-
63
- // src/lib/withErrnoException.ts
64
- var withErrnoException = /* @__PURE__ */ __name((ex, closure) => {
65
- return withError(ex, closure, (ex2) => ex2.errno !== void 0);
66
- }, "withErrnoException");
67
-
68
- // src/lib/processEx.ts
69
- var processEx = /* @__PURE__ */ __name((ex) => {
70
- const error = typeof ex === "string" ? new Error(ex) : ex;
71
- const exitCode = withErrnoException(error, (error2) => {
72
- if (error2.code === "ENOENT") {
73
- console.error(import_chalk2.default.red(`'${error2.path}' not found.`));
74
- } else {
75
- console.error(import_chalk2.default.red(`Errno: ${error2.code}`));
76
- }
77
- return error2.errno ?? -1;
78
- }) ?? withError(error, (error2) => {
79
- console.error(import_chalk2.default.red(`${error2.name}: ${error2.message}`));
80
- return -1;
81
- }) ?? (() => {
82
- console.error(import_chalk2.default.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`));
83
- return -1;
84
- })();
85
- process.exit(process.exitCode ?? exitCode);
86
- }, "processEx");
87
-
88
- // src/lib/safeExit.ts
89
- var safeExitAsync = /* @__PURE__ */ __name(async (func, exitOnFail = true) => {
90
- try {
91
- const result = await func();
92
- if (result && exitOnFail) {
93
- process.exit(result);
94
- }
95
- return result;
96
- } catch (ex) {
97
- return processEx(ex);
98
- }
99
- }, "safeExitAsync");
100
-
101
- // src/lib/runStepsAsync.ts
102
- var runStepAsync = /* @__PURE__ */ __name((name, step, exitOnFail = true, message) => {
103
- return new Promise((resolve) => {
104
- const [command, args, config] = step;
105
- if (message) {
106
- console.log(import_chalk3.default.gray(message));
107
- }
108
- const argList = Array.isArray(args) ? args : args.split(" ");
109
- if (command === "node" && !(0, import_node_fs.existsSync)(argList[0])) {
110
- throw new Error(`File not found [${argList[0]}]`);
111
- }
112
- (0, import_node_child_process.spawn)(command, Array.isArray(args) ? args : args.split(" "), {
113
- ...config,
114
- env: {
115
- FORCE_COLOR: "3",
116
- ...process.env
117
- },
118
- shell: true,
119
- stdio: "inherit"
120
- }).on("close", (code) => {
121
- if (code) {
122
- console.error(import_chalk3.default.red(`Command Exited With Non-Zero Result [${import_chalk3.default.gray(code)}] | ${import_chalk3.default.yellow(command)} ${import_chalk3.default.white(Array.isArray(args) ? args.join(" ") : args)}`));
123
- checkResult(name, code, "error", exitOnFail);
124
- resolve(code);
125
- } else {
126
- resolve(0);
127
- }
128
- });
129
- });
130
- }, "runStepAsync");
131
- var runStepsAsync = /* @__PURE__ */ __name(async (name, steps, exitOnFail = true, messages) => {
132
- return await safeExitAsync(async () => {
133
- const pkgName = process.env.npm_package_name;
134
- console.log(import_chalk3.default.green(`${name} [${pkgName}]`));
135
- let result = 0;
136
- for (const [i, step] of steps.entries()) {
137
- result += await runStepAsync(name, step, exitOnFail, messages?.[i]);
138
- }
139
- return result;
140
- });
141
- }, "runStepsAsync");
142
- // Annotate the CommonJS export names for ESM import in node:
143
- 0 && (module.exports = {
144
- runStepAsync,
145
- runStepsAsync
146
- });
147
- //# sourceMappingURL=runStepsAsync.cjs.map