@xylabs/ts-scripts-yarn3 3.14.2 → 3.15.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 (970) hide show
  1. package/dist/actions/build.cjs +208 -0
  2. package/dist/actions/build.cjs.map +1 -0
  3. package/dist/actions/build.mjs +164 -13
  4. package/dist/actions/build.mjs.map +1 -1
  5. package/dist/actions/{clean-docs.js → clean-docs.cjs} +33 -7
  6. package/dist/actions/clean-docs.cjs.map +1 -0
  7. package/dist/actions/clean-docs.mjs +31 -4
  8. package/dist/actions/clean-docs.mjs.map +1 -1
  9. package/dist/actions/{clean-eslint.js → clean-eslint.cjs} +11 -6
  10. package/dist/actions/clean-eslint.cjs.map +1 -0
  11. package/dist/actions/clean-eslint.mjs +9 -3
  12. package/dist/actions/clean-eslint.mjs.map +1 -1
  13. package/dist/actions/clean-jest.cjs +147 -0
  14. package/dist/actions/clean-jest.cjs.map +1 -0
  15. package/dist/actions/clean-jest.mjs +107 -4
  16. package/dist/actions/clean-jest.mjs.map +1 -1
  17. package/dist/actions/clean.cjs +192 -0
  18. package/dist/actions/clean.cjs.map +1 -0
  19. package/dist/actions/clean.mjs +149 -11
  20. package/dist/actions/clean.mjs.map +1 -1
  21. package/dist/actions/compile.cjs +217 -0
  22. package/dist/actions/compile.cjs.map +1 -0
  23. package/dist/actions/compile.mjs +169 -17
  24. package/dist/actions/compile.mjs.map +1 -1
  25. package/dist/actions/{copy-assets.js → copy-assets.cjs} +54 -26
  26. package/dist/actions/copy-assets.cjs.map +1 -0
  27. package/dist/actions/copy-assets.mjs +50 -21
  28. package/dist/actions/copy-assets.mjs.map +1 -1
  29. package/dist/actions/cycle.cjs +156 -0
  30. package/dist/actions/cycle.cjs.map +1 -0
  31. package/dist/actions/cycle.mjs +117 -5
  32. package/dist/actions/cycle.mjs.map +1 -1
  33. package/dist/actions/dead.cjs +148 -0
  34. package/dist/actions/dead.cjs.map +1 -0
  35. package/dist/actions/dead.mjs +109 -4
  36. package/dist/actions/dead.mjs.map +1 -1
  37. package/dist/actions/deploy-major.cjs +160 -0
  38. package/dist/actions/deploy-major.cjs.map +1 -0
  39. package/dist/actions/deploy-major.mjs +119 -8
  40. package/dist/actions/deploy-major.mjs.map +1 -1
  41. package/dist/actions/deploy-minor.cjs +160 -0
  42. package/dist/actions/deploy-minor.cjs.map +1 -0
  43. package/dist/actions/deploy-minor.mjs +119 -8
  44. package/dist/actions/deploy-minor.mjs.map +1 -1
  45. package/dist/actions/deploy-next.cjs +160 -0
  46. package/dist/actions/deploy-next.cjs.map +1 -0
  47. package/dist/actions/deploy-next.mjs +119 -8
  48. package/dist/actions/deploy-next.mjs.map +1 -1
  49. package/dist/actions/deploy.cjs +160 -0
  50. package/dist/actions/deploy.cjs.map +1 -0
  51. package/dist/actions/deploy.mjs +119 -8
  52. package/dist/actions/deploy.mjs.map +1 -1
  53. package/dist/actions/deps.cjs +205 -0
  54. package/dist/actions/deps.cjs.map +1 -0
  55. package/dist/actions/deps.mjs +158 -17
  56. package/dist/actions/deps.mjs.map +1 -1
  57. package/dist/actions/dupdeps.cjs +229 -0
  58. package/dist/actions/dupdeps.cjs.map +1 -0
  59. package/dist/actions/dupdeps.mjs +189 -6
  60. package/dist/actions/dupdeps.mjs.map +1 -1
  61. package/dist/actions/fix.cjs +149 -0
  62. package/dist/actions/fix.cjs.map +1 -0
  63. package/dist/actions/fix.mjs +110 -4
  64. package/dist/actions/fix.mjs.map +1 -1
  65. package/dist/actions/gen-docs.cjs +186 -0
  66. package/dist/actions/gen-docs.cjs.map +1 -0
  67. package/dist/actions/gen-docs.mjs +143 -13
  68. package/dist/actions/gen-docs.mjs.map +1 -1
  69. package/dist/actions/gitignore-gen.cjs +138 -0
  70. package/dist/actions/gitignore-gen.cjs.map +1 -0
  71. package/dist/actions/gitignore-gen.mjs +99 -3
  72. package/dist/actions/gitignore-gen.mjs.map +1 -1
  73. package/dist/actions/{gitlint-fix.js → gitlint-fix.cjs} +19 -10
  74. package/dist/actions/gitlint-fix.cjs.map +1 -0
  75. package/dist/actions/gitlint-fix.mjs +17 -7
  76. package/dist/actions/gitlint-fix.mjs.map +1 -1
  77. package/dist/actions/{gitlint.js → gitlint.cjs} +11 -8
  78. package/dist/actions/gitlint.cjs.map +1 -0
  79. package/dist/actions/gitlint.mjs +10 -6
  80. package/dist/actions/gitlint.mjs.map +1 -1
  81. package/dist/actions/index.cjs +2598 -0
  82. package/dist/actions/index.cjs.map +1 -0
  83. package/dist/actions/index.mjs +2499 -38
  84. package/dist/actions/index.mjs.map +1 -1
  85. package/dist/actions/license.cjs +133 -0
  86. package/dist/actions/license.cjs.map +1 -0
  87. package/dist/actions/license.mjs +65 -37
  88. package/dist/actions/license.mjs.map +1 -1
  89. package/dist/actions/lint-clean.cjs +227 -0
  90. package/dist/actions/lint-clean.cjs.map +1 -0
  91. package/dist/actions/lint-clean.mjs +176 -5
  92. package/dist/actions/lint-clean.mjs.map +1 -1
  93. package/dist/actions/lint-profile.cjs +153 -0
  94. package/dist/actions/lint-profile.cjs.map +1 -0
  95. package/dist/actions/lint-profile.mjs +114 -4
  96. package/dist/actions/lint-profile.mjs.map +1 -1
  97. package/dist/actions/lint.cjs +217 -0
  98. package/dist/actions/lint.cjs.map +1 -0
  99. package/dist/actions/lint.mjs +159 -23
  100. package/dist/actions/lint.mjs.map +1 -1
  101. package/dist/actions/npmignore-gen.cjs +138 -0
  102. package/dist/actions/npmignore-gen.cjs.map +1 -0
  103. package/dist/actions/npmignore-gen.mjs +99 -3
  104. package/dist/actions/npmignore-gen.mjs.map +1 -1
  105. package/dist/actions/package/{clean-outputs.js → clean-outputs.cjs} +13 -6
  106. package/dist/actions/package/clean-outputs.cjs.map +1 -0
  107. package/dist/actions/package/clean-outputs.mjs +11 -3
  108. package/dist/actions/package/clean-outputs.mjs.map +1 -1
  109. package/dist/actions/package/{clean-typescript.js → clean-typescript.cjs} +13 -6
  110. package/dist/actions/package/clean-typescript.cjs.map +1 -0
  111. package/dist/actions/package/clean-typescript.mjs +11 -3
  112. package/dist/actions/package/clean-typescript.mjs.map +1 -1
  113. package/dist/actions/package/clean.cjs +83 -0
  114. package/dist/actions/package/clean.cjs.map +1 -0
  115. package/dist/actions/package/clean.mjs +44 -5
  116. package/dist/actions/package/clean.mjs.map +1 -1
  117. package/dist/actions/package/compile/{XyConfig.js → XyConfig.cjs} +3 -1
  118. package/dist/actions/package/compile/{XyConfig.js.map → XyConfig.cjs.map} +1 -1
  119. package/dist/actions/package/compile/{buildEntries.js → buildEntries.cjs} +30 -7
  120. package/dist/actions/package/compile/buildEntries.cjs.map +1 -0
  121. package/dist/actions/package/compile/buildEntries.mjs +26 -5
  122. package/dist/actions/package/compile/buildEntries.mjs.map +1 -1
  123. package/dist/actions/package/compile/compile.cjs +560 -0
  124. package/dist/actions/package/compile/compile.cjs.map +1 -0
  125. package/dist/actions/package/compile/compile.mjs +510 -14
  126. package/dist/actions/package/compile/compile.mjs.map +1 -1
  127. package/dist/actions/package/compile/{copyTypeFiles.js → copyTypeFiles.cjs} +26 -23
  128. package/dist/actions/package/compile/{copyTypeFiles.js.map → copyTypeFiles.cjs.map} +1 -1
  129. package/dist/actions/package/compile/copyTypeFiles.mjs +25 -21
  130. package/dist/actions/package/compile/copyTypeFiles.mjs.map +1 -1
  131. package/dist/actions/package/compile/{getCompilerOptions.js → getCompilerOptions.cjs} +21 -24
  132. package/dist/actions/package/compile/getCompilerOptions.cjs.map +1 -0
  133. package/dist/actions/package/compile/getCompilerOptions.mjs +19 -12
  134. package/dist/actions/package/compile/getCompilerOptions.mjs.map +1 -1
  135. package/dist/actions/package/compile/index.cjs +566 -0
  136. package/dist/actions/package/compile/index.cjs.map +1 -0
  137. package/dist/actions/package/compile/index.mjs +526 -4
  138. package/dist/actions/package/compile/index.mjs.map +1 -1
  139. package/dist/actions/package/compile/{inputs.js → inputs.cjs} +29 -17
  140. package/dist/actions/package/compile/inputs.cjs.map +1 -0
  141. package/dist/actions/package/compile/inputs.mjs +28 -15
  142. package/dist/actions/package/compile/inputs.mjs.map +1 -1
  143. package/dist/actions/package/compile/packageCompileTsc.cjs +164 -0
  144. package/dist/actions/package/compile/packageCompileTsc.cjs.map +1 -0
  145. package/dist/actions/package/compile/packageCompileTsc.mjs +103 -24
  146. package/dist/actions/package/compile/packageCompileTsc.mjs.map +1 -1
  147. package/dist/actions/package/compile/packageCompileTscTypes.cjs +199 -0
  148. package/dist/actions/package/compile/packageCompileTscTypes.cjs.map +1 -0
  149. package/dist/actions/package/compile/packageCompileTscTypes.mjs +111 -11
  150. package/dist/actions/package/compile/packageCompileTscTypes.mjs.map +1 -1
  151. package/dist/actions/package/compile/packageCompileTsup.cjs +516 -0
  152. package/dist/actions/package/compile/packageCompileTsup.cjs.map +1 -0
  153. package/dist/actions/package/compile/packageCompileTsup.mjs +456 -164
  154. package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -1
  155. package/dist/actions/package/{copy-assets.js → copy-assets.cjs} +25 -16
  156. package/dist/actions/package/{copy-assets.js.map → copy-assets.cjs.map} +1 -1
  157. package/dist/actions/package/copy-assets.mjs +22 -12
  158. package/dist/actions/package/copy-assets.mjs.map +1 -1
  159. package/dist/actions/package/{deps.js → deps.cjs} +103 -38
  160. package/dist/actions/package/deps.cjs.map +1 -0
  161. package/dist/actions/package/deps.mjs +99 -33
  162. package/dist/actions/package/deps.mjs.map +1 -1
  163. package/dist/actions/package/{gen-docs.js → gen-docs.cjs} +16 -10
  164. package/dist/actions/package/{gen-docs.js.map → gen-docs.cjs.map} +1 -1
  165. package/dist/actions/package/gen-docs.mjs +13 -6
  166. package/dist/actions/package/gen-docs.mjs.map +1 -1
  167. package/dist/actions/package/index.cjs +963 -0
  168. package/dist/actions/package/index.cjs.map +1 -0
  169. package/dist/actions/package/index.mjs +915 -9
  170. package/dist/actions/package/index.mjs.map +1 -1
  171. package/dist/actions/package/{publint.js → publint.cjs} +11 -8
  172. package/dist/actions/package/publint.cjs.map +1 -0
  173. package/dist/actions/package/publint.mjs +9 -5
  174. package/dist/actions/package/publint.mjs.map +1 -1
  175. package/dist/actions/package/recompile.cjs +612 -0
  176. package/dist/actions/package/recompile.cjs.map +1 -0
  177. package/dist/actions/package/recompile.mjs +571 -5
  178. package/dist/actions/package/recompile.mjs.map +1 -1
  179. package/dist/actions/publint.cjs +237 -0
  180. package/dist/actions/publint.cjs.map +1 -0
  181. package/dist/actions/publint.mjs +194 -11
  182. package/dist/actions/publint.mjs.map +1 -1
  183. package/dist/actions/rebuild.cjs +148 -0
  184. package/dist/actions/rebuild.cjs.map +1 -0
  185. package/dist/actions/rebuild.mjs +107 -5
  186. package/dist/actions/rebuild.mjs.map +1 -1
  187. package/dist/actions/recompile.cjs +232 -0
  188. package/dist/actions/recompile.cjs.map +1 -0
  189. package/dist/actions/recompile.mjs +184 -18
  190. package/dist/actions/recompile.mjs.map +1 -1
  191. package/dist/actions/reinstall.cjs +183 -0
  192. package/dist/actions/reinstall.cjs.map +1 -0
  193. package/dist/actions/reinstall.mjs +131 -5
  194. package/dist/actions/reinstall.mjs.map +1 -1
  195. package/dist/actions/relint.cjs +185 -0
  196. package/dist/actions/relint.cjs.map +1 -0
  197. package/dist/actions/relint.mjs +135 -5
  198. package/dist/actions/relint.mjs.map +1 -1
  199. package/dist/actions/retest.cjs +154 -0
  200. package/dist/actions/retest.cjs.map +1 -0
  201. package/dist/actions/retest.mjs +113 -5
  202. package/dist/actions/retest.mjs.map +1 -1
  203. package/dist/actions/sonar.cjs +149 -0
  204. package/dist/actions/sonar.cjs.map +1 -0
  205. package/dist/actions/sonar.mjs +110 -4
  206. package/dist/actions/sonar.mjs.map +1 -1
  207. package/dist/actions/statics.cjs +237 -0
  208. package/dist/actions/statics.cjs.map +1 -0
  209. package/dist/actions/statics.mjs +198 -7
  210. package/dist/actions/statics.mjs.map +1 -1
  211. package/dist/actions/test.cjs +147 -0
  212. package/dist/actions/test.cjs.map +1 -0
  213. package/dist/actions/test.mjs +108 -4
  214. package/dist/actions/test.mjs.map +1 -1
  215. package/dist/actions/up.cjs +144 -0
  216. package/dist/actions/up.cjs.map +1 -0
  217. package/dist/actions/up.mjs +105 -4
  218. package/dist/actions/up.mjs.map +1 -1
  219. package/dist/actions/updo.cjs +152 -0
  220. package/dist/actions/updo.cjs.map +1 -0
  221. package/dist/actions/updo.mjs +111 -6
  222. package/dist/actions/updo.mjs.map +1 -1
  223. package/dist/actions/upplug.cjs +172 -0
  224. package/dist/actions/upplug.cjs.map +1 -0
  225. package/dist/actions/upplug.mjs +131 -7
  226. package/dist/actions/upplug.mjs.map +1 -1
  227. package/dist/actions/upyarn.cjs +148 -0
  228. package/dist/actions/upyarn.cjs.map +1 -0
  229. package/dist/actions/upyarn.mjs +109 -4
  230. package/dist/actions/upyarn.mjs.map +1 -1
  231. package/dist/actions/yarn3only.cjs +106 -0
  232. package/dist/actions/yarn3only.cjs.map +1 -0
  233. package/dist/actions/yarn3only.mjs +62 -3
  234. package/dist/actions/yarn3only.mjs.map +1 -1
  235. package/dist/bin/build.cjs +39 -0
  236. package/dist/bin/build.cjs.map +1 -0
  237. package/dist/bin/build.mjs +15 -11
  238. package/dist/bin/build.mjs.map +1 -1
  239. package/dist/bin/clean.cjs +39 -0
  240. package/dist/bin/clean.cjs.map +1 -0
  241. package/dist/bin/clean.mjs +15 -11
  242. package/dist/bin/clean.mjs.map +1 -1
  243. package/dist/bin/compile-only.cjs +39 -0
  244. package/dist/bin/compile-only.cjs.map +1 -0
  245. package/dist/bin/compile-only.mjs +15 -11
  246. package/dist/bin/compile-only.mjs.map +1 -1
  247. package/dist/bin/compile.cjs +39 -0
  248. package/dist/bin/compile.cjs.map +1 -0
  249. package/dist/bin/compile.mjs +15 -11
  250. package/dist/bin/compile.mjs.map +1 -1
  251. package/dist/bin/cycle.cjs +39 -0
  252. package/dist/bin/cycle.cjs.map +1 -0
  253. package/dist/bin/cycle.mjs +15 -11
  254. package/dist/bin/cycle.mjs.map +1 -1
  255. package/dist/bin/{package/copy-assets-cjs.js → dead.cjs} +15 -7
  256. package/dist/bin/dead.cjs.map +1 -0
  257. package/dist/bin/dead.mjs +15 -11
  258. package/dist/bin/dead.mjs.map +1 -1
  259. package/dist/bin/deploy-major.cjs +39 -0
  260. package/dist/bin/deploy-major.cjs.map +1 -0
  261. package/dist/bin/deploy-major.mjs +15 -11
  262. package/dist/bin/deploy-major.mjs.map +1 -1
  263. package/dist/bin/deploy-minor.cjs +39 -0
  264. package/dist/bin/deploy-minor.cjs.map +1 -0
  265. package/dist/bin/deploy-minor.mjs +15 -11
  266. package/dist/bin/deploy-minor.mjs.map +1 -1
  267. package/dist/bin/deploy-next.cjs +39 -0
  268. package/dist/bin/deploy-next.cjs.map +1 -0
  269. package/dist/bin/deploy-next.mjs +15 -11
  270. package/dist/bin/deploy-next.mjs.map +1 -1
  271. package/dist/bin/deploy.cjs +39 -0
  272. package/dist/bin/deploy.cjs.map +1 -0
  273. package/dist/bin/deploy.mjs +15 -11
  274. package/dist/bin/deploy.mjs.map +1 -1
  275. package/dist/bin/deps.cjs +39 -0
  276. package/dist/bin/deps.cjs.map +1 -0
  277. package/dist/bin/deps.mjs +15 -11
  278. package/dist/bin/deps.mjs.map +1 -1
  279. package/dist/bin/{package/compile-tsup.js → fix.cjs} +15 -7
  280. package/dist/bin/fix.cjs.map +1 -0
  281. package/dist/bin/fix.mjs +15 -11
  282. package/dist/bin/fix.mjs.map +1 -1
  283. package/dist/bin/gen-docs.cjs +39 -0
  284. package/dist/bin/gen-docs.cjs.map +1 -0
  285. package/dist/bin/gen-docs.mjs +15 -11
  286. package/dist/bin/gen-docs.mjs.map +1 -1
  287. package/dist/bin/gitlint-fix.cjs +39 -0
  288. package/dist/bin/gitlint-fix.cjs.map +1 -0
  289. package/dist/bin/gitlint-fix.mjs +15 -11
  290. package/dist/bin/gitlint-fix.mjs.map +1 -1
  291. package/dist/bin/gitlint.cjs +39 -0
  292. package/dist/bin/gitlint.cjs.map +1 -0
  293. package/dist/bin/gitlint.mjs +15 -11
  294. package/dist/bin/gitlint.mjs.map +1 -1
  295. package/dist/bin/license.cjs +39 -0
  296. package/dist/bin/license.cjs.map +1 -0
  297. package/dist/bin/license.mjs +15 -11
  298. package/dist/bin/license.mjs.map +1 -1
  299. package/dist/bin/lint-clean.cjs +39 -0
  300. package/dist/bin/lint-clean.cjs.map +1 -0
  301. package/dist/bin/lint-clean.mjs +15 -11
  302. package/dist/bin/lint-clean.mjs.map +1 -1
  303. package/dist/bin/lint-fast.cjs +39 -0
  304. package/dist/bin/lint-fast.cjs.map +1 -0
  305. package/dist/bin/lint-fast.mjs +15 -11
  306. package/dist/bin/lint-fast.mjs.map +1 -1
  307. package/dist/bin/lint-profile.cjs +39 -0
  308. package/dist/bin/lint-profile.cjs.map +1 -0
  309. package/dist/bin/lint-profile.mjs +15 -11
  310. package/dist/bin/lint-profile.mjs.map +1 -1
  311. package/dist/bin/lint.cjs +39 -0
  312. package/dist/bin/lint.cjs.map +1 -0
  313. package/dist/bin/lint.mjs +15 -11
  314. package/dist/bin/lint.mjs.map +1 -1
  315. package/dist/bin/package/clean-outputs.cjs +51 -0
  316. package/dist/bin/package/clean-outputs.cjs.map +1 -0
  317. package/dist/bin/package/clean-outputs.mjs +26 -15
  318. package/dist/bin/package/clean-outputs.mjs.map +1 -1
  319. package/dist/bin/package/clean-typescript.cjs +51 -0
  320. package/dist/bin/package/clean-typescript.cjs.map +1 -0
  321. package/dist/bin/package/clean-typescript.mjs +26 -15
  322. package/dist/bin/package/clean-typescript.mjs.map +1 -1
  323. package/dist/bin/package/clean.cjs +76 -0
  324. package/dist/bin/package/clean.cjs.map +1 -0
  325. package/dist/bin/package/clean.mjs +51 -15
  326. package/dist/bin/package/clean.mjs.map +1 -1
  327. package/dist/bin/package/compile-only.cjs +559 -0
  328. package/dist/bin/package/compile-only.cjs.map +1 -0
  329. package/dist/bin/package/compile-only.mjs +530 -12
  330. package/dist/bin/package/compile-only.mjs.map +1 -1
  331. package/dist/bin/package/compile-tsup.cjs +514 -0
  332. package/dist/bin/package/compile-tsup.cjs.map +1 -0
  333. package/dist/bin/package/compile-tsup.mjs +485 -12
  334. package/dist/bin/package/compile-tsup.mjs.map +1 -1
  335. package/dist/bin/package/compile.cjs +562 -0
  336. package/dist/bin/package/compile.cjs.map +1 -0
  337. package/dist/bin/package/compile.mjs +532 -15
  338. package/dist/bin/package/compile.mjs.map +1 -1
  339. package/dist/bin/package/copy-assets-cjs.cjs +86 -0
  340. package/dist/bin/package/copy-assets-cjs.cjs.map +1 -0
  341. package/dist/bin/package/copy-assets-cjs.mjs +58 -11
  342. package/dist/bin/package/copy-assets-cjs.mjs.map +1 -1
  343. package/dist/bin/package/copy-assets-esm.cjs +86 -0
  344. package/dist/bin/package/copy-assets-esm.cjs.map +1 -0
  345. package/dist/bin/package/copy-assets-esm.mjs +58 -11
  346. package/dist/bin/package/copy-assets-esm.mjs.map +1 -1
  347. package/dist/bin/package/deps.cjs +208 -0
  348. package/dist/bin/package/deps.cjs.map +1 -0
  349. package/dist/bin/package/deps.mjs +181 -12
  350. package/dist/bin/package/deps.mjs.map +1 -1
  351. package/dist/bin/package/gen-docs.cjs +143 -0
  352. package/dist/bin/package/gen-docs.cjs.map +1 -0
  353. package/dist/bin/package/gen-docs.mjs +115 -12
  354. package/dist/bin/package/gen-docs.mjs.map +1 -1
  355. package/dist/bin/package/publint.cjs +77 -0
  356. package/dist/bin/package/publint.cjs.map +1 -0
  357. package/dist/bin/package/publint.mjs +50 -13
  358. package/dist/bin/package/publint.mjs.map +1 -1
  359. package/dist/bin/package/recompile.cjs +606 -0
  360. package/dist/bin/package/recompile.cjs.map +1 -0
  361. package/dist/bin/package/recompile.mjs +577 -12
  362. package/dist/bin/package/recompile.mjs.map +1 -1
  363. package/dist/bin/publint.cjs +39 -0
  364. package/dist/bin/publint.cjs.map +1 -0
  365. package/dist/bin/publint.mjs +15 -11
  366. package/dist/bin/publint.mjs.map +1 -1
  367. package/dist/bin/rebuild.cjs +39 -0
  368. package/dist/bin/rebuild.cjs.map +1 -0
  369. package/dist/bin/rebuild.mjs +15 -11
  370. package/dist/bin/rebuild.mjs.map +1 -1
  371. package/dist/bin/recompile.cjs +39 -0
  372. package/dist/bin/recompile.cjs.map +1 -0
  373. package/dist/bin/recompile.mjs +15 -11
  374. package/dist/bin/recompile.mjs.map +1 -1
  375. package/dist/bin/reinstall.cjs +39 -0
  376. package/dist/bin/reinstall.cjs.map +1 -0
  377. package/dist/bin/reinstall.mjs +15 -11
  378. package/dist/bin/reinstall.mjs.map +1 -1
  379. package/dist/bin/relint.cjs +39 -0
  380. package/dist/bin/relint.cjs.map +1 -0
  381. package/dist/bin/relint.mjs +15 -11
  382. package/dist/bin/relint.mjs.map +1 -1
  383. package/dist/bin/sonar.cjs +39 -0
  384. package/dist/bin/sonar.cjs.map +1 -0
  385. package/dist/bin/sonar.mjs +15 -11
  386. package/dist/bin/sonar.mjs.map +1 -1
  387. package/dist/bin/test.cjs +39 -0
  388. package/dist/bin/test.cjs.map +1 -0
  389. package/dist/bin/test.mjs +15 -11
  390. package/dist/bin/test.mjs.map +1 -1
  391. package/dist/bin/{package/deps.js → up.cjs} +15 -7
  392. package/dist/bin/up.cjs.map +1 -0
  393. package/dist/bin/up.mjs +15 -11
  394. package/dist/bin/up.mjs.map +1 -1
  395. package/dist/bin/updo.cjs +39 -0
  396. package/dist/bin/updo.cjs.map +1 -0
  397. package/dist/bin/updo.mjs +15 -11
  398. package/dist/bin/updo.mjs.map +1 -1
  399. package/dist/bin/upplug.cjs +39 -0
  400. package/dist/bin/upplug.cjs.map +1 -0
  401. package/dist/bin/upplug.mjs +15 -11
  402. package/dist/bin/upplug.mjs.map +1 -1
  403. package/dist/bin/upyarn.cjs +39 -0
  404. package/dist/bin/upyarn.cjs.map +1 -0
  405. package/dist/bin/upyarn.mjs +15 -11
  406. package/dist/bin/upyarn.mjs.map +1 -1
  407. package/dist/bin/xy-ts.cjs +1893 -0
  408. package/dist/bin/xy-ts.cjs.map +1 -0
  409. package/dist/bin/xy-ts.mjs +1865 -12
  410. package/dist/bin/xy-ts.mjs.map +1 -1
  411. package/dist/bin/xy.cjs +1893 -0
  412. package/dist/bin/xy.cjs.map +1 -0
  413. package/dist/bin/xy.mjs +1865 -12
  414. package/dist/bin/xy.mjs.map +1 -1
  415. package/dist/bin/yarn3only.cjs +39 -0
  416. package/dist/bin/yarn3only.cjs.map +1 -0
  417. package/dist/bin/yarn3only.mjs +15 -11
  418. package/dist/bin/yarn3only.mjs.map +1 -1
  419. package/dist/index.cjs +3127 -0
  420. package/dist/index.cjs.map +1 -0
  421. package/dist/{index.d.mts → index.d.cts} +1 -19
  422. package/dist/index.d.ts +1 -19
  423. package/dist/index.mjs +2987 -4
  424. package/dist/index.mjs.map +1 -1
  425. package/dist/lib/{checkResult.js → checkResult.cjs} +7 -4
  426. package/dist/lib/{checkResult.js.map → checkResult.cjs.map} +1 -1
  427. package/dist/lib/checkResult.mjs +6 -2
  428. package/dist/lib/checkResult.mjs.map +1 -1
  429. package/dist/lib/{createBuildConfig.js → createBuildConfig.cjs} +48 -13
  430. package/dist/lib/createBuildConfig.cjs.map +1 -0
  431. package/dist/lib/createBuildConfig.mjs +46 -10
  432. package/dist/lib/createBuildConfig.mjs.map +1 -1
  433. package/dist/lib/{defaultBuildConfig.js → defaultBuildConfig.cjs} +21 -5
  434. package/dist/lib/{defaultBuildConfig.js.map → defaultBuildConfig.cjs.map} +1 -1
  435. package/dist/lib/defaultBuildConfig.mjs +19 -4
  436. package/dist/lib/defaultBuildConfig.mjs.map +1 -1
  437. package/dist/lib/dependencies/{DuplicateDetector.js → DuplicateDetector.cjs} +39 -17
  438. package/dist/lib/dependencies/DuplicateDetector.cjs.map +1 -0
  439. package/dist/lib/dependencies/DuplicateDetector.mjs +35 -12
  440. package/dist/lib/dependencies/DuplicateDetector.mjs.map +1 -1
  441. package/dist/lib/dependencies/detectDuplicateDependencies.cjs +210 -0
  442. package/dist/lib/dependencies/detectDuplicateDependencies.cjs.map +1 -0
  443. package/dist/lib/dependencies/detectDuplicateDependencies.mjs +140 -5
  444. package/dist/lib/dependencies/detectDuplicateDependencies.mjs.map +1 -1
  445. package/dist/lib/dependencies/index.cjs +214 -0
  446. package/dist/lib/dependencies/index.cjs.map +1 -0
  447. package/dist/lib/dependencies/index.mjs +177 -2
  448. package/dist/lib/dependencies/index.mjs.map +1 -1
  449. package/dist/lib/file/{ReadFileSyncOptions.js → ReadFileSyncOptions.cjs} +6 -2
  450. package/dist/lib/file/{ReadFileSyncOptions.js.map → ReadFileSyncOptions.cjs.map} +1 -1
  451. package/dist/lib/file/ReadFileSyncOptions.mjs +4 -1
  452. package/dist/lib/file/ReadFileSyncOptions.mjs.map +1 -1
  453. package/dist/lib/file/{constants.js → constants.cjs} +5 -3
  454. package/dist/lib/file/{constants.js.map → constants.cjs.map} +1 -1
  455. package/dist/lib/file/constants.mjs +3 -2
  456. package/dist/lib/file/constants.mjs.map +1 -1
  457. package/dist/lib/file/{fileLines.js → fileLines.cjs} +25 -10
  458. package/dist/lib/file/fileLines.cjs.map +1 -0
  459. package/dist/lib/file/fileLines.mjs +23 -7
  460. package/dist/lib/file/fileLines.mjs.map +1 -1
  461. package/dist/lib/file/index.cjs +74 -0
  462. package/dist/lib/file/index.cjs.map +1 -0
  463. package/dist/lib/file/index.mjs +42 -4
  464. package/dist/lib/file/index.mjs.map +1 -1
  465. package/dist/lib/file/{tryReadFileSync.js → tryReadFileSync.cjs} +14 -5
  466. package/dist/lib/file/tryReadFileSync.cjs.map +1 -0
  467. package/dist/lib/file/tryReadFileSync.mjs +13 -3
  468. package/dist/lib/file/tryReadFileSync.mjs.map +1 -1
  469. package/dist/lib/generateIgnoreFiles.cjs +132 -0
  470. package/dist/lib/generateIgnoreFiles.cjs.map +1 -0
  471. package/dist/lib/generateIgnoreFiles.mjs +80 -9
  472. package/dist/lib/generateIgnoreFiles.mjs.map +1 -1
  473. package/dist/lib/index.cjs +617 -0
  474. package/dist/lib/index.cjs.map +1 -0
  475. package/dist/lib/index.mjs +549 -19
  476. package/dist/lib/index.mjs.map +1 -1
  477. package/dist/lib/{jsonFormatters.js → jsonFormatters.cjs} +6 -3
  478. package/dist/lib/jsonFormatters.cjs.map +1 -0
  479. package/dist/lib/jsonFormatters.mjs +6 -2
  480. package/dist/lib/jsonFormatters.mjs.map +1 -1
  481. package/dist/lib/{loadConfig.js → loadConfig.cjs} +16 -11
  482. package/dist/lib/loadConfig.cjs.map +1 -0
  483. package/dist/lib/loadConfig.mjs +13 -7
  484. package/dist/lib/loadConfig.mjs.map +1 -1
  485. package/dist/lib/{parsedPackageJSON.js → parsedPackageJSON.cjs} +7 -4
  486. package/dist/lib/{parsedPackageJSON.js.map → parsedPackageJSON.cjs.map} +1 -1
  487. package/dist/lib/parsedPackageJSON.mjs +6 -2
  488. package/dist/lib/parsedPackageJSON.mjs.map +1 -1
  489. package/dist/lib/{processEx.js → processEx.cjs} +21 -8
  490. package/dist/lib/processEx.cjs.map +1 -0
  491. package/dist/lib/processEx.mjs +18 -4
  492. package/dist/lib/processEx.mjs.map +1 -1
  493. package/dist/lib/runSteps.cjs +134 -0
  494. package/dist/lib/runSteps.cjs.map +1 -0
  495. package/dist/lib/runSteps.mjs +74 -8
  496. package/dist/lib/runSteps.mjs.map +1 -1
  497. package/dist/lib/runStepsAsync.cjs +147 -0
  498. package/dist/lib/runStepsAsync.cjs.map +1 -0
  499. package/dist/lib/runStepsAsync.mjs +77 -17
  500. package/dist/lib/runStepsAsync.mjs.map +1 -1
  501. package/dist/lib/runXy.cjs +150 -0
  502. package/dist/lib/runXy.cjs.map +1 -0
  503. package/dist/lib/runXy.mjs +111 -4
  504. package/dist/lib/runXy.mjs.map +1 -1
  505. package/dist/lib/{runXyWithWarning.js → runXyWithWarning.cjs} +7 -4
  506. package/dist/lib/runXyWithWarning.cjs.map +1 -0
  507. package/dist/lib/runXyWithWarning.mjs +6 -2
  508. package/dist/lib/runXyWithWarning.mjs.map +1 -1
  509. package/dist/lib/safeExit.cjs +100 -0
  510. package/dist/lib/safeExit.cjs.map +1 -0
  511. package/dist/lib/safeExit.mjs +41 -5
  512. package/dist/lib/safeExit.mjs.map +1 -1
  513. package/dist/lib/string/{empty.js → empty.cjs} +6 -3
  514. package/dist/lib/string/{empty.js.map → empty.cjs.map} +1 -1
  515. package/dist/lib/string/empty.mjs +6 -2
  516. package/dist/lib/string/empty.mjs.map +1 -1
  517. package/dist/{actions/up.js → lib/string/index.cjs} +23 -10
  518. package/dist/lib/string/index.cjs.map +1 -0
  519. package/dist/lib/string/index.mjs +17 -2
  520. package/dist/lib/string/index.mjs.map +1 -1
  521. package/dist/lib/string/{union.js → union.cjs} +8 -2
  522. package/dist/lib/string/{union.js.map → union.cjs.map} +1 -1
  523. package/dist/lib/string/union.mjs +8 -1
  524. package/dist/lib/string/union.mjs.map +1 -1
  525. package/dist/lib/{withErrnoException.js → withErrnoException.cjs} +14 -5
  526. package/dist/lib/withErrnoException.cjs.map +1 -0
  527. package/dist/lib/withErrnoException.mjs +11 -3
  528. package/dist/lib/withErrnoException.mjs.map +1 -1
  529. package/dist/lib/{withError.js → withError.cjs} +6 -3
  530. package/dist/lib/{withError.js.map → withError.cjs.map} +1 -1
  531. package/dist/lib/withError.mjs +6 -2
  532. package/dist/lib/withError.mjs.map +1 -1
  533. package/dist/lib/yarn/index.cjs +93 -0
  534. package/dist/lib/yarn/index.cjs.map +1 -0
  535. package/dist/lib/yarn/index.mjs +64 -3
  536. package/dist/lib/yarn/index.mjs.map +1 -1
  537. package/dist/lib/yarn/{isYarnVersionOrGreater.js → isYarnVersionOrGreater.cjs} +17 -6
  538. package/dist/lib/yarn/{isYarnVersionOrGreater.js.map → isYarnVersionOrGreater.cjs.map} +1 -1
  539. package/dist/lib/yarn/isYarnVersionOrGreater.mjs +16 -4
  540. package/dist/lib/yarn/isYarnVersionOrGreater.mjs.map +1 -1
  541. package/dist/lib/yarn/workspace/{Workspace.js → Workspace.cjs} +3 -1
  542. package/dist/lib/yarn/workspace/{Workspace.js.map → Workspace.cjs.map} +1 -1
  543. package/dist/lib/yarn/workspace/index.cjs +60 -0
  544. package/dist/lib/yarn/workspace/index.cjs.map +1 -0
  545. package/dist/lib/yarn/workspace/index.mjs +33 -3
  546. package/dist/lib/yarn/workspace/index.mjs.map +1 -1
  547. package/dist/lib/yarn/workspace/{yarnWorkspace.js → yarnWorkspace.cjs} +29 -5
  548. package/dist/lib/yarn/workspace/yarnWorkspace.cjs.map +1 -0
  549. package/dist/lib/yarn/workspace/yarnWorkspace.mjs +26 -3
  550. package/dist/lib/yarn/workspace/yarnWorkspace.mjs.map +1 -1
  551. package/dist/lib/yarn/workspace/{yarnWorkspaces.js → yarnWorkspaces.cjs} +16 -5
  552. package/dist/lib/yarn/workspace/yarnWorkspaces.cjs.map +1 -0
  553. package/dist/lib/yarn/workspace/yarnWorkspaces.mjs +15 -3
  554. package/dist/lib/yarn/workspace/yarnWorkspaces.mjs.map +1 -1
  555. package/dist/lib/yarn/{yarnInitCwd.js → yarnInitCwd.cjs} +6 -3
  556. package/dist/lib/yarn/yarnInitCwd.cjs.map +1 -0
  557. package/dist/lib/yarn/yarnInitCwd.mjs +6 -2
  558. package/dist/lib/yarn/yarnInitCwd.mjs.map +1 -1
  559. package/dist/{loadPackageConfig.js → loadPackageConfig.cjs} +10 -5
  560. package/dist/{loadPackageConfig.js.map → loadPackageConfig.cjs.map} +1 -1
  561. package/dist/loadPackageConfig.mjs +9 -3
  562. package/dist/loadPackageConfig.mjs.map +1 -1
  563. package/dist/types.d.cjs +2 -0
  564. package/dist/types.d.mjs +0 -9
  565. package/dist/types.d.mjs.map +1 -1
  566. package/dist/xy/index.cjs +1912 -0
  567. package/dist/xy/index.cjs.map +1 -0
  568. package/dist/xy/index.mjs +1870 -7
  569. package/dist/xy/index.mjs.map +1 -1
  570. package/dist/xy/{param.js → param.cjs} +6 -3
  571. package/dist/xy/{param.js.map → param.cjs.map} +1 -1
  572. package/dist/xy/param.mjs +6 -2
  573. package/dist/xy/param.mjs.map +1 -1
  574. package/dist/xy/xy.cjs +1898 -0
  575. package/dist/xy/xy.cjs.map +1 -0
  576. package/dist/xy/xy.mjs +1857 -10
  577. package/dist/xy/xy.mjs.map +1 -1
  578. package/dist/xy/xyBuildCommands.cjs +595 -0
  579. package/dist/xy/xyBuildCommands.cjs.map +1 -0
  580. package/dist/xy/xyBuildCommands.mjs +553 -106
  581. package/dist/xy/xyBuildCommands.mjs.map +1 -1
  582. package/dist/xy/xyCommonCommands.cjs +723 -0
  583. package/dist/xy/xyCommonCommands.cjs.map +1 -0
  584. package/dist/xy/xyCommonCommands.mjs +679 -143
  585. package/dist/xy/xyCommonCommands.mjs.map +1 -1
  586. package/dist/xy/xyDeployCommands.cjs +263 -0
  587. package/dist/xy/xyDeployCommands.cjs.map +1 -0
  588. package/dist/xy/xyDeployCommands.mjs +220 -40
  589. package/dist/xy/xyDeployCommands.mjs.map +1 -1
  590. package/dist/xy/xyInstallCommands.cjs +511 -0
  591. package/dist/xy/xyInstallCommands.cjs.map +1 -0
  592. package/dist/xy/xyInstallCommands.mjs +465 -64
  593. package/dist/xy/xyInstallCommands.mjs.map +1 -1
  594. package/dist/xy/xyLintCommands.cjs +466 -0
  595. package/dist/xy/xyLintCommands.cjs.map +1 -0
  596. package/dist/xy/xyLintCommands.mjs +422 -71
  597. package/dist/xy/xyLintCommands.mjs.map +1 -1
  598. package/dist/xy/{xyParseOptions.js → xyParseOptions.cjs} +11 -5
  599. package/dist/xy/xyParseOptions.cjs.map +1 -0
  600. package/dist/xy/xyParseOptions.mjs +10 -3
  601. package/dist/xy/xyParseOptions.mjs.map +1 -1
  602. package/package.json +68 -74
  603. package/src/actions/build.ts +1 -1
  604. package/src/actions/clean-docs.ts +1 -1
  605. package/src/actions/clean-jest.ts +1 -1
  606. package/src/actions/clean.ts +1 -1
  607. package/src/actions/compile.ts +1 -1
  608. package/src/actions/copy-assets.ts +1 -1
  609. package/src/actions/cycle.ts +1 -1
  610. package/src/actions/dead.ts +1 -1
  611. package/src/actions/deploy-major.ts +1 -1
  612. package/src/actions/deploy-minor.ts +1 -1
  613. package/src/actions/deploy-next.ts +1 -1
  614. package/src/actions/deploy.ts +1 -1
  615. package/src/actions/deps.ts +1 -1
  616. package/src/actions/dupdeps.ts +1 -1
  617. package/src/actions/fix.ts +1 -1
  618. package/src/actions/gen-docs.ts +1 -1
  619. package/src/actions/gitignore-gen.ts +1 -1
  620. package/src/actions/gitlint-fix.ts +2 -2
  621. package/src/actions/gitlint.ts +2 -2
  622. package/src/actions/index.ts +38 -38
  623. package/src/actions/license.ts +1 -1
  624. package/src/actions/lint-clean.ts +2 -2
  625. package/src/actions/lint-profile.ts +1 -1
  626. package/src/actions/lint.ts +1 -1
  627. package/src/actions/npmignore-gen.ts +1 -1
  628. package/src/actions/package/clean.ts +2 -2
  629. package/src/actions/package/compile/buildEntries.ts +2 -2
  630. package/src/actions/package/compile/compile.ts +5 -5
  631. package/src/actions/package/compile/getCompilerOptions.ts +10 -7
  632. package/src/actions/package/compile/index.ts +4 -4
  633. package/src/actions/package/compile/packageCompileTsc.ts +5 -5
  634. package/src/actions/package/compile/packageCompileTscTypes.ts +6 -6
  635. package/src/actions/package/compile/packageCompileTsup.ts +10 -10
  636. package/src/actions/package/deps.ts +3 -2
  637. package/src/actions/package/index.ts +9 -9
  638. package/src/actions/package/publint.ts +1 -0
  639. package/src/actions/package/recompile.ts +2 -2
  640. package/src/actions/publint.ts +1 -1
  641. package/src/actions/rebuild.ts +1 -1
  642. package/src/actions/recompile.ts +1 -1
  643. package/src/actions/reinstall.ts +1 -1
  644. package/src/actions/relint.ts +1 -1
  645. package/src/actions/retest.ts +1 -1
  646. package/src/actions/sonar.ts +1 -1
  647. package/src/actions/statics.ts +1 -1
  648. package/src/actions/test.ts +1 -1
  649. package/src/actions/up.ts +1 -1
  650. package/src/actions/updo.ts +1 -1
  651. package/src/actions/upplug.ts +1 -1
  652. package/src/actions/upyarn.ts +1 -1
  653. package/src/actions/yarn3only.ts +1 -1
  654. package/src/bin/build.ts +1 -1
  655. package/src/bin/clean.ts +1 -1
  656. package/src/bin/compile-only.ts +1 -1
  657. package/src/bin/compile.ts +1 -1
  658. package/src/bin/cycle.ts +1 -1
  659. package/src/bin/dead.ts +1 -1
  660. package/src/bin/deploy-major.ts +1 -1
  661. package/src/bin/deploy-minor.ts +1 -1
  662. package/src/bin/deploy-next.ts +1 -1
  663. package/src/bin/deploy.ts +1 -1
  664. package/src/bin/deps.ts +1 -1
  665. package/src/bin/fix.ts +1 -1
  666. package/src/bin/gen-docs.ts +1 -1
  667. package/src/bin/gitlint-fix.ts +1 -1
  668. package/src/bin/gitlint.ts +1 -1
  669. package/src/bin/license.ts +1 -1
  670. package/src/bin/lint-clean.ts +1 -1
  671. package/src/bin/lint-fast.ts +1 -1
  672. package/src/bin/lint-profile.ts +1 -1
  673. package/src/bin/lint.ts +1 -1
  674. package/src/bin/package/clean-outputs.ts +1 -1
  675. package/src/bin/package/clean-typescript.ts +1 -1
  676. package/src/bin/package/clean.ts +1 -1
  677. package/src/bin/package/compile-only.ts +1 -1
  678. package/src/bin/package/compile-tsup.ts +1 -1
  679. package/src/bin/package/compile.ts +1 -1
  680. package/src/bin/package/copy-assets-cjs.ts +1 -1
  681. package/src/bin/package/copy-assets-esm.ts +1 -1
  682. package/src/bin/package/deps.ts +1 -1
  683. package/src/bin/package/gen-docs.ts +1 -1
  684. package/src/bin/package/publint.ts +1 -1
  685. package/src/bin/package/recompile.ts +1 -1
  686. package/src/bin/publint.ts +1 -1
  687. package/src/bin/rebuild.ts +1 -1
  688. package/src/bin/recompile.ts +1 -1
  689. package/src/bin/reinstall.ts +1 -1
  690. package/src/bin/relint.ts +1 -1
  691. package/src/bin/sonar.ts +1 -1
  692. package/src/bin/test.ts +1 -1
  693. package/src/bin/up.ts +1 -1
  694. package/src/bin/updo.ts +1 -1
  695. package/src/bin/upplug.ts +1 -1
  696. package/src/bin/upyarn.ts +1 -1
  697. package/src/bin/yarn3only.ts +1 -1
  698. package/src/index.ts +4 -4
  699. package/src/lib/createBuildConfig.ts +1 -1
  700. package/src/lib/dependencies/DuplicateDetector.ts +2 -2
  701. package/src/lib/dependencies/detectDuplicateDependencies.ts +2 -2
  702. package/src/lib/dependencies/index.ts +2 -2
  703. package/src/lib/file/fileLines.ts +3 -3
  704. package/src/lib/file/index.ts +4 -4
  705. package/src/lib/file/tryReadFileSync.ts +1 -1
  706. package/src/lib/generateIgnoreFiles.ts +3 -3
  707. package/src/lib/index.ts +19 -19
  708. package/src/lib/loadConfig.ts +1 -1
  709. package/src/lib/processEx.ts +2 -2
  710. package/src/lib/runSteps.ts +2 -2
  711. package/src/lib/runStepsAsync.ts +3 -3
  712. package/src/lib/runXy.ts +1 -1
  713. package/src/lib/safeExit.ts +1 -1
  714. package/src/lib/string/index.ts +2 -2
  715. package/src/lib/withErrnoException.ts +1 -1
  716. package/src/lib/yarn/index.ts +3 -3
  717. package/src/lib/yarn/workspace/index.ts +3 -3
  718. package/src/lib/yarn/workspace/yarnWorkspace.ts +2 -2
  719. package/src/lib/yarn/workspace/yarnWorkspaces.ts +1 -1
  720. package/src/xy/index.ts +7 -7
  721. package/src/xy/xy.ts +6 -6
  722. package/src/xy/xyBuildCommands.ts +1 -1
  723. package/src/xy/xyCommonCommands.ts +2 -2
  724. package/src/xy/xyDeployCommands.ts +1 -1
  725. package/src/xy/xyInstallCommands.ts +1 -1
  726. package/src/xy/xyLintCommands.ts +2 -2
  727. package/src/xy/xyParseOptions.ts +1 -0
  728. package/tsconfig.build.json +10 -4
  729. package/tsup.config.ts +12 -2
  730. package/dist/actions/build.js +0 -58
  731. package/dist/actions/build.js.map +0 -1
  732. package/dist/actions/clean-docs.js.map +0 -1
  733. package/dist/actions/clean-eslint.js.map +0 -1
  734. package/dist/actions/clean-jest.js +0 -33
  735. package/dist/actions/clean-jest.js.map +0 -1
  736. package/dist/actions/clean.js +0 -43
  737. package/dist/actions/clean.js.map +0 -1
  738. package/dist/actions/compile.js +0 -66
  739. package/dist/actions/compile.js.map +0 -1
  740. package/dist/actions/copy-assets.js.map +0 -1
  741. package/dist/actions/cycle.js +0 -33
  742. package/dist/actions/cycle.js.map +0 -1
  743. package/dist/actions/dead.js +0 -32
  744. package/dist/actions/dead.js.map +0 -1
  745. package/dist/actions/deploy-major.js +0 -38
  746. package/dist/actions/deploy-major.js.map +0 -1
  747. package/dist/actions/deploy-minor.js +0 -38
  748. package/dist/actions/deploy-minor.js.map +0 -1
  749. package/dist/actions/deploy-next.js +0 -38
  750. package/dist/actions/deploy-next.js.map +0 -1
  751. package/dist/actions/deploy.js +0 -38
  752. package/dist/actions/deploy.js.map +0 -1
  753. package/dist/actions/deps.js +0 -65
  754. package/dist/actions/deps.js.map +0 -1
  755. package/dist/actions/dupdeps.js +0 -47
  756. package/dist/actions/dupdeps.js.map +0 -1
  757. package/dist/actions/fix.js +0 -32
  758. package/dist/actions/fix.js.map +0 -1
  759. package/dist/actions/gen-docs.js +0 -45
  760. package/dist/actions/gen-docs.js.map +0 -1
  761. package/dist/actions/gitignore-gen.js +0 -31
  762. package/dist/actions/gitignore-gen.js.map +0 -1
  763. package/dist/actions/gitlint-fix.js.map +0 -1
  764. package/dist/actions/gitlint.js.map +0 -1
  765. package/dist/actions/index.js +0 -97
  766. package/dist/actions/index.js.map +0 -1
  767. package/dist/actions/license.js +0 -106
  768. package/dist/actions/license.js.map +0 -1
  769. package/dist/actions/lint-clean.js +0 -47
  770. package/dist/actions/lint-clean.js.map +0 -1
  771. package/dist/actions/lint-profile.js +0 -32
  772. package/dist/actions/lint-profile.js.map +0 -1
  773. package/dist/actions/lint.js +0 -82
  774. package/dist/actions/lint.js.map +0 -1
  775. package/dist/actions/npmignore-gen.js +0 -31
  776. package/dist/actions/npmignore-gen.js.map +0 -1
  777. package/dist/actions/package/clean-outputs.js.map +0 -1
  778. package/dist/actions/package/clean-typescript.js.map +0 -1
  779. package/dist/actions/package/clean.js +0 -33
  780. package/dist/actions/package/clean.js.map +0 -1
  781. package/dist/actions/package/compile/buildEntries.js.map +0 -1
  782. package/dist/actions/package/compile/compile.js +0 -63
  783. package/dist/actions/package/compile/compile.js.map +0 -1
  784. package/dist/actions/package/compile/getCompilerOptions.js.map +0 -1
  785. package/dist/actions/package/compile/index.js +0 -29
  786. package/dist/actions/package/compile/index.js.map +0 -1
  787. package/dist/actions/package/compile/inputs.js.map +0 -1
  788. package/dist/actions/package/compile/packageCompileTsc.js +0 -80
  789. package/dist/actions/package/compile/packageCompileTsc.js.map +0 -1
  790. package/dist/actions/package/compile/packageCompileTscTypes.js +0 -98
  791. package/dist/actions/package/compile/packageCompileTscTypes.js.map +0 -1
  792. package/dist/actions/package/compile/packageCompileTsup.js +0 -213
  793. package/dist/actions/package/compile/packageCompileTsup.js.map +0 -1
  794. package/dist/actions/package/deps.js.map +0 -1
  795. package/dist/actions/package/index.js +0 -39
  796. package/dist/actions/package/index.js.map +0 -1
  797. package/dist/actions/package/publint.js.map +0 -1
  798. package/dist/actions/package/recompile.js +0 -33
  799. package/dist/actions/package/recompile.js.map +0 -1
  800. package/dist/actions/publint.js +0 -43
  801. package/dist/actions/publint.js.map +0 -1
  802. package/dist/actions/rebuild.js +0 -35
  803. package/dist/actions/rebuild.js.map +0 -1
  804. package/dist/actions/recompile.js +0 -67
  805. package/dist/actions/recompile.js.map +0 -1
  806. package/dist/actions/reinstall.js +0 -48
  807. package/dist/actions/reinstall.js.map +0 -1
  808. package/dist/actions/relint.js +0 -46
  809. package/dist/actions/relint.js.map +0 -1
  810. package/dist/actions/retest.js +0 -35
  811. package/dist/actions/retest.js.map +0 -1
  812. package/dist/actions/sonar.js +0 -32
  813. package/dist/actions/sonar.js.map +0 -1
  814. package/dist/actions/statics.js +0 -47
  815. package/dist/actions/statics.js.map +0 -1
  816. package/dist/actions/test.js +0 -32
  817. package/dist/actions/test.js.map +0 -1
  818. package/dist/actions/up.js.map +0 -1
  819. package/dist/actions/updo.js +0 -36
  820. package/dist/actions/updo.js.map +0 -1
  821. package/dist/actions/upplug.js +0 -37
  822. package/dist/actions/upplug.js.map +0 -1
  823. package/dist/actions/upyarn.js +0 -32
  824. package/dist/actions/upyarn.js.map +0 -1
  825. package/dist/actions/yarn3only.js +0 -36
  826. package/dist/actions/yarn3only.js.map +0 -1
  827. package/dist/bin/build.js +0 -5
  828. package/dist/bin/build.js.map +0 -1
  829. package/dist/bin/clean.js +0 -5
  830. package/dist/bin/clean.js.map +0 -1
  831. package/dist/bin/compile-only.js +0 -5
  832. package/dist/bin/compile-only.js.map +0 -1
  833. package/dist/bin/compile.js +0 -5
  834. package/dist/bin/compile.js.map +0 -1
  835. package/dist/bin/cycle.js +0 -5
  836. package/dist/bin/cycle.js.map +0 -1
  837. package/dist/bin/dead.js +0 -5
  838. package/dist/bin/dead.js.map +0 -1
  839. package/dist/bin/deploy-major.js +0 -5
  840. package/dist/bin/deploy-major.js.map +0 -1
  841. package/dist/bin/deploy-minor.js +0 -5
  842. package/dist/bin/deploy-minor.js.map +0 -1
  843. package/dist/bin/deploy-next.js +0 -5
  844. package/dist/bin/deploy-next.js.map +0 -1
  845. package/dist/bin/deploy.js +0 -5
  846. package/dist/bin/deploy.js.map +0 -1
  847. package/dist/bin/deps.js +0 -5
  848. package/dist/bin/deps.js.map +0 -1
  849. package/dist/bin/fix.js +0 -5
  850. package/dist/bin/fix.js.map +0 -1
  851. package/dist/bin/gen-docs.js +0 -5
  852. package/dist/bin/gen-docs.js.map +0 -1
  853. package/dist/bin/gitlint-fix.js +0 -5
  854. package/dist/bin/gitlint-fix.js.map +0 -1
  855. package/dist/bin/gitlint.js +0 -5
  856. package/dist/bin/gitlint.js.map +0 -1
  857. package/dist/bin/license.js +0 -5
  858. package/dist/bin/license.js.map +0 -1
  859. package/dist/bin/lint-clean.js +0 -5
  860. package/dist/bin/lint-clean.js.map +0 -1
  861. package/dist/bin/lint-fast.js +0 -5
  862. package/dist/bin/lint-fast.js.map +0 -1
  863. package/dist/bin/lint-profile.js +0 -5
  864. package/dist/bin/lint-profile.js.map +0 -1
  865. package/dist/bin/lint.js +0 -5
  866. package/dist/bin/lint.js.map +0 -1
  867. package/dist/bin/package/clean-outputs.js +0 -10
  868. package/dist/bin/package/clean-outputs.js.map +0 -1
  869. package/dist/bin/package/clean-typescript.js +0 -10
  870. package/dist/bin/package/clean-typescript.js.map +0 -1
  871. package/dist/bin/package/clean.js +0 -10
  872. package/dist/bin/package/clean.js.map +0 -1
  873. package/dist/bin/package/compile-only.js +0 -31
  874. package/dist/bin/package/compile-only.js.map +0 -1
  875. package/dist/bin/package/compile-tsup.js.map +0 -1
  876. package/dist/bin/package/compile.js +0 -35
  877. package/dist/bin/package/compile.js.map +0 -1
  878. package/dist/bin/package/copy-assets-cjs.js.map +0 -1
  879. package/dist/bin/package/copy-assets-esm.js +0 -31
  880. package/dist/bin/package/copy-assets-esm.js.map +0 -1
  881. package/dist/bin/package/deps.js.map +0 -1
  882. package/dist/bin/package/gen-docs.js +0 -10
  883. package/dist/bin/package/gen-docs.js.map +0 -1
  884. package/dist/bin/package/publint.js +0 -32
  885. package/dist/bin/package/publint.js.map +0 -1
  886. package/dist/bin/package/recompile.js +0 -31
  887. package/dist/bin/package/recompile.js.map +0 -1
  888. package/dist/bin/publint.js +0 -5
  889. package/dist/bin/publint.js.map +0 -1
  890. package/dist/bin/rebuild.js +0 -5
  891. package/dist/bin/rebuild.js.map +0 -1
  892. package/dist/bin/recompile.js +0 -5
  893. package/dist/bin/recompile.js.map +0 -1
  894. package/dist/bin/reinstall.js +0 -5
  895. package/dist/bin/reinstall.js.map +0 -1
  896. package/dist/bin/relint.js +0 -5
  897. package/dist/bin/relint.js.map +0 -1
  898. package/dist/bin/sonar.js +0 -5
  899. package/dist/bin/sonar.js.map +0 -1
  900. package/dist/bin/test.js +0 -5
  901. package/dist/bin/test.js.map +0 -1
  902. package/dist/bin/up.js +0 -5
  903. package/dist/bin/up.js.map +0 -1
  904. package/dist/bin/updo.js +0 -5
  905. package/dist/bin/updo.js.map +0 -1
  906. package/dist/bin/upplug.js +0 -5
  907. package/dist/bin/upplug.js.map +0 -1
  908. package/dist/bin/upyarn.js +0 -5
  909. package/dist/bin/upyarn.js.map +0 -1
  910. package/dist/bin/xy-ts.js +0 -10
  911. package/dist/bin/xy-ts.js.map +0 -1
  912. package/dist/bin/xy.js +0 -10
  913. package/dist/bin/xy.js.map +0 -1
  914. package/dist/bin/yarn3only.js +0 -5
  915. package/dist/bin/yarn3only.js.map +0 -1
  916. package/dist/index.js +0 -29
  917. package/dist/index.js.map +0 -1
  918. package/dist/lib/createBuildConfig.js.map +0 -1
  919. package/dist/lib/dependencies/DuplicateDetector.js.map +0 -1
  920. package/dist/lib/dependencies/detectDuplicateDependencies.js +0 -66
  921. package/dist/lib/dependencies/detectDuplicateDependencies.js.map +0 -1
  922. package/dist/lib/dependencies/index.js +0 -25
  923. package/dist/lib/dependencies/index.js.map +0 -1
  924. package/dist/lib/file/fileLines.js.map +0 -1
  925. package/dist/lib/file/index.js +0 -29
  926. package/dist/lib/file/index.js.map +0 -1
  927. package/dist/lib/file/tryReadFileSync.js.map +0 -1
  928. package/dist/lib/generateIgnoreFiles.js +0 -62
  929. package/dist/lib/generateIgnoreFiles.js.map +0 -1
  930. package/dist/lib/index.js +0 -59
  931. package/dist/lib/index.js.map +0 -1
  932. package/dist/lib/jsonFormatters.js.map +0 -1
  933. package/dist/lib/loadConfig.js.map +0 -1
  934. package/dist/lib/processEx.js.map +0 -1
  935. package/dist/lib/runSteps.js +0 -69
  936. package/dist/lib/runSteps.js.map +0 -1
  937. package/dist/lib/runStepsAsync.js +0 -88
  938. package/dist/lib/runStepsAsync.js.map +0 -1
  939. package/dist/lib/runXy.js +0 -32
  940. package/dist/lib/runXy.js.map +0 -1
  941. package/dist/lib/runXyWithWarning.js.map +0 -1
  942. package/dist/lib/safeExit.js +0 -53
  943. package/dist/lib/safeExit.js.map +0 -1
  944. package/dist/lib/string/index.js +0 -25
  945. package/dist/lib/string/index.js.map +0 -1
  946. package/dist/lib/withErrnoException.js.map +0 -1
  947. package/dist/lib/yarn/index.js +0 -27
  948. package/dist/lib/yarn/index.js.map +0 -1
  949. package/dist/lib/yarn/workspace/index.js +0 -27
  950. package/dist/lib/yarn/workspace/index.js.map +0 -1
  951. package/dist/lib/yarn/workspace/yarnWorkspace.js.map +0 -1
  952. package/dist/lib/yarn/workspace/yarnWorkspaces.js.map +0 -1
  953. package/dist/lib/yarn/yarnInitCwd.js.map +0 -1
  954. package/dist/types.d.js +0 -2
  955. package/dist/xy/index.js +0 -35
  956. package/dist/xy/index.js.map +0 -1
  957. package/dist/xy/xy.js +0 -52
  958. package/dist/xy/xy.js.map +0 -1
  959. package/dist/xy/xyBuildCommands.js +0 -137
  960. package/dist/xy/xyBuildCommands.js.map +0 -1
  961. package/dist/xy/xyCommonCommands.js +0 -161
  962. package/dist/xy/xyCommonCommands.js.map +0 -1
  963. package/dist/xy/xyDeployCommands.js +0 -72
  964. package/dist/xy/xyDeployCommands.js.map +0 -1
  965. package/dist/xy/xyInstallCommands.js +0 -99
  966. package/dist/xy/xyInstallCommands.js.map +0 -1
  967. package/dist/xy/xyLintCommands.js +0 -116
  968. package/dist/xy/xyLintCommands.js.map +0 -1
  969. package/dist/xy/xyParseOptions.js.map +0 -1
  970. /package/dist/{types.d.js.map → types.d.cjs.map} +0 -0
