@xylabs/ts-scripts-yarn3 6.3.5 → 6.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/dist/actions/build.mjs +39 -87
  2. package/dist/actions/build.mjs.map +1 -1
  3. package/dist/actions/clean-docs.mjs +8 -22
  4. package/dist/actions/clean-docs.mjs.map +1 -1
  5. package/dist/actions/clean-eslint.mjs +5 -11
  6. package/dist/actions/clean-eslint.mjs.map +1 -1
  7. package/dist/actions/clean-jest.mjs +16 -29
  8. package/dist/actions/clean-jest.mjs.map +1 -1
  9. package/dist/actions/clean.mjs +32 -63
  10. package/dist/actions/clean.mjs.map +1 -1
  11. package/dist/actions/compile-types.mjs +45 -68
  12. package/dist/actions/compile-types.mjs.map +1 -1
  13. package/dist/actions/compile.mjs +50 -76
  14. package/dist/actions/compile.mjs.map +1 -1
  15. package/dist/actions/copy-assets.mjs +23 -38
  16. package/dist/actions/copy-assets.mjs.map +1 -1
  17. package/dist/actions/cycle.mjs +28 -57
  18. package/dist/actions/cycle.mjs.map +1 -1
  19. package/dist/actions/dead.mjs +16 -31
  20. package/dist/actions/dead.mjs.map +1 -1
  21. package/dist/actions/deplint.mjs +195 -0
  22. package/dist/actions/deplint.mjs.map +1 -0
  23. package/dist/actions/deploy-major.mjs +20 -41
  24. package/dist/actions/deploy-major.mjs.map +1 -1
  25. package/dist/actions/deploy-minor.mjs +20 -41
  26. package/dist/actions/deploy-minor.mjs.map +1 -1
  27. package/dist/actions/deploy-next.mjs +20 -41
  28. package/dist/actions/deploy-next.mjs.map +1 -1
  29. package/dist/actions/deploy.mjs +20 -41
  30. package/dist/actions/deploy.mjs.map +1 -1
  31. package/dist/actions/dupdeps.mjs +26 -37
  32. package/dist/actions/dupdeps.mjs.map +1 -1
  33. package/dist/actions/fix.mjs +36 -54
  34. package/dist/actions/fix.mjs.map +1 -1
  35. package/dist/actions/gen-docs.mjs +25 -65
  36. package/dist/actions/gen-docs.mjs.map +1 -1
  37. package/dist/actions/gitignore-gen.mjs +28 -44
  38. package/dist/actions/gitignore-gen.mjs.map +1 -1
  39. package/dist/actions/gitlint-fix.mjs +5 -14
  40. package/dist/actions/gitlint-fix.mjs.map +1 -1
  41. package/dist/actions/gitlint.mjs +4 -7
  42. package/dist/actions/gitlint.mjs.map +1 -1
  43. package/dist/actions/index.mjs +864 -1241
  44. package/dist/actions/index.mjs.map +1 -1
  45. package/dist/actions/knip.mjs +16 -31
  46. package/dist/actions/knip.mjs.map +1 -1
  47. package/dist/actions/license.mjs +37 -51
  48. package/dist/actions/license.mjs.map +1 -1
  49. package/dist/actions/lint.mjs +33 -48
  50. package/dist/actions/lint.mjs.map +1 -1
  51. package/dist/actions/npmignore-gen.mjs +28 -44
  52. package/dist/actions/npmignore-gen.mjs.map +1 -1
  53. package/dist/actions/package/clean-outputs.mjs +6 -16
  54. package/dist/actions/package/clean-outputs.mjs.map +1 -1
  55. package/dist/actions/package/clean-typescript.mjs +6 -16
  56. package/dist/actions/package/clean-typescript.mjs.map +1 -1
  57. package/dist/actions/package/clean.mjs +12 -29
  58. package/dist/actions/package/clean.mjs.map +1 -1
  59. package/dist/actions/package/compile/buildEntries.mjs +7 -17
  60. package/dist/actions/package/compile/buildEntries.mjs.map +1 -1
  61. package/dist/actions/package/compile/compile.mjs +133 -169
  62. package/dist/actions/package/compile/compile.mjs.map +1 -1
  63. package/dist/actions/package/compile/compileTypes.mjs +43 -59
  64. package/dist/actions/package/compile/compileTypes.mjs.map +1 -1
  65. package/dist/actions/package/compile/copyTypeFiles.mjs +20 -23
  66. package/dist/actions/package/compile/copyTypeFiles.mjs.map +1 -1
  67. package/dist/actions/package/compile/deepMerge.mjs +0 -5
  68. package/dist/actions/package/compile/deepMerge.mjs.map +1 -1
  69. package/dist/actions/package/compile/getCompilerOptions.mjs +11 -10
  70. package/dist/actions/package/compile/getCompilerOptions.mjs.map +1 -1
  71. package/dist/actions/package/compile/index.mjs +133 -169
  72. package/dist/actions/package/compile/index.mjs.map +1 -1
  73. package/dist/actions/package/compile/inputs.mjs +3 -8
  74. package/dist/actions/package/compile/inputs.mjs.map +1 -1
  75. package/dist/actions/package/compile/packageCompileTsc.mjs +37 -52
  76. package/dist/actions/package/compile/packageCompileTsc.mjs.map +1 -1
  77. package/dist/actions/package/compile/packageCompileTscTypes.mjs +37 -52
  78. package/dist/actions/package/compile/packageCompileTscTypes.mjs.map +1 -1
  79. package/dist/actions/package/compile/packageCompileTsup.mjs +127 -163
  80. package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -1
  81. package/dist/actions/package/copy-assets.mjs +12 -21
  82. package/dist/actions/package/copy-assets.mjs.map +1 -1
  83. package/dist/actions/package/cycle.mjs +5 -14
  84. package/dist/actions/package/cycle.mjs.map +1 -1
  85. package/dist/actions/package/gen-docs.mjs +11 -12
  86. package/dist/actions/package/gen-docs.mjs.map +1 -1
  87. package/dist/actions/package/index.mjs +191 -271
  88. package/dist/actions/package/index.mjs.map +1 -1
  89. package/dist/actions/package/lint.mjs +16 -39
  90. package/dist/actions/package/lint.mjs.map +1 -1
  91. package/dist/actions/package/publint.mjs +4 -7
  92. package/dist/actions/package/publint.mjs.map +1 -1
  93. package/dist/actions/package/recompile.mjs +147 -197
  94. package/dist/actions/package/recompile.mjs.map +1 -1
  95. package/dist/actions/publint.mjs +37 -71
  96. package/dist/actions/publint.mjs.map +1 -1
  97. package/dist/actions/rebuild.mjs +17 -29
  98. package/dist/actions/rebuild.mjs.map +1 -1
  99. package/dist/actions/recompile.mjs +50 -67
  100. package/dist/actions/recompile.mjs.map +1 -1
  101. package/dist/actions/reinstall.mjs +25 -43
  102. package/dist/actions/reinstall.mjs.map +1 -1
  103. package/dist/actions/relint.mjs +40 -63
  104. package/dist/actions/relint.mjs.map +1 -1
  105. package/dist/actions/retest.mjs +17 -35
  106. package/dist/actions/retest.mjs.map +1 -1
  107. package/dist/actions/sonar.mjs +16 -32
  108. package/dist/actions/sonar.mjs.map +1 -1
  109. package/dist/actions/statics.mjs +27 -46
  110. package/dist/actions/statics.mjs.map +1 -1
  111. package/dist/actions/test.mjs +16 -30
  112. package/dist/actions/test.mjs.map +1 -1
  113. package/dist/actions/up.mjs +16 -27
  114. package/dist/actions/up.mjs.map +1 -1
  115. package/dist/actions/updo.mjs +18 -33
  116. package/dist/actions/updo.mjs.map +1 -1
  117. package/dist/actions/upplug.mjs +19 -53
  118. package/dist/actions/upplug.mjs.map +1 -1
  119. package/dist/actions/upyarn.mjs +16 -31
  120. package/dist/actions/upyarn.mjs.map +1 -1
  121. package/dist/actions/yarn3only.mjs +12 -23
  122. package/dist/actions/yarn3only.mjs.map +1 -1
  123. package/dist/bin/package/build-only.mjs +134 -172
  124. package/dist/bin/package/build-only.mjs.map +1 -1
  125. package/dist/bin/package/build.mjs +134 -172
  126. package/dist/bin/package/build.mjs.map +1 -1
  127. package/dist/bin/package/clean-outputs.mjs +6 -15
  128. package/dist/bin/package/clean-outputs.mjs.map +1 -1
  129. package/dist/bin/package/clean-typescript.mjs +6 -15
  130. package/dist/bin/package/clean-typescript.mjs.map +1 -1
  131. package/dist/bin/package/clean.mjs +12 -28
  132. package/dist/bin/package/clean.mjs.map +1 -1
  133. package/dist/bin/package/compile-only.mjs +134 -172
  134. package/dist/bin/package/compile-only.mjs.map +1 -1
  135. package/dist/bin/package/compile-tsup.mjs +128 -165
  136. package/dist/bin/package/compile-tsup.mjs.map +1 -1
  137. package/dist/bin/package/compile-types.mjs +44 -61
  138. package/dist/bin/package/compile-types.mjs.map +1 -1
  139. package/dist/bin/package/compile.mjs +134 -171
  140. package/dist/bin/package/compile.mjs.map +1 -1
  141. package/dist/bin/package/copy-assets-cjs.mjs +13 -23
  142. package/dist/bin/package/copy-assets-cjs.mjs.map +1 -1
  143. package/dist/bin/package/copy-assets-esm.mjs +13 -23
  144. package/dist/bin/package/copy-assets-esm.mjs.map +1 -1
  145. package/dist/bin/package/cycle.mjs +6 -16
  146. package/dist/bin/package/cycle.mjs.map +1 -1
  147. package/dist/bin/package/fix.mjs +16 -38
  148. package/dist/bin/package/fix.mjs.map +1 -1
  149. package/dist/bin/package/gen-docs.mjs +11 -11
  150. package/dist/bin/package/gen-docs.mjs.map +1 -1
  151. package/dist/bin/package/lint.mjs +16 -38
  152. package/dist/bin/package/lint.mjs.map +1 -1
  153. package/dist/bin/package/publint.mjs +4 -6
  154. package/dist/bin/package/publint.mjs.map +1 -1
  155. package/dist/bin/package/recompile.mjs +147 -196
  156. package/dist/bin/package/recompile.mjs.map +1 -1
  157. package/dist/bin/package/relint.mjs +16 -38
  158. package/dist/bin/package/relint.mjs.map +1 -1
  159. package/dist/bin/xy.mjs +1086 -1237
  160. package/dist/bin/xy.mjs.map +1 -1
  161. package/dist/index.d.ts +5 -1
  162. package/dist/index.mjs +1338 -1583
  163. package/dist/index.mjs.map +1 -1
  164. package/dist/lib/checkResult.mjs +2 -5
  165. package/dist/lib/checkResult.mjs.map +1 -1
  166. package/dist/lib/createBuildConfig.mjs +9 -24
  167. package/dist/lib/createBuildConfig.mjs.map +1 -1
  168. package/dist/lib/defaultBuildConfig.mjs +2 -6
  169. package/dist/lib/defaultBuildConfig.mjs.map +1 -1
  170. package/dist/lib/deleteGlob.mjs +3 -9
  171. package/dist/lib/deleteGlob.mjs.map +1 -1
  172. package/dist/lib/dependencies/DuplicateDetector.mjs +12 -23
  173. package/dist/lib/dependencies/DuplicateDetector.mjs.map +1 -1
  174. package/dist/lib/dependencies/detectDuplicateDependencies.mjs +22 -33
  175. package/dist/lib/dependencies/detectDuplicateDependencies.mjs.map +1 -1
  176. package/dist/lib/dependencies/index.mjs +22 -33
  177. package/dist/lib/dependencies/index.mjs.map +1 -1
  178. package/dist/lib/file/ReadFileSyncOptions.mjs +1 -3
  179. package/dist/lib/file/ReadFileSyncOptions.mjs.map +1 -1
  180. package/dist/lib/file/constants.mjs.map +1 -1
  181. package/dist/lib/file/fileLines.mjs +12 -13
  182. package/dist/lib/file/fileLines.mjs.map +1 -1
  183. package/dist/lib/file/index.mjs +14 -15
  184. package/dist/lib/file/index.mjs.map +1 -1
  185. package/dist/lib/file/tryReadFileSync.mjs +3 -8
  186. package/dist/lib/file/tryReadFileSync.mjs.map +1 -1
  187. package/dist/lib/generateIgnoreFiles.mjs +27 -43
  188. package/dist/lib/generateIgnoreFiles.mjs.map +1 -1
  189. package/dist/lib/index.mjs +100 -154
  190. package/dist/lib/index.mjs.map +1 -1
  191. package/dist/lib/jsonFormatters.mjs +2 -5
  192. package/dist/lib/jsonFormatters.mjs.map +1 -1
  193. package/dist/lib/loadConfig.mjs +4 -8
  194. package/dist/lib/loadConfig.mjs.map +1 -1
  195. package/dist/lib/parsedPackageJSON.mjs +2 -5
  196. package/dist/lib/parsedPackageJSON.mjs.map +1 -1
  197. package/dist/lib/processEx.mjs +6 -9
  198. package/dist/lib/processEx.mjs.map +1 -1
  199. package/dist/lib/runSteps.mjs +13 -19
  200. package/dist/lib/runSteps.mjs.map +1 -1
  201. package/dist/lib/runStepsAsync.mjs +22 -22
  202. package/dist/lib/runStepsAsync.mjs.map +1 -1
  203. package/dist/lib/runXy.mjs +19 -31
  204. package/dist/lib/runXy.mjs.map +1 -1
  205. package/dist/lib/runXyWithWarning.mjs +2 -5
  206. package/dist/lib/runXyWithWarning.mjs.map +1 -1
  207. package/dist/lib/safeExit.mjs +10 -13
  208. package/dist/lib/safeExit.mjs.map +1 -1
  209. package/dist/lib/string/empty.mjs +2 -5
  210. package/dist/lib/string/empty.mjs.map +1 -1
  211. package/dist/lib/string/index.mjs +3 -9
  212. package/dist/lib/string/index.mjs.map +1 -1
  213. package/dist/lib/string/union.mjs +1 -7
  214. package/dist/lib/string/union.mjs.map +1 -1
  215. package/dist/lib/withErrnoException.mjs +4 -7
  216. package/dist/lib/withErrnoException.mjs.map +1 -1
  217. package/dist/lib/withError.mjs +2 -5
  218. package/dist/lib/withError.mjs.map +1 -1
  219. package/dist/lib/yarn/index.mjs +11 -30
  220. package/dist/lib/yarn/index.mjs.map +1 -1
  221. package/dist/lib/yarn/isYarnVersionOrGreater.mjs +4 -15
  222. package/dist/lib/yarn/isYarnVersionOrGreater.mjs.map +1 -1
  223. package/dist/lib/yarn/workspace/index.mjs +5 -16
  224. package/dist/lib/yarn/workspace/index.mjs.map +1 -1
  225. package/dist/lib/yarn/workspace/yarnWorkspace.mjs +5 -16
  226. package/dist/lib/yarn/workspace/yarnWorkspace.mjs.map +1 -1
  227. package/dist/lib/yarn/workspace/yarnWorkspaces.mjs +3 -14
  228. package/dist/lib/yarn/workspace/yarnWorkspaces.mjs.map +1 -1
  229. package/dist/lib/yarn/yarnInitCwd.mjs +2 -5
  230. package/dist/lib/yarn/yarnInitCwd.mjs.map +1 -1
  231. package/dist/loadPackageConfig.mjs +3 -8
  232. package/dist/loadPackageConfig.mjs.map +1 -1
  233. package/dist/xy/index.mjs +1086 -1238
  234. package/dist/xy/index.mjs.map +1 -1
  235. package/dist/xy/param.mjs +3 -8
  236. package/dist/xy/param.mjs.map +1 -1
  237. package/dist/xy/xy.mjs +1086 -1238
  238. package/dist/xy/xy.mjs.map +1 -1
  239. package/dist/xy/xyBuildCommands.mjs +276 -382
  240. package/dist/xy/xyBuildCommands.mjs.map +1 -1
  241. package/dist/xy/xyCommonCommands.mjs +251 -335
  242. package/dist/xy/xyCommonCommands.mjs.map +1 -1
  243. package/dist/xy/xyDeployCommands.mjs +84 -130
  244. package/dist/xy/xyDeployCommands.mjs.map +1 -1
  245. package/dist/xy/xyInstallCommands.mjs +145 -193
  246. package/dist/xy/xyInstallCommands.mjs.map +1 -1
  247. package/dist/xy/xyLintCommands.mjs +413 -292
  248. package/dist/xy/xyLintCommands.mjs.map +1 -1
  249. package/dist/xy/xyParseOptions.mjs +4 -13
  250. package/dist/xy/xyParseOptions.mjs.map +1 -1
  251. package/package.json +3 -22
