@xylabs/ts-scripts-yarn3 6.3.4 → 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 -50
  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 -1237
  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 -44
  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 -1233
  160. package/dist/bin/xy.mjs.map +1 -1
  161. package/dist/index.d.ts +5 -1
  162. package/dist/index.mjs +1334 -1579
  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 -1234
  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 -1234
  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 -288
  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 +5 -24
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,243 +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();
911
+ const fixOptions = fix2 ? ["--fix"] : [];
991
912
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
992
- [
993
- "yarn",
994
- [
995
- "eslint"
996
- ]
997
- ]
913
+ ["yarn", ["eslint", ...fixOptions]]
998
914
  ]);
999
- 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")}`));
1000
916
  return result;
1001
- }, "lintAllPackages");
917
+ };
1002
918
 
1003
919
  // src/actions/fix.ts
1004
- var fix = /* @__PURE__ */ __name((params) => {
1005
- return lint({
1006
- ...params,
1007
- fix: true
1008
- });
1009
- }, "fix");
920
+ var fix = (params) => {
921
+ return lint({ ...params, fix: true });
922
+ };
1010
923
 
1011
924
  // src/actions/gen-docs.ts
1012
- var genDocs = /* @__PURE__ */ __name(({ pkg, incremental }) => {
1013
- return pkg ? genDocsPackage({
1014
- pkg
1015
- }) : genDocsAll({
1016
- incremental
1017
- });
1018
- }, "genDocs");
1019
- var genDocsPackage = /* @__PURE__ */ __name(({ pkg }) => {
1020
- const steps = [
1021
- [
1022
- "yarn",
1023
- [
1024
- "workspace",
1025
- pkg,
1026
- "run",
1027
- "package-gen-docs"
1028
- ]
1029
- ]
1030
- ];
1031
- return runSteps(`GenDocs [${pkg}]`, [
1032
- ...steps
1033
- ]);
1034
- }, "genDocsPackage");
1035
- var genDocsAll = /* @__PURE__ */ __name(({ incremental }) => {
1036
- const incrementalOptions = incremental ? [
1037
- "--since",
1038
- "-pA"
1039
- ] : [
1040
- "-pA"
1041
- ];
1042
- const steps = [
1043
- [
1044
- "yarn",
1045
- [
1046
- "workspaces",
1047
- "foreach",
1048
- ...incrementalOptions,
1049
- "run",
1050
- "package-gen-docs"
1051
- ]
1052
- ]
1053
- ];
1054
- return runSteps(`GenDocs [All${incremental ? "-Incremental" : ""}]`, [
1055
- ...steps
1056
- ]);
1057
- }, "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
+ };
1058
937
 
1059
938
  // src/actions/gitignore-gen.ts
1060
939
  var filename = ".gitignore";
1061
- var gitignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename, pkg), "gitignoreGen");
940
+ var gitignoreGen = (pkg) => generateIgnoreFiles(filename, pkg);
1062
941
 
1063
942
  // src/actions/gitlint.ts
1064
- import chalk14 from "chalk";
943
+ import chalk15 from "chalk";
1065
944
  import ParseGitConfig from "parse-git-config";
1066
- var gitlint = /* @__PURE__ */ __name(() => {
945
+ var gitlint = () => {
1067
946
  console.log(`
1068
947
  Gitlint Start [${process.cwd()}]
1069
948
  `);
@@ -1071,10 +950,10 @@ Gitlint Start [${process.cwd()}]
1071
950
  let warnings = 0;
1072
951
  const errors = 0;
1073
952
  const gitConfig = ParseGitConfig.sync();
1074
- const warn = /* @__PURE__ */ __name((message) => {
1075
- console.warn(chalk14.yellow(`Warning: ${message}`));
953
+ const warn = (message) => {
954
+ console.warn(chalk15.yellow(`Warning: ${message}`));
1076
955
  warnings++;
1077
- }, "warn");
956
+ };
1078
957
  if (gitConfig.core.ignorecase) {
1079
958
  warn("Please set core.ignorecase to FALSE in .git/config file [run yarn gitlint-fix]");
1080
959
  } else {
@@ -1092,67 +971,52 @@ Gitlint Start [${process.cwd()}]
1092
971
  }
1093
972
  const resultMessages = [];
1094
973
  if (valid > 0) {
1095
- resultMessages.push(chalk14.green(`Passed: ${valid}`));
974
+ resultMessages.push(chalk15.green(`Passed: ${valid}`));
1096
975
  }
1097
976
  if (warnings > 0) {
1098
- resultMessages.push(chalk14.yellow(`Warnings: ${warnings}`));
977
+ resultMessages.push(chalk15.yellow(`Warnings: ${warnings}`));
1099
978
  }
1100
979
  if (errors > 0) {
1101
- resultMessages.push(chalk14.red(` Errors: ${errors}`));
980
+ resultMessages.push(chalk15.red(` Errors: ${errors}`));
1102
981
  }
1103
982
  console.warn(`Gitlint Finish [ ${resultMessages.join(" | ")} ]
1104
983
  `);
1105
984
  return warnings + errors === 0 ? 1 : 0;
1106
- }, "gitlint");
985
+ };
1107
986
 
