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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (353) hide show
  1. package/dist/actions/compile.mjs +3 -2
  2. package/dist/actions/compile.mjs.map +1 -1
  3. package/dist/actions/index.mjs +96 -287
  4. package/dist/actions/index.mjs.map +1 -1
  5. package/dist/actions/package/compile/compile.mjs +57 -259
  6. package/dist/actions/package/compile/compile.mjs.map +1 -1
  7. package/dist/actions/package/compile/index.mjs +57 -259
  8. package/dist/actions/package/compile/index.mjs.map +1 -1
  9. package/dist/actions/package/compile/packageCompileTsc.mjs +1 -1
  10. package/dist/actions/package/compile/packageCompileTsc.mjs.map +1 -1
  11. package/dist/actions/package/compile/packageCompileTscTypes.mjs +2 -36
  12. package/dist/actions/package/compile/packageCompileTscTypes.mjs.map +1 -1
  13. package/dist/actions/package/compile/packageCompileTsup.mjs +54 -339
  14. package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -1
  15. package/dist/actions/package/index.mjs +72 -277
  16. package/dist/actions/package/index.mjs.map +1 -1
  17. package/dist/actions/package/recompile.mjs +58 -263
  18. package/dist/actions/package/recompile.mjs.map +1 -1
  19. package/dist/actions/recompile.mjs +14 -1
  20. package/dist/actions/recompile.mjs.map +1 -1
  21. package/dist/bin/package/compile-only.mjs +59 -261
  22. package/dist/bin/package/compile-only.mjs.map +1 -1
  23. package/dist/bin/package/compile-tsup.mjs +56 -341
  24. package/dist/bin/package/compile-tsup.mjs.map +1 -1
  25. package/dist/bin/package/compile.mjs +59 -261
  26. package/dist/bin/package/compile.mjs.map +1 -1
  27. package/dist/bin/package/recompile.mjs +60 -265
  28. package/dist/bin/package/recompile.mjs.map +1 -1
  29. package/dist/bin/xy-ts.mjs +17 -3
  30. package/dist/bin/xy-ts.mjs.map +1 -1
  31. package/dist/bin/xy.mjs +17 -3
  32. package/dist/bin/xy.mjs.map +1 -1
  33. package/dist/index.d.ts +1 -1
  34. package/dist/index.mjs +106 -297
  35. package/dist/index.mjs.map +1 -1
  36. package/dist/xy/index.mjs +17 -3
  37. package/dist/xy/index.mjs.map +1 -1
  38. package/dist/xy/xy.mjs +17 -3
  39. package/dist/xy/xy.mjs.map +1 -1
  40. package/dist/xy/xyBuildCommands.mjs +17 -3
  41. package/dist/xy/xyBuildCommands.mjs.map +1 -1
  42. package/package.json +10 -20
  43. package/src/actions/compile.ts +2 -2
  44. package/src/actions/package/compile/XyConfig.ts +2 -2
  45. package/src/actions/package/compile/packageCompileTsc.ts +1 -1
  46. package/src/actions/package/compile/packageCompileTscTypes.ts +3 -8
  47. package/src/actions/package/compile/packageCompileTsup.ts +54 -130
  48. package/src/actions/package/recompile.ts +1 -1
  49. package/src/actions/recompile.ts +2 -1
  50. package/tsup.config.ts +1 -1
  51. package/dist/actions/build.cjs +0 -208
  52. package/dist/actions/build.cjs.map +0 -1
  53. package/dist/actions/clean-docs.cjs +0 -74
  54. package/dist/actions/clean-docs.cjs.map +0 -1
  55. package/dist/actions/clean-eslint.cjs +0 -53
  56. package/dist/actions/clean-eslint.cjs.map +0 -1
  57. package/dist/actions/clean-jest.cjs +0 -147
  58. package/dist/actions/clean-jest.cjs.map +0 -1
  59. package/dist/actions/clean.cjs +0 -192
  60. package/dist/actions/clean.cjs.map +0 -1
  61. package/dist/actions/compile.cjs +0 -217
  62. package/dist/actions/compile.cjs.map +0 -1
  63. package/dist/actions/copy-assets.cjs +0 -121
  64. package/dist/actions/copy-assets.cjs.map +0 -1
  65. package/dist/actions/cycle.cjs +0 -156
  66. package/dist/actions/cycle.cjs.map +0 -1
  67. package/dist/actions/dead.cjs +0 -148
  68. package/dist/actions/dead.cjs.map +0 -1
  69. package/dist/actions/deploy-major.cjs +0 -160
  70. package/dist/actions/deploy-major.cjs.map +0 -1
  71. package/dist/actions/deploy-minor.cjs +0 -160
  72. package/dist/actions/deploy-minor.cjs.map +0 -1
  73. package/dist/actions/deploy-next.cjs +0 -160
  74. package/dist/actions/deploy-next.cjs.map +0 -1
  75. package/dist/actions/deploy.cjs +0 -160
  76. package/dist/actions/deploy.cjs.map +0 -1
  77. package/dist/actions/deps.cjs +0 -205
  78. package/dist/actions/deps.cjs.map +0 -1
  79. package/dist/actions/dupdeps.cjs +0 -226
  80. package/dist/actions/dupdeps.cjs.map +0 -1
  81. package/dist/actions/fix.cjs +0 -149
  82. package/dist/actions/fix.cjs.map +0 -1
  83. package/dist/actions/gen-docs.cjs +0 -186
  84. package/dist/actions/gen-docs.cjs.map +0 -1
  85. package/dist/actions/gitignore-gen.cjs +0 -138
  86. package/dist/actions/gitignore-gen.cjs.map +0 -1
  87. package/dist/actions/gitlint-fix.cjs +0 -69
  88. package/dist/actions/gitlint-fix.cjs.map +0 -1
  89. package/dist/actions/gitlint.cjs +0 -84
  90. package/dist/actions/gitlint.cjs.map +0 -1
  91. package/dist/actions/index.cjs +0 -2600
  92. package/dist/actions/index.cjs.map +0 -1
  93. package/dist/actions/license.cjs +0 -133
  94. package/dist/actions/license.cjs.map +0 -1
  95. package/dist/actions/lint-clean.cjs +0 -227
  96. package/dist/actions/lint-clean.cjs.map +0 -1
  97. package/dist/actions/lint-profile.cjs +0 -153
  98. package/dist/actions/lint-profile.cjs.map +0 -1
  99. package/dist/actions/lint.cjs +0 -217
  100. package/dist/actions/lint.cjs.map +0 -1
  101. package/dist/actions/npmignore-gen.cjs +0 -138
  102. package/dist/actions/npmignore-gen.cjs.map +0 -1
  103. package/dist/actions/package/clean-outputs.cjs +0 -56
  104. package/dist/actions/package/clean-outputs.cjs.map +0 -1
  105. package/dist/actions/package/clean-typescript.cjs +0 -56
  106. package/dist/actions/package/clean-typescript.cjs.map +0 -1
  107. package/dist/actions/package/clean.cjs +0 -83
  108. package/dist/actions/package/clean.cjs.map +0 -1
  109. package/dist/actions/package/compile/XyConfig.cjs +0 -19
  110. package/dist/actions/package/compile/XyConfig.cjs.map +0 -1
  111. package/dist/actions/package/compile/buildEntries.cjs +0 -68
  112. package/dist/actions/package/compile/buildEntries.cjs.map +0 -1
  113. package/dist/actions/package/compile/compile.cjs +0 -565
  114. package/dist/actions/package/compile/compile.cjs.map +0 -1
  115. package/dist/actions/package/compile/copyTypeFiles.cjs +0 -60
  116. package/dist/actions/package/compile/copyTypeFiles.cjs.map +0 -1
  117. package/dist/actions/package/compile/getCompilerOptions.cjs +0 -67
  118. package/dist/actions/package/compile/getCompilerOptions.cjs.map +0 -1
  119. package/dist/actions/package/compile/index.cjs +0 -571
  120. package/dist/actions/package/compile/index.cjs.map +0 -1
  121. package/dist/actions/package/compile/inputs.cjs +0 -79
  122. package/dist/actions/package/compile/inputs.cjs.map +0 -1
  123. package/dist/actions/package/compile/packageCompileTsc.cjs +0 -164
  124. package/dist/actions/package/compile/packageCompileTsc.cjs.map +0 -1
  125. package/dist/actions/package/compile/packageCompileTscTypes.cjs +0 -199
  126. package/dist/actions/package/compile/packageCompileTscTypes.cjs.map +0 -1
  127. package/dist/actions/package/compile/packageCompileTsup.cjs +0 -521
  128. package/dist/actions/package/compile/packageCompileTsup.cjs.map +0 -1
  129. package/dist/actions/package/copy-assets.cjs +0 -88
  130. package/dist/actions/package/copy-assets.cjs.map +0 -1
  131. package/dist/actions/package/deps.cjs +0 -214
  132. package/dist/actions/package/deps.cjs.map +0 -1
  133. package/dist/actions/package/gen-docs.cjs +0 -148
  134. package/dist/actions/package/gen-docs.cjs.map +0 -1
  135. package/dist/actions/package/index.cjs +0 -968
  136. package/dist/actions/package/index.cjs.map +0 -1
  137. package/dist/actions/package/publint.cjs +0 -80
  138. package/dist/actions/package/publint.cjs.map +0 -1
  139. package/dist/actions/package/recompile.cjs +0 -617
  140. package/dist/actions/package/recompile.cjs.map +0 -1
  141. package/dist/actions/publint.cjs +0 -237
  142. package/dist/actions/publint.cjs.map +0 -1
  143. package/dist/actions/rebuild.cjs +0 -148
  144. package/dist/actions/rebuild.cjs.map +0 -1
  145. package/dist/actions/recompile.cjs +0 -232
  146. package/dist/actions/recompile.cjs.map +0 -1
  147. package/dist/actions/reinstall.cjs +0 -183
  148. package/dist/actions/reinstall.cjs.map +0 -1
  149. package/dist/actions/relint.cjs +0 -185
  150. package/dist/actions/relint.cjs.map +0 -1
  151. package/dist/actions/retest.cjs +0 -154
  152. package/dist/actions/retest.cjs.map +0 -1
  153. package/dist/actions/sonar.cjs +0 -149
  154. package/dist/actions/sonar.cjs.map +0 -1
  155. package/dist/actions/statics.cjs +0 -234
  156. package/dist/actions/statics.cjs.map +0 -1
  157. package/dist/actions/test.cjs +0 -147
  158. package/dist/actions/test.cjs.map +0 -1
  159. package/dist/actions/up.cjs +0 -144
  160. package/dist/actions/up.cjs.map +0 -1
  161. package/dist/actions/updo.cjs +0 -152
  162. package/dist/actions/updo.cjs.map +0 -1
  163. package/dist/actions/upplug.cjs +0 -172
  164. package/dist/actions/upplug.cjs.map +0 -1
  165. package/dist/actions/upyarn.cjs +0 -148
  166. package/dist/actions/upyarn.cjs.map +0 -1
  167. package/dist/actions/yarn3only.cjs +0 -106
  168. package/dist/actions/yarn3only.cjs.map +0 -1
  169. package/dist/bin/build.cjs +0 -39
  170. package/dist/bin/build.cjs.map +0 -1
  171. package/dist/bin/clean.cjs +0 -39
  172. package/dist/bin/clean.cjs.map +0 -1
  173. package/dist/bin/compile-only.cjs +0 -39
  174. package/dist/bin/compile-only.cjs.map +0 -1
  175. package/dist/bin/compile.cjs +0 -39
  176. package/dist/bin/compile.cjs.map +0 -1
  177. package/dist/bin/cycle.cjs +0 -39
  178. package/dist/bin/cycle.cjs.map +0 -1
  179. package/dist/bin/dead.cjs +0 -39
  180. package/dist/bin/dead.cjs.map +0 -1
  181. package/dist/bin/deploy-major.cjs +0 -39
  182. package/dist/bin/deploy-major.cjs.map +0 -1
  183. package/dist/bin/deploy-minor.cjs +0 -39
  184. package/dist/bin/deploy-minor.cjs.map +0 -1
  185. package/dist/bin/deploy-next.cjs +0 -39
  186. package/dist/bin/deploy-next.cjs.map +0 -1
  187. package/dist/bin/deploy.cjs +0 -39
  188. package/dist/bin/deploy.cjs.map +0 -1
  189. package/dist/bin/deps.cjs +0 -39
  190. package/dist/bin/deps.cjs.map +0 -1
  191. package/dist/bin/fix.cjs +0 -39
  192. package/dist/bin/fix.cjs.map +0 -1
  193. package/dist/bin/gen-docs.cjs +0 -39
  194. package/dist/bin/gen-docs.cjs.map +0 -1
  195. package/dist/bin/gitlint-fix.cjs +0 -39
  196. package/dist/bin/gitlint-fix.cjs.map +0 -1
  197. package/dist/bin/gitlint.cjs +0 -39
  198. package/dist/bin/gitlint.cjs.map +0 -1
  199. package/dist/bin/license.cjs +0 -39
  200. package/dist/bin/license.cjs.map +0 -1
  201. package/dist/bin/lint-clean.cjs +0 -39
  202. package/dist/bin/lint-clean.cjs.map +0 -1
  203. package/dist/bin/lint-fast.cjs +0 -39
  204. package/dist/bin/lint-fast.cjs.map +0 -1
  205. package/dist/bin/lint-profile.cjs +0 -39
  206. package/dist/bin/lint-profile.cjs.map +0 -1
  207. package/dist/bin/lint.cjs +0 -39
  208. package/dist/bin/lint.cjs.map +0 -1
  209. package/dist/bin/package/clean-outputs.cjs +0 -51
  210. package/dist/bin/package/clean-outputs.cjs.map +0 -1
  211. package/dist/bin/package/clean-typescript.cjs +0 -51
  212. package/dist/bin/package/clean-typescript.cjs.map +0 -1
  213. package/dist/bin/package/clean.cjs +0 -76
  214. package/dist/bin/package/clean.cjs.map +0 -1
  215. package/dist/bin/package/compile-only.cjs +0 -564
  216. package/dist/bin/package/compile-only.cjs.map +0 -1
  217. package/dist/bin/package/compile-tsup.cjs +0 -519
  218. package/dist/bin/package/compile-tsup.cjs.map +0 -1
  219. package/dist/bin/package/compile.cjs +0 -567
  220. package/dist/bin/package/compile.cjs.map +0 -1
  221. package/dist/bin/package/copy-assets-cjs.cjs +0 -86
  222. package/dist/bin/package/copy-assets-cjs.cjs.map +0 -1
  223. package/dist/bin/package/copy-assets-esm.cjs +0 -86
  224. package/dist/bin/package/copy-assets-esm.cjs.map +0 -1
  225. package/dist/bin/package/deps.cjs +0 -208
  226. package/dist/bin/package/deps.cjs.map +0 -1
  227. package/dist/bin/package/gen-docs.cjs +0 -143
  228. package/dist/bin/package/gen-docs.cjs.map +0 -1
  229. package/dist/bin/package/publint.cjs +0 -77
  230. package/dist/bin/package/publint.cjs.map +0 -1
  231. package/dist/bin/package/recompile.cjs +0 -611
  232. package/dist/bin/package/recompile.cjs.map +0 -1
  233. package/dist/bin/publint.cjs +0 -39
  234. package/dist/bin/publint.cjs.map +0 -1
  235. package/dist/bin/rebuild.cjs +0 -39
  236. package/dist/bin/rebuild.cjs.map +0 -1
  237. package/dist/bin/recompile.cjs +0 -39
  238. package/dist/bin/recompile.cjs.map +0 -1
  239. package/dist/bin/reinstall.cjs +0 -39
  240. package/dist/bin/reinstall.cjs.map +0 -1
  241. package/dist/bin/relint.cjs +0 -39
  242. package/dist/bin/relint.cjs.map +0 -1
  243. package/dist/bin/sonar.cjs +0 -39
  244. package/dist/bin/sonar.cjs.map +0 -1
  245. package/dist/bin/test.cjs +0 -39
  246. package/dist/bin/test.cjs.map +0 -1
  247. package/dist/bin/up.cjs +0 -39
  248. package/dist/bin/up.cjs.map +0 -1
  249. package/dist/bin/updo.cjs +0 -39
  250. package/dist/bin/updo.cjs.map +0 -1
  251. package/dist/bin/upplug.cjs +0 -39
  252. package/dist/bin/upplug.cjs.map +0 -1
  253. package/dist/bin/upyarn.cjs +0 -39
  254. package/dist/bin/upyarn.cjs.map +0 -1
  255. package/dist/bin/xy-ts.cjs +0 -1890
  256. package/dist/bin/xy-ts.cjs.map +0 -1
  257. package/dist/bin/xy.cjs +0 -1890
  258. package/dist/bin/xy.cjs.map +0 -1
  259. package/dist/bin/yarn3only.cjs +0 -39
  260. package/dist/bin/yarn3only.cjs.map +0 -1
  261. package/dist/index.cjs +0 -3129
  262. package/dist/index.cjs.map +0 -1
  263. package/dist/index.d.cts +0 -359
  264. package/dist/lib/checkResult.cjs +0 -52
  265. package/dist/lib/checkResult.cjs.map +0 -1
  266. package/dist/lib/createBuildConfig.cjs +0 -93
  267. package/dist/lib/createBuildConfig.cjs.map +0 -1
  268. package/dist/lib/defaultBuildConfig.cjs +0 -52
  269. package/dist/lib/defaultBuildConfig.cjs.map +0 -1
  270. package/dist/lib/dependencies/DuplicateDetector.cjs +0 -124
  271. package/dist/lib/dependencies/DuplicateDetector.cjs.map +0 -1
  272. package/dist/lib/dependencies/detectDuplicateDependencies.cjs +0 -207
  273. package/dist/lib/dependencies/detectDuplicateDependencies.cjs.map +0 -1
  274. package/dist/lib/dependencies/index.cjs +0 -211
  275. package/dist/lib/dependencies/index.cjs.map +0 -1
  276. package/dist/lib/file/ReadFileSyncOptions.cjs +0 -33
  277. package/dist/lib/file/ReadFileSyncOptions.cjs.map +0 -1
  278. package/dist/lib/file/constants.cjs +0 -34
  279. package/dist/lib/file/constants.cjs.map +0 -1
  280. package/dist/lib/file/fileLines.cjs +0 -58
  281. package/dist/lib/file/fileLines.cjs.map +0 -1
  282. package/dist/lib/file/index.cjs +0 -74
  283. package/dist/lib/file/index.cjs.map +0 -1
  284. package/dist/lib/file/tryReadFileSync.cjs +0 -42
  285. package/dist/lib/file/tryReadFileSync.cjs.map +0 -1
  286. package/dist/lib/generateIgnoreFiles.cjs +0 -132
  287. package/dist/lib/generateIgnoreFiles.cjs.map +0 -1
  288. package/dist/lib/index.cjs +0 -614
  289. package/dist/lib/index.cjs.map +0 -1
  290. package/dist/lib/jsonFormatters.cjs +0 -37
  291. package/dist/lib/jsonFormatters.cjs.map +0 -1
  292. package/dist/lib/loadConfig.cjs +0 -59
  293. package/dist/lib/loadConfig.cjs.map +0 -1
  294. package/dist/lib/parsedPackageJSON.cjs +0 -37
  295. package/dist/lib/parsedPackageJSON.cjs.map +0 -1
  296. package/dist/lib/processEx.cjs +0 -72
  297. package/dist/lib/processEx.cjs.map +0 -1
  298. package/dist/lib/runSteps.cjs +0 -134
  299. package/dist/lib/runSteps.cjs.map +0 -1
  300. package/dist/lib/runStepsAsync.cjs +0 -147
  301. package/dist/lib/runStepsAsync.cjs.map +0 -1
  302. package/dist/lib/runXy.cjs +0 -150
  303. package/dist/lib/runXy.cjs.map +0 -1
  304. package/dist/lib/runXyWithWarning.cjs +0 -49
  305. package/dist/lib/runXyWithWarning.cjs.map +0 -1
  306. package/dist/lib/safeExit.cjs +0 -100
  307. package/dist/lib/safeExit.cjs.map +0 -1
  308. package/dist/lib/string/empty.cjs +0 -35
  309. package/dist/lib/string/empty.cjs.map +0 -1
  310. package/dist/lib/string/index.cjs +0 -45
  311. package/dist/lib/string/index.cjs.map +0 -1
  312. package/dist/lib/string/union.cjs +0 -35
  313. package/dist/lib/string/union.cjs.map +0 -1
  314. package/dist/lib/withErrnoException.cjs +0 -41
  315. package/dist/lib/withErrnoException.cjs.map +0 -1
  316. package/dist/lib/withError.cjs +0 -34
  317. package/dist/lib/withError.cjs.map +0 -1
  318. package/dist/lib/yarn/index.cjs +0 -93
  319. package/dist/lib/yarn/index.cjs.map +0 -1
  320. package/dist/lib/yarn/isYarnVersionOrGreater.cjs +0 -52
  321. package/dist/lib/yarn/isYarnVersionOrGreater.cjs.map +0 -1
  322. package/dist/lib/yarn/workspace/Workspace.cjs +0 -19
  323. package/dist/lib/yarn/workspace/Workspace.cjs.map +0 -1
  324. package/dist/lib/yarn/workspace/index.cjs +0 -60
  325. package/dist/lib/yarn/workspace/index.cjs.map +0 -1
  326. package/dist/lib/yarn/workspace/yarnWorkspace.cjs +0 -58
  327. package/dist/lib/yarn/workspace/yarnWorkspace.cjs.map +0 -1
  328. package/dist/lib/yarn/workspace/yarnWorkspaces.cjs +0 -49
  329. package/dist/lib/yarn/workspace/yarnWorkspaces.cjs.map +0 -1
  330. package/dist/lib/yarn/yarnInitCwd.cjs +0 -35
  331. package/dist/lib/yarn/yarnInitCwd.cjs.map +0 -1
  332. package/dist/loadPackageConfig.cjs +0 -39
  333. package/dist/loadPackageConfig.cjs.map +0 -1
  334. package/dist/types.d.cjs +0 -2
  335. package/dist/types.d.cjs.map +0 -1
  336. package/dist/xy/index.cjs +0 -1909
  337. package/dist/xy/index.cjs.map +0 -1
  338. package/dist/xy/param.cjs +0 -36
  339. package/dist/xy/param.cjs.map +0 -1
  340. package/dist/xy/xy.cjs +0 -1895
  341. package/dist/xy/xy.cjs.map +0 -1
  342. package/dist/xy/xyBuildCommands.cjs +0 -595
  343. package/dist/xy/xyBuildCommands.cjs.map +0 -1
  344. package/dist/xy/xyCommonCommands.cjs +0 -723
  345. package/dist/xy/xyCommonCommands.cjs.map +0 -1
  346. package/dist/xy/xyDeployCommands.cjs +0 -263
  347. package/dist/xy/xyDeployCommands.cjs.map +0 -1
  348. package/dist/xy/xyInstallCommands.cjs +0 -508
  349. package/dist/xy/xyInstallCommands.cjs.map +0 -1
  350. package/dist/xy/xyLintCommands.cjs +0 -466
  351. package/dist/xy/xyLintCommands.cjs.map +0 -1
  352. package/dist/xy/xyParseOptions.cjs +0 -84
  353. package/dist/xy/xyParseOptions.cjs.map +0 -1
