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