1108
987
  // src/actions/gitlint-fix.ts
1109
988
  import { execSync as execSync2 } from "node:child_process";
1110
- import chalk15 from "chalk";
989
+ import chalk16 from "chalk";
1111
990
  import ParseGitConfig2 from "parse-git-config";
1112
- var gitlintFix = /* @__PURE__ */ __name(() => {
991
+ var gitlintFix = () => {
1113
992
  console.log(`
1114
993
  Gitlint Fix Start [${process.cwd()}]
1115
994
  `);
1116
995
  const gitConfig = ParseGitConfig2.sync();
1117
996
  if (gitConfig.core.ignorecase) {
1118
- execSync2("git config core.ignorecase false", {
1119
- stdio: "inherit"
1120
- });
1121
- 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"));
1122
999
  }
1123
1000
  if (gitConfig.core.autocrlf !== false) {
1124
- execSync2("git config core.autocrlf false", {
1125
- stdio: "inherit"
1126
- });
1127
- 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"));
1128
1003
  }
1129
1004
  if (gitConfig.core.eol !== "lf") {
1130
- execSync2("git config core.eol lf", {
1131
- stdio: "inherit"
1132
- });
1133
- 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'));
1134
1007
  }
1135
1008
  return 1;
1136
- }, "gitlintFix");
1009
+ };
1137
1010
 
1138
1011
  // src/actions/knip.ts
1139
- var knip = /* @__PURE__ */ __name(() => {
1140
- return runSteps("Knip", [
1141
- [
1142
- "yarn",
1143
- [
1144
- "knip",
1145
- "--dependencies",
1146
- "--no-exit-code"
1147
- ]
1148
- ]
1149
- ]);
1150
- }, "knip");
1012
+ var knip = () => {
1013
+ return runSteps("Knip", [["yarn", ["knip", "--dependencies", "--no-exit-code"]]]);
1014
+ };
1151
1015
 
1152
1016
  // src/actions/license.ts
1153
- import chalk16 from "chalk";
1017
+ import chalk17 from "chalk";
1154
1018
  import { init } from "license-checker";
