@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,12 +1,9 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
1
  // src/xy/xyLintCommands.ts
5
2
  import chalk12 from "chalk";
6
3
 
7
4
  // src/lib/checkResult.ts
8
5
  import chalk from "chalk";
9
- var checkResult = /* @__PURE__ */ __name((name, result, level = "error", exitOnFail = false) => {
6
+ var checkResult = (name, result, level = "error", exitOnFail = false) => {
10
7
  if (result) {
11
8
  const exiting = exitOnFail ? "[Exiting Process]" : "[Continuing]";
12
9
  const chalkFunc = level === "error" ? chalk.red : chalk.yellow;
@@ -15,23 +12,23 @@ var checkResult = /* @__PURE__ */ __name((name, result, level = "error", exitOnF
15
12
  process.exit(result);
16
13
  }
17
14
  }
18
- }, "checkResult");
15
+ };
19
16
 
20
17
  // src/lib/processEx.ts
21
18
  import chalk2 from "chalk";
22
19
 
23
20
  // src/lib/withError.ts
24
- var withError = /* @__PURE__ */ __name((ex, closure, predicate = (ex2) => !!ex2.name && !!ex2.message) => {
21
+ var withError = (ex, closure, predicate = (ex2) => !!ex2.name && !!ex2.message) => {
25
22
  return predicate(ex) ? closure(ex) : void 0;
26
- }, "withError");
23
+ };
27
24
 
28
25
  // src/lib/withErrnoException.ts
29
- var withErrnoException = /* @__PURE__ */ __name((ex, closure) => {
26
+ var withErrnoException = (ex, closure) => {
30
27
  return withError(ex, closure, (ex2) => ex2.errno !== void 0);
31
- }, "withErrnoException");
28
+ };
32
29
 
33
30
  // src/lib/processEx.ts
34
- var processEx = /* @__PURE__ */ __name((ex) => {
31
+ var processEx = (ex) => {
35
32
  const error = typeof ex === "string" ? new Error(ex) : ex;
36
33
  const exitCode = withErrnoException(error, (error2) => {
37
34
  if (error2.code === "ENOENT") {
@@ -48,10 +45,10 @@ var processEx = /* @__PURE__ */ __name((ex) => {
48
45
  return -1;
49
46
  })();
50
47
  process.exit(process.exitCode ?? exitCode);
51
- }, "processEx");
48
+ };
52
49
 
53
50
  // src/lib/safeExit.ts
54
- var safeExit = /* @__PURE__ */ __name((func, exitOnFail = true) => {
51
+ var safeExit = (func, exitOnFail = true) => {
55
52
  try {
56
53
  const result = func();
57
54
  if (result && exitOnFail) {
@@ -61,8 +58,8 @@ var safeExit = /* @__PURE__ */ __name((func, exitOnFail = true) => {
61
58
  } catch (ex) {
62
59
  return processEx(ex);
63
60
  }
64
- }, "safeExit");
65
- var safeExitAsync = /* @__PURE__ */ __name(async (func, exitOnFail = true) => {
61
+ };
62
+ var safeExitAsync = async (func, exitOnFail = true) => {
66
63
  try {
67
64
  const result = await func();
68
65
  if (result && exitOnFail) {
@@ -72,40 +69,32 @@ var safeExitAsync = /* @__PURE__ */ __name(async (func, exitOnFail = true) => {
72
69
  } catch (ex) {
73
70
  return processEx(ex);
74
71
  }
75
- }, "safeExitAsync");
72
+ };
76
73
 
77
74
  // src/lib/yarn/workspace/yarnWorkspaces.ts
78
75
  import { spawnSync } from "child_process";
79
- var yarnWorkspaces = /* @__PURE__ */ __name(() => {
80
- const result = spawnSync("yarn", [
81
- "workspaces",
82
- "list",
83
- "--json",
84
- "--recursive"
85
- ], {
86
- encoding: "utf8",
87
- shell: true
88
- });
76
+ var yarnWorkspaces = () => {
77
+ const result = spawnSync("yarn", ["workspaces", "list", "--json", "--recursive"], { encoding: "utf8", shell: true });
89
78
  if (result.error) {
90
79
  throw result.error;
91
80
  }
92
81
  return result.stdout.toString().split("\n").slice(0, -1).map((item) => {
93
82
  return JSON.parse(item);
94
83
  });
95
- }, "yarnWorkspaces");
84
+ };
96
85
 
97
86
  // src/lib/yarn/workspace/yarnWorkspace.ts
98
- var yarnWorkspace = /* @__PURE__ */ __name((pkg) => {
87
+ var yarnWorkspace = (pkg) => {
99
88
  const workspace = yarnWorkspaces().find(({ name }) => name === pkg);
100
89
  if (!workspace) throw new Error(`Workspace ${pkg} not found`);
101
90
  return workspace;
102
- }, "yarnWorkspace");
91
+ };
103
92
 
104
93
  // src/lib/runSteps.ts
105
94
  import { spawnSync as spawnSync2 } from "child_process";
106
95
  import { existsSync } from "fs";
107
96
  import chalk3 from "chalk";
108
- var runSteps = /* @__PURE__ */ __name((name, steps, exitOnFail = true, messages) => {
97
+ var runSteps = (name, steps, exitOnFail = true, messages) => {
109
98
  return safeExit(() => {
110
99
  const pkgName = process.env.npm_package_name;
111
100
  console.log(chalk3.green(`${name} [${pkgName}]`));
@@ -121,10 +110,7 @@ var runSteps = /* @__PURE__ */ __name((name, steps, exitOnFail = true, messages)
121
110
  const status = spawnSync2(command, Array.isArray(args) ? args : args.split(" "), {
122
111
  ...config,
123
112
  encoding: "utf8",
124
- env: {
125
- FORCE_COLOR: "3",
126
- ...process.env
127
- },
113
+ env: { FORCE_COLOR: "3", ...process.env },
128
114
  shell: true,
129
115
  stdio: "inherit"
130
116
  }).status ?? 0;
@@ -133,13 +119,13 @@ var runSteps = /* @__PURE__ */ __name((name, steps, exitOnFail = true, messages)
133
119
  }
134
120
  return totalStatus;
135
121
  }, !!exitOnFail);
136
- }, "runSteps");
122
+ };
137
123
 
138
124
  // src/lib/runStepsAsync.ts
139
125
  import { spawn } from "child_process";
140
126
  import { existsSync as existsSync2 } from "fs";
141
127
  import chalk4 from "chalk";
142
- var runStepAsync = /* @__PURE__ */ __name((name, step, exitOnFail = true, message) => {
128
+ var runStepAsync = (name, step, exitOnFail = true, message) => {
143
129
  return new Promise((resolve) => {
144
130
  const [command, args, config] = step;
145
131
  if (message) {
@@ -151,15 +137,18 @@ var runStepAsync = /* @__PURE__ */ __name((name, step, exitOnFail = true, messag
151
137
  }
152
138
  spawn(command, Array.isArray(args) ? args : args.split(" "), {
153
139
  ...config,
154
- env: {
155
- FORCE_COLOR: "3",
156
- ...process.env
157
- },
140
+ env: { FORCE_COLOR: "3", ...process.env },
158
141
  shell: true,
159
142
  stdio: "inherit"
160
143
  }).on("close", (code) => {
161
144
  if (code) {
162
- console.error(chalk4.red(`Command Exited With Non-Zero Result [${chalk4.gray(code)}] | ${chalk4.yellow(command)} ${chalk4.white(Array.isArray(args) ? args.join(" ") : args)}`));
145
+ console.error(
146
+ chalk4.red(
147
+ `Command Exited With Non-Zero Result [${chalk4.gray(code)}] | ${chalk4.yellow(command)} ${chalk4.white(
148
+ Array.isArray(args) ? args.join(" ") : args
149
+ )}`
150
+ )
151
+ );
163
152
  checkResult(name, code, "error", exitOnFail);
164
153
  resolve(code);
165
154
  } else {
@@ -167,8 +156,8 @@ var runStepAsync = /* @__PURE__ */ __name((name, step, exitOnFail = true, messag
167
156
  }
168
157
  });
169
158
  });
170
- }, "runStepAsync");
171
- var runStepsAsync = /* @__PURE__ */ __name(async (name, steps, exitOnFail = true, messages) => {
159
+ };
160
+ var runStepsAsync = async (name, steps, exitOnFail = true, messages) => {
172
161
  return await safeExitAsync(async () => {
173
162
  const pkgName = process.env.npm_package_name;
174
163
  console.log(chalk4.green(`${name} [${pkgName}]`));
@@ -178,38 +167,21 @@ var runStepsAsync = /* @__PURE__ */ __name(async (name, steps, exitOnFail = true
178
167
  }
179
168
  return result;
180
169
  });
181
- }, "runStepsAsync");
170
+ };
182
171
 
183
172
  // src/actions/cycle.ts
184
173
  import { cruise } from "dependency-cruiser";
185
- var cycle = /* @__PURE__ */ __name(async ({ verbose, pkg } = {}) => {
186
- return pkg ? cyclePackage({
187
- pkg,
188
- verbose
189
- }) : await cycleAll({
190
- verbose
191
- });
192
- }, "cycle");
193
- var cyclePackage = /* @__PURE__ */ __name(({ pkg, verbose }) => {
194
- const verboseOptions = verbose ? [
195
- "--verbose"
196
- ] : [
197
- "--no-verbose"
198
- ];
199
- return runSteps(`Cycle [${pkg}]`, [
200
- [
201
- "yarn",
202
- [
203
- "workspace",
204
- pkg,
205
- "run",
206
- "package-cycle",
207
- ...verboseOptions
208
- ]
209
- ]
210
- ]);
211
- }, "cyclePackage");
212
- var cycleAll = /* @__PURE__ */ __name(async ({ verbose = false }) => {
174
+ var cycle = async ({ verbose, pkg } = {}) => {
175
+ return pkg ? cyclePackage({ pkg, verbose }) : await cycleAll({ verbose });
176
+ };
177
+ var cyclePackage = ({ pkg, verbose }) => {
178
+ const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
179
+ return runSteps(
180
+ `Cycle [${pkg}]`,
181
+ [["yarn", ["workspace", pkg, "run", "package-cycle", ...verboseOptions]]]
182
+ );
183
+ };
184
+ var cycleAll = async ({ verbose = false }) => {
213
185
  const pkgName = process.env.npm_package_name;
214
186
  const cruiseOptions = {
215
187
  ruleSet: {
@@ -219,26 +191,20 @@ var cycleAll = /* @__PURE__ */ __name(async ({ verbose = false }) => {
219
191
  severity: "error",
220
192
  comment: "This dependency creates a circular reference",
221
193
  from: {},
222
- to: {
223
- circular: true
224
- }
194
+ to: { circular: true }
225
195
  }
226
196
  ]
227
197
  },
228
198
  exclude: "node_modules|packages/.*/packages",
229
199
  validate: true,
230
- doNotFollow: {
231
- path: "node_modules|packages/.*/packages"
232
- },
200
+ doNotFollow: { path: "node_modules|packages/.*/packages" },
233
201
  tsPreCompilationDeps: false,
234
202
  combinedDependencies: true,
235
203
  outputType: verbose ? "text" : "err"
236
204
  };
237
205
  const target = "**/src";
238
206
  console.log(`Checking for circular dependencies in ${target}...`);
239
- const result = await cruise([
240
- target
241
- ], cruiseOptions);
207
+ const result = await cruise([target], cruiseOptions);
242
208
  if (result.output) {
243
209
  console.log(result.output);
244
210
  }
@@ -248,7 +214,7 @@ var cycleAll = /* @__PURE__ */ __name(async ({ verbose = false }) => {
248
214
  console.error(`${pkgName} \u274C Dependency violations found`);
249
215
  }
250
216
  return result.exitCode;
251
- }, "cycleAll");
217
+ };
252
218
 
253
219
  // src/actions/deplint/deplint.ts
254
220
  import chalk9 from "chalk";
@@ -256,30 +222,17 @@ import chalk9 from "chalk";
256
222
  // src/actions/deplint/findFilesByGlob.ts
257
223
  import { globSync } from "glob";
258
224
  function findFilesByGlob(cwd, pattern) {
259
- return globSync(pattern, {
260
- cwd,
261
- absolute: true
262
- });
225
+ return globSync(pattern, { cwd, absolute: true });
263
226
  }
264
- __name(findFilesByGlob, "findFilesByGlob");
265
227
 
266
228
  // src/actions/deplint/findFiles.ts
267
229
  function findFiles(path3) {
268
- const allSourceInclude = [
269
- "./src/**/*.{ts,tsx}"
270
- ];
271
- const allDistInclude = [
272
- "./dist/**/*.d.ts",
273
- "./dist/**/*.{mjs,js,cjs}"
274
- ];
230
+ const allSourceInclude = ["./src/**/*.{ts,tsx}"];
231
+ const allDistInclude = ["./dist/**/*.d.ts", "./dist/**/*.{mjs,js,cjs}"];
275
232
  const srcFiles = allSourceInclude.flatMap((pattern) => findFilesByGlob(path3, pattern));
276
233
  const distFiles = allDistInclude.flatMap((pattern) => findFilesByGlob(path3, pattern));
277
- return {
278
- srcFiles,
279
- distFiles
280
- };
234
+ return { srcFiles, distFiles };
281
235
  }
282
- __name(findFiles, "findFiles");
283
236
 
284
237
  // src/actions/deplint/getDependenciesFromPackageJson.ts
285
238
  import fs from "fs";
@@ -297,7 +250,6 @@ function getDependenciesFromPackageJson(packageJsonPath) {
297
250
  peerDependencies
298
251
  };
299
252
  }
300
- __name(getDependenciesFromPackageJson, "getDependenciesFromPackageJson");
301
253
 
302
254
  // src/actions/deplint/getImportsFromFile.ts
303
255
  import fs2 from "fs";
@@ -313,13 +265,18 @@ function getBasePackageName(importName) {
313
265
  }
314
266
  return importNameScrubbed.split("/")[0];
315
267
  }
316
- __name(getBasePackageName, "getBasePackageName");
317
268
 
318
269
  // src/actions/deplint/getImportsFromFile.ts
319
270
  function getImportsFromFile(filePath, importPaths, typeImportPaths) {
320
271
  const sourceCode = fs2.readFileSync(filePath, "utf8");
321
272
  const isMjsFile = filePath.endsWith(".mjs");
322
- const sourceFile = ts.createSourceFile(path2.basename(filePath), sourceCode, ts.ScriptTarget.Latest, true, isMjsFile ? ts.ScriptKind.JS : void 0);
273
+ const sourceFile = ts.createSourceFile(
274
+ path2.basename(filePath),
275
+ sourceCode,
276
+ ts.ScriptTarget.Latest,
277
+ true,
278
+ isMjsFile ? ts.ScriptKind.JS : void 0
279
+ );
323
280
  const imports = [];
324
281
  const typeImports = [];
325
282
  const isDeclarationFile = filePath.endsWith(".d.ts");
@@ -344,13 +301,8 @@ function getImportsFromFile(filePath, importPaths, typeImportPaths) {
344
301
  }
345
302
  ts.forEachChild(node, visit);
346
303
  }
347
- __name(visit, "visit");
348
304
  visit(sourceFile);
349
- const importsStartsWithExcludes = [
350
- ".",
351
- "#",
352
- "node:"
353
- ];
305
+ const importsStartsWithExcludes = [".", "#", "node:"];
354
306
  const cleanedImports = imports.filter((imp) => !importsStartsWithExcludes.some((exc) => imp.startsWith(exc))).map(getBasePackageName);
355
307
  const cleanedTypeImports = typeImports.filter((imp) => !importsStartsWithExcludes.some((exc) => imp.startsWith(exc))).map(getBasePackageName);
356
308
  for (const imp of cleanedImports) {
@@ -361,22 +313,14 @@ function getImportsFromFile(filePath, importPaths, typeImportPaths) {
361
313
  typeImportPaths[imp] = typeImportPaths[imp] ?? [];
362
314
  typeImportPaths[imp].push(filePath);
363
315
  }
364
- return [
365
- cleanedImports,
366
- cleanedTypeImports
367
- ];
316
+ return [cleanedImports, cleanedTypeImports];
368
317
  }
369
- __name(getImportsFromFile, "getImportsFromFile");
370
318
 
371
319
  // src/actions/deplint/getExternalImportsFromFiles.ts
372
- var internalImportPrefixes = [
373
- ".",
374
- "#",
375
- "node:"
376
- ];
377
- var removeInternalImports = /* @__PURE__ */ __name((imports) => {
320
+ var internalImportPrefixes = [".", "#", "node:"];
321
+ var removeInternalImports = (imports) => {
378
322
  return imports.filter((imp) => !internalImportPrefixes.some((prefix) => imp.startsWith(prefix)));
379
- }, "removeInternalImports");
323
+ };
380
324
  function getExternalImportsFromFiles({ srcFiles, distFiles }) {
381
325
  const srcImportPaths = {};
382
326
  const distImportPaths = {};
@@ -402,12 +346,15 @@ function getExternalImportsFromFiles({ srcFiles, distFiles }) {
402
346
  externalDistTypeImports
403
347
  };
404
348
  }
405
- __name(getExternalImportsFromFiles, "getExternalImportsFromFiles");
406
349
 
407
350
  // src/actions/deplint/checkPackage/getUnlistedDependencies.ts
408
351
  import { builtinModules } from "module";
409
352
  import chalk5 from "chalk";
410
- function getUnlistedDependencies({ name, location }, { dependencies, peerDependencies }, { externalDistImports, externalDistTypeImports, distImportPaths }) {
353
+ function getUnlistedDependencies({ name, location }, { dependencies, peerDependencies }, {
354
+ externalDistImports,
355
+ externalDistTypeImports,
356
+ distImportPaths
357
+ }) {
411
358
  let unlistedDependencies = 0;
412
359
  for (const imp of externalDistImports) {
413
360
  if (!dependencies.includes(imp) && imp !== name && !dependencies.includes(`@types/${imp}`) && !peerDependencies.includes(imp) && !peerDependencies.includes(`@types/${imp}`) && !builtinModules.includes(imp) && !builtinModules.includes(`@types/${imp}`)) {
@@ -430,12 +377,19 @@ function getUnlistedDependencies({ name, location }, { dependencies, peerDepende
430
377
  }
431
378
  return unlistedDependencies;
432
379
  }
433
- __name(getUnlistedDependencies, "getUnlistedDependencies");
434
380
 
435
381
  // src/actions/deplint/checkPackage/getUnlistedDevDependencies.ts
436
382
  import { builtinModules as builtinModules2 } from "module";
437
383
  import chalk6 from "chalk";
438
- function getUnlistedDevDependencies({ name, location }, { devDependencies, dependencies, peerDependencies }, { srcImportPaths, externalSrcImports, distImports }) {
384
+ function getUnlistedDevDependencies({ name, location }, {
385
+ devDependencies,
386
+ dependencies,
387
+ peerDependencies
388
+ }, {
389
+ srcImportPaths,
390
+ externalSrcImports,
391
+ distImports
392
+ }) {
439
393
  let unlistedDevDependencies = 0;
440
394
  for (const imp of externalSrcImports) {
441
395
  if (!distImports.includes(imp) && imp !== name && !dependencies.includes(imp) && !dependencies.includes(`@types/${imp}`) && !peerDependencies.includes(imp) && !peerDependencies.includes(`@types/${imp}`) && !devDependencies.includes(imp) && !devDependencies.includes(`@types/${imp}`) && !builtinModules2.includes(imp)) {
@@ -451,11 +405,14 @@ function getUnlistedDevDependencies({ name, location }, { devDependencies, depen
451
405
  }
452
406
  return unlistedDevDependencies;
453
407
  }
454
- __name(getUnlistedDevDependencies, "getUnlistedDevDependencies");
455
408
 
456
409
  // src/actions/deplint/checkPackage/getUnusedDependencies.ts
457
410
  import chalk7 from "chalk";
458
- function getUnusedDependencies({ name, location }, { dependencies }, { externalDistImports, externalDistTypeImports, externalSrcImports }) {
411
+ function getUnusedDependencies({ name, location }, { dependencies }, {
412
+ externalDistImports,
413
+ externalDistTypeImports,
414
+ externalSrcImports
415
+ }) {
459
416
  let unusedDependencies = 0;
460
417
  for (const dep of dependencies) {
461
418
  if (!externalDistImports.includes(dep) && !externalDistImports.includes(dep.replace(/^@types\//, "")) && !externalDistTypeImports.includes(dep) && !externalDistTypeImports.includes(dep.replace(/^@types\//, ""))) {
@@ -474,7 +431,6 @@ function getUnusedDependencies({ name, location }, { dependencies }, { externalD
474
431
  }
475
432
  return unusedDependencies;
476
433
  }
477
- __name(getUnusedDependencies, "getUnusedDependencies");
478
434
 
479
435
  // src/actions/deplint/checkPackage/getUnusedPeerDependencies.ts
480
436
  import chalk8 from "chalk";
@@ -497,10 +453,16 @@ function getUnusedPeerDependencies({ name, location }, { peerDependencies, depen
497
453
  }
498
454
  return unusedDependencies;
499
455
  }
500
- __name(getUnusedPeerDependencies, "getUnusedPeerDependencies");
501
456
 
502
457
  // src/actions/deplint/checkPackage/checkPackage.ts
503
- function checkPackage({ name, location, deps = false, devDeps = false, peerDeps = false, verbose = false }) {
458
+ function checkPackage({
459
+ name,
460
+ location,
461
+ deps = false,
462
+ devDeps = false,
463
+ peerDeps = false,
464
+ verbose = false
465
+ }) {
504
466
  const { srcFiles, distFiles } = findFiles(location);
505
467
  if (verbose) {
506
468
  console.info(`Checking package: ${name} at ${location}`);
@@ -515,34 +477,24 @@ function checkPackage({ name, location, deps = false, devDeps = false, peerDeps
515
477
  const checkDeps = deps || !(deps || devDeps || peerDeps);
516
478
  const checkDevDeps = devDeps || !(deps || devDeps || peerDeps);
517
479
  const checkPeerDeps = peerDeps;
518
- const sourceParams = getExternalImportsFromFiles({
519
- srcFiles,
520
- distFiles
521
- });
480
+ const sourceParams = getExternalImportsFromFiles({ srcFiles, distFiles });
522
481
  const packageParams = getDependenciesFromPackageJson(`${location}/package.json`);
523
- const unlistedDependencies = checkDeps ? getUnlistedDependencies({
524
- name,
525
- location
526
- }, packageParams, sourceParams) : 0;
527
- const unusedDependencies = checkDeps ? getUnusedDependencies({
528
- name,
529
- location
530
- }, packageParams, sourceParams) : 0;
531
- const unlistedDevDependencies = checkDevDeps ? getUnlistedDevDependencies({
532
- name,
533
- location
534
- }, packageParams, sourceParams) : 0;
535
- const unusedPeerDependencies = checkPeerDeps ? getUnusedPeerDependencies({
536
- name,
537
- location
538
- }, packageParams, sourceParams) : 0;
482
+ const unlistedDependencies = checkDeps ? getUnlistedDependencies({ name, location }, packageParams, sourceParams) : 0;
483
+ const unusedDependencies = checkDeps ? getUnusedDependencies({ name, location }, packageParams, sourceParams) : 0;
484
+ const unlistedDevDependencies = checkDevDeps ? getUnlistedDevDependencies({ name, location }, packageParams, sourceParams) : 0;
485
+ const unusedPeerDependencies = checkPeerDeps ? getUnusedPeerDependencies({ name, location }, packageParams, sourceParams) : 0;
539
486
  const totalErrors = unlistedDependencies + unlistedDevDependencies + unusedDependencies + unusedPeerDependencies;
540
487
  return totalErrors;
541
488
  }
542
- __name(checkPackage, "checkPackage");
543
489
 
544
490
  // src/actions/deplint/deplint.ts
545
- var deplint = /* @__PURE__ */ __name(({ pkg, deps, devDeps, peerDeps, verbose }) => {
491
+ var deplint = ({
492
+ pkg,
493
+ deps,
494
+ devDeps,
495
+ peerDeps,
496
+ verbose
497
+ }) => {
546
498
  let totalErrors = 0;
547
499
  if (pkg === void 0) {
548
500
  const workspaces = yarnWorkspaces();
@@ -574,305 +526,252 @@ var deplint = /* @__PURE__ */ __name(({ pkg, deps, devDeps, peerDeps, verbose })
574
526
  console.info(`Deplint: Found no dependency problems. ${chalk9.green("\u2714")}`);
575
527
  }
576
528
  return 0;
577
- }, "deplint");
529
+ };
578
530
 
579
531
  // src/actions/lint.ts
580
532
  import chalk10 from "chalk";
581
- var lintPackage = /* @__PURE__ */ __name(({ pkg, fix: fix2 }) => {
533
+ var lintPackage = ({ pkg, fix: fix2 }) => {
582
534
  console.log(chalk10.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
583
535
  const start = Date.now();
584
536
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
585
- [
586
- "yarn",
587
- [
588
- "workspace",
589
- pkg,
590
- "run",
591
- fix2 ? "package-fix" : "package-lint"
592
- ]
593
- ]
537
+ ["yarn", [
538
+ "workspace",
539
+ pkg,
540
+ "run",
541
+ fix2 ? "package-fix" : "package-lint"
542
+ ]]
594
543
  ]);
595
544
  console.log(chalk10.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk10.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk10.gray("seconds")}`));
596
545
  return result;
597
- }, "lintPackage");
598
- var lint = /* @__PURE__ */ __name(({ pkg, verbose, incremental, fix: fix2 } = {}) => {
546
+ };
547
+ var lint = ({
548
+ pkg,
549
+ verbose,
550
+ incremental,
551
+ fix: fix2
552
+ } = {}) => {
599
553
  return pkg === void 0 ? lintAllPackages({
600
554
  verbose,
601
555
  incremental,
602
556
  fix: fix2
603
- }) : lintPackage({
604
- pkg,
605
- fix: fix2
606
- });
607
- }, "lint");
608
- var lintAllPackages = /* @__PURE__ */ __name(({ fix: fix2 = false } = {}) => {
557
+ }) : lintPackage({ pkg, fix: fix2 });
558
+ };
559
+ var lintAllPackages = ({ fix: fix2 = false } = {}) => {
609
560
  console.log(chalk10.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
610
561
  const start = Date.now();
611
- const fixOptions = fix2 ? [
612
- "--fix"
613
- ] : [];
562
+ const fixOptions = fix2 ? ["--fix"] : [];
614
563
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
615
- [
616
- "yarn",
617
- [
618
- "eslint",
619
- ...fixOptions
620
- ]
621
- ]
564
+ ["yarn", ["eslint", ...fixOptions]]
622
565
  ]);
623
566
  console.log(chalk10.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk10.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk10.gray("seconds")}`));
624
567
  return result;
625
- }, "lintAllPackages");
568
+ };
626
569
 
627
570
  // src/actions/fix.ts
628
- var fix = /* @__PURE__ */ __name((params) => {
629
- return lint({
630
- ...params,
631
- fix: true
632
- });
633
- }, "fix");
571
+ var fix = (params) => {
572
+ return lint({ ...params, fix: true });
573
+ };
634
574
 
635
575
  // src/actions/knip.ts
636
- var knip = /* @__PURE__ */ __name(() => {
637
- return runSteps("Knip", [
638
- [
639
- "yarn",
640
- [
641
- "knip",
642
- "--dependencies",
643
- "--no-exit-code"
644
- ]
645
- ]
646
- ]);
647
- }, "knip");
576
+ var knip = () => {
577
+ return runSteps("Knip", [["yarn", ["knip", "--dependencies", "--no-exit-code"]]]);
578
+ };
648
579
 
649
580
  // src/actions/publint.ts
650
- var publint = /* @__PURE__ */ __name(async ({ verbose, pkg }) => {
651
- return pkg === void 0 ? publintAll({
652
- verbose
653
- }) : await publintPackage({
654
- pkg,
655
- verbose
656
- });
657
- }, "publint");
658
- var publintPackage = /* @__PURE__ */ __name(({ pkg }) => {
659
- return runStepsAsync(`Publint [${pkg}]`, [
660
- [
661
- "yarn",
662
- [
663
- "workspace",
664
- pkg,
665
- "run",
666
- "package-publint"
667
- ]
668
- ]
669
- ]);
670
- }, "publintPackage");
671
- var publintAll = /* @__PURE__ */ __name(({ verbose }) => {
672
- const verboseOptions = verbose ? [
673
- "--verbose"
674
- ] : [
675
- "--no-verbose"
676
- ];
677
- return runSteps("Publint", [
678
- [
679
- "yarn",
680
- [
681
- "workspaces",
682
- "foreach",
683
- "-pA",
684
- ...verboseOptions,
685
- "run",
686
- "package-publint"
687
- ]
688
- ]
689
- ]);
690
- }, "publintAll");
581
+ var publint = async ({ verbose, pkg }) => {
582
+ return pkg === void 0 ? publintAll({ verbose }) : await publintPackage({ pkg, verbose });
583
+ };
584
+ var publintPackage = ({ pkg }) => {
585
+ return runStepsAsync(`Publint [${pkg}]`, [["yarn", ["workspace", pkg, "run", "package-publint"]]]);
586
+ };
587
+ var publintAll = ({ verbose }) => {
588
+ const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
589
+ return runSteps("Publint", [["yarn", ["workspaces", "foreach", "-pA", ...verboseOptions, "run", "package-publint"]]]);
590
+ };
691
591
 
692
592
  // src/actions/relint.ts
693
593
  import chalk11 from "chalk";
694
- var relintPackage = /* @__PURE__ */ __name(({ pkg }) => {
594
+ var relintPackage = ({ pkg }) => {
695
595
  console.log(chalk11.gray(`${"Relint"} [All-Packages]`));
696
596
  const start = Date.now();
697
597
  const result = runSteps("Relint [All-Packages]", [
698
- [
699
- "yarn",
700
- [
701
- "workspace",
702
- pkg,
703
- "run",
704
- "package-relint"
705
- ]
706
- ]
598
+ ["yarn", [
599
+ "workspace",
600
+ pkg,
601
+ "run",
602
+ "package-relint"
603
+ ]]
707
604
  ]);
708
605
  console.log(chalk11.gray(`${"Relinted in"} [${chalk11.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk11.gray("seconds")}`));
709
606
  return result;
710
- }, "relintPackage");
711
- var relint = /* @__PURE__ */ __name(({ pkg, verbose, incremental } = {}) => {
712
- return pkg ? relintPackage({
713
- pkg
714
- }) : relintAllPackages({
715
- verbose,
716
- incremental
717
- });
718
- }, "relint");
719
- var relintAllPackages = /* @__PURE__ */ __name(({ verbose = false, incremental } = {}) => {
607
+ };
608
+ var relint = ({
609
+ pkg,
610
+ verbose,
611
+ incremental
612
+ } = {}) => {
613
+ return pkg ? relintPackage({ pkg }) : relintAllPackages({ verbose, incremental });
614
+ };
615
+ var relintAllPackages = ({ verbose = false, incremental } = {}) => {
720
616
  console.log(chalk11.gray(`${"Relint"} [All-Packages]`));
721
617
  const start = Date.now();
722
- const verboseOptions = verbose ? [
723
- "--verbose"
724
- ] : [
725
- "--no-verbose"
726
- ];
727
- const incrementalOptions = incremental ? [
728
- "--since",
729
- "-Ap"
730
- ] : [
731
- "--parallel",
732
- "-Ap"
733
- ];
618
+ const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
619
+ const incrementalOptions = incremental ? ["--since", "-Ap"] : ["--parallel", "-Ap"];
734
620
  const result = runSteps(`${"Relint"} [All-Packages]`, [
735
- [
736
- "yarn",
737
- [
738
- "workspaces",
739
- "foreach",
740
- ...verboseOptions,
741
- ...incrementalOptions,
742
- "run",
743
- "package-relint"
744
- ]
745
- ]
621
+ ["yarn", [
622
+ "workspaces",
623
+ "foreach",
624
+ ...verboseOptions,
625
+ ...incrementalOptions,
626
+ "run",
627
+ "package-relint"
628
+ ]]
746
629
  ]);
747
630
  console.log(chalk11.gray(`Relinted in [${chalk11.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk11.gray("seconds")}`));
748
631
  return result;
749
- }, "relintAllPackages");
632
+ };
750
633
 
751
634
  // src/actions/sonar.ts
752
- var sonar = /* @__PURE__ */ __name(() => {
753
- return runSteps("Sonar", [
754
- [
755
- "yarn",
756
- [
757
- "eslint",
758
- "-c",
759
- "sonar.eslintrc",
760
- "."
761
- ]
762
- ]
763
- ]);
764
- }, "sonar");
635
+ var sonar = () => {
636
+ return runSteps("Sonar", [["yarn", ["eslint", "-c", "sonar.eslintrc", "."]]]);
637
+ };
765
638
 
766
639
  // src/xy/param.ts
767
- var packagePositionalParam = /* @__PURE__ */ __name((yargs) => {
768
- return yargs.positional("package", {
769
- describe: "Specific package to target",
770
- type: "string"
771
- });
772
- }, "packagePositionalParam");
640
+ var packagePositionalParam = (yargs) => {
641
+ return yargs.positional("package", { describe: "Specific package to target", type: "string" });
642
+ };
773
643
 
774
644
  // src/xy/xyLintCommands.ts
775
- var xyLintCommands = /* @__PURE__ */ __name((args) => {
776
- return args.command("cycle [package]", "Cycle - Check for dependency cycles", (yargs) => {
777
- return packagePositionalParam(yargs);
778
- }, async (argv) => {
779
- const start = Date.now();
780
- if (argv.verbose) console.log("Cycle");
781
- process.exitCode = await cycle({
782
- pkg: argv.package
783
- });
784
- console.log(chalk12.blue(`Finished in ${Date.now() - start}ms`));
785
- }).command("lint [package]", "Lint - Run Eslint", (yargs) => {
786
- return packagePositionalParam(yargs).option("fix", {
787
- alias: "f",
788
- default: false,
789
- description: "Fix fixable issues",
790
- type: "boolean"
791
- }).option("cache", {
792
- alias: "c",
793
- default: false,
794
- description: "Use caching for performance",
795
- type: "boolean"
796
- });
797
- }, (argv) => {
798
- if (argv.verbose) console.log("Lint");
799
- const start = Date.now();
800
- process.exitCode = argv.fix ? fix({
801
- pkg: argv.package,
802
- cache: argv.cache
803
- }) : lint({
804
- pkg: argv.package,
805
- cache: argv.cache
806
- });
807
- console.log(chalk12.blue(`Finished in ${Date.now() - start}ms`));
808
- }).command("deplint [package]", "Deplint - Run Deplint", (yargs) => {
809
- return packagePositionalParam(yargs).option("deps", {
810
- alias: "d",
811
- default: false,
812
- description: "Check dependencies",
813
- type: "boolean"
814
- }).option("devDeps", {
815
- alias: "v",
816
- default: false,
817
- description: "Check devDependencies",
818
- type: "boolean"
819
- }).option("peerDeps", {
820
- alias: "p",
821
- default: false,
822
- description: "Check peerDependencies",
823
- type: "boolean"
824
- });
825
- }, (argv) => {
826
- if (argv.verbose) console.log("Deplint");
827
- const start = Date.now();
828
- process.exitCode = deplint({
829
- pkg: argv.package,
830
- deps: !!argv.deps,
831
- devDeps: !!argv.devDeps,
832
- peerDeps: !!argv.peerDeps,
833
- verbose: !!argv.verbose
834
- });
835
- console.log(chalk12.blue(`Finished in ${Date.now() - start}ms`));
836
- }).command("fix [package]", "Fix - Run Eslint w/fix", (yargs) => {
837
- return packagePositionalParam(yargs);
838
- }, (argv) => {
839
- const start = Date.now();
840
- if (argv.verbose) console.log("Fix");
841
- process.exitCode = fix();
842
- console.log(chalk12.blue(`Finished in ${Date.now() - start}ms`));
843
- }).command("relint [package]", "Relint - Clean & Lint", (yargs) => {
844
- return packagePositionalParam(yargs);
845
- }, (argv) => {
846
- if (argv.verbose) console.log("Relinting");
847
- const start = Date.now();
848
- process.exitCode = relint();
849
- console.log(chalk12.blue(`Finished in ${Date.now() - start}ms`));
850
- }).command("publint [package]", "Publint - Run Publint", (yargs) => {
851
- return packagePositionalParam(yargs);
852
- }, async (argv) => {
853
- if (argv.verbose) console.log("Publint");
854
- const start = Date.now();
855
- process.exitCode = await publint({
856
- pkg: argv.package,
857
- verbose: !!argv.verbose
858
- });
859
- console.log(chalk12.blue(`Finished in ${Date.now() - start}ms`));
860
- }).command("knip", "Knip - Run Knip", (yargs) => {
861
- return packagePositionalParam(yargs);
862
- }, (argv) => {
863
- if (argv.verbose) console.log("Knip");
864
- const start = Date.now();
865
- process.exitCode = knip();
866
- console.log(chalk12.blue(`Knip finished in ${Date.now() - start}ms`));
867
- }).command("sonar", "Sonar - Run Sonar Check", (yargs) => {
868
- return packagePositionalParam(yargs);
869
- }, (argv) => {
870
- const start = Date.now();
871
- if (argv.verbose) console.log("Sonar Check");
872
- process.exitCode = sonar();
873
- console.log(chalk12.blue(`Finished in ${Date.now() - start}ms`));
874
- });
875
- }, "xyLintCommands");
645
+ var xyLintCommands = (args) => {
646
+ return args.command(
647
+ "cycle [package]",
648
+ "Cycle - Check for dependency cycles",
649
+ (yargs) => {
650
+ return packagePositionalParam(yargs);
651
+ },
652
+ async (argv) => {
653
+ const start = Date.now();
654
+ if (argv.verbose) console.log("Cycle");
655
+ process.exitCode = await cycle({ pkg: argv.package });
656
+ console.log(chalk12.blue(`Finished in ${Date.now() - start}ms`));
657
+ }
658
+ ).command(
659
+ "lint [package]",
660
+ "Lint - Run Eslint",
661
+ (yargs) => {
662
+ return packagePositionalParam(yargs).option("fix", {
663
+ alias: "f",
664
+ default: false,
665
+ description: "Fix fixable issues",
666
+ type: "boolean"
667
+ }).option("cache", {
668
+ alias: "c",
669
+ default: false,
670
+ description: "Use caching for performance",
671
+ type: "boolean"
672
+ });
673
+ },
674
+ (argv) => {
675
+ if (argv.verbose) console.log("Lint");
676
+ const start = Date.now();
677
+ process.exitCode = argv.fix ? fix({ pkg: argv.package, cache: argv.cache }) : lint({ pkg: argv.package, cache: argv.cache });
678
+ console.log(chalk12.blue(`Finished in ${Date.now() - start}ms`));
679
+ }
680
+ ).command(
681
+ "deplint [package]",
682
+ "Deplint - Run Deplint",
683
+ (yargs) => {
684
+ return packagePositionalParam(yargs).option("deps", {
685
+ alias: "d",
686
+ default: false,
687
+ description: "Check dependencies",
688
+ type: "boolean"
689
+ }).option("devDeps", {
690
+ alias: "v",
691
+ default: false,
692
+ description: "Check devDependencies",
693
+ type: "boolean"
694
+ }).option("peerDeps", {
695
+ alias: "p",
696
+ default: false,
697
+ description: "Check peerDependencies",
698
+ type: "boolean"
699
+ });
700
+ },
701
+ (argv) => {
702
+ if (argv.verbose) console.log("Deplint");
703
+ const start = Date.now();
704
+ process.exitCode = deplint({
705
+ pkg: argv.package,
706
+ deps: !!argv.deps,
707
+ devDeps: !!argv.devDeps,
708
+ peerDeps: !!argv.peerDeps,
709
+ verbose: !!argv.verbose
710
+ });
711
+ console.log(chalk12.blue(`Finished in ${Date.now() - start}ms`));
712
+ }
713
+ ).command(
714
+ "fix [package]",
715
+ "Fix - Run Eslint w/fix",
716
+ (yargs) => {
717
+ return packagePositionalParam(yargs);
718
+ },
719
+ (argv) => {
720
+ const start = Date.now();
721
+ if (argv.verbose) console.log("Fix");
722
+ process.exitCode = fix();
723
+ console.log(chalk12.blue(`Finished in ${Date.now() - start}ms`));
724
+ }
725
+ ).command(
726
+ "relint [package]",
727
+ "Relint - Clean & Lint",
728
+ (yargs) => {
729
+ return packagePositionalParam(yargs);
730
+ },
731
+ (argv) => {
732
+ if (argv.verbose) console.log("Relinting");
733
+ const start = Date.now();
734
+ process.exitCode = relint();
735
+ console.log(chalk12.blue(`Finished in ${Date.now() - start}ms`));
736
+ }
737
+ ).command(
738
+ "publint [package]",
739
+ "Publint - Run Publint",
740
+ (yargs) => {
741
+ return packagePositionalParam(yargs);
742
+ },
743
+ async (argv) => {
744
+ if (argv.verbose) console.log("Publint");
745
+ const start = Date.now();
746
+ process.exitCode = await publint({ pkg: argv.package, verbose: !!argv.verbose });
747
+ console.log(chalk12.blue(`Finished in ${Date.now() - start}ms`));
748
+ }
749
+ ).command(
750
+ "knip",
751
+ "Knip - Run Knip",
752
+ (yargs) => {
753
+ return packagePositionalParam(yargs);
754
+ },
755
+ (argv) => {
756
+ if (argv.verbose) console.log("Knip");
757
+ const start = Date.now();
758
+ process.exitCode = knip();
759
+ console.log(chalk12.blue(`Knip finished in ${Date.now() - start}ms`));
760
+ }
761
+ ).command(
762
+ "sonar",
763
+ "Sonar - Run Sonar Check",
764
+ (yargs) => {
765
+ return packagePositionalParam(yargs);
766
+ },
767
+ (argv) => {
768
+ const start = Date.now();
769
+ if (argv.verbose) console.log("Sonar Check");
770
+ process.exitCode = sonar();
771
+ console.log(chalk12.blue(`Finished in ${Date.now() - start}ms`));
772
+ }
773
+ );
774
+ };
876
775
  export {
877
776
  xyLintCommands
878
777
  };