@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
package/dist/index.mjs CHANGED
@@ -1,12 +1,9 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
1
  // src/actions/build.ts
5
2
  import chalk9 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,7 +12,7 @@ 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/createBuildConfig.ts
21
18
  import { readFileSync } from "fs";
@@ -24,9 +21,7 @@ import { readFileSync } from "fs";
24
21
  var defaultBuildConfig = {
25
22
  compilerOptions: {
26
23
  rootDir: "src",
27
- rootDirs: [
28
- "package.json"
29
- ]
24
+ rootDirs: ["package.json"]
30
25
  },
31
26
  exclude: [
32
27
  "**/build",
@@ -39,24 +34,20 @@ var defaultBuildConfig = {
39
34
  "**/spec/*",
40
35
  "**/stories/*"
41
36
  ],
42
- include: [
43
- "src"
44
- ]
37
+ include: ["src"]
45
38
  };
46
39
 
47
40
  // src/lib/createBuildConfig.ts
48
- var getGeneralTypescriptConfig = /* @__PURE__ */ __name((location) => {
41
+ var getGeneralTypescriptConfig = (location) => {
49
42
  let generalConfig;
50
43
  try {
51
- generalConfig = readFileSync(`${location}/tsconfig.json`, {
52
- encoding: "utf8"
53
- });
44
+ generalConfig = readFileSync(`${location}/tsconfig.json`, { encoding: "utf8" });
54
45
  } catch {
55
46
  return false;
56
47
  }
57
48
  return JSON.parse(generalConfig);
58
- }, "getGeneralTypescriptConfig");
59
- var createBuildConfig = /* @__PURE__ */ __name((location, module, target, outDirSuffix) => {
49
+ };
50
+ var createBuildConfig = (location, module, target, outDirSuffix) => {
60
51
  const generalConfigObject = getGeneralTypescriptConfig(location);
61
52
  if (generalConfigObject === false) {
62
53
  return void 0;
@@ -70,29 +61,20 @@ var createBuildConfig = /* @__PURE__ */ __name((location, module, target, outDir
70
61
  outDir: `./${generalConfigObject.compilerOptions?.outDir ?? "dist"}/${outDirSuffix}`,
71
62
  target
72
63
  },
73
- exclude: [
74
- ...generalConfigObject.exclude ?? [],
75
- ...defaultBuildConfig.exclude
76
- ],
77
- include: [
78
- ...generalConfigObject.include ?? [],
79
- ...defaultBuildConfig.include
80
- ]
64
+ exclude: [...generalConfigObject.exclude ?? [], ...defaultBuildConfig.exclude],
65
+ include: [...generalConfigObject.include ?? [], ...defaultBuildConfig.include]
81
66
  };
82
- }, "createBuildConfig");
67
+ };
83
68
 
84
69
  // src/lib/deleteGlob.ts
85
70
  import fs from "fs";
86
71
  import { glob } from "glob";
87
- var deleteGlob = /* @__PURE__ */ __name((globPath) => {
72
+ var deleteGlob = (globPath) => {
88
73
  const files = glob.sync(globPath);
89
74
  for (const file of files) {
90
- fs.rmSync(file, {
91
- recursive: true,
92
- force: true
93
- });
75
+ fs.rmSync(file, { recursive: true, force: true });
94
76
  }
95
- }, "deleteGlob");
77
+ };
96
78
 
97
79
  // src/lib/dependencies/detectDuplicateDependencies.ts
98
80
  import { execSync } from "child_process";
@@ -101,17 +83,17 @@ import { execSync } from "child_process";
101
83
  import chalk2 from "chalk";
102
84
 
103
85
  // src/lib/withError.ts
104
- var withError = /* @__PURE__ */ __name((ex, closure, predicate = (ex2) => !!ex2.name && !!ex2.message) => {
86
+ var withError = (ex, closure, predicate = (ex2) => !!ex2.name && !!ex2.message) => {
105
87
  return predicate(ex) ? closure(ex) : void 0;
106
- }, "withError");
88
+ };
107
89
 
108
90
  // src/lib/withErrnoException.ts
109
- var withErrnoException = /* @__PURE__ */ __name((ex, closure) => {
91
+ var withErrnoException = (ex, closure) => {
110
92
  return withError(ex, closure, (ex2) => ex2.errno !== void 0);
111
- }, "withErrnoException");
93
+ };
112
94
 
113
95
  // src/lib/processEx.ts
114
- var processEx = /* @__PURE__ */ __name((ex) => {
96
+ var processEx = (ex) => {
115
97
  const error = typeof ex === "string" ? new Error(ex) : ex;
116
98
  const exitCode = withErrnoException(error, (error2) => {
117
99
  if (error2.code === "ENOENT") {
@@ -128,10 +110,10 @@ var processEx = /* @__PURE__ */ __name((ex) => {
128
110
  return -1;
129
111
  })();
130
112
  process.exit(process.exitCode ?? exitCode);
131
- }, "processEx");
113
+ };
132
114
 
133
115
  // src/lib/safeExit.ts
134
- var safeExit = /* @__PURE__ */ __name((func, exitOnFail = true) => {
116
+ var safeExit = (func, exitOnFail = true) => {
135
117
  try {
136
118
  const result = func();
137
119
  if (result && exitOnFail) {
@@ -141,8 +123,8 @@ var safeExit = /* @__PURE__ */ __name((func, exitOnFail = true) => {
141
123
  } catch (ex) {
142
124
  return processEx(ex);
143
125
  }
144
- }, "safeExit");
145
- var safeExitAsync = /* @__PURE__ */ __name(async (func, exitOnFail = true) => {
126
+ };
127
+ var safeExitAsync = async (func, exitOnFail = true) => {
146
128
  try {
147
129
  const result = await func();
148
130
  if (result && exitOnFail) {
@@ -152,22 +134,22 @@ var safeExitAsync = /* @__PURE__ */ __name(async (func, exitOnFail = true) => {
152
134
  } catch (ex) {
153
135
  return processEx(ex);
154
136
  }
155
- }, "safeExitAsync");
137
+ };
156
138
 
157
139
  // src/lib/dependencies/DuplicateDetector.ts
158
140
  import { EOL } from "os";
159
141
  import chalk3 from "chalk";
160
142
 
161
143
  // src/lib/jsonFormatters.ts
162
- var multiLineToJSONArray = /* @__PURE__ */ __name((output) => {
144
+ var multiLineToJSONArray = (output) => {
163
145
  const withCommas = output.replaceAll("\r\n", "").replaceAll("\n", ",");
164
146
  const cleanCollection = withCommas.slice(0, Math.max(0, withCommas.length - 1));
165
147
  const collection = `[${cleanCollection}]`;
166
148
  return JSON.parse(collection);
167
- }, "multiLineToJSONArray");
149
+ };
168
150
 
169
151
  // src/lib/dependencies/DuplicateDetector.ts
170
- var trimVirtualMeta = /* @__PURE__ */ __name((value) => {
152
+ var trimVirtualMeta = (value) => {
171
153
  const virtualParts = value.split("virtual:");
172
154
  if (virtualParts.length > 1) {
173
155
  const hashParts = virtualParts[1].split("#");
@@ -175,8 +157,8 @@ var trimVirtualMeta = /* @__PURE__ */ __name((value) => {
175
157
  } else {
176
158
  return value;
177
159
  }
178
- }, "trimVirtualMeta");
179
- var trimObjectDependencyVirtualMeta = /* @__PURE__ */ __name((obj) => {
160
+ };
161
+ var trimObjectDependencyVirtualMeta = (obj) => {
180
162
  const resultObj = {};
181
163
  for (const [key, value] of Object.entries(obj)) {
182
164
  resultObj[trimVirtualMeta(key)] = {
@@ -185,19 +167,13 @@ var trimObjectDependencyVirtualMeta = /* @__PURE__ */ __name((obj) => {
185
167
  };
186
168
  }
187
169
  return resultObj;
188
- }, "trimObjectDependencyVirtualMeta");
189
- var trimDependencyVirtualMeta = /* @__PURE__ */ __name((dependencies) => {
170
+ };
171
+ var trimDependencyVirtualMeta = (dependencies) => {
190
172
  return dependencies.map((dependency) => {
191
- return {
192
- children: trimObjectDependencyVirtualMeta(dependency.children),
193
- value: trimVirtualMeta(dependency.value)
194
- };
173
+ return { children: trimObjectDependencyVirtualMeta(dependency.children), value: trimVirtualMeta(dependency.value) };
195
174
  });
196
- }, "trimDependencyVirtualMeta");
175
+ };
197
176
  var DuplicateDetector = class {
198
- static {
199
- __name(this, "DuplicateDetector");
200
- }
201
177
  dependency;
202
178
  dependencyEntries;
203
179
  constructor(output, dependency) {
@@ -227,21 +203,19 @@ var DuplicateDetector = class {
227
203
  acc.duplicateVersions.push(acc.currentVersion);
228
204
  }
229
205
  acc.duplicateVersions.push(version);
230
- acc.duplicateVersions = [
231
- ...new Set(acc.duplicateVersions)
232
- ];
206
+ acc.duplicateVersions = [...new Set(acc.duplicateVersions)];
233
207
  }
234
208
  return acc;
235
209
  }
236
- resultsFactory = /* @__PURE__ */ __name((dependency) => ({
210
+ resultsFactory = (dependency) => ({
237
211
  currentVersion: void 0,
238
212
  dependency,
239
213
  duplicateVersions: []
240
- }), "resultsFactory");
214
+ });
241
215
  };
242
216
 
243
217
  // src/lib/dependencies/detectDuplicateDependencies.ts
244
- var detectDuplicateDependencies = /* @__PURE__ */ __name((depsFromPackageJSON, DefaultDependencies2) => {
218
+ var detectDuplicateDependencies = (depsFromPackageJSON, DefaultDependencies2) => {
245
219
  let exitCode = 0;
246
220
  const dependencies = depsFromPackageJSON?.length ? depsFromPackageJSON : DefaultDependencies2;
247
221
  return safeExit(() => {
@@ -272,57 +246,51 @@ var detectDuplicateDependencies = /* @__PURE__ */ __name((depsFromPackageJSON, D
272
246
  return exitCode;
273
247
  }
274
248
  });
275
- }, "detectDuplicateDependencies");
249
+ };
276
250
 
277
251
  // src/lib/file/constants.ts
278
252
  var WINDOWS_NEWLINE_REGEX = /\r\n/g;
279
253
  var CROSS_PLATFORM_NEWLINE = "\n";
280
254
 
281
255
  // src/lib/file/fileLines.ts
282
- import { existsSync, readFileSync as readFileSync2, writeFileSync } from "fs";
256
+ import {
257
+ existsSync,
258
+ readFileSync as readFileSync2,
259
+ writeFileSync
260
+ } from "fs";
283
261
 
284
262
  // src/lib/string/empty.ts
285
- var empty = /* @__PURE__ */ __name((value) => value?.trim().length === 0, "empty");
286
- var notEmpty = /* @__PURE__ */ __name((value) => !empty(value), "notEmpty");
263
+ var empty = (value) => value?.trim().length === 0;
264
+ var notEmpty = (value) => !empty(value);
287
265
 
288
266
  // src/lib/string/union.ts
289
- var union = /* @__PURE__ */ __name((a, b) => /* @__PURE__ */ new Set([
290
- ...new Set(a),
291
- ...new Set(b)
292
- ]), "union");
267
+ var union = (a, b) => /* @__PURE__ */ new Set([...new Set(a), ...new Set(b)]);
293
268
 
294
269
  // src/lib/file/ReadFileSyncOptions.ts
295
- var defaultReadFileSyncOptions = {
296
- encoding: "utf8"
297
- };
270
+ var defaultReadFileSyncOptions = { encoding: "utf8" };
298
271
 
299
272
  // src/lib/file/fileLines.ts
300
- var readLines = /* @__PURE__ */ __name((uri, options = defaultReadFileSyncOptions) => existsSync(uri) ? readFileSync2(uri, options).replace(WINDOWS_NEWLINE_REGEX, CROSS_PLATFORM_NEWLINE).split(CROSS_PLATFORM_NEWLINE) : [], "readLines");
301
- var readNonEmptyLines = /* @__PURE__ */ __name((uri, options = defaultReadFileSyncOptions) => readLines(uri, options).filter(notEmpty), "readNonEmptyLines");
302
- var writeLines = /* @__PURE__ */ __name((uri, lines, options = defaultReadFileSyncOptions) => {
273
+ var readLines = (uri, options = defaultReadFileSyncOptions) => existsSync(uri) ? readFileSync2(uri, options).replace(WINDOWS_NEWLINE_REGEX, CROSS_PLATFORM_NEWLINE).split(CROSS_PLATFORM_NEWLINE) : [];
274
+ var readNonEmptyLines = (uri, options = defaultReadFileSyncOptions) => readLines(uri, options).filter(notEmpty);
275
+ var writeLines = (uri, lines, options = defaultReadFileSyncOptions) => {
303
276
  const existing = existsSync(uri) ? readFileSync2(uri, options) : void 0;
304
277
  const desired = lines.join(CROSS_PLATFORM_NEWLINE);
305
278
  if (existing !== desired) writeFileSync(uri, desired, options);
306
- }, "writeLines");
279
+ };
307
280
 
308
281
  // src/lib/file/tryReadFileSync.ts
309
282
  import { existsSync as existsSync2, readFileSync as readFileSync3 } from "fs";
310
- var tryReadFileSync = /* @__PURE__ */ __name((uri, options = defaultReadFileSyncOptions) => {
283
+ var tryReadFileSync = (uri, options = defaultReadFileSyncOptions) => {
311
284
  return existsSync2(uri) ? readFileSync3(uri, options) : void 0;
312
- }, "tryReadFileSync");
285
+ };
313
286
 
314
287
  // src/lib/generateIgnoreFiles.ts
315
288
  import chalk4 from "chalk";
316
289
 
317
290
  // src/lib/yarn/isYarnVersionOrGreater.ts
318
291
  import { spawnSync } from "child_process";
319
- var isYarnVersionOrGreater = /* @__PURE__ */ __name((major, minor, patch) => {
320
- const result = spawnSync("yarn", [
321
- "-v"
322
- ], {
323
- encoding: "utf8",
324
- shell: true
325
- });
292
+ var isYarnVersionOrGreater = (major, minor, patch) => {
293
+ const result = spawnSync("yarn", ["-v"], { encoding: "utf8", shell: true });
326
294
  const version = result.stdout.toString().replaceAll("\n", "");
327
295
  const versionNumbers = version.split(".").map((ver) => Number.parseInt(ver));
328
296
  const majorDelta = versionNumbers[0] - major;
@@ -331,58 +299,43 @@ var isYarnVersionOrGreater = /* @__PURE__ */ __name((major, minor, patch) => {
331
299
  const majorOk = majorDelta >= 0;
332
300
  const minorOk = majorDelta > 0 || minorDelta >= 0;
333
301
  const patchOk = majorDelta > 0 || minorDelta > 0 || patchDelta >= 0;
334
- return [
335
- majorOk && minorOk && patchOk,
336
- version
337
- ];
338
- }, "isYarnVersionOrGreater");
302
+ return [majorOk && minorOk && patchOk, version];
303
+ };
339
304
 
340
305
  // src/lib/yarn/workspace/yarnWorkspaces.ts
341
306
  import { spawnSync as spawnSync2 } from "child_process";
342
- var yarnWorkspaces = /* @__PURE__ */ __name(() => {
343
- const result = spawnSync2("yarn", [
344
- "workspaces",
345
- "list",
346
- "--json",
347
- "--recursive"
348
- ], {
349
- encoding: "utf8",
350
- shell: true
351
- });
307
+ var yarnWorkspaces = () => {
308
+ const result = spawnSync2("yarn", ["workspaces", "list", "--json", "--recursive"], { encoding: "utf8", shell: true });
352
309
  if (result.error) {
353
310
  throw result.error;
354
311
  }
355
312
  return result.stdout.toString().split("\n").slice(0, -1).map((item) => {
356
313
  return JSON.parse(item);
357
314
  });
358
- }, "yarnWorkspaces");
315
+ };
359
316
 
360
317
  // src/lib/yarn/workspace/yarnWorkspace.ts
361
- var yarnWorkspace = /* @__PURE__ */ __name((pkg) => {
318
+ var yarnWorkspace = (pkg) => {
362
319
  const workspace = yarnWorkspaces().find(({ name }) => name === pkg);
363
320
  if (!workspace) throw new Error(`Workspace ${pkg} not found`);
364
321
  return workspace;
365
- }, "yarnWorkspace");
322
+ };
366
323
 
367
324
  // src/lib/yarn/yarnInitCwd.ts
368
- var INIT_CWD = /* @__PURE__ */ __name(() => {
325
+ var INIT_CWD = () => {
369
326
  if (!process.env.INIT_CWD) console.error("Missing INIT_CWD");
370
327
  return process.env.INIT_CWD;
371
- }, "INIT_CWD");
328
+ };
372
329
 
373
330
  // src/lib/generateIgnoreFiles.ts
374
- var localeCompare = /* @__PURE__ */ __name((a, b) => a.localeCompare(b), "localeCompare");
375
- var mergeEntries = /* @__PURE__ */ __name((a, b) => [
376
- ...union(a, b)
377
- ].sort(localeCompare), "mergeEntries");
378
- var generateIgnoreFiles = /* @__PURE__ */ __name((filename3, pkg) => {
331
+ var localeCompare = (a, b) => a.localeCompare(b);
332
+ var mergeEntries = (a, b) => [...union(a, b)].sort(localeCompare);
333
+ var generateIgnoreFiles = (filename3, pkg) => {
379
334
  console.log(chalk4.green(`Generate ${filename3} Files`));
380
335
  const cwd5 = INIT_CWD() ?? ".";
381
- const workspaces = pkg ? [
382
- yarnWorkspace(pkg)
383
- ] : yarnWorkspaces();
384
- const readEntries = /* @__PURE__ */ __name((location) => readNonEmptyLines(`${location}/${filename3}`), "readEntries");
385
- const writeEntries = /* @__PURE__ */ __name((location, entries) => writeLines(`${location}/${filename3}`, entries), "writeEntries");
336
+ const workspaces = pkg ? [yarnWorkspace(pkg)] : yarnWorkspaces();
337
+ const readEntries = (location) => readNonEmptyLines(`${location}/${filename3}`);
338
+ const writeEntries = (location, entries) => writeLines(`${location}/${filename3}`, entries);
386
339
  const results = workspaces.map(({ location, name }) => {
387
340
  try {
388
341
  writeEntries(location, mergeEntries(readEntries(cwd5), readEntries(location)));
@@ -395,7 +348,7 @@ var generateIgnoreFiles = /* @__PURE__ */ __name((filename3, pkg) => {
395
348
  });
396
349
  const succeeded = results.every((result) => result === 0);
397
350
  return succeeded ? 0 : 1;
398
- }, "generateIgnoreFiles");
351
+ };
399
352
 
400
353
  // src/lib/loadConfig.ts
401
354
  import chalk5 from "chalk";
@@ -403,14 +356,9 @@ import { cosmiconfig } from "cosmiconfig";
403
356
  import { TypeScriptLoader } from "cosmiconfig-typescript-loader";
404
357
  import deepmerge from "deepmerge";
405
358
  var config;
406
- var loadConfig = /* @__PURE__ */ __name(async (params) => {
359
+ var loadConfig = async (params) => {
407
360
  if (config === void 0) {
408
- const cosmicConfigResult = await cosmiconfig("xy", {
409
- cache: true,
410
- loaders: {
411
- ".ts": TypeScriptLoader()
412
- }
413
- }).search();
361
+ const cosmicConfigResult = await cosmiconfig("xy", { cache: true, loaders: { ".ts": TypeScriptLoader() } }).search();
414
362
  config = cosmicConfigResult?.config;
415
363
  const configFilePath = cosmicConfigResult?.filepath;
416
364
  if (configFilePath !== void 0) {
@@ -421,21 +369,21 @@ var loadConfig = /* @__PURE__ */ __name(async (params) => {
421
369
  }
422
370
  }
423
371
  return deepmerge(config, params ?? {});
424
- }, "loadConfig");
372
+ };
425
373
 
426
374
  // src/lib/parsedPackageJSON.ts
427
375
  import { readFileSync as readFileSync4 } from "fs";
428
- var parsedPackageJSON = /* @__PURE__ */ __name((path11) => {
376
+ var parsedPackageJSON = (path11) => {
429
377
  const pathToPackageJSON = path11 ?? process.env.npm_package_json ?? "";
430
378
  const packageJSON = readFileSync4(pathToPackageJSON).toString();
431
379
  return JSON.parse(packageJSON);
432
- }, "parsedPackageJSON");
380
+ };
433
381
 
434
382
  // src/lib/runSteps.ts
435
383
  import { spawnSync as spawnSync3 } from "child_process";
436
384
  import { existsSync as existsSync3 } from "fs";
437
385
  import chalk6 from "chalk";
438
- var runSteps = /* @__PURE__ */ __name((name, steps, exitOnFail = true, messages) => {
386
+ var runSteps = (name, steps, exitOnFail = true, messages) => {
439
387
  return safeExit(() => {
440
388
  const pkgName = process.env.npm_package_name;
441
389
  console.log(chalk6.green(`${name} [${pkgName}]`));
@@ -451,10 +399,7 @@ var runSteps = /* @__PURE__ */ __name((name, steps, exitOnFail = true, messages)
451
399
  const status = spawnSync3(command, Array.isArray(args) ? args : args.split(" "), {
452
400
  ...config2,
453
401
  encoding: "utf8",
454
- env: {
455
- FORCE_COLOR: "3",
456
- ...process.env
457
- },
402
+ env: { FORCE_COLOR: "3", ...process.env },
458
403
  shell: true,
459
404
  stdio: "inherit"
460
405
  }).status ?? 0;
@@ -463,13 +408,13 @@ var runSteps = /* @__PURE__ */ __name((name, steps, exitOnFail = true, messages)
463
408
  }
464
409
  return totalStatus;
465
410
  }, !!exitOnFail);
466
- }, "runSteps");
411
+ };
467
412
 
468
413
  // src/lib/runStepsAsync.ts
469
414
  import { spawn } from "child_process";
470
415
  import { existsSync as existsSync4 } from "fs";
471
416
  import chalk7 from "chalk";
472
- var runStepAsync = /* @__PURE__ */ __name((name, step, exitOnFail = true, message) => {
417
+ var runStepAsync = (name, step, exitOnFail = true, message) => {
473
418
  return new Promise((resolve) => {
474
419
  const [command, args, config2] = step;
475
420
  if (message) {
@@ -481,15 +426,18 @@ var runStepAsync = /* @__PURE__ */ __name((name, step, exitOnFail = true, messag
481
426
  }
482
427
  spawn(command, Array.isArray(args) ? args : args.split(" "), {
483
428
  ...config2,
484
- env: {
485
- FORCE_COLOR: "3",
486
- ...process.env
487
- },
429
+ env: { FORCE_COLOR: "3", ...process.env },
488
430
  shell: true,
489
431
  stdio: "inherit"
490
432
  }).on("close", (code) => {
491
433
  if (code) {
492
- console.error(chalk7.red(`Command Exited With Non-Zero Result [${chalk7.gray(code)}] | ${chalk7.yellow(command)} ${chalk7.white(Array.isArray(args) ? args.join(" ") : args)}`));
434
+ console.error(
435
+ chalk7.red(
436
+ `Command Exited With Non-Zero Result [${chalk7.gray(code)}] | ${chalk7.yellow(command)} ${chalk7.white(
437
+ Array.isArray(args) ? args.join(" ") : args
438
+ )}`
439
+ )
440
+ );
493
441
  checkResult(name, code, "error", exitOnFail);
494
442
  resolve(code);
495
443
  } else {
@@ -497,8 +445,8 @@ var runStepAsync = /* @__PURE__ */ __name((name, step, exitOnFail = true, messag
497
445
  }
498
446
  });
499
447
  });
500
- }, "runStepAsync");
501
- var runStepsAsync = /* @__PURE__ */ __name(async (name, steps, exitOnFail = true, messages) => {
448
+ };
449
+ var runStepsAsync = async (name, steps, exitOnFail = true, messages) => {
502
450
  return await safeExitAsync(async () => {
503
451
  const pkgName = process.env.npm_package_name;
504
452
  console.log(chalk7.green(`${name} [${pkgName}]`));
@@ -508,163 +456,85 @@ var runStepsAsync = /* @__PURE__ */ __name(async (name, steps, exitOnFail = true
508
456
  }
509
457
  return result;
510
458
  });
511
- }, "runStepsAsync");
459
+ };
512
460
 
513
461
  // src/lib/runXy.ts
514
- var runXy = /* @__PURE__ */ __name((command) => {
515
- return runSteps(`XY [${command}]`, [
516
- [
517
- "yarn",
518
- [
519
- "xy",
520
- command,
521
- ...process.argv.filter((value, index) => index > 1 ? value : void 0)
522
- ]
523
- ]
524
- ]);
525
- }, "runXy");
462
+ var runXy = (command) => {
463
+ return runSteps(
464
+ `XY [${command}]`,
465
+ [["yarn", ["xy", command, ...process.argv.filter((value, index) => index > 1 ? value : void 0)]]]
466
+ );
467
+ };
526
468
 
527
469
  // src/lib/runXyWithWarning.ts
528
470
  import chalk8 from "chalk";
529
- var runXyWithWarning = /* @__PURE__ */ __name((command) => {
471
+ var runXyWithWarning = (command) => {
530
472
  const commandString = `yarn ${command}`;
531
473
  const commandXyString = `yarn xy ${command}`;
532
474
  console.warn(chalk8.yellow(`WARNING: [${chalk8.white(commandString)}] is deprecated for XY Labs Scripts.`));
533
475
  console.warn(chalk8.gray(`Did you mean [${chalk8.magenta(commandXyString)}]?`));
534
476
  return 1;
535
- }, "runXyWithWarning");
477
+ };
536
478
 
537
479
  // src/actions/build.ts
538
- var build = /* @__PURE__ */ __name(async ({ incremental, jobs, target, verbose, pkg }) => {
480
+ var build = async ({
481
+ incremental,
482
+ jobs,
483
+ target,
484
+ verbose,
485
+ pkg
486
+ }) => {
539
487
  const start = Date.now();
540
- const pkgOptions = pkg === void 0 ? [] : [
541
- pkg
542
- ];
543
- const incrementalOptions = incremental ? [
544
- "-i"
545
- ] : [];
546
- const verboseOptions = verbose ? [
547
- "-v"
548
- ] : [];
549
- const targetOptions = target === void 0 ? [] : [
550
- "-t",
551
- target
552
- ];
553
- const jobsOptions = jobs === void 0 ? [] : [
554
- "-j",
555
- `${jobs}`
556
- ];
488
+ const pkgOptions = pkg === void 0 ? [] : [pkg];
489
+ const incrementalOptions = incremental ? ["-i"] : [];
490
+ const verboseOptions = verbose ? ["-v"] : [];
491
+ const targetOptions = target === void 0 ? [] : ["-t", target];
492
+ const jobsOptions = jobs === void 0 ? [] : ["-j", `${jobs}`];
557
493
  if (jobs !== void 0) {
558
494
  console.log(chalk9.blue(`Jobs set to [${jobs}]`));
559
495
  }
560
496
  const result = await runStepsAsync(`Build${incremental ? "-Incremental" : ""} [${pkg ?? "All"}]`, [
561
- [
562
- "yarn",
563
- [
564
- "xy",
565
- "compile",
566
- ...pkgOptions,
567
- ...targetOptions,
568
- ...verboseOptions,
569
- ...jobsOptions,
570
- ...incrementalOptions,
571
- "--types",
572
- "tsup"
573
- ]
574
- ],
575
- [
576
- "yarn",
577
- [
578
- "xy",
579
- "publint",
580
- ...pkgOptions,
581
- ...verboseOptions,
582
- ...jobsOptions,
583
- ...incrementalOptions
584
- ]
585
- ],
586
- [
587
- "yarn",
588
- [
589
- "xy",
590
- "deplint",
591
- ...pkgOptions,
592
- ...verboseOptions,
593
- ...jobsOptions,
594
- ...incrementalOptions
595
- ]
596
- ],
597
- [
598
- "yarn",
599
- [
600
- "xy",
601
- "lint",
602
- ...pkgOptions,
603
- ...verboseOptions,
604
- ...incrementalOptions
605
- ]
606
- ]
497
+ ["yarn", ["xy", "compile", ...pkgOptions, ...targetOptions, ...verboseOptions, ...jobsOptions, ...incrementalOptions, "--types", "tsup"]],
498
+ ["yarn", ["xy", "publint", ...pkgOptions, ...verboseOptions, ...jobsOptions, ...incrementalOptions]],
499
+ ["yarn", ["xy", "deplint", ...pkgOptions, ...verboseOptions, ...jobsOptions, ...incrementalOptions]],
500
+ ["yarn", ["xy", "lint", ...pkgOptions, ...verboseOptions, ...incrementalOptions]]
607
501
  ]);
608
502
  console.log(`${chalk9.gray("Built in")} [${chalk9.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk9.gray("seconds")}`);
609
503
  return result;
610
- }, "build");
504
+ };
611
505
 
612
506
  // src/actions/clean.ts
613
- var clean = /* @__PURE__ */ __name(async ({ verbose, pkg }) => {
614
- return pkg ? await cleanPackage({
615
- pkg,
616
- verbose
617
- }) : cleanAll({
618
- verbose
619
- });
620
- }, "clean");
621
- var cleanPackage = /* @__PURE__ */ __name(({ pkg }) => {
622
- return runStepsAsync(`Clean [${pkg}]`, [
623
- [
624
- "yarn",
625
- [
626
- "workspace",
627
- pkg,
628
- "run",
629
- "package-clean"
630
- ]
631
- ]
632
- ]);
633
- }, "cleanPackage");
634
- var cleanAll = /* @__PURE__ */ __name(({ verbose }) => {
635
- const verboseOptions = verbose ? [
636
- "--verbose"
637
- ] : [
638
- "--no-verbose"
639
- ];
640
- return runStepsAsync("Clean", [
641
- [
642
- "yarn",
643
- [
644
- "workspaces foreach",
645
- "-pA",
646
- "--jobs 64",
647
- ...verboseOptions,
648
- "run",
649
- "package-clean"
650
- ]
651
- ]
652
- ]);
653
- }, "cleanAll");
507
+ var clean = async ({ verbose, pkg }) => {
508
+ return pkg ? await cleanPackage({ pkg, verbose }) : cleanAll({ verbose });
509
+ };
510
+ var cleanPackage = ({ pkg }) => {
511
+ return runStepsAsync(`Clean [${pkg}]`, [["yarn", ["workspace", pkg, "run", "package-clean"]]]);
512
+ };
513
+ var cleanAll = ({ verbose }) => {
514
+ const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
515
+ return runStepsAsync("Clean", [["yarn", ["workspaces foreach", "-pA", "--jobs 64", ...verboseOptions, "run", "package-clean"]]]);
516
+ };
654
517
 
655
518
  // src/actions/clean-docs.ts
656
519
  import path from "path";
657
520
  import chalk10 from "chalk";
658
- var cleanDocs = /* @__PURE__ */ __name(() => {
521
+ var cleanDocs = () => {
659
522
  const pkgName = process.env.npm_package_name;
660
523
  console.log(chalk10.green(`Cleaning Docs [${pkgName}]`));
661
524
  for (const { location } of yarnWorkspaces()) deleteGlob(path.join(location, "docs"));
662
525
  return 0;
663
- }, "cleanDocs");
526
+ };
664
527
 
665
528
  // src/actions/compile.ts
666
529
  import chalk11 from "chalk";
667
- var compile = /* @__PURE__ */ __name(({ verbose, target, pkg, incremental, publint: publint2, jobs }) => {
530
+ var compile = ({
531
+ verbose,
532
+ target,
533
+ pkg,
534
+ incremental,
535
+ publint: publint2,
536
+ jobs
537
+ }) => {
668
538
  return pkg ? compilePackage({
669
539
  pkg,
670
540
  publint: publint2,
@@ -677,91 +547,58 @@ var compile = /* @__PURE__ */ __name(({ verbose, target, pkg, incremental, publi
677
547
  verbose,
678
548
  jobs
679
549
  });
680
- }, "compile");
681
- var compilePackage = /* @__PURE__ */ __name(({ target, pkg }) => {
682
- const targetOptions = target ? [
683
- "-t",
684
- target
685
- ] : [];
686
- return runSteps(`Compile [${pkg}]`, [
687
- [
688
- "yarn",
689
- [
690
- "workspace",
691
- pkg,
692
- "run",
693
- "package-compile",
694
- ...targetOptions
695
- ]
696
- ]
697
- ]);
698
- }, "compilePackage");
699
- var compileAll = /* @__PURE__ */ __name(({ jobs, verbose, target, incremental }) => {
550
+ };
551
+ var compilePackage = ({ target, pkg }) => {
552
+ const targetOptions = target ? ["-t", target] : [];
553
+ return runSteps(
554
+ `Compile [${pkg}]`,
555
+ [["yarn", ["workspace", pkg, "run", "package-compile", ...targetOptions]]]
556
+ );
557
+ };
558
+ var compileAll = ({
559
+ jobs,
560
+ verbose,
561
+ target,
562
+ incremental
563
+ }) => {
700
564
  const start = Date.now();
701
- const verboseOptions = verbose ? [
702
- "--verbose"
703
- ] : [
704
- "--no-verbose"
705
- ];
706
- const targetOptions = target ? [
707
- "-t",
708
- target
709
- ] : [];
710
- const incrementalOptions = incremental ? [
711
- "--since",
712
- "-Apt",
713
- "--topological-dev"
714
- ] : [
715
- "--parallel",
716
- "-Apt",
717
- "--topological-dev"
718
- ];
719
- const jobsOptions = jobs ? [
720
- "-j",
721
- `${jobs}`
722
- ] : [];
565
+ const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
566
+ const targetOptions = target ? ["-t", target] : [];
567
+ const incrementalOptions = incremental ? ["--since", "-Apt", "--topological-dev"] : ["--parallel", "-Apt", "--topological-dev"];
568
+ const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
723
569
  if (jobs) {
724
570
  console.log(chalk11.blue(`Jobs set to [${jobs}]`));
725
571
  }
726
572
  const result = runSteps(`Compile${incremental ? "-Incremental" : ""} [All]`, [
727
- [
728
- "yarn",
729
- [
730
- "workspaces",
731
- "foreach",
732
- ...incrementalOptions,
733
- ...jobsOptions,
734
- ...verboseOptions,
735
- "run",
736
- "package-compile",
737
- ...targetOptions
738
- ]
739
- ]
573
+ ["yarn", [
574
+ "workspaces",
575
+ "foreach",
576
+ ...incrementalOptions,
577
+ ...jobsOptions,
578
+ ...verboseOptions,
579
+ "run",
580
+ "package-compile",
581
+ ...targetOptions
582
+ ]]
740
583
  ]);
741
584
  console.log(`${chalk11.gray("Compiled in")} [${chalk11.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk11.gray("seconds")}`);
742
585
  return result;
743
- }, "compileAll");
586
+ };
744
587
 
745
588
  // src/actions/copy-assets.ts
746
589
  import path2 from "path/posix";
747
590
  import chalk12 from "chalk";
748
591
  import cpy from "cpy";
749
- var copyPackageTargetAssets = /* @__PURE__ */ __name(async (target, name, location) => {
592
+ var copyPackageTargetAssets = async (target, name, location) => {
750
593
  try {
751
- const values = await cpy([
752
- "**/*.jpg",
753
- "**/*.png",
754
- "**/*.gif",
755
- "**/*.svg",
756
- "**/*.webp",
757
- "**/*.sass",
758
- "**/*.scss",
759
- "**/*.gif",
760
- "**/*.css"
761
- ], `../dist/${target}`, {
762
- cwd: path2.join(process.cwd(), location, "src"),
763
- flat: false
764
- });
594
+ const values = await cpy(
595
+ ["**/*.jpg", "**/*.png", "**/*.gif", "**/*.svg", "**/*.webp", "**/*.sass", "**/*.scss", "**/*.gif", "**/*.css"],
596
+ `../dist/${target}`,
597
+ {
598
+ cwd: path2.join(process.cwd(), location, "src"),
599
+ flat: false
600
+ }
601
+ );
765
602
  for (const value of values) {
766
603
  console.log(`${value.split("/").pop()} => ./dist/${target}`);
767
604
  }
@@ -770,8 +607,8 @@ var copyPackageTargetAssets = /* @__PURE__ */ __name(async (target, name, locati
770
607
  console.log(`Copy Failed: ${name}: ${reason}`);
771
608
  return 1;
772
609
  }
773
- }, "copyPackageTargetAssets");
774
- var copyTargetAssets = /* @__PURE__ */ __name(async (target, pkg) => {
610
+ };
611
+ var copyTargetAssets = async (target, pkg) => {
775
612
  const workspaces = yarnWorkspaces();
776
613
  console.log(chalk12.green(`Copying Assets [${target.toUpperCase()}]`));
777
614
  const workspaceList = workspaces.filter(({ name }) => {
@@ -780,15 +617,17 @@ var copyTargetAssets = /* @__PURE__ */ __name(async (target, pkg) => {
780
617
  if (workspaceList.length === 0) {
781
618
  console.error(`Package not found [${pkg}]`);
782
619
  } else {
783
- const results = await Promise.all(workspaceList.map(async (workspace) => {
784
- const { location, name } = workspace;
785
- return await copyPackageTargetAssets(target, name, location);
786
- }));
620
+ const results = await Promise.all(
621
+ workspaceList.map(async (workspace) => {
622
+ const { location, name } = workspace;
623
+ return await copyPackageTargetAssets(target, name, location);
624
+ })
625
+ );
787
626
  return results.reduce((prev, result) => prev || result, 0);
788
627
  }
789
628
  return 0;
790
- }, "copyTargetAssets");
791
- var copyAssets = /* @__PURE__ */ __name(async ({ target, pkg }) => {
629
+ };
630
+ var copyAssets = async ({ target, pkg }) => {
792
631
  switch (target) {
793
632
  case "esm": {
794
633
  return await copyTargetAssets("esm", pkg);
@@ -800,38 +639,21 @@ var copyAssets = /* @__PURE__ */ __name(async ({ target, pkg }) => {
800
639
  return await copyTargetAssets("esm", pkg) || await copyTargetAssets("cjs", pkg);
801
640
  }
802
641
  }
803
- }, "copyAssets");
642
+ };
804
643
 
805
644
  // src/actions/cycle.ts
806
645
  import { cruise } from "dependency-cruiser";
807
- var cycle = /* @__PURE__ */ __name(async ({ verbose, pkg } = {}) => {
808
- return pkg ? cyclePackage({
809
- pkg,
810
- verbose
811
- }) : await cycleAll({
812
- verbose
813
- });
814
- }, "cycle");
815
- var cyclePackage = /* @__PURE__ */ __name(({ pkg, verbose }) => {
816
- const verboseOptions = verbose ? [
817
- "--verbose"
818
- ] : [
819
- "--no-verbose"
820
- ];
821
- return runSteps(`Cycle [${pkg}]`, [
822
- [
823
- "yarn",
824
- [
825
- "workspace",
826
- pkg,
827
- "run",
828
- "package-cycle",
829
- ...verboseOptions
830
- ]
831
- ]
832
- ]);
833
- }, "cyclePackage");
834
- var cycleAll = /* @__PURE__ */ __name(async ({ verbose = false }) => {
646
+ var cycle = async ({ verbose, pkg } = {}) => {
647
+ return pkg ? cyclePackage({ pkg, verbose }) : await cycleAll({ verbose });
648
+ };
649
+ var cyclePackage = ({ pkg, verbose }) => {
650
+ const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
651
+ return runSteps(
652
+ `Cycle [${pkg}]`,
653
+ [["yarn", ["workspace", pkg, "run", "package-cycle", ...verboseOptions]]]
654
+ );
655
+ };
656
+ var cycleAll = async ({ verbose = false }) => {
835
657
  const pkgName = process.env.npm_package_name;
836
658
  const cruiseOptions = {
837
659
  ruleSet: {
@@ -841,26 +663,20 @@ var cycleAll = /* @__PURE__ */ __name(async ({ verbose = false }) => {
841
663
  severity: "error",
842
664
  comment: "This dependency creates a circular reference",
843
665
  from: {},
844
- to: {
845
- circular: true
846
- }
666
+ to: { circular: true }
847
667
  }
848
668
  ]
849
669
  },
850
670
  exclude: "node_modules|packages/.*/packages",
851
671
  validate: true,
852
- doNotFollow: {
853
- path: "node_modules|packages/.*/packages"
854
- },
672
+ doNotFollow: { path: "node_modules|packages/.*/packages" },
855
673
  tsPreCompilationDeps: false,
856
674
  combinedDependencies: true,
857
675
  outputType: verbose ? "text" : "err"
858
676
  };
859
677
  const target = "**/src";
860
678
  console.log(`Checking for circular dependencies in ${target}...`);
861
- const result = await cruise([
862
- target
863
- ], cruiseOptions);
679
+ const result = await cruise([target], cruiseOptions);
864
680
  if (result.output) {
865
681
  console.log(result.output);
866
682
  }
@@ -870,21 +686,12 @@ var cycleAll = /* @__PURE__ */ __name(async ({ verbose = false }) => {
870
686
  console.error(`${pkgName} \u274C Dependency violations found`);
871
687
  }
872
688
  return result.exitCode;
873
- }, "cycleAll");
689
+ };
874
690
 
875
691
  // src/actions/dead.ts
876
- var dead = /* @__PURE__ */ __name(() => {
877
- return runSteps("Dead", [
878
- [
879
- "yarn",
880
- [
881
- "ts-prune",
882
- "-p",
883
- "tsconfig.json"
884
- ]
885
- ]
886
- ]);
887
- }, "dead");
692
+ var dead = () => {
693
+ return runSteps("Dead", [["yarn", ["ts-prune", "-p", "tsconfig.json"]]]);
694
+ };
888
695
 
889
696
  // src/actions/deplint/deplint.ts
890
697
  import chalk17 from "chalk";
@@ -892,30 +699,17 @@ import chalk17 from "chalk";
892
699
  // src/actions/deplint/findFilesByGlob.ts
893
700
  import { globSync } from "glob";
894
701
  function findFilesByGlob(cwd5, pattern) {
895
- return globSync(pattern, {
896
- cwd: cwd5,
897
- absolute: true
898
- });
702
+ return globSync(pattern, { cwd: cwd5, absolute: true });
899
703
  }
900
- __name(findFilesByGlob, "findFilesByGlob");
901
704
 
902
705
  // src/actions/deplint/findFiles.ts
903
706
  function findFiles(path11) {
904
- const allSourceInclude = [
905
- "./src/**/*.{ts,tsx}"
906
- ];
907
- const allDistInclude = [
908
- "./dist/**/*.d.ts",
909
- "./dist/**/*.{mjs,js,cjs}"
910
- ];
707
+ const allSourceInclude = ["./src/**/*.{ts,tsx}"];
708
+ const allDistInclude = ["./dist/**/*.d.ts", "./dist/**/*.{mjs,js,cjs}"];
911
709
  const srcFiles = allSourceInclude.flatMap((pattern) => findFilesByGlob(path11, pattern));
912
710
  const distFiles = allDistInclude.flatMap((pattern) => findFilesByGlob(path11, pattern));
913
- return {
914
- srcFiles,
915
- distFiles
916
- };
711
+ return { srcFiles, distFiles };
917
712
  }
918
- __name(findFiles, "findFiles");
919
713
 
920
714
  // src/actions/deplint/getDependenciesFromPackageJson.ts
921
715
  import fs2 from "fs";
@@ -933,7 +727,6 @@ function getDependenciesFromPackageJson(packageJsonPath) {
933
727
  peerDependencies
934
728
  };
935
729
  }
936
- __name(getDependenciesFromPackageJson, "getDependenciesFromPackageJson");
937
730
 
938
731
  // src/actions/deplint/getImportsFromFile.ts
939
732
  import fs3 from "fs";
@@ -949,13 +742,18 @@ function getBasePackageName(importName) {
949
742
  }
950
743
  return importNameScrubbed.split("/")[0];
951
744
  }
952
- __name(getBasePackageName, "getBasePackageName");
953
745
 
954
746
  // src/actions/deplint/getImportsFromFile.ts
955
747
  function getImportsFromFile(filePath, importPaths, typeImportPaths) {
956
748
  const sourceCode = fs3.readFileSync(filePath, "utf8");
957
749
  const isMjsFile = filePath.endsWith(".mjs");
958
- const sourceFile = ts.createSourceFile(path4.basename(filePath), sourceCode, ts.ScriptTarget.Latest, true, isMjsFile ? ts.ScriptKind.JS : void 0);
750
+ const sourceFile = ts.createSourceFile(
751
+ path4.basename(filePath),
752
+ sourceCode,
753
+ ts.ScriptTarget.Latest,
754
+ true,
755
+ isMjsFile ? ts.ScriptKind.JS : void 0
756
+ );
959
757
  const imports = [];
960
758
  const typeImports = [];
961
759
  const isDeclarationFile = filePath.endsWith(".d.ts");
@@ -980,13 +778,8 @@ function getImportsFromFile(filePath, importPaths, typeImportPaths) {
980
778
  }
981
779
  ts.forEachChild(node, visit);
982
780
  }
983
- __name(visit, "visit");
984
781
  visit(sourceFile);
985
- const importsStartsWithExcludes = [
986
- ".",
987
- "#",
988
- "node:"
989
- ];
782
+ const importsStartsWithExcludes = [".", "#", "node:"];
990
783
  const cleanedImports = imports.filter((imp) => !importsStartsWithExcludes.some((exc) => imp.startsWith(exc))).map(getBasePackageName);
991
784
  const cleanedTypeImports = typeImports.filter((imp) => !importsStartsWithExcludes.some((exc) => imp.startsWith(exc))).map(getBasePackageName);
992
785
  for (const imp of cleanedImports) {
@@ -997,22 +790,14 @@ function getImportsFromFile(filePath, importPaths, typeImportPaths) {
997
790
  typeImportPaths[imp] = typeImportPaths[imp] ?? [];
998
791
  typeImportPaths[imp].push(filePath);
999
792
  }
1000
- return [
1001
- cleanedImports,
1002
- cleanedTypeImports
1003
- ];
793
+ return [cleanedImports, cleanedTypeImports];
1004
794
  }
1005
- __name(getImportsFromFile, "getImportsFromFile");
1006
795
 
1007
796
  // src/actions/deplint/getExternalImportsFromFiles.ts
1008
- var internalImportPrefixes = [
1009
- ".",
1010
- "#",
1011
- "node:"
1012
- ];
1013
- var removeInternalImports = /* @__PURE__ */ __name((imports) => {
797
+ var internalImportPrefixes = [".", "#", "node:"];
798
+ var removeInternalImports = (imports) => {
1014
799
  return imports.filter((imp) => !internalImportPrefixes.some((prefix) => imp.startsWith(prefix)));
1015
- }, "removeInternalImports");
800
+ };
1016
801
  function getExternalImportsFromFiles({ srcFiles, distFiles }) {
1017
802
  const srcImportPaths = {};
1018
803
  const distImportPaths = {};
@@ -1038,12 +823,15 @@ function getExternalImportsFromFiles({ srcFiles, distFiles }) {
1038
823
  externalDistTypeImports
1039
824
  };
1040
825
  }
1041
- __name(getExternalImportsFromFiles, "getExternalImportsFromFiles");
1042
826
 
1043
827
  // src/actions/deplint/checkPackage/getUnlistedDependencies.ts
1044
828
  import { builtinModules } from "module";
1045
829
  import chalk13 from "chalk";
1046
- function getUnlistedDependencies({ name, location }, { dependencies, peerDependencies }, { externalDistImports, externalDistTypeImports, distImportPaths }) {
830
+ function getUnlistedDependencies({ name, location }, { dependencies, peerDependencies }, {
831
+ externalDistImports,
832
+ externalDistTypeImports,
833
+ distImportPaths
834
+ }) {
1047
835
  let unlistedDependencies = 0;
1048
836
  for (const imp of externalDistImports) {
1049
837
  if (!dependencies.includes(imp) && imp !== name && !dependencies.includes(`@types/${imp}`) && !peerDependencies.includes(imp) && !peerDependencies.includes(`@types/${imp}`) && !builtinModules.includes(imp) && !builtinModules.includes(`@types/${imp}`)) {
@@ -1066,12 +854,19 @@ function getUnlistedDependencies({ name, location }, { dependencies, peerDepende
1066
854
  }
1067
855
  return unlistedDependencies;
1068
856
  }
1069
- __name(getUnlistedDependencies, "getUnlistedDependencies");
1070
857
 
1071
858
  // src/actions/deplint/checkPackage/getUnlistedDevDependencies.ts
1072
859
  import { builtinModules as builtinModules2 } from "module";
1073
860
  import chalk14 from "chalk";
1074
- function getUnlistedDevDependencies({ name, location }, { devDependencies, dependencies, peerDependencies }, { srcImportPaths, externalSrcImports, distImports }) {
861
+ function getUnlistedDevDependencies({ name, location }, {
862
+ devDependencies,
863
+ dependencies,
864
+ peerDependencies
865
+ }, {
866
+ srcImportPaths,
867
+ externalSrcImports,
868
+ distImports
869
+ }) {
1075
870
  let unlistedDevDependencies = 0;
1076
871
  for (const imp of externalSrcImports) {
1077
872
  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)) {
@@ -1087,11 +882,14 @@ function getUnlistedDevDependencies({ name, location }, { devDependencies, depen
1087
882
  }
1088
883
  return unlistedDevDependencies;
1089
884
  }
1090
- __name(getUnlistedDevDependencies, "getUnlistedDevDependencies");
1091
885
 
1092
886
  // src/actions/deplint/checkPackage/getUnusedDependencies.ts
1093
887
  import chalk15 from "chalk";
1094
- function getUnusedDependencies({ name, location }, { dependencies }, { externalDistImports, externalDistTypeImports, externalSrcImports }) {
888
+ function getUnusedDependencies({ name, location }, { dependencies }, {
889
+ externalDistImports,
890
+ externalDistTypeImports,
891
+ externalSrcImports
892
+ }) {
1095
893
  let unusedDependencies = 0;
1096
894
  for (const dep of dependencies) {
1097
895
  if (!externalDistImports.includes(dep) && !externalDistImports.includes(dep.replace(/^@types\//, "")) && !externalDistTypeImports.includes(dep) && !externalDistTypeImports.includes(dep.replace(/^@types\//, ""))) {
@@ -1110,7 +908,6 @@ function getUnusedDependencies({ name, location }, { dependencies }, { externalD
1110
908
  }
1111
909
  return unusedDependencies;
1112
910
  }
1113
- __name(getUnusedDependencies, "getUnusedDependencies");
1114
911
 
1115
912
  // src/actions/deplint/checkPackage/getUnusedPeerDependencies.ts
1116
913
  import chalk16 from "chalk";
@@ -1133,10 +930,16 @@ function getUnusedPeerDependencies({ name, location }, { peerDependencies, depen
1133
930
  }
1134
931
  return unusedDependencies;
1135
932
  }
1136
- __name(getUnusedPeerDependencies, "getUnusedPeerDependencies");
1137
933
 
1138
934
  // src/actions/deplint/checkPackage/checkPackage.ts
1139
- function checkPackage({ name, location, deps = false, devDeps = false, peerDeps = false, verbose = false }) {
935
+ function checkPackage({
936
+ name,
937
+ location,
938
+ deps = false,
939
+ devDeps = false,
940
+ peerDeps = false,
941
+ verbose = false
942
+ }) {
1140
943
  const { srcFiles, distFiles } = findFiles(location);
1141
944
  if (verbose) {
1142
945
  console.info(`Checking package: ${name} at ${location}`);
@@ -1151,34 +954,24 @@ function checkPackage({ name, location, deps = false, devDeps = false, peerDeps
1151
954
  const checkDeps = deps || !(deps || devDeps || peerDeps);
1152
955
  const checkDevDeps = devDeps || !(deps || devDeps || peerDeps);
1153
956
  const checkPeerDeps = peerDeps;
1154
- const sourceParams = getExternalImportsFromFiles({
1155
- srcFiles,
1156
- distFiles
1157
- });
957
+ const sourceParams = getExternalImportsFromFiles({ srcFiles, distFiles });
1158
958
  const packageParams = getDependenciesFromPackageJson(`${location}/package.json`);
1159
- const unlistedDependencies = checkDeps ? getUnlistedDependencies({
1160
- name,
1161
- location
1162
- }, packageParams, sourceParams) : 0;
1163
- const unusedDependencies = checkDeps ? getUnusedDependencies({
1164
- name,
1165
- location
1166
- }, packageParams, sourceParams) : 0;
1167
- const unlistedDevDependencies = checkDevDeps ? getUnlistedDevDependencies({
1168
- name,
1169
- location
1170
- }, packageParams, sourceParams) : 0;
1171
- const unusedPeerDependencies = checkPeerDeps ? getUnusedPeerDependencies({
1172
- name,
1173
- location
1174
- }, packageParams, sourceParams) : 0;
959
+ const unlistedDependencies = checkDeps ? getUnlistedDependencies({ name, location }, packageParams, sourceParams) : 0;
960
+ const unusedDependencies = checkDeps ? getUnusedDependencies({ name, location }, packageParams, sourceParams) : 0;
961
+ const unlistedDevDependencies = checkDevDeps ? getUnlistedDevDependencies({ name, location }, packageParams, sourceParams) : 0;
962
+ const unusedPeerDependencies = checkPeerDeps ? getUnusedPeerDependencies({ name, location }, packageParams, sourceParams) : 0;
1175
963
  const totalErrors = unlistedDependencies + unlistedDevDependencies + unusedDependencies + unusedPeerDependencies;
1176
964
  return totalErrors;
1177
965
  }
1178
- __name(checkPackage, "checkPackage");
1179
966
 
1180
967
  // src/actions/deplint/deplint.ts
1181
- var deplint = /* @__PURE__ */ __name(({ pkg, deps, devDeps, peerDeps, verbose }) => {
968
+ var deplint = ({
969
+ pkg,
970
+ deps,
971
+ devDeps,
972
+ peerDeps,
973
+ verbose
974
+ }) => {
1182
975
  let totalErrors = 0;
1183
976
  if (pkg === void 0) {
1184
977
  const workspaces = yarnWorkspaces();
@@ -1210,297 +1003,183 @@ var deplint = /* @__PURE__ */ __name(({ pkg, deps, devDeps, peerDeps, verbose })
1210
1003
  console.info(`Deplint: Found no dependency problems. ${chalk17.green("\u2714")}`);
1211
1004
  }
1212
1005
  return 0;
1213
- }, "deplint");
1006
+ };
1214
1007
 
1215
1008
  // src/actions/deploy.ts
1216
1009
  import { readFileSync as readFileSync5 } from "fs";
1217
- var privatePackageExcludeList = /* @__PURE__ */ __name(() => {
1010
+ var privatePackageExcludeList = () => {
1218
1011
  const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
1219
1012
  workspace,
1220
- JSON.parse(readFileSync5(`${workspace.location}/package.json`, {
1221
- encoding: "utf8"
1222
- }))
1013
+ JSON.parse(readFileSync5(`${workspace.location}/package.json`, { encoding: "utf8" }))
1223
1014
  ]);
1224
1015
  const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
1225
1016
  const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
1226
1017
  return excludeList;
1227
- }, "privatePackageExcludeList");
1228
- var deploy = /* @__PURE__ */ __name(() => {
1018
+ };
1019
+ var deploy = () => {
1229
1020
  const excludeList = privatePackageExcludeList();
1230
1021
  if (excludeList.length > 0) {
1231
1022
  console.log("Excluding private packages from deployment:", excludeList);
1232
1023
  }
1233
1024
  return runSteps("Deploy [Patch]", [
1234
- [
1235
- "yarn",
1236
- "workspaces foreach --all version patch --deferred"
1237
- ],
1238
- [
1239
- "yarn",
1240
- "xy clean"
1241
- ],
1242
- [
1243
- "yarn",
1244
- "xy build"
1245
- ],
1246
- [
1247
- "yarn",
1248
- "version apply --all"
1249
- ],
1250
- [
1251
- "yarn",
1252
- `workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish`
1253
- ]
1025
+ ["yarn", "workspaces foreach --all version patch --deferred"],
1026
+ ["yarn", "xy clean"],
1027
+ ["yarn", "xy build"],
1028
+ ["yarn", "version apply --all"],
1029
+ ["yarn", `workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish`]
1254
1030
  ]);
1255
- }, "deploy");
1031
+ };
1256
1032
 
1257
1033
  // src/actions/deploy-major.ts
1258
1034
  import { readFileSync as readFileSync6 } from "fs";
1259
- var privatePackageExcludeList2 = /* @__PURE__ */ __name(() => {
1035
+ var privatePackageExcludeList2 = () => {
1260
1036
  const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
1261
1037
  workspace,
1262
- JSON.parse(readFileSync6(`${workspace.location}/package.json`, {
1263
- encoding: "utf8"
1264
- }))
1038
+ JSON.parse(readFileSync6(`${workspace.location}/package.json`, { encoding: "utf8" }))
1265
1039
  ]);
1266
1040
  const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
1267
1041
  const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
1268
1042
  return excludeList;
1269
- }, "privatePackageExcludeList");
1270
- var deployMajor = /* @__PURE__ */ __name(() => {
1043
+ };
1044
+ var deployMajor = () => {
1271
1045
  const excludeList = privatePackageExcludeList2();
1272
1046
  if (excludeList.length > 0) {
1273
1047
  console.log("Excluding private packages from deployment:", excludeList);
1274
1048
  }
1275
1049
  return runSteps("Deploy [Major]", [
1276
- [
1277
- "yarn",
1278
- "workspaces foreach --all version major --deferred"
1279
- ],
1280
- [
1281
- "yarn",
1282
- "xy clean"
1283
- ],
1284
- [
1285
- "yarn",
1286
- "xy build"
1287
- ],
1288
- [
1289
- "yarn",
1290
- "version apply --all"
1291
- ],
1292
- [
1293
- "yarn",
1294
- `workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish`
1295
- ]
1050
+ ["yarn", "workspaces foreach --all version major --deferred"],
1051
+ ["yarn", "xy clean"],
1052
+ ["yarn", "xy build"],
1053
+ ["yarn", "version apply --all"],
1054
+ ["yarn", `workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish`]
1296
1055
  ]);
1297
- }, "deployMajor");
1056
+ };
1298
1057
 
1299
1058
  // src/actions/deploy-minor.ts
1300
1059
  import { readFileSync as readFileSync7 } from "fs";
1301
- var privatePackageExcludeList3 = /* @__PURE__ */ __name(() => {
1060
+ var privatePackageExcludeList3 = () => {
1302
1061
  const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
1303
1062
  workspace,
1304
- JSON.parse(readFileSync7(`${workspace.location}/package.json`, {
1305
- encoding: "utf8"
1306
- }))
1063
+ JSON.parse(readFileSync7(`${workspace.location}/package.json`, { encoding: "utf8" }))
1307
1064
  ]);
1308
1065
  const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
1309
1066
  const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
1310
1067
  return excludeList;
1311
- }, "privatePackageExcludeList");
1312
- var deployMinor = /* @__PURE__ */ __name(() => {
1068
+ };
1069
+ var deployMinor = () => {
1313
1070
  const excludeList = privatePackageExcludeList3();
1314
1071
  if (excludeList.length > 0) {
1315
1072
  console.log("Excluding private packages from deployment:", excludeList);
1316
1073
  }
1317
1074
  return runSteps("Deploy [Minor]", [
1318
- [
1319
- "yarn",
1320
- "workspaces foreach --all version minor --deferred"
1321
- ],
1322
- [
1323
- "yarn",
1324
- "xy clean"
1325
- ],
1326
- [
1327
- "yarn",
1328
- "xy build"
1329
- ],
1330
- [
1331
- "yarn",
1332
- "version apply --all"
1333
- ],
1334
- [
1335
- "yarn",
1336
- `workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish`
1337
- ]
1075
+ ["yarn", "workspaces foreach --all version minor --deferred"],
1076
+ ["yarn", "xy clean"],
1077
+ ["yarn", "xy build"],
1078
+ ["yarn", "version apply --all"],
1079
+ ["yarn", `workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish`]
1338
1080
  ]);
1339
- }, "deployMinor");
1081
+ };
1340
1082
 
1341
1083
  // src/actions/deploy-next.ts
1342
1084
  import { readFileSync as readFileSync8 } from "fs";
1343
- var privatePackageExcludeList4 = /* @__PURE__ */ __name(() => {
1085
+ var privatePackageExcludeList4 = () => {
1344
1086
  const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
1345
1087
  workspace,
1346
- JSON.parse(readFileSync8(`${workspace.location}/package.json`, {
1347
- encoding: "utf8"
1348
- }))
1088
+ JSON.parse(readFileSync8(`${workspace.location}/package.json`, { encoding: "utf8" }))
1349
1089
  ]);
1350
1090
  const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
1351
1091
  const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
1352
1092
  return excludeList;
1353
- }, "privatePackageExcludeList");
1354
- var deployNext = /* @__PURE__ */ __name(() => {
1093
+ };
1094
+ var deployNext = () => {
1355
1095
  const excludeList = privatePackageExcludeList4();
1356
1096
  if (excludeList.length > 0) {
1357
1097
  console.log("Excluding private packages from deployment:", excludeList);
1358
1098
  }
1359
1099
  return runSteps("Deploy [Next]", [
1360
- [
1361
- "yarn",
1362
- "workspaces foreach --all version minor --deferred"
1363
- ],
1364
- [
1365
- "yarn",
1366
- "xy clean"
1367
- ],
1368
- [
1369
- "yarn",
1370
- "xy build"
1371
- ],
1372
- [
1373
- "yarn",
1374
- "version apply --all --prerelease"
1375
- ],
1376
- [
1377
- "yarn",
1378
- `workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish --tag next`
1379
- ]
1100
+ ["yarn", "workspaces foreach --all version minor --deferred"],
1101
+ ["yarn", "xy clean"],
1102
+ ["yarn", "xy build"],
1103
+ ["yarn", "version apply --all --prerelease"],
1104
+ ["yarn", `workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish --tag next`]
1380
1105
  ]);
1381
- }, "deployNext");
1106
+ };
1382
1107
 
1383
1108
  // src/actions/dupdeps.ts
1384
1109
  import chalk18 from "chalk";
1385
- var dupdeps = /* @__PURE__ */ __name(() => {
1110
+ var dupdeps = () => {
1386
1111
  console.log(chalk18.green("Checking all Dependencies for Duplicates"));
1387
1112
  const allDependencies = parsedPackageJSON()?.dependencies;
1388
1113
  const dependencies = Object.entries(allDependencies).map(([k]) => k);
1389
1114
  return detectDuplicateDependencies(dependencies);
1390
- }, "dupdeps");
1115
+ };
1391
1116
 
1392
1117
  // src/actions/lint.ts
1393
1118
  import chalk19 from "chalk";
1394
- var lintPackage = /* @__PURE__ */ __name(({ pkg, fix: fix2 }) => {
1119
+ var lintPackage = ({ pkg, fix: fix2 }) => {
1395
1120
  console.log(chalk19.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
1396
1121
  const start = Date.now();
1397
1122
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
1398
- [
1399
- "yarn",
1400
- [
1401
- "workspace",
1402
- pkg,
1403
- "run",
1404
- fix2 ? "package-fix" : "package-lint"
1405
- ]
1406
- ]
1123
+ ["yarn", [
1124
+ "workspace",
1125
+ pkg,
1126
+ "run",
1127
+ fix2 ? "package-fix" : "package-lint"
1128
+ ]]
1407
1129
  ]);
1408
1130
  console.log(chalk19.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk19.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk19.gray("seconds")}`));
1409
1131
  return result;
1410
- }, "lintPackage");
1411
- var lint = /* @__PURE__ */ __name(({ pkg, verbose, incremental, fix: fix2 } = {}) => {
1132
+ };
1133
+ var lint = ({
1134
+ pkg,
1135
+ verbose,
1136
+ incremental,
1137
+ fix: fix2
1138
+ } = {}) => {
1412
1139
  return pkg === void 0 ? lintAllPackages({
1413
1140
  verbose,
1414
1141
  incremental,
1415
1142
  fix: fix2
1416
- }) : lintPackage({
1417
- pkg,
1418
- fix: fix2
1419
- });
1420
- }, "lint");
1421
- var lintAllPackages = /* @__PURE__ */ __name(({ fix: fix2 = false } = {}) => {
1143
+ }) : lintPackage({ pkg, fix: fix2 });
1144
+ };
1145
+ var lintAllPackages = ({ fix: fix2 = false } = {}) => {
1422
1146
  console.log(chalk19.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
1423
1147
  const start = Date.now();
1424
- const fixOptions = fix2 ? [
1425
- "--fix"
1426
- ] : [];
1148
+ const fixOptions = fix2 ? ["--fix"] : [];
1427
1149
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
1428
- [
1429
- "yarn",
1430
- [
1431
- "eslint",
1432
- ...fixOptions
1433
- ]
1434
- ]
1150
+ ["yarn", ["eslint", ...fixOptions]]
1435
1151
  ]);
1436
1152
  console.log(chalk19.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk19.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk19.gray("seconds")}`));
1437
1153
  return result;
1438
- }, "lintAllPackages");
1154
+ };
1439
1155
 
1440
1156
  // src/actions/fix.ts
1441
- var fix = /* @__PURE__ */ __name((params) => {
1442
- return lint({
1443
- ...params,
1444
- fix: true
1445
- });
1446
- }, "fix");
1157
+ var fix = (params) => {
1158
+ return lint({ ...params, fix: true });
1159
+ };
1447
1160
 
1448
1161
  // src/actions/gen-docs.ts
1449
- var genDocs = /* @__PURE__ */ __name(({ pkg, incremental }) => {
1450
- return pkg ? genDocsPackage({
1451
- pkg
1452
- }) : genDocsAll({
1453
- incremental
1454
- });
1455
- }, "genDocs");
1456
- var genDocsPackage = /* @__PURE__ */ __name(({ pkg }) => {
1457
- const steps = [
1458
- [
1459
- "yarn",
1460
- [
1461
- "workspace",
1462
- pkg,
1463
- "run",
1464
- "package-gen-docs"
1465
- ]
1466
- ]
1467
- ];
1468
- return runSteps(`GenDocs [${pkg}]`, [
1469
- ...steps
1470
- ]);
1471
- }, "genDocsPackage");
1472
- var genDocsAll = /* @__PURE__ */ __name(({ incremental }) => {
1473
- const incrementalOptions = incremental ? [
1474
- "--since",
1475
- "-pA"
1476
- ] : [
1477
- "-pA"
1478
- ];
1479
- const steps = [
1480
- [
1481
- "yarn",
1482
- [
1483
- "workspaces",
1484
- "foreach",
1485
- ...incrementalOptions,
1486
- "run",
1487
- "package-gen-docs"
1488
- ]
1489
- ]
1490
- ];
1491
- return runSteps(`GenDocs [All${incremental ? "-Incremental" : ""}]`, [
1492
- ...steps
1493
- ]);
1494
- }, "genDocsAll");
1162
+ var genDocs = ({ pkg, incremental }) => {
1163
+ return pkg ? genDocsPackage({ pkg }) : genDocsAll({ incremental });
1164
+ };
1165
+ var genDocsPackage = ({ pkg }) => {
1166
+ const steps = [["yarn", ["workspace", pkg, "run", "package-gen-docs"]]];
1167
+ return runSteps(`GenDocs [${pkg}]`, [...steps]);
1168
+ };
1169
+ var genDocsAll = ({ incremental }) => {
1170
+ const incrementalOptions = incremental ? ["--since", "-pA"] : ["-pA"];
1171
+ const steps = [["yarn", ["workspaces", "foreach", ...incrementalOptions, "run", "package-gen-docs"]]];
1172
+ return runSteps(`GenDocs [All${incremental ? "-Incremental" : ""}]`, [...steps]);
1173
+ };
1495
1174
 
1496
1175
  // src/actions/gitignore-gen.ts
1497
1176
  var filename = ".gitignore";
1498
- var gitignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename, pkg), "gitignoreGen");
1177
+ var gitignoreGen = (pkg) => generateIgnoreFiles(filename, pkg);
1499
1178
 
1500
1179
  // src/actions/gitlint.ts
1501
1180
  import chalk20 from "chalk";
1502
1181
  import ParseGitConfig from "parse-git-config";
1503
- var gitlint = /* @__PURE__ */ __name(() => {
1182
+ var gitlint = () => {
1504
1183
  console.log(`
1505
1184
  Gitlint Start [${process.cwd()}]
1506
1185
  `);
@@ -1508,10 +1187,10 @@ Gitlint Start [${process.cwd()}]
1508
1187
  let warnings = 0;
1509
1188
  const errors = 0;
1510
1189
  const gitConfig = ParseGitConfig.sync();
1511
- const warn = /* @__PURE__ */ __name((message) => {
1190
+ const warn = (message) => {
1512
1191
  console.warn(chalk20.yellow(`Warning: ${message}`));
1513
1192
  warnings++;
1514
- }, "warn");
1193
+ };
1515
1194
  if (gitConfig.core.ignorecase) {
1516
1195
  warn("Please set core.ignorecase to FALSE in .git/config file [run yarn gitlint-fix]");
1517
1196
  } else {
@@ -1540,56 +1219,41 @@ Gitlint Start [${process.cwd()}]
1540
1219
  console.warn(`Gitlint Finish [ ${resultMessages.join(" | ")} ]
1541
1220
  `);
1542
1221
  return warnings + errors === 0 ? 1 : 0;
1543
- }, "gitlint");
1222
+ };
1544
1223
 
1545
1224
  // src/actions/gitlint-fix.ts
1546
1225
  import { execSync as execSync2 } from "child_process";
1547
1226
  import chalk21 from "chalk";
1548
1227
  import ParseGitConfig2 from "parse-git-config";
1549
- var gitlintFix = /* @__PURE__ */ __name(() => {
1228
+ var gitlintFix = () => {
1550
1229
  console.log(`
1551
1230
  Gitlint Fix Start [${process.cwd()}]
1552
1231
  `);
1553
1232
  const gitConfig = ParseGitConfig2.sync();
1554
1233
  if (gitConfig.core.ignorecase) {
1555
- execSync2("git config core.ignorecase false", {
1556
- stdio: "inherit"
1557
- });
1234
+ execSync2("git config core.ignorecase false", { stdio: "inherit" });
1558
1235
  console.warn(chalk21.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
1559
1236
  }
1560
1237
  if (gitConfig.core.autocrlf !== false) {
1561
- execSync2("git config core.autocrlf false", {
1562
- stdio: "inherit"
1563
- });
1238
+ execSync2("git config core.autocrlf false", { stdio: "inherit" });
1564
1239
  console.warn(chalk21.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
1565
1240
  }
1566
1241
  if (gitConfig.core.eol !== "lf") {
1567
- execSync2("git config core.eol lf", {
1568
- stdio: "inherit"
1569
- });
1242
+ execSync2("git config core.eol lf", { stdio: "inherit" });
1570
1243
  console.warn(chalk21.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
1571
1244
  }
1572
1245
  return 1;
1573
- }, "gitlintFix");
1246
+ };
1574
1247
 
1575
1248
  // src/actions/knip.ts
1576
- var knip = /* @__PURE__ */ __name(() => {
1577
- return runSteps("Knip", [
1578
- [
1579
- "yarn",
1580
- [
1581
- "knip",
1582
- "--dependencies",
1583
- "--no-exit-code"
1584
- ]
1585
- ]
1586
- ]);
1587
- }, "knip");
1249
+ var knip = () => {
1250
+ return runSteps("Knip", [["yarn", ["knip", "--dependencies", "--no-exit-code"]]]);
1251
+ };
1588
1252
 
1589
1253
  // src/actions/license.ts
1590
1254
  import chalk22 from "chalk";
1591
1255
  import { init } from "license-checker";
1592
- var license = /* @__PURE__ */ __name(async (pkg) => {
1256
+ var license = async (pkg) => {
1593
1257
  const workspaces = yarnWorkspaces();
1594
1258
  const workspaceList = workspaces.filter(({ name }) => {
1595
1259
  return pkg === void 0 || name === pkg;
@@ -1613,96 +1277,82 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
1613
1277
  "Python-2.0"
1614
1278
  ]);
1615
1279
  console.log(chalk22.green("License Checker"));
1616
- return (await Promise.all(workspaceList.map(({ location, name }) => {
1617
- return new Promise((resolve) => {
1618
- init({
1619
- production: true,
1620
- start: location
1621
- }, (error, packages) => {
1622
- if (error) {
1623
- console.error(chalk22.red(`License Checker [${name}] Error`));
1624
- console.error(chalk22.gray(error));
1625
- console.log("\n");
1626
- resolve(1);
1627
- } else {
1628
- console.log(chalk22.green(`License Checker [${name}]`));
1629
- let count = 0;
1630
- for (const [name2, info] of Object.entries(packages)) {
1631
- const licenses = Array.isArray(info.licenses) ? info.licenses : [
1632
- info.licenses
1633
- ];
1634
- for (let license2 of licenses) {
1635
- if (license2) {
1636
- const processedLicense = license2[0] === "(" && license2.at(-1) === ")" ? license2.slice(1, -2) : license2;
1637
- const orLicenses = processedLicense.split(" OR ");
1638
- let orLicenseFound = false;
1639
- for (const orLicense of orLicenses) {
1640
- if (exclude.has(orLicense)) {
1641
- orLicenseFound = true;
1280
+ return (await Promise.all(
1281
+ workspaceList.map(({ location, name }) => {
1282
+ return new Promise((resolve) => {
1283
+ init({ production: true, start: location }, (error, packages) => {
1284
+ if (error) {
1285
+ console.error(chalk22.red(`License Checker [${name}] Error`));
1286
+ console.error(chalk22.gray(error));
1287
+ console.log("\n");
1288
+ resolve(1);
1289
+ } else {
1290
+ console.log(chalk22.green(`License Checker [${name}]`));
1291
+ let count = 0;
1292
+ for (const [name2, info] of Object.entries(packages)) {
1293
+ const licenses = Array.isArray(info.licenses) ? info.licenses : [info.licenses];
1294
+ for (let license2 of licenses) {
1295
+ if (license2) {
1296
+ const processedLicense = license2[0] === "(" && license2.at(-1) === ")" ? license2.slice(1, -2) : license2;
1297
+ const orLicenses = processedLicense.split(" OR ");
1298
+ let orLicenseFound = false;
1299
+ for (const orLicense of orLicenses) {
1300
+ if (exclude.has(orLicense)) {
1301
+ orLicenseFound = true;
1302
+ }
1303
+ }
1304
+ if (!orLicenseFound) {
1305
+ count++;
1306
+ console.warn(chalk22.yellow(`${name2}: Package License not allowed [${license2}]`));
1642
1307
  }
1643
- }
1644
- if (!orLicenseFound) {
1645
- count++;
1646
- console.warn(chalk22.yellow(`${name2}: Package License not allowed [${license2}]`));
1647
1308
  }
1648
1309
  }
1649
1310
  }
1311
+ console.log("\n");
1312
+ resolve(count);
1650
1313
  }
1651
- console.log("\n");
1652
- resolve(count);
1653
- }
1314
+ });
1654
1315
  });
1655
- });
1656
- }))).reduce((prev, value) => prev || value, 0);
1657
- }, "license");
1316
+ })
1317
+ )).reduce((prev, value) => prev || value, 0);
1318
+ };
1658
1319
 
1659
1320
  // src/actions/npmignore-gen.ts
1660
1321
  var filename2 = ".npmignore";
1661
- var npmignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename2, pkg), "npmignoreGen");
1322
+ var npmignoreGen = (pkg) => generateIgnoreFiles(filename2, pkg);
1662
1323
 
1663
1324
  // src/actions/package/clean-outputs.ts
1664
1325
  import path5 from "path";
1665
1326
  import chalk23 from "chalk";
1666
- var packageCleanOutputs = /* @__PURE__ */ __name(() => {
1327
+ var packageCleanOutputs = () => {
1667
1328
  const pkg = process.env.INIT_CWD ?? ".";
1668
1329
  const pkgName = process.env.npm_package_name;
1669
- const folders = [
1670
- path5.join(pkg, "dist"),
1671
- path5.join(pkg, "build"),
1672
- path5.join(pkg, "docs")
1673
- ];
1330
+ const folders = [path5.join(pkg, "dist"), path5.join(pkg, "build"), path5.join(pkg, "docs")];
1674
1331
  console.log(chalk23.green(`Cleaning Outputs [${pkgName}]`));
1675
1332
  for (let folder of folders) {
1676
1333
  deleteGlob(folder);
1677
1334
  }
1678
1335
  return 0;
1679
- }, "packageCleanOutputs");
1336
+ };
1680
1337
 
1681
1338
  // src/actions/package/clean-typescript.ts
1682
1339
  import path6 from "path";
1683
1340
  import chalk24 from "chalk";
1684
- var packageCleanTypescript = /* @__PURE__ */ __name(() => {
1341
+ var packageCleanTypescript = () => {
1685
1342
  const pkg = process.env.INIT_CWD ?? ".";
1686
1343
  const pkgName = process.env.npm_package_name;
1687
1344
  console.log(chalk24.green(`Cleaning Typescript [${pkgName}]`));
1688
- const files = [
1689
- path6.join(pkg, "*.tsbuildinfo"),
1690
- path6.join(pkg, ".tsconfig.*"),
1691
- path6.join(pkg, ".eslintcache")
1692
- ];
1345
+ const files = [path6.join(pkg, "*.tsbuildinfo"), path6.join(pkg, ".tsconfig.*"), path6.join(pkg, ".eslintcache")];
1693
1346
  for (let file of files) {
1694
1347
  deleteGlob(file);
1695
1348
  }
1696
1349
  return 0;
1697
- }, "packageCleanTypescript");
1350
+ };
1698
1351
 
1699
1352
  // src/actions/package/clean.ts
1700
- var packageClean = /* @__PURE__ */ __name(async () => {
1701
- return (await Promise.all([
1702
- packageCleanOutputs(),
1703
- packageCleanTypescript()
1704
- ])).reduce((prev, value) => prev + value, 0);
1705
- }, "packageClean");
1353
+ var packageClean = async () => {
1354
+ return (await Promise.all([packageCleanOutputs(), packageCleanTypescript()])).reduce((prev, value) => prev + value, 0);
1355
+ };
1706
1356
 
1707
1357
  // src/actions/package/compile/compile.ts
1708
1358
  import chalk29 from "chalk";
@@ -1714,38 +1364,28 @@ import { build as build2, defineConfig } from "tsup";
1714
1364
  // src/actions/package/compile/inputs.ts
1715
1365
  import chalk25 from "chalk";
1716
1366
  import { glob as glob2 } from "glob";
1717
- var getAllInputs = /* @__PURE__ */ __name((srcDir, verbose = false) => {
1718
- return [
1719
- ...glob2.sync(`${srcDir}/**/*.ts`, {
1720
- posix: true
1721
- }).map((file) => {
1722
- const result = file.slice(Math.max(0, srcDir.length + 1));
1723
- if (verbose) {
1724
- console.log(chalk25.gray(`getAllInputs: ${JSON.stringify(result, null, 2)}`));
1725
- }
1726
- return result;
1727
- }),
1728
- ...glob2.sync(`${srcDir}/**/*.tsx`, {
1729
- posix: true
1730
- }).map((file) => {
1731
- const result = file.slice(Math.max(0, srcDir.length + 1));
1732
- if (verbose) {
1733
- console.log(chalk25.gray(`getAllInputs: ${JSON.stringify(result, null, 2)}`));
1734
- }
1735
- return result;
1736
- })
1737
- ];
1738
- }, "getAllInputs");
1367
+ var getAllInputs = (srcDir, verbose = false) => {
1368
+ return [...glob2.sync(`${srcDir}/**/*.ts`, { posix: true }).map((file) => {
1369
+ const result = file.slice(Math.max(0, srcDir.length + 1));
1370
+ if (verbose) {
1371
+ console.log(chalk25.gray(`getAllInputs: ${JSON.stringify(result, null, 2)}`));
1372
+ }
1373
+ return result;
1374
+ }), ...glob2.sync(`${srcDir}/**/*.tsx`, { posix: true }).map((file) => {
1375
+ const result = file.slice(Math.max(0, srcDir.length + 1));
1376
+ if (verbose) {
1377
+ console.log(chalk25.gray(`getAllInputs: ${JSON.stringify(result, null, 2)}`));
1378
+ }
1379
+ return result;
1380
+ })];
1381
+ };
1739
1382
 
1740
1383
  // src/actions/package/compile/buildEntries.ts
1741
- var buildEntries = /* @__PURE__ */ __name((srcDir, entryMode = "single", options, excludeSpecAndStories = true, verbose = false) => {
1384
+ var buildEntries = (srcDir, entryMode = "single", options, excludeSpecAndStories = true, verbose = false) => {
1742
1385
  let entries = [];
1743
1386
  switch (entryMode) {
1744
1387
  case "platform": {
1745
- entries = [
1746
- "index-node.ts",
1747
- "index-browser.ts"
1748
- ];
1388
+ entries = ["index-node.ts", "index-browser.ts"];
1749
1389
  break;
1750
1390
  }
1751
1391
  case "all": {
@@ -1757,9 +1397,7 @@ var buildEntries = /* @__PURE__ */ __name((srcDir, entryMode = "single", options
1757
1397
  break;
1758
1398
  }
1759
1399
  default: {
1760
- entries = [
1761
- "index.ts"
1762
- ];
1400
+ entries = ["index.ts"];
1763
1401
  break;
1764
1402
  }
1765
1403
  }
@@ -1768,7 +1406,7 @@ var buildEntries = /* @__PURE__ */ __name((srcDir, entryMode = "single", options
1768
1406
  }
1769
1407
  if (verbose) console.log(`buildEntries [${entryMode}] ${entries.length}`);
1770
1408
  return entries;
1771
- }, "buildEntries");
1409
+ };
1772
1410
 
1773
1411
  // src/actions/package/compile/deepMerge.ts
1774
1412
  function deepMerge(target, source) {
@@ -1785,7 +1423,6 @@ function deepMerge(target, source) {
1785
1423
  }
1786
1424
  return target;
1787
1425
  }
1788
- __name(deepMerge, "deepMerge");
1789
1426
  function deepMergeObjects(objects) {
1790
1427
  const result = {};
1791
1428
  for (const obj of objects) {
@@ -1793,30 +1430,39 @@ function deepMergeObjects(objects) {
1793
1430
  }
1794
1431
  return result;
1795
1432
  }
1796
- __name(deepMergeObjects, "deepMergeObjects");
1797
1433
 
1798
1434
  // src/actions/package/compile/packageCompileTsc.ts
1799
1435
  import { cwd as cwd2 } from "process";
1800
1436
  import chalk26 from "chalk";
1801
1437
  import { createProgramFromConfig } from "tsc-prog";
1802
- import ts2, { DiagnosticCategory, formatDiagnosticsWithColorAndContext, getPreEmitDiagnostics, sys } from "typescript";
1438
+ import ts2, {
1439
+ DiagnosticCategory,
1440
+ formatDiagnosticsWithColorAndContext,
1441
+ getPreEmitDiagnostics,
1442
+ sys
1443
+ } from "typescript";
1803
1444
 
1804
1445
  // src/actions/package/compile/getCompilerOptions.ts
1805
1446
  import { cwd } from "process";
1806
1447
  import deepmerge2 from "deepmerge";
1807
1448
  import { getTsconfig } from "get-tsconfig";
1808
- var getCompilerOptions = /* @__PURE__ */ __name((options = {}, fileName = "tsconfig.json") => {
1449
+ var getCompilerOptions = (options = {}, fileName = "tsconfig.json") => {
1809
1450
  const resolvedTsConfigCompilerOptions = getTsconfig(cwd(), fileName)?.config?.compilerOptions ?? {};
1810
1451
  return deepmerge2(resolvedTsConfigCompilerOptions, options);
1811
- }, "getCompilerOptions");
1452
+ };
1812
1453
 
1813
1454
  // src/actions/package/compile/packageCompileTsc.ts
1814
- var packageCompileTsc = /* @__PURE__ */ __name((platform, entries, srcDir = "src", outDir = "dist", compilerOptionsParam, verbose = false) => {
1455
+ var packageCompileTsc = (platform, entries, srcDir = "src", outDir = "dist", compilerOptionsParam, verbose = false) => {
1815
1456
  const pkg = process.env.INIT_CWD ?? cwd2();
1816
1457
  if (verbose) {
1817
1458
  console.log(chalk26.cyan(`Validating code START: ${entries.length} files to ${outDir} from ${srcDir}`));
1818
1459
  }
1819
- const configFilePath = ts2.findConfigFile("./", ts2.sys.fileExists, "tsconfig.json");
1460
+ const configFilePath = ts2.findConfigFile(
1461
+ "./",
1462
+ // search path
1463
+ ts2.sys.fileExists,
1464
+ "tsconfig.json"
1465
+ );
1820
1466
  if (configFilePath === void 0) {
1821
1467
  throw new Error("Could not find tsconfig.json");
1822
1468
  }
@@ -1845,17 +1491,18 @@ var packageCompileTsc = /* @__PURE__ */ __name((platform, entries, srcDir = "src
1845
1491
  basePath: pkg ?? cwd2(),
1846
1492
  compilerOptions,
1847
1493
  files: entries.map((entry) => `${srcDir}/${entry}`),
1848
- include: [
1849
- `${srcDir}/**/*.*`
1850
- ]
1494
+ include: [`${srcDir}/**/*.*`]
1851
1495
  });
1852
1496
  const diagnostics = getPreEmitDiagnostics(program);
1853
1497
  if (diagnostics.length > 0) {
1854
- const formattedDiagnostics = formatDiagnosticsWithColorAndContext(diagnostics, {
1855
- getCanonicalFileName: /* @__PURE__ */ __name((fileName) => fileName, "getCanonicalFileName"),
1856
- getCurrentDirectory: /* @__PURE__ */ __name(() => srcDir, "getCurrentDirectory"),
1857
- getNewLine: /* @__PURE__ */ __name(() => sys.newLine, "getNewLine")
1858
- });
1498
+ const formattedDiagnostics = formatDiagnosticsWithColorAndContext(
1499
+ diagnostics,
1500
+ {
1501
+ getCanonicalFileName: (fileName) => fileName,
1502
+ getCurrentDirectory: () => srcDir,
1503
+ getNewLine: () => sys.newLine
1504
+ }
1505
+ );
1859
1506
  console.error(formattedDiagnostics);
1860
1507
  }
1861
1508
  program.emit();
@@ -1867,7 +1514,7 @@ var packageCompileTsc = /* @__PURE__ */ __name((platform, entries, srcDir = "src
1867
1514
  console.log(chalk26.cyan(`Validating code FINISH: ${entries.length} files to ${outDir} from ${srcDir}`));
1868
1515
  }
1869
1516
  }
1870
- }, "packageCompileTsc");
1517
+ };
1871
1518
 
1872
1519
  // src/actions/package/compile/packageCompileTscTypes.ts
1873
1520
  import path7 from "path";
@@ -1876,31 +1523,23 @@ import chalk27 from "chalk";
1876
1523
  import { rollup } from "rollup";
1877
1524
  import dts from "rollup-plugin-dts";
1878
1525
  import nodeExternals from "rollup-plugin-node-externals";
1879
- var ignoredWarningCodes = /* @__PURE__ */ new Set([
1880
- "EMPTY_BUNDLE",
1881
- "UNRESOLVED_IMPORT"
1882
- ]);
1526
+ var ignoredWarningCodes = /* @__PURE__ */ new Set(["EMPTY_BUNDLE", "UNRESOLVED_IMPORT"]);
1883
1527
  async function bundleDts(inputPath, outputPath, platform, options, verbose = false) {
1884
1528
  const pkg = process.env.INIT_CWD ?? cwd3();
1885
1529
  const tsconfigPath = path7.resolve(pkg, "tsconfig.json");
1886
- const nodePlugIns = platform === "node" ? [
1887
- nodeExternals()
1888
- ] : [];
1530
+ const nodePlugIns = platform === "node" ? [nodeExternals()] : [];
1889
1531
  try {
1890
1532
  const bundle = await rollup({
1891
1533
  input: inputPath,
1892
- plugins: [
1893
- dts({
1894
- ...options,
1895
- tsconfig: tsconfigPath,
1896
- compilerOptions: {
1897
- emitDeclarationOnly: true,
1898
- noEmit: false,
1899
- declarationMap: true
1900
- }
1901
- }),
1902
- ...nodePlugIns
1903
- ],
1534
+ plugins: [dts({
1535
+ ...options,
1536
+ tsconfig: tsconfigPath,
1537
+ compilerOptions: {
1538
+ emitDeclarationOnly: true,
1539
+ noEmit: false,
1540
+ declarationMap: true
1541
+ }
1542
+ }), ...nodePlugIns],
1904
1543
  onwarn(warning, warn) {
1905
1544
  if (ignoredWarningCodes.has(warning.code ?? "")) {
1906
1545
  return;
@@ -1923,22 +1562,18 @@ async function bundleDts(inputPath, outputPath, platform, options, verbose = fal
1923
1562
  console.log(`Bundled declarations written to ${outputPath}`);
1924
1563
  }
1925
1564
  }
1926
- __name(bundleDts, "bundleDts");
1927
- var packageCompileTscTypes = /* @__PURE__ */ __name(async (entries, outDir, platform, srcDir = "build", verbose = false) => {
1565
+ var packageCompileTscTypes = async (entries, outDir, platform, srcDir = "build", verbose = false) => {
1928
1566
  if (verbose) {
1929
1567
  console.log(chalk27.cyan(`Compiling Types START [${platform}]: ${entries.length} files to ${outDir} from ${srcDir}`));
1930
1568
  console.log(`Entries: ${entries.join(", ")}`);
1931
1569
  }
1932
1570
  const pkg = process.env.INIT_CWD ?? cwd3();
1933
1571
  const srcRoot = `${pkg}/${srcDir}/${platform}`;
1934
- const entryNameToTypeName = /* @__PURE__ */ __name((entry) => {
1572
+ const entryNameToTypeName = (entry) => {
1935
1573
  const splitEntryName = entry.split(".");
1936
1574
  const newEntryExtension = "d." + splitEntryName.at(-1);
1937
- return [
1938
- ...splitEntryName.slice(0, -1),
1939
- newEntryExtension
1940
- ].join(".");
1941
- }, "entryNameToTypeName");
1575
+ return [...splitEntryName.slice(0, -1), newEntryExtension].join(".");
1576
+ };
1942
1577
  const compilerOptions = getCompilerOptions({
1943
1578
  removeComments: false,
1944
1579
  skipDefaultLibCheck: true,
@@ -1950,18 +1585,16 @@ var packageCompileTscTypes = /* @__PURE__ */ __name(async (entries, outDir, plat
1950
1585
  const entryNames = entries.map((entry) => entry.split(`${srcDir}/`).at(-1) ?? entry);
1951
1586
  await Promise.all(entryNames.map(async (entryName) => {
1952
1587
  const entryTypeName = entryNameToTypeName(entryName);
1953
- await bundleDts(`${srcRoot}/${entryTypeName}`, `${outDir}/${entryTypeName}`, platform, {
1954
- compilerOptions
1955
- }, verbose);
1588
+ await bundleDts(`${srcRoot}/${entryTypeName}`, `${outDir}/${entryTypeName}`, platform, { compilerOptions }, verbose);
1956
1589
  }));
1957
1590
  if (verbose) {
1958
1591
  console.log(chalk27.cyan(`Compiling Types FINISH: ${entries.length} files to ${outDir} from ${srcDir}`));
1959
1592
  }
1960
1593
  return 0;
1961
- }, "packageCompileTscTypes");
1594
+ };
1962
1595
 
1963
1596
  // src/actions/package/compile/packageCompileTsup.ts
1964
- var compileFolder = /* @__PURE__ */ __name(async (srcDir, entries, buildDir, options, bundleTypes = false, verbose) => {
1597
+ var compileFolder = async (srcDir, entries, buildDir, options, bundleTypes = false, verbose) => {
1965
1598
  const outDir = options?.outDir ?? "dist";
1966
1599
  if (verbose) {
1967
1600
  console.log(`compileFolder [${srcDir}, ${options?.outDir}]`);
@@ -1978,35 +1611,27 @@ var compileFolder = /* @__PURE__ */ __name(async (srcDir, entries, buildDir, opt
1978
1611
  console.error(chalk28.red(`Compile:Validation had ${validationResult} errors`));
1979
1612
  return validationResult;
1980
1613
  }
1981
- const optionsParams = tsupOptions([
1982
- {
1983
- bundle: true,
1984
- cjsInterop: true,
1985
- clean: false,
1986
- dts: false,
1987
- format: [
1988
- "esm"
1989
- ],
1990
- outDir,
1991
- silent: true,
1992
- sourcemap: true,
1993
- splitting: false,
1994
- tsconfig: "tsconfig.json",
1995
- ...options,
1996
- entry: entries.map((entry) => `${srcDir}/${entry}`)
1997
- }
1998
- ]);
1614
+ const optionsParams = tsupOptions([{
1615
+ bundle: true,
1616
+ cjsInterop: true,
1617
+ clean: false,
1618
+ dts: false,
1619
+ format: ["esm"],
1620
+ outDir,
1621
+ silent: true,
1622
+ sourcemap: true,
1623
+ splitting: false,
1624
+ tsconfig: "tsconfig.json",
1625
+ ...options,
1626
+ entry: entries.map((entry) => `${srcDir}/${entry}`)
1627
+ }]);
1999
1628
  const optionsResult = defineConfig(optionsParams);
2000
- const optionsList = (await Promise.all((Array.isArray(optionsResult) ? optionsResult : [
2001
- optionsResult
2002
- ]).flatMap(async (options2) => {
2003
- const result = typeof options2 === "function" ? await options2({}) : [
2004
- options2
2005
- ];
2006
- return Array.isArray(result) ? result : [
2007
- result
2008
- ];
2009
- }))).flat();
1629
+ const optionsList = (await Promise.all(
1630
+ (Array.isArray(optionsResult) ? optionsResult : [optionsResult]).flatMap(async (options2) => {
1631
+ const result = typeof options2 === "function" ? await options2({}) : [options2];
1632
+ return Array.isArray(result) ? result : [result];
1633
+ })
1634
+ )).flat();
2010
1635
  if (verbose) {
2011
1636
  console.log(chalk28.cyan(`TSUP:build:start [${srcDir}]`));
2012
1637
  console.log(chalk28.gray(`TSUP:build:options [${JSON.stringify(optionsList, null, 2)}]`));
@@ -2019,8 +1644,8 @@ var compileFolder = /* @__PURE__ */ __name(async (srcDir, entries, buildDir, opt
2019
1644
  await packageCompileTscTypes(entries, outDir, options?.platform ?? "neutral", buildDir, verbose);
2020
1645
  }
2021
1646
  return 0;
2022
- }, "compileFolder");
2023
- var tsupOptions = /* @__PURE__ */ __name((options = []) => {
1647
+ };
1648
+ var tsupOptions = (options = []) => {
2024
1649
  const standardLoaders = {
2025
1650
  ".gif": "copy",
2026
1651
  ".html": "copy",
@@ -2032,25 +1657,16 @@ var tsupOptions = /* @__PURE__ */ __name((options = []) => {
2032
1657
  };
2033
1658
  const standardOptions = {
2034
1659
  bundle: true,
2035
- format: [
2036
- "esm"
2037
- ],
1660
+ format: ["esm"],
2038
1661
  loader: standardLoaders,
2039
- outExtension: /* @__PURE__ */ __name(({ format }) => format === "esm" ? {
2040
- js: ".mjs"
2041
- } : {
2042
- js: ".cjs"
2043
- }, "outExtension"),
1662
+ outExtension: ({ format }) => format === "esm" ? { js: ".mjs" } : { js: ".cjs" },
2044
1663
  skipNodeModulesBundle: true,
2045
1664
  sourcemap: true,
2046
1665
  target: "esnext"
2047
1666
  };
2048
- return deepMergeObjects([
2049
- standardOptions,
2050
- ...options
2051
- ]);
2052
- }, "tsupOptions");
2053
- var packageCompileTsup = /* @__PURE__ */ __name(async (config2) => {
1667
+ return deepMergeObjects([standardOptions, ...options]);
1668
+ };
1669
+ var packageCompileTsup = async (config2) => {
2054
1670
  const compile2 = config2?.compile;
2055
1671
  const verbose = config2?.verbose ?? false;
2056
1672
  const outDirAsBuildDir = compile2?.outDirAsBuildDir ?? true;
@@ -2058,94 +1674,100 @@ var packageCompileTsup = /* @__PURE__ */ __name(async (config2) => {
2058
1674
  if (verbose) {
2059
1675
  console.log("Compiling with TSUP");
2060
1676
  }
2061
- const compileForNode = compile2?.node ?? {
2062
- src: {}
2063
- };
2064
- const compileForBrowser = compile2?.browser ?? {
2065
- src: {}
2066
- };
2067
- const compileForNeutral = compile2?.neutral ?? {
2068
- src: {}
2069
- };
2070
- return (await Promise.all(Object.entries(compileForNode).map(async ([srcDir, options]) => {
2071
- const optionsObject = typeof options === "object" ? options : {};
2072
- const inEsBuildOptions = typeof compile2?.node?.esbuildOptions === "object" ? compile2?.node?.esbuildOptions : {};
2073
- const entry = buildEntries(srcDir, compile2?.entryMode, options, true, verbose);
2074
- const platform = "node";
2075
- const rootOutDir = optionsObject.outDir ?? "dist";
2076
- const outDir = rootOutDir + "/" + platform;
2077
- return typeof srcDir === "string" ? await compileFolder(srcDir, entry, outDirAsBuildDir ? rootOutDir : "build", tsupOptions([
2078
- inEsBuildOptions,
2079
- compile2?.tsup?.options ?? {},
2080
- typeof options === "object" ? options : {},
2081
- {
2082
- platform: "node",
2083
- outDir
2084
- }
2085
- ]), bundleTypes, verbose) : 0;
2086
- }))).reduce((prev, value) => prev + value, 0) + (await Promise.all(Object.entries(compileForBrowser).map(async ([srcDir, options]) => {
2087
- const optionsObject = typeof options === "object" ? options : {};
2088
- const inEsBuildOptions = typeof compile2?.browser?.esbuildOptions === "object" ? compile2?.browser?.esbuildOptions : {};
2089
- const entry = buildEntries(srcDir, compile2?.entryMode, options, true, verbose);
2090
- const platform = "browser";
2091
- const rootOutDir = optionsObject.outDir ?? "dist";
2092
- const outDir = rootOutDir + "/" + platform;
2093
- return typeof srcDir === "string" ? await compileFolder(srcDir, entry, outDirAsBuildDir ? rootOutDir : "build", tsupOptions([
2094
- inEsBuildOptions,
2095
- compile2?.tsup?.options ?? {},
2096
- typeof options === "object" ? options : {},
2097
- {
2098
- platform: "browser",
2099
- outDir
2100
- }
2101
- ]), bundleTypes, verbose) : 0;
2102
- }))).reduce((prev, value) => prev + value, 0) + (await Promise.all(Object.entries(compileForNeutral).map(async ([srcDir, options]) => {
2103
- const optionsObject = typeof options === "object" ? options : {};
2104
- const inEsBuildOptions = typeof compile2?.neutral?.esbuildOptions === "object" ? compile2?.neutral?.esbuildOptions : {};
2105
- const entry = buildEntries(srcDir, compile2?.entryMode, options, true, verbose);
2106
- const platform = "neutral";
2107
- const rootOutDir = optionsObject.outDir ?? "dist";
2108
- const outDir = rootOutDir + "/" + platform;
2109
- return typeof srcDir === "string" ? await compileFolder(srcDir, entry, outDirAsBuildDir ? rootOutDir : "build", tsupOptions([
2110
- inEsBuildOptions,
2111
- compile2?.tsup?.options ?? {},
2112
- typeof options === "object" ? options : {},
2113
- {
2114
- platform: "neutral",
2115
- outDir
2116
- }
2117
- ]), bundleTypes, verbose) : 0;
2118
- }))).reduce((prev, value) => prev + value, 0) + 0;
2119
- }, "packageCompileTsup");
1677
+ const compileForNode = compile2?.node ?? { src: {} };
1678
+ const compileForBrowser = compile2?.browser ?? { src: {} };
1679
+ const compileForNeutral = compile2?.neutral ?? { src: {} };
1680
+ return (await Promise.all(
1681
+ Object.entries(compileForNode).map(async ([srcDir, options]) => {
1682
+ const optionsObject = typeof options === "object" ? options : {};
1683
+ const inEsBuildOptions = typeof compile2?.node?.esbuildOptions === "object" ? compile2?.node?.esbuildOptions : {};
1684
+ const entry = buildEntries(srcDir, compile2?.entryMode, options, true, verbose);
1685
+ const platform = "node";
1686
+ const rootOutDir = optionsObject.outDir ?? "dist";
1687
+ const outDir = rootOutDir + "/" + platform;
1688
+ return typeof srcDir === "string" ? await compileFolder(
1689
+ srcDir,
1690
+ entry,
1691
+ outDirAsBuildDir ? rootOutDir : "build",
1692
+ tsupOptions([
1693
+ inEsBuildOptions,
1694
+ compile2?.tsup?.options ?? {},
1695
+ typeof options === "object" ? options : {},
1696
+ { platform: "node", outDir }
1697
+ ]),
1698
+ bundleTypes,
1699
+ verbose
1700
+ ) : 0;
1701
+ })
1702
+ )).reduce((prev, value) => prev + value, 0) + (await Promise.all(
1703
+ Object.entries(compileForBrowser).map(async ([srcDir, options]) => {
1704
+ const optionsObject = typeof options === "object" ? options : {};
1705
+ const inEsBuildOptions = typeof compile2?.browser?.esbuildOptions === "object" ? compile2?.browser?.esbuildOptions : {};
1706
+ const entry = buildEntries(srcDir, compile2?.entryMode, options, true, verbose);
1707
+ const platform = "browser";
1708
+ const rootOutDir = optionsObject.outDir ?? "dist";
1709
+ const outDir = rootOutDir + "/" + platform;
1710
+ return typeof srcDir === "string" ? await compileFolder(
1711
+ srcDir,
1712
+ entry,
1713
+ outDirAsBuildDir ? rootOutDir : "build",
1714
+ tsupOptions([
1715
+ inEsBuildOptions,
1716
+ compile2?.tsup?.options ?? {},
1717
+ typeof options === "object" ? options : {},
1718
+ { platform: "browser", outDir }
1719
+ ]),
1720
+ bundleTypes,
1721
+ verbose
1722
+ ) : 0;
1723
+ })
1724
+ )).reduce((prev, value) => prev + value, 0) + (await Promise.all(
1725
+ Object.entries(compileForNeutral).map(async ([srcDir, options]) => {
1726
+ const optionsObject = typeof options === "object" ? options : {};
1727
+ const inEsBuildOptions = typeof compile2?.neutral?.esbuildOptions === "object" ? compile2?.neutral?.esbuildOptions : {};
1728
+ const entry = buildEntries(srcDir, compile2?.entryMode, options, true, verbose);
1729
+ const platform = "neutral";
1730
+ const rootOutDir = optionsObject.outDir ?? "dist";
1731
+ const outDir = rootOutDir + "/" + platform;
1732
+ return typeof srcDir === "string" ? await compileFolder(
1733
+ srcDir,
1734
+ entry,
1735
+ outDirAsBuildDir ? rootOutDir : "build",
1736
+ tsupOptions([
1737
+ inEsBuildOptions,
1738
+ compile2?.tsup?.options ?? {},
1739
+ typeof options === "object" ? options : {},
1740
+ { platform: "neutral", outDir }
1741
+ ]),
1742
+ bundleTypes,
1743
+ verbose
1744
+ ) : 0;
1745
+ })
1746
+ )).reduce((prev, value) => prev + value, 0) + 0;
1747
+ };
2120
1748
 
2121
1749
  // src/actions/package/compile/compile.ts
2122
- var packageCompile = /* @__PURE__ */ __name(async (inConfig = {}) => {
1750
+ var packageCompile = async (inConfig = {}) => {
2123
1751
  const pkg = process.env.INIT_CWD;
2124
1752
  console.log(chalk29.green(`Compiling ${pkg}`));
2125
1753
  const config2 = await loadConfig(inConfig);
2126
1754
  return await packageCompileTsup(config2);
2127
- }, "packageCompile");
1755
+ };
2128
1756
 
2129
1757
  // src/actions/package/copy-assets.ts
2130
1758
  import path8 from "path/posix";
2131
1759
  import chalk30 from "chalk";
2132
1760
  import cpy2 from "cpy";
2133
- var copyTargetAssets2 = /* @__PURE__ */ __name(async (target, name, location) => {
1761
+ var copyTargetAssets2 = async (target, name, location) => {
2134
1762
  try {
2135
- const values = await cpy2([
2136
- "**/*.jpg",
2137
- "**/*.png",
2138
- "**/*.gif",
2139
- "**/*.svg",
2140
- "**/*.webp",
2141
- "**/*.sass",
2142
- "**/*.scss",
2143
- "**/*.gif",
2144
- "**/*.css"
2145
- ], `../dist/${target}`, {
2146
- cwd: path8.join(location, "src"),
2147
- flat: false
2148
- });
1763
+ const values = await cpy2(
1764
+ ["**/*.jpg", "**/*.png", "**/*.gif", "**/*.svg", "**/*.webp", "**/*.sass", "**/*.scss", "**/*.gif", "**/*.css"],
1765
+ `../dist/${target}`,
1766
+ {
1767
+ cwd: path8.join(location, "src"),
1768
+ flat: false
1769
+ }
1770
+ );
2149
1771
  if (values.length > 0) {
2150
1772
  console.log(chalk30.green(`Copying Assets [${target.toUpperCase()}] - ${name} - ${location}`));
2151
1773
  }
@@ -2158,8 +1780,8 @@ var copyTargetAssets2 = /* @__PURE__ */ __name(async (target, name, location) =>
2158
1780
  console.log(`Copy Assets Failed: ${name}: ${error.message}`);
2159
1781
  return 1;
2160
1782
  }
2161
- }, "copyTargetAssets");
2162
- var packageCopyAssets = /* @__PURE__ */ __name(async ({ target }) => {
1783
+ };
1784
+ var packageCopyAssets = async ({ target }) => {
2163
1785
  const pkg = process.env.INIT_CWD ?? "./";
2164
1786
  const pkgName = process.env.npm_package_name ?? "Unknown";
2165
1787
  switch (target) {
@@ -2173,11 +1795,11 @@ var packageCopyAssets = /* @__PURE__ */ __name(async ({ target }) => {
2173
1795
  return await copyTargetAssets2("esm", pkgName, pkg) || await copyTargetAssets2("cjs", pkgName, pkg);
2174
1796
  }
2175
1797
  }
2176
- }, "packageCopyAssets");
1798
+ };
2177
1799
 
2178
1800
  // src/actions/package/cycle.ts
2179
1801
  import { cruise as cruise2 } from "dependency-cruiser";
2180
- var packageCycle = /* @__PURE__ */ __name(async () => {
1802
+ var packageCycle = async () => {
2181
1803
  const pkg = process.env.INIT_CWD;
2182
1804
  const pkgName = process.env.npm_package_name;
2183
1805
  const cruiseOptions = {
@@ -2188,26 +1810,20 @@ var packageCycle = /* @__PURE__ */ __name(async () => {
2188
1810
  severity: "error",
2189
1811
  comment: "This dependency creates a circular reference",
2190
1812
  from: {},
2191
- to: {
2192
- circular: true
2193
- }
1813
+ to: { circular: true }
2194
1814
  }
2195
1815
  ]
2196
1816
  },
2197
1817
  exclude: "node_modules|packages/.*/packages",
2198
1818
  validate: true,
2199
- doNotFollow: {
2200
- path: "node_modules|packages/.*/packages"
2201
- },
1819
+ doNotFollow: { path: "node_modules|packages/.*/packages" },
2202
1820
  tsPreCompilationDeps: false,
2203
1821
  combinedDependencies: true,
2204
1822
  outputType: "err"
2205
1823
  };
2206
1824
  const target = `${pkg}/src`;
2207
1825
  console.log(`Checking for circular dependencies in ${target}...`);
2208
- const result = await cruise2([
2209
- target
2210
- ], cruiseOptions);
1826
+ const result = await cruise2([target], cruiseOptions);
2211
1827
  console.log(result.output);
2212
1828
  if (result.exitCode === 0) {
2213
1829
  console.log(`${pkgName} \u2705 No dependency violations`);
@@ -2215,13 +1831,18 @@ var packageCycle = /* @__PURE__ */ __name(async () => {
2215
1831
  console.error(`${pkgName} \u274C Dependency violations found`);
2216
1832
  }
2217
1833
  return result.exitCode;
2218
- }, "packageCycle");
1834
+ };
2219
1835
 
2220
1836
  // src/actions/package/gen-docs.ts
2221
1837
  import { existsSync as existsSync5 } from "fs";
2222
1838
  import path9 from "path";
2223
1839
  import chalk31 from "chalk";
2224
- import { Application, ArgumentsReader, TSConfigReader, TypeDocReader } from "typedoc";
1840
+ import {
1841
+ Application,
1842
+ ArgumentsReader,
1843
+ TSConfigReader,
1844
+ TypeDocReader
1845
+ } from "typedoc";
2225
1846
  var ExitCodes = {
2226
1847
  CompileError: 3,
2227
1848
  ExceptionThrown: 6,
@@ -2231,17 +1852,14 @@ var ExitCodes = {
2231
1852
  OutputError: 5,
2232
1853
  ValidationError: 4
2233
1854
  };
2234
- var packageGenDocs = /* @__PURE__ */ __name(async () => {
1855
+ var packageGenDocs = async () => {
2235
1856
  const pkg = process.env.INIT_CWD;
2236
1857
  if (pkg !== void 0 && !existsSync5(path9.join(pkg, "typedoc.json"))) {
2237
1858
  return;
2238
1859
  }
2239
1860
  const app = await Application.bootstrap({
2240
1861
  entryPointStrategy: "merge",
2241
- entryPoints: [
2242
- `${pkg}/src/**/*.ts`,
2243
- `${pkg}/packages/*/dist/docs.json`
2244
- ],
1862
+ entryPoints: [`${pkg}/src/**/*.ts`, `${pkg}/packages/*/dist/docs.json`],
2245
1863
  excludeExternals: true,
2246
1864
  json: `${pkg}/dist/docs.json`,
2247
1865
  logLevel: "Error",
@@ -2252,8 +1870,8 @@ var packageGenDocs = /* @__PURE__ */ __name(async () => {
2252
1870
  app.options.addReader(new TSConfigReader());
2253
1871
  app.options.addReader(new ArgumentsReader(300));
2254
1872
  return await runTypeDoc(app);
2255
- }, "packageGenDocs");
2256
- var runTypeDoc = /* @__PURE__ */ __name(async (app) => {
1873
+ };
1874
+ var runTypeDoc = async (app) => {
2257
1875
  const pkgName = process.env.npm_package_name;
2258
1876
  if (app.options.getValue("version")) {
2259
1877
  console.log(app.toString());
@@ -2324,7 +1942,7 @@ var runTypeDoc = /* @__PURE__ */ __name(async (app) => {
2324
1942
  }
2325
1943
  console.log(chalk31.green(`${pkgName} - Ok`));
2326
1944
  return ExitCodes.Ok;
2327
- }, "runTypeDoc");
1945
+ };
2328
1946
 
2329
1947
  // src/actions/package/lint.ts
2330
1948
  import { readdirSync } from "fs";
@@ -2335,27 +1953,24 @@ import chalk32 from "chalk";
2335
1953
  import { ESLint } from "eslint";
2336
1954
  import { findUp } from "find-up";
2337
1955
  import picomatch from "picomatch";
2338
- var dumpMessages = /* @__PURE__ */ __name((lintResults) => {
2339
- const colors = [
2340
- "white",
2341
- "yellow",
2342
- "red"
2343
- ];
2344
- const severity = [
2345
- "none",
2346
- "warning",
2347
- "error"
2348
- ];
1956
+ var dumpMessages = (lintResults) => {
1957
+ const colors = ["white", "yellow", "red"];
1958
+ const severity = ["none", "warning", "error"];
2349
1959
  for (const lintResult of lintResults) {
2350
1960
  if (lintResult.messages.length > 0) {
2351
1961
  console.log(chalk32.gray(`
2352
1962
  ${lintResult.filePath}`));
2353
1963
  for (const message of lintResult.messages) {
2354
- console.log(chalk32.gray(` ${message.line}:${message.column}`), chalk32[colors[message.severity]](` ${severity[message.severity]}`), chalk32.white(` ${message.message}`), chalk32.gray(` ${message.ruleId}`));
1964
+ console.log(
1965
+ chalk32.gray(` ${message.line}:${message.column}`),
1966
+ chalk32[colors[message.severity]](` ${severity[message.severity]}`),
1967
+ chalk32.white(` ${message.message}`),
1968
+ chalk32.gray(` ${message.ruleId}`)
1969
+ );
2355
1970
  }
2356
1971
  }
2357
1972
  }
2358
- }, "dumpMessages");
1973
+ };
2359
1974
  async function getRootESLintConfig() {
2360
1975
  const configPath = await findUp("eslint.config.mjs");
2361
1976
  if (configPath === void 0) {
@@ -2363,43 +1978,26 @@ async function getRootESLintConfig() {
2363
1978
  }
2364
1979
  return pathToFileURL(configPath);
2365
1980
  }
2366
- __name(getRootESLintConfig, "getRootESLintConfig");
2367
1981
  function getFiles(dir, ignoreFolders) {
2368
1982
  const currentDirectory = cwd4();
2369
1983
  const subDirectory = dir.split(currentDirectory)[1];
2370
1984
  if (ignoreFolders.includes(subDirectory)) return [];
2371
- return readdirSync(dir, {
2372
- withFileTypes: true
2373
- }).flatMap((dirent) => {
1985
+ return readdirSync(dir, { withFileTypes: true }).flatMap((dirent) => {
2374
1986
  const res = path10.resolve(dir, dirent.name);
2375
1987
  const relativePath = subDirectory === void 0 ? dirent.name : `${subDirectory}/${dirent.name}`;
2376
1988
  const ignoreMatchers = ignoreFolders.map((pattern) => picomatch(pattern));
2377
1989
  if (ignoreMatchers.some((isMatch) => isMatch(relativePath))) return [];
2378
- return dirent.isDirectory() ? getFiles(res, ignoreFolders) : [
2379
- res
2380
- ];
1990
+ return dirent.isDirectory() ? getFiles(res, ignoreFolders) : [res];
2381
1991
  });
2382
1992
  }
2383
- __name(getFiles, "getFiles");
2384
- var packageLint = /* @__PURE__ */ __name(async (fix2 = false, verbose = false, cache = true) => {
1993
+ var packageLint = async (fix2 = false, verbose = false, cache = true) => {
2385
1994
  const pkg = process.env.INIT_CWD;
2386
1995
  const configPath = await getRootESLintConfig();
2387
1996
  const { default: eslintConfig } = await import(configPath.href);
2388
1997
  const start = Date.now();
2389
- const ignoreFolders = [
2390
- "node_modules",
2391
- "dist",
2392
- "packages",
2393
- ".git",
2394
- "build",
2395
- ".yarn",
2396
- ".vscode",
2397
- ".github"
2398
- ];
1998
+ const ignoreFolders = ["node_modules", "dist", "packages", ".git", "build", ".yarn", ".vscode", ".github"];
2399
1999
  const engine = new ESLint({
2400
- baseConfig: [
2401
- ...eslintConfig
2402
- ],
2000
+ baseConfig: [...eslintConfig],
2403
2001
  fix: fix2,
2404
2002
  warnIgnored: false,
2405
2003
  cache
@@ -2418,33 +2016,35 @@ var packageLint = /* @__PURE__ */ __name(async (fix2 = false, verbose = false, c
2418
2016
  const lintTimeColor = lintTime < 1e3 ? "green" : lintTime < 3e3 ? "yellow" : "red";
2419
2017
  console.log(chalk32.white(`Linted ${chalk32[filesCountColor](files.length)} files in ${chalk32[lintTimeColor](lintTime)}ms`));
2420
2018
  return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
2421
- }, "packageLint");
2019
+ };
2422
2020
 
2423
2021
  // src/actions/package/publint.ts
2424
2022
  import { promises as fs4 } from "fs";
2425
2023
  import chalk33 from "chalk";
2426
2024
  import sortPackageJson from "sort-package-json";
2427
- var customPubLint = /* @__PURE__ */ __name((pkg) => {
2025
+ var customPubLint = (pkg) => {
2428
2026
  let errorCount = 0;
2429
2027
  let warningCount = 0;
2430
2028
  if (pkg.files === void 0) {
2431
- console.error(chalk33.yellow('Publint [custom]: "files" field is missing'));
2029
+ console.warn(chalk33.yellow('Publint [custom]: "files" field is missing'));
2432
2030
  warningCount++;
2433
2031
  }
2434
2032
  if (pkg.main !== void 0) {
2435
- console.error(chalk33.yellow('Publint [custom]: "main" field is deprecated, use "exports" instead'));
2033
+ console.warn(chalk33.yellow('Publint [custom]: "main" field is deprecated, use "exports" instead'));
2436
2034
  warningCount++;
2437
2035
  }
2438
2036
  if (pkg.sideEffects !== false) {
2439
- console.error(chalk33.yellow('Publint [custom]: "sideEffects" field should be set to false'));
2037
+ console.warn(chalk33.yellow('Publint [custom]: "sideEffects" field should be set to false'));
2038
+ warningCount++;
2039
+ }
2040
+ if (pkg.resolutions !== void 0) {
2041
+ console.warn(chalk33.yellow('Publint [custom]: "resolutions" in use'));
2042
+ console.warn(chalk33.gray(JSON.stringify(pkg.resolutions, null, 2)));
2440
2043
  warningCount++;
2441
2044
  }
2442
- return [
2443
- errorCount,
2444
- warningCount
2445
- ];
2446
- }, "customPubLint");
2447
- var packagePublint = /* @__PURE__ */ __name(async ({ strict = true, verbose = false } = {}) => {
2045
+ return [errorCount, warningCount];
2046
+ };
2047
+ var packagePublint = async ({ strict = true, verbose = false } = {}) => {
2448
2048
  const pkgDir = process.env.INIT_CWD;
2449
2049
  const sortedPkg = sortPackageJson(await fs4.readFile(`${pkgDir}/package.json`, "utf8"));
2450
2050
  await fs4.writeFile(`${pkgDir}/package.json`, sortedPkg);
@@ -2479,73 +2079,41 @@ var packagePublint = /* @__PURE__ */ __name(async ({ strict = true, verbose = fa
2479
2079
  console.log(chalk33.gray(`Publint [Finish]: ${pkgDir} [${messages.length + errorCount + warningCount} messages]`));
2480
2080
  }
2481
2081
  return messages.filter((message) => message.type === "error").length + errorCount;
2482
- }, "packagePublint");
2082
+ };
2483
2083
 
2484
2084
  // src/actions/package/recompile.ts
2485
- var packageRecompile = /* @__PURE__ */ __name(async () => {
2085
+ var packageRecompile = async () => {
2486
2086
  return await packageClean() || await packageCompile();
2487
- }, "packageRecompile");
2087
+ };
2488
2088
 
2489
2089
  // src/actions/publint.ts
2490
- var publint = /* @__PURE__ */ __name(async ({ verbose, pkg }) => {
2491
- return pkg === void 0 ? publintAll({
2492
- verbose
2493
- }) : await publintPackage({
2494
- pkg,
2495
- verbose
2496
- });
2497
- }, "publint");
2498
- var publintPackage = /* @__PURE__ */ __name(({ pkg }) => {
2499
- return runStepsAsync(`Publint [${pkg}]`, [
2500
- [
2501
- "yarn",
2502
- [
2503
- "workspace",
2504
- pkg,
2505
- "run",
2506
- "package-publint"
2507
- ]
2508
- ]
2509
- ]);
2510
- }, "publintPackage");
2511
- var publintAll = /* @__PURE__ */ __name(({ verbose }) => {
2512
- const verboseOptions = verbose ? [
2513
- "--verbose"
2514
- ] : [
2515
- "--no-verbose"
2516
- ];
2517
- return runSteps("Publint", [
2518
- [
2519
- "yarn",
2520
- [
2521
- "workspaces",
2522
- "foreach",
2523
- "-pA",
2524
- ...verboseOptions,
2525
- "run",
2526
- "package-publint"
2527
- ]
2528
- ]
2529
- ]);
2530
- }, "publintAll");
2090
+ var publint = async ({ verbose, pkg }) => {
2091
+ return pkg === void 0 ? publintAll({ verbose }) : await publintPackage({ pkg, verbose });
2092
+ };
2093
+ var publintPackage = ({ pkg }) => {
2094
+ return runStepsAsync(`Publint [${pkg}]`, [["yarn", ["workspace", pkg, "run", "package-publint"]]]);
2095
+ };
2096
+ var publintAll = ({ verbose }) => {
2097
+ const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
2098
+ return runSteps("Publint", [["yarn", ["workspaces", "foreach", "-pA", ...verboseOptions, "run", "package-publint"]]]);
2099
+ };
2531
2100
 
2532
2101
  // src/actions/rebuild.ts
2533
- var rebuild = /* @__PURE__ */ __name(({ target }) => {
2102
+ var rebuild = ({ target }) => {
2534
2103
  return runSteps("Rebuild", [
2535
- [
2536
- "yarn",
2537
- "xy clean"
2538
- ],
2539
- [
2540
- "yarn",
2541
- target ? `xy build -t ${target}` : "xy build"
2542
- ]
2104
+ ["yarn", "xy clean"],
2105
+ ["yarn", target ? `xy build -t ${target}` : "xy build"]
2543
2106
  ]);
2544
- }, "rebuild");
2107
+ };
2545
2108
 
2546
2109
  // src/actions/recompile.ts
2547
2110
  import chalk34 from "chalk";
2548
- var recompile = /* @__PURE__ */ __name(async ({ verbose, target, pkg, incremental }) => {
2111
+ var recompile = async ({
2112
+ verbose,
2113
+ target,
2114
+ pkg,
2115
+ incremental
2116
+ }) => {
2549
2117
  return pkg ? await recompilePackage({
2550
2118
  pkg,
2551
2119
  target,
@@ -2555,49 +2123,25 @@ var recompile = /* @__PURE__ */ __name(async ({ verbose, target, pkg, incrementa
2555
2123
  target,
2556
2124
  verbose
2557
2125
  });
2558
- }, "recompile");
2559
- var recompilePackage = /* @__PURE__ */ __name(({ target, pkg }) => {
2560
- const targetOptions = target ? [
2561
- "-t",
2562
- target
2563
- ] : [];
2564
- return runStepsAsync(`Recompile [${pkg}]`, [
2565
- [
2566
- "yarn",
2567
- [
2568
- "workspace",
2569
- pkg,
2570
- "run",
2571
- "package-recompile",
2572
- ...targetOptions
2573
- ]
2574
- ]
2575
- ]);
2576
- }, "recompilePackage");
2577
- var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, incremental }) => {
2126
+ };
2127
+ var recompilePackage = ({ target, pkg }) => {
2128
+ const targetOptions = target ? ["-t", target] : [];
2129
+ return runStepsAsync(
2130
+ `Recompile [${pkg}]`,
2131
+ [["yarn", ["workspace", pkg, "run", "package-recompile", ...targetOptions]]]
2132
+ );
2133
+ };
2134
+ var recompileAll = async ({
2135
+ jobs,
2136
+ verbose,
2137
+ target,
2138
+ incremental
2139
+ }) => {
2578
2140
  const start = Date.now();
2579
- const verboseOptions = verbose ? [
2580
- "--verbose"
2581
- ] : [
2582
- "--no-verbose"
2583
- ];
2584
- const targetOptions = target ? [
2585
- "-t",
2586
- target
2587
- ] : [];
2588
- const incrementalOptions = incremental ? [
2589
- "--since",
2590
- "-Apt",
2591
- "--topological-dev"
2592
- ] : [
2593
- "--parallel",
2594
- "-Apt",
2595
- "--topological-dev"
2596
- ];
2597
- const jobsOptions = jobs ? [
2598
- "-j",
2599
- `${jobs}`
2600
- ] : [];
2141
+ const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
2142
+ const targetOptions = target ? ["-t", target] : [];
2143
+ const incrementalOptions = incremental ? ["--since", "-Apt", "--topological-dev"] : ["--parallel", "-Apt", "--topological-dev"];
2144
+ const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
2601
2145
  if (jobs) {
2602
2146
  console.log(chalk34.blue(`Jobs set to [${jobs}]`));
2603
2147
  }
@@ -2629,13 +2173,19 @@ var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, increm
2629
2173
  ]
2630
2174
  ]
2631
2175
  ]);
2632
- console.log(`${chalk34.gray("Recompiled in")} [${chalk34.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk34.gray("seconds")}`);
2176
+ console.log(
2177
+ `${chalk34.gray("Recompiled in")} [${chalk34.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk34.gray("seconds")}`
2178
+ );
2633
2179
  return result;
2634
- }, "recompileAll");
2180
+ };
2635
2181
 
2636
2182
  // src/actions/reinstall.ts
2637
- import { closeSync, openSync, rmSync } from "fs";
2638
- var reinstall = /* @__PURE__ */ __name(() => {
2183
+ import {
2184
+ closeSync,
2185
+ openSync,
2186
+ rmSync
2187
+ } from "fs";
2188
+ var reinstall = () => {
2639
2189
  console.log("Reinstall [Clear Lock File]");
2640
2190
  closeSync(openSync("./yarn.lock", "w"));
2641
2191
  console.log("Reinstall [Clear Node Modules]");
@@ -2643,10 +2193,7 @@ var reinstall = /* @__PURE__ */ __name(() => {
2643
2193
  const result = workspaces.map(({ location, name }) => {
2644
2194
  const dist = `${location}/node_modules`;
2645
2195
  try {
2646
- rmSync(dist, {
2647
- force: true,
2648
- recursive: true
2649
- });
2196
+ rmSync(dist, { force: true, recursive: true });
2650
2197
  return 0;
2651
2198
  } catch (ex) {
2652
2199
  const error = ex;
@@ -2654,573 +2201,605 @@ var reinstall = /* @__PURE__ */ __name(() => {
2654
2201
  return 1;
2655
2202
  }
2656
2203
  }).reduce((prev, result2) => prev || result2, 0);
2657
- return result || runSteps("Reinstall", [
2658
- [
2659
- "yarn",
2660
- "install --network-timeout 10000"
2661
- ]
2662
- ]);
2663
- }, "reinstall");
2204
+ return result || runSteps("Reinstall", [["yarn", "install --network-timeout 10000"]]);
2205
+ };
2664
2206
 
2665
2207
  // src/actions/relint.ts
2666
2208
  import chalk35 from "chalk";
2667
- var relintPackage = /* @__PURE__ */ __name(({ pkg }) => {
2209
+ var relintPackage = ({ pkg }) => {
2668
2210
  console.log(chalk35.gray(`${"Relint"} [All-Packages]`));
2669
2211
  const start = Date.now();
2670
2212
  const result = runSteps("Relint [All-Packages]", [
2671
- [
2672
- "yarn",
2673
- [
2674
- "workspace",
2675
- pkg,
2676
- "run",
2677
- "package-relint"
2678
- ]
2679
- ]
2213
+ ["yarn", [
2214
+ "workspace",
2215
+ pkg,
2216
+ "run",
2217
+ "package-relint"
2218
+ ]]
2680
2219
  ]);
2681
2220
  console.log(chalk35.gray(`${"Relinted in"} [${chalk35.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk35.gray("seconds")}`));
2682
2221
  return result;
2683
- }, "relintPackage");
2684
- var relint = /* @__PURE__ */ __name(({ pkg, verbose, incremental } = {}) => {
2685
- return pkg ? relintPackage({
2686
- pkg
2687
- }) : relintAllPackages({
2688
- verbose,
2689
- incremental
2690
- });
2691
- }, "relint");
2692
- var relintAllPackages = /* @__PURE__ */ __name(({ verbose = false, incremental } = {}) => {
2222
+ };
2223
+ var relint = ({
2224
+ pkg,
2225
+ verbose,
2226
+ incremental
2227
+ } = {}) => {
2228
+ return pkg ? relintPackage({ pkg }) : relintAllPackages({ verbose, incremental });
2229
+ };
2230
+ var relintAllPackages = ({ verbose = false, incremental } = {}) => {
2693
2231
  console.log(chalk35.gray(`${"Relint"} [All-Packages]`));
2694
2232
  const start = Date.now();
2695
- const verboseOptions = verbose ? [
2696
- "--verbose"
2697
- ] : [
2698
- "--no-verbose"
2699
- ];
2700
- const incrementalOptions = incremental ? [
2701
- "--since",
2702
- "-Ap"
2703
- ] : [
2704
- "--parallel",
2705
- "-Ap"
2706
- ];
2233
+ const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
2234
+ const incrementalOptions = incremental ? ["--since", "-Ap"] : ["--parallel", "-Ap"];
2707
2235
  const result = runSteps(`${"Relint"} [All-Packages]`, [
2708
- [
2709
- "yarn",
2710
- [
2711
- "workspaces",
2712
- "foreach",
2713
- ...verboseOptions,
2714
- ...incrementalOptions,
2715
- "run",
2716
- "package-relint"
2717
- ]
2718
- ]
2236
+ ["yarn", [
2237
+ "workspaces",
2238
+ "foreach",
2239
+ ...verboseOptions,
2240
+ ...incrementalOptions,
2241
+ "run",
2242
+ "package-relint"
2243
+ ]]
2719
2244
  ]);
2720
2245
  console.log(chalk35.gray(`Relinted in [${chalk35.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk35.gray("seconds")}`));
2721
2246
  return result;
2722
- }, "relintAllPackages");
2247
+ };
2723
2248
 
2724
2249
  // src/actions/retest.ts
2725
- var retest = /* @__PURE__ */ __name(() => {
2250
+ var retest = () => {
2726
2251
  return runSteps("Test", [
2727
- [
2728
- "yarn",
2729
- [
2730
- "jest",
2731
- "--clearCache"
2732
- ]
2733
- ],
2734
- [
2735
- "yarn",
2736
- [
2737
- "jest",
2738
- "."
2739
- ]
2740
- ]
2252
+ ["yarn", ["jest", "--clearCache"]],
2253
+ ["yarn", ["jest", "."]]
2741
2254
  ]);
2742
- }, "retest");
2255
+ };
2743
2256
 
2744
2257
  // src/actions/sonar.ts
2745
- var sonar = /* @__PURE__ */ __name(() => {
2746
- return runSteps("Sonar", [
2747
- [
2748
- "yarn",
2749
- [
2750
- "eslint",
2751
- "-c",
2752
- "sonar.eslintrc",
2753
- "."
2754
- ]
2755
- ]
2756
- ]);
2757
- }, "sonar");
2258
+ var sonar = () => {
2259
+ return runSteps("Sonar", [["yarn", ["eslint", "-c", "sonar.eslintrc", "."]]]);
2260
+ };
2758
2261
 
2759
2262
  // src/actions/statics.ts
2760
2263
  import chalk36 from "chalk";
2761
- var DefaultDependencies = [
2762
- "axios",
2763
- "@xylabs/pixel",
2764
- "react",
2765
- "graphql",
2766
- "react-router",
2767
- "@mui/material",
2768
- "@mui/system"
2769
- ];
2770
- var statics = /* @__PURE__ */ __name(() => {
2264
+ var DefaultDependencies = ["axios", "@xylabs/pixel", "react", "graphql", "react-router", "@mui/material", "@mui/system"];
2265
+ var statics = () => {
2771
2266
  console.log(chalk36.green("Check Required Static Dependencies"));
2772
2267
  const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
2773
2268
  return detectDuplicateDependencies(statics2, DefaultDependencies);
2774
- }, "statics");
2269
+ };
2775
2270
 
2776
2271
  // src/actions/test.ts
2777
- var test = /* @__PURE__ */ __name(() => {
2778
- return runSteps("Test", [
2779
- [
2780
- "yarn",
2781
- [
2782
- "vitest",
2783
- "."
2784
- ]
2785
- ]
2786
- ]);
2787
- }, "test");
2272
+ var test = () => {
2273
+ return runSteps("Test", [["yarn", ["vitest", "."]]]);
2274
+ };
2788
2275
 
2789
2276
  // src/actions/up.ts
2790
- var up = /* @__PURE__ */ __name(() => {
2791
- return runSteps("Up", [
2792
- [
2793
- "yarn",
2794
- "outdated"
2795
- ]
2796
- ]);
2797
- }, "up");
2277
+ var up = () => {
2278
+ return runSteps("Up", [["yarn", "outdated"]]);
2279
+ };
2798
2280
 
2799
2281
  // src/actions/updo.ts
2800
- var updo = /* @__PURE__ */ __name(() => {
2282
+ var updo = () => {
2801
2283
  return runSteps("Updo", [
2802
- [
2803
- "yarn",
2804
- "install"
2805
- ],
2806
- [
2807
- "yarn",
2808
- "upgrade-interactive"
2809
- ],
2810
- [
2811
- "yarn",
2812
- "dedupe"
2813
- ]
2284
+ ["yarn", "install"],
2285
+ ["yarn", "upgrade-interactive"],
2286
+ ["yarn", "dedupe"]
2814
2287
  ]);
2815
- }, "updo");
2288
+ };
2816
2289
 
2817
2290
  // src/actions/upplug.ts
2818
- var updateYarnPlugins = /* @__PURE__ */ __name(() => {
2291
+ var updateYarnPlugins = () => {
2819
2292
  return runSteps("Update Yarn Plugins", [
2820
- [
2821
- "yarn",
2822
- [
2823
- "plugin",
2824
- "import",
2825
- "https://mskelton.dev/yarn-outdated/v3"
2826
- ]
2827
- ],
2828
- [
2829
- "yarn",
2830
- [
2831
- "plugin",
2832
- "import",
2833
- "version"
2834
- ]
2835
- ],
2836
- [
2837
- "yarn",
2838
- [
2839
- "plugin",
2840
- "import",
2841
- "interactive-tools"
2842
- ]
2843
- ],
2844
- [
2845
- "yarn",
2846
- [
2847
- "plugin",
2848
- "import",
2849
- "workspace-tools"
2850
- ]
2851
- ]
2293
+ ["yarn", ["plugin", "import", "https://mskelton.dev/yarn-outdated/v3"]],
2294
+ ["yarn", ["plugin", "import", "version"]],
2295
+ ["yarn", ["plugin", "import", "interactive-tools"]],
2296
+ ["yarn", ["plugin", "import", "workspace-tools"]]
2852
2297
  ]);
2853
- }, "updateYarnPlugins");
2298
+ };
2854
2299
 
2855
2300
  // src/actions/upyarn.ts
2856
- var updateYarnVersion = /* @__PURE__ */ __name(() => {
2857
- return runSteps("Update Yarn Version", [
2858
- [
2859
- "yarn",
2860
- [
2861
- "set",
2862
- "version",
2863
- "latest"
2864
- ]
2865
- ]
2866
- ]);
2867
- }, "updateYarnVersion");
2301
+ var updateYarnVersion = () => {
2302
+ return runSteps("Update Yarn Version", [["yarn", ["set", "version", "latest"]]]);
2303
+ };
2868
2304
 
2869
2305
  // src/actions/yarn3only.ts
2870
- var yarn3Only = /* @__PURE__ */ __name(() => {
2306
+ var yarn3Only = () => {
2871
2307
  const [valid, version] = isYarnVersionOrGreater(3);
2872
2308
  if (!valid) {
2873
2309
  processEx(`Invalid Yarn version [${version}]`);
2874
2310
  }
2875
2311
  return 0;
2876
- }, "yarn3Only");
2312
+ };
2877
2313
 
2878
2314
  // src/loadPackageConfig.ts
2879
2315
  import { readFile } from "fs/promises";
2880
- var loadPackageConfig = /* @__PURE__ */ __name(async () => {
2316
+ var loadPackageConfig = async () => {
2881
2317
  const pkg = process.env.INIT_CWD;
2882
- const pkgConfig = await readFile(`${pkg}/package.json`, {
2883
- encoding: "utf8"
2884
- });
2318
+ const pkgConfig = await readFile(`${pkg}/package.json`, { encoding: "utf8" });
2885
2319
  return JSON.parse(pkgConfig);
2886
- }, "loadPackageConfig");
2320
+ };
2887
2321
 
2888
2322
  // src/xy/xy.ts
2889
2323
  import chalk38 from "chalk";
2890
2324
 
2891
2325
  // src/xy/xyBuildCommands.ts
2892
- var xyBuildCommands = /* @__PURE__ */ __name((args) => {
2893
- return args.command("build [package]", "Build - Compile & Lint", (yargs2) => {
2894
- return yargs2.positional("package", {
2895
- describe: "Specific package to build"
2896
- });
2897
- }, async (argv) => {
2898
- if (argv.verbose) {
2899
- console.log(`Building: ${argv.package ?? "all"}`);
2900
- }
2901
- process.exitCode = await build({
2902
- incremental: !!argv.incremental,
2903
- jobs: argv.jobs,
2904
- pkg: argv.package,
2905
- target: argv.target,
2906
- verbose: !!argv.verbose
2907
- });
2908
- }).command("compile [package]", "Compile with Typescript & Copy Images", (yargs2) => {
2909
- return yargs2.positional("package", {
2910
- describe: "Specific package to compile"
2911
- });
2912
- }, (argv) => {
2913
- if (argv.verbose) {
2914
- console.log(`Compiling: ${argv.package ?? "all"}`);
2915
- }
2916
- process.exitCode = compile({
2917
- incremental: !!argv.incremental,
2918
- jobs: argv.jobs,
2919
- pkg: argv.package,
2920
- target: argv.target,
2921
- verbose: !!argv.verbose
2922
- });
2923
- }).command("compile-only [package]", "Compile with Typescript & Copy Images (No Publint)", (yargs2) => {
2924
- return yargs2.positional("package", {
2925
- describe: "Specific package to compile"
2926
- });
2927
- }, (argv) => {
2928
- if (argv.verbose) {
2929
- console.log(`Compiling: ${argv.package ?? "all"}`);
2930
- }
2931
- process.exitCode = compile({
2932
- incremental: !!argv.incremental,
2933
- jobs: argv.jobs,
2934
- pkg: argv.package,
2935
- publint: false,
2936
- target: argv.target,
2937
- verbose: !!argv.verbose
2938
- });
2939
- }).command("recompile [package]", "Re-compile with Typescript & Copy Images", (yargs2) => {
2940
- return yargs2.positional("package", {
2941
- describe: "Specific package to re-compile"
2942
- });
2943
- }, async (argv) => {
2944
- if (argv.verbose) {
2945
- console.log(`Re-compiling: ${argv.package ?? "all"}`);
2946
- }
2947
- process.exitCode = await recompile({
2948
- incremental: !!argv.incremental,
2949
- jobs: argv.jobs,
2950
- pkg: argv.package,
2951
- target: argv.target,
2952
- verbose: !!argv.verbose
2953
- });
2954
- }).command("rebuild [package]", "Rebuild - Clean, Compile & Lint", (yargs2) => {
2955
- return yargs2.positional("package", {
2956
- describe: "Specific package to rebuild"
2957
- });
2958
- }, (argv) => {
2959
- if (argv.verbose) console.log(`Rebuilding: ${argv.package ?? "all"}`);
2960
- process.exitCode = rebuild({
2961
- target: argv.target
2962
- });
2963
- }).command("copy-assets [package]", "Copy Assets - Copy the assets from src to dist", (yargs2) => {
2964
- return yargs2.positional("package", {
2965
- describe: "Specific package to copy assets"
2966
- });
2967
- }, async (argv) => {
2968
- if (argv.verbose) console.log(`Copying Assets: ${argv.package ?? "all"}`);
2969
- process.exitCode = await copyAssets({
2970
- target: argv.target
2971
- });
2972
- });
2973
- }, "xyBuildCommands");
2326
+ var xyBuildCommands = (args) => {
2327
+ return args.command(
2328
+ "build [package]",
2329
+ "Build - Compile & Lint",
2330
+ (yargs2) => {
2331
+ return yargs2.positional("package", { describe: "Specific package to build" });
2332
+ },
2333
+ async (argv) => {
2334
+ if (argv.verbose) {
2335
+ console.log(`Building: ${argv.package ?? "all"}`);
2336
+ }
2337
+ process.exitCode = await build({
2338
+ incremental: !!argv.incremental,
2339
+ jobs: argv.jobs,
2340
+ pkg: argv.package,
2341
+ target: argv.target,
2342
+ verbose: !!argv.verbose
2343
+ });
2344
+ }
2345
+ ).command(
2346
+ "compile [package]",
2347
+ "Compile with Typescript & Copy Images",
2348
+ (yargs2) => {
2349
+ return yargs2.positional("package", { describe: "Specific package to compile" });
2350
+ },
2351
+ (argv) => {
2352
+ if (argv.verbose) {
2353
+ console.log(`Compiling: ${argv.package ?? "all"}`);
2354
+ }
2355
+ process.exitCode = compile({
2356
+ incremental: !!argv.incremental,
2357
+ jobs: argv.jobs,
2358
+ pkg: argv.package,
2359
+ target: argv.target,
2360
+ verbose: !!argv.verbose
2361
+ });
2362
+ }
2363
+ ).command(
2364
+ "compile-only [package]",
2365
+ "Compile with Typescript & Copy Images (No Publint)",
2366
+ (yargs2) => {
2367
+ return yargs2.positional("package", { describe: "Specific package to compile" });
2368
+ },
2369
+ (argv) => {
2370
+ if (argv.verbose) {
2371
+ console.log(`Compiling: ${argv.package ?? "all"}`);
2372
+ }
2373
+ process.exitCode = compile({
2374
+ incremental: !!argv.incremental,
2375
+ jobs: argv.jobs,
2376
+ pkg: argv.package,
2377
+ publint: false,
2378
+ target: argv.target,
2379
+ verbose: !!argv.verbose
2380
+ });
2381
+ }
2382
+ ).command(
2383
+ "recompile [package]",
2384
+ "Re-compile with Typescript & Copy Images",
2385
+ (yargs2) => {
2386
+ return yargs2.positional("package", { describe: "Specific package to re-compile" });
2387
+ },
2388
+ async (argv) => {
2389
+ if (argv.verbose) {
2390
+ console.log(`Re-compiling: ${argv.package ?? "all"}`);
2391
+ }
2392
+ process.exitCode = await recompile({
2393
+ incremental: !!argv.incremental,
2394
+ jobs: argv.jobs,
2395
+ pkg: argv.package,
2396
+ target: argv.target,
2397
+ verbose: !!argv.verbose
2398
+ });
2399
+ }
2400
+ ).command(
2401
+ "rebuild [package]",
2402
+ "Rebuild - Clean, Compile & Lint",
2403
+ (yargs2) => {
2404
+ return yargs2.positional("package", { describe: "Specific package to rebuild" });
2405
+ },
2406
+ (argv) => {
2407
+ if (argv.verbose) console.log(`Rebuilding: ${argv.package ?? "all"}`);
2408
+ process.exitCode = rebuild({ target: argv.target });
2409
+ }
2410
+ ).command(
2411
+ "copy-assets [package]",
2412
+ "Copy Assets - Copy the assets from src to dist",
2413
+ (yargs2) => {
2414
+ return yargs2.positional("package", { describe: "Specific package to copy assets" });
2415
+ },
2416
+ async (argv) => {
2417
+ if (argv.verbose) console.log(`Copying Assets: ${argv.package ?? "all"}`);
2418
+ process.exitCode = await copyAssets({ target: argv.target });
2419
+ }
2420
+ );
2421
+ };
2974
2422
 
2975
2423
  // src/xy/param.ts
2976
- var packagePositionalParam = /* @__PURE__ */ __name((yargs2) => {
2977
- return yargs2.positional("package", {
2978
- describe: "Specific package to target",
2979
- type: "string"
2980
- });
2981
- }, "packagePositionalParam");
2424
+ var packagePositionalParam = (yargs2) => {
2425
+ return yargs2.positional("package", { describe: "Specific package to target", type: "string" });
2426
+ };
2982
2427
 
2983
2428
  // src/xy/xyCommonCommands.ts
2984
- var xyCommonCommands = /* @__PURE__ */ __name((args) => {
2985
- return args.command("license [package]", "License - Check licenses of dependencies", (yargs2) => {
2986
- return packagePositionalParam(yargs2);
2987
- }, async (argv) => {
2988
- if (argv.verbose) console.log(`License: ${argv.package ?? "all"}`);
2989
- process.exitCode = await license();
2990
- }).command("dead [package]", "Dead - Check for dead code", (yargs2) => {
2991
- return packagePositionalParam(yargs2);
2992
- }, (argv) => {
2993
- if (argv.verbose) console.log("Dead");
2994
- process.exitCode = dead();
2995
- }).command("gen-docs [package]", "GenDocs - Generate TypeDocs", (yargs2) => {
2996
- return packagePositionalParam(yargs2);
2997
- }, (argv) => {
2998
- if (argv.verbose) console.log(`Generating TypeDocs: ${argv.package ?? "all"}`);
2999
- process.exitCode = genDocs({
3000
- incremental: !!argv.incremental,
3001
- pkg: argv.package
3002
- });
3003
- }).command("clean-docs", "CleanDocs - Clean TypeDocs", (yargs2) => yargs2, (argv) => {
3004
- if (argv.verbose) console.log("Cleaning TypeDocs: all");
3005
- process.exitCode = cleanDocs();
3006
- }).command("gitlint [package]", "Gitlint - Lint your git config", (yargs2) => {
3007
- return yargs2;
3008
- }, (argv) => {
3009
- if (argv.verbose) console.log("Gitlint");
3010
- process.exitCode = argv.fix ? gitlintFix() : gitlint();
3011
- }).command("gitignore-gen", "GitIgnore Gen - Generate .gitignore files", (yargs2) => {
3012
- return yargs2;
3013
- }, (argv) => {
3014
- if (argv.verbose) console.log("GitIgnore Gen");
3015
- process.exitCode = gitignoreGen();
3016
- }).command("npmignore-gen", "NpmIgnore Gen - Generate .npmignore files", (yargs2) => {
3017
- return yargs2;
3018
- }, (argv) => {
3019
- if (argv.verbose) console.log("NpmIgnore Gen");
3020
- process.exitCode = npmignoreGen();
3021
- }).command("retest", "Re-Test - Run Jest Tests with cleaned cache", (yargs2) => {
3022
- return yargs2;
3023
- }, (argv) => {
3024
- if (argv.verbose) console.log("Re-Testing");
3025
- process.exitCode = retest();
3026
- }).command("test", "Test - Run Jest Tests", (yargs2) => {
3027
- return yargs2;
3028
- }, (argv) => {
3029
- if (argv.verbose) console.log("Testing");
3030
- process.exitCode = test();
3031
- }).command("upplug", "UpPlug - Update Yarn Plugins", (yargs2) => {
3032
- return yargs2;
3033
- }, (argv) => {
3034
- if (argv.verbose) console.log("UpPlug");
3035
- process.exitCode = updateYarnPlugins();
3036
- }).command("upyarn", "UpYarn - Update Yarn Version", (yargs2) => {
3037
- return yargs2;
3038
- }, (argv) => {
3039
- if (argv.verbose) console.log("UpYarn");
3040
- process.exitCode = updateYarnVersion();
3041
- }).command("yarn3only", "Yarn3Only - Check if using Yarn v3", (yargs2) => {
3042
- return yargs2;
3043
- }, (argv) => {
3044
- if (argv.verbose) console.log("Yarn 3 Check");
3045
- process.exitCode = yarn3Only();
3046
- });
3047
- }, "xyCommonCommands");
2429
+ var xyCommonCommands = (args) => {
2430
+ return args.command(
2431
+ "license [package]",
2432
+ "License - Check licenses of dependencies",
2433
+ (yargs2) => {
2434
+ return packagePositionalParam(yargs2);
2435
+ },
2436
+ async (argv) => {
2437
+ if (argv.verbose) console.log(`License: ${argv.package ?? "all"}`);
2438
+ process.exitCode = await license();
2439
+ }
2440
+ ).command(
2441
+ "dead [package]",
2442
+ "Dead - Check for dead code",
2443
+ (yargs2) => {
2444
+ return packagePositionalParam(yargs2);
2445
+ },
2446
+ (argv) => {
2447
+ if (argv.verbose) console.log("Dead");
2448
+ process.exitCode = dead();
2449
+ }
2450
+ ).command(
2451
+ "gen-docs [package]",
2452
+ "GenDocs - Generate TypeDocs",
2453
+ (yargs2) => {
2454
+ return packagePositionalParam(yargs2);
2455
+ },
2456
+ (argv) => {
2457
+ if (argv.verbose) console.log(`Generating TypeDocs: ${argv.package ?? "all"}`);
2458
+ process.exitCode = genDocs({ incremental: !!argv.incremental, pkg: argv.package });
2459
+ }
2460
+ ).command(
2461
+ "clean-docs",
2462
+ "CleanDocs - Clean TypeDocs",
2463
+ (yargs2) => yargs2,
2464
+ (argv) => {
2465
+ if (argv.verbose) console.log("Cleaning TypeDocs: all");
2466
+ process.exitCode = cleanDocs();
2467
+ }
2468
+ ).command(
2469
+ "gitlint [package]",
2470
+ "Gitlint - Lint your git config",
2471
+ (yargs2) => {
2472
+ return yargs2;
2473
+ },
2474
+ (argv) => {
2475
+ if (argv.verbose) console.log("Gitlint");
2476
+ process.exitCode = argv.fix ? gitlintFix() : gitlint();
2477
+ }
2478
+ ).command(
2479
+ "gitignore-gen",
2480
+ "GitIgnore Gen - Generate .gitignore files",
2481
+ (yargs2) => {
2482
+ return yargs2;
2483
+ },
2484
+ (argv) => {
2485
+ if (argv.verbose) console.log("GitIgnore Gen");
2486
+ process.exitCode = gitignoreGen();
2487
+ }
2488
+ ).command(
2489
+ "npmignore-gen",
2490
+ "NpmIgnore Gen - Generate .npmignore files",
2491
+ (yargs2) => {
2492
+ return yargs2;
2493
+ },
2494
+ (argv) => {
2495
+ if (argv.verbose) console.log("NpmIgnore Gen");
2496
+ process.exitCode = npmignoreGen();
2497
+ }
2498
+ ).command(
2499
+ "retest",
2500
+ "Re-Test - Run Jest Tests with cleaned cache",
2501
+ (yargs2) => {
2502
+ return yargs2;
2503
+ },
2504
+ (argv) => {
2505
+ if (argv.verbose) console.log("Re-Testing");
2506
+ process.exitCode = retest();
2507
+ }
2508
+ ).command(
2509
+ "test",
2510
+ "Test - Run Jest Tests",
2511
+ (yargs2) => {
2512
+ return yargs2;
2513
+ },
2514
+ (argv) => {
2515
+ if (argv.verbose) console.log("Testing");
2516
+ process.exitCode = test();
2517
+ }
2518
+ ).command(
2519
+ "upplug",
2520
+ "UpPlug - Update Yarn Plugins",
2521
+ (yargs2) => {
2522
+ return yargs2;
2523
+ },
2524
+ (argv) => {
2525
+ if (argv.verbose) console.log("UpPlug");
2526
+ process.exitCode = updateYarnPlugins();
2527
+ }
2528
+ ).command(
2529
+ "upyarn",
2530
+ "UpYarn - Update Yarn Version",
2531
+ (yargs2) => {
2532
+ return yargs2;
2533
+ },
2534
+ (argv) => {
2535
+ if (argv.verbose) console.log("UpYarn");
2536
+ process.exitCode = updateYarnVersion();
2537
+ }
2538
+ ).command(
2539
+ "yarn3only",
2540
+ "Yarn3Only - Check if using Yarn v3",
2541
+ (yargs2) => {
2542
+ return yargs2;
2543
+ },
2544
+ (argv) => {
2545
+ if (argv.verbose) console.log("Yarn 3 Check");
2546
+ process.exitCode = yarn3Only();
2547
+ }
2548
+ );
2549
+ };
3048
2550
 
3049
2551
  // src/xy/xyDeployCommands.ts
3050
- var xyDeployCommands = /* @__PURE__ */ __name((args) => {
3051
- return args.command("deploy", "Deploy - Deploy patch", (yargs2) => {
3052
- return yargs2;
3053
- }, (argv) => {
3054
- if (argv.verbose) console.log("Deploy patch");
3055
- process.exitCode = deploy();
3056
- }).command("deploy-minor", "Deploy - Deploy minor", (yargs2) => {
3057
- return yargs2;
3058
- }, (argv) => {
3059
- if (argv.verbose) console.log("Deploy minor");
3060
- process.exitCode = deployMinor();
3061
- }).command("deploy-major", "Deploy - Deploy major", (yargs2) => {
3062
- return yargs2;
3063
- }, (argv) => {
3064
- if (argv.verbose) console.log("Deploy major");
3065
- process.exitCode = deployMajor();
3066
- }).command("deploy-next", "Deploy - Deploy next", (yargs2) => {
3067
- return yargs2;
3068
- }, (argv) => {
3069
- if (argv.verbose) console.log("Deploy next");
3070
- process.exitCode = deployNext();
3071
- });
3072
- }, "xyDeployCommands");
2552
+ var xyDeployCommands = (args) => {
2553
+ return args.command(
2554
+ "deploy",
2555
+ "Deploy - Deploy patch",
2556
+ (yargs2) => {
2557
+ return yargs2;
2558
+ },
2559
+ (argv) => {
2560
+ if (argv.verbose) console.log("Deploy patch");
2561
+ process.exitCode = deploy();
2562
+ }
2563
+ ).command(
2564
+ "deploy-minor",
2565
+ "Deploy - Deploy minor",
2566
+ (yargs2) => {
2567
+ return yargs2;
2568
+ },
2569
+ (argv) => {
2570
+ if (argv.verbose) console.log("Deploy minor");
2571
+ process.exitCode = deployMinor();
2572
+ }
2573
+ ).command(
2574
+ "deploy-major",
2575
+ "Deploy - Deploy major",
2576
+ (yargs2) => {
2577
+ return yargs2;
2578
+ },
2579
+ (argv) => {
2580
+ if (argv.verbose) console.log("Deploy major");
2581
+ process.exitCode = deployMajor();
2582
+ }
2583
+ ).command(
2584
+ "deploy-next",
2585
+ "Deploy - Deploy next",
2586
+ (yargs2) => {
2587
+ return yargs2;
2588
+ },
2589
+ (argv) => {
2590
+ if (argv.verbose) console.log("Deploy next");
2591
+ process.exitCode = deployNext();
2592
+ }
2593
+ );
2594
+ };
3073
2595
 
3074
2596
  // src/xy/xyInstallCommands.ts
3075
- var xyInstallCommands = /* @__PURE__ */ __name((args) => {
3076
- return args.command("clean [package]", "Clean", (yargs2) => {
3077
- return yargs2.positional("package", {
3078
- describe: "Specific package to clean"
3079
- });
3080
- }, async (argv) => {
3081
- if (argv.verbose) {
3082
- console.log(`Cleaning: ${argv.package ?? "all"}`);
2597
+ var xyInstallCommands = (args) => {
2598
+ return args.command(
2599
+ "clean [package]",
2600
+ "Clean",
2601
+ (yargs2) => {
2602
+ return yargs2.positional("package", { describe: "Specific package to clean" });
2603
+ },
2604
+ async (argv) => {
2605
+ if (argv.verbose) {
2606
+ console.log(`Cleaning: ${argv.package ?? "all"}`);
2607
+ }
2608
+ process.exitCode = await clean({
2609
+ pkg: argv.package,
2610
+ verbose: !!argv.verbose
2611
+ });
3083
2612
  }
3084
- process.exitCode = await clean({
3085
- pkg: argv.package,
3086
- verbose: !!argv.verbose
3087
- });
3088
- }).command("reinstall", "Reinstall - Clean & Install", (yargs2) => {
3089
- return yargs2;
3090
- }, (argv) => {
3091
- if (argv.verbose) console.log("Reinstalling");
3092
- process.exitCode = reinstall();
3093
- }).command("up", "Up - Update dependencies", (yargs2) => {
3094
- return yargs2;
3095
- }, (argv) => {
3096
- if (argv.verbose) console.log("Up");
3097
- process.exitCode = up();
3098
- }).command("updo", "Updo - Update dependencies [Interactive]", (yargs2) => {
3099
- return yargs2;
3100
- }, (argv) => {
3101
- if (argv.verbose) console.log("Updo");
3102
- process.exitCode = updo();
3103
- }).command("statics", "Statics - Confirming Static Packages", (yargs2) => {
3104
- return yargs2;
3105
- }, (argv) => {
3106
- if (argv.verbose) console.log("Statics");
3107
- process.exitCode = statics();
3108
- }).command("dupdeps", "Dupdeps - Duplicate Dependencies in package.json", (yargs2) => {
3109
- return yargs2;
3110
- }, (argv) => {
3111
- if (argv.verbose) console.log("Dupdeps");
3112
- process.exitCode = dupdeps();
3113
- });
3114
- }, "xyInstallCommands");
2613
+ ).command(
2614
+ "reinstall",
2615
+ "Reinstall - Clean & Install",
2616
+ (yargs2) => {
2617
+ return yargs2;
2618
+ },
2619
+ (argv) => {
2620
+ if (argv.verbose) console.log("Reinstalling");
2621
+ process.exitCode = reinstall();
2622
+ }
2623
+ ).command(
2624
+ "up",
2625
+ "Up - Update dependencies",
2626
+ (yargs2) => {
2627
+ return yargs2;
2628
+ },
2629
+ (argv) => {
2630
+ if (argv.verbose) console.log("Up");
2631
+ process.exitCode = up();
2632
+ }
2633
+ ).command(
2634
+ "updo",
2635
+ "Updo - Update dependencies [Interactive]",
2636
+ (yargs2) => {
2637
+ return yargs2;
2638
+ },
2639
+ (argv) => {
2640
+ if (argv.verbose) console.log("Updo");
2641
+ process.exitCode = updo();
2642
+ }
2643
+ ).command(
2644
+ "statics",
2645
+ "Statics - Confirming Static Packages",
2646
+ (yargs2) => {
2647
+ return yargs2;
2648
+ },
2649
+ (argv) => {
2650
+ if (argv.verbose) console.log("Statics");
2651
+ process.exitCode = statics();
2652
+ }
2653
+ ).command(
2654
+ "dupdeps",
2655
+ "Dupdeps - Duplicate Dependencies in package.json",
2656
+ (yargs2) => {
2657
+ return yargs2;
2658
+ },
2659
+ (argv) => {
2660
+ if (argv.verbose) console.log("Dupdeps");
2661
+ process.exitCode = dupdeps();
2662
+ }
2663
+ );
2664
+ };
3115
2665
 
3116
2666
  // src/xy/xyLintCommands.ts
3117
2667
  import chalk37 from "chalk";
3118
- var xyLintCommands = /* @__PURE__ */ __name((args) => {
3119
- return args.command("cycle [package]", "Cycle - Check for dependency cycles", (yargs2) => {
3120
- return packagePositionalParam(yargs2);
3121
- }, async (argv) => {
3122
- const start = Date.now();
3123
- if (argv.verbose) console.log("Cycle");
3124
- process.exitCode = await cycle({
3125
- pkg: argv.package
3126
- });
3127
- console.log(chalk37.blue(`Finished in ${Date.now() - start}ms`));
3128
- }).command("lint [package]", "Lint - Run Eslint", (yargs2) => {
3129
- return packagePositionalParam(yargs2).option("fix", {
3130
- alias: "f",
3131
- default: false,
3132
- description: "Fix fixable issues",
3133
- type: "boolean"
3134
- }).option("cache", {
3135
- alias: "c",
3136
- default: false,
3137
- description: "Use caching for performance",
3138
- type: "boolean"
3139
- });
3140
- }, (argv) => {
3141
- if (argv.verbose) console.log("Lint");
3142
- const start = Date.now();
3143
- process.exitCode = argv.fix ? fix({
3144
- pkg: argv.package,
3145
- cache: argv.cache
3146
- }) : lint({
3147
- pkg: argv.package,
3148
- cache: argv.cache
3149
- });
3150
- console.log(chalk37.blue(`Finished in ${Date.now() - start}ms`));
3151
- }).command("deplint [package]", "Deplint - Run Deplint", (yargs2) => {
3152
- return packagePositionalParam(yargs2).option("deps", {
3153
- alias: "d",
3154
- default: false,
3155
- description: "Check dependencies",
3156
- type: "boolean"
3157
- }).option("devDeps", {
3158
- alias: "v",
3159
- default: false,
3160
- description: "Check devDependencies",
3161
- type: "boolean"
3162
- }).option("peerDeps", {
3163
- alias: "p",
3164
- default: false,
3165
- description: "Check peerDependencies",
3166
- type: "boolean"
3167
- });
3168
- }, (argv) => {
3169
- if (argv.verbose) console.log("Deplint");
3170
- const start = Date.now();
3171
- process.exitCode = deplint({
3172
- pkg: argv.package,
3173
- deps: !!argv.deps,
3174
- devDeps: !!argv.devDeps,
3175
- peerDeps: !!argv.peerDeps,
3176
- verbose: !!argv.verbose
3177
- });
3178
- console.log(chalk37.blue(`Finished in ${Date.now() - start}ms`));
3179
- }).command("fix [package]", "Fix - Run Eslint w/fix", (yargs2) => {
3180
- return packagePositionalParam(yargs2);
3181
- }, (argv) => {
3182
- const start = Date.now();
3183
- if (argv.verbose) console.log("Fix");
3184
- process.exitCode = fix();
3185
- console.log(chalk37.blue(`Finished in ${Date.now() - start}ms`));
3186
- }).command("relint [package]", "Relint - Clean & Lint", (yargs2) => {
3187
- return packagePositionalParam(yargs2);
3188
- }, (argv) => {
3189
- if (argv.verbose) console.log("Relinting");
3190
- const start = Date.now();
3191
- process.exitCode = relint();
3192
- console.log(chalk37.blue(`Finished in ${Date.now() - start}ms`));
3193
- }).command("publint [package]", "Publint - Run Publint", (yargs2) => {
3194
- return packagePositionalParam(yargs2);
3195
- }, async (argv) => {
3196
- if (argv.verbose) console.log("Publint");
3197
- const start = Date.now();
3198
- process.exitCode = await publint({
3199
- pkg: argv.package,
3200
- verbose: !!argv.verbose
3201
- });
3202
- console.log(chalk37.blue(`Finished in ${Date.now() - start}ms`));
3203
- }).command("knip", "Knip - Run Knip", (yargs2) => {
3204
- return packagePositionalParam(yargs2);
3205
- }, (argv) => {
3206
- if (argv.verbose) console.log("Knip");
3207
- const start = Date.now();
3208
- process.exitCode = knip();
3209
- console.log(chalk37.blue(`Knip finished in ${Date.now() - start}ms`));
3210
- }).command("sonar", "Sonar - Run Sonar Check", (yargs2) => {
3211
- return packagePositionalParam(yargs2);
3212
- }, (argv) => {
3213
- const start = Date.now();
3214
- if (argv.verbose) console.log("Sonar Check");
3215
- process.exitCode = sonar();
3216
- console.log(chalk37.blue(`Finished in ${Date.now() - start}ms`));
3217
- });
3218
- }, "xyLintCommands");
2668
+ var xyLintCommands = (args) => {
2669
+ return args.command(
2670
+ "cycle [package]",
2671
+ "Cycle - Check for dependency cycles",
2672
+ (yargs2) => {
2673
+ return packagePositionalParam(yargs2);
2674
+ },
2675
+ async (argv) => {
2676
+ const start = Date.now();
2677
+ if (argv.verbose) console.log("Cycle");
2678
+ process.exitCode = await cycle({ pkg: argv.package });
2679
+ console.log(chalk37.blue(`Finished in ${Date.now() - start}ms`));
2680
+ }
2681
+ ).command(
2682
+ "lint [package]",
2683
+ "Lint - Run Eslint",
2684
+ (yargs2) => {
2685
+ return packagePositionalParam(yargs2).option("fix", {
2686
+ alias: "f",
2687
+ default: false,
2688
+ description: "Fix fixable issues",
2689
+ type: "boolean"
2690
+ }).option("cache", {
2691
+ alias: "c",
2692
+ default: false,
2693
+ description: "Use caching for performance",
2694
+ type: "boolean"
2695
+ });
2696
+ },
2697
+ (argv) => {
2698
+ if (argv.verbose) console.log("Lint");
2699
+ const start = Date.now();
2700
+ process.exitCode = argv.fix ? fix({ pkg: argv.package, cache: argv.cache }) : lint({ pkg: argv.package, cache: argv.cache });
2701
+ console.log(chalk37.blue(`Finished in ${Date.now() - start}ms`));
2702
+ }
2703
+ ).command(
2704
+ "deplint [package]",
2705
+ "Deplint - Run Deplint",
2706
+ (yargs2) => {
2707
+ return packagePositionalParam(yargs2).option("deps", {
2708
+ alias: "d",
2709
+ default: false,
2710
+ description: "Check dependencies",
2711
+ type: "boolean"
2712
+ }).option("devDeps", {
2713
+ alias: "v",
2714
+ default: false,
2715
+ description: "Check devDependencies",
2716
+ type: "boolean"
2717
+ }).option("peerDeps", {
2718
+ alias: "p",
2719
+ default: false,
2720
+ description: "Check peerDependencies",
2721
+ type: "boolean"
2722
+ });
2723
+ },
2724
+ (argv) => {
2725
+ if (argv.verbose) console.log("Deplint");
2726
+ const start = Date.now();
2727
+ process.exitCode = deplint({
2728
+ pkg: argv.package,
2729
+ deps: !!argv.deps,
2730
+ devDeps: !!argv.devDeps,
2731
+ peerDeps: !!argv.peerDeps,
2732
+ verbose: !!argv.verbose
2733
+ });
2734
+ console.log(chalk37.blue(`Finished in ${Date.now() - start}ms`));
2735
+ }
2736
+ ).command(
2737
+ "fix [package]",
2738
+ "Fix - Run Eslint w/fix",
2739
+ (yargs2) => {
2740
+ return packagePositionalParam(yargs2);
2741
+ },
2742
+ (argv) => {
2743
+ const start = Date.now();
2744
+ if (argv.verbose) console.log("Fix");
2745
+ process.exitCode = fix();
2746
+ console.log(chalk37.blue(`Finished in ${Date.now() - start}ms`));
2747
+ }
2748
+ ).command(
2749
+ "relint [package]",
2750
+ "Relint - Clean & Lint",
2751
+ (yargs2) => {
2752
+ return packagePositionalParam(yargs2);
2753
+ },
2754
+ (argv) => {
2755
+ if (argv.verbose) console.log("Relinting");
2756
+ const start = Date.now();
2757
+ process.exitCode = relint();
2758
+ console.log(chalk37.blue(`Finished in ${Date.now() - start}ms`));
2759
+ }
2760
+ ).command(
2761
+ "publint [package]",
2762
+ "Publint - Run Publint",
2763
+ (yargs2) => {
2764
+ return packagePositionalParam(yargs2);
2765
+ },
2766
+ async (argv) => {
2767
+ if (argv.verbose) console.log("Publint");
2768
+ const start = Date.now();
2769
+ process.exitCode = await publint({ pkg: argv.package, verbose: !!argv.verbose });
2770
+ console.log(chalk37.blue(`Finished in ${Date.now() - start}ms`));
2771
+ }
2772
+ ).command(
2773
+ "knip",
2774
+ "Knip - Run Knip",
2775
+ (yargs2) => {
2776
+ return packagePositionalParam(yargs2);
2777
+ },
2778
+ (argv) => {
2779
+ if (argv.verbose) console.log("Knip");
2780
+ const start = Date.now();
2781
+ process.exitCode = knip();
2782
+ console.log(chalk37.blue(`Knip finished in ${Date.now() - start}ms`));
2783
+ }
2784
+ ).command(
2785
+ "sonar",
2786
+ "Sonar - Run Sonar Check",
2787
+ (yargs2) => {
2788
+ return packagePositionalParam(yargs2);
2789
+ },
2790
+ (argv) => {
2791
+ const start = Date.now();
2792
+ if (argv.verbose) console.log("Sonar Check");
2793
+ process.exitCode = sonar();
2794
+ console.log(chalk37.blue(`Finished in ${Date.now() - start}ms`));
2795
+ }
2796
+ );
2797
+ };
3219
2798
 
3220
2799
  // src/xy/xyParseOptions.ts
3221
2800
  import yargs from "yargs";
3222
2801
  import { hideBin } from "yargs/helpers";
3223
- var xyParseOptions = /* @__PURE__ */ __name(() => {
2802
+ var xyParseOptions = () => {
3224
2803
  return yargs(hideBin(process.argv)).scriptName("yarn xy").option("jobs", {
3225
2804
  alias: "j",
3226
2805
  default: void 0,
@@ -3242,16 +2821,16 @@ var xyParseOptions = /* @__PURE__ */ __name(() => {
3242
2821
  description: "Profile action",
3243
2822
  type: "boolean"
3244
2823
  });
3245
- }, "xyParseOptions");
2824
+ };
3246
2825
 
3247
2826
  // src/xy/xy.ts
3248
- var xy = /* @__PURE__ */ __name(async () => {
2827
+ var xy = async () => {
3249
2828
  const options = xyParseOptions();
3250
2829
  return await xyBuildCommands(xyCommonCommands(xyInstallCommands(xyDeployCommands(xyLintCommands(options))))).demandCommand(1).command("*", "", () => {
3251
2830
  console.error(chalk38.yellow(`Command not found [${chalk38.magenta(process.argv[2])}]`));
3252
2831
  console.log(chalk38.gray("Try 'yarn xy --help' for list of commands"));
3253
2832
  }).version().help().argv;
3254
- }, "xy");
2833
+ };
3255
2834
  export {
3256
2835
  CROSS_PLATFORM_NEWLINE,
3257
2836
  DuplicateDetector,