1155
- var license = /* @__PURE__ */ __name(async (pkg) => {
1019
+ var license = async (pkg) => {
1156
1020
  const workspaces = yarnWorkspaces();
1157
1021
  const workspaceList = workspaces.filter(({ name }) => {
1158
1022
  return pkg === void 0 || name === pkg;
@@ -1175,114 +1039,79 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
1175
1039
  "LGPL-3.0-or-later",
1176
1040
  "Python-2.0"
1177
1041
  ]);
1178
- console.log(chalk16.green("License Checker"));
1179
- return (await Promise.all(workspaceList.map(({ location, name }) => {
1180
- return new Promise((resolve) => {
1181
- init({
1182
- production: true,
1183
- start: location
1184
- }, (error, packages) => {
1185
- if (error) {
1186
- console.error(chalk16.red(`License Checker [${name}] Error`));
1187
- console.error(chalk16.gray(error));
1188
- console.log("\n");
1189
- resolve(1);
1190
- } else {
1191
- console.log(chalk16.green(`License Checker [${name}]`));
1192
- let count = 0;
1193
- for (const [name2, info] of Object.entries(packages)) {
1194
- const licenses = Array.isArray(info.licenses) ? info.licenses : [
1195
- info.licenses
1196
- ];
1197
- for (let license2 of licenses) {
1198
- if (license2) {
1199
- const processedLicense = license2[0] === "(" && license2.at(-1) === ")" ? license2.slice(1, -2) : license2;
1200
- const orLicenses = processedLicense.split(" OR ");
1201
- let orLicenseFound = false;
1202
- for (const orLicense of orLicenses) {
1203
- if (exclude.has(orLicense)) {
1204
- 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}]`));
1205
1070
  }
1206
- }
1207
- if (!orLicenseFound) {
1208
- count++;
1209
- console.warn(chalk16.yellow(`${name2}: Package License not allowed [${license2}]`));
1210
1071
  }
1211
1072
  }
1212
1073
  }
1074
+ console.log("\n");
1075
+ resolve(count);
1213
1076
  }
1214
- console.log("\n");
1215
- resolve(count);
1216
- }
1077
+ });
1217
1078
  });
1218
- });
1219
- }))).reduce((prev, value) => prev || value, 0);
1220
- }, "license");
1079
+ })
1080
+ )).reduce((prev, value) => prev || value, 0);
1081
+ };
1221
1082
 
1222
1083
  // src/actions/npmignore-gen.ts
1223
1084
  var filename2 = ".npmignore";
1224
- var npmignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename2, pkg), "npmignoreGen");
1085
+ var npmignoreGen = (pkg) => generateIgnoreFiles(filename2, pkg);
1225
1086
 
1226
1087
  // src/actions/publint.ts
1227
- var publint = /* @__PURE__ */ __name(async ({ verbose, pkg }) => {
1228
- return pkg ? await publintPackage({
1229
- pkg,
1230
- verbose
1231
- }) : publintAll({
1232
- verbose
1233
- });
1234
- }, "publint");
1235
- var publintPackage = /* @__PURE__ */ __name(({ pkg }) => {
1236
- return runStepsAsync(`Publint [${pkg}]`, [
1237
- [
1238
- "yarn",
1239
- [
1240
- "workspace",
1241
- pkg,
1242
- "run",
1243
- "package-publint"
1244
- ]
1245
- ]
1246
- ]);
1247
- }, "publintPackage");
1248
- var publintAll = /* @__PURE__ */ __name(({ verbose }) => {
1249
- const verboseOptions = verbose ? [
1250
- "--verbose"
1251
- ] : [
1252
- "--no-verbose"
1253
- ];
1254
- return runSteps("Publint", [
1255
- [
1256
- "yarn",
1257
- [
1258
- "workspaces",
1259
- "foreach",
1260
- "-pA",
1261
- ...verboseOptions,
1262
- "run",
1263
- "package-publint"
1264
- ]
1265
- ]
1266
- ]);
1267
- }, "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
+ };
1268
1098
 
1269
1099
  // src/actions/rebuild.ts
1270
- var rebuild = /* @__PURE__ */ __name(({ target }) => {
1100
+ var rebuild = ({ target }) => {
1271
1101
  return runSteps("Rebuild", [
1272
- [
1273
- "yarn",
1274
- "xy clean"
1275
- ],
1276
- [
1277
- "yarn",
1278
- target ? `xy build -t ${target}` : "xy build"
1279
- ]
1102
+ ["yarn", "xy clean"],
1103
+ ["yarn", target ? `xy build -t ${target}` : "xy build"]
1280
1104
  ]);
1281
- }, "rebuild");
1105
+ };
1282
1106
 
1283
1107
  // src/actions/recompile.ts
1284
- import chalk17 from "chalk";
1285
- 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
+ }) => {
1286
1115
  return pkg ? await recompilePackage({
1287
1116
  pkg,
1288
1117
  target,
@@ -1292,51 +1121,27 @@ var recompile = /* @__PURE__ */ __name(async ({ verbose, target, pkg, incrementa
1292
1121
  target,
1293
1122
  verbose
1294
1123
  });
1295
- }, "recompile");
1296
- var recompilePackage = /* @__PURE__ */ __name(({ target, pkg }) => {
1297
- const targetOptions = target ? [
1298
- "-t",
1299
- target
1300
- ] : [];
1301
- return runStepsAsync(`Recompile [${pkg}]`, [
1302
- [
1303
- "yarn",
1304
- [
1305
- "workspace",
1306
- pkg,
1307
- "run",
1308
- "package-recompile",
1309
- ...targetOptions
1310
- ]
1311
- ]
1312
- ]);
1313
- }, "recompilePackage");
1314
- 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
+ }) => {
1315
1138
  const start = Date.now();
1316
- const verboseOptions = verbose ? [
1317
- "--verbose"
1318
- ] : [
1319
- "--no-verbose"
1320
- ];
1321
- const targetOptions = target ? [
1322
- "-t",
1323
- target
1324
- ] : [];
1325
- const incrementalOptions = incremental ? [
1326
- "--since",
1327
- "-Apt",
1328
- "--topological-dev"
1329
- ] : [
1330
- "--parallel",
1331
- "-Apt",
1332
- "--topological-dev"
1333
- ];
1334
- const jobsOptions = jobs ? [
1335
- "-j",
1336
- `${jobs}`
1337
- ] : [];
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}`] : [];
1338
1143
  if (jobs) {
1339
- console.log(chalk17.blue(`Jobs set to [${jobs}]`));
1144
+ console.log(chalk18.blue(`Jobs set to [${jobs}]`));
1340
1145
  }
1341
1146
  const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
1342
1147
  [
@@ -1366,13 +1171,19 @@ var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, increm
1366
1171
  ]
1367
1172
  ]
1368
1173
  ]);
1369
- 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
+ );
1370
1177
  return result;
1371
- }, "recompileAll");
1178
+ };
1372
1179
 
1373
1180
  // src/actions/reinstall.ts
1374
- import { closeSync, openSync, rmSync } from "node:fs";
1375
- var reinstall = /* @__PURE__ */ __name(() => {
1181
+ import {
1182
+ closeSync,
1183
+ openSync,
1184
+ rmSync
1185
+ } from "node:fs";
1186
+ var reinstall = () => {
1376
1187
  console.log("Reinstall [Clear Lock File]");
1377
1188
  closeSync(openSync("./yarn.lock", "w"));
1378
1189
  console.log("Reinstall [Clear Node Modules]");
@@ -1380,10 +1191,7 @@ var reinstall = /* @__PURE__ */ __name(() => {
1380
1191
  const result = workspaces.map(({ location, name }) => {
1381
1192
  const dist = `${location}/node_modules`;
1382
1193
  try {
1383
- rmSync(dist, {
1384
- force: true,
1385
- recursive: true
1386
- });
1194
+ rmSync(dist, { force: true, recursive: true });
1387
1195
  return 0;
1388
1196
  } catch (ex) {
1389
1197
  const error = ex;
@@ -1391,533 +1199,580 @@ var reinstall = /* @__PURE__ */ __name(() => {
1391
1199
  return 1;
1392
1200
  }
1393
1201
  }).reduce((prev, result2) => prev || result2, 0);
1394
- return result || runSteps("Reinstall", [
1395
- [
1396
- "yarn",
1397
- "install --network-timeout 10000"
1398
- ]
1399
- ]);
1400
- }, "reinstall");
1202
+ return result || runSteps("Reinstall", [["yarn", "install --network-timeout 10000"]]);
1203
+ };
1401
1204
 
1402
1205
  // src/actions/relint.ts
1403
- import chalk18 from "chalk";
1404
- var relintPackage = /* @__PURE__ */ __name(({ pkg }) => {
1405
- console.log(chalk18.gray(`${"Relint"} [All-Packages]`));
1206
+ import chalk19 from "chalk";
1207
+ var relintPackage = ({ pkg }) => {
1208
+ console.log(chalk19.gray(`${"Relint"} [All-Packages]`));
1406
1209
  const start = Date.now();
1407
1210
  const result = runSteps("Relint [All-Packages]", [
1408
- [
1409
- "yarn",
1410
- [
1411
- "workspace",
1412
- pkg,
1413
- "run",
1414
- "package-relint"
1415
- ]
1416
- ]
1211
+ ["yarn", [
1212
+ "workspace",
1213
+ pkg,
1214
+ "run",
1215
+ "package-relint"
1216
+ ]]
1417
1217
  ]);
1418
- 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")}`));
1419
1219
  return result;
1420
- }, "relintPackage");
1421
- var relint = /* @__PURE__ */ __name(({ pkg, verbose, incremental } = {}) => {
1422
- return pkg ? relintPackage({
1423
- pkg
1424
- }) : relintAllPackages({
1425
- verbose,
1426
- incremental
1427
- });
1428
- }, "relint");
1429
- var relintAllPackages = /* @__PURE__ */ __name(({ verbose = true, incremental } = {}) => {
1430
- 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]`));
1431
1230
  const start = Date.now();
1432
- const verboseOptions = verbose ? [
1433
- "--verbose"
1434
- ] : [
1435
- "--no-verbose"
1436
- ];
1437
- const incrementalOptions = incremental ? [
1438
- "--since",
1439
- "-Ap"
1440
- ] : [
1441
- "--parallel",
1442
- "-Ap"
1443
- ];
1231
+ const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
1232
+ const incrementalOptions = incremental ? ["--since", "-Ap"] : ["--parallel", "-Ap"];
1444
1233
  const result = runSteps(`${"Relint"} [All-Packages]`, [
1445
- [
1446
- "yarn",
1447
- [
1448
- "workspaces",
1449
- "foreach",
1450
- ...verboseOptions,
1451
- ...incrementalOptions,
1452
- "run",
1453
- "package-relint"
1454
- ]
1455
- ]
1234
+ ["yarn", [
1235
+ "workspaces",
1236
+ "foreach",
1237
+ ...verboseOptions,
1238
+ ...incrementalOptions,
1239
+ "run",
1240
+ "package-relint"
1241
+ ]]
1456
1242
  ]);
1457
- 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")}`));
1458
1244
  return result;
1459
- }, "relintAllPackages");
1245
+ };
1460
1246
 
1461
1247
  // src/actions/retest.ts
1462
- var retest = /* @__PURE__ */ __name(() => {
1248
+ var retest = () => {
1463
1249
  return runSteps("Test", [
1464
- [
1465
- "yarn",
1466
- [
1467
- "jest",
1468
- "--clearCache"
1469
- ]
1470
- ],
1471
- [
1472
- "yarn",
1473
- [
1474
- "jest",
1475
- "."
1476
- ]
1477
- ]
1250
+ ["yarn", ["jest", "--clearCache"]],
1251
+ ["yarn", ["jest", "."]]
1478
1252
  ]);
1479
- }, "retest");
1253
+ };
1480
1254
 
1481
1255
  // src/actions/sonar.ts
1482
- var sonar = /* @__PURE__ */ __name(() => {
1483
- return runSteps("Sonar", [
1484
- [
1485
- "yarn",
1486
- [
1487
- "eslint",
1488
- "-c",
1489
- "sonar.eslintrc",
1490
- "."
1491
- ]
1492
- ]
1493
- ]);
1494
- }, "sonar");
1256
+ var sonar = () => {
1257
+ return runSteps("Sonar", [["yarn", ["eslint", "-c", "sonar.eslintrc", "."]]]);
1258
+ };
1495
1259
 
1496
1260
  // src/actions/statics.ts
1497
- import chalk19 from "chalk";
1498
- var DefaultDependencies = [
1499
- "axios",
1500
- "@xylabs/pixel",
1501
- "react",
1502
- "graphql",
1503
- "react-router",
1504
- "@mui/material",
1505
- "@mui/system"
1506
- ];
1507
- var statics = /* @__PURE__ */ __name(() => {
1508
- 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"));
1509
1265
  const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
1510
1266
  return detectDuplicateDependencies(statics2, DefaultDependencies);
1511
- }, "statics");
1267
+ };
1512
1268
 
1513
1269
  // src/actions/test.ts
1514
- var test = /* @__PURE__ */ __name(() => {
1515
- return runSteps("Test", [
1516
- [
1517
- "yarn",
1518
- [
1519
- "vitest",
1520
- "."
1521
- ]
1522
- ]
1523
- ]);
1524
- }, "test");
1270
+ var test = () => {
1271
+ return runSteps("Test", [["yarn", ["vitest", "."]]]);
1272
+ };
1525
1273
 
1526
1274
  // src/actions/up.ts
1527
- var up = /* @__PURE__ */ __name(() => {
1528
- return runSteps("Up", [
1529
- [
1530
- "yarn",
1531
- "outdated"
1532
- ]
1533
- ]);
1534
- }, "up");
1275
+ var up = () => {
1276
+ return runSteps("Up", [["yarn", "outdated"]]);
1277
+ };
1535
1278
 
1536
1279
  // src/actions/updo.ts
1537
- var updo = /* @__PURE__ */ __name(() => {
1280
+ var updo = () => {
1538
1281
  return runSteps("Updo", [
1539
- [
1540
- "yarn",
1541
- "install"
1542
- ],
1543
- [
1544
- "yarn",
1545
- "upgrade-interactive"
1546
- ],
1547
- [
1548
- "yarn",
1549
- "dedupe"
1550
- ]
1282
+ ["yarn", "install"],
1283
+ ["yarn", "upgrade-interactive"],
1284
+ ["yarn", "dedupe"]
1551
1285
  ]);
1552
- }, "updo");
1286
+ };
1553
1287
 
1554
1288
  // src/actions/upplug.ts
1555
- var updateYarnPlugins = /* @__PURE__ */ __name(() => {
1289
+ var updateYarnPlugins = () => {
1556
1290
  return runSteps("Update Yarn Plugins", [
1557
- [
1558
- "yarn",
1559
- [
1560
- "plugin",
1561
- "import",
1562
- "https://mskelton.dev/yarn-outdated/v3"
1563
- ]
1564
- ],
1565
- [
1566
- "yarn",
1567
- [
1568
- "plugin",
1569
- "import",
1570
- "version"
1571
- ]
1572
- ],
1573
- [
1574
- "yarn",
1575
- [
1576
- "plugin",
1577
- "import",
1578
- "interactive-tools"
1579
- ]
1580
- ],
1581
- [
1582
- "yarn",
1583
- [
1584
- "plugin",
1585
- "import",
1586
- "workspace-tools"
1587
- ]
1588
- ]
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"]]
1589
1295
  ]);
1590
- }, "updateYarnPlugins");
1296
+ };
1591
1297
 
1592
1298
  // src/actions/upyarn.ts
1593
- var updateYarnVersion = /* @__PURE__ */ __name(() => {
1594
- return runSteps("Update Yarn Version", [
1595
- [
1596
- "yarn",
1597
- [
1598
- "set",
1599
- "version",
1600
- "latest"
1601
- ]
1602
- ]
1603
- ]);
1604
- }, "updateYarnVersion");
1299
+ var updateYarnVersion = () => {
1300
+ return runSteps("Update Yarn Version", [["yarn", ["set", "version", "latest"]]]);
1301
+ };
1605
1302
 
1606
1303
  // src/actions/yarn3only.ts
1607
- var yarn3Only = /* @__PURE__ */ __name(() => {
1304
+ var yarn3Only = () => {
1608
1305
  const [valid, version] = isYarnVersionOrGreater(3);
1609
1306
  if (!valid) {
1610
1307
  processEx(`Invalid Yarn version [${version}]`);
1611
1308
  }
1612
1309
  return 0;
1613
- }, "yarn3Only");
1310
+ };
1614
1311
 
1615
1312
  // src/xy/xyBuildCommands.ts
1616
- var xyBuildCommands = /* @__PURE__ */ __name((args) => {
1617
- return args.command("build [package]", "Build - Compile & Lint", (yargs2) => {
1618
- return yargs2.positional("package", {
1619
- describe: "Specific package to build"
1620
- });
1621
- }, async (argv) => {
1622
- if (argv.verbose) {
1623
- 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
+ });
1624
1331
  }
1625
- process.exitCode = await build({
1626
- incremental: !!argv.incremental,
1627
- jobs: argv.jobs,
1628
- pkg: argv.package,
1629
- target: argv.target,
1630
- verbose: !!argv.verbose
1631
- });
1632
- }).command("compile [package]", "Compile with Typescript & Copy Images", (yargs2) => {
1633
- return yargs2.positional("package", {
1634
- describe: "Specific package to compile"
1635
- });
1636
- }, (argv) => {
1637
- if (argv.verbose) {
1638
- 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
+ });
1639
1349
  }
1640
- process.exitCode = compile({
1641
- incremental: !!argv.incremental,
1642
- jobs: argv.jobs,
1643
- pkg: argv.package,
1644
- target: argv.target,
1645
- verbose: !!argv.verbose
1646
- });
1647
- }).command("compile-types [package]", "Compile types with Typescript", (yargs2) => {
1648
- return yargs2.positional("package", {
1649
- describe: "Specific package to compile"
1650
- });
1651
- }, (argv) => {
1652
- if (argv.verbose) {
1653
- 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
+ });
1654
1366
  }
1655
- process.exitCode = compileTypes({
1656
- incremental: !!argv.incremental,
1657
- jobs: argv.jobs,
1658
- pkg: argv.package,
1659
- verbose: !!argv.verbose
1660
- });
1661
- }).command("compile-only [package]", "Compile with Typescript & Copy Images (No Publint)", (yargs2) => {
1662
- return yargs2.positional("package", {
1663
- describe: "Specific package to compile"
1664
- });
1665
- }, (argv) => {
1666
- if (argv.verbose) {
1667
- 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
+ });
1668
1385
  }
1669
- process.exitCode = compile({
1670
- incremental: !!argv.incremental,
1671
- jobs: argv.jobs,
1672
- pkg: argv.package,
1673
- publint: false,
1674
- target: argv.target,
1675
- verbose: !!argv.verbose
1676
- });
1677
- }).command("recompile [package]", "Re-compile with Typescript & Copy Images", (yargs2) => {
1678
- return yargs2.positional("package", {
1679
- describe: "Specific package to re-compile"
1680
- });
1681
- }, async (argv) => {
1682
- if (argv.verbose) {
1683
- 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
+ });
1684
1403
  }
1685
- process.exitCode = await recompile({
1686
- incremental: !!argv.incremental,
1687
- jobs: argv.jobs,
1688
- pkg: argv.package,
1689
- target: argv.target,
1690
- verbose: !!argv.verbose
1691
- });
1692
- }).command("rebuild [package]", "Rebuild - Clean, Compile & Lint", (yargs2) => {
1693
- return yargs2.positional("package", {
1694
- describe: "Specific package to rebuild"
1695
- });
1696
- }, (argv) => {
1697
- if (argv.verbose) console.log(`Rebuilding: ${argv.package ?? "all"}`);
1698
- process.exitCode = rebuild({
1699
- target: argv.target
1700
- });
1701
- }).command("copy-assets [package]", "Copy Assets - Copy the assets from src to dist", (yargs2) => {
1702
- return yargs2.positional("package", {
1703
- describe: "Specific package to copy assets"
1704
- });
1705
- }, async (argv) => {
1706
- if (argv.verbose) console.log(`Copying Assets: ${argv.package ?? "all"}`);
1707
- process.exitCode = await copyAssets({
1708
- target: argv.target
1709
- });
1710
- });
1711
- }, "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
+ };
1712
1426
 