package/dist/index.mjs CHANGED
@@ -1,5 +1,2988 @@
1
- export * from "./actions";
2
- export * from "./lib";
3
- export * from "./loadPackageConfig";
4
- export * from "./xy";
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+
4
+ // src/actions/build.ts
5
+ import chalk9 from "chalk";
6
+
7
+ // src/lib/checkResult.ts
8
+ import chalk from "chalk";
9
+ var checkResult = /* @__PURE__ */ __name((name, result, level = "error", exitOnFail = false) => {
10
+ if (result) {
11
+ const exiting = exitOnFail ? "[Exiting Process]" : "[Continuing]";
12
+ const chalkFunc = level === "error" ? chalk.red : chalk.yellow;
13
+ console[level](chalkFunc(`${name} had ${result} failures ${exiting}`));
14
+ if (exitOnFail) {
15
+ process.exit(result);
16
+ }
17
+ }
18
+ }, "checkResult");
19
+
20
+ // src/lib/createBuildConfig.ts
21
+ import { readFileSync } from "node:fs";
22
+
23
+ // src/lib/defaultBuildConfig.ts
24
+ var defaultBuildConfig = {
25
+ compilerOptions: {
26
+ rootDir: "src",
27
+ rootDirs: [
28
+ "package.json"
29
+ ]
30
+ },
31
+ exclude: [
32
+ "**/build",
33
+ "**/dist",
34
+ "**/node_modules",
35
+ "**/*.spec.*",
36
+ "**/*.spec",
37
+ "**/*.stories.*",
38
+ "**/*.example.*",
39
+ "**/spec/*",
40
+ "**/stories/*"
41
+ ],
42
+ include: [
43
+ "src"
44
+ ]
45
+ };
46
+
47
+ // src/lib/createBuildConfig.ts
48
+ var getGeneralTypescriptConfig = /* @__PURE__ */ __name((location) => {
49
+ let generalConfig;
50
+ try {
51
+ generalConfig = readFileSync(`${location}/tsconfig.json`, {
52
+ encoding: "utf8"
53
+ });
54
+ } catch {
55
+ return false;
56
+ }
57
+ return JSON.parse(generalConfig);
58
+ }, "getGeneralTypescriptConfig");
59
+ var createBuildConfig = /* @__PURE__ */ __name((location, module, target, outDirSuffix) => {
60
+ const generalConfigObject = getGeneralTypescriptConfig(location);
61
+ if (generalConfigObject === false) {
62
+ return void 0;
63
+ }
64
+ return {
65
+ ...generalConfigObject,
66
+ compilerOptions: {
67
+ ...defaultBuildConfig.compilerOptions,
68
+ ...generalConfigObject.compilerOptions,
69
+ module,
70
+ outDir: `./${generalConfigObject.compilerOptions?.outDir ?? "dist"}/${outDirSuffix}`,
71
+ target
72
+ },
73
+ exclude: [
74
+ ...generalConfigObject.exclude ?? [],
75
+ ...defaultBuildConfig.exclude
76
+ ],
77
+ include: [
78
+ ...generalConfigObject.include ?? [],
79
+ ...defaultBuildConfig.include
80
+ ]
81
+ };
82
+ }, "createBuildConfig");
83
+
84
+ // src/lib/dependencies/detectDuplicateDependencies.ts
85
+ import { execSync } from "node:child_process";
86
+
87
+ // src/lib/processEx.ts
88
+ import chalk2 from "chalk";
89
+
90
+ // src/lib/withError.ts
91
+ var withError = /* @__PURE__ */ __name((ex, closure, predicate = (ex2) => ex2.name !== void 0 && ex2.message !== void 0) => {
92
+ return predicate(ex) ? closure(ex) : void 0;
93
+ }, "withError");
94
+
95
+ // src/lib/withErrnoException.ts
96
+ var withErrnoException = /* @__PURE__ */ __name((ex, closure) => {
97
+ return withError(ex, closure, (ex2) => ex2.errno !== void 0);
98
+ }, "withErrnoException");
99
+
100
+ // src/lib/processEx.ts
101
+ var processEx = /* @__PURE__ */ __name((ex) => {
102
+ const error = typeof ex === "string" ? new Error(ex) : ex;
103
+ const exitCode = withErrnoException(error, (error2) => {
104
+ if (error2.code === "ENOENT") {
105
+ console.error(chalk2.red(`'${error2.path}' not found.`));
106
+ } else {
107
+ console.error(chalk2.red(`Errno: ${error2.code}`));
108
+ }
109
+ return error2.errno ?? -1;
110
+ }) ?? withError(error, (error2) => {
111
+ console.error(chalk2.red(`${error2.name}: ${error2.message}`));
112
+ return -1;
113
+ }) ?? (() => {
114
+ console.error(chalk2.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`));
115
+ return -1;
116
+ })();
117
+ process.exit(process.exitCode ?? exitCode);
118
+ }, "processEx");
119
+
120
+ // src/lib/safeExit.ts
121
+ var safeExit = /* @__PURE__ */ __name((func, exitOnFail = true) => {
122
+ try {
123
+ const result = func();
124
+ if (result && exitOnFail) {
125
+ process.exit(result);
126
+ }
127
+ return result;
128
+ } catch (ex) {
129
+ return processEx(ex);
130
+ }
131
+ }, "safeExit");
132
+ var safeExitAsync = /* @__PURE__ */ __name(async (func, exitOnFail = true) => {
133
+ try {
134
+ const result = await func();
135
+ if (result && exitOnFail) {
136
+ process.exit(result);
137
+ }
138
+ return result;
139
+ } catch (ex) {
140
+ return processEx(ex);
141
+ }
142
+ }, "safeExitAsync");
143
+
144
+ // src/lib/dependencies/DuplicateDetector.ts
145
+ import { EOL } from "node:os";
146
+ import chalk3 from "chalk";
147
+ import { uniq } from "lodash-es";
148
+
149
+ // src/lib/jsonFormatters.ts
150
+ var multiLineToJSONArray = /* @__PURE__ */ __name((output) => {
151
+ const withCommas = output.replaceAll("\r\n", "").replaceAll("\n", ",");
152
+ const cleanCollection = withCommas.slice(0, Math.max(0, withCommas.length - 1));
153
+ const collection = `[${cleanCollection}]`;
154
+ return JSON.parse(collection);
155
+ }, "multiLineToJSONArray");
156
+
157
+ // src/lib/dependencies/DuplicateDetector.ts
158
+ var trimVirtualMeta = /* @__PURE__ */ __name((value) => {
159
+ const virtualParts = value.split("virtual:");
160
+ if (virtualParts.length > 1) {
161
+ const hashParts = virtualParts[1].split("#");
162
+ return virtualParts[0] + hashParts[1];
163
+ } else {
164
+ return value;
165
+ }
166
+ }, "trimVirtualMeta");
167
+ var trimObjectDependencyVirtualMeta = /* @__PURE__ */ __name((obj) => {
168
+ const resultObj = {};
169
+ for (const [key, value] of Object.entries(obj)) {
170
+ resultObj[trimVirtualMeta(key)] = {
171
+ descriptor: trimVirtualMeta(value.descriptor),
172
+ locator: trimVirtualMeta(value.locator)
173
+ };
174
+ }
175
+ return resultObj;
176
+ }, "trimObjectDependencyVirtualMeta");
177
+ var trimDependencyVirtualMeta = /* @__PURE__ */ __name((dependencies) => {
178
+ return dependencies.map((dependency) => {
179
+ return {
180
+ children: trimObjectDependencyVirtualMeta(dependency.children),
181
+ value: trimVirtualMeta(dependency.value)
182
+ };
183
+ });
184
+ }, "trimDependencyVirtualMeta");
185
+ var DuplicateDetector = class {
186
+ static {
187
+ __name(this, "DuplicateDetector");
188
+ }
189
+ dependency;
190
+ dependencyEntries;
191
+ constructor(output, dependency) {
192
+ this.dependency = dependency;
193
+ this.dependencyEntries = trimDependencyVirtualMeta(multiLineToJSONArray(output));
194
+ }
195
+ detect() {
196
+ const result = this.dependencyEntries.reduce(this.detectReducer, this.resultsFactory(this.dependency));
197
+ if (result.duplicateVersions.length > 0) {
198
+ console.log(chalk3.yellow(`${EOL}Duplicates found for: ${this.dependency}`));
199
+ const duplicateVersions = result.duplicateVersions.toString().replaceAll(",", `${EOL} `);
200
+ console.log(chalk3.grey(` ${duplicateVersions}`, EOL));
201
+ return 1;
202
+ } else {
203
+ console.log(`${this.dependency} - OK`);
204
+ return 0;
205
+ }
206
+ }
207
+ detectReducer(acc, entry) {
208
+ const version = Object.entries(entry.children).map(([k]) => k)[0];
209
+ if (!acc.currentVersion) {
210
+ acc.currentVersion = version;
211
+ return acc;
212
+ }
213
+ if (acc.currentVersion && acc.currentVersion !== version && !version.includes("@virtual:")) {
214
+ if (acc.duplicateVersions.length === 0) {
215
+ acc.duplicateVersions.push(acc.currentVersion);
216
+ }
217
+ acc.duplicateVersions.push(version);
218
+ acc.duplicateVersions = uniq(acc.duplicateVersions);
219
+ }
220
+ return acc;
221
+ }
222
+ resultsFactory = /* @__PURE__ */ __name((dependency) => ({
223
+ currentVersion: void 0,
224
+ dependency,
225
+ duplicateVersions: []
226
+ }), "resultsFactory");
227
+ };
228
+
229
+ // src/lib/dependencies/detectDuplicateDependencies.ts
230
+ var detectDuplicateDependencies = /* @__PURE__ */ __name((depsFromPackageJSON, DefaultDependencies2) => {
231
+ let exitCode = 0;
232
+ const dependencies = depsFromPackageJSON?.length ? depsFromPackageJSON : DefaultDependencies2;
233
+ return safeExit(() => {
234
+ if (dependencies) {
235
+ for (const dependency of dependencies) {
236
+ let output;
237
+ try {
238
+ const cmd = `yarn why ${dependency} --json`;
239
+ output = execSync(cmd).toString();
240
+ } catch (e) {
241
+ console.error(`Error running yarn why: ${e}`);
242
+ exitCode = 1;
243
+ exitCode;
244
+ continue;
245
+ }
246
+ if (output) {
247
+ exitCode = new DuplicateDetector(output, dependency).detect();
248
+ exitCode;
249
+ } else {
250
+ console.log(`${dependency} - N/A`);
251
+ if (depsFromPackageJSON) {
252
+ exitCode = 1;
253
+ console.log(`\u{1F6A8} Library ${dependency} was requested in package.json but not found`);
254
+ }
255
+ exitCode;
256
+ }
257
+ }
258
+ return exitCode;
259
+ } else {
260
+ console.log("\u{1F6A8} No dependencies where passed");
261
+ return exitCode;
262
+ }
263
+ });
264
+ }, "detectDuplicateDependencies");
265
+
266
+ // src/lib/file/constants.ts
267
+ var WINDOWS_NEWLINE_REGEX = /\r\n/g;
268
+ var CROSS_PLATFORM_NEWLINE = "\n";
269
+
270
+ // src/lib/file/fileLines.ts
271
+ import { existsSync, readFileSync as readFileSync2, writeFileSync } from "node:fs";
272
+
273
+ // src/lib/string/empty.ts
274
+ var empty = /* @__PURE__ */ __name((value) => value?.trim().length === 0, "empty");
275
+ var notEmpty = /* @__PURE__ */ __name((value) => !empty(value), "notEmpty");
276
+
277
+ // src/lib/string/union.ts
278
+ var union = /* @__PURE__ */ __name((a, b) => /* @__PURE__ */ new Set([
279
+ ...new Set(a),
280
+ ...new Set(b)
281
+ ]), "union");
282
+
283
+ // src/lib/file/ReadFileSyncOptions.ts
284
+ var defaultReadFileSyncOptions = {
285
+ encoding: "utf8"
286
+ };
287
+
288
+ // src/lib/file/fileLines.ts
289
+ var readLines = /* @__PURE__ */ __name((uri, options = defaultReadFileSyncOptions) => existsSync(uri) ? readFileSync2(uri, options).replace(WINDOWS_NEWLINE_REGEX, CROSS_PLATFORM_NEWLINE).split(CROSS_PLATFORM_NEWLINE) : [], "readLines");
290
+ var readNonEmptyLines = /* @__PURE__ */ __name((uri, options = defaultReadFileSyncOptions) => readLines(uri, options).filter(notEmpty), "readNonEmptyLines");
291
+ var writeLines = /* @__PURE__ */ __name((uri, lines, options = defaultReadFileSyncOptions) => {
292
+ const existing = existsSync(uri) ? readFileSync2(uri, options) : void 0;
293
+ const desired = lines.join(CROSS_PLATFORM_NEWLINE);
294
+ if (existing !== desired) writeFileSync(uri, desired, options);
295
+ }, "writeLines");
296
+
297
+ // src/lib/file/tryReadFileSync.ts
298
+ import { existsSync as existsSync2, readFileSync as readFileSync3 } from "node:fs";
299
+ var tryReadFileSync = /* @__PURE__ */ __name((uri, options = defaultReadFileSyncOptions) => {
300
+ return existsSync2(uri) ? readFileSync3(uri, options) : void 0;
301
+ }, "tryReadFileSync");
302
+
303
+ // src/lib/generateIgnoreFiles.ts
304
+ import chalk4 from "chalk";
305
+
306
+ // src/lib/yarn/isYarnVersionOrGreater.ts
307
+ import { spawnSync } from "node:child_process";
308
+ var isYarnVersionOrGreater = /* @__PURE__ */ __name((major, minor, patch) => {
309
+ const result = spawnSync("yarn", [
310
+ "-v"
311
+ ], {
312
+ encoding: "utf8",
313
+ shell: true
314
+ });
315
+ const version = result.stdout.toString().replaceAll("\n", "");
316
+ const versionNumbers = version.split(".").map((ver) => Number.parseInt(ver));
317
+ const majorDelta = versionNumbers[0] - major;
318
+ const minorDelta = versionNumbers[1] - (minor ?? versionNumbers[1]);
319
+ const patchDelta = versionNumbers[2] - (patch ?? versionNumbers[2]);
320
+ const majorOk = majorDelta >= 0;
321
+ const minorOk = majorDelta > 0 || minorDelta >= 0;
322
+ const patchOk = majorDelta > 0 || minorDelta > 0 || patchDelta >= 0;
323
+ return [
324
+ majorOk && minorOk && patchOk,
325
+ version
326
+ ];
327
+ }, "isYarnVersionOrGreater");
328
+
329
+ // src/lib/yarn/workspace/yarnWorkspaces.ts
330
+ import { spawnSync as spawnSync2 } from "node:child_process";
331
+ var yarnWorkspaces = /* @__PURE__ */ __name(() => {
332
+ const result = spawnSync2("yarn", [
333
+ "workspaces",
334
+ "list",
335
+ "--json",
336
+ "--recursive"
337
+ ], {
338
+ encoding: "utf8",
339
+ shell: true
340
+ });
341
+ if (result.error) {
342
+ throw result.error;
343
+ }
344
+ return result.stdout.toString().split("\n").slice(0, -1).map((item) => {
345
+ return JSON.parse(item);
346
+ });
347
+ }, "yarnWorkspaces");
348
+
349
+ // src/lib/yarn/workspace/yarnWorkspace.ts
350
+ var yarnWorkspace = /* @__PURE__ */ __name((pkg) => {
351
+ const workspace = yarnWorkspaces().find(({ name }) => name === pkg);
352
+ if (!workspace) throw new Error(`Workspace ${pkg} not found`);
353
+ return workspace;
354
+ }, "yarnWorkspace");
355
+
356
+ // src/lib/yarn/yarnInitCwd.ts
357
+ var INIT_CWD = /* @__PURE__ */ __name(() => {
358
+ if (!process.env.INIT_CWD) console.error("Missing INIT_CWD");
359
+ return process.env.INIT_CWD;
360
+ }, "INIT_CWD");
361
+
362
+ // src/lib/generateIgnoreFiles.ts
363
+ var mergeEntries = /* @__PURE__ */ __name((a, b) => [
364
+ ...union(a, b)
365
+ ].sort(), "mergeEntries");
366
+ var generateIgnoreFiles = /* @__PURE__ */ __name((filename3, pkg) => {
367
+ console.log(chalk4.green(`Generate ${filename3} Files`));
368
+ const cwd4 = INIT_CWD() ?? ".";
369
+ const workspaces = pkg ? [
370
+ yarnWorkspace(pkg)
371
+ ] : yarnWorkspaces();
372
+ const readEntries = /* @__PURE__ */ __name((location) => readNonEmptyLines(`${location}/${filename3}`), "readEntries");
373
+ const writeEntries = /* @__PURE__ */ __name((location, entries) => writeLines(`${location}/${filename3}`, entries), "writeEntries");
374
+ const results = workspaces.map(({ location, name }) => {
375
+ try {
376
+ writeEntries(location, mergeEntries(readEntries(cwd4), readEntries(location)));
377
+ return 0;
378
+ } catch (ex) {
379
+ const error = ex;
380
+ console.error(`Generate ${filename3} Files [${name}] [${error.message}]`);
381
+ return 1;
382
+ }
383
+ });
384
+ const succeeded = results.every((result) => result === 0);
385
+ return succeeded ? 0 : 1;
386
+ }, "generateIgnoreFiles");
387
+
388
+ // src/lib/loadConfig.ts
389
+ import chalk5 from "chalk";
390
+ import { cosmiconfig } from "cosmiconfig";
391
+ import { merge } from "lodash-es";
392
+ var config;
393
+ var loadConfig = /* @__PURE__ */ __name(async (params) => {
394
+ if (config) {
395
+ return merge({}, config, params);
396
+ }
397
+ const cosmicConfigResult = await cosmiconfig("xy", {
398
+ cache: true
399
+ }).search();
400
+ config = cosmicConfigResult?.config;
401
+ const configFilePath = cosmicConfigResult?.filepath;
402
+ if (configFilePath) {
403
+ console.log(chalk5.gray(`Loading config from ${configFilePath}`));
404
+ }
405
+ return merge({}, config, params);
406
+ }, "loadConfig");
407
+
408
+ // src/lib/parsedPackageJSON.ts
409
+ import { readFileSync as readFileSync4 } from "node:fs";
410
+ var parsedPackageJSON = /* @__PURE__ */ __name((path7) => {
411
+ const pathToPackageJSON = path7 ?? process.env.npm_package_json ?? "";
412
+ const packageJSON = readFileSync4(pathToPackageJSON).toString();
413
+ return JSON.parse(packageJSON);
414
+ }, "parsedPackageJSON");
415
+
416
+ // src/lib/runSteps.ts
417
+ import { spawnSync as spawnSync3 } from "node:child_process";
418
+ import { existsSync as existsSync3 } from "node:fs";
419
+ import chalk6 from "chalk";
420
+ var runSteps = /* @__PURE__ */ __name((name, steps, exitOnFail = true, messages) => {
421
+ return safeExit(() => {
422
+ const pkgName = process.env.npm_package_name;
423
+ console.log(chalk6.green(`${name} [${pkgName}]`));
424
+ let totalStatus = 0;
425
+ for (const [i, [command, args, config2]] of steps.entries()) {
426
+ if (messages?.[i]) {
427
+ console.log(chalk6.gray(messages?.[i]));
428
+ }
429
+ const argList = Array.isArray(args) ? args : args.split(" ");
430
+ if (command === "node" && !existsSync3(argList[0])) {
431
+ throw new Error(`File not found [${argList[0]}]`);
432
+ }
433
+ const status = spawnSync3(command, Array.isArray(args) ? args : args.split(" "), {
434
+ ...config2,
435
+ encoding: "utf8",
436
+ env: {
437
+ FORCE_COLOR: "3",
438
+ ...process.env
439
+ },
440
+ shell: true,
441
+ stdio: "inherit"
442
+ }).status ?? 0;
443
+ checkResult(name, status, "error", exitOnFail);
444
+ totalStatus += status ?? 0;
445
+ }
446
+ return totalStatus;
447
+ }, !!exitOnFail);
448
+ }, "runSteps");
449
+
450
+ // src/lib/runStepsAsync.ts
451
+ import { spawn } from "node:child_process";
452
+ import { existsSync as existsSync4 } from "node:fs";
453
+ import chalk7 from "chalk";
454
+ var runStepAsync = /* @__PURE__ */ __name((name, step, exitOnFail = true, message) => {
455
+ return new Promise((resolve) => {
456
+ const [command, args, config2] = step;
457
+ if (message) {
458
+ console.log(chalk7.gray(message));
459
+ }
460
+ const argList = Array.isArray(args) ? args : args.split(" ");
461
+ if (command === "node" && !existsSync4(argList[0])) {
462
+ throw new Error(`File not found [${argList[0]}]`);
463
+ }
464
+ spawn(command, Array.isArray(args) ? args : args.split(" "), {
465
+ ...config2,
466
+ env: {
467
+ FORCE_COLOR: "3",
468
+ ...process.env
469
+ },
470
+ shell: true,
471
+ stdio: "inherit"
472
+ }).on("close", (code) => {
473
+ if (code) {
474
+ console.error(chalk7.red(`Command Exited With Non-Zero Result [${chalk7.gray(code)}] | ${chalk7.yellow(command)} ${chalk7.white(Array.isArray(args) ? args.join(" ") : args)}`));
475
+ checkResult(name, code, "error", exitOnFail);
476
+ resolve(code);
477
+ } else {
478
+ resolve(0);
479
+ }
480
+ });
481
+ });
482
+ }, "runStepAsync");
483
+ var runStepsAsync = /* @__PURE__ */ __name(async (name, steps, exitOnFail = true, messages) => {
484
+ return await safeExitAsync(async () => {
485
+ const pkgName = process.env.npm_package_name;
486
+ console.log(chalk7.green(`${name} [${pkgName}]`));
487
+ let result = 0;
488
+ for (const [i, step] of steps.entries()) {
489
+ result += await runStepAsync(name, step, exitOnFail, messages?.[i]);
490
+ }
491
+ return result;
492
+ });
493
+ }, "runStepsAsync");
494
+
495
+ // src/lib/runXy.ts
496
+ var runXy = /* @__PURE__ */ __name((command) => {
497
+ return runSteps(`XY [${command}]`, [
498
+ [
499
+ "yarn",
500
+ [
501
+ "xy",
502
+ command,
503
+ ...process.argv.filter((value, index) => index > 1 ? value : void 0)
504
+ ]
505
+ ]
506
+ ]);
507
+ }, "runXy");
508
+
509
+ // src/lib/runXyWithWarning.ts
510
+ import chalk8 from "chalk";
511
+ var runXyWithWarning = /* @__PURE__ */ __name((command) => {
512
+ const commandString = `yarn ${command}`;
513
+ const commandXyString = `yarn xy ${command}`;
514
+ console.warn(chalk8.yellow(`WARNING: [${chalk8.white(commandString)}] is deprecated for XY Labs Scripts.`));
515
+ console.warn(chalk8.gray(`Did you mean [${chalk8.magenta(commandXyString)}]?`));
516
+ return 1;
517
+ }, "runXyWithWarning");
518
+
519
+ // src/actions/build.ts
520
+ var build = /* @__PURE__ */ __name(async ({ incremental, jobs, target, verbose, pkg }) => {
521
+ const start = Date.now();
522
+ const pkgOptions = pkg ? [
523
+ pkg
524
+ ] : [];
525
+ const incrementalOptions = incremental ? [
526
+ "-i"
527
+ ] : [];
528
+ const verboseOptions = verbose ? [
529
+ "-v"
530
+ ] : [];
531
+ const targetOptions = target ? [
532
+ "-t",
533
+ target
534
+ ] : [];
535
+ const jobsOptions = jobs ? [
536
+ "-j",
537
+ `${jobs}`
538
+ ] : [];
539
+ if (jobs) {
540
+ console.log(chalk9.blue(`Jobs set to [${jobs}]`));
541
+ }
542
+ const result = await runStepsAsync(`Build${incremental ? "-Incremental" : ""} [${pkg ?? "All"}]`, [
543
+ [
544
+ "yarn",
545
+ [
546
+ "xy",
547
+ "compile",
548
+ ...pkgOptions,
549
+ ...targetOptions,
550
+ ...verboseOptions,
551
+ ...jobsOptions,
552
+ ...incrementalOptions
553
+ ]
554
+ ],
555
+ [
556
+ "yarn",
557
+ [
558
+ "xy",
559
+ "lint",
560
+ ...pkgOptions,
561
+ ...verboseOptions,
562
+ ...incrementalOptions
563
+ ]
564
+ ],
565
+ [
566
+ "yarn",
567
+ [
568
+ "xy",
569
+ "deps",
570
+ ...pkgOptions,
571
+ ...verboseOptions,
572
+ ...jobsOptions,
573
+ ...incrementalOptions
574
+ ]
575
+ ]
576
+ ]);
577
+ console.log(`${chalk9.gray("Built in")} [${chalk9.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk9.gray("seconds")}`);
578
+ return result;
579
+ }, "build");
580
+
581
+ // src/actions/clean.ts
582
+ var clean = /* @__PURE__ */ __name(async ({ verbose, pkg }) => {
583
+ return pkg ? await cleanPackage({
584
+ pkg,
585
+ verbose
586
+ }) : cleanAll({
587
+ verbose
588
+ });
589
+ }, "clean");
590
+ var cleanPackage = /* @__PURE__ */ __name(({ pkg }) => {
591
+ return runStepsAsync(`Clean [${pkg}]`, [
592
+ [
593
+ "yarn",
594
+ [
595
+ "workspace",
596
+ pkg,
597
+ "run",
598
+ "package-clean"
599
+ ]
600
+ ]
601
+ ]);
602
+ }, "cleanPackage");
603
+ var cleanAll = /* @__PURE__ */ __name(({ verbose }) => {
604
+ const verboseOptions = verbose ? [
605
+ "--verbose"
606
+ ] : [
607
+ "--no-verbose"
608
+ ];
609
+ return runStepsAsync("Clean", [
610
+ [
611
+ "yarn",
612
+ [
613
+ "workspaces foreach",
614
+ "-pA",
615
+ "--jobs 64",
616
+ ...verboseOptions,
617
+ "run",
618
+ "package-clean"
619
+ ]
620
+ ]
621
+ ]);
622
+ }, "cleanAll");
623
+
624
+ // src/actions/clean-docs.ts
625
+ import path from "node:path";
626
+ import chalk10 from "chalk";
627
+ import { rimrafSync } from "rimraf";
628
+ var cleanDocs = /* @__PURE__ */ __name(() => {
629
+ const pkgName = process.env.npm_package_name;
630
+ console.log(chalk10.green(`Cleaning Docs [${pkgName}]`));
631
+ for (const { location } of yarnWorkspaces()) rimrafSync(path.join(location, "docs"), {
632
+ glob: true
633
+ });
634
+ return 0;
635
+ }, "cleanDocs");
636
+
637
+ // src/actions/compile.ts
638
+ import chalk11 from "chalk";
639
+ var compile = /* @__PURE__ */ __name(({ verbose, target, pkg, incremental, publint: publint2 }) => {
640
+ return pkg ? compilePackage({
641
+ pkg,
642
+ publint: publint2,
643
+ target,
644
+ verbose
645
+ }) : compileAll({
646
+ incremental,
647
+ publint: publint2,
648
+ target,
649
+ verbose
650
+ });
651
+ }, "compile");
652
+ var compilePackage = /* @__PURE__ */ __name(({ target, pkg }) => {
653
+ const targetOptions = target ? [
654
+ "-t",
655
+ target
656
+ ] : [];
657
+ return runSteps(`Compile [${pkg}]`, [
658
+ [
659
+ "yarn",
660
+ [
661
+ "workspace",
662
+ pkg,
663
+ "run",
664
+ "package-compile",
665
+ ...targetOptions
666
+ ]
667
+ ]
668
+ ]);
669
+ }, "compilePackage");
670
+ var compileAll = /* @__PURE__ */ __name(({ jobs, verbose, target, incremental }) => {
671
+ const start = Date.now();
672
+ const verboseOptions = verbose ? [
673
+ "--verbose"
674
+ ] : [
675
+ "--no-verbose"
676
+ ];
677
+ const targetOptions = target ? [
678
+ "-t",
679
+ target
680
+ ] : [];
681
+ const incrementalOptions = incremental ? [
682
+ "--since",
683
+ "-Apt",
684
+ "--topological-dev"
685
+ ] : [
686
+ "--parallel",
687
+ "-Apt",
688
+ "--topological-dev"
689
+ ];
690
+ const jobsOptions = jobs ? [
691
+ "-j",
692
+ `${jobs}`
693
+ ] : [];
694
+ if (jobs) {
695
+ console.log(chalk11.blue(`Jobs set to [${jobs}]`));
696
+ }
697
+ const result = runSteps(`Compile${incremental ? "-Incremental" : ""} [All]`, [
698
+ [
699
+ "yarn",
700
+ [
701
+ "workspaces",
702
+ "foreach",
703
+ ...incrementalOptions,
704
+ ...jobsOptions,
705
+ ...verboseOptions,
706
+ "run",
707
+ "package-compile",
708
+ ...targetOptions
709
+ ]
710
+ ]
711
+ ]);
712
+ console.log(`${chalk11.gray("Compiled in")} [${chalk11.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk11.gray("seconds")}`);
713
+ return result;
714
+ }, "compileAll");
715
+
716
+ // src/actions/copy-assets.ts
717
+ import path2 from "node:path/posix";
718
+ import chalk12 from "chalk";
719
+ import cpy from "cpy";
720
+ var copyPackageTargetAssets = /* @__PURE__ */ __name(async (target, name, location) => {
721
+ try {
722
+ const values = await cpy([
723
+ "**/*.jpg",
724
+ "**/*.png",
725
+ "**/*.gif",
726
+ "**/*.svg",
727
+ "**/*.webp",
728
+ "**/*.sass",
729
+ "**/*.scss",
730
+ "**/*.gif",
731
+ "**/*.css"
732
+ ], `../dist/${target}`, {
733
+ cwd: path2.join(process.cwd(), location, "src"),
734
+ parents: true
735
+ });
736
+ for (const value of values) {
737
+ console.log(`${value.split("/").pop()} => ./dist/${target}`);
738
+ }
739
+ return 0;
740
+ } catch (reason) {
741
+ console.log(`Copy Failed: ${name}: ${reason}`);
742
+ return 1;
743
+ }
744
+ }, "copyPackageTargetAssets");
745
+ var copyTargetAssets = /* @__PURE__ */ __name(async (target, pkg) => {
746
+ const workspaces = yarnWorkspaces();
747
+ console.log(chalk12.green(`Copying Assets [${target.toUpperCase()}]`));
748
+ const workspaceList = workspaces.filter(({ name }) => {
749
+ return pkg === void 0 || name === pkg;
750
+ });
751
+ if (workspaceList.length === 0) {
752
+ console.error(`Package not found [${pkg}]`);
753
+ } else {
754
+ const results = await Promise.all(workspaceList.map(async (workspace) => {
755
+ const { location, name } = workspace;
756
+ return await copyPackageTargetAssets(target, name, location);
757
+ }));
758
+ return results.reduce((prev, result) => prev || result, 0);
759
+ }
760
+ return 0;
761
+ }, "copyTargetAssets");
762
+ var copyAssets = /* @__PURE__ */ __name(async ({ target, pkg }) => {
763
+ switch (target) {
764
+ case "esm": {
765
+ return await copyTargetAssets("esm", pkg);
766
+ }
767
+ case "cjs": {
768
+ return await copyTargetAssets("cjs", pkg);
769
+ }
770
+ default: {
771
+ return await copyTargetAssets("esm", pkg) || await copyTargetAssets("cjs", pkg);
772
+ }
773
+ }
774
+ }, "copyAssets");
775
+
776
+ // src/actions/cycle.ts
777
+ var cycle = /* @__PURE__ */ __name(() => {
778
+ const rules = [
779
+ `"'import/no-cycle': [1, { maxDepth: 6 }]"`,
780
+ `"'import/no-internal-modules': ['off']"`
781
+ ];
782
+ return runSteps("Cycle", [
783
+ [
784
+ "yarn",
785
+ [
786
+ "eslint",
787
+ ...rules.flatMap((rule) => [
788
+ "--rule",
789
+ rule
790
+ ]),
791
+ "--cache",
792
+ "."
793
+ ]
794
+ ]
795
+ ]);
796
+ }, "cycle");
797
+
798
+ // src/actions/dead.ts
799
+ var dead = /* @__PURE__ */ __name(() => {
800
+ return runSteps("Dead", [
801
+ [
802
+ "yarn",
803
+ [
804
+ "ts-prune",
805
+ "-p",
806
+ "tsconfig.json"
807
+ ]
808
+ ]
809
+ ]);
810
+ }, "dead");
811
+
812
+ // src/actions/deploy.ts
813
+ var deploy = /* @__PURE__ */ __name(() => {
814
+ return runSteps("Deploy [Patch]", [
815
+ [
816
+ "yarn",
817
+ "workspaces foreach --all version patch --deferred"
818
+ ],
819
+ [
820
+ "yarn",
821
+ "xy clean"
822
+ ],
823
+ [
824
+ "yarn",
825
+ "xy build"
826
+ ],
827
+ [
828
+ "yarn",
829
+ "version apply --all"
830
+ ],
831
+ [
832
+ "yarn",
833
+ "workspaces foreach --all --parallel npm publish"
834
+ ]
835
+ ]);
836
+ }, "deploy");
837
+
838
+ // src/actions/deploy-major.ts
839
+ var deployMajor = /* @__PURE__ */ __name(() => {
840
+ return runSteps("Deploy [Major]", [
841
+ [
842
+ "yarn",
843
+ "workspaces foreach --all version major --deferred"
844
+ ],
845
+ [
846
+ "yarn",
847
+ "xy clean"
848
+ ],
849
+ [
850
+ "yarn",
851
+ "xy build"
852
+ ],
853
+ [
854
+ "yarn",
855
+ "version apply --all"
856
+ ],
857
+ [
858
+ "yarn",
859
+ "workspaces foreach --all --parallel npm publish"
860
+ ]
861
+ ]);
862
+ }, "deployMajor");
863
+
864
+ // src/actions/deploy-minor.ts
865
+ var deployMinor = /* @__PURE__ */ __name(() => {
866
+ return runSteps("Deploy [Minor]", [
867
+ [
868
+ "yarn",
869
+ "workspaces foreach --all version minor --deferred"
870
+ ],
871
+ [
872
+ "yarn",
873
+ "xy clean"
874
+ ],
875
+ [
876
+ "yarn",
877
+ "xy build"
878
+ ],
879
+ [
880
+ "yarn",
881
+ "version apply --all"
882
+ ],
883
+ [
884
+ "yarn",
885
+ "workspaces foreach --all --parallel npm publish"
886
+ ]
887
+ ]);
888
+ }, "deployMinor");
889
+
890
+ // src/actions/deploy-next.ts
891
+ var deployNext = /* @__PURE__ */ __name(() => {
892
+ return runSteps("Deploy [Next]", [
893
+ [
894
+ "yarn",
895
+ "workspaces foreach --all version minor --deferred"
896
+ ],
897
+ [
898
+ "yarn",
899
+ "xy clean"
900
+ ],
901
+ [
902
+ "yarn",
903
+ "xy build"
904
+ ],
905
+ [
906
+ "yarn",
907
+ "version apply --all --prerelease"
908
+ ],
909
+ [
910
+ "yarn",
911
+ "workspaces foreach --all --parallel npm publish --tag next"
912
+ ]
913
+ ]);
914
+ }, "deployNext");
915
+
916
+ // src/actions/deps.ts
917
+ import chalk13 from "chalk";
918
+ var deps = /* @__PURE__ */ __name(({ pkg, incremental }) => {
919
+ pkg ? depsPackage({
920
+ pkg
921
+ }) : depsAll({
922
+ incremental
923
+ });
924
+ return 0;
925
+ }, "deps");
926
+ var depsPackage = /* @__PURE__ */ __name(({ pkg }) => {
927
+ const steps = [
928
+ [
929
+ "yarn",
930
+ [
931
+ "workspace",
932
+ pkg,
933
+ "run",
934
+ "package-deps"
935
+ ]
936
+ ]
937
+ ];
938
+ return runSteps(`Deps [${pkg}]`, [
939
+ ...steps
940
+ ]);
941
+ }, "depsPackage");
942
+ var depsAll = /* @__PURE__ */ __name(({ incremental, jobs, verbose }) => {
943
+ const start = Date.now();
944
+ const jobsOptions = jobs ? [
945
+ "-j",
946
+ `${jobs}`
947
+ ] : [];
948
+ const verboseOptions = verbose ? [
949
+ "--verbose"
950
+ ] : [
951
+ "--no-verbose"
952
+ ];
953
+ if (jobs) {
954
+ console.log(chalk13.blue(`Jobs set to [${jobs}]`));
955
+ }
956
+ const incrementalOptions = incremental ? [
957
+ "--since",
958
+ "-pA"
959
+ ] : [
960
+ "-pA"
961
+ ];
962
+ const steps = [
963
+ [
964
+ "yarn",
965
+ [
966
+ "workspaces",
967
+ "foreach",
968
+ ...jobsOptions,
969
+ ...incrementalOptions,
970
+ ...verboseOptions,
971
+ "run",
972
+ "package-deps"
973
+ ]
974
+ ]
975
+ ];
976
+ const result = runSteps(`Deps${incremental ? "-Incremental" : ""} [All]`, [
977
+ ...steps
978
+ ]);
979
+ console.log(`${chalk13.gray("Dep checked in")} [${chalk13.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk13.gray("seconds")}`);
980
+ return result;
981
+ }, "depsAll");
982
+
983
+ // src/actions/dupdeps.ts
984
+ import chalk14 from "chalk";
985
+ var dupdeps = /* @__PURE__ */ __name(() => {
986
+ console.log(chalk14.green("Checking all Dependencies for Duplicates"));
987
+ const allDependencies = parsedPackageJSON()?.dependencies;
988
+ const dependencies = Object.entries(allDependencies).map(([k]) => k);
989
+ return detectDuplicateDependencies(dependencies);
990
+ }, "dupdeps");
991
+
992
+ // src/actions/fix.ts
993
+ var fix = /* @__PURE__ */ __name(() => {
994
+ return runSteps("Fix", [
995
+ [
996
+ "yarn",
997
+ [
998
+ "eslint",
999
+ ".",
1000
+ "--fix",
1001
+ "--cache"
1002
+ ]
1003
+ ]
1004
+ ]);
1005
+ }, "fix");
1006
+
1007
+ // src/actions/gen-docs.ts
1008
+ var genDocs = /* @__PURE__ */ __name(({ pkg, incremental }) => {
1009
+ return pkg ? genDocsPackage({
1010
+ pkg
1011
+ }) : genDocsAll({
1012
+ incremental
1013
+ });
1014
+ }, "genDocs");
1015
+ var genDocsPackage = /* @__PURE__ */ __name(({ pkg }) => {
1016
+ const steps = [
1017
+ [
1018
+ "yarn",
1019
+ [
1020
+ "workspace",
1021
+ pkg,
1022
+ "run",
1023
+ "package-gen-docs"
1024
+ ]
1025
+ ]
1026
+ ];
1027
+ return runSteps(`GenDocs [${pkg}]`, [
1028
+ ...steps
1029
+ ]);
1030
+ }, "genDocsPackage");
1031
+ var genDocsAll = /* @__PURE__ */ __name(({ incremental }) => {
1032
+ const incrementalOptions = incremental ? [
1033
+ "--since",
1034
+ "-pA"
1035
+ ] : [
1036
+ "-pA"
1037
+ ];
1038
+ const steps = [
1039
+ [
1040
+ "yarn",
1041
+ [
1042
+ "workspaces",
1043
+ "foreach",
1044
+ ...incrementalOptions,
1045
+ "run",
1046
+ "package-gen-docs"
1047
+ ]
1048
+ ]
1049
+ ];
1050
+ return runSteps(`GenDocs [All${incremental ? "-Incremental" : ""}]`, [
1051
+ ...steps
1052
+ ]);
1053
+ }, "genDocsAll");
1054
+
1055
+ // src/actions/gitignore-gen.ts
1056
+ var filename = ".gitignore";
1057
+ var gitignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename, pkg), "gitignoreGen");
1058
+
1059
+ // src/actions/gitlint.ts
1060
+ import chalk15 from "chalk";
1061
+ import ParseGitConfig from "parse-git-config";
1062
+ var gitlint = /* @__PURE__ */ __name(() => {
1063
+ console.log(`
1064
+ Gitlint Start [${process.cwd()}]
1065
+ `);
1066
+ let valid = 0;
1067
+ let warnings = 0;
1068
+ const errors = 0;
1069
+ const gitConfig = ParseGitConfig.sync();
1070
+ const warn = /* @__PURE__ */ __name((message) => {
1071
+ console.warn(chalk15.yellow(`Warning: ${message}`));
1072
+ warnings++;
1073
+ }, "warn");
1074
+ if (gitConfig.core.ignorecase) {
1075
+ warn("Please set core.ignorecase to FALSE in .git/config file [run yarn gitlint-fix]");
1076
+ } else {
1077
+ valid++;
1078
+ }
1079
+ if (gitConfig.core.autocrlf === false) {
1080
+ valid++;
1081
+ } else {
1082
+ warn("Please set core.autocrlf to FALSE in .git/config file [run yarn gitlint-fix]");
1083
+ }
1084
+ if (gitConfig.core.eol === "lf") {
1085
+ valid++;
1086
+ } else {
1087
+ warn('Please set core.eol to "lf" in .git/config file [run yarn gitlint-fix]');
1088
+ }
1089
+ const resultMessages = [];
1090
+ if (valid > 0) {
1091
+ resultMessages.push(chalk15.green(`Passed: ${valid}`));
1092
+ }
1093
+ if (warnings > 0) {
1094
+ resultMessages.push(chalk15.yellow(`Warnings: ${warnings}`));
1095
+ }
1096
+ if (errors > 0) {
1097
+ resultMessages.push(chalk15.red(` Errors: ${errors}`));
1098
+ }
1099
+ console.warn(`Gitlint Finish [ ${resultMessages.join(" | ")} ]
1100
+ `);
1101
+ return warnings + errors === 0 ? 1 : 0;
1102
+ }, "gitlint");
1103
+
1104
+ // src/actions/gitlint-fix.ts
1105
+ import { execSync as execSync2 } from "node:child_process";
1106
+ import chalk16 from "chalk";
1107
+ import ParseGitConfig2 from "parse-git-config";
1108
+ var gitlintFix = /* @__PURE__ */ __name(() => {
1109
+ console.log(`
1110
+ Gitlint Fix Start [${process.cwd()}]
1111
+ `);
1112
+ const gitConfig = ParseGitConfig2.sync();
1113
+ if (gitConfig.core.ignorecase) {
1114
+ execSync2("git config core.ignorecase false", {
1115
+ stdio: "inherit"
1116
+ });
1117
+ console.warn(chalk16.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
1118
+ }
1119
+ if (gitConfig.core.autocrlf !== false) {
1120
+ execSync2("git config core.autocrlf false", {
1121
+ stdio: "inherit"
1122
+ });
1123
+ console.warn(chalk16.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
1124
+ }
1125
+ if (gitConfig.core.eol !== "lf") {
1126
+ execSync2("git config core.eol lf", {
1127
+ stdio: "inherit"
1128
+ });
1129
+ console.warn(chalk16.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
1130
+ }
1131
+ return 1;
1132
+ }, "gitlintFix");
1133
+
1134
+ // src/actions/license.ts
1135
+ import chalk17 from "chalk";
1136
+ import { init } from "license-checker";
1137
+ var license = /* @__PURE__ */ __name(async (pkg) => {
1138
+ const workspaces = yarnWorkspaces();
1139
+ const workspaceList = workspaces.filter(({ name }) => {
1140
+ return pkg === void 0 || name === pkg;
1141
+ });
1142
+ const exclude = /* @__PURE__ */ new Set([
1143
+ "MIT",
1144
+ "MIT*",
1145
+ "ISC",
1146
+ "Apache-2.0",
1147
+ "BSD",
1148
+ "BSD*",
1149
+ "BSD-2-Clause",
1150
+ "BSD-3-Clause",
1151
+ "CC-BY-4.0",
1152
+ "Unlicense",
1153
+ "CC-BY-3.0",
1154
+ "CC0-1.0",
1155
+ "LGPL-3.0-only",
1156
+ "LGPL-3.0",
1157
+ "LGPL-3.0-or-later",
1158
+ "Python-2.0"
1159
+ ]);
1160
+ console.log(chalk17.green("License Checker"));
1161
+ return (await Promise.all(workspaceList.map(({ location, name }) => {
1162
+ return new Promise((resolve) => {
1163
+ init({
1164
+ production: true,
1165
+ start: location
1166
+ }, (error, packages) => {
1167
+ if (error) {
1168
+ console.error(chalk17.red(`License Checker [${name}] Error`));
1169
+ console.error(chalk17.gray(error));
1170
+ console.log("\n");
1171
+ resolve(1);
1172
+ } else {
1173
+ console.log(chalk17.green(`License Checker [${name}]`));
1174
+ let count = 0;
1175
+ for (const [name2, info] of Object.entries(packages)) {
1176
+ const licenses = Array.isArray(info.licenses) ? info.licenses : [
1177
+ info.licenses
1178
+ ];
1179
+ for (let license2 of licenses) {
1180
+ if (license2) {
1181
+ if (license2[0] === "(" && license2.at(-1) === ")") {
1182
+ license2 = license2.slice(1, -2);
1183
+ }
1184
+ const orLicenses = license2.split(" OR ");
1185
+ let orLicenseFound = false;
1186
+ for (const orLicense of orLicenses) {
1187
+ if (exclude.has(orLicense)) {
1188
+ orLicenseFound = true;
1189
+ }
1190
+ }
1191
+ if (!orLicenseFound) {
1192
+ count++;
1193
+ console.warn(chalk17.yellow(`${name2}: Package License not allowed [${license2}]`));
1194
+ }
1195
+ }
1196
+ }
1197
+ }
1198
+ console.log("\n");
1199
+ resolve(count);
1200
+ }
1201
+ });
1202
+ });
1203
+ }))).reduce((prev, value) => prev || value, 0);
1204
+ }, "license");
1205
+
1206
+ // src/actions/lint.ts
1207
+ import chalk18 from "chalk";
1208
+ import { ESLint } from "eslint";
1209
+ var dumpMessages = /* @__PURE__ */ __name((lintResults) => {
1210
+ const colors = [
1211
+ "white",
1212
+ "yellow",
1213
+ "red"
1214
+ ];
1215
+ const severity = [
1216
+ "none",
1217
+ "warning",
1218
+ "error"
1219
+ ];
1220
+ for (const lintResult of lintResults) {
1221
+ if (lintResult.messages.length > 0) {
1222
+ console.log(chalk18.gray(`${lintResult.filePath}`));
1223
+ for (const message of lintResult.messages) {
1224
+ console.log(chalk18.gray(` ${message.line}:${message.column}`), chalk18[colors[message.severity]](` ${severity[message.severity]}`), chalk18.white(` ${message.message}`), chalk18.gray(` ${message.ruleId}`));
1225
+ }
1226
+ }
1227
+ }
1228
+ }, "dumpMessages");
1229
+ var lintPackage = /* @__PURE__ */ __name(async ({ pkg }) => {
1230
+ const workspace = yarnWorkspaces().find((workspace2) => workspace2.name === pkg);
1231
+ if (!workspace) {
1232
+ console.error(chalk18.red(`Unable to locate package [${chalk18.magenta(pkg)}]`));
1233
+ process.exit(1);
1234
+ }
1235
+ const engine = new ESLint({
1236
+ cache: true
1237
+ });
1238
+ const lintResults = await engine.lintFiles(workspace.location);
1239
+ dumpMessages(lintResults);
1240
+ return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
1241
+ }, "lintPackage");
1242
+ var lintAll = /* @__PURE__ */ __name(async () => {
1243
+ const engine = new ESLint({
1244
+ cache: true
1245
+ });
1246
+ const lintResults = await engine.lintFiles("./**/*.*");
1247
+ dumpMessages(lintResults);
1248
+ return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
1249
+ }, "lintAll");
1250
+ var lint = /* @__PURE__ */ __name(async ({ pkg } = {}) => {
1251
+ return pkg ? await lintPackage({
1252
+ pkg
1253
+ }) : runSteps("Lint-Caching [All]", [
1254
+ [
1255
+ "yarn",
1256
+ [
1257
+ "eslint",
1258
+ ".",
1259
+ "--cache"
1260
+ ]
1261
+ ]
1262
+ ]);
1263
+ }, "lint");
1264
+
1265
+ // src/actions/lint-clean.ts
1266
+ import { rmSync } from "node:fs";
1267
+ var lintClean = /* @__PURE__ */ __name(() => {
1268
+ console.log("Lint Clean [.eslintcache]");
1269
+ const workspaces = yarnWorkspaces();
1270
+ const result = workspaces.map(({ location, name }) => {
1271
+ const dist = `${location}/.eslintcache`;
1272
+ try {
1273
+ rmSync(dist, {
1274
+ force: true,
1275
+ recursive: true
1276
+ });
1277
+ return 0;
1278
+ } catch (ex) {
1279
+ const error = ex;
1280
+ console.error(`Lint Clean [.eslintcache] Failed [${name}, ${error.message}]`);
1281
+ return 1;
1282
+ }
1283
+ }).reduce((prev, result2) => prev || result2, 0);
1284
+ return result || lint();
1285
+ }, "lintClean");
1286
+
1287
+ // src/actions/lint-profile.ts
1288
+ var lintProfile = /* @__PURE__ */ __name(() => {
1289
+ return runSteps("Lint Profile", [
1290
+ [
1291
+ "yarn",
1292
+ [
1293
+ "xy",
1294
+ "lint"
1295
+ ],
1296
+ {
1297
+ env: {
1298
+ ...process.env,
1299
+ TIMING: "1"
1300
+ }
1301
+ }
1302
+ ]
1303
+ ]);
1304
+ }, "lintProfile");
1305
+
1306
+ // src/actions/npmignore-gen.ts
1307
+ var filename2 = ".npmignore";
1308
+ var npmignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename2, pkg), "npmignoreGen");
1309
+
1310
+ // src/actions/package/clean-outputs.ts
1311
+ import path3 from "node:path";
1312
+ import chalk19 from "chalk";
1313
+ import { rimraf } from "rimraf";
1314
+ var packageCleanOutputs = /* @__PURE__ */ __name(async () => {
1315
+ const pkg = process.env.INIT_CWD ?? ".";
1316
+ const pkgName = process.env.npm_package_name;
1317
+ const folders = [
1318
+ path3.join(pkg, "dist"),
1319
+ path3.join(pkg, "build"),
1320
+ path3.join(pkg, "docs")
1321
+ ];
1322
+ console.log(chalk19.green(`Cleaning Outputs [${pkgName}]`));
1323
+ await Promise.all(folders.map((folder) => rimraf(folder)));
1324
+ return 0;
1325
+ }, "packageCleanOutputs");
1326
+
1327
+ // src/actions/package/clean-typescript.ts
1328
+ import path4 from "node:path";
1329
+ import chalk20 from "chalk";
1330
+ import { rimraf as rimraf2 } from "rimraf";
1331
+ var packageCleanTypescript = /* @__PURE__ */ __name(async () => {
1332
+ const pkg = process.env.INIT_CWD ?? ".";
1333
+ const pkgName = process.env.npm_package_name;
1334
+ console.log(chalk20.green(`Cleaning Typescript [${pkgName}]`));
1335
+ const files = [
1336
+ path4.join(pkg, "*.tsbuildinfo"),
1337
+ path4.join(pkg, ".tsconfig.*"),
1338
+ path4.join(pkg, ".eslintcache")
1339
+ ];
1340
+ await Promise.all(files.map((file) => rimraf2(file)));
1341
+ return 0;
1342
+ }, "packageCleanTypescript");
1343
+
1344
+ // src/actions/package/clean.ts
1345
+ var packageClean = /* @__PURE__ */ __name(async () => {
1346
+ return (await Promise.all([
1347
+ packageCleanOutputs(),
1348
+ packageCleanTypescript()
1349
+ ])).reduce((prev, value) => prev + value, 0);
1350
+ }, "packageClean");
1351
+
1352
+ // src/actions/package/compile/compile.ts
1353
+ import chalk24 from "chalk";
1354
+
1355
+ // src/actions/package/publint.ts
1356
+ import { promises as fs } from "node:fs";
1357
+ import chalk21 from "chalk";
1358
+ var packagePublint = /* @__PURE__ */ __name(async (params) => {
1359
+ const pkgDir = process.env.INIT_CWD;
1360
+ const pkg = JSON.parse(await fs.readFile(`${pkgDir}/package.json`, "utf8"));
1361
+ console.log(chalk21.green(`Publint: ${pkg.name}`));
1362
+ console.log(chalk21.gray(pkgDir));
1363
+ const { publint: publint2 } = await import("publint");
1364
+ const { messages } = await publint2({
1365
+ level: "suggestion",
1366
+ pkgDir,
1367
+ strict: true
1368
+ });
1369
+ const { formatMessage } = await import("publint/utils");
1370
+ const validMessage = /* @__PURE__ */ __name((_message) => {
1371
+ return true;
1372
+ }, "validMessage");
1373
+ const validMessages = messages.filter(validMessage);
1374
+ for (const message of validMessages) {
1375
+ switch (message.type) {
1376
+ case "error": {
1377
+ console.error(chalk21.red(`[${message.code}] ${formatMessage(message, pkg)}`));
1378
+ break;
1379
+ }
1380
+ case "warning": {
1381
+ console.warn(chalk21.yellow(`[${message.code}] ${formatMessage(message, pkg)}`));
1382
+ break;
1383
+ }
1384
+ default: {
1385
+ console.log(chalk21.white(`[${message.code}] ${formatMessage(message, pkg)}`));
1386
+ break;
1387
+ }
1388
+ }
1389
+ }
1390
+ if (params?.verbose) {
1391
+ console.log(chalk21.gray(`Publint [Finish]: ${pkgDir} [${validMessages.length}]`));
1392
+ }
1393
+ return validMessages.filter((message) => message.type === "error").length;
1394
+ }, "packagePublint");
1395
+
1396
+ // src/actions/package/compile/packageCompileTsc.ts
1397
+ import { cwd } from "node:process";
1398
+ import chalk22 from "chalk";
1399
+ import { createProgramFromConfig } from "tsc-prog";
1400
+ import { DiagnosticCategory, formatDiagnosticsWithColorAndContext, getLineAndCharacterOfPosition, getPreEmitDiagnostics } from "typescript";
1401
+
1402
+ // src/actions/package/compile/getCompilerOptions.ts
1403
+ import { createRequire } from "node:module";
1404
+ import { merge as merge2 } from "lodash-es";
1405
+ import { findConfigFile, readConfigFile, sys } from "typescript";
1406
+ var getCompilerOptionsJSONFollowExtends = /* @__PURE__ */ __name((filename3) => {
1407
+ let opts = {};
1408
+ const config2 = readConfigFile(filename3, sys.readFile).config;
1409
+ if (config2.extends) {
1410
+ const require2 = createRequire(import.meta.url);
1411
+ opts = require2(config2.extends);
1412
+ }
1413
+ if (config2?.error) {
1414
+ throw new Error(`getCompilerOptionsJSONFollowExtends failed ${JSON.stringify(config2?.error?.messageText, null, 2)}`);
1415
+ }
1416
+ return {
1417
+ ...opts.compilerOptions,
1418
+ ...config2.compilerOptions
1419
+ };
1420
+ }, "getCompilerOptionsJSONFollowExtends");
1421
+ var getCompilerOptions = /* @__PURE__ */ __name(async (options, tsconfig = "tsconfig.json") => {
1422
+ const configFileName = findConfigFile("./", sys.fileExists, tsconfig);
1423
+ const configFileCompilerOptions = configFileName ? await getCompilerOptionsJSONFollowExtends(configFileName) : void 0;
1424
+ return merge2({}, configFileCompilerOptions, options);
1425
+ }, "getCompilerOptions");
1426
+
1427
+ // src/actions/package/compile/packageCompileTsc.ts
1428
+ var packageCompileTsc = /* @__PURE__ */ __name(async (noEmit, config2, compilerOptionsParam) => {
1429
+ const pkg = process.env.INIT_CWD ?? cwd();
1430
+ const publint2 = config2?.publint ?? true;
1431
+ const verbose = config2?.verbose ?? false;
1432
+ const formatHost = {
1433
+ getCanonicalFileName: /* @__PURE__ */ __name((fileName) => fileName, "getCanonicalFileName"),
1434
+ getCurrentDirectory: /* @__PURE__ */ __name(() => pkg, "getCurrentDirectory"),
1435
+ getNewLine: /* @__PURE__ */ __name(() => "\n", "getNewLine")
1436
+ };
1437
+ if (verbose) {
1438
+ console.log(`Compiling with NoEmit TSC [${pkg}]`);
1439
+ }
1440
+ const compilerOptions = {
1441
+ ...await getCompilerOptions({
1442
+ outDir: "dist",
1443
+ removeComments: true,
1444
+ rootDir: "src"
1445
+ }),
1446
+ ...compilerOptionsParam,
1447
+ ...noEmit === void 0 ? {} : {
1448
+ noEmit
1449
+ }
1450
+ };
1451
+ const program = createProgramFromConfig({
1452
+ basePath: pkg ?? cwd(),
1453
+ compilerOptions,
1454
+ exclude: [
1455
+ "dist",
1456
+ "docs",
1457
+ "**/*.spec.*",
1458
+ "**/*.stories.*",
1459
+ "src/**/spec/**/*"
1460
+ ],
1461
+ include: [
1462
+ "src"
1463
+ ]
1464
+ });
1465
+ const results = getPreEmitDiagnostics(program);
1466
+ for (const diag of results) {
1467
+ const lineAndChar = diag.file ? getLineAndCharacterOfPosition(diag.file, diag.start ?? 0) : {
1468
+ character: 0,
1469
+ line: 0
1470
+ };
1471
+ console.log(chalk22.cyan(`${diag.file?.fileName}:${lineAndChar.line + 1}:${lineAndChar.character + 1}`));
1472
+ console.log(formatDiagnosticsWithColorAndContext([
1473
+ diag
1474
+ ], formatHost));
1475
+ }
1476
+ return results.reduce((prev, diag) => prev + diag.category === DiagnosticCategory.Error ? 1 : 0, 0) || (publint2 ? await packagePublint() : 0);
1477
+ }, "packageCompileTsc");
1478
+
1479
+ // src/actions/package/compile/packageCompileTsup.ts
1480
+ import { merge as merge3 } from "lodash-es";
1481
+ import { build as build2, defineConfig } from "tsup";
1482
+
1483
+ // src/actions/package/compile/inputs.ts
1484
+ import { glob } from "glob";
1485
+ var getAllInputs2 = /* @__PURE__ */ __name((folder) => {
1486
+ return glob.sync(`${folder}/**/*.*`, {
1487
+ ignore: [
1488
+ "**/*.spec.*",
1489
+ "**/*.stories.*",
1490
+ "**/spec/**/*"
1491
+ ],
1492
+ posix: true
1493
+ });
1494
+ }, "getAllInputs2");
1495
+
1496
+ // src/actions/package/compile/buildEntries.ts
1497
+ var buildEntries = /* @__PURE__ */ __name((folder, entryMode, verbose = false) => {
1498
+ switch (entryMode) {
1499
+ case "platform": {
1500
+ if (verbose) console.log("buildEntries [platform]");
1501
+ return [
1502
+ `${folder}/index-node.ts`,
1503
+ `${folder}/index-browser.ts`
1504
+ ];
1505
+ }
1506
+ case "all": {
1507
+ if (verbose) console.log("buildEntries [all]");
1508
+ return getAllInputs2(folder).filter((entry) => !entry.includes(".spec.") && !entry.includes(".story."));
1509
+ }
1510
+ default: {
1511
+ if (verbose) console.log("buildEntries [single]");
1512
+ return [
1513
+ `${folder}/index.ts`
1514
+ ];
1515
+ }
1516
+ }
1517
+ }, "buildEntries");
1518
+
1519
+ // src/actions/package/compile/packageCompileTscTypes.ts
1520
+ import { cwd as cwd2 } from "node:process";
1521
+ import chalk23 from "chalk";
1522
+ import { createProgramFromConfig as createProgramFromConfig2 } from "tsc-prog";
1523
+ import { DiagnosticCategory as DiagnosticCategory2 } from "typescript";
1524
+
1525
+ // src/actions/package/compile/copyTypeFiles.ts
1526
+ import { copyFile, readdir } from "node:fs/promises";
1527
+ import { Mutex } from "async-mutex";
1528
+ var copyFileMutex = new Mutex();
1529
+ var getDistTypeFiles = /* @__PURE__ */ __name(async (compilerOptions) => {
1530
+ const outDir = compilerOptions.outDir ?? "dist";
1531
+ return (await readdir(outDir, {
1532
+ recursive: true
1533
+ })).filter((file) => file.endsWith("d.ts")).map((file) => `${outDir}/${file}`);
1534
+ }, "getDistTypeFiles");
1535
+ var getDistTypeMapFiles = /* @__PURE__ */ __name(async (compilerOptions) => {
1536
+ const outDir = compilerOptions.outDir ?? "dist";
1537
+ return (await readdir(outDir, {
1538
+ recursive: true
1539
+ })).filter((file) => file.endsWith("d.ts.map")).map((file) => `${outDir}/${file}`);
1540
+ }, "getDistTypeMapFiles");
1541
+ var copyTypeFiles = /* @__PURE__ */ __name(async (compilerOptions) => {
1542
+ await copyFileMutex.runExclusive(async () => {
1543
+ const distTypeFiles = await getDistTypeFiles(compilerOptions);
1544
+ await Promise.all(distTypeFiles.map(async (file) => {
1545
+ await copyFile(file, file.replace("d.ts", "d.mts"));
1546
+ await copyFile(file, file.replace("d.ts", "d.cts"));
1547
+ }));
1548
+ const distTypeMapFiles = await getDistTypeMapFiles(compilerOptions);
1549
+ await Promise.all(distTypeMapFiles.map(async (file) => {
1550
+ await copyFile(file, file.replace("d.ts.map", "d.mts.map"));
1551
+ await copyFile(file, file.replace("d.ts.map", "d.cts.map"));
1552
+ }));
1553
+ });
1554
+ }, "copyTypeFiles");
1555
+
1556
+ // src/actions/package/compile/packageCompileTscTypes.ts
1557
+ var packageCompileTscTypes = /* @__PURE__ */ __name(async (folder = "src", { verbose } = {}, compilerOptionsParam, generateMts = true) => {
1558
+ const pkg = process.env.INIT_CWD ?? cwd2();
1559
+ if (verbose) {
1560
+ console.log(`Compiling types with TSC [${pkg}]`);
1561
+ }
1562
+ const compilerOptions = {
1563
+ ...await getCompilerOptions({
1564
+ declaration: true,
1565
+ emitDeclarationOnly: true,
1566
+ outDir: "dist",
1567
+ removeComments: true,
1568
+ skipDefaultLibCheck: true,
1569
+ skipLibCheck: true,
1570
+ sourceMap: true
1571
+ }),
1572
+ ...compilerOptionsParam
1573
+ };
1574
+ const files = buildEntries(folder, "all");
1575
+ const result = createProgramFromConfig2({
1576
+ basePath: pkg ?? cwd2(),
1577
+ compilerOptions,
1578
+ exclude: [
1579
+ "dist",
1580
+ "docs",
1581
+ "**/*.spec.*",
1582
+ "**/*.stories.*",
1583
+ "src/**/spec/**/*"
1584
+ ],
1585
+ files
1586
+ }).emit();
1587
+ const diagResults = result.diagnostics.length;
1588
+ for (const diag of result.diagnostics) {
1589
+ switch (diag.category) {
1590
+ case DiagnosticCategory2.Error: {
1591
+ console.error(chalk23.red(diag.messageText));
1592
+ console.error(chalk23.grey(pkg));
1593
+ console.error(chalk23.blue(diag.file?.fileName));
1594
+ break;
1595
+ }
1596
+ case DiagnosticCategory2.Warning: {
1597
+ console.error(chalk23.yellow(diag.messageText));
1598
+ console.error(chalk23.grey(pkg));
1599
+ console.error(chalk23.blue(diag.file?.fileName));
1600
+ break;
1601
+ }
1602
+ case DiagnosticCategory2.Suggestion: {
1603
+ console.error(chalk23.white(diag.messageText));
1604
+ console.error(chalk23.grey(pkg));
1605
+ console.error(chalk23.blue(diag.file?.fileName));
1606
+ break;
1607
+ }
1608
+ }
1609
+ }
1610
+ if (generateMts) {
1611
+ await copyTypeFiles(compilerOptions);
1612
+ }
1613
+ return diagResults;
1614
+ }, "packageCompileTscTypes");
1615
+
1616
+ // src/actions/package/compile/packageCompileTsup.ts
1617
+ var compileFolder = /* @__PURE__ */ __name(async (folder, entryMode = "single", options, verbose) => {
1618
+ const outDir = options?.outDir ?? "dist";
1619
+ const entry = buildEntries(folder, entryMode);
1620
+ const optionsResult = defineConfig({
1621
+ bundle: true,
1622
+ cjsInterop: true,
1623
+ clean: true,
1624
+ dts: false,
1625
+ entry,
1626
+ format: [
1627
+ "cjs",
1628
+ "esm"
1629
+ ],
1630
+ // minify: true,
1631
+ outDir,
1632
+ silent: true,
1633
+ sourcemap: true,
1634
+ splitting: false,
1635
+ // terserOptions: { format: { comments: false } },
1636
+ tsconfig: "tsconfig.json",
1637
+ ...options
1638
+ });
1639
+ const optionsList = (await Promise.all((Array.isArray(optionsResult) ? optionsResult : [
1640
+ optionsResult
1641
+ ]).flatMap(async (options2) => {
1642
+ const result = typeof options2 === "function" ? await options2({}) : [
1643
+ options2
1644
+ ];
1645
+ return Array.isArray(result) ? result : [
1646
+ result
1647
+ ];
1648
+ }))).flat();
1649
+ await Promise.all(optionsList.map((options2) => build2(options2)));
1650
+ await packageCompileTscTypes(folder, {
1651
+ verbose
1652
+ }, {
1653
+ outDir
1654
+ });
1655
+ return 0;
1656
+ }, "compileFolder");
1657
+ var packageCompileTsup = /* @__PURE__ */ __name(async (config2) => {
1658
+ const compile2 = config2?.compile;
1659
+ const publint2 = config2?.publint ?? true;
1660
+ const verbose = config2?.verbose ?? false;
1661
+ if (verbose) {
1662
+ console.log(`Compiling with TSUP [Depth: ${compile2?.depth}]`);
1663
+ }
1664
+ const compileForNode = compile2?.node ?? {
1665
+ src: {}
1666
+ };
1667
+ const compileForBrowser = compile2?.browser ?? {
1668
+ src: {}
1669
+ };
1670
+ const compileForNeutral = compile2?.neutral ?? {
1671
+ src: {}
1672
+ };
1673
+ return await packageCompileTsc(true, {
1674
+ publint: false,
1675
+ verbose
1676
+ }) || (await Promise.all(Object.entries(compileForNode).map(async ([folder, options]) => {
1677
+ const inEsBuildOptions = typeof compile2?.node?.esbuildOptions === "object" ? compile2?.node?.esbuildOptions : {};
1678
+ return folder ? await compileFolder(folder, compile2?.entryMode, {
1679
+ bundle: true,
1680
+ format: [
1681
+ "cjs",
1682
+ "esm"
1683
+ ],
1684
+ loader: merge3({}, {
1685
+ ".gif": "copy",
1686
+ ".html": "copy",
1687
+ ".jpg": "copy",
1688
+ ".json": "json",
1689
+ ".png": "copy",
1690
+ ".svg": "copy",
1691
+ ".webp": "copy"
1692
+ }, inEsBuildOptions?.loader),
1693
+ // minify: true,
1694
+ outDir: "dist/node",
1695
+ platform: "node",
1696
+ skipNodeModulesBundle: true,
1697
+ sourcemap: true,
1698
+ target: "node16",
1699
+ // terserOptions: { format: { comments: false } },
1700
+ ...compile2?.tsup?.options,
1701
+ ...typeof options === "object" ? options : {}
1702
+ }, verbose) : 0;
1703
+ }))).reduce((prev, value) => prev + value, 0) || (await Promise.all(Object.entries(compileForBrowser).map(async ([folder, options]) => {
1704
+ const inEsBuildOptions = typeof compile2?.browser?.esbuildOptions === "object" ? compile2?.browser?.esbuildOptions : {};
1705
+ return folder ? (await Promise.all([
1706
+ compileFolder(folder, compile2?.entryMode, {
1707
+ bundle: true,
1708
+ format: [
1709
+ "cjs"
1710
+ ],
1711
+ loader: merge3({}, {
1712
+ ".gif": "copy",
1713
+ ".html": "copy",
1714
+ ".jpg": "copy",
1715
+ ".json": "json",
1716
+ ".png": "copy",
1717
+ ".svg": "copy",
1718
+ ".webp": "copy"
1719
+ }, inEsBuildOptions?.loader),
1720
+ // minify: true,
1721
+ outDir: "dist/browser",
1722
+ outExtension: /* @__PURE__ */ __name(({ format }) => format === "esm" ? {
1723
+ js: ".ts"
1724
+ } : {
1725
+ js: ".cjs"
1726
+ }, "outExtension"),
1727
+ platform: "browser",
1728
+ skipNodeModulesBundle: true,
1729
+ sourcemap: true,
1730
+ target: "esnext",
1731
+ // terserOptions: { format: { comments: false } },
1732
+ ...compile2?.tsup?.options,
1733
+ ...typeof options === "object" ? options : {}
1734
+ }, verbose),
1735
+ compileFolder(folder, compile2?.entryMode, {
1736
+ bundle: true,
1737
+ format: [
1738
+ "esm"
1739
+ ],
1740
+ loader: merge3({}, {
1741
+ ".gif": "copy",
1742
+ ".html": "copy",
1743
+ ".jpg": "copy",
1744
+ ".json": "json",
1745
+ ".png": "copy",
1746
+ ".svg": "copy",
1747
+ ".webp": "copy"
1748
+ }, inEsBuildOptions?.loader),
1749
+ // minify: true,
1750
+ outDir: "dist/browser",
1751
+ outExtension: /* @__PURE__ */ __name(({ format }) => format === "esm" ? {
1752
+ js: ".ts"
1753
+ } : {
1754
+ js: ".cjs"
1755
+ }, "outExtension"),
1756
+ platform: "browser",
1757
+ skipNodeModulesBundle: true,
1758
+ sourcemap: true,
1759
+ target: "esnext",
1760
+ // terserOptions: { format: { comments: false } },
1761
+ ...compile2?.tsup?.options,
1762
+ ...typeof options === "object" ? options : {}
1763
+ }, verbose)
1764
+ ])).reduce((prev, value) => prev + value, 0) : 0;
1765
+ }))).reduce((prev, value) => prev + value, 0) || (await Promise.all(Object.entries(compileForNeutral).map(async ([folder, options]) => {
1766
+ const inEsBuildOptions = typeof compile2?.neutral?.esbuildOptions === "object" ? compile2?.neutral?.esbuildOptions : {};
1767
+ return folder ? (await Promise.all([
1768
+ compileFolder(folder, compile2?.entryMode, {
1769
+ bundle: true,
1770
+ format: [
1771
+ "cjs"
1772
+ ],
1773
+ loader: merge3({}, {
1774
+ ".gif": "copy",
1775
+ ".html": "copy",
1776
+ ".jpg": "copy",
1777
+ ".json": "json",
1778
+ ".png": "copy",
1779
+ ".svg": "copy",
1780
+ ".webp": "copy"
1781
+ }, inEsBuildOptions?.loader),
1782
+ // minify: true,
1783
+ outDir: "dist/neutral",
1784
+ outExtension: /* @__PURE__ */ __name(({ format }) => format === "esm" ? {
1785
+ js: ".ts"
1786
+ } : {
1787
+ js: ".cjs"
1788
+ }, "outExtension"),
1789
+ platform: "neutral",
1790
+ skipNodeModulesBundle: true,
1791
+ sourcemap: true,
1792
+ target: "esnext",
1793
+ // terserOptions: { format: { comments: false } },
1794
+ ...compile2?.tsup?.options,
1795
+ ...typeof options === "object" ? options : {}
1796
+ }, verbose),
1797
+ compileFolder(folder, compile2?.entryMode, {
1798
+ bundle: true,
1799
+ format: [
1800
+ "esm"
1801
+ ],
1802
+ loader: merge3({}, {
1803
+ ".gif": "copy",
1804
+ ".html": "copy",
1805
+ ".jpg": "copy",
1806
+ ".json": "json",
1807
+ ".png": "copy",
1808
+ ".svg": "copy",
1809
+ ".webp": "copy"
1810
+ }, inEsBuildOptions?.loader),
1811
+ // minify: true,
1812
+ outDir: "dist/neutral",
1813
+ outExtension: /* @__PURE__ */ __name(({ format }) => format === "esm" ? {
1814
+ js: ".ts"
1815
+ } : {
1816
+ js: ".cjs"
1817
+ }, "outExtension"),
1818
+ platform: "neutral",
1819
+ skipNodeModulesBundle: true,
1820
+ sourcemap: true,
1821
+ target: "esnext",
1822
+ // terserOptions: { format: { comments: false } },
1823
+ ...compile2?.tsup?.options,
1824
+ ...typeof options === "object" ? options : {}
1825
+ }, verbose)
1826
+ ])).reduce((prev, value) => prev + value, 0) : 0;
1827
+ }))).reduce((prev, value) => prev + value, 0) || (publint2 ? await packagePublint() : 0);
1828
+ }, "packageCompileTsup");
1829
+
1830
+ // src/actions/package/compile/compile.ts
1831
+ var packageCompile = /* @__PURE__ */ __name(async (inConfig = {}) => {
1832
+ const pkg = process.env.INIT_CWD;
1833
+ console.log(chalk24.green(`Compiling ${pkg}`));
1834
+ const config2 = await loadConfig(inConfig);
1835
+ const publint2 = config2.publint;
1836
+ const mode = config2.compile?.mode ?? "tsup";
1837
+ let result = 0;
1838
+ switch (mode) {
1839
+ case "tsc": {
1840
+ result += await packageCompileTsc(void 0, config2);
1841
+ break;
1842
+ }
1843
+ case "tsup": {
1844
+ result += await packageCompileTsup(config2);
1845
+ break;
1846
+ }
1847
+ }
1848
+ return result + (publint2 ? await packagePublint(config2) : 0);
1849
+ }, "packageCompile");
1850
+
1851
+ // src/actions/package/copy-assets.ts
1852
+ import path5 from "node:path/posix";
1853
+ import chalk25 from "chalk";
1854
+ import cpy2 from "cpy";
1855
+ var copyTargetAssets2 = /* @__PURE__ */ __name(async (target, name, location) => {
1856
+ try {
1857
+ const values = await cpy2([
1858
+ "**/*.jpg",
1859
+ "**/*.png",
1860
+ "**/*.gif",
1861
+ "**/*.svg",
1862
+ "**/*.webp",
1863
+ "**/*.sass",
1864
+ "**/*.scss",
1865
+ "**/*.gif",
1866
+ "**/*.css"
1867
+ ], `../dist/${target}`, {
1868
+ cwd: path5.join(location, "src"),
1869
+ parents: true
1870
+ });
1871
+ if (values.length > 0) {
1872
+ console.log(chalk25.green(`Copying Assets [${target.toUpperCase()}] - ${name} - ${location}`));
1873
+ }
1874
+ for (const value of values) {
1875
+ console.log(`${value.split("/").pop()} => ./dist/${target}`);
1876
+ }
1877
+ return 0;
1878
+ } catch (ex) {
1879
+ const error = ex;
1880
+ console.log(`Copy Assets Failed: ${name}: ${error.message}`);
1881
+ return 1;
1882
+ }
1883
+ }, "copyTargetAssets");
1884
+ var packageCopyAssets = /* @__PURE__ */ __name(async ({ target }) => {
1885
+ const pkg = process.env.INIT_CWD ?? "./";
1886
+ const pkgName = process.env.npm_package_name ?? "Unknown";
1887
+ switch (target) {
1888
+ case "esm": {
1889
+ return await copyTargetAssets2("esm", pkgName, pkg);
1890
+ }
1891
+ case "cjs": {
1892
+ return await copyTargetAssets2("cjs", pkgName, pkg);
1893
+ }
1894
+ default: {
1895
+ return await copyTargetAssets2("esm", pkgName, pkg) || await copyTargetAssets2("cjs", pkgName, pkg);
1896
+ }
1897
+ }
1898
+ }, "packageCopyAssets");
1899
+
1900
+ // src/actions/package/deps.ts
1901
+ import { existsSync as existsSync5, readFileSync as readFileSync5 } from "node:fs";
1902
+ import { cwd as cwd3 } from "node:process";
1903
+ import chalk26 from "chalk";
1904
+ import depcheck from "depcheck";
1905
+ var special = depcheck.special;
1906
+ var defaultIgnorePatterns = [
1907
+ "*.d.ts",
1908
+ "dist",
1909
+ ".*",
1910
+ "node_modules"
1911
+ ];
1912
+ var defaultIgnoreDevDeps = [
1913
+ "@xylabs/ts-scripts-yarn3",
1914
+ "@xylabs/tsconfig",
1915
+ "@xylabs/tsconfig-dom",
1916
+ "@xylabs/tsconfig-react",
1917
+ "@xylabs/tsconfig-jest",
1918
+ "typescript"
1919
+ ];
1920
+ var defaultIgnoreDevPatterns = [
1921
+ "*.stories.*",
1922
+ "*.spec.*",
1923
+ "spec",
1924
+ "stories",
1925
+ "tsconfig.json"
1926
+ ];
1927
+ var reportUnused = /* @__PURE__ */ __name((name, unused) => {
1928
+ if (unused.length > 0) {
1929
+ const message = [
1930
+ chalk26.yellow(`${unused.length} Unused ${name}`)
1931
+ ];
1932
+ for (const value of unused) message.push(chalk26.gray(` ${value}`));
1933
+ console.log(message.join("\n"));
1934
+ }
1935
+ }, "reportUnused");
1936
+ var reportMissing = /* @__PURE__ */ __name((name, missing) => {
1937
+ if (Object.keys(missing).length > 0) {
1938
+ const message = [
1939
+ chalk26.yellow(`${Object.entries(missing).length} Missing ${name}`)
1940
+ ];
1941
+ for (const [key, value] of Object.entries(missing)) {
1942
+ message.push(`${key}`, chalk26.gray(` ${value.at(0)}`));
1943
+ }
1944
+ console.log(chalk26.yellow(message.join("\n")));
1945
+ }
1946
+ }, "reportMissing");
1947
+ var analyzeDeps = /* @__PURE__ */ __name(async (pkg, ignoreMatches) => {
1948
+ const packageContent = existsSync5(`${pkg}/package.json`) ? JSON.parse(readFileSync5(`${pkg}/package.json`, {
1949
+ encoding: "utf8"
1950
+ })) : void 0;
1951
+ const [srcUnused, allUnused] = await Promise.all([
1952
+ depcheck(`${pkg}/src`, {
1953
+ ignoreMatches,
1954
+ ignorePatterns: [
1955
+ ...defaultIgnoreDevPatterns,
1956
+ ...defaultIgnorePatterns
1957
+ ],
1958
+ package: packageContent
1959
+ }),
1960
+ depcheck(`${pkg}/.`, {
1961
+ ignoreMatches: [
1962
+ ...ignoreMatches,
1963
+ ...defaultIgnoreDevDeps
1964
+ ],
1965
+ ignorePatterns: [
1966
+ ...defaultIgnorePatterns
1967
+ ],
1968
+ package: packageContent,
1969
+ specials: [
1970
+ special.eslint,
1971
+ special.babel,
1972
+ special.bin,
1973
+ special.prettier,
1974
+ special.jest,
1975
+ special.mocha
1976
+ ]
1977
+ })
1978
+ ]);
1979
+ const unusedDeps = srcUnused.dependencies;
1980
+ const unusedDevDeps = allUnused.devDependencies;
1981
+ const usedDeps = srcUnused.using;
1982
+ const usedDevDeps = allUnused.using;
1983
+ const missing = {
1984
+ ...srcUnused.missing,
1985
+ ...allUnused.missing
1986
+ };
1987
+ const { invalidDirs, invalidFiles } = allUnused;
1988
+ return {
1989
+ invalidDirs,
1990
+ invalidFiles,
1991
+ missing,
1992
+ unusedDeps,
1993
+ unusedDevDeps,
1994
+ usedDeps,
1995
+ usedDevDeps
1996
+ };
1997
+ }, "analyzeDeps");
1998
+ var packageDeps = /* @__PURE__ */ __name(async () => {
1999
+ const pkg = process.env.INIT_CWD ?? cwd3();
2000
+ const pkgName = process.env.npm_package_name;
2001
+ const packageContent = existsSync5(`${pkg}/package.json`) ? JSON.parse(readFileSync5(`${pkg}/package.json`, {
2002
+ encoding: "utf8"
2003
+ })) : void 0;
2004
+ const rawIgnore = existsSync5(`${pkg}/.depcheckrc`) ? readFileSync5(`${pkg}/.depcheckrc`, {
2005
+ encoding: "utf8"
2006
+ }).replace("ignores:", '"ignores":') : void 0;
2007
+ let ignoreMatches = [];
2008
+ try {
2009
+ ignoreMatches = rawIgnore ? JSON.parse(`{${rawIgnore}}`).ignores : [];
2010
+ } catch (ex) {
2011
+ const error = ex;
2012
+ console.log(`${pkgName} [${error.message}] Failed to parse .depcheckrc [${rawIgnore}]`);
2013
+ }
2014
+ const { invalidDirs, invalidFiles, unusedDeps, unusedDevDeps, usedDeps, usedDevDeps, missing } = await analyzeDeps(pkg, ignoreMatches);
2015
+ const declaredDeps = Object.keys(packageContent.dependencies ?? {});
2016
+ const declaredPeerDeps = Object.keys(packageContent.peerDependencies ?? {});
2017
+ const declaredDevDeps = Object.keys(packageContent.devDependencies ?? {});
2018
+ const missingDeps = Object.keys(usedDeps).filter((key) => !declaredDeps.includes(key) && !declaredPeerDeps.includes(key) && !key.startsWith("@types/"));
2019
+ const missingDevDeps = Object.keys(usedDevDeps).filter((key) => !declaredDevDeps.includes(key) && !declaredDeps.includes(key));
2020
+ const missingDepsObject = {};
2021
+ for (const key of missingDeps) {
2022
+ missingDepsObject[key] = missing[key] ?? [
2023
+ `devDep should be dep [${key}]`
2024
+ ];
2025
+ }
2026
+ const missingDevDepsObject = {};
2027
+ for (const key of missingDevDeps) {
2028
+ if (missing[key]) {
2029
+ missingDevDepsObject[key] = missing[key];
2030
+ }
2031
+ }
2032
+ const errorCounts = [
2033
+ unusedDeps.length,
2034
+ unusedDevDeps.length,
2035
+ Object.entries(invalidDirs).length,
2036
+ Object.entries(invalidFiles).length,
2037
+ Object.entries(missingDepsObject).length,
2038
+ Object.entries(missingDevDepsObject).length
2039
+ ];
2040
+ const errorCount = errorCounts.reduce((prev, count) => prev + count, 0);
2041
+ if (errorCount > 0) {
2042
+ console.log(`Deps [${pkgName}] = (${JSON.stringify(errorCounts)})`);
2043
+ } else {
2044
+ console.log(`Deps [${pkgName}] - Ok`);
2045
+ }
2046
+ reportUnused("dependencies", unusedDeps);
2047
+ reportUnused("devDependencies", unusedDevDeps);
2048
+ if (Object.entries(invalidDirs).length > 0) {
2049
+ for (const [key, value] of Object.entries(invalidDirs)) console.warn(chalk26.gray(`Invalid Dir: ${key}: ${value}`));
2050
+ }
2051
+ if (Object.entries(invalidFiles).length > 0) {
2052
+ for (const [key, value] of Object.entries(invalidFiles)) console.warn(chalk26.gray(`Invalid File: ${key}: ${value}`));
2053
+ }
2054
+ reportMissing("dependencies", missingDepsObject);
2055
+ reportMissing("devDependencies", missingDevDepsObject);
2056
+ checkResult(`Deps [${pkgName}]`, errorCount, "warn", false);
2057
+ return 0;
2058
+ }, "packageDeps");
2059
+
2060
+ // src/actions/package/gen-docs.ts
2061
+ import { existsSync as existsSync6 } from "node:fs";
2062
+ import path6 from "node:path";
2063
+ import chalk27 from "chalk";
2064
+ import { Application, ArgumentsReader, TSConfigReader, TypeDocReader } from "typedoc";
2065
+ var ExitCodes = {
2066
+ CompileError: 3,
2067
+ ExceptionThrown: 6,
2068
+ NoEntryPoints: 2,
2069
+ Ok: 0,
2070
+ OptionError: 1,
2071
+ OutputError: 5,
2072
+ ValidationError: 4
2073
+ };
2074
+ var packageGenDocs = /* @__PURE__ */ __name(async () => {
2075
+ const pkg = process.env.INIT_CWD;
2076
+ if (pkg && !existsSync6(path6.join(pkg, "typedoc.json"))) {
2077
+ return;
2078
+ }
2079
+ const app = await Application.bootstrap({
2080
+ entryPointStrategy: "merge",
2081
+ entryPoints: [
2082
+ `${pkg}/src/**/*.ts`,
2083
+ `${pkg}/packages/*/dist/docs.json`
2084
+ ],
2085
+ excludeExternals: true,
2086
+ json: `${pkg}/dist/docs.json`,
2087
+ logLevel: "Error",
2088
+ tsconfig: `${pkg}/tsconfig.json`
2089
+ });
2090
+ app.options.addReader(new ArgumentsReader(0));
2091
+ app.options.addReader(new TypeDocReader());
2092
+ app.options.addReader(new TSConfigReader());
2093
+ app.options.addReader(new ArgumentsReader(300));
2094
+ return await runTypeDoc(app);
2095
+ }, "packageGenDocs");
2096
+ var runTypeDoc = /* @__PURE__ */ __name(async (app) => {
2097
+ const pkgName = process.env.npm_package_name;
2098
+ if (app.options.getValue("version")) {
2099
+ console.log(app.toString());
2100
+ return ExitCodes.Ok;
2101
+ }
2102
+ if (app.options.getValue("showConfig")) {
2103
+ console.log(app.options.getRawValues());
2104
+ return ExitCodes.Ok;
2105
+ }
2106
+ if (app.logger.hasErrors()) {
2107
+ return ExitCodes.OptionError;
2108
+ }
2109
+ if (app.options.getValue("treatWarningsAsErrors") && app.logger.hasWarnings()) {
2110
+ return ExitCodes.OptionError;
2111
+ }
2112
+ if (app.options.getValue("entryPoints").length === 0) {
2113
+ app.logger.error("No entry points provided");
2114
+ return ExitCodes.NoEntryPoints;
2115
+ }
2116
+ if (app.options.getValue("watch")) {
2117
+ app.convertAndWatch(async (project2) => {
2118
+ const out = app.options.getValue("out");
2119
+ if (out) {
2120
+ await app.generateDocs(project2, out);
2121
+ }
2122
+ const json = app.options.getValue("json");
2123
+ if (json) {
2124
+ await app.generateJson(project2, json);
2125
+ }
2126
+ if (!out && !json) {
2127
+ await app.generateDocs(project2, "./docs");
2128
+ }
2129
+ });
2130
+ return ExitCodes.Ok;
2131
+ }
2132
+ const project = await app.convert();
2133
+ if (!project) {
2134
+ return ExitCodes.CompileError;
2135
+ }
2136
+ if (app.options.getValue("treatWarningsAsErrors") && app.logger.hasWarnings()) {
2137
+ return ExitCodes.CompileError;
2138
+ }
2139
+ app.validate(project);
2140
+ if (app.logger.hasErrors()) {
2141
+ return ExitCodes.ValidationError;
2142
+ }
2143
+ if (app.options.getValue("treatWarningsAsErrors") && app.logger.hasWarnings()) {
2144
+ return ExitCodes.ValidationError;
2145
+ }
2146
+ if (app.options.getValue("emit") !== "none") {
2147
+ const out = app.options.getValue("out");
2148
+ if (out) {
2149
+ await app.generateDocs(project, out);
2150
+ }
2151
+ const json = app.options.getValue("json");
2152
+ if (json) {
2153
+ await app.generateJson(project, json);
2154
+ }
2155
+ if (!out && !json) {
2156
+ await app.generateDocs(project, "./docs");
2157
+ }
2158
+ if (app.logger.hasErrors()) {
2159
+ return ExitCodes.OutputError;
2160
+ }
2161
+ if (app.options.getValue("treatWarningsAsErrors") && app.logger.hasWarnings()) {
2162
+ return ExitCodes.OutputError;
2163
+ }
2164
+ }
2165
+ console.log(chalk27.green(`${pkgName} - Ok`));
2166
+ return ExitCodes.Ok;
2167
+ }, "runTypeDoc");
2168
+
2169
+ // src/actions/package/recompile.ts
2170
+ var packageRecompile = /* @__PURE__ */ __name(async () => {
2171
+ return (await Promise.all([
2172
+ packageClean(),
2173
+ packageCompile()
2174
+ ])).reduce((prev, value) => prev + value, 0);
2175
+ }, "packageRecompile");
2176
+
2177
+ // src/actions/publint.ts
2178
+ var publint = /* @__PURE__ */ __name(async ({ verbose, pkg }) => {
2179
+ return pkg ? await publintPackage({
2180
+ pkg,
2181
+ verbose
2182
+ }) : publintAll({
2183
+ verbose
2184
+ });
2185
+ }, "publint");
2186
+ var publintPackage = /* @__PURE__ */ __name(({ pkg }) => {
2187
+ return runStepsAsync(`Publint [${pkg}]`, [
2188
+ [
2189
+ "yarn",
2190
+ [
2191
+ "workspace",
2192
+ pkg,
2193
+ "run",
2194
+ "package-publint"
2195
+ ]
2196
+ ]
2197
+ ]);
2198
+ }, "publintPackage");
2199
+ var publintAll = /* @__PURE__ */ __name(({ verbose }) => {
2200
+ const verboseOptions = verbose ? [
2201
+ "--verbose"
2202
+ ] : [
2203
+ "--no-verbose"
2204
+ ];
2205
+ return runSteps("Publint", [
2206
+ [
2207
+ "yarn",
2208
+ [
2209
+ "workspaces",
2210
+ "foreach",
2211
+ "-pA",
2212
+ ...verboseOptions,
2213
+ "run",
2214
+ "package-publint"
2215
+ ]
2216
+ ]
2217
+ ]);
2218
+ }, "publintAll");
2219
+
2220
+ // src/actions/rebuild.ts
2221
+ var rebuild = /* @__PURE__ */ __name(({ target }) => {
2222
+ return runSteps("Rebuild", [
2223
+ [
2224
+ "yarn",
2225
+ "xy clean"
2226
+ ],
2227
+ [
2228
+ "yarn",
2229
+ target ? `xy build -t ${target}` : "xy build"
2230
+ ]
2231
+ ]);
2232
+ }, "rebuild");
2233
+
2234
+ // src/actions/recompile.ts
2235
+ import chalk28 from "chalk";
2236
+ var recompile = /* @__PURE__ */ __name(async ({ verbose, target, pkg, incremental }) => {
2237
+ return pkg ? await recompilePackage({
2238
+ pkg,
2239
+ target,
2240
+ verbose
2241
+ }) : await recompileAll({
2242
+ incremental,
2243
+ target,
2244
+ verbose
2245
+ });
2246
+ }, "recompile");
2247
+ var recompilePackage = /* @__PURE__ */ __name(({ verbose, target, pkg }) => {
2248
+ const targetOptions = target ? [
2249
+ "-t",
2250
+ target
2251
+ ] : [];
2252
+ const verboseOptions = verbose ? [
2253
+ "--verbose"
2254
+ ] : [
2255
+ "--no-verbose"
2256
+ ];
2257
+ return runStepsAsync(`Recompile [${pkg}]`, [
2258
+ [
2259
+ "yarn",
2260
+ [
2261
+ "workspace",
2262
+ pkg,
2263
+ ...verboseOptions,
2264
+ "run",
2265
+ "package-recompile",
2266
+ ...targetOptions
2267
+ ]
2268
+ ]
2269
+ ]);
2270
+ }, "recompilePackage");
2271
+ var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, incremental }) => {
2272
+ const start = Date.now();
2273
+ const verboseOptions = verbose ? [
2274
+ "--verbose"
2275
+ ] : [
2276
+ "--no-verbose"
2277
+ ];
2278
+ const targetOptions = target ? [
2279
+ "-t",
2280
+ target
2281
+ ] : [];
2282
+ const incrementalOptions = incremental ? [
2283
+ "--since",
2284
+ "-Apt",
2285
+ "--topological-dev"
2286
+ ] : [
2287
+ "--parallel",
2288
+ "-Apt",
2289
+ "--topological-dev"
2290
+ ];
2291
+ const jobsOptions = jobs ? [
2292
+ "-j",
2293
+ `${jobs}`
2294
+ ] : [];
2295
+ if (jobs) {
2296
+ console.log(chalk28.blue(`Jobs set to [${jobs}]`));
2297
+ }
2298
+ const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
2299
+ [
2300
+ "yarn",
2301
+ [
2302
+ "workspaces",
2303
+ "foreach",
2304
+ ...incrementalOptions,
2305
+ ...jobsOptions,
2306
+ ...verboseOptions,
2307
+ "run",
2308
+ "package-recompile",
2309
+ ...targetOptions
2310
+ ]
2311
+ ]
2312
+ ]);
2313
+ console.log(`${chalk28.gray("Recompiled in")} [${chalk28.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk28.gray("seconds")}`);
2314
+ return result;
2315
+ }, "recompileAll");
2316
+
2317
+ // src/actions/reinstall.ts
2318
+ import { closeSync, openSync, rmSync as rmSync2 } from "node:fs";
2319
+ var reinstall = /* @__PURE__ */ __name(() => {
2320
+ console.log("Reinstall [Clear Lock File]");
2321
+ closeSync(openSync("./yarn.lock", "w"));
2322
+ console.log("Reinstall [Clear Node Modules]");
2323
+ const workspaces = yarnWorkspaces();
2324
+ const result = workspaces.map(({ location, name }) => {
2325
+ const dist = `${location}/node_modules`;
2326
+ try {
2327
+ rmSync2(dist, {
2328
+ force: true,
2329
+ recursive: true
2330
+ });
2331
+ return 0;
2332
+ } catch (ex) {
2333
+ const error = ex;
2334
+ console.error(`Reinstall [Clear Node Modules] Failed [${name}, ${error.message}]`);
2335
+ return 1;
2336
+ }
2337
+ }).reduce((prev, result2) => prev || result2, 0);
2338
+ return result || runSteps("Reinstall", [
2339
+ [
2340
+ "yarn",
2341
+ "install --network-timeout 10000"
2342
+ ]
2343
+ ]);
2344
+ }, "reinstall");
2345
+
2346
+ // src/actions/relint.ts
2347
+ import { rmSync as rmSync3 } from "node:fs";
2348
+ var relint = /* @__PURE__ */ __name(() => {
2349
+ console.log("Relint - Cleaning [.eslintcache]");
2350
+ const workspaces = yarnWorkspaces();
2351
+ const result = workspaces.map(({ location, name }) => {
2352
+ const dist = `${location}/.eslintcache`;
2353
+ try {
2354
+ rmSync3(dist, {
2355
+ force: true,
2356
+ recursive: true
2357
+ });
2358
+ return 0;
2359
+ } catch (ex) {
2360
+ const error = ex;
2361
+ console.error(`Relint - Cleaning [.eslintcache] Failed [${name}, ${error.message}]`);
2362
+ return 1;
2363
+ }
2364
+ }).reduce((prev, result2) => prev || result2, 0);
2365
+ return result || runSteps("Relint", [
2366
+ [
2367
+ "yarn",
2368
+ [
2369
+ "eslint",
2370
+ ".",
2371
+ "--cache"
2372
+ ]
2373
+ ]
2374
+ ]);
2375
+ }, "relint");
2376
+
2377
+ // src/actions/retest.ts
2378
+ var retest = /* @__PURE__ */ __name(() => {
2379
+ return runSteps("Test", [
2380
+ [
2381
+ "yarn",
2382
+ [
2383
+ "jest",
2384
+ "--clearCache"
2385
+ ]
2386
+ ],
2387
+ [
2388
+ "yarn",
2389
+ [
2390
+ "jest",
2391
+ "."
2392
+ ]
2393
+ ]
2394
+ ]);
2395
+ }, "retest");
2396
+
2397
+ // src/actions/sonar.ts
2398
+ var sonar = /* @__PURE__ */ __name(() => {
2399
+ return runSteps("Sonar", [
2400
+ [
2401
+ "yarn",
2402
+ [
2403
+ "eslint",
2404
+ "-c",
2405
+ "sonar.eslintrc",
2406
+ "."
2407
+ ]
2408
+ ]
2409
+ ]);
2410
+ }, "sonar");
2411
+
2412
+ // src/actions/statics.ts
2413
+ import chalk29 from "chalk";
2414
+ var DefaultDependencies = [
2415
+ "axios",
2416
+ "@xylabs/pixel",
2417
+ "react",
2418
+ "graphql",
2419
+ "react-router",
2420
+ "@mui/material",
2421
+ "@mui/system"
2422
+ ];
2423
+ var statics = /* @__PURE__ */ __name(() => {
2424
+ console.log(chalk29.green("Check Required Static Dependencies"));
2425
+ const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
2426
+ return detectDuplicateDependencies(statics2, DefaultDependencies);
2427
+ }, "statics");
2428
+
2429
+ // src/actions/test.ts
2430
+ var test = /* @__PURE__ */ __name(() => {
2431
+ return runSteps("Test", [
2432
+ [
2433
+ "yarn",
2434
+ [
2435
+ "jest",
2436
+ "."
2437
+ ]
2438
+ ]
2439
+ ]);
2440
+ }, "test");
2441
+
2442
+ // src/actions/up.ts
2443
+ var up = /* @__PURE__ */ __name(() => {
2444
+ return runSteps("Up", [
2445
+ [
2446
+ "yarn",
2447
+ "outdated"
2448
+ ]
2449
+ ]);
2450
+ }, "up");
2451
+
2452
+ // src/actions/updo.ts
2453
+ var updo = /* @__PURE__ */ __name(() => {
2454
+ return runSteps("Updo", [
2455
+ [
2456
+ "yarn",
2457
+ "install"
2458
+ ],
2459
+ [
2460
+ "yarn",
2461
+ "upgrade-interactive"
2462
+ ],
2463
+ [
2464
+ "yarn",
2465
+ "dedupe"
2466
+ ]
2467
+ ]);
2468
+ }, "updo");
2469
+
2470
+ // src/actions/upplug.ts
2471
+ var updateYarnPlugins = /* @__PURE__ */ __name(() => {
2472
+ return runSteps("Update Yarn Plugins", [
2473
+ [
2474
+ "yarn",
2475
+ [
2476
+ "plugin",
2477
+ "import",
2478
+ "https://mskelton.dev/yarn-outdated/v3"
2479
+ ]
2480
+ ],
2481
+ [
2482
+ "yarn",
2483
+ [
2484
+ "plugin",
2485
+ "import",
2486
+ "version"
2487
+ ]
2488
+ ],
2489
+ [
2490
+ "yarn",
2491
+ [
2492
+ "plugin",
2493
+ "import",
2494
+ "interactive-tools"
2495
+ ]
2496
+ ],
2497
+ [
2498
+ "yarn",
2499
+ [
2500
+ "plugin",
2501
+ "import",
2502
+ "workspace-tools"
2503
+ ]
2504
+ ]
2505
+ ]);
2506
+ }, "updateYarnPlugins");
2507
+
2508
+ // src/actions/upyarn.ts
2509
+ var updateYarnVersion = /* @__PURE__ */ __name(() => {
2510
+ return runSteps("Update Yarn Version", [
2511
+ [
2512
+ "yarn",
2513
+ [
2514
+ "set",
2515
+ "version",
2516
+ "latest"
2517
+ ]
2518
+ ]
2519
+ ]);
2520
+ }, "updateYarnVersion");
2521
+
2522
+ // src/actions/yarn3only.ts
2523
+ var yarn3Only = /* @__PURE__ */ __name(() => {
2524
+ const [valid, version] = isYarnVersionOrGreater(3);
2525
+ if (!valid) {
2526
+ processEx(`Invalid Yarn version [${version}]`);
2527
+ }
2528
+ return 0;
2529
+ }, "yarn3Only");
2530
+
2531
+ // src/loadPackageConfig.ts
2532
+ import { readFile } from "node:fs/promises";
2533
+ var loadPackageConfig = /* @__PURE__ */ __name(async () => {
2534
+ const pkg = process.env.INIT_CWD;
2535
+ const pkgConfig = await readFile(`${pkg}/package.json`, {
2536
+ encoding: "utf8"
2537
+ });
2538
+ return JSON.parse(pkgConfig);
2539
+ }, "loadPackageConfig");
2540
+
2541
+ // src/xy/xy.ts
2542
+ import chalk31 from "chalk";
2543
+
2544
+ // src/xy/xyBuildCommands.ts
2545
+ var xyBuildCommands = /* @__PURE__ */ __name((args) => {
2546
+ return args.command("build [package]", "Build - Compile & Lint", (yargs2) => {
2547
+ return yargs2.positional("package", {
2548
+ describe: "Specific package to build"
2549
+ });
2550
+ }, async (argv) => {
2551
+ if (argv.verbose) {
2552
+ console.log(`Building: ${argv.package ?? "all"}`);
2553
+ }
2554
+ process.exitCode = await build({
2555
+ incremental: !!argv.incremental,
2556
+ jobs: argv.jobs,
2557
+ pkg: argv.package,
2558
+ target: argv.target,
2559
+ verbose: !!argv.verbose
2560
+ });
2561
+ }).command("compile [package]", "Compile with Typescript & Copy Images", (yargs2) => {
2562
+ return yargs2.positional("package", {
2563
+ describe: "Specific package to compile"
2564
+ });
2565
+ }, async (argv) => {
2566
+ if (argv.verbose) {
2567
+ console.log(`Compiling: ${argv.package ?? "all"}`);
2568
+ }
2569
+ process.exitCode = await compile({
2570
+ incremental: !!argv.incremental,
2571
+ jobs: argv.jobs,
2572
+ pkg: argv.package,
2573
+ target: argv.target,
2574
+ verbose: !!argv.verbose
2575
+ });
2576
+ }).command("compile-only [package]", "Compile with Typescript & Copy Images (No Publint)", (yargs2) => {
2577
+ return yargs2.positional("package", {
2578
+ describe: "Specific package to compile"
2579
+ });
2580
+ }, async (argv) => {
2581
+ if (argv.verbose) {
2582
+ console.log(`Compiling: ${argv.package ?? "all"}`);
2583
+ }
2584
+ process.exitCode = await compile({
2585
+ incremental: !!argv.incremental,
2586
+ jobs: argv.jobs,
2587
+ pkg: argv.package,
2588
+ publint: false,
2589
+ target: argv.target,
2590
+ verbose: !!argv.verbose
2591
+ });
2592
+ }).command("recompile [package]", "Re-compile with Typescript & Copy Images", (yargs2) => {
2593
+ return yargs2.positional("package", {
2594
+ describe: "Specific package to re-compile"
2595
+ });
2596
+ }, async (argv) => {
2597
+ if (argv.verbose) {
2598
+ console.log(`Re-compiling: ${argv.package ?? "all"}`);
2599
+ }
2600
+ process.exitCode = await recompile({
2601
+ incremental: !!argv.incremental,
2602
+ jobs: argv.jobs,
2603
+ pkg: argv.package,
2604
+ target: argv.target,
2605
+ verbose: !!argv.verbose
2606
+ });
2607
+ }).command("rebuild [package]", "Rebuild - Clean, Compile & Lint", (yargs2) => {
2608
+ return yargs2.positional("package", {
2609
+ describe: "Specific package to rebuild"
2610
+ });
2611
+ }, (argv) => {
2612
+ if (argv.verbose) console.log(`Rebuilding: ${argv.package ?? "all"}`);
2613
+ process.exitCode = rebuild({
2614
+ target: argv.target
2615
+ });
2616
+ }).command("copy-assets [package]", "Copy Assets - Copy the assets from src to dist", (yargs2) => {
2617
+ return yargs2.positional("package", {
2618
+ describe: "Specific package to copy assets"
2619
+ });
2620
+ }, async (argv) => {
2621
+ if (argv.verbose) console.log(`Copying Assets: ${argv.package ?? "all"}`);
2622
+ process.exitCode = await copyAssets({
2623
+ target: argv.target
2624
+ });
2625
+ });
2626
+ }, "xyBuildCommands");
2627
+
2628
+ // src/xy/param.ts
2629
+ var packagePositionalParam = /* @__PURE__ */ __name((yargs2) => {
2630
+ return yargs2.positional("package", {
2631
+ describe: "Specific package to target"
2632
+ });
2633
+ }, "packagePositionalParam");
2634
+
2635
+ // src/xy/xyCommonCommands.ts
2636
+ var xyCommonCommands = /* @__PURE__ */ __name((args) => {
2637
+ return args.command("license [package]", "License - Check licenses of dependencies", (yargs2) => {
2638
+ return packagePositionalParam(yargs2);
2639
+ }, async (argv) => {
2640
+ if (argv.verbose) console.log(`License: ${argv.package ?? "all"}`);
2641
+ process.exitCode = await license();
2642
+ }).command("dead [package]", "Dead - Check for dead code", (yargs2) => {
2643
+ return packagePositionalParam(yargs2);
2644
+ }, (argv) => {
2645
+ if (argv.verbose) console.log("Dead");
2646
+ process.exitCode = dead();
2647
+ }).command("deps [package]", "Deps - Check for unused or missing dependencies", (yargs2) => {
2648
+ return packagePositionalParam(yargs2);
2649
+ }, (argv) => {
2650
+ if (argv.verbose) console.log(`Checking Dependencies: ${argv.package ?? "all"}`);
2651
+ process.exitCode = deps({
2652
+ incremental: !!argv.incremental,
2653
+ jobs: argv.jobs,
2654
+ pkg: argv.package
2655
+ });
2656
+ }).command("gen-docs [package]", "GenDocs - Generate TypeDocs", (yargs2) => {
2657
+ return packagePositionalParam(yargs2);
2658
+ }, (argv) => {
2659
+ if (argv.verbose) console.log(`Generating TypeDocs: ${argv.package ?? "all"}`);
2660
+ process.exitCode = genDocs({
2661
+ incremental: !!argv.incremental,
2662
+ pkg: argv.package
2663
+ });
2664
+ }).command("clean-docs", "CleanDocs - Clean TypeDocs", (yargs2) => yargs2, (argv) => {
2665
+ if (argv.verbose) console.log("Cleaning TypeDocs: all");
2666
+ process.exitCode = cleanDocs();
2667
+ }).command("gitlint [package]", "Gitlint - Lint your git config", (yargs2) => {
2668
+ return yargs2;
2669
+ }, (argv) => {
2670
+ if (argv.verbose) console.log("Gitlint");
2671
+ process.exitCode = argv.fix ? gitlintFix() : gitlint();
2672
+ }).command("gitignore-gen", "GitIgnore Gen - Generate .gitignore files", (yargs2) => {
2673
+ return yargs2;
2674
+ }, (argv) => {
2675
+ if (argv.verbose) console.log("GitIgnore Gen");
2676
+ process.exitCode = gitignoreGen();
2677
+ }).command("npmignore-gen", "NpmIgnore Gen - Generate .npmignore files", (yargs2) => {
2678
+ return yargs2;
2679
+ }, (argv) => {
2680
+ if (argv.verbose) console.log("NpmIgnore Gen");
2681
+ process.exitCode = npmignoreGen();
2682
+ }).command("retest", "Re-Test - Run Jest Tests with cleaned cache", (yargs2) => {
2683
+ return yargs2;
2684
+ }, (argv) => {
2685
+ if (argv.verbose) console.log("Re-Testing");
2686
+ process.exitCode = retest();
2687
+ }).command("test", "Test - Run Jest Tests", (yargs2) => {
2688
+ return yargs2;
2689
+ }, (argv) => {
2690
+ if (argv.verbose) console.log("Testing");
2691
+ process.exitCode = test();
2692
+ }).command("upplug", "UpPlug - Update Yarn Plugins", (yargs2) => {
2693
+ return yargs2;
2694
+ }, (argv) => {
2695
+ if (argv.verbose) console.log("UpPlug");
2696
+ process.exitCode = updateYarnPlugins();
2697
+ }).command("upyarn", "UpYarn - Update Yarn Version", (yargs2) => {
2698
+ return yargs2;
2699
+ }, (argv) => {
2700
+ if (argv.verbose) console.log("UpYarn");
2701
+ process.exitCode = updateYarnVersion();
2702
+ }).command("yarn3only", "Yarn3Only - Check if using Yarn v3", (yargs2) => {
2703
+ return yargs2;
2704
+ }, (argv) => {
2705
+ if (argv.verbose) console.log("Yarn 3 Check");
2706
+ process.exitCode = yarn3Only();
2707
+ });
2708
+ }, "xyCommonCommands");
2709
+
2710
+ // src/xy/xyDeployCommands.ts
2711
+ var xyDeployCommands = /* @__PURE__ */ __name((args) => {
2712
+ return args.command("deploy", "Deploy - Deploy patch", (yargs2) => {
2713
+ return yargs2;
2714
+ }, (argv) => {
2715
+ if (argv.verbose) console.log("Deploy patch");
2716
+ process.exitCode = deploy();
2717
+ }).command("deploy-minor", "Deploy - Deploy minor", (yargs2) => {
2718
+ return yargs2;
2719
+ }, (argv) => {
2720
+ if (argv.verbose) console.log("Deploy minor");
2721
+ process.exitCode = deployMinor();
2722
+ }).command("deploy-major", "Deploy - Deploy major", (yargs2) => {
2723
+ return yargs2;
2724
+ }, (argv) => {
2725
+ if (argv.verbose) console.log("Deploy major");
2726
+ process.exitCode = deployMajor();
2727
+ }).command("deploy-next", "Deploy - Deploy next", (yargs2) => {
2728
+ return yargs2;
2729
+ }, (argv) => {
2730
+ if (argv.verbose) console.log("Deploy next");
2731
+ process.exitCode = deployNext();
2732
+ });
2733
+ }, "xyDeployCommands");
2734
+
2735
+ // src/xy/xyInstallCommands.ts
2736
+ var xyInstallCommands = /* @__PURE__ */ __name((args) => {
2737
+ return args.command("clean [package]", "Clean", (yargs2) => {
2738
+ return yargs2.positional("package", {
2739
+ describe: "Specific package to clean"
2740
+ });
2741
+ }, async (argv) => {
2742
+ if (argv.verbose) {
2743
+ console.log(`Cleaning: ${argv.package ?? "all"}`);
2744
+ }
2745
+ process.exitCode = await clean({
2746
+ pkg: argv.package,
2747
+ verbose: !!argv.verbose
2748
+ });
2749
+ }).command("reinstall", "Reinstall - Clean & Install", (yargs2) => {
2750
+ return yargs2;
2751
+ }, (argv) => {
2752
+ if (argv.verbose) console.log("Reinstalling");
2753
+ process.exitCode = reinstall();
2754
+ }).command("up", "Up - Update dependencies", (yargs2) => {
2755
+ return yargs2;
2756
+ }, (argv) => {
2757
+ if (argv.verbose) console.log("Up");
2758
+ process.exitCode = up();
2759
+ }).command("updo", "Updo - Update dependencies [Interactive]", (yargs2) => {
2760
+ return yargs2;
2761
+ }, (argv) => {
2762
+ if (argv.verbose) console.log("Updo");
2763
+ process.exitCode = updo();
2764
+ }).command("statics", "Statics - Confirming Static Packages", (yargs2) => {
2765
+ return yargs2;
2766
+ }, (argv) => {
2767
+ if (argv.verbose) console.log("Statics");
2768
+ process.exitCode = statics();
2769
+ }).command("dupdeps", "Dupdeps - Duplicate Dependencies in package.json", (yargs2) => {
2770
+ return yargs2;
2771
+ }, (argv) => {
2772
+ if (argv.verbose) console.log("Dupdeps");
2773
+ process.exitCode = dupdeps();
2774
+ });
2775
+ }, "xyInstallCommands");
2776
+
2777
+ // src/xy/xyLintCommands.ts
2778
+ import chalk30 from "chalk";
2779
+ var xyLintCommands = /* @__PURE__ */ __name((args) => {
2780
+ return args.command("cycle [package]", "Cycle - Check for dependency cycles", (yargs2) => {
2781
+ return packagePositionalParam(yargs2);
2782
+ }, (argv) => {
2783
+ const start = Date.now();
2784
+ if (argv.verbose) console.log("Cycle");
2785
+ process.exitCode = cycle();
2786
+ console.log(chalk30.blue(`Finished in ${Date.now() - start}ms`));
2787
+ }).command("lint [package]", "Lint - Run Eslint", (yargs2) => {
2788
+ return packagePositionalParam(yargs2);
2789
+ }, async (argv) => {
2790
+ if (argv.verbose) console.log("Lint");
2791
+ const start = Date.now();
2792
+ process.exitCode = argv.fix ? fix() : argv.profile ? lintProfile() : await lint({
2793
+ pkg: argv.package
2794
+ });
2795
+ console.log(chalk30.blue(`Finished in ${Date.now() - start}ms`));
2796
+ }).command("fix [package]", "Fix - Run Eslint w/fix", (yargs2) => {
2797
+ return packagePositionalParam(yargs2);
2798
+ }, (argv) => {
2799
+ const start = Date.now();
2800
+ if (argv.verbose) console.log("Fix");
2801
+ process.exitCode = fix();
2802
+ console.log(chalk30.blue(`Finished in ${Date.now() - start}ms`));
2803
+ }).command("relint [package]", "Relint - Clean & Lint", (yargs2) => {
2804
+ return packagePositionalParam(yargs2);
2805
+ }, (argv) => {
2806
+ if (argv.verbose) console.log("Relinting");
2807
+ const start = Date.now();
2808
+ process.exitCode = relint();
2809
+ console.log(chalk30.blue(`Finished in ${Date.now() - start}ms`));
2810
+ }).command("publint [package]", "Publint - Run Publint", (yargs2) => {
2811
+ return packagePositionalParam(yargs2);
2812
+ }, async (argv) => {
2813
+ if (argv.verbose) console.log("Publint");
2814
+ const start = Date.now();
2815
+ process.exitCode = await publint({
2816
+ pkg: argv.package,
2817
+ verbose: !!argv.verbose
2818
+ });
2819
+ console.log(chalk30.blue(`Finished in ${Date.now() - start}ms`));
2820
+ }).command("sonar", "Sonar - Run Sonar Check", (yargs2) => {
2821
+ return packagePositionalParam(yargs2);
2822
+ }, (argv) => {
2823
+ const start = Date.now();
2824
+ if (argv.verbose) console.log("Sonar Check");
2825
+ process.exitCode = sonar();
2826
+ console.log(chalk30.blue(`Finished in ${Date.now() - start}ms`));
2827
+ });
2828
+ }, "xyLintCommands");
2829
+
2830
+ // src/xy/xyParseOptions.ts
2831
+ import yargs from "yargs";
2832
+ import { hideBin } from "yargs/helpers";
2833
+ var xyParseOptions = /* @__PURE__ */ __name(() => {
2834
+ return yargs(hideBin(process.argv)).scriptName("yarn xy").option("jobs", {
2835
+ alias: "j",
2836
+ default: void 0,
2837
+ description: "Max parallel jobs",
2838
+ type: "number"
2839
+ }).option("verbose", {
2840
+ alias: "v",
2841
+ default: false,
2842
+ description: "Run with verbose logging",
2843
+ type: "boolean"
2844
+ }).option("target", {
2845
+ alias: "t",
2846
+ choices: [
2847
+ "esm",
2848
+ "cjs"
2849
+ ],
2850
+ description: "Limit output to specific target",
2851
+ type: "string"
2852
+ }).option("incremental", {
2853
+ alias: "i",
2854
+ default: false,
2855
+ description: "Attempt to perform the action only on changed packages",
2856
+ type: "boolean"
2857
+ }).option("fix", {
2858
+ alias: "f",
2859
+ default: false,
2860
+ description: "Try to fix errors",
2861
+ type: "boolean"
2862
+ }).option("cache", {
2863
+ alias: "c",
2864
+ default: false,
2865
+ description: "Use caching for performance",
2866
+ type: "boolean"
2867
+ }).option("profile", {
2868
+ alias: "p",
2869
+ default: false,
2870
+ description: "Profile action",
2871
+ type: "boolean"
2872
+ });
2873
+ }, "xyParseOptions");
2874
+
2875
+ // src/xy/xy.ts
2876
+ var xy = /* @__PURE__ */ __name(async () => {
2877
+ const options = xyParseOptions();
2878
+ return await xyBuildCommands(xyCommonCommands(xyInstallCommands(xyDeployCommands(xyLintCommands(options))))).demandCommand(1).command("*", "", () => {
2879
+ console.error(chalk31.yellow(`Command not found [${chalk31.magenta(process.argv[2])}]`));
2880
+ console.log(chalk31.gray("Try 'yarn xy --help' for list of commands"));
2881
+ }).version().help().argv;
2882
+ }, "xy");
2883
+ export {
2884
+ CROSS_PLATFORM_NEWLINE,
2885
+ DuplicateDetector,
2886
+ INIT_CWD,
2887
+ WINDOWS_NEWLINE_REGEX,
2888
+ build,
2889
+ checkResult,
2890
+ clean,
2891
+ cleanAll,
2892
+ cleanDocs,
2893
+ cleanPackage,
2894
+ compile,
2895
+ compileAll,
2896
+ compilePackage,
2897
+ copyAssets,
2898
+ createBuildConfig,
2899
+ cycle,
2900
+ dead,
2901
+ defaultBuildConfig,
2902
+ defaultReadFileSyncOptions,
2903
+ deploy,
2904
+ deployMajor,
2905
+ deployMinor,
2906
+ deployNext,
2907
+ deps,
2908
+ depsAll,
2909
+ depsPackage,
2910
+ detectDuplicateDependencies,
2911
+ dupdeps,
2912
+ empty,
2913
+ fix,
2914
+ genDocs,
2915
+ genDocsAll,
2916
+ genDocsPackage,
2917
+ generateIgnoreFiles,
2918
+ gitignoreGen,
2919
+ gitlint,
2920
+ gitlintFix,
2921
+ isYarnVersionOrGreater,
2922
+ license,
2923
+ lint,
2924
+ lintAll,
2925
+ lintClean,
2926
+ lintPackage,
2927
+ lintProfile,
2928
+ loadConfig,
2929
+ loadPackageConfig,
2930
+ multiLineToJSONArray,
2931
+ notEmpty,
2932
+ npmignoreGen,
2933
+ packageClean,
2934
+ packageCleanOutputs,
2935
+ packageCleanTypescript,
2936
+ packageCompile,
2937
+ packageCompileTsc,
2938
+ packageCompileTsup,
2939
+ packageCopyAssets,
2940
+ packageDeps,
2941
+ packageGenDocs,
2942
+ packagePublint,
2943
+ packageRecompile,
2944
+ parsedPackageJSON,
2945
+ processEx,
2946
+ publint,
2947
+ publintAll,
2948
+ publintPackage,
2949
+ readLines,
2950
+ readNonEmptyLines,
2951
+ rebuild,
2952
+ recompile,
2953
+ recompileAll,
2954
+ recompilePackage,
2955
+ reinstall,
2956
+ relint,
2957
+ retest,
2958
+ runStepAsync,
2959
+ runSteps,
2960
+ runStepsAsync,
2961
+ runXy,
2962
+ runXyWithWarning,
2963
+ safeExit,
2964
+ safeExitAsync,
2965
+ sonar,
2966
+ statics,
2967
+ test,
2968
+ tryReadFileSync,
2969
+ union,
2970
+ up,
2971
+ updateYarnPlugins,
2972
+ updateYarnVersion,
2973
+ updo,
2974
+ withErrnoException,
2975
+ withError,
2976
+ writeLines,
2977
+ xy,
2978
+ xyBuildCommands,
2979
+ xyCommonCommands,
2980
+ xyDeployCommands,
2981
+ xyInstallCommands,
2982
+ xyLintCommands,
2983
+ xyParseOptions,
2984
+ yarn3Only,
2985
+ yarnWorkspace,
2986
+ yarnWorkspaces
2987
+ };
5
2988
  //# sourceMappingURL=index.mjs.map