@xylabs/ts-scripts-yarn3 7.0.2 → 7.1.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 (270) 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.mjs +50 -76
  12. package/dist/actions/compile.mjs.map +1 -1
  13. package/dist/actions/copy-assets.mjs +23 -38
  14. package/dist/actions/copy-assets.mjs.map +1 -1
  15. package/dist/actions/cycle.mjs +28 -57
  16. package/dist/actions/cycle.mjs.map +1 -1
  17. package/dist/actions/dead.mjs +16 -31
  18. package/dist/actions/dead.mjs.map +1 -1
  19. package/dist/actions/deplint/checkPackage/checkPackage.mjs +48 -71
  20. package/dist/actions/deplint/checkPackage/checkPackage.mjs.map +1 -1
  21. package/dist/actions/deplint/checkPackage/getUnlistedDependencies.mjs +5 -5
  22. package/dist/actions/deplint/checkPackage/getUnlistedDependencies.mjs.map +1 -1
  23. package/dist/actions/deplint/checkPackage/getUnlistedDevDependencies.mjs +9 -5
  24. package/dist/actions/deplint/checkPackage/getUnlistedDevDependencies.mjs.map +1 -1
  25. package/dist/actions/deplint/checkPackage/getUnusedDependencies.mjs +5 -5
  26. package/dist/actions/deplint/checkPackage/getUnusedDependencies.mjs.map +1 -1
  27. package/dist/actions/deplint/checkPackage/getUnusedPeerDependencies.mjs +0 -4
  28. package/dist/actions/deplint/checkPackage/getUnusedPeerDependencies.mjs.map +1 -1
  29. package/dist/actions/deplint/checkPackage/index.mjs +48 -71
  30. package/dist/actions/deplint/checkPackage/index.mjs.map +1 -1
  31. package/dist/actions/deplint/deplint.mjs +61 -86
  32. package/dist/actions/deplint/deplint.mjs.map +1 -1
  33. package/dist/actions/deplint/findFiles.mjs +4 -20
  34. package/dist/actions/deplint/findFiles.mjs.map +1 -1
  35. package/dist/actions/deplint/findFilesByGlob.mjs +1 -8
  36. package/dist/actions/deplint/findFilesByGlob.mjs.map +1 -1
  37. package/dist/actions/deplint/getBasePackageName.mjs +0 -4
  38. package/dist/actions/deplint/getBasePackageName.mjs.map +1 -1
  39. package/dist/actions/deplint/getDependenciesFromPackageJson.mjs +0 -4
  40. package/dist/actions/deplint/getDependenciesFromPackageJson.mjs.map +1 -1
  41. package/dist/actions/deplint/getExternalImportsFromFiles.mjs +12 -24
  42. package/dist/actions/deplint/getExternalImportsFromFiles.mjs.map +1 -1
  43. package/dist/actions/deplint/getImportsFromFile.mjs +9 -16
  44. package/dist/actions/deplint/getImportsFromFile.mjs.map +1 -1
  45. package/dist/actions/deplint/index.mjs +61 -86
  46. package/dist/actions/deplint/index.mjs.map +1 -1
  47. package/dist/actions/deploy-major.mjs +26 -57
  48. package/dist/actions/deploy-major.mjs.map +1 -1
  49. package/dist/actions/deploy-minor.mjs +26 -57
  50. package/dist/actions/deploy-minor.mjs.map +1 -1
  51. package/dist/actions/deploy-next.mjs +26 -57
  52. package/dist/actions/deploy-next.mjs.map +1 -1
  53. package/dist/actions/deploy.mjs +26 -57
  54. package/dist/actions/deploy.mjs.map +1 -1
  55. package/dist/actions/dupdeps.mjs +26 -37
  56. package/dist/actions/dupdeps.mjs.map +1 -1
  57. package/dist/actions/fix.mjs +36 -54
  58. package/dist/actions/fix.mjs.map +1 -1
  59. package/dist/actions/gen-docs.mjs +25 -65
  60. package/dist/actions/gen-docs.mjs.map +1 -1
  61. package/dist/actions/gitignore-gen.mjs +28 -44
  62. package/dist/actions/gitignore-gen.mjs.map +1 -1
  63. package/dist/actions/gitlint-fix.mjs +5 -14
  64. package/dist/actions/gitlint-fix.mjs.map +1 -1
  65. package/dist/actions/gitlint.mjs +4 -7
  66. package/dist/actions/gitlint.mjs.map +1 -1
  67. package/dist/actions/index.mjs +705 -1251
  68. package/dist/actions/index.mjs.map +1 -1
  69. package/dist/actions/knip.mjs +16 -31
  70. package/dist/actions/knip.mjs.map +1 -1
  71. package/dist/actions/license.mjs +37 -51
  72. package/dist/actions/license.mjs.map +1 -1
  73. package/dist/actions/lint.mjs +33 -48
  74. package/dist/actions/lint.mjs.map +1 -1
  75. package/dist/actions/npmignore-gen.mjs +28 -44
  76. package/dist/actions/npmignore-gen.mjs.map +1 -1
  77. package/dist/actions/package/clean-outputs.mjs +6 -16
  78. package/dist/actions/package/clean-outputs.mjs.map +1 -1
  79. package/dist/actions/package/clean-typescript.mjs +6 -16
  80. package/dist/actions/package/clean-typescript.mjs.map +1 -1
  81. package/dist/actions/package/clean.mjs +12 -29
  82. package/dist/actions/package/clean.mjs.map +1 -1
  83. package/dist/actions/package/compile/buildEntries.mjs +19 -34
  84. package/dist/actions/package/compile/buildEntries.mjs.map +1 -1
  85. package/dist/actions/package/compile/compile.mjs +165 -195
  86. package/dist/actions/package/compile/compile.mjs.map +1 -1
  87. package/dist/actions/package/compile/copyTypeFiles.mjs +20 -23
  88. package/dist/actions/package/compile/copyTypeFiles.mjs.map +1 -1
  89. package/dist/actions/package/compile/deepMerge.mjs +0 -5
  90. package/dist/actions/package/compile/deepMerge.mjs.map +1 -1
  91. package/dist/actions/package/compile/getCompilerOptions.mjs +2 -5
  92. package/dist/actions/package/compile/getCompilerOptions.mjs.map +1 -1
  93. package/dist/actions/package/compile/index.mjs +165 -195
  94. package/dist/actions/package/compile/index.mjs.map +1 -1
  95. package/dist/actions/package/compile/inputs.mjs +15 -25
  96. package/dist/actions/package/compile/inputs.mjs.map +1 -1
  97. package/dist/actions/package/compile/packageCompileTsc.mjs +25 -17
  98. package/dist/actions/package/compile/packageCompileTsc.mjs.map +1 -1
  99. package/dist/actions/package/compile/packageCompileTscTypes.mjs +19 -36
  100. package/dist/actions/package/compile/packageCompileTscTypes.mjs.map +1 -1
  101. package/dist/actions/package/compile/packageCompileTsup.mjs +160 -185
  102. package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -1
  103. package/dist/actions/package/copy-assets.mjs +12 -21
  104. package/dist/actions/package/copy-assets.mjs.map +1 -1
  105. package/dist/actions/package/cycle.mjs +5 -14
  106. package/dist/actions/package/cycle.mjs.map +1 -1
  107. package/dist/actions/package/gen-docs.mjs +11 -12
  108. package/dist/actions/package/gen-docs.mjs.map +1 -1
  109. package/dist/actions/package/index.mjs +236 -308
  110. package/dist/actions/package/index.mjs.map +1 -1
  111. package/dist/actions/package/lint.mjs +16 -39
  112. package/dist/actions/package/lint.mjs.map +1 -1
  113. package/dist/actions/package/publint.mjs +13 -14
  114. package/dist/actions/package/publint.mjs.map +1 -1
  115. package/dist/actions/package/recompile.mjs +179 -223
  116. package/dist/actions/package/recompile.mjs.map +1 -1
  117. package/dist/actions/publint.mjs +37 -71
  118. package/dist/actions/publint.mjs.map +1 -1
  119. package/dist/actions/rebuild.mjs +17 -29
  120. package/dist/actions/rebuild.mjs.map +1 -1
  121. package/dist/actions/recompile.mjs +50 -67
  122. package/dist/actions/recompile.mjs.map +1 -1
  123. package/dist/actions/reinstall.mjs +25 -43
  124. package/dist/actions/reinstall.mjs.map +1 -1
  125. package/dist/actions/relint.mjs +40 -63
  126. package/dist/actions/relint.mjs.map +1 -1
  127. package/dist/actions/retest.mjs +17 -35
  128. package/dist/actions/retest.mjs.map +1 -1
  129. package/dist/actions/sonar.mjs +16 -32
  130. package/dist/actions/sonar.mjs.map +1 -1
  131. package/dist/actions/statics.mjs +27 -46
  132. package/dist/actions/statics.mjs.map +1 -1
  133. package/dist/actions/test.mjs +16 -30
  134. package/dist/actions/test.mjs.map +1 -1
  135. package/dist/actions/up.mjs +16 -27
  136. package/dist/actions/up.mjs.map +1 -1
  137. package/dist/actions/updo.mjs +18 -33
  138. package/dist/actions/updo.mjs.map +1 -1
  139. package/dist/actions/upplug.mjs +19 -53
  140. package/dist/actions/upplug.mjs.map +1 -1
  141. package/dist/actions/upyarn.mjs +16 -31
  142. package/dist/actions/upyarn.mjs.map +1 -1
  143. package/dist/actions/yarn3only.mjs +12 -23
  144. package/dist/actions/yarn3only.mjs.map +1 -1
  145. package/dist/bin/package/build-only.mjs +165 -194
  146. package/dist/bin/package/build-only.mjs.map +1 -1
  147. package/dist/bin/package/build.mjs +166 -197
  148. package/dist/bin/package/build.mjs.map +1 -1
  149. package/dist/bin/package/clean-outputs.mjs +6 -15
  150. package/dist/bin/package/clean-outputs.mjs.map +1 -1
  151. package/dist/bin/package/clean-typescript.mjs +6 -15
  152. package/dist/bin/package/clean-typescript.mjs.map +1 -1
  153. package/dist/bin/package/clean.mjs +12 -28
  154. package/dist/bin/package/clean.mjs.map +1 -1
  155. package/dist/bin/package/compile-only.mjs +165 -194
  156. package/dist/bin/package/compile-only.mjs.map +1 -1
  157. package/dist/bin/package/compile-tsup.mjs +160 -184
  158. package/dist/bin/package/compile-tsup.mjs.map +1 -1
  159. package/dist/bin/package/compile.mjs +165 -194
  160. package/dist/bin/package/compile.mjs.map +1 -1
  161. package/dist/bin/package/copy-assets-cjs.mjs +13 -23
  162. package/dist/bin/package/copy-assets-cjs.mjs.map +1 -1
  163. package/dist/bin/package/copy-assets-esm.mjs +13 -23
  164. package/dist/bin/package/copy-assets-esm.mjs.map +1 -1
  165. package/dist/bin/package/cycle.mjs +5 -13
  166. package/dist/bin/package/cycle.mjs.map +1 -1
  167. package/dist/bin/package/fix.mjs +16 -38
  168. package/dist/bin/package/fix.mjs.map +1 -1
  169. package/dist/bin/package/gen-docs.mjs +11 -11
  170. package/dist/bin/package/gen-docs.mjs.map +1 -1
  171. package/dist/bin/package/lint.mjs +16 -38
  172. package/dist/bin/package/lint.mjs.map +1 -1
  173. package/dist/bin/package/publint.mjs +13 -13
  174. package/dist/bin/package/publint.mjs.map +1 -1
  175. package/dist/bin/package/recompile.mjs +179 -222
  176. package/dist/bin/package/recompile.mjs.map +1 -1
  177. package/dist/bin/package/relint.mjs +16 -38
  178. package/dist/bin/package/relint.mjs.map +1 -1
  179. package/dist/bin/xy.mjs +932 -1266
  180. package/dist/bin/xy.mjs.map +1 -1
  181. package/dist/index.mjs +1191 -1612
  182. package/dist/index.mjs.map +1 -1
  183. package/dist/lib/checkResult.mjs +2 -5
  184. package/dist/lib/checkResult.mjs.map +1 -1
  185. package/dist/lib/createBuildConfig.mjs +9 -24
  186. package/dist/lib/createBuildConfig.mjs.map +1 -1
  187. package/dist/lib/defaultBuildConfig.mjs +2 -6
  188. package/dist/lib/defaultBuildConfig.mjs.map +1 -1
  189. package/dist/lib/deleteGlob.mjs +3 -9
  190. package/dist/lib/deleteGlob.mjs.map +1 -1
  191. package/dist/lib/dependencies/DuplicateDetector.mjs +12 -23
  192. package/dist/lib/dependencies/DuplicateDetector.mjs.map +1 -1
  193. package/dist/lib/dependencies/detectDuplicateDependencies.mjs +22 -33
  194. package/dist/lib/dependencies/detectDuplicateDependencies.mjs.map +1 -1
  195. package/dist/lib/dependencies/index.mjs +22 -33
  196. package/dist/lib/dependencies/index.mjs.map +1 -1
  197. package/dist/lib/file/ReadFileSyncOptions.mjs +1 -3
  198. package/dist/lib/file/ReadFileSyncOptions.mjs.map +1 -1
  199. package/dist/lib/file/constants.mjs.map +1 -1
  200. package/dist/lib/file/fileLines.mjs +12 -13
  201. package/dist/lib/file/fileLines.mjs.map +1 -1
  202. package/dist/lib/file/index.mjs +14 -15
  203. package/dist/lib/file/index.mjs.map +1 -1
  204. package/dist/lib/file/tryReadFileSync.mjs +3 -8
  205. package/dist/lib/file/tryReadFileSync.mjs.map +1 -1
  206. package/dist/lib/generateIgnoreFiles.mjs +27 -43
  207. package/dist/lib/generateIgnoreFiles.mjs.map +1 -1
  208. package/dist/lib/index.mjs +99 -157
  209. package/dist/lib/index.mjs.map +1 -1
  210. package/dist/lib/jsonFormatters.mjs +2 -5
  211. package/dist/lib/jsonFormatters.mjs.map +1 -1
  212. package/dist/lib/loadConfig.mjs +3 -11
  213. package/dist/lib/loadConfig.mjs.map +1 -1
  214. package/dist/lib/parsedPackageJSON.mjs +2 -5
  215. package/dist/lib/parsedPackageJSON.mjs.map +1 -1
  216. package/dist/lib/processEx.mjs +6 -9
  217. package/dist/lib/processEx.mjs.map +1 -1
  218. package/dist/lib/runSteps.mjs +13 -19
  219. package/dist/lib/runSteps.mjs.map +1 -1
  220. package/dist/lib/runStepsAsync.mjs +22 -22
  221. package/dist/lib/runStepsAsync.mjs.map +1 -1
  222. package/dist/lib/runXy.mjs +19 -31
  223. package/dist/lib/runXy.mjs.map +1 -1
  224. package/dist/lib/runXyWithWarning.mjs +2 -5
  225. package/dist/lib/runXyWithWarning.mjs.map +1 -1
  226. package/dist/lib/safeExit.mjs +10 -13
  227. package/dist/lib/safeExit.mjs.map +1 -1
  228. package/dist/lib/string/empty.mjs +2 -5
  229. package/dist/lib/string/empty.mjs.map +1 -1
  230. package/dist/lib/string/index.mjs +3 -9
  231. package/dist/lib/string/index.mjs.map +1 -1
  232. package/dist/lib/string/union.mjs +1 -7
  233. package/dist/lib/string/union.mjs.map +1 -1
  234. package/dist/lib/withErrnoException.mjs +4 -7
  235. package/dist/lib/withErrnoException.mjs.map +1 -1
  236. package/dist/lib/withError.mjs +2 -5
  237. package/dist/lib/withError.mjs.map +1 -1
  238. package/dist/lib/yarn/index.mjs +11 -30
  239. package/dist/lib/yarn/index.mjs.map +1 -1
  240. package/dist/lib/yarn/isYarnVersionOrGreater.mjs +4 -15
  241. package/dist/lib/yarn/isYarnVersionOrGreater.mjs.map +1 -1
  242. package/dist/lib/yarn/workspace/index.mjs +5 -16
  243. package/dist/lib/yarn/workspace/index.mjs.map +1 -1
  244. package/dist/lib/yarn/workspace/yarnWorkspace.mjs +5 -16
  245. package/dist/lib/yarn/workspace/yarnWorkspace.mjs.map +1 -1
  246. package/dist/lib/yarn/workspace/yarnWorkspaces.mjs +3 -14
  247. package/dist/lib/yarn/workspace/yarnWorkspaces.mjs.map +1 -1
  248. package/dist/lib/yarn/yarnInitCwd.mjs +2 -5
  249. package/dist/lib/yarn/yarnInitCwd.mjs.map +1 -1
  250. package/dist/loadPackageConfig.mjs +3 -8
  251. package/dist/loadPackageConfig.mjs.map +1 -1
  252. package/dist/xy/index.mjs +932 -1267
  253. package/dist/xy/index.mjs.map +1 -1
  254. package/dist/xy/param.mjs +3 -9
  255. package/dist/xy/param.mjs.map +1 -1
  256. package/dist/xy/xy.mjs +932 -1267
  257. package/dist/xy/xy.mjs.map +1 -1
  258. package/dist/xy/xyBuildCommands.mjs +228 -320
  259. package/dist/xy/xyBuildCommands.mjs.map +1 -1
  260. package/dist/xy/xyCommonCommands.mjs +251 -336
  261. package/dist/xy/xyCommonCommands.mjs.map +1 -1
  262. package/dist/xy/xyDeployCommands.mjs +99 -161
  263. package/dist/xy/xyDeployCommands.mjs.map +1 -1
  264. package/dist/xy/xyInstallCommands.mjs +145 -193
  265. package/dist/xy/xyInstallCommands.mjs.map +1 -1
  266. package/dist/xy/xyLintCommands.mjs +302 -403
  267. package/dist/xy/xyLintCommands.mjs.map +1 -1
  268. package/dist/xy/xyParseOptions.mjs +2 -5
  269. package/dist/xy/xyParseOptions.mjs.map +1 -1
  270. package/package.json +8 -9