package/dist/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,303 @@ 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
+ peerDeps = false
748
+ }) {
749
+ const { prodSourceFiles, devSourceFiles } = findFiles(location);
750
+ const {
751
+ prodImportPaths,
752
+ devImportPaths,
753
+ externalProdImports,
754
+ externalDevImports
755
+ } = getExternalImportsFromFiles({ prodSourceFiles, devSourceFiles });
756
+ const {
757
+ dependencies,
758
+ devDependencies,
759
+ peerDependencies
760
+ } = getDependenciesFromPackageJson(`${location}/package.json`);
761
+ let unlistedDependencies = 0;
762
+ let unlistedDevDependencies = 0;
763
+ let unusedDependencies = 0;
764
+ for (const imp of externalProdImports) {
765
+ if (!dependencies.includes(imp) && !peerDependencies.includes(imp)) {
766
+ unlistedDependencies++;
767
+ console.log(`[${chalk12.blue(name)}] Missing dependency in package.json: ${chalk12.red(imp)}`);
768
+ console.log(` ${prodImportPaths[imp].join("\n")}`);
769
+ console.log("");
770
+ }
771
+ }
772
+ for (const dep of dependencies) {
773
+ if (!externalProdImports.includes(dep)) {
774
+ unusedDependencies++;
775
+ console.log(`[${chalk12.blue(name)}] Unused dependency in package.json: ${chalk12.red(dep)}`);
776
+ console.log(` ${location}/package.json
777
+ `);
778
+ console.log("");
779
+ }
780
+ }
781
+ if (peerDeps) {
782
+ for (const dep of peerDependencies) {
783
+ if (!externalProdImports.includes(dep)) {
784
+ unusedDependencies++;
785
+ console.log(`[${chalk12.blue(name)}] Unused peerDependency in package.json: ${chalk12.red(dep)}`);
786
+ console.log(` ${location}/package.json
787
+ `);
788
+ console.log("");
789
+ }
790
+ }
791
+ }
792
+ if (devDeps) {
793
+ for (const imp of externalDevImports) {
794
+ if (!devDependencies.includes(imp)) {
795
+ unlistedDevDependencies++;
796
+ console.log(`[${chalk12.blue(name)}] Missing devDependency in package.json: ${chalk12.red(imp)}`);
797
+ console.log(` Found in: ${devImportPaths[imp].join(", ")}`);
798
+ }
799
+ }
800
+ }
801
+ const totalErrors = unlistedDependencies + unlistedDevDependencies + unusedDependencies;
802
+ return totalErrors;
803
+ }
804
+ var deplint = ({ pkg }) => {
805
+ if (pkg) {
806
+ const { location, name } = yarnWorkspace(pkg);
807
+ console.log(`Running Deplint for ${name}`);
808
+ check({
809
+ name,
810
+ location,
811
+ devDeps: true
812
+ });
813
+ } else {
814
+ const workspaces = yarnWorkspaces();
815
+ console.log("Deplint Started...");
816
+ let totalErrors = 0;
817
+ for (const workspace of workspaces) {
818
+ totalErrors += check(workspace);
819
+ }
820
+ if (totalErrors > 0) {
821
+ console.log(`Found ${chalk12.red(totalErrors)} unlisted imports.`);
822
+ } else {
823
+ console.log(`No unlisted imports found. ${chalk12.green("\u2714")}`);
824
+ }
825
+ }
826
+ return 0;
827
+ };
844
828
 
