@xylabs/ts-scripts-yarn3 6.3.5 → 6.4.0

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