1713
1427
  // src/xy/param.ts
1714
- var packagePositionalParam = /* @__PURE__ */ __name((yargs2) => {
1715
- return yargs2.positional("package", {
1716
- describe: "Specific package to target"
1717
- });
1718
- }, "packagePositionalParam");
1428
+ var packagePositionalParam = (yargs2) => {
1429
+ return yargs2.positional("package", { describe: "Specific package to target" });
1430
+ };
1719
1431
 
1720
1432
  // src/xy/xyCommonCommands.ts
1721
- var xyCommonCommands = /* @__PURE__ */ __name((args) => {
1722
- return args.command("license [package]", "License - Check licenses of dependencies", (yargs2) => {
1723
- return packagePositionalParam(yargs2);
1724
- }, async (argv) => {
1725
- if (argv.verbose) console.log(`License: ${argv.package ?? "all"}`);
1726
- process.exitCode = await license();
1727
- }).command("dead [package]", "Dead - Check for dead code", (yargs2) => {
1728
- return packagePositionalParam(yargs2);
1729
- }, (argv) => {
1730
- if (argv.verbose) console.log("Dead");
1731
- process.exitCode = dead();
1732
- }).command("gen-docs [package]", "GenDocs - Generate TypeDocs", (yargs2) => {
1733
- return packagePositionalParam(yargs2);
1734
- }, (argv) => {
1735
- if (argv.verbose) console.log(`Generating TypeDocs: ${argv.package ?? "all"}`);
1736
- process.exitCode = genDocs({
1737
- incremental: !!argv.incremental,
1738
- pkg: argv.package
1739
- });
1740
- }).command("clean-docs", "CleanDocs - Clean TypeDocs", (yargs2) => yargs2, (argv) => {
1741
- if (argv.verbose) console.log("Cleaning TypeDocs: all");
1742
- process.exitCode = cleanDocs();
1743
- }).command("gitlint [package]", "Gitlint - Lint your git config", (yargs2) => {
1744
- return yargs2;
1745
- }, (argv) => {
1746
- if (argv.verbose) console.log("Gitlint");
1747
- process.exitCode = argv.fix ? gitlintFix() : gitlint();
1748
- }).command("gitignore-gen", "GitIgnore Gen - Generate .gitignore files", (yargs2) => {
1749
- return yargs2;
1750
- }, (argv) => {
1751
- if (argv.verbose) console.log("GitIgnore Gen");
1752
- process.exitCode = gitignoreGen();
1753
- }).command("npmignore-gen", "NpmIgnore Gen - Generate .npmignore files", (yargs2) => {
1754
- return yargs2;
1755
- }, (argv) => {
1756
- if (argv.verbose) console.log("NpmIgnore Gen");
1757
- process.exitCode = npmignoreGen();
1758
- }).command("retest", "Re-Test - Run Jest Tests with cleaned cache", (yargs2) => {
1759
- return yargs2;
1760
- }, (argv) => {
1761
- if (argv.verbose) console.log("Re-Testing");
1762
- process.exitCode = retest();
1763
- }).command("test", "Test - Run Jest Tests", (yargs2) => {
1764
- return yargs2;
1765
- }, (argv) => {
1766
- if (argv.verbose) console.log("Testing");
1767
- process.exitCode = test();
1768
- }).command("upplug", "UpPlug - Update Yarn Plugins", (yargs2) => {
1769
- return yargs2;
1770
- }, (argv) => {
1771
- if (argv.verbose) console.log("UpPlug");
1772
- process.exitCode = updateYarnPlugins();
1773
- }).command("upyarn", "UpYarn - Update Yarn Version", (yargs2) => {
1774
- return yargs2;
1775
- }, (argv) => {
1776
- if (argv.verbose) console.log("UpYarn");
1777
- process.exitCode = updateYarnVersion();
1778
- }).command("yarn3only", "Yarn3Only - Check if using Yarn v3", (yargs2) => {
1779
- return yargs2;
1780
- }, (argv) => {
1781
- if (argv.verbose) console.log("Yarn 3 Check");
1782
- process.exitCode = yarn3Only();
1783
- });
1784
- }, "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
+ };
1785
1554
 