845
829
  // src/actions/deploy.ts
846
- var deploy = /* @__PURE__ */ __name(() => {
830
+ var deploy = () => {
847
831
  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
- ]
832
+ ["yarn", "workspaces foreach --all version patch --deferred"],
833
+ ["yarn", "xy clean"],
834
+ ["yarn", "xy build"],
835
+ ["yarn", "version apply --all"],
836
+ ["yarn", "workspaces foreach --all --parallel npm publish"]
868
837
  ]);
869
- }, "deploy");
838
+ };
870
839
 
871
840
  // src/actions/deploy-major.ts
872
- var deployMajor = /* @__PURE__ */ __name(() => {
841
+ var deployMajor = () => {
873
842
  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
- ]
843
+ ["yarn", "workspaces foreach --all version major --deferred"],
844
+ ["yarn", "xy clean"],
845
+ ["yarn", "xy build"],
846
+ ["yarn", "version apply --all"],
847
+ ["yarn", "workspaces foreach --all --parallel npm publish"]
894
848
  ]);
895
- }, "deployMajor");
849
+ };
896
850
 
897
851
  // src/actions/deploy-minor.ts
898
- var deployMinor = /* @__PURE__ */ __name(() => {
852
+ var deployMinor = () => {
899
853
  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
- ]
854
+ ["yarn", "workspaces foreach --all version minor --deferred"],
855
+ ["yarn", "xy clean"],
856
+ ["yarn", "xy build"],
857
+ ["yarn", "version apply --all"],
858
+ ["yarn", "workspaces foreach --all --parallel npm publish"]
920
859
  ]);
921
- }, "deployMinor");
860
+ };
922
861
 
923
862
  // src/actions/deploy-next.ts
924
- var deployNext = /* @__PURE__ */ __name(() => {
863
+ var deployNext = () => {
925
864
  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
- ]
865
+ ["yarn", "workspaces foreach --all version minor --deferred"],
866
+ ["yarn", "xy clean"],
867
+ ["yarn", "xy build"],
868
+ ["yarn", "version apply --all --prerelease"],
869
+ ["yarn", "workspaces foreach --all --parallel npm publish --tag next"]
946
870
  ]);
947
- }, "deployNext");
871
+ };
948
872
 
949
873
  // src/actions/dupdeps.ts
950
- import chalk12 from "chalk";
951
- var dupdeps = /* @__PURE__ */ __name(() => {
952
- console.log(chalk12.green("Checking all Dependencies for Duplicates"));
874
+ import chalk13 from "chalk";
875
+ var dupdeps = () => {
876
+ console.log(chalk13.green("Checking all Dependencies for Duplicates"));
953
877
  const allDependencies = parsedPackageJSON()?.dependencies;
954
878
  const dependencies = Object.entries(allDependencies).map(([k]) => k);
955
879
  return detectDuplicateDependencies(dependencies);
956
- }, "dupdeps");
880
+ };
957
881
 
958
882
  // 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}]`));
883
+ import chalk14 from "chalk";
884
+ var lintPackage = ({ pkg, fix: fix2 }) => {
885
+ console.log(chalk14.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
962
886
  const start = Date.now();
963
887
  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
- ]
888
+ ["yarn", [
889
+ "workspace",
890
+ pkg,
891
+ "run",
892
+ fix2 ? "package-fix" : "package-lint"
893
+ ]]
973
894
  ]);
