@xylabs/ts-scripts-yarn3 3.14.2 → 3.15.1

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