1786
1555
  // src/xy/xyDeployCommands.ts
1787
- var xyDeployCommands = /* @__PURE__ */ __name((args) => {
1788
- return args.command("deploy", "Deploy - Deploy patch", (yargs2) => {
1789
- return yargs2;
1790
- }, (argv) => {
1791
- if (argv.verbose) console.log("Deploy patch");
1792
- process.exitCode = deploy();
1793
- }).command("deploy-minor", "Deploy - Deploy minor", (yargs2) => {
1794
- return yargs2;
1795
- }, (argv) => {
1796
- if (argv.verbose) console.log("Deploy minor");
1797
- process.exitCode = deployMinor();
1798
- }).command("deploy-major", "Deploy - Deploy major", (yargs2) => {
1799
- return yargs2;
1800
- }, (argv) => {
1801
- if (argv.verbose) console.log("Deploy major");
1802
- process.exitCode = deployMajor();
1803
- }).command("deploy-next", "Deploy - Deploy next", (yargs2) => {
1804
- return yargs2;
1805
- }, (argv) => {
1806
- if (argv.verbose) console.log("Deploy next");
1807
- process.exitCode = deployNext();
1808
- });
1809
- }, "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
+ };
1810
1599
 
1811
1600
  // src/xy/xyInstallCommands.ts