974
- console.log(chalk13.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk13.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk13.gray("seconds")}`));
895
+ console.log(chalk14.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk14.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk14.gray("seconds")}`));
975
896
  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({
897
+ };
898
+ var lint = ({
899
+ pkg,
900
+ verbose,
901
+ incremental,
902
+ fix: fix2
903
+ } = {}) => {
904
+ return pkg ? lintPackage({ pkg, fix: fix2 }) : lintAllPackages({
982
905
  verbose,
983
906
  incremental,
984
907
  fix: fix2
985
908
  });
986
- }, "lint");
987
- var lintAllPackages = /* @__PURE__ */ __name(({ fix: fix2 = false } = {}) => {
988
- console.log(chalk13.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
909
+ };
910
+ var lintAllPackages = ({ fix: fix2 = false } = {}) => {
911
+ console.log(chalk14.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
989
912
  const start = Date.now();
990
- const fixOptions = fix2 ? [
991
- "--fix"
992
- ] : [];
913
+ const fixOptions = fix2 ? ["--fix"] : [];
993
914
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
994
- [
995
- "yarn",
996
- [
997
- "eslint",
998
- ...fixOptions
999
- ]
1000
- ]
915
+ ["yarn", ["eslint", ...fixOptions]]
1001
916
  ]);
1002
- console.log(chalk13.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk13.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk13.gray("seconds")}`));
917
+ console.log(chalk14.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk14.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk14.gray("seconds")}`));
1003
918
  return result;
1004
- }, "lintAllPackages");
919
+ };
1005
920
 
1006
921
  // src/actions/fix.ts
1007
- var fix = /* @__PURE__ */ __name((params) => {
1008
- return lint({
1009
- ...params,
1010
- fix: true
1011
- });
1012
- }, "fix");
922
+ var fix = (params) => {
923
+ return lint({ ...params, fix: true });
924
+ };
1013
925
 
1014
926
  // 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");
927
+ var genDocs = ({ pkg, incremental }) => {
928
+ return pkg ? genDocsPackage({ pkg }) : genDocsAll({ incremental });
929
+ };
930
+ var genDocsPackage = ({ pkg }) => {
931
+ const steps = [["yarn", ["workspace", pkg, "run", "package-gen-docs"]]];
932
+ return runSteps(`GenDocs [${pkg}]`, [...steps]);
933
+ };
934
+ var genDocsAll = ({ incremental }) => {
935
+ const incrementalOptions = incremental ? ["--since", "-pA"] : ["-pA"];
936
+ const steps = [["yarn", ["workspaces", "foreach", ...incrementalOptions, "run", "package-gen-docs"]]];
937
+ return runSteps(`GenDocs [All${incremental ? "-Incremental" : ""}]`, [...steps]);
938
+ };
1061
939
 
1062
940
  // src/actions/gitignore-gen.ts
1063
941
  var filename = ".gitignore";
1064
- var gitignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename, pkg), "gitignoreGen");
942
+ var gitignoreGen = (pkg) => generateIgnoreFiles(filename, pkg);
1065
943
 
1066
944
  // src/actions/gitlint.ts
1067
- import chalk14 from "chalk";
945
+ import chalk15 from "chalk";
1068
946
  import ParseGitConfig from "parse-git-config";
1069
- var gitlint = /* @__PURE__ */ __name(() => {
947
+ var gitlint = () => {
1070
948
  console.log(`
1071
949
  Gitlint Start [${process.cwd()}]
1072
950
  `);
@@ -1074,10 +952,10 @@ Gitlint Start [${process.cwd()}]
1074
952
  let warnings = 0;
1075
953
  const errors = 0;
1076
954
  const gitConfig = ParseGitConfig.sync();
1077
- const warn = /* @__PURE__ */ __name((message) => {
1078
- console.warn(chalk14.yellow(`Warning: ${message}`));
955
+ const warn = (message) => {
956
+ console.warn(chalk15.yellow(`Warning: ${message}`));
1079
957
  warnings++;
1080
- }, "warn");
958
+ };
1081
959
  if (gitConfig.core.ignorecase) {
1082
960
  warn("Please set core.ignorecase to FALSE in .git/config file [run yarn gitlint-fix]");
1083
961
  } else {
@@ -1095,67 +973,52 @@ Gitlint Start [${process.cwd()}]
1095
973
  }
1096
974
  const resultMessages = [];
1097
975
  if (valid > 0) {
1098
- resultMessages.push(chalk14.green(`Passed: ${valid}`));
976
+ resultMessages.push(chalk15.green(`Passed: ${valid}`));
1099
977
  }
1100
978
  if (warnings > 0) {
1101
- resultMessages.push(chalk14.yellow(`Warnings: ${warnings}`));
979
+ resultMessages.push(chalk15.yellow(`Warnings: ${warnings}`));
1102
980
  }
1103
981
  if (errors > 0) {
1104
- resultMessages.push(chalk14.red(` Errors: ${errors}`));
982
+ resultMessages.push(chalk15.red(` Errors: ${errors}`));
1105
983
  }
1106
984
  console.warn(`Gitlint Finish [ ${resultMessages.join(" | ")} ]
1107
985
  `);
1108
986
  return warnings + errors === 0 ? 1 : 0;
1109
- }, "gitlint");
987
+ };
1110
988
 
1111
989
  // src/actions/gitlint-fix.ts
1112
990
  import { execSync as execSync2 } from "node:child_process";
1113
- import chalk15 from "chalk";
991
+ import chalk16 from "chalk";
1114
992
  import ParseGitConfig2 from "parse-git-config";
1115
- var gitlintFix = /* @__PURE__ */ __name(() => {
993
+ var gitlintFix = () => {
1116
994
  console.log(`
1117
995
  Gitlint Fix Start [${process.cwd()}]
1118
996
  `);
1119
997
  const gitConfig = ParseGitConfig2.sync();
1120
998
  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"));
999
+ execSync2("git config core.ignorecase false", { stdio: "inherit" });
1000
+ console.warn(chalk16.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
1125
1001
  }
1126
1002
  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"));
1003
+ execSync2("git config core.autocrlf false", { stdio: "inherit" });
1004
+ console.warn(chalk16.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
1131
1005
  }
1132
1006
  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'));
1007
+ execSync2("git config core.eol lf", { stdio: "inherit" });
1008
+ console.warn(chalk16.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
1137
1009
  }
1138
1010
  return 1;
1139
- }, "gitlintFix");
1011
+ };
1140
1012
 
1141
1013
  // 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");
1014
+ var knip = () => {
1015
+ return runSteps("Knip", [["yarn", ["knip", "--dependencies", "--no-exit-code"]]]);
1016
+ };
1154
1017
 
1155
1018
  // src/actions/license.ts
1156
- import chalk16 from "chalk";
1019
+ import chalk17 from "chalk";
1157
1020
  import { init } from "license-checker";
1158
- var license = /* @__PURE__ */ __name(async (pkg) => {
1021
+ var license = async (pkg) => {
1159
1022
  const workspaces = yarnWorkspaces();
1160
1023
  const workspaceList = workspaces.filter(({ name }) => {
1161
1024
  return pkg === void 0 || name === pkg;
@@ -1178,114 +1041,79 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
1178
1041
  "LGPL-3.0-or-later",
1179
1042
  "Python-2.0"
1180
1043
  ]);
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;
1044
+ console.log(chalk17.green("License Checker"));
1045
+ return (await Promise.all(
1046
+ workspaceList.map(({ location, name }) => {
1047
+ return new Promise((resolve) => {
1048
+ init({ production: true, start: location }, (error, packages) => {
1049
+ if (error) {
1050
+ console.error(chalk17.red(`License Checker [${name}] Error`));
1051
+ console.error(chalk17.gray(error));
1052
+ console.log("\n");
1053
+ resolve(1);
1054
+ } else {
1055
+ console.log(chalk17.green(`License Checker [${name}]`));
1056
+ let count = 0;
1057
+ for (const [name2, info] of Object.entries(packages)) {
1058
+ const licenses = Array.isArray(info.licenses) ? info.licenses : [info.licenses];
1059
+ for (let license2 of licenses) {
1060
+ if (license2) {
1061
+ const processedLicense = license2[0] === "(" && license2.at(-1) === ")" ? license2.slice(1, -2) : license2;
1062
+ const orLicenses = processedLicense.split(" OR ");
1063
+ let orLicenseFound = false;
1064
+ for (const orLicense of orLicenses) {
1065
+ if (exclude.has(orLicense)) {
1066
+ orLicenseFound = true;
1067
+ }
1068
+ }
1069
+ if (!orLicenseFound) {
1070
+ count++;
1071
+ console.warn(chalk17.yellow(`${name2}: Package License not allowed [${license2}]`));
1208
1072
  }
1209
- }
1210
- if (!orLicenseFound) {
1211
- count++;
1212
- console.warn(chalk16.yellow(`${name2}: Package License not allowed [${license2}]`));
1213
1073
  }
1214
1074
  }
1215
1075
  }
1076
+ console.log("\n");
1077
+ resolve(count);
1216
1078
  }
1217
- console.log("\n");
1218
- resolve(count);
1219
- }
1079
+ });
1220
1080
  });
1221
- });
1222
- }))).reduce((prev, value) => prev || value, 0);
1223
- }, "license");
1081
+ })
1082
+ )).reduce((prev, value) => prev || value, 0);
1083
+ };
1224
1084
 