package/dist/xy/index.cjs DELETED
@@ -1,1909 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
9
- var __export = (target, all) => {
10
- for (var name in all)
11
- __defProp(target, name, { get: all[name], enumerable: true });
12
- };
13
- var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from))
16
- if (!__hasOwnProp.call(to, key) && key !== except)
17
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
- }
19
- return to;
20
- };
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
- mod
28
- ));
29
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
-
31
- // src/xy/index.ts
32
- var xy_exports = {};
33
- __export(xy_exports, {
34
- xy: () => xy,
35
- xyBuildCommands: () => xyBuildCommands,
36
- xyCommonCommands: () => xyCommonCommands,
37
- xyDeployCommands: () => xyDeployCommands,
38
- xyInstallCommands: () => xyInstallCommands,
39
- xyLintCommands: () => xyLintCommands,
40
- xyParseOptions: () => xyParseOptions
41
- });
42
- module.exports = __toCommonJS(xy_exports);
43
-
44
- // src/xy/xy.ts
45
- var import_chalk20 = __toESM(require("chalk"), 1);
46
-
47
- // src/actions/build.ts
48
- var import_chalk7 = __toESM(require("chalk"), 1);
49
-
50
- // src/lib/checkResult.ts
51
- var import_chalk = __toESM(require("chalk"), 1);
52
- var checkResult = /* @__PURE__ */ __name((name, result, level = "error", exitOnFail = false) => {
53
- if (result) {
54
- const exiting = exitOnFail ? "[Exiting Process]" : "[Continuing]";
55
- const chalkFunc = level === "error" ? import_chalk.default.red : import_chalk.default.yellow;
56
- console[level](chalkFunc(`${name} had ${result} failures ${exiting}`));
57
- if (exitOnFail) {
58
- process.exit(result);
59
- }
60
- }
61
- }, "checkResult");
62
-
63
- // src/lib/dependencies/detectDuplicateDependencies.ts
64
- var import_node_child_process = require("child_process");
65
-
66
- // src/lib/processEx.ts
67
- var import_chalk2 = __toESM(require("chalk"), 1);
68
-
69
- // src/lib/withError.ts
70
- var withError = /* @__PURE__ */ __name((ex, closure, predicate = (ex2) => ex2.name !== void 0 && ex2.message !== void 0) => {
71
- return predicate(ex) ? closure(ex) : void 0;
72
- }, "withError");
73
-
74
- // src/lib/withErrnoException.ts
75
- var withErrnoException = /* @__PURE__ */ __name((ex, closure) => {
76
- return withError(ex, closure, (ex2) => ex2.errno !== void 0);
77
- }, "withErrnoException");
78
-
79
- // src/lib/processEx.ts
80
- var processEx = /* @__PURE__ */ __name((ex) => {
81
- const error = typeof ex === "string" ? new Error(ex) : ex;
82
- const exitCode = withErrnoException(error, (error2) => {
83
- if (error2.code === "ENOENT") {
84
- console.error(import_chalk2.default.red(`'${error2.path}' not found.`));
85
- } else {
86
- console.error(import_chalk2.default.red(`Errno: ${error2.code}`));
87
- }
88
- return error2.errno ?? -1;
89
- }) ?? withError(error, (error2) => {
90
- console.error(import_chalk2.default.red(`${error2.name}: ${error2.message}`));
91
- return -1;
92
- }) ?? (() => {
93
- console.error(import_chalk2.default.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`));
94
- return -1;
95
- })();
96
- process.exit(process.exitCode ?? exitCode);
97
- }, "processEx");
98
-
99
- // src/lib/safeExit.ts
100
- var safeExit = /* @__PURE__ */ __name((func, exitOnFail = true) => {
101
- try {
102
- const result = func();
103
- if (result && exitOnFail) {
104
- process.exit(result);
105
- }
106
- return result;
107
- } catch (ex) {
108
- return processEx(ex);
109
- }
110
- }, "safeExit");
111
- var safeExitAsync = /* @__PURE__ */ __name(async (func, exitOnFail = true) => {
112
- try {
113
- const result = await func();
114
- if (result && exitOnFail) {
115
- process.exit(result);
116
- }
117
- return result;
118
- } catch (ex) {
119
- return processEx(ex);
120
- }
121
- }, "safeExitAsync");
122
-
123
- // src/lib/dependencies/DuplicateDetector.ts
124
- var import_node_os = require("os");
125
- var import_chalk3 = __toESM(require("chalk"), 1);
126
- var import_uniq = __toESM(require("lodash/uniq.js"), 1);
127
-
128
- // src/lib/jsonFormatters.ts
129
- var multiLineToJSONArray = /* @__PURE__ */ __name((output) => {
130
- const withCommas = output.replaceAll("\r\n", "").replaceAll("\n", ",");
131
- const cleanCollection = withCommas.slice(0, Math.max(0, withCommas.length - 1));
132
- const collection = `[${cleanCollection}]`;
133
- return JSON.parse(collection);
134
- }, "multiLineToJSONArray");
135
-
136
- // src/lib/dependencies/DuplicateDetector.ts
137
- var trimVirtualMeta = /* @__PURE__ */ __name((value) => {
138
- const virtualParts = value.split("virtual:");
139
- if (virtualParts.length > 1) {
140
- const hashParts = virtualParts[1].split("#");
141
- return virtualParts[0] + hashParts[1];
142
- } else {
143
- return value;
144
- }
145
- }, "trimVirtualMeta");
146
- var trimObjectDependencyVirtualMeta = /* @__PURE__ */ __name((obj) => {
147
- const resultObj = {};
148
- for (const [key, value] of Object.entries(obj)) {
149
- resultObj[trimVirtualMeta(key)] = {
150
- descriptor: trimVirtualMeta(value.descriptor),
151
- locator: trimVirtualMeta(value.locator)
152
- };
153
- }
154
- return resultObj;
155
- }, "trimObjectDependencyVirtualMeta");
156
- var trimDependencyVirtualMeta = /* @__PURE__ */ __name((dependencies) => {
157
- return dependencies.map((dependency) => {
158
- return {
159
- children: trimObjectDependencyVirtualMeta(dependency.children),
160
- value: trimVirtualMeta(dependency.value)
161
- };
162
- });
163
- }, "trimDependencyVirtualMeta");
164
- var DuplicateDetector = class {
165
- static {
166
- __name(this, "DuplicateDetector");
167
- }
168
- dependency;
169
- dependencyEntries;
170
- constructor(output, dependency) {
171
- this.dependency = dependency;
172
- this.dependencyEntries = trimDependencyVirtualMeta(multiLineToJSONArray(output));
173
- }
174
- detect() {
175
- const result = this.dependencyEntries.reduce(this.detectReducer, this.resultsFactory(this.dependency));
176
- if (result.duplicateVersions.length > 0) {
177
- console.log(import_chalk3.default.yellow(`${import_node_os.EOL}Duplicates found for: ${this.dependency}`));
178
- const duplicateVersions = result.duplicateVersions.toString().replaceAll(",", `${import_node_os.EOL} `);
179
- console.log(import_chalk3.default.grey(` ${duplicateVersions}`, import_node_os.EOL));
180
- return 1;
181
- } else {
182
- console.log(`${this.dependency} - OK`);
183
- return 0;
184
- }
185
- }
186
- detectReducer(acc, entry) {
187
- const version = Object.entries(entry.children).map(([k]) => k)[0];
188
- if (!acc.currentVersion) {
189
- acc.currentVersion = version;
190
- return acc;
191
- }
192
- if (acc.currentVersion && acc.currentVersion !== version && !version.includes("@virtual:")) {
193
- if (acc.duplicateVersions.length === 0) {
194
- acc.duplicateVersions.push(acc.currentVersion);
195
- }
196
- acc.duplicateVersions.push(version);
197
- acc.duplicateVersions = (0, import_uniq.default)(acc.duplicateVersions);
198
- }
199
- return acc;
200
- }
201
- resultsFactory = /* @__PURE__ */ __name((dependency) => ({
202
- currentVersion: void 0,
203
- dependency,
204
- duplicateVersions: []
205
- }), "resultsFactory");
206
- };
207
-
208
- // src/lib/dependencies/detectDuplicateDependencies.ts
209
- var detectDuplicateDependencies = /* @__PURE__ */ __name((depsFromPackageJSON, DefaultDependencies2) => {
210
- let exitCode = 0;
211
- const dependencies = depsFromPackageJSON?.length ? depsFromPackageJSON : DefaultDependencies2;
212
- return safeExit(() => {
213
- if (dependencies) {
214
- for (const dependency of dependencies) {
215
- let output;
216
- try {
217
- const cmd = `yarn why ${dependency} --json`;
218
- output = (0, import_node_child_process.execSync)(cmd).toString();
219
- } catch (e) {
220
- console.error(`Error running yarn why: ${e}`);
221
- exitCode = 1;
222
- continue;
223
- }
224
- if (output) {
225
- exitCode = new DuplicateDetector(output, dependency).detect();
226
- } else {
227
- console.log(`${dependency} - N/A`);
228
- if (depsFromPackageJSON) {
229
- exitCode = 1;
230
- console.log(`\u{1F6A8} Library ${dependency} was requested in package.json but not found`);
231
- }
232
- }
233
- }
234
- return exitCode;
235
- } else {
236
- console.log("\u{1F6A8} No dependencies where passed");
237
- return exitCode;
238
- }
239
- });
240
- }, "detectDuplicateDependencies");
241
-
242
- // src/lib/file/constants.ts
243
- var WINDOWS_NEWLINE_REGEX = /\r\n/g;
244
- var CROSS_PLATFORM_NEWLINE = "\n";
245
-
246
- // src/lib/file/fileLines.ts
247
- var import_node_fs = require("fs");
248
-
249
- // src/lib/string/empty.ts
250
- var empty = /* @__PURE__ */ __name((value) => value?.trim().length === 0, "empty");
251
- var notEmpty = /* @__PURE__ */ __name((value) => !empty(value), "notEmpty");
252
-
253
- // src/lib/string/union.ts
254
- var union = /* @__PURE__ */ __name((a, b) => /* @__PURE__ */ new Set([
255
- ...new Set(a),
256
- ...new Set(b)
257
- ]), "union");
258
-
259
- // src/lib/file/ReadFileSyncOptions.ts
260
- var defaultReadFileSyncOptions = {
261
- encoding: "utf8"
262
- };
263
-
264
- // src/lib/file/fileLines.ts
265
- var readLines = /* @__PURE__ */ __name((uri, options = defaultReadFileSyncOptions) => (0, import_node_fs.existsSync)(uri) ? (0, import_node_fs.readFileSync)(uri, options).replace(WINDOWS_NEWLINE_REGEX, CROSS_PLATFORM_NEWLINE).split(CROSS_PLATFORM_NEWLINE) : [], "readLines");
266
- var readNonEmptyLines = /* @__PURE__ */ __name((uri, options = defaultReadFileSyncOptions) => readLines(uri, options).filter(notEmpty), "readNonEmptyLines");
267
- var writeLines = /* @__PURE__ */ __name((uri, lines, options = defaultReadFileSyncOptions) => {
268
- const existing = (0, import_node_fs.existsSync)(uri) ? (0, import_node_fs.readFileSync)(uri, options) : void 0;
269
- const desired = lines.join(CROSS_PLATFORM_NEWLINE);
270
- if (existing !== desired) (0, import_node_fs.writeFileSync)(uri, desired, options);
271
- }, "writeLines");
272
-
273
- // src/lib/generateIgnoreFiles.ts
274
- var import_chalk4 = __toESM(require("chalk"), 1);
275
-
276
- // src/lib/yarn/isYarnVersionOrGreater.ts
277
- var import_node_child_process2 = require("child_process");
278
- var isYarnVersionOrGreater = /* @__PURE__ */ __name((major, minor, patch) => {
279
- const result = (0, import_node_child_process2.spawnSync)("yarn", [
280
- "-v"
281
- ], {
282
- encoding: "utf8",
283
- shell: true
284
- });
285
- const version = result.stdout.toString().replaceAll("\n", "");
286
- const versionNumbers = version.split(".").map((ver) => Number.parseInt(ver));
287
- const majorDelta = versionNumbers[0] - major;
288
- const minorDelta = versionNumbers[1] - (minor ?? versionNumbers[1]);
289
- const patchDelta = versionNumbers[2] - (patch ?? versionNumbers[2]);
290
- const majorOk = majorDelta >= 0;
291
- const minorOk = majorDelta > 0 || minorDelta >= 0;
292
- const patchOk = majorDelta > 0 || minorDelta > 0 || patchDelta >= 0;
293
- return [
294
- majorOk && minorOk && patchOk,
295
- version
296
- ];
297
- }, "isYarnVersionOrGreater");
298
-
299
- // src/lib/yarn/workspace/yarnWorkspaces.ts
300
- var import_node_child_process3 = require("child_process");
301
- var yarnWorkspaces = /* @__PURE__ */ __name(() => {
302
- const result = (0, import_node_child_process3.spawnSync)("yarn", [
303
- "workspaces",
304
- "list",
305
- "--json",
306
- "--recursive"
307
- ], {
308
- encoding: "utf8",
309
- shell: true
310
- });
311
- if (result.error) {
312
- throw result.error;
313
- }
314
- return result.stdout.toString().split("\n").slice(0, -1).map((item) => {
315
- return JSON.parse(item);
316
- });
317
- }, "yarnWorkspaces");
318
-
319
- // src/lib/yarn/workspace/yarnWorkspace.ts
320
- var yarnWorkspace = /* @__PURE__ */ __name((pkg) => {
321
- const workspace = yarnWorkspaces().find(({ name }) => name === pkg);
322
- if (!workspace) throw new Error(`Workspace ${pkg} not found`);
323
- return workspace;
324
- }, "yarnWorkspace");
325
-
326
- // src/lib/yarn/yarnInitCwd.ts
327
- var INIT_CWD = /* @__PURE__ */ __name(() => {
328
- if (!process.env.INIT_CWD) console.error("Missing INIT_CWD");
329
- return process.env.INIT_CWD;
330
- }, "INIT_CWD");
331
-
332
- // src/lib/generateIgnoreFiles.ts
333
- var mergeEntries = /* @__PURE__ */ __name((a, b) => [
334
- ...union(a, b)
335
- ].sort(), "mergeEntries");
336
- var generateIgnoreFiles = /* @__PURE__ */ __name((filename3, pkg) => {
337
- console.log(import_chalk4.default.green(`Generate ${filename3} Files`));
338
- const cwd = INIT_CWD() ?? ".";
339
- const workspaces = pkg ? [
340
- yarnWorkspace(pkg)
341
- ] : yarnWorkspaces();
342
- const readEntries = /* @__PURE__ */ __name((location) => readNonEmptyLines(`${location}/${filename3}`), "readEntries");
343
- const writeEntries = /* @__PURE__ */ __name((location, entries) => writeLines(`${location}/${filename3}`, entries), "writeEntries");
344
- const results = workspaces.map(({ location, name }) => {
345
- try {
346
- writeEntries(location, mergeEntries(readEntries(cwd), readEntries(location)));
347
- return 0;
348
- } catch (ex) {
349
- const error = ex;
350
- console.error(`Generate ${filename3} Files [${name}] [${error.message}]`);
351
- return 1;
352
- }
353
- });
354
- const succeeded = results.every((result) => result === 0);
355
- return succeeded ? 0 : 1;
356
- }, "generateIgnoreFiles");
357
-
358
- // src/lib/parsedPackageJSON.ts
359
- var import_node_fs2 = require("fs");
360
- var parsedPackageJSON = /* @__PURE__ */ __name((path3) => {
361
- const pathToPackageJSON = path3 ?? process.env.npm_package_json ?? "";
362
- const packageJSON = (0, import_node_fs2.readFileSync)(pathToPackageJSON).toString();
363
- return JSON.parse(packageJSON);
364
- }, "parsedPackageJSON");
365
-
366
- // src/lib/runSteps.ts
367
- var import_node_child_process4 = require("child_process");
368
- var import_node_fs3 = require("fs");
369
- var import_chalk5 = __toESM(require("chalk"), 1);
370
- var runSteps = /* @__PURE__ */ __name((name, steps, exitOnFail = true, messages) => {
371
- return safeExit(() => {
372
- const pkgName = process.env.npm_package_name;
373
- console.log(import_chalk5.default.green(`${name} [${pkgName}]`));
374
- let totalStatus = 0;
375
- for (const [i, [command, args, config]] of steps.entries()) {
376
- if (messages?.[i]) {
377
- console.log(import_chalk5.default.gray(messages?.[i]));
378
- }
379
- const argList = Array.isArray(args) ? args : args.split(" ");
380
- if (command === "node" && !(0, import_node_fs3.existsSync)(argList[0])) {
381
- throw new Error(`File not found [${argList[0]}]`);
382
- }
383
- const status = (0, import_node_child_process4.spawnSync)(command, Array.isArray(args) ? args : args.split(" "), {
384
- ...config,
385
- encoding: "utf8",
386
- env: {
387
- FORCE_COLOR: "3",
388
- ...process.env
389
- },
390
- shell: true,
391
- stdio: "inherit"
392
- }).status ?? 0;
393
- checkResult(name, status, "error", exitOnFail);
394
- totalStatus += status ?? 0;
395
- }
396
- return totalStatus;
397
- }, !!exitOnFail);
398
- }, "runSteps");
399
-
400
- // src/lib/runStepsAsync.ts
401
- var import_node_child_process5 = require("child_process");
402
- var import_node_fs4 = require("fs");
403
- var import_chalk6 = __toESM(require("chalk"), 1);
404
- var runStepAsync = /* @__PURE__ */ __name((name, step, exitOnFail = true, message) => {
405
- return new Promise((resolve) => {
406
- const [command, args, config] = step;
407
- if (message) {
408
- console.log(import_chalk6.default.gray(message));
409
- }
410
- const argList = Array.isArray(args) ? args : args.split(" ");
411
- if (command === "node" && !(0, import_node_fs4.existsSync)(argList[0])) {
412
- throw new Error(`File not found [${argList[0]}]`);
413
- }
414
- (0, import_node_child_process5.spawn)(command, Array.isArray(args) ? args : args.split(" "), {
415
- ...config,
416
- env: {
417
- FORCE_COLOR: "3",
418
- ...process.env
419
- },
420
- shell: true,
421
- stdio: "inherit"
422
- }).on("close", (code) => {
423
- if (code) {
424
- console.error(import_chalk6.default.red(`Command Exited With Non-Zero Result [${import_chalk6.default.gray(code)}] | ${import_chalk6.default.yellow(command)} ${import_chalk6.default.white(Array.isArray(args) ? args.join(" ") : args)}`));
425
- checkResult(name, code, "error", exitOnFail);
426
- resolve(code);
427
- } else {
428
- resolve(0);
429
- }
430
- });
431
- });
432
- }, "runStepAsync");
433
- var runStepsAsync = /* @__PURE__ */ __name(async (name, steps, exitOnFail = true, messages) => {
434
- return await safeExitAsync(async () => {
435
- const pkgName = process.env.npm_package_name;
436
- console.log(import_chalk6.default.green(`${name} [${pkgName}]`));
437
- let result = 0;
438
- for (const [i, step] of steps.entries()) {
439
- result += await runStepAsync(name, step, exitOnFail, messages?.[i]);
440
- }
441
- return result;
442
- });
443
- }, "runStepsAsync");
444
-
445
- // src/actions/build.ts
446
- var build = /* @__PURE__ */ __name(async ({ incremental, jobs, target, verbose, pkg }) => {
447
- const start = Date.now();
448
- const pkgOptions = pkg ? [
449
- pkg
450
- ] : [];
451
- const incrementalOptions = incremental ? [
452
- "-i"
453
- ] : [];
454
- const verboseOptions = verbose ? [
455
- "-v"
456
- ] : [];
457
- const targetOptions = target ? [
458
- "-t",
459
- target
460
- ] : [];
461
- const jobsOptions = jobs ? [
462
- "-j",
463
- `${jobs}`
464
- ] : [];
465
- if (jobs) {
466
- console.log(import_chalk7.default.blue(`Jobs set to [${jobs}]`));
467
- }
468
- const result = await runStepsAsync(`Build${incremental ? "-Incremental" : ""} [${pkg ?? "All"}]`, [
469
- [
470
- "yarn",
471
- [
472
- "xy",
473
- "compile",
474
- ...pkgOptions,
475
- ...targetOptions,
476
- ...verboseOptions,
477
- ...jobsOptions,
478
- ...incrementalOptions
479
- ]
480
- ],
481
- [
482
- "yarn",
483
- [
484
- "xy",
485
- "lint",
486
- ...pkgOptions,
487
- ...verboseOptions,
488
- ...incrementalOptions
489
- ]
490
- ],
491
- [
492
- "yarn",
493
- [
494
- "xy",
495
- "deps",
496
- ...pkgOptions,
497
- ...verboseOptions,
498
- ...jobsOptions,
499
- ...incrementalOptions
500
- ]
501
- ]
502
- ]);
503
- console.log(`${import_chalk7.default.gray("Built in")} [${import_chalk7.default.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${import_chalk7.default.gray("seconds")}`);
504
- return result;
505
- }, "build");
506
-
507
- // src/actions/clean.ts
508
- var clean = /* @__PURE__ */ __name(async ({ verbose, pkg }) => {
509
- return pkg ? await cleanPackage({
510
- pkg,
511
- verbose
512
- }) : cleanAll({
513
- verbose
514
- });
515
- }, "clean");
516
- var cleanPackage = /* @__PURE__ */ __name(({ pkg }) => {
517
- return runStepsAsync(`Clean [${pkg}]`, [
518
- [
519
- "yarn",
520
- [
521
- "workspace",
522
- pkg,
523
- "run",
524
- "package-clean"
525
- ]
526
- ]
527
- ]);
528
- }, "cleanPackage");
529
- var cleanAll = /* @__PURE__ */ __name(({ verbose }) => {
530
- const verboseOptions = verbose ? [
531
- "--verbose"
532
- ] : [
533
- "--no-verbose"
534
- ];
535
- return runStepsAsync("Clean", [
536
- [
537
- "yarn",
538
- [
539
- "workspaces foreach",
540
- "-pA",
541
- "--jobs 64",
542
- ...verboseOptions,
543
- "run",
544
- "package-clean"
545
- ]
546
- ]
547
- ]);
548
- }, "cleanAll");
549
-
550
- // src/actions/clean-docs.ts
551
- var import_node_path = __toESM(require("path"), 1);
552
- var import_chalk8 = __toESM(require("chalk"), 1);
553
- var import_rimraf = require("rimraf");
554
- var cleanDocs = /* @__PURE__ */ __name(() => {
555
- const pkgName = process.env.npm_package_name;
556
- console.log(import_chalk8.default.green(`Cleaning Docs [${pkgName}]`));
557
- for (const { location } of yarnWorkspaces()) (0, import_rimraf.rimrafSync)(import_node_path.default.join(location, "docs"), {
558
- glob: true
559
- });
560
- return 0;
561
- }, "cleanDocs");
562
-
563
- // src/actions/compile.ts
564
- var import_chalk9 = __toESM(require("chalk"), 1);
565
- var compile = /* @__PURE__ */ __name(({ verbose, target, pkg, incremental, publint: publint2 }) => {
566
- return pkg ? compilePackage({
567
- pkg,
568
- publint: publint2,
569
- target,
570
- verbose
571
- }) : compileAll({
572
- incremental,
573
- publint: publint2,
574
- target,
575
- verbose
576
- });
577
- }, "compile");
578
- var compilePackage = /* @__PURE__ */ __name(({ target, pkg }) => {
579
- const targetOptions = target ? [
580
- "-t",
581
- target
582
- ] : [];
583
- return runSteps(`Compile [${pkg}]`, [
584
- [
585
- "yarn",
586
- [
587
- "workspace",
588
- pkg,
589
- "run",
590
- "package-compile",
591
- ...targetOptions
592
- ]
593
- ]
594
- ]);
595
- }, "compilePackage");
596
- var compileAll = /* @__PURE__ */ __name(({ jobs, verbose, target, incremental }) => {
597
- const start = Date.now();
598
- const verboseOptions = verbose ? [
599
- "--verbose"
600
- ] : [
601
- "--no-verbose"
602
- ];
603
- const targetOptions = target ? [
604
- "-t",
605
- target
606
- ] : [];
607
- const incrementalOptions = incremental ? [
608
- "--since",
609
- "-Apt",
610
- "--topological-dev"
611
- ] : [
612
- "--parallel",
613
- "-Apt",
614
- "--topological-dev"
615
- ];
616
- const jobsOptions = jobs ? [
617
- "-j",
618
- `${jobs}`
619
- ] : [];
620
- if (jobs) {
621
- console.log(import_chalk9.default.blue(`Jobs set to [${jobs}]`));
622
- }
623
- const result = runSteps(`Compile${incremental ? "-Incremental" : ""} [All]`, [
624
- [
625
- "yarn",
626
- [
627
- "workspaces",
628
- "foreach",
629
- ...incrementalOptions,
630
- ...jobsOptions,
631
- ...verboseOptions,
632
- "run",
633
- "package-compile",
634
- ...targetOptions
635
- ]
636
- ]
637
- ]);
638
- console.log(`${import_chalk9.default.gray("Compiled in")} [${import_chalk9.default.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${import_chalk9.default.gray("seconds")}`);
639
- return result;
640
- }, "compileAll");
641
-
642
- // src/actions/copy-assets.ts
643
- var import_posix = __toESM(require("path/posix"), 1);
644
- var import_chalk10 = __toESM(require("chalk"), 1);
645
- var import_cpy = __toESM(require("cpy"), 1);
646
- var copyPackageTargetAssets = /* @__PURE__ */ __name(async (target, name, location) => {
647
- try {
648
- const values = await (0, import_cpy.default)([
649
- "**/*.jpg",
650
- "**/*.png",
651
- "**/*.gif",
652
- "**/*.svg",
653
- "**/*.webp",
654
- "**/*.sass",
655
- "**/*.scss",
656
- "**/*.gif",
657
- "**/*.css"
658
- ], `../dist/${target}`, {
659
- cwd: import_posix.default.join(process.cwd(), location, "src"),
660
- flat: false
661
- });
662
- for (const value of values) {
663
- console.log(`${value.split("/").pop()} => ./dist/${target}`);
664
- }
665
- return 0;
666
- } catch (reason) {
667
- console.log(`Copy Failed: ${name}: ${reason}`);
668
- return 1;
669
- }
670
- }, "copyPackageTargetAssets");
671
- var copyTargetAssets = /* @__PURE__ */ __name(async (target, pkg) => {
672
- const workspaces = yarnWorkspaces();
673
- console.log(import_chalk10.default.green(`Copying Assets [${target.toUpperCase()}]`));
674
- const workspaceList = workspaces.filter(({ name }) => {
675
- return pkg === void 0 || name === pkg;
676
- });
677
- if (workspaceList.length === 0) {
678
- console.error(`Package not found [${pkg}]`);
679
- } else {
680
- const results = await Promise.all(workspaceList.map(async (workspace) => {
681
- const { location, name } = workspace;
682
- return await copyPackageTargetAssets(target, name, location);
683
- }));
684
- return results.reduce((prev, result) => prev || result, 0);
685
- }
686
- return 0;
687
- }, "copyTargetAssets");
688
- var copyAssets = /* @__PURE__ */ __name(async ({ target, pkg }) => {
689
- switch (target) {
690
- case "esm": {
691
- return await copyTargetAssets("esm", pkg);
692
- }
693
- case "cjs": {
694
- return await copyTargetAssets("cjs", pkg);
695
- }
696
- default: {
697
- return await copyTargetAssets("esm", pkg) || await copyTargetAssets("cjs", pkg);
698
- }
699
- }
700
- }, "copyAssets");
701
-
702
- // src/actions/cycle.ts
703
- var cycle = /* @__PURE__ */ __name(() => {
704
- const rules = [
705
- `"'import/no-cycle': [1, { maxDepth: 6 }]"`,
706
- `"'import/no-internal-modules': ['off']"`
707
- ];
708
- return runSteps("Cycle", [
709
- [
710
- "yarn",
711
- [
712
- "eslint",
713
- ...rules.flatMap((rule) => [
714
- "--rule",
715
- rule
716
- ]),
717
- "--cache",
718
- "."
719
- ]
720
- ]
721
- ]);
722
- }, "cycle");
723
-
724
- // src/actions/dead.ts
725
- var dead = /* @__PURE__ */ __name(() => {
726
- return runSteps("Dead", [
727
- [
728
- "yarn",
729
- [
730
- "ts-prune",
731
- "-p",
732
- "tsconfig.json"
733
- ]
734
- ]
735
- ]);
736
- }, "dead");
737
-
738
- // src/actions/deploy.ts
739
- var deploy = /* @__PURE__ */ __name(() => {
740
- return runSteps("Deploy [Patch]", [
741
- [
742
- "yarn",
743
- "workspaces foreach --all version patch --deferred"
744
- ],
745
- [
746
- "yarn",
747
- "xy clean"
748
- ],
749
- [
750
- "yarn",
751
- "xy build"
752
- ],
753
- [
754
- "yarn",
755
- "version apply --all"
756
- ],
757
- [
758
- "yarn",
759
- "workspaces foreach --all --parallel npm publish"
760
- ]
761
- ]);
762
- }, "deploy");
763
-
764
- // src/actions/deploy-major.ts
765
- var deployMajor = /* @__PURE__ */ __name(() => {
766
- return runSteps("Deploy [Major]", [
767
- [
768
- "yarn",
769
- "workspaces foreach --all version major --deferred"
770
- ],
771
- [
772
- "yarn",
773
- "xy clean"
774
- ],
775
- [
776
- "yarn",
777
- "xy build"
778
- ],
779
- [
780
- "yarn",
781
- "version apply --all"
782
- ],
783
- [
784
- "yarn",
785
- "workspaces foreach --all --parallel npm publish"
786
- ]
787
- ]);
788
- }, "deployMajor");
789
-
790
- // src/actions/deploy-minor.ts
791
- var deployMinor = /* @__PURE__ */ __name(() => {
792
- return runSteps("Deploy [Minor]", [
793
- [
794
- "yarn",
795
- "workspaces foreach --all version minor --deferred"
796
- ],
797
- [
798
- "yarn",
799
- "xy clean"
800
- ],
801
- [
802
- "yarn",
803
- "xy build"
804
- ],
805
- [
806
- "yarn",
807
- "version apply --all"
808
- ],
809
- [
810
- "yarn",
811
- "workspaces foreach --all --parallel npm publish"
812
- ]
813
- ]);
814
- }, "deployMinor");
815
-
816
- // src/actions/deploy-next.ts
817
- var deployNext = /* @__PURE__ */ __name(() => {
818
- return runSteps("Deploy [Next]", [
819
- [
820
- "yarn",
821
- "workspaces foreach --all version minor --deferred"
822
- ],
823
- [
824
- "yarn",
825
- "xy clean"
826
- ],
827
- [
828
- "yarn",
829
- "xy build"
830
- ],
831
- [
832
- "yarn",
833
- "version apply --all --prerelease"
834
- ],
835
- [
836
- "yarn",
837
- "workspaces foreach --all --parallel npm publish --tag next"
838
- ]
839
- ]);
840
- }, "deployNext");
841
-
842
- // src/actions/deps.ts
843
- var import_chalk11 = __toESM(require("chalk"), 1);
844
- var deps = /* @__PURE__ */ __name(({ pkg, incremental }) => {
845
- pkg ? depsPackage({
846
- pkg
847
- }) : depsAll({
848
- incremental
849
- });
850
- return 0;
851
- }, "deps");
852
- var depsPackage = /* @__PURE__ */ __name(({ pkg }) => {
853
- const steps = [
854
- [
855
- "yarn",
856
- [
857
- "workspace",
858
- pkg,
859
- "run",
860
- "package-deps"
861
- ]
862
- ]
863
- ];
864
- return runSteps(`Deps [${pkg}]`, [
865
- ...steps
866
- ]);
867
- }, "depsPackage");
868
- var depsAll = /* @__PURE__ */ __name(({ incremental, jobs, verbose }) => {
869
- const start = Date.now();
870
- const jobsOptions = jobs ? [
871
- "-j",
872
- `${jobs}`
873
- ] : [];
874
- const verboseOptions = verbose ? [
875
- "--verbose"
876
- ] : [
877
- "--no-verbose"
878
- ];
879
- if (jobs) {
880
- console.log(import_chalk11.default.blue(`Jobs set to [${jobs}]`));
881
- }
882
- const incrementalOptions = incremental ? [
883
- "--since",
884
- "-pA"
885
- ] : [
886
- "-pA"
887
- ];
888
- const steps = [
889
- [
890
- "yarn",
891
- [
892
- "workspaces",
893
- "foreach",
894
- ...jobsOptions,
895
- ...incrementalOptions,
896
- ...verboseOptions,
897
- "run",
898
- "package-deps"
899
- ]
900
- ]
901
- ];
902
- const result = runSteps(`Deps${incremental ? "-Incremental" : ""} [All]`, [
903
- ...steps
904
- ]);
905
- console.log(`${import_chalk11.default.gray("Dep checked in")} [${import_chalk11.default.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${import_chalk11.default.gray("seconds")}`);
906
- return result;
907
- }, "depsAll");
908
-
909
- // src/actions/dupdeps.ts
910
- var import_chalk12 = __toESM(require("chalk"), 1);
911
- var dupdeps = /* @__PURE__ */ __name(() => {
912
- console.log(import_chalk12.default.green("Checking all Dependencies for Duplicates"));
913
- const allDependencies = parsedPackageJSON()?.dependencies;
914
- const dependencies = Object.entries(allDependencies).map(([k]) => k);
915
- return detectDuplicateDependencies(dependencies);
916
- }, "dupdeps");
917
-
918
- // src/actions/fix.ts
919
- var fix = /* @__PURE__ */ __name(() => {
920
- return runSteps("Fix", [
921
- [
922
- "yarn",
923
- [
924
- "eslint",
925
- ".",
926
- "--fix",
927
- "--cache"
928
- ]
929
- ]
930
- ]);
931
- }, "fix");
932
-
933
- // src/actions/gen-docs.ts
934
- var genDocs = /* @__PURE__ */ __name(({ pkg, incremental }) => {
935
- return pkg ? genDocsPackage({
936
- pkg
937
- }) : genDocsAll({
938
- incremental
939
- });
940
- }, "genDocs");
941
- var genDocsPackage = /* @__PURE__ */ __name(({ pkg }) => {
942
- const steps = [
943
- [
944
- "yarn",
945
- [
946
- "workspace",
947
- pkg,
948
- "run",
949
- "package-gen-docs"
950
- ]
951
- ]
952
- ];
953
- return runSteps(`GenDocs [${pkg}]`, [
954
- ...steps
955
- ]);
956
- }, "genDocsPackage");
957
- var genDocsAll = /* @__PURE__ */ __name(({ incremental }) => {
958
- const incrementalOptions = incremental ? [
959
- "--since",
960
- "-pA"
961
- ] : [
962
- "-pA"
963
- ];
964
- const steps = [
965
- [
966
- "yarn",
967
- [
968
- "workspaces",
969
- "foreach",
970
- ...incrementalOptions,
971
- "run",
972
- "package-gen-docs"
973
- ]
974
- ]
975
- ];
976
- return runSteps(`GenDocs [All${incremental ? "-Incremental" : ""}]`, [
977
- ...steps
978
- ]);
979
- }, "genDocsAll");
980
-
981
- // src/actions/gitignore-gen.ts
982
- var filename = ".gitignore";
983
- var gitignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename, pkg), "gitignoreGen");
984
-
985
- // src/actions/gitlint.ts
986
- var import_chalk13 = __toESM(require("chalk"), 1);
987
- var import_parse_git_config = __toESM(require("parse-git-config"), 1);
988
- var gitlint = /* @__PURE__ */ __name(() => {
989
- console.log(`
990
- Gitlint Start [${process.cwd()}]
991
- `);
992
- let valid = 0;
993
- let warnings = 0;
994
- const errors = 0;
995
- const gitConfig = import_parse_git_config.default.sync();
996
- const warn = /* @__PURE__ */ __name((message) => {
997
- console.warn(import_chalk13.default.yellow(`Warning: ${message}`));
998
- warnings++;
999
- }, "warn");
1000
- if (gitConfig.core.ignorecase) {
1001
- warn("Please set core.ignorecase to FALSE in .git/config file [run yarn gitlint-fix]");
1002
- } else {
1003
- valid++;
1004
- }
1005
- if (gitConfig.core.autocrlf === false) {
1006
- valid++;
1007
- } else {
1008
- warn("Please set core.autocrlf to FALSE in .git/config file [run yarn gitlint-fix]");
1009
- }
1010
- if (gitConfig.core.eol === "lf") {
1011
- valid++;
1012
- } else {
1013
- warn('Please set core.eol to "lf" in .git/config file [run yarn gitlint-fix]');
1014
- }
1015
- const resultMessages = [];
1016
- if (valid > 0) {
1017
- resultMessages.push(import_chalk13.default.green(`Passed: ${valid}`));
1018
- }
1019
- if (warnings > 0) {
1020
- resultMessages.push(import_chalk13.default.yellow(`Warnings: ${warnings}`));
1021
- }
1022
- if (errors > 0) {
1023
- resultMessages.push(import_chalk13.default.red(` Errors: ${errors}`));
1024
- }
1025
- console.warn(`Gitlint Finish [ ${resultMessages.join(" | ")} ]
1026
- `);
1027
- return warnings + errors === 0 ? 1 : 0;
1028
- }, "gitlint");
1029
-
1030
- // src/actions/gitlint-fix.ts
1031
- var import_node_child_process6 = require("child_process");
1032
- var import_chalk14 = __toESM(require("chalk"), 1);
1033
- var import_parse_git_config2 = __toESM(require("parse-git-config"), 1);
1034
- var gitlintFix = /* @__PURE__ */ __name(() => {
1035
- console.log(`
1036
- Gitlint Fix Start [${process.cwd()}]
1037
- `);
1038
- const gitConfig = import_parse_git_config2.default.sync();
1039
- if (gitConfig.core.ignorecase) {
1040
- (0, import_node_child_process6.execSync)("git config core.ignorecase false", {
1041
- stdio: "inherit"
1042
- });
1043
- console.warn(import_chalk14.default.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
1044
- }
1045
- if (gitConfig.core.autocrlf !== false) {
1046
- (0, import_node_child_process6.execSync)("git config core.autocrlf false", {
1047
- stdio: "inherit"
1048
- });
1049
- console.warn(import_chalk14.default.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
1050
- }
1051
- if (gitConfig.core.eol !== "lf") {
1052
- (0, import_node_child_process6.execSync)("git config core.eol lf", {
1053
- stdio: "inherit"
1054
- });
1055
- console.warn(import_chalk14.default.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
1056
- }
1057
- return 1;
1058
- }, "gitlintFix");
1059
-
1060
- // src/actions/license.ts
1061
- var import_chalk15 = __toESM(require("chalk"), 1);
1062
- var import_license_checker = require("license-checker");
1063
- var license = /* @__PURE__ */ __name(async (pkg) => {
1064
- const workspaces = yarnWorkspaces();
1065
- const workspaceList = workspaces.filter(({ name }) => {
1066
- return pkg === void 0 || name === pkg;
1067
- });
1068
- const exclude = /* @__PURE__ */ new Set([
1069
- "MIT",
1070
- "MIT*",
1071
- "ISC",
1072
- "Apache-2.0",
1073
- "BSD",
1074
- "BSD*",
1075
- "BSD-2-Clause",
1076
- "BSD-3-Clause",
1077
- "CC-BY-4.0",
1078
- "Unlicense",
1079
- "CC-BY-3.0",
1080
- "CC0-1.0",
1081
- "LGPL-3.0-only",
1082
- "LGPL-3.0",
1083
- "LGPL-3.0-or-later",
1084
- "Python-2.0"
1085
- ]);
1086
- console.log(import_chalk15.default.green("License Checker"));
1087
- return (await Promise.all(workspaceList.map(({ location, name }) => {
1088
- return new Promise((resolve) => {
1089
- (0, import_license_checker.init)({
1090
- production: true,
1091
- start: location
1092
- }, (error, packages) => {
1093
- if (error) {
1094
- console.error(import_chalk15.default.red(`License Checker [${name}] Error`));
1095
- console.error(import_chalk15.default.gray(error));
1096
- console.log("\n");
1097
- resolve(1);
1098
- } else {
1099
- console.log(import_chalk15.default.green(`License Checker [${name}]`));
1100
- let count = 0;
1101
- for (const [name2, info] of Object.entries(packages)) {
1102
- const licenses = Array.isArray(info.licenses) ? info.licenses : [
1103
- info.licenses
1104
- ];
1105
- for (let license2 of licenses) {
1106
- if (license2) {
1107
- if (license2[0] === "(" && license2.at(-1) === ")") {
1108
- license2 = license2.slice(1, -2);
1109
- }
1110
- const orLicenses = license2.split(" OR ");
1111
- let orLicenseFound = false;
1112
- for (const orLicense of orLicenses) {
1113
- if (exclude.has(orLicense)) {
1114
- orLicenseFound = true;
1115
- }
1116
- }
1117
- if (!orLicenseFound) {
1118
- count++;
1119
- console.warn(import_chalk15.default.yellow(`${name2}: Package License not allowed [${license2}]`));
1120
- }
1121
- }
1122
- }
1123
- }
1124
- console.log("\n");
1125
- resolve(count);
1126
- }
1127
- });
1128
- });
1129
- }))).reduce((prev, value) => prev || value, 0);
1130
- }, "license");
1131
-
1132
- // src/actions/lint.ts
1133
- var import_chalk16 = __toESM(require("chalk"), 1);
1134
- var import_eslint = require("eslint");
1135
- var dumpMessages = /* @__PURE__ */ __name((lintResults) => {
1136
- const colors = [
1137
- "white",
1138
- "yellow",
1139
- "red"
1140
- ];
1141
- const severity = [
1142
- "none",
1143
- "warning",
1144
- "error"
1145
- ];
1146
- for (const lintResult of lintResults) {
1147
- if (lintResult.messages.length > 0) {
1148
- console.log(import_chalk16.default.gray(`${lintResult.filePath}`));
1149
- for (const message of lintResult.messages) {
1150
- console.log(import_chalk16.default.gray(` ${message.line}:${message.column}`), import_chalk16.default[colors[message.severity]](` ${severity[message.severity]}`), import_chalk16.default.white(` ${message.message}`), import_chalk16.default.gray(` ${message.ruleId}`));
1151
- }
1152
- }
1153
- }
1154
- }, "dumpMessages");
1155
- var lintPackage = /* @__PURE__ */ __name(async ({ pkg }) => {
1156
- const workspace = yarnWorkspaces().find((workspace2) => workspace2.name === pkg);
1157
- if (!workspace) {
1158
- console.error(import_chalk16.default.red(`Unable to locate package [${import_chalk16.default.magenta(pkg)}]`));
1159
- process.exit(1);
1160
- }
1161
- const engine = new import_eslint.ESLint({
1162
- cache: true
1163
- });
1164
- const lintResults = await engine.lintFiles(workspace.location);
1165
- dumpMessages(lintResults);
1166
- return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
1167
- }, "lintPackage");
1168
- var lint = /* @__PURE__ */ __name(async ({ pkg } = {}) => {
1169
- return pkg ? await lintPackage({
1170
- pkg
1171
- }) : runSteps("Lint-Caching [All]", [
1172
- [
1173
- "yarn",
1174
- [
1175
- "eslint",
1176
- ".",
1177
- "--cache"
1178
- ]
1179
- ]
1180
- ]);
1181
- }, "lint");
1182
-
1183
- // src/actions/lint-profile.ts
1184
- var lintProfile = /* @__PURE__ */ __name(() => {
1185
- return runSteps("Lint Profile", [
1186
- [
1187
- "yarn",
1188
- [
1189
- "xy",
1190
- "lint"
1191
- ],
1192
- {
1193
- env: {
1194
- ...process.env,
1195
- TIMING: "1"
1196
- }
1197
- }
1198
- ]
1199
- ]);
1200
- }, "lintProfile");
1201
-
1202
- // src/actions/npmignore-gen.ts
1203
- var filename2 = ".npmignore";
1204
- var npmignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename2, pkg), "npmignoreGen");
1205
-
1206
- // src/actions/publint.ts
1207
- var publint = /* @__PURE__ */ __name(async ({ verbose, pkg }) => {
1208
- return pkg ? await publintPackage({
1209
- pkg,
1210
- verbose
1211
- }) : publintAll({
1212
- verbose
1213
- });
1214
- }, "publint");
1215
- var publintPackage = /* @__PURE__ */ __name(({ pkg }) => {
1216
- return runStepsAsync(`Publint [${pkg}]`, [
1217
- [
1218
- "yarn",
1219
- [
1220
- "workspace",
1221
- pkg,
1222
- "run",
1223
- "package-publint"
1224
- ]
1225
- ]
1226
- ]);
1227
- }, "publintPackage");
1228
- var publintAll = /* @__PURE__ */ __name(({ verbose }) => {
1229
- const verboseOptions = verbose ? [
1230
- "--verbose"
1231
- ] : [
1232
- "--no-verbose"
1233
- ];
1234
- return runSteps("Publint", [
1235
- [
1236
- "yarn",
1237
- [
1238
- "workspaces",
1239
- "foreach",
1240
- "-pA",
1241
- ...verboseOptions,
1242
- "run",
1243
- "package-publint"
1244
- ]
1245
- ]
1246
- ]);
1247
- }, "publintAll");
1248
-
1249
- // src/actions/rebuild.ts
1250
- var rebuild = /* @__PURE__ */ __name(({ target }) => {
1251
- return runSteps("Rebuild", [
1252
- [
1253
- "yarn",
1254
- "xy clean"
1255
- ],
1256
- [
1257
- "yarn",
1258
- target ? `xy build -t ${target}` : "xy build"
1259
- ]
1260
- ]);
1261
- }, "rebuild");
1262
-
1263
- // src/actions/recompile.ts
1264
- var import_chalk17 = __toESM(require("chalk"), 1);
1265
- var recompile = /* @__PURE__ */ __name(async ({ verbose, target, pkg, incremental }) => {
1266
- return pkg ? await recompilePackage({
1267
- pkg,
1268
- target,
1269
- verbose
1270
- }) : await recompileAll({
1271
- incremental,
1272
- target,
1273
- verbose
1274
- });
1275
- }, "recompile");
1276
- var recompilePackage = /* @__PURE__ */ __name(({ verbose, target, pkg }) => {
1277
- const targetOptions = target ? [
1278
- "-t",
1279
- target
1280
- ] : [];
1281
- const verboseOptions = verbose ? [
1282
- "--verbose"
1283
- ] : [
1284
- "--no-verbose"
1285
- ];
1286
- return runStepsAsync(`Recompile [${pkg}]`, [
1287
- [
1288
- "yarn",
1289
- [
1290
- "workspace",
1291
- pkg,
1292
- ...verboseOptions,
1293
- "run",
1294
- "package-recompile",
1295
- ...targetOptions
1296
- ]
1297
- ]
1298
- ]);
1299
- }, "recompilePackage");
1300
- var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, incremental }) => {
1301
- const start = Date.now();
1302
- const verboseOptions = verbose ? [
1303
- "--verbose"
1304
- ] : [
1305
- "--no-verbose"
1306
- ];
1307
- const targetOptions = target ? [
1308
- "-t",
1309
- target
1310
- ] : [];
1311
- const incrementalOptions = incremental ? [
1312
- "--since",
1313
- "-Apt",
1314
- "--topological-dev"
1315
- ] : [
1316
- "--parallel",
1317
- "-Apt",
1318
- "--topological-dev"
1319
- ];
1320
- const jobsOptions = jobs ? [
1321
- "-j",
1322
- `${jobs}`
1323
- ] : [];
1324
- if (jobs) {
1325
- console.log(import_chalk17.default.blue(`Jobs set to [${jobs}]`));
1326
- }
1327
- const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
1328
- [
1329
- "yarn",
1330
- [
1331
- "workspaces",
1332
- "foreach",
1333
- ...incrementalOptions,
1334
- ...jobsOptions,
1335
- ...verboseOptions,
1336
- "run",
1337
- "package-recompile",
1338
- ...targetOptions
1339
- ]
1340
- ]
1341
- ]);
1342
- console.log(`${import_chalk17.default.gray("Recompiled in")} [${import_chalk17.default.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${import_chalk17.default.gray("seconds")}`);
1343
- return result;
1344
- }, "recompileAll");
1345
-
1346
- // src/actions/reinstall.ts
1347
- var import_node_fs5 = require("fs");
1348
- var reinstall = /* @__PURE__ */ __name(() => {
1349
- console.log("Reinstall [Clear Lock File]");
1350
- (0, import_node_fs5.closeSync)((0, import_node_fs5.openSync)("./yarn.lock", "w"));
1351
- console.log("Reinstall [Clear Node Modules]");
1352
- const workspaces = yarnWorkspaces();
1353
- const result = workspaces.map(({ location, name }) => {
1354
- const dist = `${location}/node_modules`;
1355
- try {
1356
- (0, import_node_fs5.rmSync)(dist, {
1357
- force: true,
1358
- recursive: true
1359
- });
1360
- return 0;
1361
- } catch (ex) {
1362
- const error = ex;
1363
- console.error(`Reinstall [Clear Node Modules] Failed [${name}, ${error.message}]`);
1364
- return 1;
1365
- }
1366
- }).reduce((prev, result2) => prev || result2, 0);
1367
- return result || runSteps("Reinstall", [
1368
- [
1369
- "yarn",
1370
- "install --network-timeout 10000"
1371
- ]
1372
- ]);
1373
- }, "reinstall");
1374
-
1375
- // src/actions/relint.ts
1376
- var import_node_fs6 = require("fs");
1377
- var relint = /* @__PURE__ */ __name(() => {
1378
- console.log("Relint - Cleaning [.eslintcache]");
1379
- const workspaces = yarnWorkspaces();
1380
- const result = workspaces.map(({ location, name }) => {
1381
- const dist = `${location}/.eslintcache`;
1382
- try {
1383
- (0, import_node_fs6.rmSync)(dist, {
1384
- force: true,
1385
- recursive: true
1386
- });
1387
- return 0;
1388
- } catch (ex) {
1389
- const error = ex;
1390
- console.error(`Relint - Cleaning [.eslintcache] Failed [${name}, ${error.message}]`);
1391
- return 1;
1392
- }
1393
- }).reduce((prev, result2) => prev || result2, 0);
1394
- return result || runSteps("Relint", [
1395
- [
1396
- "yarn",
1397
- [
1398
- "eslint",
1399
- ".",
1400
- "--cache"
1401
- ]
1402
- ]
1403
- ]);
1404
- }, "relint");
1405
-
1406
- // src/actions/retest.ts
1407
- var retest = /* @__PURE__ */ __name(() => {
1408
- return runSteps("Test", [
1409
- [
1410
- "yarn",
1411
- [
1412
- "jest",
1413
- "--clearCache"
1414
- ]
1415
- ],
1416
- [
1417
- "yarn",
1418
- [
1419
- "jest",
1420
- "."
1421
- ]
1422
- ]
1423
- ]);
1424
- }, "retest");
1425
-
1426
- // src/actions/sonar.ts
1427
- var sonar = /* @__PURE__ */ __name(() => {
1428
- return runSteps("Sonar", [
1429
- [
1430
- "yarn",
1431
- [
1432
- "eslint",
1433
- "-c",
1434
- "sonar.eslintrc",
1435
- "."
1436
- ]
1437
- ]
1438
- ]);
1439
- }, "sonar");
1440
-
1441
- // src/actions/statics.ts
1442
- var import_chalk18 = __toESM(require("chalk"), 1);
1443
- var DefaultDependencies = [
1444
- "axios",
1445
- "@xylabs/pixel",
1446
- "react",
1447
- "graphql",
1448
- "react-router",
1449
- "@mui/material",
1450
- "@mui/system"
1451
- ];
1452
- var statics = /* @__PURE__ */ __name(() => {
1453
- console.log(import_chalk18.default.green("Check Required Static Dependencies"));
1454
- const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
1455
- return detectDuplicateDependencies(statics2, DefaultDependencies);
1456
- }, "statics");
1457
-
1458
- // src/actions/test.ts
1459
- var test = /* @__PURE__ */ __name(() => {
1460
- return runSteps("Test", [
1461
- [
1462
- "yarn",
1463
- [
1464
- "jest",
1465
- "."
1466
- ]
1467
- ]
1468
- ]);
1469
- }, "test");
1470
-
1471
- // src/actions/up.ts
1472
- var up = /* @__PURE__ */ __name(() => {
1473
- return runSteps("Up", [
1474
- [
1475
- "yarn",
1476
- "outdated"
1477
- ]
1478
- ]);
1479
- }, "up");
1480
-
1481
- // src/actions/updo.ts
1482
- var updo = /* @__PURE__ */ __name(() => {
1483
- return runSteps("Updo", [
1484
- [
1485
- "yarn",
1486
- "install"
1487
- ],
1488
- [
1489
- "yarn",
1490
- "upgrade-interactive"
1491
- ],
1492
- [
1493
- "yarn",
1494
- "dedupe"
1495
- ]
1496
- ]);
1497
- }, "updo");
1498
-
1499
- // src/actions/upplug.ts
1500
- var updateYarnPlugins = /* @__PURE__ */ __name(() => {
1501
- return runSteps("Update Yarn Plugins", [
1502
- [
1503
- "yarn",
1504
- [
1505
- "plugin",
1506
- "import",
1507
- "https://mskelton.dev/yarn-outdated/v3"
1508
- ]
1509
- ],
1510
- [
1511
- "yarn",
1512
- [
1513
- "plugin",
1514
- "import",
1515
- "version"
1516
- ]
1517
- ],
1518
- [
1519
- "yarn",
1520
- [
1521
- "plugin",
1522
- "import",
1523
- "interactive-tools"
1524
- ]
1525
- ],
1526
- [
1527
- "yarn",
1528
- [
1529
- "plugin",
1530
- "import",
1531
- "workspace-tools"
1532
- ]
1533
- ]
1534
- ]);
1535
- }, "updateYarnPlugins");
1536
-
1537
- // src/actions/upyarn.ts
1538
- var updateYarnVersion = /* @__PURE__ */ __name(() => {
1539
- return runSteps("Update Yarn Version", [
1540
- [
1541
- "yarn",
1542
- [
1543
- "set",
1544
- "version",
1545
- "latest"
1546
- ]
1547
- ]
1548
- ]);
1549
- }, "updateYarnVersion");
1550
-
1551
- // src/actions/yarn3only.ts
1552
- var yarn3Only = /* @__PURE__ */ __name(() => {
1553
- const [valid, version] = isYarnVersionOrGreater(3);
1554
- if (!valid) {
1555
- processEx(`Invalid Yarn version [${version}]`);
1556
- }
1557
- return 0;
1558
- }, "yarn3Only");
1559
-
1560
- // src/xy/xyBuildCommands.ts
1561
- var xyBuildCommands = /* @__PURE__ */ __name((args) => {
1562
- return args.command("build [package]", "Build - Compile & Lint", (yargs2) => {
1563
- return yargs2.positional("package", {
1564
- describe: "Specific package to build"
1565
- });
1566
- }, async (argv) => {
1567
- if (argv.verbose) {
1568
- console.log(`Building: ${argv.package ?? "all"}`);
1569
- }
1570
- process.exitCode = await build({
1571
- incremental: !!argv.incremental,
1572
- jobs: argv.jobs,
1573
- pkg: argv.package,
1574
- target: argv.target,
1575
- verbose: !!argv.verbose
1576
- });
1577
- }).command("compile [package]", "Compile with Typescript & Copy Images", (yargs2) => {
1578
- return yargs2.positional("package", {
1579
- describe: "Specific package to compile"
1580
- });
1581
- }, async (argv) => {
1582
- if (argv.verbose) {
1583
- console.log(`Compiling: ${argv.package ?? "all"}`);
1584
- }
1585
- process.exitCode = await compile({
1586
- incremental: !!argv.incremental,
1587
- jobs: argv.jobs,
1588
- pkg: argv.package,
1589
- target: argv.target,
1590
- verbose: !!argv.verbose
1591
- });
1592
- }).command("compile-only [package]", "Compile with Typescript & Copy Images (No Publint)", (yargs2) => {
1593
- return yargs2.positional("package", {
1594
- describe: "Specific package to compile"
1595
- });
1596
- }, async (argv) => {
1597
- if (argv.verbose) {
1598
- console.log(`Compiling: ${argv.package ?? "all"}`);
1599
- }
1600
- process.exitCode = await compile({
1601
- incremental: !!argv.incremental,
1602
- jobs: argv.jobs,
1603
- pkg: argv.package,
1604
- publint: false,
1605
- target: argv.target,
1606
- verbose: !!argv.verbose
1607
- });
1608
- }).command("recompile [package]", "Re-compile with Typescript & Copy Images", (yargs2) => {
1609
- return yargs2.positional("package", {
1610
- describe: "Specific package to re-compile"
1611
- });
1612
- }, async (argv) => {
1613
- if (argv.verbose) {
1614
- console.log(`Re-compiling: ${argv.package ?? "all"}`);
1615
- }
1616
- process.exitCode = await recompile({
1617
- incremental: !!argv.incremental,
1618
- jobs: argv.jobs,
1619
- pkg: argv.package,
1620
- target: argv.target,
1621
- verbose: !!argv.verbose
1622
- });
1623
- }).command("rebuild [package]", "Rebuild - Clean, Compile & Lint", (yargs2) => {
1624
- return yargs2.positional("package", {
1625
- describe: "Specific package to rebuild"
1626
- });
1627
- }, (argv) => {
1628
- if (argv.verbose) console.log(`Rebuilding: ${argv.package ?? "all"}`);
1629
- process.exitCode = rebuild({
1630
- target: argv.target
1631
- });
1632
- }).command("copy-assets [package]", "Copy Assets - Copy the assets from src to dist", (yargs2) => {
1633
- return yargs2.positional("package", {
1634
- describe: "Specific package to copy assets"
1635
- });
1636
- }, async (argv) => {
1637
- if (argv.verbose) console.log(`Copying Assets: ${argv.package ?? "all"}`);
1638
- process.exitCode = await copyAssets({
1639
- target: argv.target
1640
- });
1641
- });
1642
- }, "xyBuildCommands");
1643
-
1644
- // src/xy/param.ts
1645
- var packagePositionalParam = /* @__PURE__ */ __name((yargs2) => {
1646
- return yargs2.positional("package", {
1647
- describe: "Specific package to target"
1648
- });
1649
- }, "packagePositionalParam");
1650
-
1651
- // src/xy/xyCommonCommands.ts
1652
- var xyCommonCommands = /* @__PURE__ */ __name((args) => {
1653
- return args.command("license [package]", "License - Check licenses of dependencies", (yargs2) => {
1654
- return packagePositionalParam(yargs2);
1655
- }, async (argv) => {
1656
- if (argv.verbose) console.log(`License: ${argv.package ?? "all"}`);
1657
- process.exitCode = await license();
1658
- }).command("dead [package]", "Dead - Check for dead code", (yargs2) => {
1659
- return packagePositionalParam(yargs2);
1660
- }, (argv) => {
1661
- if (argv.verbose) console.log("Dead");
1662
- process.exitCode = dead();
1663
- }).command("deps [package]", "Deps - Check for unused or missing dependencies", (yargs2) => {
1664
- return packagePositionalParam(yargs2);
1665
- }, (argv) => {
1666
- if (argv.verbose) console.log(`Checking Dependencies: ${argv.package ?? "all"}`);
1667
- process.exitCode = deps({
1668
- incremental: !!argv.incremental,
1669
- jobs: argv.jobs,
1670
- pkg: argv.package
1671
- });
1672
- }).command("gen-docs [package]", "GenDocs - Generate TypeDocs", (yargs2) => {
1673
- return packagePositionalParam(yargs2);
1674
- }, (argv) => {
1675
- if (argv.verbose) console.log(`Generating TypeDocs: ${argv.package ?? "all"}`);
1676
- process.exitCode = genDocs({
1677
- incremental: !!argv.incremental,
1678
- pkg: argv.package
1679
- });
1680
- }).command("clean-docs", "CleanDocs - Clean TypeDocs", (yargs2) => yargs2, (argv) => {
1681
- if (argv.verbose) console.log("Cleaning TypeDocs: all");
1682
- process.exitCode = cleanDocs();
1683
- }).command("gitlint [package]", "Gitlint - Lint your git config", (yargs2) => {
1684
- return yargs2;
1685
- }, (argv) => {
1686
- if (argv.verbose) console.log("Gitlint");
1687
- process.exitCode = argv.fix ? gitlintFix() : gitlint();
1688
- }).command("gitignore-gen", "GitIgnore Gen - Generate .gitignore files", (yargs2) => {
1689
- return yargs2;
1690
- }, (argv) => {
1691
- if (argv.verbose) console.log("GitIgnore Gen");
1692
- process.exitCode = gitignoreGen();
1693
- }).command("npmignore-gen", "NpmIgnore Gen - Generate .npmignore files", (yargs2) => {
1694
- return yargs2;
1695
- }, (argv) => {
1696
- if (argv.verbose) console.log("NpmIgnore Gen");
1697
- process.exitCode = npmignoreGen();
1698
- }).command("retest", "Re-Test - Run Jest Tests with cleaned cache", (yargs2) => {
1699
- return yargs2;
1700
- }, (argv) => {
1701
- if (argv.verbose) console.log("Re-Testing");
1702
- process.exitCode = retest();
1703
- }).command("test", "Test - Run Jest Tests", (yargs2) => {
1704
- return yargs2;
1705
- }, (argv) => {
1706
- if (argv.verbose) console.log("Testing");
1707
- process.exitCode = test();
1708
- }).command("upplug", "UpPlug - Update Yarn Plugins", (yargs2) => {
1709
- return yargs2;
1710
- }, (argv) => {
1711
- if (argv.verbose) console.log("UpPlug");
1712
- process.exitCode = updateYarnPlugins();
1713
- }).command("upyarn", "UpYarn - Update Yarn Version", (yargs2) => {
1714
- return yargs2;
1715
- }, (argv) => {
1716
- if (argv.verbose) console.log("UpYarn");
1717
- process.exitCode = updateYarnVersion();
1718
- }).command("yarn3only", "Yarn3Only - Check if using Yarn v3", (yargs2) => {
1719
- return yargs2;
1720
- }, (argv) => {
1721
- if (argv.verbose) console.log("Yarn 3 Check");
1722
- process.exitCode = yarn3Only();
1723
- });
1724
- }, "xyCommonCommands");
1725
-
1726
- // src/xy/xyDeployCommands.ts
1727
- var xyDeployCommands = /* @__PURE__ */ __name((args) => {
1728
- return args.command("deploy", "Deploy - Deploy patch", (yargs2) => {
1729
- return yargs2;
1730
- }, (argv) => {
1731
- if (argv.verbose) console.log("Deploy patch");
1732
- process.exitCode = deploy();
1733
- }).command("deploy-minor", "Deploy - Deploy minor", (yargs2) => {
1734
- return yargs2;
1735
- }, (argv) => {
1736
- if (argv.verbose) console.log("Deploy minor");
1737
- process.exitCode = deployMinor();
1738
- }).command("deploy-major", "Deploy - Deploy major", (yargs2) => {
1739
- return yargs2;
1740
- }, (argv) => {
1741
- if (argv.verbose) console.log("Deploy major");
1742
- process.exitCode = deployMajor();
1743
- }).command("deploy-next", "Deploy - Deploy next", (yargs2) => {
1744
- return yargs2;
1745
- }, (argv) => {
1746
- if (argv.verbose) console.log("Deploy next");
1747
- process.exitCode = deployNext();
1748
- });
1749
- }, "xyDeployCommands");
1750
-
1751
- // src/xy/xyInstallCommands.ts
1752
- var xyInstallCommands = /* @__PURE__ */ __name((args) => {
1753
- return args.command("clean [package]", "Clean", (yargs2) => {
1754
- return yargs2.positional("package", {
1755
- describe: "Specific package to clean"
1756
- });
1757
- }, async (argv) => {
1758
- if (argv.verbose) {
1759
- console.log(`Cleaning: ${argv.package ?? "all"}`);
1760
- }
1761
- process.exitCode = await clean({
1762
- pkg: argv.package,
1763
- verbose: !!argv.verbose
1764
- });
1765
- }).command("reinstall", "Reinstall - Clean & Install", (yargs2) => {
1766
- return yargs2;
1767
- }, (argv) => {
1768
- if (argv.verbose) console.log("Reinstalling");
1769
- process.exitCode = reinstall();
1770
- }).command("up", "Up - Update dependencies", (yargs2) => {
1771
- return yargs2;
1772
- }, (argv) => {
1773
- if (argv.verbose) console.log("Up");
1774
- process.exitCode = up();
1775
- }).command("updo", "Updo - Update dependencies [Interactive]", (yargs2) => {
1776
- return yargs2;
1777
- }, (argv) => {
1778
- if (argv.verbose) console.log("Updo");
1779
- process.exitCode = updo();
1780
- }).command("statics", "Statics - Confirming Static Packages", (yargs2) => {
1781
- return yargs2;
1782
- }, (argv) => {
1783
- if (argv.verbose) console.log("Statics");
1784
- process.exitCode = statics();
1785
- }).command("dupdeps", "Dupdeps - Duplicate Dependencies in package.json", (yargs2) => {
1786
- return yargs2;
1787
- }, (argv) => {
1788
- if (argv.verbose) console.log("Dupdeps");
1789
- process.exitCode = dupdeps();
1790
- });
1791
- }, "xyInstallCommands");
1792
-
1793
- // src/xy/xyLintCommands.ts
1794
- var import_chalk19 = __toESM(require("chalk"), 1);
1795
- var xyLintCommands = /* @__PURE__ */ __name((args) => {
1796
- return args.command("cycle [package]", "Cycle - Check for dependency cycles", (yargs2) => {
1797
- return packagePositionalParam(yargs2);
1798
- }, (argv) => {
1799
- const start = Date.now();
1800
- if (argv.verbose) console.log("Cycle");
1801
- process.exitCode = cycle();
1802
- console.log(import_chalk19.default.blue(`Finished in ${Date.now() - start}ms`));
1803
- }).command("lint [package]", "Lint - Run Eslint", (yargs2) => {
1804
- return packagePositionalParam(yargs2);
1805
- }, async (argv) => {
1806
- if (argv.verbose) console.log("Lint");
1807
- const start = Date.now();
1808
- process.exitCode = argv.fix ? fix() : argv.profile ? lintProfile() : await lint({
1809
- pkg: argv.package
1810
- });
1811
- console.log(import_chalk19.default.blue(`Finished in ${Date.now() - start}ms`));
1812
- }).command("fix [package]", "Fix - Run Eslint w/fix", (yargs2) => {
1813
- return packagePositionalParam(yargs2);
1814
- }, (argv) => {
1815
- const start = Date.now();
1816
- if (argv.verbose) console.log("Fix");
1817
- process.exitCode = fix();
1818
- console.log(import_chalk19.default.blue(`Finished in ${Date.now() - start}ms`));
1819
- }).command("relint [package]", "Relint - Clean & Lint", (yargs2) => {
1820
- return packagePositionalParam(yargs2);
1821
- }, (argv) => {
1822
- if (argv.verbose) console.log("Relinting");
1823
- const start = Date.now();
1824
- process.exitCode = relint();
1825
- console.log(import_chalk19.default.blue(`Finished in ${Date.now() - start}ms`));
1826
- }).command("publint [package]", "Publint - Run Publint", (yargs2) => {
1827
- return packagePositionalParam(yargs2);
1828
- }, async (argv) => {
1829
- if (argv.verbose) console.log("Publint");
1830
- const start = Date.now();
1831
- process.exitCode = await publint({
1832
- pkg: argv.package,
1833
- verbose: !!argv.verbose
1834
- });
1835
- console.log(import_chalk19.default.blue(`Finished in ${Date.now() - start}ms`));
1836
- }).command("sonar", "Sonar - Run Sonar Check", (yargs2) => {
1837
- return packagePositionalParam(yargs2);
1838
- }, (argv) => {
1839
- const start = Date.now();
1840
- if (argv.verbose) console.log("Sonar Check");
1841
- process.exitCode = sonar();
1842
- console.log(import_chalk19.default.blue(`Finished in ${Date.now() - start}ms`));
1843
- });
1844
- }, "xyLintCommands");
1845
-
1846
- // src/xy/xyParseOptions.ts
1847
- var import_yargs = __toESM(require("yargs"), 1);
1848
- var import_helpers = require("yargs/helpers");
1849
- var xyParseOptions = /* @__PURE__ */ __name(() => {
1850
- return (0, import_yargs.default)((0, import_helpers.hideBin)(process.argv)).scriptName("yarn xy").option("jobs", {
1851
- alias: "j",
1852
- default: void 0,
1853
- description: "Max parallel jobs",
1854
- type: "number"
1855
- }).option("verbose", {
1856
- alias: "v",
1857
- default: false,
1858
- description: "Run with verbose logging",
1859
- type: "boolean"
1860
- }).option("target", {
1861
- alias: "t",
1862
- choices: [
1863
- "esm",
1864
- "cjs"
1865
- ],
1866
- description: "Limit output to specific target",
1867
- type: "string"
1868
- }).option("incremental", {
1869
- alias: "i",
1870
- default: false,
1871
- description: "Attempt to perform the action only on changed packages",
1872
- type: "boolean"
1873
- }).option("fix", {
1874
- alias: "f",
1875
- default: false,
1876
- description: "Try to fix errors",
1877
- type: "boolean"
1878
- }).option("cache", {
1879
- alias: "c",
1880
- default: false,
1881
- description: "Use caching for performance",
1882
- type: "boolean"
1883
- }).option("profile", {
1884
- alias: "p",
1885
- default: false,
1886
- description: "Profile action",
1887
- type: "boolean"
1888
- });
1889
- }, "xyParseOptions");
1890
-
1891
- // src/xy/xy.ts
1892
- var xy = /* @__PURE__ */ __name(async () => {
1893
- const options = xyParseOptions();
1894
- return await xyBuildCommands(xyCommonCommands(xyInstallCommands(xyDeployCommands(xyLintCommands(options))))).demandCommand(1).command("*", "", () => {
1895
- console.error(import_chalk20.default.yellow(`Command not found [${import_chalk20.default.magenta(process.argv[2])}]`));
1896
- console.log(import_chalk20.default.gray("Try 'yarn xy --help' for list of commands"));
1897
- }).version().help().argv;
1898
- }, "xy");
1899
- // Annotate the CommonJS export names for ESM import in node:
1900
- 0 && (module.exports = {
1901
- xy,
1902
- xyBuildCommands,
1903
- xyCommonCommands,
1904
- xyDeployCommands,
1905
- xyInstallCommands,
1906
- xyLintCommands,
1907
- xyParseOptions
1908
- });
1909
- //# sourceMappingURL=index.cjs.map