1812
- var xyInstallCommands = /* @__PURE__ */ __name((args) => {
1813
- return args.command("clean [package]", "Clean", (yargs2) => {
1814
- return yargs2.positional("package", {
1815
- describe: "Specific package to clean"
1816
- });
1817
- }, async (argv) => {
1818
- if (argv.verbose) {
1819
- 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
+ });
1820
1616
  }
1821
- process.exitCode = await clean({
1822
- pkg: argv.package,
1823
- verbose: !!argv.verbose
1824
- });
1825
- }).command("reinstall", "Reinstall - Clean & Install", (yargs2) => {
1826
- return yargs2;
1827
- }, (argv) => {
1828
- if (argv.verbose) console.log("Reinstalling");
1829
- process.exitCode = reinstall();
1830
- }).command("up", "Up - Update dependencies", (yargs2) => {
1831
- return yargs2;
1832
- }, (argv) => {
1833
- if (argv.verbose) console.log("Up");
1834
- process.exitCode = up();
1835
- }).command("updo", "Updo - Update dependencies [Interactive]", (yargs2) => {
1836
- return yargs2;
1837
- }, (argv) => {
1838
- if (argv.verbose) console.log("Updo");
1839
- process.exitCode = updo();
1840
- }).command("statics", "Statics - Confirming Static Packages", (yargs2) => {
1841
- return yargs2;
1842
- }, (argv) => {
1843
- if (argv.verbose) console.log("Statics");
1844
- process.exitCode = statics();
1845
- }).command("dupdeps", "Dupdeps - Duplicate Dependencies in package.json", (yargs2) => {
1846
- return yargs2;
1847
- }, (argv) => {
1848
- if (argv.verbose) console.log("Dupdeps");
1849
- process.exitCode = dupdeps();
1850
- });
1851
- }, "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
+ };
1852
1669
 