1225
1085
  // src/actions/npmignore-gen.ts
1226
1086
  var filename2 = ".npmignore";
1227
- var npmignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename2, pkg), "npmignoreGen");
1087
+ var npmignoreGen = (pkg) => generateIgnoreFiles(filename2, pkg);
1228
1088
 
1229
1089
  // 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");
1090
+ var publint = async ({ verbose, pkg }) => {
1091
+ return pkg ? await publintPackage({ pkg, verbose }) : publintAll({ verbose });
1092
+ };
1093
+ var publintPackage = ({ pkg }) => {
1094
+ return runStepsAsync(`Publint [${pkg}]`, [["yarn", ["workspace", pkg, "run", "package-publint"]]]);
1095
+ };
1096
+ var publintAll = ({ verbose }) => {
1097
+ const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
1098
+ return runSteps("Publint", [["yarn", ["workspaces", "foreach", "-pA", ...verboseOptions, "run", "package-publint"]]]);
1099
+ };
1271
1100
 
1272
1101
  // src/actions/rebuild.ts
1273
- var rebuild = /* @__PURE__ */ __name(({ target }) => {
1102
+ var rebuild = ({ target }) => {
1274
1103
  return runSteps("Rebuild", [
1275
- [
1276
- "yarn",
1277
- "xy clean"
1278
- ],
1279
- [
1280
- "yarn",
1281
- target ? `xy build -t ${target}` : "xy build"
1282
- ]
1104
+ ["yarn", "xy clean"],
1105
+ ["yarn", target ? `xy build -t ${target}` : "xy build"]
1283
1106
  ]);
1284
- }, "rebuild");
1107
+ };
1285
1108
 
1286
1109
  // src/actions/recompile.ts
1287
- import chalk17 from "chalk";
1288
- var recompile = /* @__PURE__ */ __name(async ({ verbose, target, pkg, incremental }) => {
1110
+ import chalk18 from "chalk";
1111
+ var recompile = async ({
1112
+ verbose,
1113
+ target,
1114
+ pkg,
1115
+ incremental
1116
+ }) => {
1289
1117
  return pkg ? await recompilePackage({
1290
1118
  pkg,
1291
1119
  target,
@@ -1295,51 +1123,27 @@ var recompile = /* @__PURE__ */ __name(async ({ verbose, target, pkg, incrementa
1295
1123
  target,
1296
1124
  verbose
1297
1125
  });
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 }) => {
1126
+ };
1127
+ var recompilePackage = ({ target, pkg }) => {
1128
+ const targetOptions = target ? ["-t", target] : [];
1129
+ return runStepsAsync(
1130
+ `Recompile [${pkg}]`,
1131
+ [["yarn", ["workspace", pkg, "run", "package-recompile", ...targetOptions]]]
1132
+ );
1133
+ };
1134
+ var recompileAll = async ({
1135
+ jobs,
1136
+ verbose,
1137
+ target,
1138
+ incremental
1139
+ }) => {
1318
1140
  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
- ] : [];
1141
+ const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
1142
+ const targetOptions = target ? ["-t", target] : [];
1143
+ const incrementalOptions = incremental ? ["--since", "-Apt", "--topological-dev"] : ["--parallel", "-Apt", "--topological-dev"];
1144
+ const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
1341
1145
  if (jobs) {
1342
- console.log(chalk17.blue(`Jobs set to [${jobs}]`));
1146
+ console.log(chalk18.blue(`Jobs set to [${jobs}]`));
1343
1147
  }
1344
1148
  const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
1345
1149
  [
@@ -1369,13 +1173,19 @@ var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, increm
1369
1173
  ]
1370
1174
  ]
1371
1175
  ]);
1372
- console.log(`${chalk17.gray("Recompiled in")} [${chalk17.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk17.gray("seconds")}`);
1176
+ console.log(
1177
+ `${chalk18.gray("Recompiled in")} [${chalk18.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk18.gray("seconds")}`
1178
+ );
1373
1179
  return result;
1374
- }, "recompileAll");
1180
+ };
1375
1181
 
1376
1182
  // src/actions/reinstall.ts
