@xylabs/ts-scripts-yarn3 6.3.5 → 6.4.0

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