1853
1670
  // src/xy/xyLintCommands.ts
1854
- import chalk20 from "chalk";
1855
- var xyLintCommands = /* @__PURE__ */ __name((args) => {
1856
- return args.command("cycle [package]", "Cycle - Check for dependency cycles", (yargs2) => {
1857
- return packagePositionalParam(yargs2);
1858
- }, async (argv) => {
1859
- const start = Date.now();
1860
- if (argv.verbose) console.log("Cycle");
1861
- process.exitCode = await cycle({
1862
- pkg: argv.package
1863
- });
1864
- console.log(chalk20.blue(`Finished in ${Date.now() - start}ms`));
1865
- }).command("lint [package]", "Lint - Run Eslint", (yargs2) => {
1866
- return packagePositionalParam(yargs2);
1867
- }, (argv) => {
1868
- if (argv.verbose) console.log("Lint");
1869
- const start = Date.now();
1870
- process.exitCode = argv.fix ? fix({
1871
- pkg: argv.package
1872
- }) : lint({
1873
- pkg: argv.package
1874
- });
1875
- console.log(chalk20.blue(`Finished in ${Date.now() - start}ms`));
1876
- }).command("fix [package]", "Fix - Run Eslint w/fix", (yargs2) => {
1877
- return packagePositionalParam(yargs2);
1878
- }, (argv) => {
1879
- const start = Date.now();
1880
- if (argv.verbose) console.log("Fix");
1881
- process.exitCode = fix();
1882
- console.log(chalk20.blue(`Finished in ${Date.now() - start}ms`));
1883
- }).command("relint [package]", "Relint - Clean & Lint", (yargs2) => {
1884
- return packagePositionalParam(yargs2);
1885
- }, (argv) => {
1886
- if (argv.verbose) console.log("Relinting");
1887
- const start = Date.now();
1888
- process.exitCode = relint();
1889
- console.log(chalk20.blue(`Finished in ${Date.now() - start}ms`));
1890
- }).command("publint [package]", "Publint - Run Publint", (yargs2) => {
1891
- return packagePositionalParam(yargs2);
1892
- }, async (argv) => {
1893
- if (argv.verbose) console.log("Publint");
1894
- const start = Date.now();
1895
- process.exitCode = await publint({
1896
- pkg: argv.package,
1897
- verbose: !!argv.verbose
1898
- });
1899
- console.log(chalk20.blue(`Finished in ${Date.now() - start}ms`));
1900
- }).command("knip", "Knip - Run Knip", (yargs2) => {
1901
- return packagePositionalParam(yargs2);
1902
- }, (argv) => {
1903
- if (argv.verbose) console.log("Knip");
1904
- const start = Date.now();
1905
- process.exitCode = knip();
1906
- console.log(chalk20.blue(`Knip finished in ${Date.now() - start}ms`));
1907
- }).command("sonar", "Sonar - Run Sonar Check", (yargs2) => {
1908
- return packagePositionalParam(yargs2);
1909
- }, (argv) => {
1910
- const start = Date.now();
1911
- if (argv.verbose) console.log("Sonar Check");
1912
- process.exitCode = sonar();
1913
- console.log(chalk20.blue(`Finished in ${Date.now() - start}ms`));
1914
- });
1915
- }, "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
+ };
1916
1771
 