1377
- import { closeSync, openSync, rmSync } from "node:fs";
1378
- var reinstall = /* @__PURE__ */ __name(() => {
1183
+ import {
1184
+ closeSync,
1185
+ openSync,
1186
+ rmSync
1187
+ } from "node:fs";
1188
+ var reinstall = () => {
1379
1189
  console.log("Reinstall [Clear Lock File]");
1380
1190
  closeSync(openSync("./yarn.lock", "w"));
1381
1191
  console.log("Reinstall [Clear Node Modules]");
@@ -1383,10 +1193,7 @@ var reinstall = /* @__PURE__ */ __name(() => {
1383
1193
  const result = workspaces.map(({ location, name }) => {
1384
1194
  const dist = `${location}/node_modules`;
1385
1195
  try {
1386
- rmSync(dist, {
1387
- force: true,
1388
- recursive: true
1389
- });
1196
+ rmSync(dist, { force: true, recursive: true });
1390
1197
  return 0;
1391
1198
  } catch (ex) {
1392
1199
  const error = ex;
@@ -1394,533 +1201,580 @@ var reinstall = /* @__PURE__ */ __name(() => {
1394
1201
  return 1;
1395
1202
  }
1396
1203
  }).reduce((prev, result2) => prev || result2, 0);
1397
- return result || runSteps("Reinstall", [
1398
- [
1399
- "yarn",
1400
- "install --network-timeout 10000"
1401
- ]
1402
- ]);
1403
- }, "reinstall");
1204
+ return result || runSteps("Reinstall", [["yarn", "install --network-timeout 10000"]]);
1205
+ };
1404
1206
 
1405
1207
  // src/actions/relint.ts
1406
- import chalk18 from "chalk";
1407
- var relintPackage = /* @__PURE__ */ __name(({ pkg }) => {
1408
- console.log(chalk18.gray(`${"Relint"} [All-Packages]`));
1208
+ import chalk19 from "chalk";
1209
+ var relintPackage = ({ pkg }) => {
1210
+ console.log(chalk19.gray(`${"Relint"} [All-Packages]`));
1409
1211
  const start = Date.now();
1410
1212
  const result = runSteps("Relint [All-Packages]", [
1411
- [
1412
- "yarn",
1413
- [
1414
- "workspace",
1415
- pkg,
1416
- "run",
1417
- "package-relint"
1418
- ]
1419
- ]
1213
+ ["yarn", [
1214
+ "workspace",
1215
+ pkg,
1216
+ "run",
1217
+ "package-relint"
1218
+ ]]
1420
1219
  ]);
1421
- console.log(chalk18.gray(`${"Relinted in"} [${chalk18.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk18.gray("seconds")}`));
1220
+ console.log(chalk19.gray(`${"Relinted in"} [${chalk19.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk19.gray("seconds")}`));
1422
1221
  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]`));
1222
+ };
1223
+ var relint = ({
1224
+ pkg,
1225
+ verbose,
1226
+ incremental
1227
+ } = {}) => {
1228
+ return pkg ? relintPackage({ pkg }) : relintAllPackages({ verbose, incremental });
1229
+ };
1230
+ var relintAllPackages = ({ verbose = true, incremental } = {}) => {
1231
+ console.log(chalk19.gray(`${"Relint"} [All-Packages]`));
1434
1232
  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
- ];
1233
+ const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
1234
+ const incrementalOptions = incremental ? ["--since", "-Ap"] : ["--parallel", "-Ap"];
1447
1235
  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
- ]
1236
+ ["yarn", [
1237
+ "workspaces",
1238
+ "foreach",
1239
+ ...verboseOptions,
1240
+ ...incrementalOptions,
1241
+ "run",
1242
+ "package-relint"
1243
+ ]]
1459
1244
  ]);
1460
- console.log(chalk18.gray(`Relinted in [${chalk18.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk18.gray("seconds")}`));
1245
+ console.log(chalk19.gray(`Relinted in [${chalk19.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk19.gray("seconds")}`));
1461
1246
  return result;
1462
- }, "relintAllPackages");
1247
+ };
1463
1248
 
1464
1249
  // src/actions/retest.ts
1465
- var retest = /* @__PURE__ */ __name(() => {
1250
+ var retest = () => {
1466
1251
  return runSteps("Test", [
1467
- [
1468
- "yarn",
1469
- [
1470
- "jest",
1471
- "--clearCache"
1472
- ]
1473
- ],
1474
- [
1475
- "yarn",
1476
- [
1477
- "jest",
1478
- "."
1479
- ]
1480
- ]
1252
+ ["yarn", ["jest", "--clearCache"]],
1253
+ ["yarn", ["jest", "."]]
1481
1254
  ]);
1482
- }, "retest");
1255
+ };
1483
1256
 
1484
1257
  // 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");
1258
+ var sonar = () => {
1259
+ return runSteps("Sonar", [["yarn", ["eslint", "-c", "sonar.eslintrc", "."]]]);
1260
+ };
1498
1261
 
1499
1262
  // 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"));
1263
+ import chalk20 from "chalk";
1264
+ var DefaultDependencies = ["axios", "@xylabs/pixel", "react", "graphql", "react-router", "@mui/material", "@mui/system"];
1265
+ var statics = () => {
1266
+ console.log(chalk20.green("Check Required Static Dependencies"));
1512
1267
  const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
1513
1268
  return detectDuplicateDependencies(statics2, DefaultDependencies);
1514
- }, "statics");
1269
+ };
1515
1270
 
1516
1271
  // 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");
1272
+ var test = () => {
1273
+ return runSteps("Test", [["yarn", ["vitest", "."]]]);
1274
+ };
1528
1275
 
1529
1276
  // src/actions/up.ts
1530
- var up = /* @__PURE__ */ __name(() => {
1531
- return runSteps("Up", [
1532
- [
1533
- "yarn",
1534
- "outdated"
1535
- ]
1536
- ]);
1537
- }, "up");
1277
+ var up = () => {
1278
+ return runSteps("Up", [["yarn", "outdated"]]);
1279
+ };
1538
1280
 
1539
1281
  // src/actions/updo.ts
1540
- var updo = /* @__PURE__ */ __name(() => {
1282
+ var updo = () => {
1541
1283
  return runSteps("Updo", [
1542
- [
1543
- "yarn",
1544
- "install"
1545
- ],
1546
- [
1547
- "yarn",
1548
- "upgrade-interactive"
1549
- ],
1550
- [
1551
- "yarn",
1552
- "dedupe"
1553
- ]
1284
+ ["yarn", "install"],
1285
+ ["yarn", "upgrade-interactive"],
1286
+ ["yarn", "dedupe"]
1554
1287
  ]);
1555
- }, "updo");
1288
+ };
1556
1289
 
1557
1290
  // src/actions/upplug.ts
1558
- var updateYarnPlugins = /* @__PURE__ */ __name(() => {
1291
+ var updateYarnPlugins = () => {
1559
1292
  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
- ]
1293
+ ["yarn", ["plugin", "import", "https://mskelton.dev/yarn-outdated/v3"]],
1294
+ ["yarn", ["plugin", "import", "version"]],
1295
+ ["yarn", ["plugin", "import", "interactive-tools"]],
1296
+ ["yarn", ["plugin", "import", "workspace-tools"]]
1592
1297
  ]);
1593
- }, "updateYarnPlugins");
1298
+ };
1594
1299
 
1595
1300
  // 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");
1301
+ var updateYarnVersion = () => {
1302
+ return runSteps("Update Yarn Version", [["yarn", ["set", "version", "latest"]]]);
1303
+ };
1608
1304
 
1609
1305
  // src/actions/yarn3only.ts
1610
- var yarn3Only = /* @__PURE__ */ __name(() => {
1306
+ var yarn3Only = () => {
1611
1307
  const [valid, version] = isYarnVersionOrGreater(3);
1612
1308
  if (!valid) {
1613
1309
  processEx(`Invalid Yarn version [${version}]`);
1614
1310
  }
1615
1311
  return 0;
1616
- }, "yarn3Only");
1312
+ };
1617
1313
 
1618
1314
  // 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"}`);
1315
+ var xyBuildCommands = (args) => {
1316
+ return args.command(
1317
+ "build [package]",
1318
+ "Build - Compile & Lint",
1319
+ (yargs2) => {
1320
+ return yargs2.positional("package", { describe: "Specific package to build" });
1321
+ },
1322
+ async (argv) => {
1323
+ if (argv.verbose) {
1324
+ console.log(`Building: ${argv.package ?? "all"}`);
1325
+ }
1326
+ process.exitCode = await build({
1327
+ incremental: !!argv.incremental,
1328
+ jobs: argv.jobs,
1329
+ pkg: argv.package,
1330
+ target: argv.target,
1331
+ verbose: !!argv.verbose
1332
+ });
1627
1333
  }
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"}`);
1334
+ ).command(
1335
+ "compile [package]",
1336
+ "Compile with Typescript & Copy Images",
1337
+ (yargs2) => {
1338
+ return yargs2.positional("package", { describe: "Specific package to compile" });
1339
+ },
1340
+ (argv) => {
1341
+ if (argv.verbose) {
1342
+ console.log(`Compiling: ${argv.package ?? "all"}`);
1343
+ }
1344
+ process.exitCode = compile({
1345
+ incremental: !!argv.incremental,
1346
+ jobs: argv.jobs,
1347
+ pkg: argv.package,
1348
+ target: argv.target,
1349
+ verbose: !!argv.verbose
1350
+ });
1642
1351
  }
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"}`);
1352
+ ).command(
1353
+ "compile-types [package]",
1354
+ "Compile types with Typescript",
1355
+ (yargs2) => {
1356
+ return yargs2.positional("package", { describe: "Specific package to compile" });
1357
+ },
1358
+ (argv) => {
1359
+ if (argv.verbose) {
1360
+ console.log(`Compiling: ${argv.package ?? "all"}`);
1361
+ }
1362
+ process.exitCode = compileTypes({
1363
+ incremental: !!argv.incremental,
1364
+ jobs: argv.jobs,
1365
+ pkg: argv.package,
1366
+ verbose: !!argv.verbose
1367
+ });
1657
1368
  }
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"}`);
1369
+ ).command(
1370
+ "compile-only [package]",
1371
+ "Compile with Typescript & Copy Images (No Publint)",
1372
+ (yargs2) => {
1373
+ return yargs2.positional("package", { describe: "Specific package to compile" });
1374
+ },
1375
+ (argv) => {
1376
+ if (argv.verbose) {
1377
+ console.log(`Compiling: ${argv.package ?? "all"}`);
1378
+ }
1379
+ process.exitCode = compile({
1380
+ incremental: !!argv.incremental,
1381
+ jobs: argv.jobs,
1382
+ pkg: argv.package,
1383
+ publint: false,
1384
+ target: argv.target,
1385
+ verbose: !!argv.verbose
1386
+ });
1671
1387
  }
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"}`);
1388
+ ).command(
1389
+ "recompile [package]",
1390
+ "Re-compile with Typescript & Copy Images",
1391
+ (yargs2) => {
1392
+ return yargs2.positional("package", { describe: "Specific package to re-compile" });
1393
+ },
1394
+ async (argv) => {
1395
+ if (argv.verbose) {
1396
+ console.log(`Re-compiling: ${argv.package ?? "all"}`);
1397
+ }
1398
+ process.exitCode = await recompile({
1399
+ incremental: !!argv.incremental,
1400
+ jobs: argv.jobs,
1401
+ pkg: argv.package,
1402
+ target: argv.target,
1403
+ verbose: !!argv.verbose
1404
+ });
1687
1405
  }
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");
1406
+ ).command(
1407
+ "rebuild [package]",
1408
+ "Rebuild - Clean, Compile & Lint",
1409
+ (yargs2) => {
1410
+ return yargs2.positional("package", { describe: "Specific package to rebuild" });
1411
+ },
1412
+ (argv) => {
1413
+ if (argv.verbose) console.log(`Rebuilding: ${argv.package ?? "all"}`);
1414
+ process.exitCode = rebuild({ target: argv.target });
1415
+ }
1416
+ ).command(
1417
+ "copy-assets [package]",
1418
+ "Copy Assets - Copy the assets from src to dist",
1419
+ (yargs2) => {
1420
+ return yargs2.positional("package", { describe: "Specific package to copy assets" });
1421
+ },
1422
+ async (argv) => {
1423
+ if (argv.verbose) console.log(`Copying Assets: ${argv.package ?? "all"}`);
1424
+ process.exitCode = await copyAssets({ target: argv.target });
1425
+ }
1426
+ );
1427
+ };
1715
1428
 
1716
1429
  // src/xy/param.ts
1717
- var packagePositionalParam = /* @__PURE__ */ __name((yargs2) => {
1718
- return yargs2.positional("package", {
1719
- describe: "Specific package to target"
1720
- });
1721
- }, "packagePositionalParam");
1430
+ var packagePositionalParam = (yargs2) => {
1431
+ return yargs2.positional("package", { describe: "Specific package to target" });
1432
+ };
1722
1433
 
1723
1434
  // 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");
1435
+ var xyCommonCommands = (args) => {
1436
+ return args.command(
1437
+ "license [package]",
1438
+ "License - Check licenses of dependencies",
1439
+ (yargs2) => {
1440
+ return packagePositionalParam(yargs2);
1441
+ },
1442
+ async (argv) => {
1443
+ if (argv.verbose) console.log(`License: ${argv.package ?? "all"}`);
1444
+ process.exitCode = await license();
1445
+ }
1446
+ ).command(
1447
+ "dead [package]",
1448
+ "Dead - Check for dead code",
1449
+ (yargs2) => {
1450
+ return packagePositionalParam(yargs2);
1451
+ },
1452
+ (argv) => {
1453
+ if (argv.verbose) console.log("Dead");
1454
+ process.exitCode = dead();
1455
+ }
1456
+ ).command(
1457
+ "gen-docs [package]",
1458
+ "GenDocs - Generate TypeDocs",
1459
+ (yargs2) => {
1460
+ return packagePositionalParam(yargs2);
1461
+ },
1462
+ (argv) => {
1463
+ if (argv.verbose) console.log(`Generating TypeDocs: ${argv.package ?? "all"}`);
1464
+ process.exitCode = genDocs({ incremental: !!argv.incremental, pkg: argv.package });
1465
+ }
1466
+ ).command(
1467
+ "clean-docs",
1468
+ "CleanDocs - Clean TypeDocs",
1469
+ (yargs2) => yargs2,
1470
+ (argv) => {
1471
+ if (argv.verbose) console.log("Cleaning TypeDocs: all");
1472
+ process.exitCode = cleanDocs();
1473
+ }
1474
+ ).command(
1475
+ "gitlint [package]",
1476
+ "Gitlint - Lint your git config",
1477
+ (yargs2) => {
1478
+ return yargs2;
1479
+ },
1480
+ (argv) => {
1481
+ if (argv.verbose) console.log("Gitlint");
1482
+ process.exitCode = argv.fix ? gitlintFix() : gitlint();
1483
+ }
1484
+ ).command(
1485
+ "gitignore-gen",
1486
+ "GitIgnore Gen - Generate .gitignore files",
1487
+ (yargs2) => {
1488
+ return yargs2;
1489
+ },
1490
+ (argv) => {
1491
+ if (argv.verbose) console.log("GitIgnore Gen");
1492
+ process.exitCode = gitignoreGen();
1493
+ }
1494
+ ).command(
1495
+ "npmignore-gen",
1496
+ "NpmIgnore Gen - Generate .npmignore files",
1497
+ (yargs2) => {
1498
+ return yargs2;
1499
+ },
1500
+ (argv) => {
1501
+ if (argv.verbose) console.log("NpmIgnore Gen");
1502
+ process.exitCode = npmignoreGen();
1503
+ }
1504
+ ).command(
1505
+ "retest",
1506
+ "Re-Test - Run Jest Tests with cleaned cache",
1507
+ (yargs2) => {
1508
+ return yargs2;
1509
+ },
1510
+ (argv) => {
1511
+ if (argv.verbose) console.log("Re-Testing");
1512
+ process.exitCode = retest();
1513
+ }
1514
+ ).command(
1515
+ "test",
1516
+ "Test - Run Jest Tests",
1517
+ (yargs2) => {
1518
+ return yargs2;
1519
+ },
1520
+ (argv) => {
1521
+ if (argv.verbose) console.log("Testing");
1522
+ process.exitCode = test();
1523
+ }
1524
+ ).command(
1525
+ "upplug",
1526
+ "UpPlug - Update Yarn Plugins",
1527
+ (yargs2) => {
1528
+ return yargs2;
1529
+ },
1530
+ (argv) => {
1531
+ if (argv.verbose) console.log("UpPlug");
1532
+ process.exitCode = updateYarnPlugins();
1533
+ }
1534
+ ).command(
1535
+ "upyarn",
1536
+ "UpYarn - Update Yarn Version",
1537
+ (yargs2) => {
1538
+ return yargs2;
1539
+ },
1540
+ (argv) => {
1541
+ if (argv.verbose) console.log("UpYarn");
1542
+ process.exitCode = updateYarnVersion();
1543
+ }
1544
+ ).command(
1545
+ "yarn3only",
1546
+ "Yarn3Only - Check if using Yarn v3",
1547
+ (yargs2) => {
1548
+ return yargs2;
1549
+ },
1550
+ (argv) => {
1551
+ if (argv.verbose) console.log("Yarn 3 Check");
1552
+ process.exitCode = yarn3Only();
1553
+ }
1554
+ );
1555
+ };
1788
1556
 
1789
1557
  // 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");
1558
+ var xyDeployCommands = (args) => {
1559
+ return args.command(
1560
+ "deploy",
1561
+ "Deploy - Deploy patch",
1562
+ (yargs2) => {
1563
+ return yargs2;
1564
+ },
1565
+ (argv) => {
1566
+ if (argv.verbose) console.log("Deploy patch");
1567
+ process.exitCode = deploy();
1568
+ }
1569
+ ).command(
1570
+ "deploy-minor",
1571
+ "Deploy - Deploy minor",
1572
+ (yargs2) => {
1573
+ return yargs2;
1574
+ },
1575
+ (argv) => {
1576
+ if (argv.verbose) console.log("Deploy minor");
1577
+ process.exitCode = deployMinor();
1578
+ }
1579
+ ).command(
1580
+ "deploy-major",
1581
+ "Deploy - Deploy major",
1582
+ (yargs2) => {
1583
+ return yargs2;
1584
+ },
1585
+ (argv) => {
1586
+ if (argv.verbose) console.log("Deploy major");
1587
+ process.exitCode = deployMajor();
1588
+ }
1589
+ ).command(
1590
+ "deploy-next",
1591
+ "Deploy - Deploy next",
1592
+ (yargs2) => {
1593
+ return yargs2;
1594
+ },
1595
+ (argv) => {
1596
+ if (argv.verbose) console.log("Deploy next");
1597
+ process.exitCode = deployNext();
1598
+ }
1599
+ );
1600
+ };
1813
1601
 
1814
1602
  // 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"}`);
1603
+ var xyInstallCommands = (args) => {
1604
+ return args.command(
1605
+ "clean [package]",
1606
+ "Clean",
1607
+ (yargs2) => {
1608
+ return yargs2.positional("package", { describe: "Specific package to clean" });
1609
+ },
1610
+ async (argv) => {
1611
+ if (argv.verbose) {
1612
+ console.log(`Cleaning: ${argv.package ?? "all"}`);
1613
+ }
1614
+ process.exitCode = await clean({
1615
+ pkg: argv.package,
1616
+ verbose: !!argv.verbose
1617
+ });
1823
1618
  }
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");
1619
+ ).command(
1620
+ "reinstall",
1621
+ "Reinstall - Clean & Install",
1622
+ (yargs2) => {
1623
+ return yargs2;
1624
+ },
1625
+ (argv) => {
1626
+ if (argv.verbose) console.log("Reinstalling");
1627
+ process.exitCode = reinstall();
1628
+ }
1629
+ ).command(
1630
+ "up",
1631
+ "Up - Update dependencies",
1632
+ (yargs2) => {
1633
+ return yargs2;
1634
+ },
1635
+ (argv) => {
1636
+ if (argv.verbose) console.log("Up");
1637
+ process.exitCode = up();
1638
+ }
1639
+ ).command(
1640
+ "updo",
1641
+ "Updo - Update dependencies [Interactive]",
1642
+ (yargs2) => {
1643
+ return yargs2;
1644
+ },
1645
+ (argv) => {
1646
+ if (argv.verbose) console.log("Updo");
1647
+ process.exitCode = updo();
1648
+ }
1649
+ ).command(
1650
+ "statics",
1651
+ "Statics - Confirming Static Packages",
1652
+ (yargs2) => {
1653
+ return yargs2;
1654
+ },
1655
+ (argv) => {
1656
+ if (argv.verbose) console.log("Statics");
1657
+ process.exitCode = statics();
1658
+ }
1659
+ ).command(
1660
+ "dupdeps",
1661
+ "Dupdeps - Duplicate Dependencies in package.json",
1662
+ (yargs2) => {
1663
+ return yargs2;
1664
+ },
1665
+ (argv) => {
1666
+ if (argv.verbose) console.log("Dupdeps");
1667
+ process.exitCode = dupdeps();
1668
+ }
1669
+ );
1670
+ };
1855
1671
 
1856
1672
  // 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");
1673
+ import chalk21 from "chalk";
1674
+ var xyLintCommands = (args) => {
1675
+ return args.command(
1676
+ "cycle [package]",
1677
+ "Cycle - Check for dependency cycles",
1678
+ (yargs2) => {
1679
+ return packagePositionalParam(yargs2);
1680
+ },
1681
+ async (argv) => {
1682
+ const start = Date.now();
1683
+ if (argv.verbose) console.log("Cycle");
1684
+ process.exitCode = await cycle({ pkg: argv.package });
1685
+ console.log(chalk21.blue(`Finished in ${Date.now() - start}ms`));
1686
+ }
1687
+ ).command(
1688
+ "lint [package]",
1689
+ "Lint - Run Eslint",
1690
+ (yargs2) => {
1691
+ return packagePositionalParam(yargs2);
1692
+ },
1693
+ (argv) => {
1694
+ if (argv.verbose) console.log("Lint");
1695
+ const start = Date.now();
1696
+ process.exitCode = argv.fix ? fix({ pkg: argv.package }) : lint({ pkg: argv.package });
1697
+ console.log(chalk21.blue(`Finished in ${Date.now() - start}ms`));
1698
+ }
1699
+ ).command(
1700
+ "deplint [package]",
1701
+ "Deplint - Run Deplint",
1702
+ (yargs2) => {
1703
+ return packagePositionalParam(yargs2);
1704
+ },
1705
+ (argv) => {
1706
+ if (argv.verbose) console.log("Deplint");
1707
+ const start = Date.now();
1708
+ process.exitCode = deplint({ pkg: argv.package });
1709
+ console.log(chalk21.blue(`Finished in ${Date.now() - start}ms`));
1710
+ }
1711
+ ).command(
1712
+ "fix [package]",
1713
+ "Fix - Run Eslint w/fix",
1714
+ (yargs2) => {
1715
+ return packagePositionalParam(yargs2);
1716
+ },
1717
+ (argv) => {
1718
+ const start = Date.now();
1719
+ if (argv.verbose) console.log("Fix");
1720
+ process.exitCode = fix();
1721
+ console.log(chalk21.blue(`Finished in ${Date.now() - start}ms`));
1722
+ }
1723
+ ).command(
1724
+ "relint [package]",
1725
+ "Relint - Clean & Lint",
1726
+ (yargs2) => {
1727
+ return packagePositionalParam(yargs2);
1728
+ },
1729
+ (argv) => {
1730
+ if (argv.verbose) console.log("Relinting");
1731
+ const start = Date.now();
1732
+ process.exitCode = relint();
1733
+ console.log(chalk21.blue(`Finished in ${Date.now() - start}ms`));
1734
+ }
1735
+ ).command(
1736
+ "publint [package]",
1737
+ "Publint - Run Publint",
1738
+ (yargs2) => {
1739
+ return packagePositionalParam(yargs2);
1740
+ },
1741
+ async (argv) => {
1742
+ if (argv.verbose) console.log("Publint");
1743
+ const start = Date.now();
1744
+ process.exitCode = await publint({ pkg: argv.package, verbose: !!argv.verbose });
1745
+ console.log(chalk21.blue(`Finished in ${Date.now() - start}ms`));
1746
+ }
1747
+ ).command(
1748
+ "knip",
1749
+ "Knip - Run Knip",
1750
+ (yargs2) => {
1751
+ return packagePositionalParam(yargs2);
1752
+ },
1753
+ (argv) => {
1754
+ if (argv.verbose) console.log("Knip");
1755
+ const start = Date.now();
1756
+ process.exitCode = knip();
1757
+ console.log(chalk21.blue(`Knip finished in ${Date.now() - start}ms`));
1758
+ }
1759
+ ).command(
1760
+ "sonar",
1761
+ "Sonar - Run Sonar Check",
1762
+ (yargs2) => {
1763
+ return packagePositionalParam(yargs2);
1764
+ },
1765
+ (argv) => {
1766
+ const start = Date.now();
1767
+ if (argv.verbose) console.log("Sonar Check");
1768
+ process.exitCode = sonar();
1769
+ console.log(chalk21.blue(`Finished in ${Date.now() - start}ms`));
1770
+ }
1771
+ );
1772
+ };
1919
1773
 
1920
1774
  // src/xy/xyParseOptions.ts
1921
1775
  import yargs from "yargs";
1922
1776
  import { hideBin } from "yargs/helpers";
1923
- var xyParseOptions = /* @__PURE__ */ __name(() => {
1777
+ var xyParseOptions = () => {
1924
1778
  return yargs(hideBin(process.argv)).scriptName("yarn xy").option("jobs", {
1925
1779
  alias: "j",
1926
1780
  default: void 0,
@@ -1934,10 +1788,7 @@ var xyParseOptions = /* @__PURE__ */ __name(() => {
1934
1788
  }).option("target", {
1935
1789
  alias: "t",
1936
1790
  default: "esm",
1937
- choices: [
1938
- "esm",
1939
- "cjs"
1940
- ],
1791
+ choices: ["esm", "cjs"],
1941
1792
  description: "Limit output to specific target",
1942
1793
  type: "string"
1943
1794
  }).option("incremental", {
@@ -1962,23 +1813,20 @@ var xyParseOptions = /* @__PURE__ */ __name(() => {
1962
1813
  type: "boolean"
1963
1814
  }).option("types", {
1964
1815
  default: "tsc",
1965
- choices: [
1966
- "tsc",
1967
- "tsup"
1968
- ],
1816
+ choices: ["tsc", "tsup"],
1969
1817
  description: "Tool to generate Typescript types",
1970
1818
  type: "string"
1971
1819
  });
1972
- }, "xyParseOptions");
1820
+ };
1973
1821
 
1974
1822
  // src/xy/xy.ts
1975
- var xy = /* @__PURE__ */ __name(async () => {
1823
+ var xy = async () => {
1976
1824
  const options = xyParseOptions();
1977
1825
  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"));
1826
+ console.error(chalk22.yellow(`Command not found [${chalk22.magenta(process.argv[2])}]`));
1827
+ console.log(chalk22.gray("Try 'yarn xy --help' for list of commands"));
1980
1828
  }).version().help().argv;
1981
- }, "xy");
1829
+ };
1982
1830
  export {
1983
1831
  xy,
1984
1832
  xyBuildCommands,