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

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