@xylabs/ts-scripts-yarn3 6.3.5 → 6.4.1

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