1917
1772
  // src/xy/xyParseOptions.ts
1918
1773
  import yargs from "yargs";
1919
1774
  import { hideBin } from "yargs/helpers";
1920
- var xyParseOptions = /* @__PURE__ */ __name(() => {
1775
+ var xyParseOptions = () => {
1921
1776
  return yargs(hideBin(process.argv)).scriptName("yarn xy").option("jobs", {
1922
1777
  alias: "j",
1923
1778
  default: void 0,
@@ -1931,10 +1786,7 @@ var xyParseOptions = /* @__PURE__ */ __name(() => {
1931
1786
  }).option("target", {
1932
1787
  alias: "t",
1933
1788
  default: "esm",
1934
- choices: [
1935
- "esm",
1936
- "cjs"
1937
- ],
1789
+ choices: ["esm", "cjs"],
1938
1790
  description: "Limit output to specific target",
1939
1791
  type: "string"
1940
1792
  }).option("incremental", {
@@ -1959,23 +1811,20 @@ var xyParseOptions = /* @__PURE__ */ __name(() => {
1959
1811
  type: "boolean"
1960
1812
  }).option("types", {
1961
1813
  default: "tsc",
1962
- choices: [
1963
- "tsc",
1964
- "tsup"
1965
- ],
1814
+ choices: ["tsc", "tsup"],
1966
1815
  description: "Tool to generate Typescript types",
1967
1816
  type: "string"
1968
1817
  });
1969
- }, "xyParseOptions");
1818
+ };
1970
1819
 
1971
1820
  // src/xy/xy.ts
1972
- var xy = /* @__PURE__ */ __name(async () => {
1821
+ var xy = async () => {
1973
1822
  const options = xyParseOptions();
1974
1823
  return await xyBuildCommands(xyCommonCommands(xyInstallCommands(xyDeployCommands(xyLintCommands(options))))).demandCommand(1).command("*", "", () => {
1975
- console.error(chalk21.yellow(`Command not found [${chalk21.magenta(process.argv[2])}]`));
1976
- 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"));
1977
1826
  }).version().help().argv;
1978
- }, "xy");
1827
+ };
1979
1828
 
1980
1829
  // src/bin/xy.ts
1981
1830
  xy().then(() => {