@@ -1,9 +1,6 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
1
  // src/lib/checkResult.ts
5
2
  import chalk from "chalk";
6
- var checkResult = /* @__PURE__ */ __name((name, result, level = "error", exitOnFail = false) => {
3
+ var checkResult = (name, result, level = "error", exitOnFail = false) => {
7
4
  if (result) {
8
5
  const exiting = exitOnFail ? "[Exiting Process]" : "[Continuing]";
9
6
  const chalkFunc = level === "error" ? chalk.red : chalk.yellow;
@@ -12,36 +9,33 @@ var checkResult = /* @__PURE__ */ __name((name, result, level = "error", exitOnF
12
9
  process.exit(result);
13
10
  }
14
11
  }
15
- }, "checkResult");
12
+ };
16
13
 
17
14
  // src/lib/deleteGlob.ts
18
15
  import fs from "fs";
19
16
  import { glob } from "glob";
20
- var deleteGlob = /* @__PURE__ */ __name((globPath) => {
17
+ var deleteGlob = (globPath) => {
21
18
  const files = glob.sync(globPath);
22
19
  for (const file of files) {
23
- fs.rmSync(file, {
24
- recursive: true,
25
- force: true
26
- });
20
+ fs.rmSync(file, { recursive: true, force: true });
27
21
  }
28
- }, "deleteGlob");
22
+ };
29
23
 
30
24
  // src/lib/processEx.ts
31
25
  import chalk2 from "chalk";
32
26
 
33
27
  // src/lib/withError.ts
34
- var withError = /* @__PURE__ */ __name((ex, closure, predicate = (ex2) => !!ex2.name && !!ex2.message) => {
28
+ var withError = (ex, closure, predicate = (ex2) => !!ex2.name && !!ex2.message) => {
35
29
  return predicate(ex) ? closure(ex) : void 0;
36
- }, "withError");
30
+ };
37
31
 
38
32
  // src/lib/withErrnoException.ts
39
- var withErrnoException = /* @__PURE__ */ __name((ex, closure) => {
33
+ var withErrnoException = (ex, closure) => {
40
34
  return withError(ex, closure, (ex2) => ex2.errno !== void 0);
41
- }, "withErrnoException");
35
+ };
42
36
 
43
37
  // src/lib/processEx.ts
44
- var processEx = /* @__PURE__ */ __name((ex) => {
38
+ var processEx = (ex) => {
45
39
  const error = typeof ex === "string" ? new Error(ex) : ex;
46
40
  const exitCode = withErrnoException(error, (error2) => {
47
41
  if (error2.code === "ENOENT") {
@@ -58,10 +52,10 @@ var processEx = /* @__PURE__ */ __name((ex) => {
58
52
  return -1;
59
53
  })();
60
54
  process.exit(process.exitCode ?? exitCode);
61
- }, "processEx");
55
+ };
62
56
 
63
57
  // src/lib/safeExit.ts
64
- var safeExit = /* @__PURE__ */ __name((func, exitOnFail = true) => {
58
+ var safeExit = (func, exitOnFail = true) => {
65
59
  try {
66
60
  const result = func();
67
61
  if (result && exitOnFail) {
@@ -71,51 +65,45 @@ var safeExit = /* @__PURE__ */ __name((func, exitOnFail = true) => {
71
65
  } catch (ex) {
72
66
  return processEx(ex);
73
67
  }
74
- }, "safeExit");
68
+ };
75
69
 
76
70
  // src/lib/file/constants.ts
77
71
  var WINDOWS_NEWLINE_REGEX = /\r\n/g;
78
72
  var CROSS_PLATFORM_NEWLINE = "\n";
79
73
 
80
74
  // src/lib/file/fileLines.ts
81
- import { existsSync, readFileSync, writeFileSync } from "fs";
75
+ import {
76
+ existsSync,
77
+ readFileSync,
78
+ writeFileSync
79
+ } from "fs";
82
80
 
83
81
  // src/lib/string/empty.ts
84
- var empty = /* @__PURE__ */ __name((value) => value?.trim().length === 0, "empty");
85
- var notEmpty = /* @__PURE__ */ __name((value) => !empty(value), "notEmpty");
82
+ var empty = (value) => value?.trim().length === 0;
83
+ var notEmpty = (value) => !empty(value);
86
84
 
87
85
  // src/lib/string/union.ts
88
- var union = /* @__PURE__ */ __name((a, b) => /* @__PURE__ */ new Set([
89
- ...new Set(a),
90
- ...new Set(b)
91
- ]), "union");
86
+ var union = (a, b) => /* @__PURE__ */ new Set([...new Set(a), ...new Set(b)]);
92
87
 
93
88
  // src/lib/file/ReadFileSyncOptions.ts
94
- var defaultReadFileSyncOptions = {
95
- encoding: "utf8"
96
- };
89
+ var defaultReadFileSyncOptions = { encoding: "utf8" };
97
90
 
98
91
  // src/lib/file/fileLines.ts
99
- var readLines = /* @__PURE__ */ __name((uri, options = defaultReadFileSyncOptions) => existsSync(uri) ? readFileSync(uri, options).replace(WINDOWS_NEWLINE_REGEX, CROSS_PLATFORM_NEWLINE).split(CROSS_PLATFORM_NEWLINE) : [], "readLines");
100
- var readNonEmptyLines = /* @__PURE__ */ __name((uri, options = defaultReadFileSyncOptions) => readLines(uri, options).filter(notEmpty), "readNonEmptyLines");
101
- var writeLines = /* @__PURE__ */ __name((uri, lines, options = defaultReadFileSyncOptions) => {
92
+ var readLines = (uri, options = defaultReadFileSyncOptions) => existsSync(uri) ? readFileSync(uri, options).replace(WINDOWS_NEWLINE_REGEX, CROSS_PLATFORM_NEWLINE).split(CROSS_PLATFORM_NEWLINE) : [];
93
+ var readNonEmptyLines = (uri, options = defaultReadFileSyncOptions) => readLines(uri, options).filter(notEmpty);
94
+ var writeLines = (uri, lines, options = defaultReadFileSyncOptions) => {
102
95
  const existing = existsSync(uri) ? readFileSync(uri, options) : void 0;
103
96
  const desired = lines.join(CROSS_PLATFORM_NEWLINE);
104
97
  if (existing !== desired) writeFileSync(uri, desired, options);
105
- }, "writeLines");
98
+ };
106
99
 
107
100
  // src/lib/generateIgnoreFiles.ts
108
101
  import chalk3 from "chalk";
109
102
 
110
103
  // src/lib/yarn/isYarnVersionOrGreater.ts
111
104
  import { spawnSync } from "child_process";
112
- var isYarnVersionOrGreater = /* @__PURE__ */ __name((major, minor, patch) => {
113
- const result = spawnSync("yarn", [
114
- "-v"
115
- ], {
116
- encoding: "utf8",
117
- shell: true
118
- });
105
+ var isYarnVersionOrGreater = (major, minor, patch) => {
106
+ const result = spawnSync("yarn", ["-v"], { encoding: "utf8", shell: true });
119
107
  const version = result.stdout.toString().replaceAll("\n", "");
120
108
  const versionNumbers = version.split(".").map((ver) => Number.parseInt(ver));
121
109
  const majorDelta = versionNumbers[0] - major;
@@ -124,58 +112,43 @@ var isYarnVersionOrGreater = /* @__PURE__ */ __name((major, minor, patch) => {
124
112
  const majorOk = majorDelta >= 0;
125
113
  const minorOk = majorDelta > 0 || minorDelta >= 0;
126
114
  const patchOk = majorDelta > 0 || minorDelta > 0 || patchDelta >= 0;
127
- return [
128
- majorOk && minorOk && patchOk,
129
- version
130
- ];
131
- }, "isYarnVersionOrGreater");
115
+ return [majorOk && minorOk && patchOk, version];
116
+ };
132
117
 
133
118
  // src/lib/yarn/workspace/yarnWorkspaces.ts
134
119
  import { spawnSync as spawnSync2 } from "child_process";
135
- var yarnWorkspaces = /* @__PURE__ */ __name(() => {
136
- const result = spawnSync2("yarn", [
137
- "workspaces",
138
- "list",
139
- "--json",
140
- "--recursive"
141
- ], {
142
- encoding: "utf8",
143
- shell: true
144
- });
120
+ var yarnWorkspaces = () => {
121
+ const result = spawnSync2("yarn", ["workspaces", "list", "--json", "--recursive"], { encoding: "utf8", shell: true });
145
122
  if (result.error) {
146
123
  throw result.error;
147
124
  }
148
125
  return result.stdout.toString().split("\n").slice(0, -1).map((item) => {
149
126
  return JSON.parse(item);
150
127
  });
151
- }, "yarnWorkspaces");
128
+ };
152
129
 
153
130
  // src/lib/yarn/workspace/yarnWorkspace.ts
154
- var yarnWorkspace = /* @__PURE__ */ __name((pkg) => {
131
+ var yarnWorkspace = (pkg) => {
155
132
  const workspace = yarnWorkspaces().find(({ name }) => name === pkg);
156
133
  if (!workspace) throw new Error(`Workspace ${pkg} not found`);
157
134
  return workspace;
158
- }, "yarnWorkspace");
135
+ };
159
136
 
160
137
  // src/lib/yarn/yarnInitCwd.ts
161
- var INIT_CWD = /* @__PURE__ */ __name(() => {
138
+ var INIT_CWD = () => {
162
139
  if (!process.env.INIT_CWD) console.error("Missing INIT_CWD");
163
140
  return process.env.INIT_CWD;
164
- }, "INIT_CWD");
141
+ };
165
142
 
166
143
  // src/lib/generateIgnoreFiles.ts
167
- var localeCompare = /* @__PURE__ */ __name((a, b) => a.localeCompare(b), "localeCompare");
168
- var mergeEntries = /* @__PURE__ */ __name((a, b) => [
169
- ...union(a, b)
170
- ].sort(localeCompare), "mergeEntries");
171
- var generateIgnoreFiles = /* @__PURE__ */ __name((filename3, pkg) => {
144
+ var localeCompare = (a, b) => a.localeCompare(b);
145
+ var mergeEntries = (a, b) => [...union(a, b)].sort(localeCompare);
146
+ var generateIgnoreFiles = (filename3, pkg) => {
172
147
  console.log(chalk3.green(`Generate ${filename3} Files`));
173
148
  const cwd = INIT_CWD() ?? ".";
174
- const workspaces = pkg ? [
175
- yarnWorkspace(pkg)
176
- ] : yarnWorkspaces();
177
- const readEntries = /* @__PURE__ */ __name((location) => readNonEmptyLines(`${location}/${filename3}`), "readEntries");
178
- const writeEntries = /* @__PURE__ */ __name((location, entries) => writeLines(`${location}/${filename3}`, entries), "writeEntries");
149
+ const workspaces = pkg ? [yarnWorkspace(pkg)] : yarnWorkspaces();
150
+ const readEntries = (location) => readNonEmptyLines(`${location}/${filename3}`);
151
+ const writeEntries = (location, entries) => writeLines(`${location}/${filename3}`, entries);
179
152
  const results = workspaces.map(({ location, name }) => {
180
153
  try {
181
154
  writeEntries(location, mergeEntries(readEntries(cwd), readEntries(location)));
@@ -188,13 +161,13 @@ var generateIgnoreFiles = /* @__PURE__ */ __name((filename3, pkg) => {
188
161
  });
189
162
  const succeeded = results.every((result) => result === 0);
190
163
  return succeeded ? 0 : 1;
191
- }, "generateIgnoreFiles");
164
+ };
192
165
 
193
166
  // src/lib/runSteps.ts
194
167
  import { spawnSync as spawnSync3 } from "child_process";
195
168
  import { existsSync as existsSync2 } from "fs";
196
169
  import chalk4 from "chalk";
197
- var runSteps = /* @__PURE__ */ __name((name, steps, exitOnFail = true, messages) => {
170
+ var runSteps = (name, steps, exitOnFail = true, messages) => {
198
171
  return safeExit(() => {
199
172
  const pkgName = process.env.npm_package_name;
200
173
  console.log(chalk4.green(`${name} [${pkgName}]`));
@@ -210,10 +183,7 @@ var runSteps = /* @__PURE__ */ __name((name, steps, exitOnFail = true, messages)
210
183
  const status = spawnSync3(command, Array.isArray(args) ? args : args.split(" "), {
211
184
  ...config,
212
185
  encoding: "utf8",
213
- env: {
214
- FORCE_COLOR: "3",
215
- ...process.env
216
- },
186
+ env: { FORCE_COLOR: "3", ...process.env },
217
187
  shell: true,
218
188
  stdio: "inherit"
219
189
  }).status ?? 0;
@@ -222,88 +192,45 @@ var runSteps = /* @__PURE__ */ __name((name, steps, exitOnFail = true, messages)
222
192
  }
223
193
  return totalStatus;
224
194
  }, !!exitOnFail);
225
- }, "runSteps");
195
+ };
226
196
 
227
197
  // src/actions/clean-docs.ts
228
198
  import path from "path";
229
199
  import chalk5 from "chalk";
230
- var cleanDocs = /* @__PURE__ */ __name(() => {
200
+ var cleanDocs = () => {
231
201
  const pkgName = process.env.npm_package_name;
232
202
  console.log(chalk5.green(`Cleaning Docs [${pkgName}]`));
233
203
  for (const { location } of yarnWorkspaces()) deleteGlob(path.join(location, "docs"));
234
204
  return 0;
235
- }, "cleanDocs");
205
+ };
236
206
 
237
207
  // src/actions/dead.ts
238
- var dead = /* @__PURE__ */ __name(() => {
239
- return runSteps("Dead", [
240
- [
241
- "yarn",
242
- [
243
- "ts-prune",
244
- "-p",
245
- "tsconfig.json"
246
- ]
247
- ]
248
- ]);
249
- }, "dead");
208
+ var dead = () => {
209
+ return runSteps("Dead", [["yarn", ["ts-prune", "-p", "tsconfig.json"]]]);
210
+ };
250
211
 
251
212
  // src/actions/gen-docs.ts
252
- var genDocs = /* @__PURE__ */ __name(({ pkg, incremental }) => {
253
- return pkg ? genDocsPackage({
254
- pkg
255
- }) : genDocsAll({
256
- incremental
257
- });
258
- }, "genDocs");
259
- var genDocsPackage = /* @__PURE__ */ __name(({ pkg }) => {
260
- const steps = [
261
- [
262
- "yarn",
263
- [
264
- "workspace",
265
- pkg,
266
- "run",
267
- "package-gen-docs"
268
- ]
269
- ]
270
- ];
271
- return runSteps(`GenDocs [${pkg}]`, [
272
- ...steps
273
- ]);
274
- }, "genDocsPackage");
275
- var genDocsAll = /* @__PURE__ */ __name(({ incremental }) => {
276
- const incrementalOptions = incremental ? [
277
- "--since",
278
- "-pA"
279
- ] : [
280
- "-pA"
281
- ];
282
- const steps = [
283
- [
284
- "yarn",
285
- [
286
- "workspaces",
287
- "foreach",
288
- ...incrementalOptions,
289
- "run",
290
- "package-gen-docs"
291
- ]
292
- ]
293
- ];
294
- return runSteps(`GenDocs [All${incremental ? "-Incremental" : ""}]`, [
295
- ...steps
296
- ]);
297
- }, "genDocsAll");
213
+ var genDocs = ({ pkg, incremental }) => {
214
+ return pkg ? genDocsPackage({ pkg }) : genDocsAll({ incremental });
215
+ };
216
+ var genDocsPackage = ({ pkg }) => {
217
+ const steps = [["yarn", ["workspace", pkg, "run", "package-gen-docs"]]];
218
+ return runSteps(`GenDocs [${pkg}]`, [...steps]);
219
+ };
220
+ var genDocsAll = ({ incremental }) => {
221
+ const incrementalOptions = incremental ? ["--since", "-pA"] : ["-pA"];
222
+ const steps = [["yarn", ["workspaces", "foreach", ...incrementalOptions, "run", "package-gen-docs"]]];
223
+ return runSteps(`GenDocs [All${incremental ? "-Incremental" : ""}]`, [...steps]);
224
+ };
298
225
 
299
226
  // src/actions/gitignore-gen.ts
300
227
  var filename = ".gitignore";
301
- var gitignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename, pkg), "gitignoreGen");
228
+ var gitignoreGen = (pkg) => generateIgnoreFiles(filename, pkg);
302
229
 
303
230
  // src/actions/gitlint.ts
304
231
  import chalk6 from "chalk";
305
232
  import ParseGitConfig from "parse-git-config";
306
- var gitlint = /* @__PURE__ */ __name(() => {
233
+ var gitlint = () => {
307
234
  console.log(`
308
235
  Gitlint Start [${process.cwd()}]
309
236
  `);
@@ -311,10 +238,10 @@ Gitlint Start [${process.cwd()}]
311
238
  let warnings = 0;
312
239
  const errors = 0;
313
240
  const gitConfig = ParseGitConfig.sync();
314
- const warn = /* @__PURE__ */ __name((message) => {
241
+ const warn = (message) => {
315
242
  console.warn(chalk6.yellow(`Warning: ${message}`));
316
243
  warnings++;
317
- }, "warn");
244
+ };
318
245
  if (gitConfig.core.ignorecase) {
319
246
  warn("Please set core.ignorecase to FALSE in .git/config file [run yarn gitlint-fix]");
320
247
  } else {
@@ -343,42 +270,36 @@ Gitlint Start [${process.cwd()}]
343
270
  console.warn(`Gitlint Finish [ ${resultMessages.join(" | ")} ]
344
271
  `);
345
272
  return warnings + errors === 0 ? 1 : 0;
346
- }, "gitlint");
273
+ };
347
274
 
348
275
  // src/actions/gitlint-fix.ts
349
276
  import { execSync } from "child_process";
350
277
  import chalk7 from "chalk";
351
278
  import ParseGitConfig2 from "parse-git-config";
352
- var gitlintFix = /* @__PURE__ */ __name(() => {
279
+ var gitlintFix = () => {
353
280
  console.log(`
354
281
  Gitlint Fix Start [${process.cwd()}]
355
282
  `);
356
283
  const gitConfig = ParseGitConfig2.sync();
357
284
  if (gitConfig.core.ignorecase) {
358
- execSync("git config core.ignorecase false", {
359
- stdio: "inherit"
360
- });
285
+ execSync("git config core.ignorecase false", { stdio: "inherit" });
361
286
  console.warn(chalk7.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
362
287
  }
363
288
  if (gitConfig.core.autocrlf !== false) {
364
- execSync("git config core.autocrlf false", {
365
- stdio: "inherit"
366
- });
289
+ execSync("git config core.autocrlf false", { stdio: "inherit" });
367
290
  console.warn(chalk7.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
368
291
  }
369
292
  if (gitConfig.core.eol !== "lf") {
370
- execSync("git config core.eol lf", {
371
- stdio: "inherit"
372
- });
293
+ execSync("git config core.eol lf", { stdio: "inherit" });
373
294
  console.warn(chalk7.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
374
295
  }
375
296
  return 1;
376
- }, "gitlintFix");
297
+ };
377
298
 
378
299
  // src/actions/license.ts
379
300
  import chalk8 from "chalk";
380
301
  import { init } from "license-checker";
381
- var license = /* @__PURE__ */ __name(async (pkg) => {
302
+ var license = async (pkg) => {
382
303
  const workspaces = yarnWorkspaces();
383
304
  const workspaceList = workspaces.filter(({ name }) => {
384
305
  return pkg === void 0 || name === pkg;
@@ -402,220 +323,214 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
402
323
  "Python-2.0"
403
324
  ]);
404
325
  console.log(chalk8.green("License Checker"));
405
- return (await Promise.all(workspaceList.map(({ location, name }) => {
406
- return new Promise((resolve) => {
407
- init({
408
- production: true,
409
- start: location
410
- }, (error, packages) => {
411
- if (error) {
412
- console.error(chalk8.red(`License Checker [${name}] Error`));
413
- console.error(chalk8.gray(error));
414
- console.log("\n");
415
- resolve(1);
416
- } else {
417
- console.log(chalk8.green(`License Checker [${name}]`));
418
- let count = 0;
419
- for (const [name2, info] of Object.entries(packages)) {
420
- const licenses = Array.isArray(info.licenses) ? info.licenses : [
421
- info.licenses
422
- ];
423
- for (let license2 of licenses) {
424
- if (license2) {
425
- const processedLicense = license2[0] === "(" && license2.at(-1) === ")" ? license2.slice(1, -2) : license2;
426
- const orLicenses = processedLicense.split(" OR ");
427
- let orLicenseFound = false;
428
- for (const orLicense of orLicenses) {
429
- if (exclude.has(orLicense)) {
430
- orLicenseFound = true;
326
+ return (await Promise.all(
327
+ workspaceList.map(({ location, name }) => {
328
+ return new Promise((resolve) => {
329
+ init({ production: true, start: location }, (error, packages) => {
330
+ if (error) {
331
+ console.error(chalk8.red(`License Checker [${name}] Error`));
332
+ console.error(chalk8.gray(error));
333
+ console.log("\n");
334
+ resolve(1);
335
+ } else {
336
+ console.log(chalk8.green(`License Checker [${name}]`));
337
+ let count = 0;
338
+ for (const [name2, info] of Object.entries(packages)) {
339
+ const licenses = Array.isArray(info.licenses) ? info.licenses : [info.licenses];
340
+ for (let license2 of licenses) {
341
+ if (license2) {
342
+ const processedLicense = license2[0] === "(" && license2.at(-1) === ")" ? license2.slice(1, -2) : license2;
343
+ const orLicenses = processedLicense.split(" OR ");
344
+ let orLicenseFound = false;
345
+ for (const orLicense of orLicenses) {
346
+ if (exclude.has(orLicense)) {
347
+ orLicenseFound = true;
348
+ }
349
+ }
350
+ if (!orLicenseFound) {
351
+ count++;
352
+ console.warn(chalk8.yellow(`${name2}: Package License not allowed [${license2}]`));
431
353
  }
432
- }
433
- if (!orLicenseFound) {
434
- count++;
435
- console.warn(chalk8.yellow(`${name2}: Package License not allowed [${license2}]`));
436
354
  }
437
355
  }
438
356
  }
357
+ console.log("\n");
358
+ resolve(count);
439
359
  }
440
- console.log("\n");
441
- resolve(count);
442
- }
360
+ });
443
361
  });
444
- });
445
- }))).reduce((prev, value) => prev || value, 0);
446
- }, "license");
362
+ })
363
+ )).reduce((prev, value) => prev || value, 0);
364
+ };
447
365
 
448
366
  // src/actions/npmignore-gen.ts
449
367
  var filename2 = ".npmignore";
450
- var npmignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename2, pkg), "npmignoreGen");
368
+ var npmignoreGen = (pkg) => generateIgnoreFiles(filename2, pkg);
451
369
 
452
370
  // src/actions/retest.ts
453
- var retest = /* @__PURE__ */ __name(() => {
371
+ var retest = () => {
454
372
  return runSteps("Test", [
455
- [
456
- "yarn",
457
- [
458
- "jest",
459
- "--clearCache"
460
- ]
461
- ],
462
- [
463
- "yarn",
464
- [
465
- "jest",
466
- "."
467
- ]
468
- ]
373
+ ["yarn", ["jest", "--clearCache"]],
374
+ ["yarn", ["jest", "."]]
469
375
  ]);
470
- }, "retest");
376
+ };
471
377
 
472
378
  // src/actions/test.ts
473
- var test = /* @__PURE__ */ __name(() => {
474
- return runSteps("Test", [
475
- [
476
- "yarn",
477
- [
478
- "vitest",
479
- "."
480
- ]
481
- ]
482
- ]);
483
- }, "test");
379
+ var test = () => {
380
+ return runSteps("Test", [["yarn", ["vitest", "."]]]);
381
+ };
484
382
 
485
383
  // src/actions/upplug.ts
486
- var updateYarnPlugins = /* @__PURE__ */ __name(() => {
384
+ var updateYarnPlugins = () => {
487
385
  return runSteps("Update Yarn Plugins", [
488
- [
489
- "yarn",
490
- [
491
- "plugin",
492
- "import",
493
- "https://mskelton.dev/yarn-outdated/v3"
494
- ]
495
- ],
496
- [
497
- "yarn",
498
- [
499
- "plugin",
500
- "import",
501
- "version"
502
- ]
503
- ],
504
- [
505
- "yarn",
506
- [
507
- "plugin",
508
- "import",
509
- "interactive-tools"
510
- ]
511
- ],
512
- [
513
- "yarn",
514
- [
515
- "plugin",
516
- "import",
517
- "workspace-tools"
518
- ]
519
- ]
386
+ ["yarn", ["plugin", "import", "https://mskelton.dev/yarn-outdated/v3"]],
387
+ ["yarn", ["plugin", "import", "version"]],
388
+ ["yarn", ["plugin", "import", "interactive-tools"]],
389
+ ["yarn", ["plugin", "import", "workspace-tools"]]
520
390
  ]);
521
- }, "updateYarnPlugins");
391
+ };
522
392
 
523
393
  // src/actions/upyarn.ts
524
- var updateYarnVersion = /* @__PURE__ */ __name(() => {
525
- return runSteps("Update Yarn Version", [
526
- [
527
- "yarn",
528
- [
529
- "set",
530
- "version",
531
- "latest"
532
- ]
533
- ]
534
- ]);
535
- }, "updateYarnVersion");
394
+ var updateYarnVersion = () => {
395
+ return runSteps("Update Yarn Version", [["yarn", ["set", "version", "latest"]]]);
396
+ };
536
397
 
537
398
  // src/actions/yarn3only.ts
538
- var yarn3Only = /* @__PURE__ */ __name(() => {
399
+ var yarn3Only = () => {
539
400
  const [valid, version] = isYarnVersionOrGreater(3);
540
401
  if (!valid) {
541
402
  processEx(`Invalid Yarn version [${version}]`);
542
403
  }
543
404
  return 0;
544
- }, "yarn3Only");
405
+ };
545
406
 
546
407
  // src/xy/param.ts
547
- var packagePositionalParam = /* @__PURE__ */ __name((yargs) => {
548
- return yargs.positional("package", {
549
- describe: "Specific package to target",
550
- type: "string"
551
- });
552
- }, "packagePositionalParam");
408
+ var packagePositionalParam = (yargs) => {
409
+ return yargs.positional("package", { describe: "Specific package to target", type: "string" });
410
+ };
553
411
 
554
412
  // src/xy/xyCommonCommands.ts
555
- var xyCommonCommands = /* @__PURE__ */ __name((args) => {
556
- return args.command("license [package]", "License - Check licenses of dependencies", (yargs) => {
557
- return packagePositionalParam(yargs);
558
- }, async (argv) => {
559
- if (argv.verbose) console.log(`License: ${argv.package ?? "all"}`);
560
- process.exitCode = await license();
561
- }).command("dead [package]", "Dead - Check for dead code", (yargs) => {
562
- return packagePositionalParam(yargs);
563
- }, (argv) => {
564
- if (argv.verbose) console.log("Dead");
565
- process.exitCode = dead();
566
- }).command("gen-docs [package]", "GenDocs - Generate TypeDocs", (yargs) => {
567
- return packagePositionalParam(yargs);
568
- }, (argv) => {
569
- if (argv.verbose) console.log(`Generating TypeDocs: ${argv.package ?? "all"}`);
570
- process.exitCode = genDocs({
571
- incremental: !!argv.incremental,
572
- pkg: argv.package
573
- });
574
- }).command("clean-docs", "CleanDocs - Clean TypeDocs", (yargs) => yargs, (argv) => {
575
- if (argv.verbose) console.log("Cleaning TypeDocs: all");
576
- process.exitCode = cleanDocs();
577
- }).command("gitlint [package]", "Gitlint - Lint your git config", (yargs) => {
578
- return yargs;
579
- }, (argv) => {
580
- if (argv.verbose) console.log("Gitlint");
581
- process.exitCode = argv.fix ? gitlintFix() : gitlint();
582
- }).command("gitignore-gen", "GitIgnore Gen - Generate .gitignore files", (yargs) => {
583
- return yargs;
584
- }, (argv) => {
585
- if (argv.verbose) console.log("GitIgnore Gen");
586
- process.exitCode = gitignoreGen();
587
- }).command("npmignore-gen", "NpmIgnore Gen - Generate .npmignore files", (yargs) => {
588
- return yargs;
589
- }, (argv) => {
590
- if (argv.verbose) console.log("NpmIgnore Gen");
591
- process.exitCode = npmignoreGen();
592
- }).command("retest", "Re-Test - Run Jest Tests with cleaned cache", (yargs) => {
593
- return yargs;
594
- }, (argv) => {
595
- if (argv.verbose) console.log("Re-Testing");
596
- process.exitCode = retest();
597
- }).command("test", "Test - Run Jest Tests", (yargs) => {
598
- return yargs;
599
- }, (argv) => {
600
- if (argv.verbose) console.log("Testing");
601
- process.exitCode = test();
602
- }).command("upplug", "UpPlug - Update Yarn Plugins", (yargs) => {
603
- return yargs;
604
- }, (argv) => {
605
- if (argv.verbose) console.log("UpPlug");
606
- process.exitCode = updateYarnPlugins();
607
- }).command("upyarn", "UpYarn - Update Yarn Version", (yargs) => {
608
- return yargs;
609
- }, (argv) => {
610
- if (argv.verbose) console.log("UpYarn");
611
- process.exitCode = updateYarnVersion();
612
- }).command("yarn3only", "Yarn3Only - Check if using Yarn v3", (yargs) => {
613
- return yargs;
614
- }, (argv) => {
615
- if (argv.verbose) console.log("Yarn 3 Check");
616
- process.exitCode = yarn3Only();
617
- });
618
- }, "xyCommonCommands");
413
+ var xyCommonCommands = (args) => {
414
+ return args.command(
415
+ "license [package]",
416
+ "License - Check licenses of dependencies",
417
+ (yargs) => {
418
+ return packagePositionalParam(yargs);
419
+ },
420
+ async (argv) => {
421
+ if (argv.verbose) console.log(`License: ${argv.package ?? "all"}`);
422
+ process.exitCode = await license();
423
+ }
424
+ ).command(
425
+ "dead [package]",
426
+ "Dead - Check for dead code",
427
+ (yargs) => {
428
+ return packagePositionalParam(yargs);
429
+ },
430
+ (argv) => {
431
+ if (argv.verbose) console.log("Dead");
432
+ process.exitCode = dead();
433
+ }
434
+ ).command(
435
+ "gen-docs [package]",
436
+ "GenDocs - Generate TypeDocs",
437
+ (yargs) => {
438
+ return packagePositionalParam(yargs);
439
+ },
440
+ (argv) => {
441
+ if (argv.verbose) console.log(`Generating TypeDocs: ${argv.package ?? "all"}`);
442
+ process.exitCode = genDocs({ incremental: !!argv.incremental, pkg: argv.package });
443
+ }
444
+ ).command(
445
+ "clean-docs",
446
+ "CleanDocs - Clean TypeDocs",
447
+ (yargs) => yargs,
448
+ (argv) => {
449
+ if (argv.verbose) console.log("Cleaning TypeDocs: all");
450
+ process.exitCode = cleanDocs();
451
+ }
452
+ ).command(
453
+ "gitlint [package]",
454
+ "Gitlint - Lint your git config",
455
+ (yargs) => {
456
+ return yargs;
457
+ },
458
+ (argv) => {
459
+ if (argv.verbose) console.log("Gitlint");
460
+ process.exitCode = argv.fix ? gitlintFix() : gitlint();
461
+ }
462
+ ).command(
463
+ "gitignore-gen",
464
+ "GitIgnore Gen - Generate .gitignore files",
465
+ (yargs) => {
466
+ return yargs;
467
+ },
468
+ (argv) => {
469
+ if (argv.verbose) console.log("GitIgnore Gen");
470
+ process.exitCode = gitignoreGen();
471
+ }
472
+ ).command(
473
+ "npmignore-gen",
474
+ "NpmIgnore Gen - Generate .npmignore files",
475
+ (yargs) => {
476
+ return yargs;
477
+ },
478
+ (argv) => {
479
+ if (argv.verbose) console.log("NpmIgnore Gen");
480
+ process.exitCode = npmignoreGen();
481
+ }
482
+ ).command(
483
+ "retest",
484
+ "Re-Test - Run Jest Tests with cleaned cache",
485
+ (yargs) => {
486
+ return yargs;
487
+ },
488
+ (argv) => {
489
+ if (argv.verbose) console.log("Re-Testing");
490
+ process.exitCode = retest();
491
+ }
492
+ ).command(
493
+ "test",
494
+ "Test - Run Jest Tests",
495
+ (yargs) => {
496
+ return yargs;
497
+ },
498
+ (argv) => {
499
+ if (argv.verbose) console.log("Testing");
500
+ process.exitCode = test();
501
+ }
502
+ ).command(
503
+ "upplug",
504
+ "UpPlug - Update Yarn Plugins",
505
+ (yargs) => {
506
+ return yargs;
507
+ },
508
+ (argv) => {
509
+ if (argv.verbose) console.log("UpPlug");
510
+ process.exitCode = updateYarnPlugins();
511
+ }
512
+ ).command(
513
+ "upyarn",
514
+ "UpYarn - Update Yarn Version",
515
+ (yargs) => {
516
+ return yargs;
517
+ },
518
+ (argv) => {
519
+ if (argv.verbose) console.log("UpYarn");
520
+ process.exitCode = updateYarnVersion();
521
+ }
522
+ ).command(
523
+ "yarn3only",
524
+ "Yarn3Only - Check if using Yarn v3",
525
+ (yargs) => {
526
+ return yargs;
527
+ },
528
+ (argv) => {
529
+ if (argv.verbose) console.log("Yarn 3 Check");
530
+ process.exitCode = yarn3Only();
531
+ }
532
+ );
533
+ };
619
534
  export {
620
535
  xyCommonCommands
621
536
  };