@xylabs/ts-scripts-yarn3 6.3.4 → 6.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/dist/actions/build.mjs +39 -87
  2. package/dist/actions/build.mjs.map +1 -1
  3. package/dist/actions/clean-docs.mjs +8 -22
  4. package/dist/actions/clean-docs.mjs.map +1 -1
  5. package/dist/actions/clean-eslint.mjs +5 -11
  6. package/dist/actions/clean-eslint.mjs.map +1 -1
  7. package/dist/actions/clean-jest.mjs +16 -29
  8. package/dist/actions/clean-jest.mjs.map +1 -1
  9. package/dist/actions/clean.mjs +32 -63
  10. package/dist/actions/clean.mjs.map +1 -1
  11. package/dist/actions/compile-types.mjs +45 -68
  12. package/dist/actions/compile-types.mjs.map +1 -1
  13. package/dist/actions/compile.mjs +50 -76
  14. package/dist/actions/compile.mjs.map +1 -1
  15. package/dist/actions/copy-assets.mjs +23 -38
  16. package/dist/actions/copy-assets.mjs.map +1 -1
  17. package/dist/actions/cycle.mjs +28 -57
  18. package/dist/actions/cycle.mjs.map +1 -1
  19. package/dist/actions/dead.mjs +16 -31
  20. package/dist/actions/dead.mjs.map +1 -1
  21. package/dist/actions/deplint.mjs +191 -0
  22. package/dist/actions/deplint.mjs.map +1 -0
  23. package/dist/actions/deploy-major.mjs +20 -41
  24. package/dist/actions/deploy-major.mjs.map +1 -1
  25. package/dist/actions/deploy-minor.mjs +20 -41
  26. package/dist/actions/deploy-minor.mjs.map +1 -1
  27. package/dist/actions/deploy-next.mjs +20 -41
  28. package/dist/actions/deploy-next.mjs.map +1 -1
  29. package/dist/actions/deploy.mjs +20 -41
  30. package/dist/actions/deploy.mjs.map +1 -1
  31. package/dist/actions/dupdeps.mjs +26 -37
  32. package/dist/actions/dupdeps.mjs.map +1 -1
  33. package/dist/actions/fix.mjs +36 -50
  34. package/dist/actions/fix.mjs.map +1 -1
  35. package/dist/actions/gen-docs.mjs +25 -65
  36. package/dist/actions/gen-docs.mjs.map +1 -1
  37. package/dist/actions/gitignore-gen.mjs +28 -44
  38. package/dist/actions/gitignore-gen.mjs.map +1 -1
  39. package/dist/actions/gitlint-fix.mjs +5 -14
  40. package/dist/actions/gitlint-fix.mjs.map +1 -1
  41. package/dist/actions/gitlint.mjs +4 -7
  42. package/dist/actions/gitlint.mjs.map +1 -1
  43. package/dist/actions/index.mjs +860 -1237
  44. package/dist/actions/index.mjs.map +1 -1
  45. package/dist/actions/knip.mjs +16 -31
  46. package/dist/actions/knip.mjs.map +1 -1
  47. package/dist/actions/license.mjs +37 -51
  48. package/dist/actions/license.mjs.map +1 -1
  49. package/dist/actions/lint.mjs +33 -44
  50. package/dist/actions/lint.mjs.map +1 -1
  51. package/dist/actions/npmignore-gen.mjs +28 -44
  52. package/dist/actions/npmignore-gen.mjs.map +1 -1
  53. package/dist/actions/package/clean-outputs.mjs +6 -16
  54. package/dist/actions/package/clean-outputs.mjs.map +1 -1
  55. package/dist/actions/package/clean-typescript.mjs +6 -16
  56. package/dist/actions/package/clean-typescript.mjs.map +1 -1
  57. package/dist/actions/package/clean.mjs +12 -29
  58. package/dist/actions/package/clean.mjs.map +1 -1
  59. package/dist/actions/package/compile/buildEntries.mjs +7 -17
  60. package/dist/actions/package/compile/buildEntries.mjs.map +1 -1
  61. package/dist/actions/package/compile/compile.mjs +133 -169
  62. package/dist/actions/package/compile/compile.mjs.map +1 -1
  63. package/dist/actions/package/compile/compileTypes.mjs +43 -59
  64. package/dist/actions/package/compile/compileTypes.mjs.map +1 -1
  65. package/dist/actions/package/compile/copyTypeFiles.mjs +20 -23
  66. package/dist/actions/package/compile/copyTypeFiles.mjs.map +1 -1
  67. package/dist/actions/package/compile/deepMerge.mjs +0 -5
  68. package/dist/actions/package/compile/deepMerge.mjs.map +1 -1
  69. package/dist/actions/package/compile/getCompilerOptions.mjs +11 -10
  70. package/dist/actions/package/compile/getCompilerOptions.mjs.map +1 -1
  71. package/dist/actions/package/compile/index.mjs +133 -169
  72. package/dist/actions/package/compile/index.mjs.map +1 -1
  73. package/dist/actions/package/compile/inputs.mjs +3 -8
  74. package/dist/actions/package/compile/inputs.mjs.map +1 -1
  75. package/dist/actions/package/compile/packageCompileTsc.mjs +37 -52
  76. package/dist/actions/package/compile/packageCompileTsc.mjs.map +1 -1
  77. package/dist/actions/package/compile/packageCompileTscTypes.mjs +37 -52
  78. package/dist/actions/package/compile/packageCompileTscTypes.mjs.map +1 -1
  79. package/dist/actions/package/compile/packageCompileTsup.mjs +127 -163
  80. package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -1
  81. package/dist/actions/package/copy-assets.mjs +12 -21
  82. package/dist/actions/package/copy-assets.mjs.map +1 -1
  83. package/dist/actions/package/cycle.mjs +5 -14
  84. package/dist/actions/package/cycle.mjs.map +1 -1
  85. package/dist/actions/package/gen-docs.mjs +11 -12
  86. package/dist/actions/package/gen-docs.mjs.map +1 -1
  87. package/dist/actions/package/index.mjs +191 -271
  88. package/dist/actions/package/index.mjs.map +1 -1
  89. package/dist/actions/package/lint.mjs +16 -39
  90. package/dist/actions/package/lint.mjs.map +1 -1
  91. package/dist/actions/package/publint.mjs +4 -7
  92. package/dist/actions/package/publint.mjs.map +1 -1
  93. package/dist/actions/package/recompile.mjs +147 -197
  94. package/dist/actions/package/recompile.mjs.map +1 -1
  95. package/dist/actions/publint.mjs +37 -71
  96. package/dist/actions/publint.mjs.map +1 -1
  97. package/dist/actions/rebuild.mjs +17 -29
  98. package/dist/actions/rebuild.mjs.map +1 -1
  99. package/dist/actions/recompile.mjs +50 -67
  100. package/dist/actions/recompile.mjs.map +1 -1
  101. package/dist/actions/reinstall.mjs +25 -43
  102. package/dist/actions/reinstall.mjs.map +1 -1
  103. package/dist/actions/relint.mjs +40 -63
  104. package/dist/actions/relint.mjs.map +1 -1
  105. package/dist/actions/retest.mjs +17 -35
  106. package/dist/actions/retest.mjs.map +1 -1
  107. package/dist/actions/sonar.mjs +16 -32
  108. package/dist/actions/sonar.mjs.map +1 -1
  109. package/dist/actions/statics.mjs +27 -46
  110. package/dist/actions/statics.mjs.map +1 -1
  111. package/dist/actions/test.mjs +16 -30
  112. package/dist/actions/test.mjs.map +1 -1
  113. package/dist/actions/up.mjs +16 -27
  114. package/dist/actions/up.mjs.map +1 -1
  115. package/dist/actions/updo.mjs +18 -33
  116. package/dist/actions/updo.mjs.map +1 -1
  117. package/dist/actions/upplug.mjs +19 -53
  118. package/dist/actions/upplug.mjs.map +1 -1
  119. package/dist/actions/upyarn.mjs +16 -31
  120. package/dist/actions/upyarn.mjs.map +1 -1
  121. package/dist/actions/yarn3only.mjs +12 -23
  122. package/dist/actions/yarn3only.mjs.map +1 -1
  123. package/dist/bin/package/build-only.mjs +134 -172
  124. package/dist/bin/package/build-only.mjs.map +1 -1
  125. package/dist/bin/package/build.mjs +134 -172
  126. package/dist/bin/package/build.mjs.map +1 -1
  127. package/dist/bin/package/clean-outputs.mjs +6 -15
  128. package/dist/bin/package/clean-outputs.mjs.map +1 -1
  129. package/dist/bin/package/clean-typescript.mjs +6 -15
  130. package/dist/bin/package/clean-typescript.mjs.map +1 -1
  131. package/dist/bin/package/clean.mjs +12 -28
  132. package/dist/bin/package/clean.mjs.map +1 -1
  133. package/dist/bin/package/compile-only.mjs +134 -172
  134. package/dist/bin/package/compile-only.mjs.map +1 -1
  135. package/dist/bin/package/compile-tsup.mjs +128 -165
  136. package/dist/bin/package/compile-tsup.mjs.map +1 -1
  137. package/dist/bin/package/compile-types.mjs +44 -61
  138. package/dist/bin/package/compile-types.mjs.map +1 -1
  139. package/dist/bin/package/compile.mjs +134 -171
  140. package/dist/bin/package/compile.mjs.map +1 -1
  141. package/dist/bin/package/copy-assets-cjs.mjs +13 -23
  142. package/dist/bin/package/copy-assets-cjs.mjs.map +1 -1
  143. package/dist/bin/package/copy-assets-esm.mjs +13 -23
  144. package/dist/bin/package/copy-assets-esm.mjs.map +1 -1
  145. package/dist/bin/package/cycle.mjs +6 -16
  146. package/dist/bin/package/cycle.mjs.map +1 -1
  147. package/dist/bin/package/fix.mjs +16 -38
  148. package/dist/bin/package/fix.mjs.map +1 -1
  149. package/dist/bin/package/gen-docs.mjs +11 -11
  150. package/dist/bin/package/gen-docs.mjs.map +1 -1
  151. package/dist/bin/package/lint.mjs +16 -38
  152. package/dist/bin/package/lint.mjs.map +1 -1
  153. package/dist/bin/package/publint.mjs +4 -6
  154. package/dist/bin/package/publint.mjs.map +1 -1
  155. package/dist/bin/package/recompile.mjs +147 -196
  156. package/dist/bin/package/recompile.mjs.map +1 -1
  157. package/dist/bin/package/relint.mjs +16 -38
  158. package/dist/bin/package/relint.mjs.map +1 -1
  159. package/dist/bin/xy.mjs +1082 -1233
  160. package/dist/bin/xy.mjs.map +1 -1
  161. package/dist/index.d.ts +5 -1
  162. package/dist/index.mjs +1334 -1579
  163. package/dist/index.mjs.map +1 -1
  164. package/dist/lib/checkResult.mjs +2 -5
  165. package/dist/lib/checkResult.mjs.map +1 -1
  166. package/dist/lib/createBuildConfig.mjs +9 -24
  167. package/dist/lib/createBuildConfig.mjs.map +1 -1
  168. package/dist/lib/defaultBuildConfig.mjs +2 -6
  169. package/dist/lib/defaultBuildConfig.mjs.map +1 -1
  170. package/dist/lib/deleteGlob.mjs +3 -9
  171. package/dist/lib/deleteGlob.mjs.map +1 -1
  172. package/dist/lib/dependencies/DuplicateDetector.mjs +12 -23
  173. package/dist/lib/dependencies/DuplicateDetector.mjs.map +1 -1
  174. package/dist/lib/dependencies/detectDuplicateDependencies.mjs +22 -33
  175. package/dist/lib/dependencies/detectDuplicateDependencies.mjs.map +1 -1
  176. package/dist/lib/dependencies/index.mjs +22 -33
  177. package/dist/lib/dependencies/index.mjs.map +1 -1
  178. package/dist/lib/file/ReadFileSyncOptions.mjs +1 -3
  179. package/dist/lib/file/ReadFileSyncOptions.mjs.map +1 -1
  180. package/dist/lib/file/constants.mjs.map +1 -1
  181. package/dist/lib/file/fileLines.mjs +12 -13
  182. package/dist/lib/file/fileLines.mjs.map +1 -1
  183. package/dist/lib/file/index.mjs +14 -15
  184. package/dist/lib/file/index.mjs.map +1 -1
  185. package/dist/lib/file/tryReadFileSync.mjs +3 -8
  186. package/dist/lib/file/tryReadFileSync.mjs.map +1 -1
  187. package/dist/lib/generateIgnoreFiles.mjs +27 -43
  188. package/dist/lib/generateIgnoreFiles.mjs.map +1 -1
  189. package/dist/lib/index.mjs +100 -154
  190. package/dist/lib/index.mjs.map +1 -1
  191. package/dist/lib/jsonFormatters.mjs +2 -5
  192. package/dist/lib/jsonFormatters.mjs.map +1 -1
  193. package/dist/lib/loadConfig.mjs +4 -8
  194. package/dist/lib/loadConfig.mjs.map +1 -1
  195. package/dist/lib/parsedPackageJSON.mjs +2 -5
  196. package/dist/lib/parsedPackageJSON.mjs.map +1 -1
  197. package/dist/lib/processEx.mjs +6 -9
  198. package/dist/lib/processEx.mjs.map +1 -1
  199. package/dist/lib/runSteps.mjs +13 -19
  200. package/dist/lib/runSteps.mjs.map +1 -1
  201. package/dist/lib/runStepsAsync.mjs +22 -22
  202. package/dist/lib/runStepsAsync.mjs.map +1 -1
  203. package/dist/lib/runXy.mjs +19 -31
  204. package/dist/lib/runXy.mjs.map +1 -1
  205. package/dist/lib/runXyWithWarning.mjs +2 -5
  206. package/dist/lib/runXyWithWarning.mjs.map +1 -1
  207. package/dist/lib/safeExit.mjs +10 -13
  208. package/dist/lib/safeExit.mjs.map +1 -1
  209. package/dist/lib/string/empty.mjs +2 -5
  210. package/dist/lib/string/empty.mjs.map +1 -1
  211. package/dist/lib/string/index.mjs +3 -9
  212. package/dist/lib/string/index.mjs.map +1 -1
  213. package/dist/lib/string/union.mjs +1 -7
  214. package/dist/lib/string/union.mjs.map +1 -1
  215. package/dist/lib/withErrnoException.mjs +4 -7
  216. package/dist/lib/withErrnoException.mjs.map +1 -1
  217. package/dist/lib/withError.mjs +2 -5
  218. package/dist/lib/withError.mjs.map +1 -1
  219. package/dist/lib/yarn/index.mjs +11 -30
  220. package/dist/lib/yarn/index.mjs.map +1 -1
  221. package/dist/lib/yarn/isYarnVersionOrGreater.mjs +4 -15
  222. package/dist/lib/yarn/isYarnVersionOrGreater.mjs.map +1 -1
  223. package/dist/lib/yarn/workspace/index.mjs +5 -16
  224. package/dist/lib/yarn/workspace/index.mjs.map +1 -1
  225. package/dist/lib/yarn/workspace/yarnWorkspace.mjs +5 -16
  226. package/dist/lib/yarn/workspace/yarnWorkspace.mjs.map +1 -1
  227. package/dist/lib/yarn/workspace/yarnWorkspaces.mjs +3 -14
  228. package/dist/lib/yarn/workspace/yarnWorkspaces.mjs.map +1 -1
  229. package/dist/lib/yarn/yarnInitCwd.mjs +2 -5
  230. package/dist/lib/yarn/yarnInitCwd.mjs.map +1 -1
  231. package/dist/loadPackageConfig.mjs +3 -8
  232. package/dist/loadPackageConfig.mjs.map +1 -1
  233. package/dist/xy/index.mjs +1082 -1234
  234. package/dist/xy/index.mjs.map +1 -1
  235. package/dist/xy/param.mjs +3 -8
  236. package/dist/xy/param.mjs.map +1 -1
  237. package/dist/xy/xy.mjs +1082 -1234
  238. package/dist/xy/xy.mjs.map +1 -1
  239. package/dist/xy/xyBuildCommands.mjs +276 -382
  240. package/dist/xy/xyBuildCommands.mjs.map +1 -1
  241. package/dist/xy/xyCommonCommands.mjs +251 -335
  242. package/dist/xy/xyCommonCommands.mjs.map +1 -1
  243. package/dist/xy/xyDeployCommands.mjs +84 -130
  244. package/dist/xy/xyDeployCommands.mjs.map +1 -1
  245. package/dist/xy/xyInstallCommands.mjs +145 -193
  246. package/dist/xy/xyInstallCommands.mjs.map +1 -1
  247. package/dist/xy/xyLintCommands.mjs +409 -288
  248. package/dist/xy/xyLintCommands.mjs.map +1 -1
  249. package/dist/xy/xyParseOptions.mjs +4 -13
  250. package/dist/xy/xyParseOptions.mjs.map +1 -1
  251. package/package.json +5 -24
package/dist/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 "node:fs";
@@ -24,9 +21,7 @@ import { readFileSync } from "node: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 "node: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 "node:child_process";
@@ -101,17 +83,17 @@ import { execSync } from "node: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 "node: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 "node:fs";
256
+ import {
257
+ existsSync,
258
+ readFileSync as readFileSync2,
259
+ writeFileSync
260
+ } from "node: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 "node: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 "node: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 "node: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 cwd4 = 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(cwd4), readEntries(location)));
@@ -395,41 +348,40 @@ 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";
402
355
  import { cosmiconfig } from "cosmiconfig";
356
+ import { TypeScriptLoader } from "cosmiconfig-typescript-loader";
403
357
  import deepmerge from "deepmerge";
404
358
  var config;
405
- var loadConfig = /* @__PURE__ */ __name(async (params) => {
359
+ var loadConfig = async (params) => {
406
360
  if (config) {
407
361
  return deepmerge(config, params ?? {});
408
362
  }
409
- const cosmicConfigResult = await cosmiconfig("xy", {
410
- cache: true
411
- }).search();
363
+ const cosmicConfigResult = await cosmiconfig("xy", { cache: true, loaders: { ".ts": TypeScriptLoader() } }).search();
412
364
  config = cosmicConfigResult?.config;
413
365
  const configFilePath = cosmicConfigResult?.filepath;
414
366
  if (configFilePath) {
415
367
  console.log(chalk5.gray(`Loading config from ${configFilePath}`));
416
368
  }
417
369
  return deepmerge(config, params ?? {});
418
- }, "loadConfig");
370
+ };
419
371
 
420
372
  // src/lib/parsedPackageJSON.ts
421
373
  import { readFileSync as readFileSync4 } from "node:fs";
422
- var parsedPackageJSON = /* @__PURE__ */ __name((path8) => {
423
- const pathToPackageJSON = path8 ?? process.env.npm_package_json ?? "";
374
+ var parsedPackageJSON = (path9) => {
375
+ const pathToPackageJSON = path9 ?? process.env.npm_package_json ?? "";
424
376
  const packageJSON = readFileSync4(pathToPackageJSON).toString();
425
377
  return JSON.parse(packageJSON);
426
- }, "parsedPackageJSON");
378
+ };
427
379
 
428
380
  // src/lib/runSteps.ts
429
381
  import { spawnSync as spawnSync3 } from "node:child_process";
430
382
  import { existsSync as existsSync3 } from "node:fs";
431
383
  import chalk6 from "chalk";
432
- var runSteps = /* @__PURE__ */ __name((name, steps, exitOnFail = true, messages) => {
384
+ var runSteps = (name, steps, exitOnFail = true, messages) => {
433
385
  return safeExit(() => {
434
386
  const pkgName = process.env.npm_package_name;
435
387
  console.log(chalk6.green(`${name} [${pkgName}]`));
@@ -445,10 +397,7 @@ var runSteps = /* @__PURE__ */ __name((name, steps, exitOnFail = true, messages)
445
397
  const status = spawnSync3(command, Array.isArray(args) ? args : args.split(" "), {
446
398
  ...config2,
447
399
  encoding: "utf8",
448
- env: {
449
- FORCE_COLOR: "3",
450
- ...process.env
451
- },
400
+ env: { FORCE_COLOR: "3", ...process.env },
452
401
  shell: true,
453
402
  stdio: "inherit"
454
403
  }).status ?? 0;
@@ -457,13 +406,13 @@ var runSteps = /* @__PURE__ */ __name((name, steps, exitOnFail = true, messages)
457
406
  }
458
407
  return totalStatus;
459
408
  }, !!exitOnFail);
460
- }, "runSteps");
409
+ };
461
410
 
462
411
  // src/lib/runStepsAsync.ts
463
412
  import { spawn } from "node:child_process";
464
413
  import { existsSync as existsSync4 } from "node:fs";
465
414
  import chalk7 from "chalk";
466
- var runStepAsync = /* @__PURE__ */ __name((name, step, exitOnFail = true, message) => {
415
+ var runStepAsync = (name, step, exitOnFail = true, message) => {
467
416
  return new Promise((resolve) => {
468
417
  const [command, args, config2] = step;
469
418
  if (message) {
@@ -475,15 +424,18 @@ var runStepAsync = /* @__PURE__ */ __name((name, step, exitOnFail = true, messag
475
424
  }
476
425
  spawn(command, Array.isArray(args) ? args : args.split(" "), {
477
426
  ...config2,
478
- env: {
479
- FORCE_COLOR: "3",
480
- ...process.env
481
- },
427
+ env: { FORCE_COLOR: "3", ...process.env },
482
428
  shell: true,
483
429
  stdio: "inherit"
484
430
  }).on("close", (code) => {
485
431
  if (code) {
486
- console.error(chalk7.red(`Command Exited With Non-Zero Result [${chalk7.gray(code)}] | ${chalk7.yellow(command)} ${chalk7.white(Array.isArray(args) ? args.join(" ") : args)}`));
432
+ console.error(
433
+ chalk7.red(
434
+ `Command Exited With Non-Zero Result [${chalk7.gray(code)}] | ${chalk7.yellow(command)} ${chalk7.white(
435
+ Array.isArray(args) ? args.join(" ") : args
436
+ )}`
437
+ )
438
+ );
487
439
  checkResult(name, code, "error", exitOnFail);
488
440
  resolve(code);
489
441
  } else {
@@ -491,8 +443,8 @@ var runStepAsync = /* @__PURE__ */ __name((name, step, exitOnFail = true, messag
491
443
  }
492
444
  });
493
445
  });
494
- }, "runStepAsync");
495
- var runStepsAsync = /* @__PURE__ */ __name(async (name, steps, exitOnFail = true, messages) => {
446
+ };
447
+ var runStepsAsync = async (name, steps, exitOnFail = true, messages) => {
496
448
  return await safeExitAsync(async () => {
497
449
  const pkgName = process.env.npm_package_name;
498
450
  console.log(chalk7.green(`${name} [${pkgName}]`));
@@ -502,163 +454,85 @@ var runStepsAsync = /* @__PURE__ */ __name(async (name, steps, exitOnFail = true
502
454
  }
503
455
  return result;
504
456
  });
505
- }, "runStepsAsync");
457
+ };
506
458
 
507
459
  // src/lib/runXy.ts
508
- var runXy = /* @__PURE__ */ __name((command) => {
509
- return runSteps(`XY [${command}]`, [
510
- [
511
- "yarn",
512
- [
513
- "xy",
514
- command,
515
- ...process.argv.filter((value, index) => index > 1 ? value : void 0)
516
- ]
517
- ]
518
- ]);
519
- }, "runXy");
460
+ var runXy = (command) => {
461
+ return runSteps(
462
+ `XY [${command}]`,
463
+ [["yarn", ["xy", command, ...process.argv.filter((value, index) => index > 1 ? value : void 0)]]]
464
+ );
465
+ };
520
466
 
521
467
  // src/lib/runXyWithWarning.ts
522
468
  import chalk8 from "chalk";
523
- var runXyWithWarning = /* @__PURE__ */ __name((command) => {
469
+ var runXyWithWarning = (command) => {
524
470
  const commandString = `yarn ${command}`;
525
471
  const commandXyString = `yarn xy ${command}`;
526
472
  console.warn(chalk8.yellow(`WARNING: [${chalk8.white(commandString)}] is deprecated for XY Labs Scripts.`));
527
473
  console.warn(chalk8.gray(`Did you mean [${chalk8.magenta(commandXyString)}]?`));
528
474
  return 1;
529
- }, "runXyWithWarning");
475
+ };
530
476
 
531
477
  // src/actions/build.ts
532
- var build = /* @__PURE__ */ __name(async ({ incremental, jobs, target, verbose, pkg }) => {
478
+ var build = async ({
479
+ incremental,
480
+ jobs,
481
+ target,
482
+ verbose,
483
+ pkg
484
+ }) => {
533
485
  const start = Date.now();
534
- const pkgOptions = pkg ? [
535
- pkg
536
- ] : [];
537
- const incrementalOptions = incremental ? [
538
- "-i"
539
- ] : [];
540
- const verboseOptions = verbose ? [
541
- "-v"
542
- ] : [];
543
- const targetOptions = target ? [
544
- "-t",
545
- target
546
- ] : [];
547
- const jobsOptions = jobs ? [
548
- "-j",
549
- `${jobs}`
550
- ] : [];
486
+ const pkgOptions = pkg ? [pkg] : [];
487
+ const incrementalOptions = incremental ? ["-i"] : [];
488
+ const verboseOptions = verbose ? ["-v"] : [];
489
+ const targetOptions = target ? ["-t", target] : [];
490
+ const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
551
491
  if (jobs) {
552
492
  console.log(chalk9.blue(`Jobs set to [${jobs}]`));
553
493
  }
554
494
  const result = await runStepsAsync(`Build${incremental ? "-Incremental" : ""} [${pkg ?? "All"}]`, [
555
- [
556
- "yarn",
557
- [
558
- "xy",
559
- "compile",
560
- ...pkgOptions,
561
- ...targetOptions,
562
- ...verboseOptions,
563
- ...jobsOptions,
564
- ...incrementalOptions,
565
- "--types",
566
- "tsup"
567
- ]
568
- ],
569
- [
570
- "yarn",
571
- [
572
- "xy",
573
- "publint",
574
- ...pkgOptions,
575
- ...verboseOptions,
576
- ...jobsOptions,
577
- ...incrementalOptions
578
- ]
579
- ],
580
- [
581
- "yarn",
582
- [
583
- "xy",
584
- "knip",
585
- ...pkgOptions,
586
- ...verboseOptions,
587
- ...jobsOptions,
588
- ...incrementalOptions
589
- ]
590
- ],
591
- [
592
- "yarn",
593
- [
594
- "xy",
595
- "lint",
596
- ...pkgOptions,
597
- ...verboseOptions,
598
- ...incrementalOptions
599
- ]
600
- ]
495
+ ["yarn", ["xy", "compile", ...pkgOptions, ...targetOptions, ...verboseOptions, ...jobsOptions, ...incrementalOptions, "--types", "tsup"]],
496
+ ["yarn", ["xy", "publint", ...pkgOptions, ...verboseOptions, ...jobsOptions, ...incrementalOptions]],
497
+ ["yarn", ["xy", "knip", ...pkgOptions, ...verboseOptions, ...jobsOptions, ...incrementalOptions]],
498
+ ["yarn", ["xy", "lint", ...pkgOptions, ...verboseOptions, ...incrementalOptions]]
601
499
  ]);
602
500
  console.log(`${chalk9.gray("Built in")} [${chalk9.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk9.gray("seconds")}`);
603
501
  return result;
604
- }, "build");
502
+ };
605
503
 
606
504
  // src/actions/clean.ts
607
- var clean = /* @__PURE__ */ __name(async ({ verbose, pkg }) => {
608
- return pkg ? await cleanPackage({
609
- pkg,
610
- verbose
611
- }) : cleanAll({
612
- verbose
613
- });
614
- }, "clean");
615
- var cleanPackage = /* @__PURE__ */ __name(({ pkg }) => {
616
- return runStepsAsync(`Clean [${pkg}]`, [
617
- [
618
- "yarn",
619
- [
620
- "workspace",
621
- pkg,
622
- "run",
623
- "package-clean"
624
- ]
625
- ]
626
- ]);
627
- }, "cleanPackage");
628
- var cleanAll = /* @__PURE__ */ __name(({ verbose }) => {
629
- const verboseOptions = verbose ? [
630
- "--verbose"
631
- ] : [
632
- "--no-verbose"
633
- ];
634
- return runStepsAsync("Clean", [
635
- [
636
- "yarn",
637
- [
638
- "workspaces foreach",
639
- "-pA",
640
- "--jobs 64",
641
- ...verboseOptions,
642
- "run",
643
- "package-clean"
644
- ]
645
- ]
646
- ]);
647
- }, "cleanAll");
505
+ var clean = async ({ verbose, pkg }) => {
506
+ return pkg ? await cleanPackage({ pkg, verbose }) : cleanAll({ verbose });
507
+ };
508
+ var cleanPackage = ({ pkg }) => {
509
+ return runStepsAsync(`Clean [${pkg}]`, [["yarn", ["workspace", pkg, "run", "package-clean"]]]);
510
+ };
511
+ var cleanAll = ({ verbose }) => {
512
+ const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
513
+ return runStepsAsync("Clean", [["yarn", ["workspaces foreach", "-pA", "--jobs 64", ...verboseOptions, "run", "package-clean"]]]);
514
+ };
648
515
 
649
516
  // src/actions/clean-docs.ts
650
517
  import path from "node:path";
651
518
  import chalk10 from "chalk";
652
- var cleanDocs = /* @__PURE__ */ __name(() => {
519
+ var cleanDocs = () => {
653
520
  const pkgName = process.env.npm_package_name;
654
521
  console.log(chalk10.green(`Cleaning Docs [${pkgName}]`));
655
522
  for (const { location } of yarnWorkspaces()) deleteGlob(path.join(location, "docs"));
656
523
  return 0;
657
- }, "cleanDocs");
524
+ };
658
525
 
659
526
  // src/actions/compile.ts
660
527
  import chalk11 from "chalk";
661
- var compile = /* @__PURE__ */ __name(({ verbose, target, pkg, incremental, publint: publint2, jobs }) => {
528
+ var compile = ({
529
+ verbose,
530
+ target,
531
+ pkg,
532
+ incremental,
533
+ publint: publint2,
534
+ jobs
535
+ }) => {
662
536
  return pkg ? compilePackage({
663
537
  pkg,
664
538
  publint: publint2,
@@ -671,164 +545,114 @@ var compile = /* @__PURE__ */ __name(({ verbose, target, pkg, incremental, publi
671
545
  verbose,
672
546
  jobs
673
547
  });
674
- }, "compile");
675
- var compilePackage = /* @__PURE__ */ __name(({ target, pkg }) => {
676
- const targetOptions = target ? [
677
- "-t",
678
- target
679
- ] : [];
680
- return runSteps(`Compile [${pkg}]`, [
681
- [
682
- "yarn",
683
- [
684
- "workspace",
685
- pkg,
686
- "run",
687
- "package-compile",
688
- ...targetOptions
689
- ]
690
- ]
691
- ]);
692
- }, "compilePackage");
693
- var compileAll = /* @__PURE__ */ __name(({ jobs, verbose, target, incremental }) => {
548
+ };
549
+ var compilePackage = ({ target, pkg }) => {
550
+ const targetOptions = target ? ["-t", target] : [];
551
+ return runSteps(
552
+ `Compile [${pkg}]`,
553
+ [["yarn", ["workspace", pkg, "run", "package-compile", ...targetOptions]]]
554
+ );
555
+ };
556
+ var compileAll = ({
557
+ jobs,
558
+ verbose,
559
+ target,
560
+ incremental
561
+ }) => {
694
562
  const start = Date.now();
695
- const verboseOptions = verbose ? [
696
- "--verbose"
697
- ] : [
698
- "--no-verbose"
699
- ];
700
- const targetOptions = target ? [
701
- "-t",
702
- target
703
- ] : [];
704
- const incrementalOptions = incremental ? [
705
- "--since",
706
- "-Apt",
707
- "--topological-dev"
708
- ] : [
709
- "--parallel",
710
- "-Apt",
711
- "--topological-dev"
712
- ];
713
- const jobsOptions = jobs ? [
714
- "-j",
715
- `${jobs}`
716
- ] : [];
563
+ const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
564
+ const targetOptions = target ? ["-t", target] : [];
565
+ const incrementalOptions = incremental ? ["--since", "-Apt", "--topological-dev"] : ["--parallel", "-Apt", "--topological-dev"];
566
+ const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
717
567
  if (jobs) {
718
568
  console.log(chalk11.blue(`Jobs set to [${jobs}]`));
719
569
  }
720
570
  const result = runSteps(`Compile${incremental ? "-Incremental" : ""} [All]`, [
721
- [
722
- "yarn",
723
- [
724
- "workspaces",
725
- "foreach",
726
- ...incrementalOptions,
727
- ...jobsOptions,
728
- ...verboseOptions,
729
- "run",
730
- "package-compile",
731
- ...targetOptions
732
- ]
733
- ]
571
+ ["yarn", [
572
+ "workspaces",
573
+ "foreach",
574
+ ...incrementalOptions,
575
+ ...jobsOptions,
576
+ ...verboseOptions,
577
+ "run",
578
+ "package-compile",
579
+ ...targetOptions
580
+ ]]
734
581
  ]);
735
582
  console.log(`${chalk11.gray("Compiled in")} [${chalk11.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk11.gray("seconds")}`);
736
583
  return result;
737
- }, "compileAll");
584
+ };
738
585
 
739
586
  // src/actions/compile-types.ts
740
587
  import chalk12 from "chalk";
741
- var compileTypes = /* @__PURE__ */ __name(({ verbose, pkg, incremental, jobs }) => {
588
+ var compileTypes = ({
589
+ verbose,
590
+ pkg,
591
+ incremental,
592
+ jobs
593
+ }) => {
742
594
  if (verbose) {
743
595
  console.log(chalk12.gray("Compiling Types"));
744
596
  }
745
- return pkg ? compileTypesPackage({
746
- pkg,
747
- verbose
748
- }) : compileTypesAll({
597
+ return pkg ? compileTypesPackage({ pkg, verbose }) : compileTypesAll({
749
598
  incremental,
750
599
  verbose,
751
600
  jobs
752
601
  });
753
- }, "compileTypes");
754
- var compileTypesPackage = /* @__PURE__ */ __name(({ verbose, pkg }) => {
602
+ };
603
+ var compileTypesPackage = ({ verbose, pkg }) => {
755
604
  if (verbose) {
756
605
  console.log(chalk12.gray("Compiling Types [Package]"));
757
606
  }
758
- return runSteps(`Compile [${pkg}]`, [
759
- [
760
- "yarn",
761
- [
762
- "workspace",
763
- pkg,
764
- "run",
765
- "package-compile-types"
766
- ]
767
- ]
768
- ]);
769
- }, "compileTypesPackage");
770
- var compileTypesAll = /* @__PURE__ */ __name(({ jobs, verbose, incremental }) => {
607
+ return runSteps(
608
+ `Compile [${pkg}]`,
609
+ [["yarn", ["workspace", pkg, "run", "package-compile-types"]]]
610
+ );
611
+ };
612
+ var compileTypesAll = ({
613
+ jobs,
614
+ verbose,
615
+ incremental
616
+ }) => {
771
617
  if (verbose) {
772
618
  console.log(chalk12.gray("Compiling Types [All]"));
773
619
  }
774
620
  const start = Date.now();
775
- const verboseOptions = verbose ? [
776
- "--verbose"
777
- ] : [
778
- "--no-verbose"
779
- ];
780
- const incrementalOptions = incremental ? [
781
- "--since",
782
- "-Apt"
783
- ] : [
784
- "--parallel",
785
- "-Apt"
786
- ];
787
- const jobsOptions = jobs ? [
788
- "-j",
789
- `${jobs}`
790
- ] : [];
621
+ const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
622
+ const incrementalOptions = incremental ? ["--since", "-Apt"] : ["--parallel", "-Apt"];
623
+ const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
791
624
  if (jobs) {
792
625
  console.log(chalk12.blue(`Jobs set to [${jobs}]`));
793
626
  }
794
627
  const result = runSteps(`Compile Types ${incremental ? "[Incremental]" : ""} [All]`, [
795
- [
796
- "yarn",
797
- [
798
- "workspaces",
799
- "foreach",
800
- ...incrementalOptions,
801
- ...jobsOptions,
802
- ...verboseOptions,
803
- "run",
804
- "package-compile-types"
805
- ]
806
- ]
628
+ ["yarn", [
629
+ "workspaces",
630
+ "foreach",
631
+ ...incrementalOptions,
632
+ ...jobsOptions,
633
+ ...verboseOptions,
634
+ "run",
635
+ "package-compile-types"
636
+ ]]
807
637
  ]);
808
638
  console.log(`${chalk12.gray("Types Compiled in")} [${chalk12.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk12.gray("seconds")}`);
809
639
  return result;
810
- }, "compileTypesAll");
640
+ };
811
641
 
812
642
  // src/actions/copy-assets.ts
813
643
  import path2 from "node:path/posix";
814
644
  import chalk13 from "chalk";
815
645
  import cpy from "cpy";
816
- var copyPackageTargetAssets = /* @__PURE__ */ __name(async (target, name, location) => {
646
+ var copyPackageTargetAssets = async (target, name, location) => {
817
647
  try {
818
- const values = await cpy([
819
- "**/*.jpg",
820
- "**/*.png",
821
- "**/*.gif",
822
- "**/*.svg",
823
- "**/*.webp",
824
- "**/*.sass",
825
- "**/*.scss",
826
- "**/*.gif",
827
- "**/*.css"
828
- ], `../dist/${target}`, {
829
- cwd: path2.join(process.cwd(), location, "src"),
830
- flat: false
831
- });
648
+ const values = await cpy(
649
+ ["**/*.jpg", "**/*.png", "**/*.gif", "**/*.svg", "**/*.webp", "**/*.sass", "**/*.scss", "**/*.gif", "**/*.css"],
650
+ `../dist/${target}`,
651
+ {
652
+ cwd: path2.join(process.cwd(), location, "src"),
653
+ flat: false
654
+ }
655
+ );
832
656
  for (const value of values) {
833
657
  console.log(`${value.split("/").pop()} => ./dist/${target}`);
834
658
  }
@@ -837,8 +661,8 @@ var copyPackageTargetAssets = /* @__PURE__ */ __name(async (target, name, locati
837
661
  console.log(`Copy Failed: ${name}: ${reason}`);
838
662
  return 1;
839
663
  }
840
- }, "copyPackageTargetAssets");
841
- var copyTargetAssets = /* @__PURE__ */ __name(async (target, pkg) => {
664
+ };
665
+ var copyTargetAssets = async (target, pkg) => {
842
666
  const workspaces = yarnWorkspaces();
843
667
  console.log(chalk13.green(`Copying Assets [${target.toUpperCase()}]`));
844
668
  const workspaceList = workspaces.filter(({ name }) => {
@@ -847,15 +671,17 @@ var copyTargetAssets = /* @__PURE__ */ __name(async (target, pkg) => {
847
671
  if (workspaceList.length === 0) {
848
672
  console.error(`Package not found [${pkg}]`);
849
673
  } else {
850
- const results = await Promise.all(workspaceList.map(async (workspace) => {
851
- const { location, name } = workspace;
852
- return await copyPackageTargetAssets(target, name, location);
853
- }));
674
+ const results = await Promise.all(
675
+ workspaceList.map(async (workspace) => {
676
+ const { location, name } = workspace;
677
+ return await copyPackageTargetAssets(target, name, location);
678
+ })
679
+ );
854
680
  return results.reduce((prev, result) => prev || result, 0);
855
681
  }
856
682
  return 0;
857
- }, "copyTargetAssets");
858
- var copyAssets = /* @__PURE__ */ __name(async ({ target, pkg }) => {
683
+ };
684
+ var copyAssets = async ({ target, pkg }) => {
859
685
  switch (target) {
860
686
  case "esm": {
861
687
  return await copyTargetAssets("esm", pkg);
@@ -867,38 +693,21 @@ var copyAssets = /* @__PURE__ */ __name(async ({ target, pkg }) => {
867
693
  return await copyTargetAssets("esm", pkg) || await copyTargetAssets("cjs", pkg);
868
694
  }
869
695
  }
870
- }, "copyAssets");
696
+ };
871
697
 
872
698
  // src/actions/cycle.ts
873
699
  import { cruise } from "dependency-cruiser";
874
- var cycle = /* @__PURE__ */ __name(async ({ verbose, pkg } = {}) => {
875
- return pkg ? cyclePackage({
876
- pkg,
877
- verbose
878
- }) : await cycleAll({
879
- verbose
880
- });
881
- }, "cycle");
882
- var cyclePackage = /* @__PURE__ */ __name(({ pkg, verbose }) => {
883
- const verboseOptions = verbose ? [
884
- "--verbose"
885
- ] : [
886
- "--no-verbose"
887
- ];
888
- return runSteps(`Cycle [${pkg}]`, [
889
- [
890
- "yarn",
891
- [
892
- "workspace",
893
- pkg,
894
- "run",
895
- "package-cycle",
896
- ...verboseOptions
897
- ]
898
- ]
899
- ]);
900
- }, "cyclePackage");
901
- var cycleAll = /* @__PURE__ */ __name(async ({ verbose = false }) => {
700
+ var cycle = async ({ verbose, pkg } = {}) => {
701
+ return pkg ? cyclePackage({ pkg, verbose }) : await cycleAll({ verbose });
702
+ };
703
+ var cyclePackage = ({ pkg, verbose }) => {
704
+ const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
705
+ return runSteps(
706
+ `Cycle [${pkg}]`,
707
+ [["yarn", ["workspace", pkg, "run", "package-cycle", ...verboseOptions]]]
708
+ );
709
+ };
710
+ var cycleAll = async ({ verbose = false }) => {
902
711
  const pkgName = process.env.npm_package_name;
903
712
  const cruiseOptions = {
904
713
  ruleSet: {
@@ -908,26 +717,20 @@ var cycleAll = /* @__PURE__ */ __name(async ({ verbose = false }) => {
908
717
  severity: "error",
909
718
  comment: "This dependency creates a circular reference",
910
719
  from: {},
911
- to: {
912
- circular: true
913
- }
720
+ to: { circular: true }
914
721
  }
915
722
  ]
916
723
  },
917
724
  exclude: "node_modules|packages/.*/packages",
918
725
  validate: true,
919
- doNotFollow: {
920
- path: "node_modules|packages/.*/packages"
921
- },
726
+ doNotFollow: { path: "node_modules|packages/.*/packages" },
922
727
  tsPreCompilationDeps: false,
923
728
  combinedDependencies: true,
924
729
  outputType: verbose ? "text" : "err"
925
730
  };
926
731
  const target = "**/src";
927
732
  console.log(`Checking for circular dependencies in ${target}...`);
928
- const result = await cruise([
929
- target
930
- ], cruiseOptions);
733
+ const result = await cruise([target], cruiseOptions);
931
734
  if (result.output) {
932
735
  console.log(result.output);
933
736
  }
@@ -937,243 +740,299 @@ var cycleAll = /* @__PURE__ */ __name(async ({ verbose = false }) => {
937
740
  console.error(`${pkgName} \u274C Dependency violations found`);
938
741
  }
939
742
  return result.exitCode;
940
- }, "cycleAll");
743
+ };
941
744
 
942
745
  // src/actions/dead.ts
943
- var dead = /* @__PURE__ */ __name(() => {
944
- return runSteps("Dead", [
945
- [
946
- "yarn",
947
- [
948
- "ts-prune",
949
- "-p",
950
- "tsconfig.json"
951
- ]
952
- ]
953
- ]);
954
- }, "dead");
746
+ var dead = () => {
747
+ return runSteps("Dead", [["yarn", ["ts-prune", "-p", "tsconfig.json"]]]);
748
+ };
749
+
750
+ // src/actions/deplint.ts
751
+ import fs2 from "node:fs";
752
+ import path3 from "node:path";
753
+ import chalk14 from "chalk";
754
+ import { globSync } from "glob";
755
+ import ts from "typescript";
756
+ function getDependenciesFromPackageJson(packageJsonPath) {
757
+ const packageJsonFullPath = path3.resolve(packageJsonPath);
758
+ const rawContent = fs2.readFileSync(packageJsonFullPath, "utf8");
759
+ const packageJson = JSON.parse(rawContent);
760
+ const dependencies = packageJson.dependencies ? Object.keys(packageJson.dependencies) : [];
761
+ const devDependencies = packageJson.devDependencies ? Object.keys(packageJson.devDependencies) : [];
762
+ const peerDependencies = packageJson.peerDependencies ? Object.keys(packageJson.peerDependencies) : [];
763
+ return {
764
+ dependencies,
765
+ devDependencies,
766
+ peerDependencies
767
+ };
768
+ }
769
+ function getBasePackageName(importName) {
770
+ if (importName.startsWith("@")) {
771
+ const parts = importName.split("/");
772
+ return parts.length >= 2 ? `${parts[0]}/${parts[1]}` : importName;
773
+ }
774
+ return importName.split("/")[0];
775
+ }
776
+ function getImportsFromFile(filePath, importPaths) {
777
+ const sourceCode = fs2.readFileSync(filePath, "utf8");
778
+ const sourceFile = ts.createSourceFile(
779
+ path3.basename(filePath),
780
+ sourceCode,
781
+ ts.ScriptTarget.Latest,
782
+ true
783
+ );
784
+ const imports = [];
785
+ function visit(node) {
786
+ if (ts.isImportDeclaration(node) || ts.isExportDeclaration(node)) {
787
+ const moduleSpecifier = node.moduleSpecifier?.getFullText();
788
+ if (moduleSpecifier) {
789
+ const trimmed = moduleSpecifier.split("'").at(1) ?? moduleSpecifier;
790
+ imports.push(trimmed);
791
+ }
792
+ }
793
+ ts.forEachChild(node, visit);
794
+ }
795
+ visit(sourceFile);
796
+ const cleanedImports = imports.filter((imp) => !imp.startsWith(".") && !imp.startsWith("#") && !imp.startsWith("node:")).map(getBasePackageName);
797
+ for (const imp of cleanedImports) {
798
+ importPaths[imp] = importPaths[imp] || [];
799
+ importPaths[imp].push(filePath);
800
+ }
801
+ return cleanedImports;
802
+ }
803
+ function findFilesByGlob(cwd4, pattern) {
804
+ return globSync(pattern, { cwd: cwd4, absolute: true });
805
+ }
806
+ function findFiles(path9) {
807
+ const allSourceInclude = ["./src/**/*.{ts,tsx}"];
808
+ const prodExcludeEndswith = [".spec.ts", ".stories.tsx"];
809
+ const prodExcludeIncludes = ["/spec/", "/stories/", "/scripts/"];
810
+ const allSourceFiles = allSourceInclude.flatMap((pattern) => findFilesByGlob(path9, pattern));
811
+ const prodSourceFiles = allSourceFiles.filter((file) => !prodExcludeEndswith.some((ext) => file.endsWith(ext)) && !prodExcludeIncludes.some((excl) => file.includes(excl)));
812
+ const devSourceFiles = allSourceFiles.filter((file) => !prodSourceFiles.includes(file));
813
+ return {
814
+ allSourceFiles,
815
+ prodSourceFiles,
816
+ devSourceFiles
817
+ };
818
+ }
819
+ function getExternalImportsFromFiles({ prodSourceFiles, devSourceFiles }) {
820
+ const prodImportPaths = {};
821
+ const prodImports = prodSourceFiles.flatMap((path9) => getImportsFromFile(path9, prodImportPaths));
822
+ const devImportPaths = {};
823
+ const devImports = devSourceFiles.flatMap((path9) => getImportsFromFile(path9, devImportPaths));
824
+ const externalProdImports = prodImports.filter((imp) => !imp.startsWith(".") && !imp.startsWith("#") && !imp.startsWith("node:"));
825
+ const externalDevImports = devImports.filter((imp) => !imp.startsWith(".") && !imp.startsWith("#") && !imp.startsWith("node:"));
826
+ return {
827
+ prodImports,
828
+ devImports,
829
+ prodImportPaths,
830
+ devImportPaths,
831
+ externalProdImports,
832
+ externalDevImports
833
+ };
834
+ }
835
+ function check({
836
+ name,
837
+ location,
838
+ devDeps = false
839
+ }) {
840
+ const { prodSourceFiles, devSourceFiles } = findFiles(location);
841
+ const {
842
+ prodImportPaths,
843
+ devImportPaths,
844
+ externalProdImports,
845
+ externalDevImports
846
+ } = getExternalImportsFromFiles({ prodSourceFiles, devSourceFiles });
847
+ const {
848
+ dependencies,
849
+ devDependencies,
850
+ peerDependencies
851
+ } = getDependenciesFromPackageJson(`${location}/package.json`);
852
+ let unlistedDependencies = 0;
853
+ let unlistedDevDependencies = 0;
854
+ for (const imp of externalProdImports) {
855
+ if (!dependencies.includes(imp) && !peerDependencies.includes(imp)) {
856
+ unlistedDependencies++;
857
+ console.log(`[${chalk14.blue(name)}] Missing dependency in package.json: ${chalk14.red(imp)}`);
858
+ console.log(` ${prodImportPaths[imp].join("\n")}`);
859
+ console.log("");
860
+ }
861
+ }
862
+ for (const dep of dependencies) {
863
+ if (!externalProdImports.includes(dep)) {
864
+ unlistedDependencies++;
865
+ console.log(`[${chalk14.blue(name)}] Unused dependency in package.json: ${chalk14.red(dep)}`);
866
+ console.log(` ${location}/package.json
867
+ `);
868
+ console.log("");
869
+ }
870
+ }
871
+ for (const dep of peerDependencies) {
872
+ if (!externalProdImports.includes(dep)) {
873
+ unlistedDependencies++;
874
+ console.log(`[${chalk14.blue(name)}] Unused peerDependency in package.json: ${chalk14.red(dep)}`);
875
+ console.log(` ${location}/package.json
876
+ `);
877
+ console.log("");
878
+ }
879
+ }
880
+ if (devDeps) {
881
+ for (const imp of externalDevImports) {
882
+ if (!devDependencies.includes(imp)) {
883
+ unlistedDevDependencies++;
884
+ console.log(`[${chalk14.blue(name)}] Missing devDependency in package.json: ${chalk14.red(imp)}`);
885
+ console.log(` Found in: ${devImportPaths[imp].join(", ")}`);
886
+ }
887
+ }
888
+ }
889
+ const totalErrors = unlistedDependencies + unlistedDevDependencies;
890
+ return totalErrors;
891
+ }
892
+ var deplint = ({ pkg }) => {
893
+ if (pkg) {
894
+ const { location, name } = yarnWorkspace(pkg);
895
+ console.log(`Running Deplint for ${name}`);
896
+ check({
897
+ name,
898
+ location,
899
+ devDeps: true
900
+ });
901
+ } else {
902
+ const workspaces = yarnWorkspaces();
903
+ console.log("Deplint Started...");
904
+ let totalErrors = 0;
905
+ for (const workspace of workspaces) {
906
+ totalErrors += check(workspace);
907
+ }
908
+ if (totalErrors > 0) {
909
+ console.log(`Found ${chalk14.red(totalErrors)} unlisted imports.`);
910
+ } else {
911
+ console.log(`No unlisted imports found. ${chalk14.green("\u2714")}`);
912
+ }
913
+ }
914
+ return 0;
915
+ };
955
916
 
956
917
  // src/actions/deploy.ts
957
- var deploy = /* @__PURE__ */ __name(() => {
918
+ var deploy = () => {
958
919
  return runSteps("Deploy [Patch]", [
959
- [
960
- "yarn",
961
- "workspaces foreach --all version patch --deferred"
962
- ],
963
- [
964
- "yarn",
965
- "xy clean"
966
- ],
967
- [
968
- "yarn",
969
- "xy build"
970
- ],
971
- [
972
- "yarn",
973
- "version apply --all"
974
- ],
975
- [
976
- "yarn",
977
- "workspaces foreach --all --parallel npm publish"
978
- ]
920
+ ["yarn", "workspaces foreach --all version patch --deferred"],
921
+ ["yarn", "xy clean"],
922
+ ["yarn", "xy build"],
923
+ ["yarn", "version apply --all"],
924
+ ["yarn", "workspaces foreach --all --parallel npm publish"]
979
925
  ]);
980
- }, "deploy");
926
+ };
981
927
 
982
928
  // src/actions/deploy-major.ts
983
- var deployMajor = /* @__PURE__ */ __name(() => {
929
+ var deployMajor = () => {
984
930
  return runSteps("Deploy [Major]", [
985
- [
986
- "yarn",
987
- "workspaces foreach --all version major --deferred"
988
- ],
989
- [
990
- "yarn",
991
- "xy clean"
992
- ],
993
- [
994
- "yarn",
995
- "xy build"
996
- ],
997
- [
998
- "yarn",
999
- "version apply --all"
1000
- ],
1001
- [
1002
- "yarn",
1003
- "workspaces foreach --all --parallel npm publish"
1004
- ]
931
+ ["yarn", "workspaces foreach --all version major --deferred"],
932
+ ["yarn", "xy clean"],
933
+ ["yarn", "xy build"],
934
+ ["yarn", "version apply --all"],
935
+ ["yarn", "workspaces foreach --all --parallel npm publish"]
1005
936
  ]);
1006
- }, "deployMajor");
937
+ };
1007
938
 
1008
939
  // src/actions/deploy-minor.ts
1009
- var deployMinor = /* @__PURE__ */ __name(() => {
940
+ var deployMinor = () => {
1010
941
  return runSteps("Deploy [Minor]", [
1011
- [
1012
- "yarn",
1013
- "workspaces foreach --all version minor --deferred"
1014
- ],
1015
- [
1016
- "yarn",
1017
- "xy clean"
1018
- ],
1019
- [
1020
- "yarn",
1021
- "xy build"
1022
- ],
1023
- [
1024
- "yarn",
1025
- "version apply --all"
1026
- ],
1027
- [
1028
- "yarn",
1029
- "workspaces foreach --all --parallel npm publish"
1030
- ]
942
+ ["yarn", "workspaces foreach --all version minor --deferred"],
943
+ ["yarn", "xy clean"],
944
+ ["yarn", "xy build"],
945
+ ["yarn", "version apply --all"],
946
+ ["yarn", "workspaces foreach --all --parallel npm publish"]
1031
947
  ]);
1032
- }, "deployMinor");
948
+ };
1033
949
 
1034
950
  // src/actions/deploy-next.ts
1035
- var deployNext = /* @__PURE__ */ __name(() => {
951
+ var deployNext = () => {
1036
952
  return runSteps("Deploy [Next]", [
1037
- [
1038
- "yarn",
1039
- "workspaces foreach --all version minor --deferred"
1040
- ],
1041
- [
1042
- "yarn",
1043
- "xy clean"
1044
- ],
1045
- [
1046
- "yarn",
1047
- "xy build"
1048
- ],
1049
- [
1050
- "yarn",
1051
- "version apply --all --prerelease"
1052
- ],
1053
- [
1054
- "yarn",
1055
- "workspaces foreach --all --parallel npm publish --tag next"
1056
- ]
953
+ ["yarn", "workspaces foreach --all version minor --deferred"],
954
+ ["yarn", "xy clean"],
955
+ ["yarn", "xy build"],
956
+ ["yarn", "version apply --all --prerelease"],
957
+ ["yarn", "workspaces foreach --all --parallel npm publish --tag next"]
1057
958
  ]);
1058
- }, "deployNext");
959
+ };
1059
960
 
1060
961
  // src/actions/dupdeps.ts
1061
- import chalk14 from "chalk";
1062
- var dupdeps = /* @__PURE__ */ __name(() => {
1063
- console.log(chalk14.green("Checking all Dependencies for Duplicates"));
962
+ import chalk15 from "chalk";
963
+ var dupdeps = () => {
964
+ console.log(chalk15.green("Checking all Dependencies for Duplicates"));
1064
965
  const allDependencies = parsedPackageJSON()?.dependencies;
1065
966
  const dependencies = Object.entries(allDependencies).map(([k]) => k);
1066
967
  return detectDuplicateDependencies(dependencies);
1067
- }, "dupdeps");
968
+ };
1068
969
 
1069
970
  // src/actions/lint.ts
1070
- import chalk15 from "chalk";
1071
- var lintPackage = /* @__PURE__ */ __name(({ pkg, fix: fix2 }) => {
1072
- console.log(chalk15.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
971
+ import chalk16 from "chalk";
972
+ var lintPackage = ({ pkg, fix: fix2 }) => {
973
+ console.log(chalk16.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
1073
974
  const start = Date.now();
1074
975
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
1075
- [
1076
- "yarn",
1077
- [
1078
- "workspace",
1079
- pkg,
1080
- "run",
1081
- fix2 ? "package-fix" : "package-lint"
1082
- ]
1083
- ]
976
+ ["yarn", [
977
+ "workspace",
978
+ pkg,
979
+ "run",
980
+ fix2 ? "package-fix" : "package-lint"
981
+ ]]
1084
982
  ]);
1085
- console.log(chalk15.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk15.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk15.gray("seconds")}`));
983
+ console.log(chalk16.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk16.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk16.gray("seconds")}`));
1086
984
  return result;
1087
- }, "lintPackage");
1088
- var lint = /* @__PURE__ */ __name(({ pkg, verbose, incremental, fix: fix2 } = {}) => {
1089
- return pkg ? lintPackage({
1090
- pkg,
1091
- fix: fix2
1092
- }) : lintAllPackages({
985
+ };
986
+ var lint = ({
987
+ pkg,
988
+ verbose,
989
+ incremental,
990
+ fix: fix2
991
+ } = {}) => {
992
+ return pkg ? lintPackage({ pkg, fix: fix2 }) : lintAllPackages({
1093
993
  verbose,
1094
994
  incremental,
1095
995
  fix: fix2
1096
996
  });
1097
- }, "lint");
1098
- var lintAllPackages = /* @__PURE__ */ __name(({ fix: fix2 = false } = {}) => {
1099
- console.log(chalk15.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
997
+ };
998
+ var lintAllPackages = ({ fix: fix2 = false } = {}) => {
999
+ console.log(chalk16.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
1100
1000
  const start = Date.now();
1001
+ const fixOptions = fix2 ? ["--fix"] : [];
1101
1002
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
1102
- [
1103
- "yarn",
1104
- [
1105
- "eslint"
1106
- ]
1107
- ]
1003
+ ["yarn", ["eslint", ...fixOptions]]
1108
1004
  ]);
1109
- console.log(chalk15.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk15.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk15.gray("seconds")}`));
1005
+ console.log(chalk16.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk16.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk16.gray("seconds")}`));
1110
1006
  return result;
1111
- }, "lintAllPackages");
1007
+ };
1112
1008
 
1113
1009
  // src/actions/fix.ts
1114
- var fix = /* @__PURE__ */ __name((params) => {
1115
- return lint({
1116
- ...params,
1117
- fix: true
1118
- });
1119
- }, "fix");
1010
+ var fix = (params) => {
1011
+ return lint({ ...params, fix: true });
1012
+ };
1120
1013
 
1121
1014
  // src/actions/gen-docs.ts
1122
- var genDocs = /* @__PURE__ */ __name(({ pkg, incremental }) => {
1123
- return pkg ? genDocsPackage({
1124
- pkg
1125
- }) : genDocsAll({
1126
- incremental
1127
- });
1128
- }, "genDocs");
1129
- var genDocsPackage = /* @__PURE__ */ __name(({ pkg }) => {
1130
- const steps = [
1131
- [
1132
- "yarn",
1133
- [
1134
- "workspace",
1135
- pkg,
1136
- "run",
1137
- "package-gen-docs"
1138
- ]
1139
- ]
1140
- ];
1141
- return runSteps(`GenDocs [${pkg}]`, [
1142
- ...steps
1143
- ]);
1144
- }, "genDocsPackage");
1145
- var genDocsAll = /* @__PURE__ */ __name(({ incremental }) => {
1146
- const incrementalOptions = incremental ? [
1147
- "--since",
1148
- "-pA"
1149
- ] : [
1150
- "-pA"
1151
- ];
1152
- const steps = [
1153
- [
1154
- "yarn",
1155
- [
1156
- "workspaces",
1157
- "foreach",
1158
- ...incrementalOptions,
1159
- "run",
1160
- "package-gen-docs"
1161
- ]
1162
- ]
1163
- ];
1164
- return runSteps(`GenDocs [All${incremental ? "-Incremental" : ""}]`, [
1165
- ...steps
1166
- ]);
1167
- }, "genDocsAll");
1015
+ var genDocs = ({ pkg, incremental }) => {
1016
+ return pkg ? genDocsPackage({ pkg }) : genDocsAll({ incremental });
1017
+ };
1018
+ var genDocsPackage = ({ pkg }) => {
1019
+ const steps = [["yarn", ["workspace", pkg, "run", "package-gen-docs"]]];
1020
+ return runSteps(`GenDocs [${pkg}]`, [...steps]);
1021
+ };
1022
+ var genDocsAll = ({ incremental }) => {
1023
+ const incrementalOptions = incremental ? ["--since", "-pA"] : ["-pA"];
1024
+ const steps = [["yarn", ["workspaces", "foreach", ...incrementalOptions, "run", "package-gen-docs"]]];
1025
+ return runSteps(`GenDocs [All${incremental ? "-Incremental" : ""}]`, [...steps]);
1026
+ };
1168
1027
 
1169
1028
  // src/actions/gitignore-gen.ts
1170
1029
  var filename = ".gitignore";
1171
- var gitignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename, pkg), "gitignoreGen");
1030
+ var gitignoreGen = (pkg) => generateIgnoreFiles(filename, pkg);
1172
1031
 
1173
1032
  // src/actions/gitlint.ts
1174
- import chalk16 from "chalk";
1033
+ import chalk17 from "chalk";
1175
1034
  import ParseGitConfig from "parse-git-config";
1176
- var gitlint = /* @__PURE__ */ __name(() => {
1035
+ var gitlint = () => {
1177
1036
  console.log(`
1178
1037
  Gitlint Start [${process.cwd()}]
1179
1038
  `);
@@ -1181,10 +1040,10 @@ Gitlint Start [${process.cwd()}]
1181
1040
  let warnings = 0;
1182
1041
  const errors = 0;
1183
1042
  const gitConfig = ParseGitConfig.sync();
1184
- const warn = /* @__PURE__ */ __name((message) => {
1185
- console.warn(chalk16.yellow(`Warning: ${message}`));
1043
+ const warn = (message) => {
1044
+ console.warn(chalk17.yellow(`Warning: ${message}`));
1186
1045
  warnings++;
1187
- }, "warn");
1046
+ };
1188
1047
  if (gitConfig.core.ignorecase) {
1189
1048
  warn("Please set core.ignorecase to FALSE in .git/config file [run yarn gitlint-fix]");
1190
1049
  } else {
@@ -1202,67 +1061,52 @@ Gitlint Start [${process.cwd()}]
1202
1061
  }
1203
1062
  const resultMessages = [];
1204
1063
  if (valid > 0) {
1205
- resultMessages.push(chalk16.green(`Passed: ${valid}`));
1064
+ resultMessages.push(chalk17.green(`Passed: ${valid}`));
1206
1065
  }
1207
1066
  if (warnings > 0) {
1208
- resultMessages.push(chalk16.yellow(`Warnings: ${warnings}`));
1067
+ resultMessages.push(chalk17.yellow(`Warnings: ${warnings}`));
1209
1068
  }
1210
1069
  if (errors > 0) {
1211
- resultMessages.push(chalk16.red(` Errors: ${errors}`));
1070
+ resultMessages.push(chalk17.red(` Errors: ${errors}`));
1212
1071
  }
1213
1072
  console.warn(`Gitlint Finish [ ${resultMessages.join(" | ")} ]
1214
1073
  `);
1215
1074
  return warnings + errors === 0 ? 1 : 0;
1216
- }, "gitlint");
1075
+ };
1217
1076
 
1218
1077
  // src/actions/gitlint-fix.ts
1219
1078
  import { execSync as execSync2 } from "node:child_process";
1220
- import chalk17 from "chalk";
1079
+ import chalk18 from "chalk";
1221
1080
  import ParseGitConfig2 from "parse-git-config";
1222
- var gitlintFix = /* @__PURE__ */ __name(() => {
1081
+ var gitlintFix = () => {
1223
1082
  console.log(`
1224
1083
  Gitlint Fix Start [${process.cwd()}]
1225
1084
  `);
1226
1085
  const gitConfig = ParseGitConfig2.sync();
1227
1086
  if (gitConfig.core.ignorecase) {
1228
- execSync2("git config core.ignorecase false", {
1229
- stdio: "inherit"
1230
- });
1231
- console.warn(chalk17.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
1087
+ execSync2("git config core.ignorecase false", { stdio: "inherit" });
1088
+ console.warn(chalk18.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
1232
1089
  }
1233
1090
  if (gitConfig.core.autocrlf !== false) {
1234
- execSync2("git config core.autocrlf false", {
1235
- stdio: "inherit"
1236
- });
1237
- console.warn(chalk17.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
1091
+ execSync2("git config core.autocrlf false", { stdio: "inherit" });
1092
+ console.warn(chalk18.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
1238
1093
  }
1239
1094
  if (gitConfig.core.eol !== "lf") {
1240
- execSync2("git config core.eol lf", {
1241
- stdio: "inherit"
1242
- });
1243
- console.warn(chalk17.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
1095
+ execSync2("git config core.eol lf", { stdio: "inherit" });
1096
+ console.warn(chalk18.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
1244
1097
  }
1245
1098
  return 1;
1246
- }, "gitlintFix");
1099
+ };
1247
1100
 
1248
1101
  // src/actions/knip.ts
1249
- var knip = /* @__PURE__ */ __name(() => {
1250
- return runSteps("Knip", [
1251
- [
1252
- "yarn",
1253
- [
1254
- "knip",
1255
- "--dependencies",
1256
- "--no-exit-code"
1257
- ]
1258
- ]
1259
- ]);
1260
- }, "knip");
1102
+ var knip = () => {
1103
+ return runSteps("Knip", [["yarn", ["knip", "--dependencies", "--no-exit-code"]]]);
1104
+ };
1261
1105
 
1262
1106
  // src/actions/license.ts
1263
- import chalk18 from "chalk";
1107
+ import chalk19 from "chalk";
1264
1108
  import { init } from "license-checker";
1265
- var license = /* @__PURE__ */ __name(async (pkg) => {
1109
+ var license = async (pkg) => {
1266
1110
  const workspaces = yarnWorkspaces();
1267
1111
  const workspaceList = workspaces.filter(({ name }) => {
1268
1112
  return pkg === void 0 || name === pkg;
@@ -1285,112 +1129,98 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
1285
1129
  "LGPL-3.0-or-later",
1286
1130
  "Python-2.0"
1287
1131
  ]);
1288
- console.log(chalk18.green("License Checker"));
1289
- return (await Promise.all(workspaceList.map(({ location, name }) => {
1290
- return new Promise((resolve) => {
1291
- init({
1292
- production: true,
1293
- start: location
1294
- }, (error, packages) => {
1295
- if (error) {
1296
- console.error(chalk18.red(`License Checker [${name}] Error`));
1297
- console.error(chalk18.gray(error));
1298
- console.log("\n");
1299
- resolve(1);
1300
- } else {
1301
- console.log(chalk18.green(`License Checker [${name}]`));
1302
- let count = 0;
1303
- for (const [name2, info] of Object.entries(packages)) {
1304
- const licenses = Array.isArray(info.licenses) ? info.licenses : [
1305
- info.licenses
1306
- ];
1307
- for (let license2 of licenses) {
1308
- if (license2) {
1309
- const processedLicense = license2[0] === "(" && license2.at(-1) === ")" ? license2.slice(1, -2) : license2;
1310
- const orLicenses = processedLicense.split(" OR ");
1311
- let orLicenseFound = false;
1312
- for (const orLicense of orLicenses) {
1313
- if (exclude.has(orLicense)) {
1314
- orLicenseFound = true;
1132
+ console.log(chalk19.green("License Checker"));
1133
+ return (await Promise.all(
1134
+ workspaceList.map(({ location, name }) => {
1135
+ return new Promise((resolve) => {
1136
+ init({ production: true, start: location }, (error, packages) => {
1137
+ if (error) {
1138
+ console.error(chalk19.red(`License Checker [${name}] Error`));
1139
+ console.error(chalk19.gray(error));
1140
+ console.log("\n");
1141
+ resolve(1);
1142
+ } else {
1143
+ console.log(chalk19.green(`License Checker [${name}]`));
1144
+ let count = 0;
1145
+ for (const [name2, info] of Object.entries(packages)) {
1146
+ const licenses = Array.isArray(info.licenses) ? info.licenses : [info.licenses];
1147
+ for (let license2 of licenses) {
1148
+ if (license2) {
1149
+ const processedLicense = license2[0] === "(" && license2.at(-1) === ")" ? license2.slice(1, -2) : license2;
1150
+ const orLicenses = processedLicense.split(" OR ");
1151
+ let orLicenseFound = false;
1152
+ for (const orLicense of orLicenses) {
1153
+ if (exclude.has(orLicense)) {
1154
+ orLicenseFound = true;
1155
+ }
1156
+ }
1157
+ if (!orLicenseFound) {
1158
+ count++;
1159
+ console.warn(chalk19.yellow(`${name2}: Package License not allowed [${license2}]`));
1315
1160
  }
1316
- }
1317
- if (!orLicenseFound) {
1318
- count++;
1319
- console.warn(chalk18.yellow(`${name2}: Package License not allowed [${license2}]`));
1320
1161
  }
1321
1162
  }
1322
1163
  }
1164
+ console.log("\n");
1165
+ resolve(count);
1323
1166
  }
1324
- console.log("\n");
1325
- resolve(count);
1326
- }
1167
+ });
1327
1168
  });
1328
- });
1329
- }))).reduce((prev, value) => prev || value, 0);
1330
- }, "license");
1169
+ })
1170
+ )).reduce((prev, value) => prev || value, 0);
1171
+ };
1331
1172
 
1332
1173
  // src/actions/npmignore-gen.ts
1333
1174
  var filename2 = ".npmignore";
1334
- var npmignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename2, pkg), "npmignoreGen");
1175
+ var npmignoreGen = (pkg) => generateIgnoreFiles(filename2, pkg);
1335
1176
 
1336
1177
  // src/actions/package/clean-outputs.ts
1337
- import path3 from "node:path";
1338
- import chalk19 from "chalk";
1339
- var packageCleanOutputs = /* @__PURE__ */ __name(() => {
1178
+ import path4 from "node:path";
1179
+ import chalk20 from "chalk";
1180
+ var packageCleanOutputs = () => {
1340
1181
  const pkg = process.env.INIT_CWD ?? ".";
1341
1182
  const pkgName = process.env.npm_package_name;
1342
- const folders = [
1343
- path3.join(pkg, "dist"),
1344
- path3.join(pkg, "build"),
1345
- path3.join(pkg, "docs")
1346
- ];
1347
- console.log(chalk19.green(`Cleaning Outputs [${pkgName}]`));
1183
+ const folders = [path4.join(pkg, "dist"), path4.join(pkg, "build"), path4.join(pkg, "docs")];
1184
+ console.log(chalk20.green(`Cleaning Outputs [${pkgName}]`));
1348
1185
  for (let folder of folders) {
1349
1186
  deleteGlob(folder);
1350
1187
  }
1351
1188
  return 0;
1352
- }, "packageCleanOutputs");
1189
+ };
1353
1190
 
1354
1191
  // src/actions/package/clean-typescript.ts
1355
- import path4 from "node:path";
1356
- import chalk20 from "chalk";
1357
- var packageCleanTypescript = /* @__PURE__ */ __name(() => {
1192
+ import path5 from "node:path";
1193
+ import chalk21 from "chalk";
1194
+ var packageCleanTypescript = () => {
1358
1195
  const pkg = process.env.INIT_CWD ?? ".";
1359
1196
  const pkgName = process.env.npm_package_name;
1360
- console.log(chalk20.green(`Cleaning Typescript [${pkgName}]`));
1361
- const files = [
1362
- path4.join(pkg, "*.tsbuildinfo"),
1363
- path4.join(pkg, ".tsconfig.*"),
1364
- path4.join(pkg, ".eslintcache")
1365
- ];
1197
+ console.log(chalk21.green(`Cleaning Typescript [${pkgName}]`));
1198
+ const files = [path5.join(pkg, "*.tsbuildinfo"), path5.join(pkg, ".tsconfig.*"), path5.join(pkg, ".eslintcache")];
1366
1199
  for (let file of files) {
1367
1200
  deleteGlob(file);
1368
1201
  }
1369
1202
  return 0;
1370
- }, "packageCleanTypescript");
1203
+ };
1371
1204
 
1372
1205
  // src/actions/package/clean.ts
1373
- var packageClean = /* @__PURE__ */ __name(async () => {
1374
- return (await Promise.all([
1375
- packageCleanOutputs(),
1376
- packageCleanTypescript()
1377
- ])).reduce((prev, value) => prev + value, 0);
1378
- }, "packageClean");
1206
+ var packageClean = async () => {
1207
+ return (await Promise.all([packageCleanOutputs(), packageCleanTypescript()])).reduce((prev, value) => prev + value, 0);
1208
+ };
1379
1209
 
1380
1210
  // src/actions/package/compile/compile.ts
1381
- import chalk24 from "chalk";
1211
+ import chalk25 from "chalk";
1382
1212
 
1383
1213
  // src/actions/package/publint.ts
1384
- import { promises as fs2 } from "node:fs";
1385
- import chalk21 from "chalk";
1214
+ import { promises as fs3 } from "node:fs";
1215
+ import chalk22 from "chalk";
1386
1216
  import sortPackageJson from "sort-package-json";
1387
- var packagePublint = /* @__PURE__ */ __name(async (params) => {
1217
+ var packagePublint = async (params) => {
1388
1218
  const pkgDir = process.env.INIT_CWD;
1389
- const sortedPkg = sortPackageJson(await fs2.readFile(`${pkgDir}/package.json`, "utf8"));
1390
- await fs2.writeFile(`${pkgDir}/package.json`, sortedPkg);
1391
- const pkg = JSON.parse(await fs2.readFile(`${pkgDir}/package.json`, "utf8"));
1392
- console.log(chalk21.green(`Publint: ${pkg.name}`));
1393
- console.log(chalk21.gray(pkgDir));
1219
+ const sortedPkg = sortPackageJson(await fs3.readFile(`${pkgDir}/package.json`, "utf8"));
1220
+ await fs3.writeFile(`${pkgDir}/package.json`, sortedPkg);
1221
+ const pkg = JSON.parse(await fs3.readFile(`${pkgDir}/package.json`, "utf8"));
1222
+ console.log(chalk22.green(`Publint: ${pkg.name}`));
1223
+ console.log(chalk22.gray(pkgDir));
1394
1224
  const { publint: publint2 } = await import("publint");
1395
1225
  const { messages } = await publint2({
1396
1226
  level: "suggestion",
@@ -1398,52 +1228,47 @@ var packagePublint = /* @__PURE__ */ __name(async (params) => {
1398
1228
  strict: true
1399
1229
  });
1400
1230
  const { formatMessage } = await import("publint/utils");
1401
- const validMessage = /* @__PURE__ */ __name((_message) => {
1231
+ const validMessage = (_message) => {
1402
1232
  return true;
1403
- }, "validMessage");
1233
+ };
1404
1234
  const validMessages = messages.filter(validMessage);
1405
1235
  for (const message of validMessages) {
1406
1236
  switch (message.type) {
1407
1237
  case "error": {
1408
- console.error(chalk21.red(`[${message.code}] ${formatMessage(message, pkg)}`));
1238
+ console.error(chalk22.red(`[${message.code}] ${formatMessage(message, pkg)}`));
1409
1239
  break;
1410
1240
  }
1411
1241
  case "warning": {
1412
- console.warn(chalk21.yellow(`[${message.code}] ${formatMessage(message, pkg)}`));
1242
+ console.warn(chalk22.yellow(`[${message.code}] ${formatMessage(message, pkg)}`));
1413
1243
  break;
1414
1244
  }
1415
1245
  default: {
1416
- console.log(chalk21.white(`[${message.code}] ${formatMessage(message, pkg)}`));
1246
+ console.log(chalk22.white(`[${message.code}] ${formatMessage(message, pkg)}`));
1417
1247
  break;
1418
1248
  }
1419
1249
  }
1420
1250
  }
1421
1251
  if (params?.verbose) {
1422
- console.log(chalk21.gray(`Publint [Finish]: ${pkgDir} [${validMessages.length}]`));
1252
+ console.log(chalk22.gray(`Publint [Finish]: ${pkgDir} [${validMessages.length}]`));
1423
1253
  }
1424
1254
  return validMessages.filter((message) => message.type === "error").length;
1425
- }, "packagePublint");
1255
+ };
1426
1256
 
1427
1257
  // src/actions/package/compile/packageCompileTsup.ts
1428
1258
  import { build as build2, defineConfig } from "tsup";
1429
1259
 
1430
1260
  // src/actions/package/compile/inputs.ts
1431
1261
  import { glob as glob2 } from "glob";
1432
- var getAllInputs = /* @__PURE__ */ __name((folder) => {
1433
- return glob2.sync(`${folder}/**/*.*`, {
1434
- posix: true
1435
- });
1436
- }, "getAllInputs");
1262
+ var getAllInputs = (folder) => {
1263
+ return glob2.sync(`${folder}/**/*.*`, { posix: true });
1264
+ };
1437
1265
 
1438
1266
  // src/actions/package/compile/buildEntries.ts
1439
- var buildEntries = /* @__PURE__ */ __name((folder, entryMode = "single", excludeSpecAndStories = true, verbose = false) => {
1267
+ var buildEntries = (folder, entryMode = "single", excludeSpecAndStories = true, verbose = false) => {
1440
1268
  let entries = [];
1441
1269
  switch (entryMode) {
1442
1270
  case "platform": {
1443
- entries = [
1444
- `${folder}/index-node.ts`,
1445
- `${folder}/index-browser.ts`
1446
- ];
1271
+ entries = [`${folder}/index-node.ts`, `${folder}/index-browser.ts`];
1447
1272
  break;
1448
1273
  }
1449
1274
  case "all": {
@@ -1451,46 +1276,53 @@ var buildEntries = /* @__PURE__ */ __name((folder, entryMode = "single", exclude
1451
1276
  break;
1452
1277
  }
1453
1278
  default: {
1454
- entries = [
1455
- `${folder}/index.ts`
1456
- ];
1279
+ entries = [`${folder}/index.ts`];
1457
1280
  break;
1458
1281
  }
1459
1282
  }
1460
1283
  if (verbose) console.log(`buildEntries [${entryMode}] ${entries.length}`);
1461
1284
  return entries;
1462
- }, "buildEntries");
1285
+ };
1463
1286
 
1464
1287
  // src/actions/package/compile/packageCompileTscTypes.ts
1465
1288
  import { cwd } from "node:process";
1466
- import chalk22 from "chalk";
1289
+ import chalk23 from "chalk";
1467
1290
  import { createProgramFromConfig } from "tsc-prog";
1468
- import { DiagnosticCategory, formatDiagnosticsWithColorAndContext, getPreEmitDiagnostics, sys as sys2 } from "typescript";
1291
+ import {
1292
+ DiagnosticCategory,
1293
+ formatDiagnosticsWithColorAndContext,
1294
+ getPreEmitDiagnostics,
1295
+ sys as sys2
1296
+ } from "typescript";
1469
1297
 
1470
1298
  // src/actions/package/compile/getCompilerOptions.ts
1471
1299
  import { createRequire } from "node:module";
1472
1300
  import deepmerge2 from "deepmerge";
1473
- import { findConfigFile, readConfigFile, sys } from "typescript";
1474
- var getNested = /* @__PURE__ */ __name((config2) => {
1301
+ import {
1302
+ findConfigFile,
1303
+ readConfigFile,
1304
+ sys
1305
+ } from "typescript";
1306
+ var getNested = (config2) => {
1475
1307
  if (config2.extends) {
1476
1308
  const require2 = createRequire(import.meta.url);
1477
1309
  const opts = require2(config2.extends);
1478
1310
  return deepmerge2(getNested(opts), config2.compilerOptions ?? {});
1479
1311
  }
1480
1312
  return config2.compilerOptions;
1481
- }, "getNested");
1482
- var getCompilerOptionsJSONFollowExtends = /* @__PURE__ */ __name((filename3) => {
1313
+ };
1314
+ var getCompilerOptionsJSONFollowExtends = (filename3) => {
1483
1315
  const config2 = readConfigFile(filename3, sys.readFile).config;
1484
1316
  return getNested(config2);
1485
- }, "getCompilerOptionsJSONFollowExtends");
1486
- var getCompilerOptions = /* @__PURE__ */ __name((options = {}, tsconfig = "tsconfig.json") => {
1317
+ };
1318
+ var getCompilerOptions = (options = {}, tsconfig = "tsconfig.json") => {
1487
1319
  const configFileName = findConfigFile("./", sys.fileExists, tsconfig);
1488
1320
  const configFileCompilerOptions = (configFileName ? getCompilerOptionsJSONFollowExtends(configFileName) : void 0) ?? {};
1489
1321
  return deepmerge2(configFileCompilerOptions, options);
1490
- }, "getCompilerOptions");
1322
+ };
1491
1323
 
1492
1324
  // src/actions/package/compile/packageCompileTscTypes.ts
1493
- var packageCompileTscTypes = /* @__PURE__ */ __name((folder = "src", config2 = {}, compilerOptionsParam) => {
1325
+ var packageCompileTscTypes = (folder = "src", config2 = {}, compilerOptionsParam) => {
1494
1326
  const pkg = process.env.INIT_CWD ?? cwd();
1495
1327
  const verbose = config2?.verbose ?? false;
1496
1328
  const compilerOptions = {
@@ -1506,54 +1338,40 @@ var packageCompileTscTypes = /* @__PURE__ */ __name((folder = "src", config2 = {
1506
1338
  emitDeclarationOnly: true,
1507
1339
  noEmit: false
1508
1340
  };
1509
- const validTsExt = [
1510
- ".ts",
1511
- ".tsx",
1512
- ".d.ts",
1513
- ".cts",
1514
- ".d.cts",
1515
- ".mts",
1516
- ".d.mts"
1517
- ];
1518
- const excludes = [
1519
- ".stories.",
1520
- ".spec."
1521
- ];
1341
+ const validTsExt = [".ts", ".tsx", ".d.ts", ".cts", ".d.cts", ".mts", ".d.mts"];
1342
+ const excludes = [".stories.", ".spec."];
1522
1343
  const files = buildEntries(folder, "all", verbose).filter((file) => validTsExt.find((ext) => file.endsWith(ext)) && !excludes.some((exclude) => file.includes(exclude)));
1523
- console.log(chalk22.green(`Compiling Types ${pkg}: ${files.length}`));
1344
+ console.log(chalk23.green(`Compiling Types ${pkg}: ${files.length}`));
1524
1345
  if (files.length > 0) {
1525
1346
  const program = createProgramFromConfig({
1526
1347
  basePath: pkg ?? cwd(),
1527
1348
  compilerOptions,
1528
- exclude: [
1529
- "dist",
1530
- "docs",
1531
- "**/*.spec.*",
1532
- "**/*.stories.*",
1533
- "src/**/spec/**/*"
1534
- ],
1349
+ exclude: ["dist", "docs", "**/*.spec.*", "**/*.stories.*", "src/**/spec/**/*"],
1535
1350
  files
1536
1351
  });
1537
1352
  const diagnostics = getPreEmitDiagnostics(program);
1538
1353
  if (diagnostics.length > 0) {
1539
- const formattedDiagnostics = formatDiagnosticsWithColorAndContext(diagnostics, {
1540
- getCanonicalFileName: /* @__PURE__ */ __name((fileName) => fileName, "getCanonicalFileName"),
1541
- getCurrentDirectory: /* @__PURE__ */ __name(() => folder, "getCurrentDirectory"),
1542
- getNewLine: /* @__PURE__ */ __name(() => sys2.newLine, "getNewLine")
1543
- });
1354
+ const formattedDiagnostics = formatDiagnosticsWithColorAndContext(
1355
+ diagnostics,
1356
+ {
1357
+ getCanonicalFileName: (fileName) => fileName,
1358
+ getCurrentDirectory: () => folder,
1359
+ getNewLine: () => sys2.newLine
1360
+ }
1361
+ );
1544
1362
  console.error(formattedDiagnostics);
1545
1363
  }
1546
1364
  program.emit();
1547
1365
  return diagnostics.reduce((acc, diag) => acc + (diag.category === DiagnosticCategory.Error ? 1 : 0), 0);
1548
1366
  }
1549
1367
  return 0;
1550
- }, "packageCompileTscTypes");
1368
+ };
1551
1369
 
1552
1370
  // src/actions/package/compile/compileTypes.ts
1553
- var packageCompileTypes = /* @__PURE__ */ __name(async (inConfig = {}) => {
1371
+ var packageCompileTypes = async (inConfig = {}) => {
1554
1372
  const config2 = await loadConfig(inConfig);
1555
1373
  return packageCompileTscTypes(void 0, config2);
1556
- }, "packageCompileTypes");
1374
+ };
1557
1375
 
1558
1376
  // src/actions/package/compile/deepMerge.ts
1559
1377
  function deepMerge(target, source) {
@@ -1570,7 +1388,6 @@ function deepMerge(target, source) {
1570
1388
  }
1571
1389
  return target;
1572
1390
  }
1573
- __name(deepMerge, "deepMerge");
1574
1391
  function deepMergeObjects(objects) {
1575
1392
  const result = {};
1576
1393
  for (const obj of objects) {
@@ -1578,14 +1395,18 @@ function deepMergeObjects(objects) {
1578
1395
  }
1579
1396
  return result;
1580
1397
  }
1581
- __name(deepMergeObjects, "deepMergeObjects");
1582
1398
 
1583
1399
  // src/actions/package/compile/packageCompileTsc.ts
1584
1400
  import { cwd as cwd2 } from "node:process";
1585
- import chalk23 from "chalk";
1401
+ import chalk24 from "chalk";
1586
1402
  import { createProgramFromConfig as createProgramFromConfig2 } from "tsc-prog";
1587
- import { DiagnosticCategory as DiagnosticCategory2, formatDiagnosticsWithColorAndContext as formatDiagnosticsWithColorAndContext2, getPreEmitDiagnostics as getPreEmitDiagnostics2, sys as sys3 } from "typescript";
1588
- var packageCompileTsc = /* @__PURE__ */ __name((folder = "src", config2 = {}, compilerOptionsParam) => {
1403
+ import {
1404
+ DiagnosticCategory as DiagnosticCategory2,
1405
+ formatDiagnosticsWithColorAndContext as formatDiagnosticsWithColorAndContext2,
1406
+ getPreEmitDiagnostics as getPreEmitDiagnostics2,
1407
+ sys as sys3
1408
+ } from "typescript";
1409
+ var packageCompileTsc = (folder = "src", config2 = {}, compilerOptionsParam) => {
1589
1410
  const pkg = process.env.INIT_CWD ?? cwd2();
1590
1411
  const verbose = config2?.verbose ?? false;
1591
1412
  const compilerOptions = {
@@ -1600,51 +1421,37 @@ var packageCompileTsc = /* @__PURE__ */ __name((folder = "src", config2 = {}, co
1600
1421
  emitDeclarationOnly: false,
1601
1422
  noEmit: true
1602
1423
  };
1603
- const validTsExt = [
1604
- ".ts",
1605
- ".tsx",
1606
- ".d.ts",
1607
- ".cts",
1608
- ".d.cts",
1609
- ".mts",
1610
- ".d.mts"
1611
- ];
1612
- const includes = [
1613
- ".stories.",
1614
- ".spec.",
1615
- ".d.ts",
1616
- ".d.cts",
1617
- ".d.mts"
1618
- ];
1424
+ const validTsExt = [".ts", ".tsx", ".d.ts", ".cts", ".d.cts", ".mts", ".d.mts"];
1425
+ const includes = [".stories.", ".spec.", ".d.ts", ".d.cts", ".d.mts"];
1619
1426
  const files = buildEntries(folder, "all", verbose).filter((file) => validTsExt.find((ext) => file.endsWith(ext)) && includes.find((include) => file.includes(include)));
1620
- console.log(chalk23.green(`Compiling Files ${pkg}: ${files.length}`));
1427
+ console.log(chalk24.green(`Compiling Files ${pkg}: ${files.length}`));
1621
1428
  if (files.length > 0) {
1622
1429
  const program = createProgramFromConfig2({
1623
1430
  basePath: pkg ?? cwd2(),
1624
1431
  compilerOptions,
1625
- exclude: [
1626
- "dist",
1627
- "docs"
1628
- ],
1432
+ exclude: ["dist", "docs"],
1629
1433
  files
1630
1434
  });
1631
1435
  const diagnostics = getPreEmitDiagnostics2(program);
1632
1436
  if (diagnostics.length > 0) {
1633
- const formattedDiagnostics = formatDiagnosticsWithColorAndContext2(diagnostics, {
1634
- getCanonicalFileName: /* @__PURE__ */ __name((fileName) => fileName, "getCanonicalFileName"),
1635
- getCurrentDirectory: /* @__PURE__ */ __name(() => folder, "getCurrentDirectory"),
1636
- getNewLine: /* @__PURE__ */ __name(() => sys3.newLine, "getNewLine")
1637
- });
1437
+ const formattedDiagnostics = formatDiagnosticsWithColorAndContext2(
1438
+ diagnostics,
1439
+ {
1440
+ getCanonicalFileName: (fileName) => fileName,
1441
+ getCurrentDirectory: () => folder,
1442
+ getNewLine: () => sys3.newLine
1443
+ }
1444
+ );
1638
1445
  console.error(formattedDiagnostics);
1639
1446
  }
1640
1447
  program.emit();
1641
1448
  return diagnostics.reduce((acc, diag) => acc + (diag.category === DiagnosticCategory2.Error ? 1 : 0), 0);
1642
1449
  }
1643
1450
  return 0;
1644
- }, "packageCompileTsc");
1451
+ };
1645
1452
 
1646
1453
  // src/actions/package/compile/packageCompileTsup.ts
1647
- var compileFolder = /* @__PURE__ */ __name(async (folder, entryMode = "single", options, verbose) => {
1454
+ var compileFolder = async (folder, entryMode = "single", options, verbose) => {
1648
1455
  const outDir = options?.outDir ?? "dist";
1649
1456
  if (verbose) {
1650
1457
  console.log(`compileFolder [${folder}]`);
@@ -1656,9 +1463,7 @@ var compileFolder = /* @__PURE__ */ __name(async (folder, entryMode = "single",
1656
1463
  clean: true,
1657
1464
  dts: false,
1658
1465
  entry,
1659
- format: [
1660
- "esm"
1661
- ],
1466
+ format: ["esm"],
1662
1467
  outDir,
1663
1468
  silent: true,
1664
1469
  sourcemap: true,
@@ -1666,16 +1471,12 @@ var compileFolder = /* @__PURE__ */ __name(async (folder, entryMode = "single",
1666
1471
  tsconfig: "tsconfig.json",
1667
1472
  ...options
1668
1473
  });
1669
- const optionsList = (await Promise.all((Array.isArray(optionsResult) ? optionsResult : [
1670
- optionsResult
1671
- ]).flatMap(async (options2) => {
1672
- const result = typeof options2 === "function" ? await options2({}) : [
1673
- options2
1674
- ];
1675
- return Array.isArray(result) ? result : [
1676
- result
1677
- ];
1678
- }))).flat();
1474
+ const optionsList = (await Promise.all(
1475
+ (Array.isArray(optionsResult) ? optionsResult : [optionsResult]).flatMap(async (options2) => {
1476
+ const result = typeof options2 === "function" ? await options2({}) : [options2];
1477
+ return Array.isArray(result) ? result : [result];
1478
+ })
1479
+ )).flat();
1679
1480
  if (verbose) {
1680
1481
  console.log(`TSUP:build:start [${folder}]`);
1681
1482
  }
@@ -1684,8 +1485,8 @@ var compileFolder = /* @__PURE__ */ __name(async (folder, entryMode = "single",
1684
1485
  console.log(`TSUP:build:stop [${folder}]`);
1685
1486
  }
1686
1487
  return 0;
1687
- }, "compileFolder");
1688
- var tsupOptions = /* @__PURE__ */ __name((options = []) => {
1488
+ };
1489
+ var tsupOptions = (options = []) => {
1689
1490
  const standardLoaders = {
1690
1491
  ".gif": "copy",
1691
1492
  ".html": "copy",
@@ -1697,39 +1498,24 @@ var tsupOptions = /* @__PURE__ */ __name((options = []) => {
1697
1498
  };
1698
1499
  const standardOptions = {
1699
1500
  bundle: true,
1700
- format: [
1701
- "esm"
1702
- ],
1501
+ format: ["esm"],
1703
1502
  loader: standardLoaders,
1704
- outExtension: /* @__PURE__ */ __name(({ format }) => format === "esm" ? {
1705
- js: ".mjs"
1706
- } : {
1707
- js: ".cjs"
1708
- }, "outExtension"),
1503
+ outExtension: ({ format }) => format === "esm" ? { js: ".mjs" } : { js: ".cjs" },
1709
1504
  skipNodeModulesBundle: true,
1710
1505
  sourcemap: true,
1711
1506
  target: "esnext"
1712
1507
  };
1713
- return deepMergeObjects([
1714
- standardOptions,
1715
- ...options
1716
- ]);
1717
- }, "tsupOptions");
1718
- var packageCompileTsup = /* @__PURE__ */ __name(async (config2) => {
1508
+ return deepMergeObjects([standardOptions, ...options]);
1509
+ };
1510
+ var packageCompileTsup = async (config2) => {
1719
1511
  const compile2 = config2?.compile;
1720
1512
  const verbose = config2?.verbose ?? false;
1721
1513
  if (verbose) {
1722
1514
  console.log(`Compiling with TSUP [Depth: ${compile2?.depth}]`);
1723
1515
  }
1724
- const compileForNode = compile2?.node ?? {
1725
- src: {}
1726
- };
1727
- const compileForBrowser = compile2?.browser ?? {
1728
- src: {}
1729
- };
1730
- const compileForNeutral = compile2?.neutral ?? {
1731
- src: {}
1732
- };
1516
+ const compileForNode = compile2?.node ?? { src: {} };
1517
+ const compileForBrowser = compile2?.browser ?? { src: {} };
1518
+ const compileForNeutral = compile2?.neutral ?? { src: {} };
1733
1519
  if (verbose) {
1734
1520
  console.log("Calling packageCompileTscTypes");
1735
1521
  }
@@ -1738,46 +1524,58 @@ var packageCompileTsup = /* @__PURE__ */ __name(async (config2) => {
1738
1524
  if (errors > 0) {
1739
1525
  return errors;
1740
1526
  }
1741
- return (await Promise.all(Object.entries(compileForNode).map(async ([folder, options]) => {
1742
- const inEsBuildOptions = typeof compile2?.node?.esbuildOptions === "object" ? compile2?.node?.esbuildOptions : {};
1743
- return folder ? await compileFolder(folder, compile2?.entryMode, tsupOptions([
1744
- inEsBuildOptions,
1745
- compile2?.tsup?.options ?? {},
1746
- typeof options === "object" ? options : {},
1747
- {
1748
- platform: "node",
1749
- outDir: "dist/node"
1750
- }
1751
- ]), verbose) : 0;
1752
- }))).reduce((prev, value) => prev + value, 0) || (await Promise.all(Object.entries(compileForBrowser).map(async ([folder, options]) => {
1753
- const inEsBuildOptions = typeof compile2?.browser?.esbuildOptions === "object" ? compile2?.browser?.esbuildOptions : {};
1754
- return folder ? await compileFolder(folder, compile2?.entryMode, tsupOptions([
1755
- inEsBuildOptions,
1756
- compile2?.tsup?.options ?? {},
1757
- typeof options === "object" ? options : {},
1758
- {
1759
- platform: "browser",
1760
- outDir: "dist/browser"
1761
- }
1762
- ]), verbose) : 0;
1763
- }))).reduce((prev, value) => prev + value, 0) || (await Promise.all(Object.entries(compileForNeutral).map(async ([folder, options]) => {
1764
- const inEsBuildOptions = typeof compile2?.neutral?.esbuildOptions === "object" ? compile2?.neutral?.esbuildOptions : {};
1765
- return folder ? await compileFolder(folder, compile2?.entryMode, tsupOptions([
1766
- inEsBuildOptions,
1767
- compile2?.tsup?.options ?? {},
1768
- typeof options === "object" ? options : {},
1769
- {
1770
- platform: "neutral",
1771
- outDir: "dist/neutral"
1772
- }
1773
- ]), verbose) : 0;
1774
- }))).reduce((prev, value) => prev + value, 0) || 0;
1775
- }, "packageCompileTsup");
1527
+ return (await Promise.all(
1528
+ Object.entries(compileForNode).map(async ([folder, options]) => {
1529
+ const inEsBuildOptions = typeof compile2?.node?.esbuildOptions === "object" ? compile2?.node?.esbuildOptions : {};
1530
+ return folder ? await compileFolder(
1531
+ folder,
1532
+ compile2?.entryMode,
1533
+ tsupOptions([
1534
+ inEsBuildOptions,
1535
+ compile2?.tsup?.options ?? {},
1536
+ typeof options === "object" ? options : {},
1537
+ { platform: "node", outDir: "dist/node" }
1538
+ ]),
1539
+ verbose
1540
+ ) : 0;
1541
+ })
1542
+ )).reduce((prev, value) => prev + value, 0) || (await Promise.all(
1543
+ Object.entries(compileForBrowser).map(async ([folder, options]) => {
1544
+ const inEsBuildOptions = typeof compile2?.browser?.esbuildOptions === "object" ? compile2?.browser?.esbuildOptions : {};
1545
+ return folder ? await compileFolder(
1546
+ folder,
1547
+ compile2?.entryMode,
1548
+ tsupOptions([
1549
+ inEsBuildOptions,
1550
+ compile2?.tsup?.options ?? {},
1551
+ typeof options === "object" ? options : {},
1552
+ { platform: "browser", outDir: "dist/browser" }
1553
+ ]),
1554
+ verbose
1555
+ ) : 0;
1556
+ })
1557
+ )).reduce((prev, value) => prev + value, 0) || (await Promise.all(
1558
+ Object.entries(compileForNeutral).map(async ([folder, options]) => {
1559
+ const inEsBuildOptions = typeof compile2?.neutral?.esbuildOptions === "object" ? compile2?.neutral?.esbuildOptions : {};
1560
+ return folder ? await compileFolder(
1561
+ folder,
1562
+ compile2?.entryMode,
1563
+ tsupOptions([
1564
+ inEsBuildOptions,
1565
+ compile2?.tsup?.options ?? {},
1566
+ typeof options === "object" ? options : {},
1567
+ { platform: "neutral", outDir: "dist/neutral" }
1568
+ ]),
1569
+ verbose
1570
+ ) : 0;
1571
+ })
1572
+ )).reduce((prev, value) => prev + value, 0) || 0;
1573
+ };
1776
1574
 
1777
1575
  // src/actions/package/compile/compile.ts
1778
- var packageCompile = /* @__PURE__ */ __name(async (inConfig = {}) => {
1576
+ var packageCompile = async (inConfig = {}) => {
1779
1577
  const pkg = process.env.INIT_CWD;
1780
- console.log(chalk24.green(`Compiling ${pkg}`));
1578
+ console.log(chalk25.green(`Compiling ${pkg}`));
1781
1579
  const config2 = await loadConfig(inConfig);
1782
1580
  const publint2 = config2.publint;
1783
1581
  const tsupResults = await packageCompileTsup(config2);
@@ -1785,30 +1583,24 @@ var packageCompile = /* @__PURE__ */ __name(async (inConfig = {}) => {
1785
1583
  return tsupResults;
1786
1584
  }
1787
1585
  return publint2 ? await packagePublint(config2) : 0;
1788
- }, "packageCompile");
1586
+ };
1789
1587
 
1790
1588
  // src/actions/package/copy-assets.ts
1791
- import path5 from "node:path/posix";
1792
- import chalk25 from "chalk";
1589
+ import path6 from "node:path/posix";
1590
+ import chalk26 from "chalk";
1793
1591
  import cpy2 from "cpy";
1794
- var copyTargetAssets2 = /* @__PURE__ */ __name(async (target, name, location) => {
1592
+ var copyTargetAssets2 = async (target, name, location) => {
1795
1593
  try {
1796
- const values = await cpy2([
1797
- "**/*.jpg",
1798
- "**/*.png",
1799
- "**/*.gif",
1800
- "**/*.svg",
1801
- "**/*.webp",
1802
- "**/*.sass",
1803
- "**/*.scss",
1804
- "**/*.gif",
1805
- "**/*.css"
1806
- ], `../dist/${target}`, {
1807
- cwd: path5.join(location, "src"),
1808
- flat: false
1809
- });
1594
+ const values = await cpy2(
1595
+ ["**/*.jpg", "**/*.png", "**/*.gif", "**/*.svg", "**/*.webp", "**/*.sass", "**/*.scss", "**/*.gif", "**/*.css"],
1596
+ `../dist/${target}`,
1597
+ {
1598
+ cwd: path6.join(location, "src"),
1599
+ flat: false
1600
+ }
1601
+ );
1810
1602
  if (values.length > 0) {
1811
- console.log(chalk25.green(`Copying Assets [${target.toUpperCase()}] - ${name} - ${location}`));
1603
+ console.log(chalk26.green(`Copying Assets [${target.toUpperCase()}] - ${name} - ${location}`));
1812
1604
  }
1813
1605
  for (const value of values) {
1814
1606
  console.log(`${value.split("/").pop()} => ./dist/${target}`);
@@ -1819,8 +1611,8 @@ var copyTargetAssets2 = /* @__PURE__ */ __name(async (target, name, location) =>
1819
1611
  console.log(`Copy Assets Failed: ${name}: ${error.message}`);
1820
1612
  return 1;
1821
1613
  }
1822
- }, "copyTargetAssets");
1823
- var packageCopyAssets = /* @__PURE__ */ __name(async ({ target }) => {
1614
+ };
1615
+ var packageCopyAssets = async ({ target }) => {
1824
1616
  const pkg = process.env.INIT_CWD ?? "./";
1825
1617
  const pkgName = process.env.npm_package_name ?? "Unknown";
1826
1618
  switch (target) {
@@ -1834,11 +1626,11 @@ var packageCopyAssets = /* @__PURE__ */ __name(async ({ target }) => {
1834
1626
  return await copyTargetAssets2("esm", pkgName, pkg) || await copyTargetAssets2("cjs", pkgName, pkg);
1835
1627
  }
1836
1628
  }
1837
- }, "packageCopyAssets");
1629
+ };
1838
1630
 
1839
1631
  // src/actions/package/cycle.ts
1840
1632
  import { cruise as cruise2 } from "dependency-cruiser";
1841
- var packageCycle = /* @__PURE__ */ __name(async ({ verbose = false }) => {
1633
+ var packageCycle = async ({ verbose = false }) => {
1842
1634
  const pkg = process.env.INIT_CWD;
1843
1635
  const pkgName = process.env.npm_package_name;
1844
1636
  const cruiseOptions = {
@@ -1849,26 +1641,20 @@ var packageCycle = /* @__PURE__ */ __name(async ({ verbose = false }) => {
1849
1641
  severity: "error",
1850
1642
  comment: "This dependency creates a circular reference",
1851
1643
  from: {},
1852
- to: {
1853
- circular: true
1854
- }
1644
+ to: { circular: true }
1855
1645
  }
1856
1646
  ]
1857
1647
  },
1858
1648
  exclude: "node_modules|packages/.*/packages",
1859
1649
  validate: true,
1860
- doNotFollow: {
1861
- path: "node_modules|packages/.*/packages"
1862
- },
1650
+ doNotFollow: { path: "node_modules|packages/.*/packages" },
1863
1651
  tsPreCompilationDeps: false,
1864
1652
  combinedDependencies: true,
1865
1653
  outputType: verbose ? "text" : "err"
1866
1654
  };
1867
1655
  const target = `${pkg}/src`;
1868
1656
  console.log(`Checking for circular dependencies in ${target}...`);
1869
- const result = await cruise2([
1870
- target
1871
- ], cruiseOptions);
1657
+ const result = await cruise2([target], cruiseOptions);
1872
1658
  if (result.output) {
1873
1659
  console.log(result.output);
1874
1660
  }
@@ -1878,13 +1664,18 @@ var packageCycle = /* @__PURE__ */ __name(async ({ verbose = false }) => {
1878
1664
  console.error(`${pkgName} \u274C Dependency violations found`);
1879
1665
  }
1880
1666
  return result.exitCode;
1881
- }, "packageCycle");
1667
+ };
1882
1668
 
1883
1669
  // src/actions/package/gen-docs.ts
1884
1670
  import { existsSync as existsSync5 } from "node:fs";
1885
- import path6 from "node:path";
1886
- import chalk26 from "chalk";
1887
- import { Application, ArgumentsReader, TSConfigReader, TypeDocReader } from "typedoc";
1671
+ import path7 from "node:path";
1672
+ import chalk27 from "chalk";
1673
+ import {
1674
+ Application,
1675
+ ArgumentsReader,
1676
+ TSConfigReader,
1677
+ TypeDocReader
1678
+ } from "typedoc";
1888
1679
  var ExitCodes = {
1889
1680
  CompileError: 3,
1890
1681
  ExceptionThrown: 6,
@@ -1894,17 +1685,14 @@ var ExitCodes = {
1894
1685
  OutputError: 5,
1895
1686
  ValidationError: 4
1896
1687
  };
1897
- var packageGenDocs = /* @__PURE__ */ __name(async () => {
1688
+ var packageGenDocs = async () => {
1898
1689
  const pkg = process.env.INIT_CWD;
1899
- if (pkg && !existsSync5(path6.join(pkg, "typedoc.json"))) {
1690
+ if (pkg && !existsSync5(path7.join(pkg, "typedoc.json"))) {
1900
1691
  return;
1901
1692
  }
1902
1693
  const app = await Application.bootstrap({
1903
1694
  entryPointStrategy: "merge",
1904
- entryPoints: [
1905
- `${pkg}/src/**/*.ts`,
1906
- `${pkg}/packages/*/dist/docs.json`
1907
- ],
1695
+ entryPoints: [`${pkg}/src/**/*.ts`, `${pkg}/packages/*/dist/docs.json`],
1908
1696
  excludeExternals: true,
1909
1697
  json: `${pkg}/dist/docs.json`,
1910
1698
  logLevel: "Error",
@@ -1915,8 +1703,8 @@ var packageGenDocs = /* @__PURE__ */ __name(async () => {
1915
1703
  app.options.addReader(new TSConfigReader());
1916
1704
  app.options.addReader(new ArgumentsReader(300));
1917
1705
  return await runTypeDoc(app);
1918
- }, "packageGenDocs");
1919
- var runTypeDoc = /* @__PURE__ */ __name(async (app) => {
1706
+ };
1707
+ var runTypeDoc = async (app) => {
1920
1708
  const pkgName = process.env.npm_package_name;
1921
1709
  if (app.options.getValue("version")) {
1922
1710
  console.log(app.toString());
@@ -1985,40 +1773,37 @@ var runTypeDoc = /* @__PURE__ */ __name(async (app) => {
1985
1773
  return ExitCodes.OutputError;
1986
1774
  }
1987
1775
  }
1988
- console.log(chalk26.green(`${pkgName} - Ok`));
1776
+ console.log(chalk27.green(`${pkgName} - Ok`));
1989
1777
  return ExitCodes.Ok;
1990
- }, "runTypeDoc");
1778
+ };
1991
1779
 
1992
1780
  // src/actions/package/lint.ts
1993
1781
  import { readdirSync } from "node:fs";
1994
- import path7 from "node:path";
1782
+ import path8 from "node:path";
1995
1783
  import { cwd as cwd3 } from "node:process";
1996
1784
  import { pathToFileURL } from "node:url";
1997
- import chalk27 from "chalk";
1785
+ import chalk28 from "chalk";
1998
1786
  import { ESLint } from "eslint";
1999
1787
  import { findUp } from "find-up";
2000
1788
  import picomatch from "picomatch";
2001
- var dumpMessages = /* @__PURE__ */ __name((lintResults) => {
2002
- const colors = [
2003
- "white",
2004
- "yellow",
2005
- "red"
2006
- ];
2007
- const severity = [
2008
- "none",
2009
- "warning",
2010
- "error"
2011
- ];
1789
+ var dumpMessages = (lintResults) => {
1790
+ const colors = ["white", "yellow", "red"];
1791
+ const severity = ["none", "warning", "error"];
2012
1792
  for (const lintResult of lintResults) {
2013
1793
  if (lintResult.messages.length > 0) {
2014
- console.log(chalk27.gray(`
1794
+ console.log(chalk28.gray(`
2015
1795
  ${lintResult.filePath}`));
2016
1796
  for (const message of lintResult.messages) {
2017
- console.log(chalk27.gray(` ${message.line}:${message.column}`), chalk27[colors[message.severity]](` ${severity[message.severity]}`), chalk27.white(` ${message.message}`), chalk27.gray(` ${message.ruleId}`));
1797
+ console.log(
1798
+ chalk28.gray(` ${message.line}:${message.column}`),
1799
+ chalk28[colors[message.severity]](` ${severity[message.severity]}`),
1800
+ chalk28.white(` ${message.message}`),
1801
+ chalk28.gray(` ${message.ruleId}`)
1802
+ );
2018
1803
  }
2019
1804
  }
2020
1805
  }
2021
- }, "dumpMessages");
1806
+ };
2022
1807
  async function getRootESLintConfig() {
2023
1808
  const configPath = await findUp("eslint.config.mjs");
2024
1809
  if (!configPath) {
@@ -2026,50 +1811,33 @@ async function getRootESLintConfig() {
2026
1811
  }
2027
1812
  return pathToFileURL(configPath);
2028
1813
  }
2029
- __name(getRootESLintConfig, "getRootESLintConfig");
2030
1814
  function getFiles(dir, ignoreFolders) {
2031
1815
  const currentDirectory = cwd3();
2032
1816
  const subDirectory = dir.split(currentDirectory)[1];
2033
1817
  if (ignoreFolders.includes(subDirectory)) return [];
2034
- return readdirSync(dir, {
2035
- withFileTypes: true
2036
- }).flatMap((dirent) => {
2037
- const res = path7.resolve(dir, dirent.name);
1818
+ return readdirSync(dir, { withFileTypes: true }).flatMap((dirent) => {
1819
+ const res = path8.resolve(dir, dirent.name);
2038
1820
  const relativePath = subDirectory ? `${subDirectory}/${dirent.name}` : dirent.name;
2039
1821
  const ignoreMatchers = ignoreFolders.map((pattern) => picomatch(pattern));
2040
1822
  if (ignoreMatchers.some((isMatch) => isMatch(relativePath))) return [];
2041
- return dirent.isDirectory() ? getFiles(res, ignoreFolders) : [
2042
- res
2043
- ];
1823
+ return dirent.isDirectory() ? getFiles(res, ignoreFolders) : [res];
2044
1824
  });
2045
1825
  }
2046
- __name(getFiles, "getFiles");
2047
- var packageLint = /* @__PURE__ */ __name(async (fix2 = false, verbose = false, cache = true) => {
1826
+ var packageLint = async (fix2 = false, verbose = false, cache = true) => {
2048
1827
  const pkg = process.env.INIT_CWD;
2049
1828
  const configPath = await getRootESLintConfig();
2050
1829
  const { default: eslintConfig } = await import(configPath.href);
2051
1830
  const start = Date.now();
2052
- const ignoreFolders = [
2053
- "node_modules",
2054
- "dist",
2055
- "packages",
2056
- ".git",
2057
- "build",
2058
- ".yarn",
2059
- ".vscode",
2060
- ".github"
2061
- ];
1831
+ const ignoreFolders = ["node_modules", "dist", "packages", ".git", "build", ".yarn", ".vscode", ".github"];
2062
1832
  const engine = new ESLint({
2063
- baseConfig: [
2064
- ...eslintConfig
2065
- ],
1833
+ baseConfig: [...eslintConfig],
2066
1834
  fix: fix2,
2067
1835
  warnIgnored: false,
2068
1836
  cache
2069
1837
  });
2070
1838
  const files = getFiles(cwd3(), ignoreFolders);
2071
1839
  if (verbose) {
2072
- console.log(chalk27.green(`Linting ${pkg} [files = ${files.length}]`));
1840
+ console.log(chalk28.green(`Linting ${pkg} [files = ${files.length}]`));
2073
1841
  }
2074
1842
  const lintResults = await engine.lintFiles(files);
2075
1843
  dumpMessages(lintResults);
@@ -2079,75 +1847,43 @@ var packageLint = /* @__PURE__ */ __name(async (fix2 = false, verbose = false, c
2079
1847
  const filesCountColor = files.length < 100 ? "green" : files.length < 1e3 ? "yellow" : "red";
2080
1848
  const lintTime = Date.now() - start;
2081
1849
  const lintTimeColor = lintTime < 1e3 ? "green" : lintTime < 3e3 ? "yellow" : "red";
2082
- console.log(chalk27.white(`Linted ${chalk27[filesCountColor](files.length)} files in ${chalk27[lintTimeColor](lintTime)}ms`));
1850
+ console.log(chalk28.white(`Linted ${chalk28[filesCountColor](files.length)} files in ${chalk28[lintTimeColor](lintTime)}ms`));
2083
1851
  return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
2084
- }, "packageLint");
1852
+ };
2085
1853
 
2086
1854
  // src/actions/package/recompile.ts
2087
- var packageRecompile = /* @__PURE__ */ __name(async () => {
1855
+ var packageRecompile = async () => {
2088
1856
  return await packageClean() || await packageCompile();
2089
- }, "packageRecompile");
1857
+ };
2090
1858
 
2091
1859
  // src/actions/publint.ts
2092
- var publint = /* @__PURE__ */ __name(async ({ verbose, pkg }) => {
2093
- return pkg ? await publintPackage({
2094
- pkg,
2095
- verbose
2096
- }) : publintAll({
2097
- verbose
2098
- });
2099
- }, "publint");
2100
- var publintPackage = /* @__PURE__ */ __name(({ pkg }) => {
2101
- return runStepsAsync(`Publint [${pkg}]`, [
2102
- [
2103
- "yarn",
2104
- [
2105
- "workspace",
2106
- pkg,
2107
- "run",
2108
- "package-publint"
2109
- ]
2110
- ]
2111
- ]);
2112
- }, "publintPackage");
2113
- var publintAll = /* @__PURE__ */ __name(({ verbose }) => {
2114
- const verboseOptions = verbose ? [
2115
- "--verbose"
2116
- ] : [
2117
- "--no-verbose"
2118
- ];
2119
- return runSteps("Publint", [
2120
- [
2121
- "yarn",
2122
- [
2123
- "workspaces",
2124
- "foreach",
2125
- "-pA",
2126
- ...verboseOptions,
2127
- "run",
2128
- "package-publint"
2129
- ]
2130
- ]
2131
- ]);
2132
- }, "publintAll");
1860
+ var publint = async ({ verbose, pkg }) => {
1861
+ return pkg ? await publintPackage({ pkg, verbose }) : publintAll({ verbose });
1862
+ };
1863
+ var publintPackage = ({ pkg }) => {
1864
+ return runStepsAsync(`Publint [${pkg}]`, [["yarn", ["workspace", pkg, "run", "package-publint"]]]);
1865
+ };
1866
+ var publintAll = ({ verbose }) => {
1867
+ const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
1868
+ return runSteps("Publint", [["yarn", ["workspaces", "foreach", "-pA", ...verboseOptions, "run", "package-publint"]]]);
1869
+ };
2133
1870
 
2134
1871
  // src/actions/rebuild.ts
2135
- var rebuild = /* @__PURE__ */ __name(({ target }) => {
1872
+ var rebuild = ({ target }) => {
2136
1873
  return runSteps("Rebuild", [
2137
- [
2138
- "yarn",
2139
- "xy clean"
2140
- ],
2141
- [
2142
- "yarn",
2143
- target ? `xy build -t ${target}` : "xy build"
2144
- ]
1874
+ ["yarn", "xy clean"],
1875
+ ["yarn", target ? `xy build -t ${target}` : "xy build"]
2145
1876
  ]);
2146
- }, "rebuild");
1877
+ };
2147
1878
 
2148
1879
  // src/actions/recompile.ts
2149
- import chalk28 from "chalk";
2150
- var recompile = /* @__PURE__ */ __name(async ({ verbose, target, pkg, incremental }) => {
1880
+ import chalk29 from "chalk";
1881
+ var recompile = async ({
1882
+ verbose,
1883
+ target,
1884
+ pkg,
1885
+ incremental
1886
+ }) => {
2151
1887
  return pkg ? await recompilePackage({
2152
1888
  pkg,
2153
1889
  target,
@@ -2157,51 +1893,27 @@ var recompile = /* @__PURE__ */ __name(async ({ verbose, target, pkg, incrementa
2157
1893
  target,
2158
1894
  verbose
2159
1895
  });
2160
- }, "recompile");
2161
- var recompilePackage = /* @__PURE__ */ __name(({ target, pkg }) => {
2162
- const targetOptions = target ? [
2163
- "-t",
2164
- target
2165
- ] : [];
2166
- return runStepsAsync(`Recompile [${pkg}]`, [
2167
- [
2168
- "yarn",
2169
- [
2170
- "workspace",
2171
- pkg,
2172
- "run",
2173
- "package-recompile",
2174
- ...targetOptions
2175
- ]
2176
- ]
2177
- ]);
2178
- }, "recompilePackage");
2179
- var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, incremental }) => {
1896
+ };
1897
+ var recompilePackage = ({ target, pkg }) => {
1898
+ const targetOptions = target ? ["-t", target] : [];
1899
+ return runStepsAsync(
1900
+ `Recompile [${pkg}]`,
1901
+ [["yarn", ["workspace", pkg, "run", "package-recompile", ...targetOptions]]]
1902
+ );
1903
+ };
1904
+ var recompileAll = async ({
1905
+ jobs,
1906
+ verbose,
1907
+ target,
1908
+ incremental
1909
+ }) => {
2180
1910
  const start = Date.now();
2181
- const verboseOptions = verbose ? [
2182
- "--verbose"
2183
- ] : [
2184
- "--no-verbose"
2185
- ];
2186
- const targetOptions = target ? [
2187
- "-t",
2188
- target
2189
- ] : [];
2190
- const incrementalOptions = incremental ? [
2191
- "--since",
2192
- "-Apt",
2193
- "--topological-dev"
2194
- ] : [
2195
- "--parallel",
2196
- "-Apt",
2197
- "--topological-dev"
2198
- ];
2199
- const jobsOptions = jobs ? [
2200
- "-j",
2201
- `${jobs}`
2202
- ] : [];
1911
+ const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
1912
+ const targetOptions = target ? ["-t", target] : [];
1913
+ const incrementalOptions = incremental ? ["--since", "-Apt", "--topological-dev"] : ["--parallel", "-Apt", "--topological-dev"];
1914
+ const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
2203
1915
  if (jobs) {
2204
- console.log(chalk28.blue(`Jobs set to [${jobs}]`));
1916
+ console.log(chalk29.blue(`Jobs set to [${jobs}]`));
2205
1917
  }
2206
1918
  const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
2207
1919
  [
@@ -2231,13 +1943,19 @@ var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, increm
2231
1943
  ]
2232
1944
  ]
2233
1945
  ]);
2234
- console.log(`${chalk28.gray("Recompiled in")} [${chalk28.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk28.gray("seconds")}`);
1946
+ console.log(
1947
+ `${chalk29.gray("Recompiled in")} [${chalk29.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk29.gray("seconds")}`
1948
+ );
2235
1949
  return result;
2236
- }, "recompileAll");
1950
+ };
2237
1951
 
2238
1952
  // src/actions/reinstall.ts
2239
- import { closeSync, openSync, rmSync } from "node:fs";
2240
- var reinstall = /* @__PURE__ */ __name(() => {
1953
+ import {
1954
+ closeSync,
1955
+ openSync,
1956
+ rmSync
1957
+ } from "node:fs";
1958
+ var reinstall = () => {
2241
1959
  console.log("Reinstall [Clear Lock File]");
2242
1960
  closeSync(openSync("./yarn.lock", "w"));
2243
1961
  console.log("Reinstall [Clear Node Modules]");
@@ -2245,10 +1963,7 @@ var reinstall = /* @__PURE__ */ __name(() => {
2245
1963
  const result = workspaces.map(({ location, name }) => {
2246
1964
  const dist = `${location}/node_modules`;
2247
1965
  try {
2248
- rmSync(dist, {
2249
- force: true,
2250
- recursive: true
2251
- });
1966
+ rmSync(dist, { force: true, recursive: true });
2252
1967
  return 0;
2253
1968
  } catch (ex) {
2254
1969
  const error = ex;
@@ -2256,546 +1971,591 @@ var reinstall = /* @__PURE__ */ __name(() => {
2256
1971
  return 1;
2257
1972
  }
2258
1973
  }).reduce((prev, result2) => prev || result2, 0);
2259
- return result || runSteps("Reinstall", [
2260
- [
2261
- "yarn",
2262
- "install --network-timeout 10000"
2263
- ]
2264
- ]);
2265
- }, "reinstall");
1974
+ return result || runSteps("Reinstall", [["yarn", "install --network-timeout 10000"]]);
1975
+ };
2266
1976
 
2267
1977
  // src/actions/relint.ts
2268
- import chalk29 from "chalk";
2269
- var relintPackage = /* @__PURE__ */ __name(({ pkg }) => {
2270
- console.log(chalk29.gray(`${"Relint"} [All-Packages]`));
1978
+ import chalk30 from "chalk";
1979
+ var relintPackage = ({ pkg }) => {
1980
+ console.log(chalk30.gray(`${"Relint"} [All-Packages]`));
2271
1981
  const start = Date.now();
2272
1982
  const result = runSteps("Relint [All-Packages]", [
2273
- [
2274
- "yarn",
2275
- [
2276
- "workspace",
2277
- pkg,
2278
- "run",
2279
- "package-relint"
2280
- ]
2281
- ]
1983
+ ["yarn", [
1984
+ "workspace",
1985
+ pkg,
1986
+ "run",
1987
+ "package-relint"
1988
+ ]]
2282
1989
  ]);
2283
- console.log(chalk29.gray(`${"Relinted in"} [${chalk29.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk29.gray("seconds")}`));
1990
+ console.log(chalk30.gray(`${"Relinted in"} [${chalk30.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk30.gray("seconds")}`));
2284
1991
  return result;
2285
- }, "relintPackage");
2286
- var relint = /* @__PURE__ */ __name(({ pkg, verbose, incremental } = {}) => {
2287
- return pkg ? relintPackage({
2288
- pkg
2289
- }) : relintAllPackages({
2290
- verbose,
2291
- incremental
2292
- });
2293
- }, "relint");
2294
- var relintAllPackages = /* @__PURE__ */ __name(({ verbose = true, incremental } = {}) => {
2295
- console.log(chalk29.gray(`${"Relint"} [All-Packages]`));
1992
+ };
1993
+ var relint = ({
1994
+ pkg,
1995
+ verbose,
1996
+ incremental
1997
+ } = {}) => {
1998
+ return pkg ? relintPackage({ pkg }) : relintAllPackages({ verbose, incremental });
1999
+ };
2000
+ var relintAllPackages = ({ verbose = true, incremental } = {}) => {
2001
+ console.log(chalk30.gray(`${"Relint"} [All-Packages]`));
2296
2002
  const start = Date.now();
2297
- const verboseOptions = verbose ? [
2298
- "--verbose"
2299
- ] : [
2300
- "--no-verbose"
2301
- ];
2302
- const incrementalOptions = incremental ? [
2303
- "--since",
2304
- "-Ap"
2305
- ] : [
2306
- "--parallel",
2307
- "-Ap"
2308
- ];
2003
+ const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
2004
+ const incrementalOptions = incremental ? ["--since", "-Ap"] : ["--parallel", "-Ap"];
2309
2005
  const result = runSteps(`${"Relint"} [All-Packages]`, [
2310
- [
2311
- "yarn",
2312
- [
2313
- "workspaces",
2314
- "foreach",
2315
- ...verboseOptions,
2316
- ...incrementalOptions,
2317
- "run",
2318
- "package-relint"
2319
- ]
2320
- ]
2006
+ ["yarn", [
2007
+ "workspaces",
2008
+ "foreach",
2009
+ ...verboseOptions,
2010
+ ...incrementalOptions,
2011
+ "run",
2012
+ "package-relint"
2013
+ ]]
2321
2014
  ]);
2322
- console.log(chalk29.gray(`Relinted in [${chalk29.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk29.gray("seconds")}`));
2015
+ console.log(chalk30.gray(`Relinted in [${chalk30.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk30.gray("seconds")}`));
2323
2016
  return result;
2324
- }, "relintAllPackages");
2017
+ };
2325
2018
 
2326
2019
  // src/actions/retest.ts
2327
- var retest = /* @__PURE__ */ __name(() => {
2020
+ var retest = () => {
2328
2021
  return runSteps("Test", [
2329
- [
2330
- "yarn",
2331
- [
2332
- "jest",
2333
- "--clearCache"
2334
- ]
2335
- ],
2336
- [
2337
- "yarn",
2338
- [
2339
- "jest",
2340
- "."
2341
- ]
2342
- ]
2022
+ ["yarn", ["jest", "--clearCache"]],
2023
+ ["yarn", ["jest", "."]]
2343
2024
  ]);
2344
- }, "retest");
2025
+ };
2345
2026
 
2346
2027
  // src/actions/sonar.ts
2347
- var sonar = /* @__PURE__ */ __name(() => {
2348
- return runSteps("Sonar", [
2349
- [
2350
- "yarn",
2351
- [
2352
- "eslint",
2353
- "-c",
2354
- "sonar.eslintrc",
2355
- "."
2356
- ]
2357
- ]
2358
- ]);
2359
- }, "sonar");
2028
+ var sonar = () => {
2029
+ return runSteps("Sonar", [["yarn", ["eslint", "-c", "sonar.eslintrc", "."]]]);
2030
+ };
2360
2031
 
2361
2032
  // src/actions/statics.ts
2362
- import chalk30 from "chalk";
2363
- var DefaultDependencies = [
2364
- "axios",
2365
- "@xylabs/pixel",
2366
- "react",
2367
- "graphql",
2368
- "react-router",
2369
- "@mui/material",
2370
- "@mui/system"
2371
- ];
2372
- var statics = /* @__PURE__ */ __name(() => {
2373
- console.log(chalk30.green("Check Required Static Dependencies"));
2033
+ import chalk31 from "chalk";
2034
+ var DefaultDependencies = ["axios", "@xylabs/pixel", "react", "graphql", "react-router", "@mui/material", "@mui/system"];
2035
+ var statics = () => {
2036
+ console.log(chalk31.green("Check Required Static Dependencies"));
2374
2037
  const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
2375
2038
  return detectDuplicateDependencies(statics2, DefaultDependencies);
2376
- }, "statics");
2039
+ };
2377
2040
 
2378
2041
  // src/actions/test.ts
2379
- var test = /* @__PURE__ */ __name(() => {
2380
- return runSteps("Test", [
2381
- [
2382
- "yarn",
2383
- [
2384
- "vitest",
2385
- "."
2386
- ]
2387
- ]
2388
- ]);
2389
- }, "test");
2042
+ var test = () => {
2043
+ return runSteps("Test", [["yarn", ["vitest", "."]]]);
2044
+ };
2390
2045
 
2391
2046
  // src/actions/up.ts
2392
- var up = /* @__PURE__ */ __name(() => {
2393
- return runSteps("Up", [
2394
- [
2395
- "yarn",
2396
- "outdated"
2397
- ]
2398
- ]);
2399
- }, "up");
2047
+ var up = () => {
2048
+ return runSteps("Up", [["yarn", "outdated"]]);
2049
+ };
2400
2050
 
2401
2051
  // src/actions/updo.ts
2402
- var updo = /* @__PURE__ */ __name(() => {
2052
+ var updo = () => {
2403
2053
  return runSteps("Updo", [
2404
- [
2405
- "yarn",
2406
- "install"
2407
- ],
2408
- [
2409
- "yarn",
2410
- "upgrade-interactive"
2411
- ],
2412
- [
2413
- "yarn",
2414
- "dedupe"
2415
- ]
2054
+ ["yarn", "install"],
2055
+ ["yarn", "upgrade-interactive"],
2056
+ ["yarn", "dedupe"]
2416
2057
  ]);
2417
- }, "updo");
2058
+ };
2418
2059
 
2419
2060
  // src/actions/upplug.ts
2420
- var updateYarnPlugins = /* @__PURE__ */ __name(() => {
2061
+ var updateYarnPlugins = () => {
2421
2062
  return runSteps("Update Yarn Plugins", [
2422
- [
2423
- "yarn",
2424
- [
2425
- "plugin",
2426
- "import",
2427
- "https://mskelton.dev/yarn-outdated/v3"
2428
- ]
2429
- ],
2430
- [
2431
- "yarn",
2432
- [
2433
- "plugin",
2434
- "import",
2435
- "version"
2436
- ]
2437
- ],
2438
- [
2439
- "yarn",
2440
- [
2441
- "plugin",
2442
- "import",
2443
- "interactive-tools"
2444
- ]
2445
- ],
2446
- [
2447
- "yarn",
2448
- [
2449
- "plugin",
2450
- "import",
2451
- "workspace-tools"
2452
- ]
2453
- ]
2063
+ ["yarn", ["plugin", "import", "https://mskelton.dev/yarn-outdated/v3"]],
2064
+ ["yarn", ["plugin", "import", "version"]],
2065
+ ["yarn", ["plugin", "import", "interactive-tools"]],
2066
+ ["yarn", ["plugin", "import", "workspace-tools"]]
2454
2067
  ]);
2455
- }, "updateYarnPlugins");
2068
+ };
2456
2069
 
2457
2070
  // src/actions/upyarn.ts
2458
- var updateYarnVersion = /* @__PURE__ */ __name(() => {
2459
- return runSteps("Update Yarn Version", [
2460
- [
2461
- "yarn",
2462
- [
2463
- "set",
2464
- "version",
2465
- "latest"
2466
- ]
2467
- ]
2468
- ]);
2469
- }, "updateYarnVersion");
2071
+ var updateYarnVersion = () => {
2072
+ return runSteps("Update Yarn Version", [["yarn", ["set", "version", "latest"]]]);
2073
+ };
2470
2074
 
2471
2075
  // src/actions/yarn3only.ts
2472
- var yarn3Only = /* @__PURE__ */ __name(() => {
2076
+ var yarn3Only = () => {
2473
2077
  const [valid, version] = isYarnVersionOrGreater(3);
2474
2078
  if (!valid) {
2475
2079
  processEx(`Invalid Yarn version [${version}]`);
2476
2080
  }
2477
2081
  return 0;
2478
- }, "yarn3Only");
2082
+ };
2479
2083
 
2480
2084
  // src/loadPackageConfig.ts
2481
2085
  import { readFile } from "node:fs/promises";
2482
- var loadPackageConfig = /* @__PURE__ */ __name(async () => {
2086
+ var loadPackageConfig = async () => {
2483
2087
  const pkg = process.env.INIT_CWD;
2484
- const pkgConfig = await readFile(`${pkg}/package.json`, {
2485
- encoding: "utf8"
2486
- });
2088
+ const pkgConfig = await readFile(`${pkg}/package.json`, { encoding: "utf8" });
2487
2089
  return JSON.parse(pkgConfig);
2488
- }, "loadPackageConfig");
2090
+ };
2489
2091
 
2490
2092
  // src/xy/xy.ts
2491
- import chalk32 from "chalk";
2093
+ import chalk33 from "chalk";
2492
2094
 
2493
2095
  // src/xy/xyBuildCommands.ts
2494
- var xyBuildCommands = /* @__PURE__ */ __name((args) => {
2495
- return args.command("build [package]", "Build - Compile & Lint", (yargs2) => {
2496
- return yargs2.positional("package", {
2497
- describe: "Specific package to build"
2498
- });
2499
- }, async (argv) => {
2500
- if (argv.verbose) {
2501
- console.log(`Building: ${argv.package ?? "all"}`);
2502
- }
2503
- process.exitCode = await build({
2504
- incremental: !!argv.incremental,
2505
- jobs: argv.jobs,
2506
- pkg: argv.package,
2507
- target: argv.target,
2508
- verbose: !!argv.verbose
2509
- });
2510
- }).command("compile [package]", "Compile with Typescript & Copy Images", (yargs2) => {
2511
- return yargs2.positional("package", {
2512
- describe: "Specific package to compile"
2513
- });
2514
- }, (argv) => {
2515
- if (argv.verbose) {
2516
- console.log(`Compiling: ${argv.package ?? "all"}`);
2517
- }
2518
- process.exitCode = compile({
2519
- incremental: !!argv.incremental,
2520
- jobs: argv.jobs,
2521
- pkg: argv.package,
2522
- target: argv.target,
2523
- verbose: !!argv.verbose
2524
- });
2525
- }).command("compile-types [package]", "Compile types with Typescript", (yargs2) => {
2526
- return yargs2.positional("package", {
2527
- describe: "Specific package to compile"
2528
- });
2529
- }, (argv) => {
2530
- if (argv.verbose) {
2531
- console.log(`Compiling: ${argv.package ?? "all"}`);
2532
- }
2533
- process.exitCode = compileTypes({
2534
- incremental: !!argv.incremental,
2535
- jobs: argv.jobs,
2536
- pkg: argv.package,
2537
- verbose: !!argv.verbose
2538
- });
2539
- }).command("compile-only [package]", "Compile with Typescript & Copy Images (No Publint)", (yargs2) => {
2540
- return yargs2.positional("package", {
2541
- describe: "Specific package to compile"
2542
- });
2543
- }, (argv) => {
2544
- if (argv.verbose) {
2545
- console.log(`Compiling: ${argv.package ?? "all"}`);
2546
- }
2547
- process.exitCode = compile({
2548
- incremental: !!argv.incremental,
2549
- jobs: argv.jobs,
2550
- pkg: argv.package,
2551
- publint: false,
2552
- target: argv.target,
2553
- verbose: !!argv.verbose
2554
- });
2555
- }).command("recompile [package]", "Re-compile with Typescript & Copy Images", (yargs2) => {
2556
- return yargs2.positional("package", {
2557
- describe: "Specific package to re-compile"
2558
- });
2559
- }, async (argv) => {
2560
- if (argv.verbose) {
2561
- console.log(`Re-compiling: ${argv.package ?? "all"}`);
2562
- }
2563
- process.exitCode = await recompile({
2564
- incremental: !!argv.incremental,
2565
- jobs: argv.jobs,
2566
- pkg: argv.package,
2567
- target: argv.target,
2568
- verbose: !!argv.verbose
2569
- });
2570
- }).command("rebuild [package]", "Rebuild - Clean, Compile & Lint", (yargs2) => {
2571
- return yargs2.positional("package", {
2572
- describe: "Specific package to rebuild"
2573
- });
2574
- }, (argv) => {
2575
- if (argv.verbose) console.log(`Rebuilding: ${argv.package ?? "all"}`);
2576
- process.exitCode = rebuild({
2577
- target: argv.target
2578
- });
2579
- }).command("copy-assets [package]", "Copy Assets - Copy the assets from src to dist", (yargs2) => {
2580
- return yargs2.positional("package", {
2581
- describe: "Specific package to copy assets"
2582
- });
2583
- }, async (argv) => {
2584
- if (argv.verbose) console.log(`Copying Assets: ${argv.package ?? "all"}`);
2585
- process.exitCode = await copyAssets({
2586
- target: argv.target
2587
- });
2588
- });
2589
- }, "xyBuildCommands");
2096
+ var xyBuildCommands = (args) => {
2097
+ return args.command(
2098
+ "build [package]",
2099
+ "Build - Compile & Lint",
2100
+ (yargs2) => {
2101
+ return yargs2.positional("package", { describe: "Specific package to build" });
2102
+ },
2103
+ async (argv) => {
2104
+ if (argv.verbose) {
2105
+ console.log(`Building: ${argv.package ?? "all"}`);
2106
+ }
2107
+ process.exitCode = await build({
2108
+ incremental: !!argv.incremental,
2109
+ jobs: argv.jobs,
2110
+ pkg: argv.package,
2111
+ target: argv.target,
2112
+ verbose: !!argv.verbose
2113
+ });
2114
+ }
2115
+ ).command(
2116
+ "compile [package]",
2117
+ "Compile with Typescript & Copy Images",
2118
+ (yargs2) => {
2119
+ return yargs2.positional("package", { describe: "Specific package to compile" });
2120
+ },
2121
+ (argv) => {
2122
+ if (argv.verbose) {
2123
+ console.log(`Compiling: ${argv.package ?? "all"}`);
2124
+ }
2125
+ process.exitCode = compile({
2126
+ incremental: !!argv.incremental,
2127
+ jobs: argv.jobs,
2128
+ pkg: argv.package,
2129
+ target: argv.target,
2130
+ verbose: !!argv.verbose
2131
+ });
2132
+ }
2133
+ ).command(
2134
+ "compile-types [package]",
2135
+ "Compile types with Typescript",
2136
+ (yargs2) => {
2137
+ return yargs2.positional("package", { describe: "Specific package to compile" });
2138
+ },
2139
+ (argv) => {
2140
+ if (argv.verbose) {
2141
+ console.log(`Compiling: ${argv.package ?? "all"}`);
2142
+ }
2143
+ process.exitCode = compileTypes({
2144
+ incremental: !!argv.incremental,
2145
+ jobs: argv.jobs,
2146
+ pkg: argv.package,
2147
+ verbose: !!argv.verbose
2148
+ });
2149
+ }
2150
+ ).command(
2151
+ "compile-only [package]",
2152
+ "Compile with Typescript & Copy Images (No Publint)",
2153
+ (yargs2) => {
2154
+ return yargs2.positional("package", { describe: "Specific package to compile" });
2155
+ },
2156
+ (argv) => {
2157
+ if (argv.verbose) {
2158
+ console.log(`Compiling: ${argv.package ?? "all"}`);
2159
+ }
2160
+ process.exitCode = compile({
2161
+ incremental: !!argv.incremental,
2162
+ jobs: argv.jobs,
2163
+ pkg: argv.package,
2164
+ publint: false,
2165
+ target: argv.target,
2166
+ verbose: !!argv.verbose
2167
+ });
2168
+ }
2169
+ ).command(
2170
+ "recompile [package]",
2171
+ "Re-compile with Typescript & Copy Images",
2172
+ (yargs2) => {
2173
+ return yargs2.positional("package", { describe: "Specific package to re-compile" });
2174
+ },
2175
+ async (argv) => {
2176
+ if (argv.verbose) {
2177
+ console.log(`Re-compiling: ${argv.package ?? "all"}`);
2178
+ }
2179
+ process.exitCode = await recompile({
2180
+ incremental: !!argv.incremental,
2181
+ jobs: argv.jobs,
2182
+ pkg: argv.package,
2183
+ target: argv.target,
2184
+ verbose: !!argv.verbose
2185
+ });
2186
+ }
2187
+ ).command(
2188
+ "rebuild [package]",
2189
+ "Rebuild - Clean, Compile & Lint",
2190
+ (yargs2) => {
2191
+ return yargs2.positional("package", { describe: "Specific package to rebuild" });
2192
+ },
2193
+ (argv) => {
2194
+ if (argv.verbose) console.log(`Rebuilding: ${argv.package ?? "all"}`);
2195
+ process.exitCode = rebuild({ target: argv.target });
2196
+ }
2197
+ ).command(
2198
+ "copy-assets [package]",
2199
+ "Copy Assets - Copy the assets from src to dist",
2200
+ (yargs2) => {
2201
+ return yargs2.positional("package", { describe: "Specific package to copy assets" });
2202
+ },
2203
+ async (argv) => {
2204
+ if (argv.verbose) console.log(`Copying Assets: ${argv.package ?? "all"}`);
2205
+ process.exitCode = await copyAssets({ target: argv.target });
2206
+ }
2207
+ );
2208
+ };
2590
2209
 
2591
2210
  // src/xy/param.ts
2592
- var packagePositionalParam = /* @__PURE__ */ __name((yargs2) => {
2593
- return yargs2.positional("package", {
2594
- describe: "Specific package to target"
2595
- });
2596
- }, "packagePositionalParam");
2211
+ var packagePositionalParam = (yargs2) => {
2212
+ return yargs2.positional("package", { describe: "Specific package to target" });
2213
+ };
2597
2214
 
2598
2215
  // src/xy/xyCommonCommands.ts
2599
- var xyCommonCommands = /* @__PURE__ */ __name((args) => {
2600
- return args.command("license [package]", "License - Check licenses of dependencies", (yargs2) => {
2601
- return packagePositionalParam(yargs2);
2602
- }, async (argv) => {
2603
- if (argv.verbose) console.log(`License: ${argv.package ?? "all"}`);
2604
- process.exitCode = await license();
2605
- }).command("dead [package]", "Dead - Check for dead code", (yargs2) => {
2606
- return packagePositionalParam(yargs2);
2607
- }, (argv) => {
2608
- if (argv.verbose) console.log("Dead");
2609
- process.exitCode = dead();
2610
- }).command("gen-docs [package]", "GenDocs - Generate TypeDocs", (yargs2) => {
2611
- return packagePositionalParam(yargs2);
2612
- }, (argv) => {
2613
- if (argv.verbose) console.log(`Generating TypeDocs: ${argv.package ?? "all"}`);
2614
- process.exitCode = genDocs({
2615
- incremental: !!argv.incremental,
2616
- pkg: argv.package
2617
- });
2618
- }).command("clean-docs", "CleanDocs - Clean TypeDocs", (yargs2) => yargs2, (argv) => {
2619
- if (argv.verbose) console.log("Cleaning TypeDocs: all");
2620
- process.exitCode = cleanDocs();
2621
- }).command("gitlint [package]", "Gitlint - Lint your git config", (yargs2) => {
2622
- return yargs2;
2623
- }, (argv) => {
2624
- if (argv.verbose) console.log("Gitlint");
2625
- process.exitCode = argv.fix ? gitlintFix() : gitlint();
2626
- }).command("gitignore-gen", "GitIgnore Gen - Generate .gitignore files", (yargs2) => {
2627
- return yargs2;
2628
- }, (argv) => {
2629
- if (argv.verbose) console.log("GitIgnore Gen");
2630
- process.exitCode = gitignoreGen();
2631
- }).command("npmignore-gen", "NpmIgnore Gen - Generate .npmignore files", (yargs2) => {
2632
- return yargs2;
2633
- }, (argv) => {
2634
- if (argv.verbose) console.log("NpmIgnore Gen");
2635
- process.exitCode = npmignoreGen();
2636
- }).command("retest", "Re-Test - Run Jest Tests with cleaned cache", (yargs2) => {
2637
- return yargs2;
2638
- }, (argv) => {
2639
- if (argv.verbose) console.log("Re-Testing");
2640
- process.exitCode = retest();
2641
- }).command("test", "Test - Run Jest Tests", (yargs2) => {
2642
- return yargs2;
2643
- }, (argv) => {
2644
- if (argv.verbose) console.log("Testing");
2645
- process.exitCode = test();
2646
- }).command("upplug", "UpPlug - Update Yarn Plugins", (yargs2) => {
2647
- return yargs2;
2648
- }, (argv) => {
2649
- if (argv.verbose) console.log("UpPlug");
2650
- process.exitCode = updateYarnPlugins();
2651
- }).command("upyarn", "UpYarn - Update Yarn Version", (yargs2) => {
2652
- return yargs2;
2653
- }, (argv) => {
2654
- if (argv.verbose) console.log("UpYarn");
2655
- process.exitCode = updateYarnVersion();
2656
- }).command("yarn3only", "Yarn3Only - Check if using Yarn v3", (yargs2) => {
2657
- return yargs2;
2658
- }, (argv) => {
2659
- if (argv.verbose) console.log("Yarn 3 Check");
2660
- process.exitCode = yarn3Only();
2661
- });
2662
- }, "xyCommonCommands");
2216
+ var xyCommonCommands = (args) => {
2217
+ return args.command(
2218
+ "license [package]",
2219
+ "License - Check licenses of dependencies",
2220
+ (yargs2) => {
2221
+ return packagePositionalParam(yargs2);
2222
+ },
2223
+ async (argv) => {
2224
+ if (argv.verbose) console.log(`License: ${argv.package ?? "all"}`);
2225
+ process.exitCode = await license();
2226
+ }
2227
+ ).command(
2228
+ "dead [package]",
2229
+ "Dead - Check for dead code",
2230
+ (yargs2) => {
2231
+ return packagePositionalParam(yargs2);
2232
+ },
2233
+ (argv) => {
2234
+ if (argv.verbose) console.log("Dead");
2235
+ process.exitCode = dead();
2236
+ }
2237
+ ).command(
2238
+ "gen-docs [package]",
2239
+ "GenDocs - Generate TypeDocs",
2240
+ (yargs2) => {
2241
+ return packagePositionalParam(yargs2);
2242
+ },
2243
+ (argv) => {
2244
+ if (argv.verbose) console.log(`Generating TypeDocs: ${argv.package ?? "all"}`);
2245
+ process.exitCode = genDocs({ incremental: !!argv.incremental, pkg: argv.package });
2246
+ }
2247
+ ).command(
2248
+ "clean-docs",
2249
+ "CleanDocs - Clean TypeDocs",
2250
+ (yargs2) => yargs2,
2251
+ (argv) => {
2252
+ if (argv.verbose) console.log("Cleaning TypeDocs: all");
2253
+ process.exitCode = cleanDocs();
2254
+ }
2255
+ ).command(
2256
+ "gitlint [package]",
2257
+ "Gitlint - Lint your git config",
2258
+ (yargs2) => {
2259
+ return yargs2;
2260
+ },
2261
+ (argv) => {
2262
+ if (argv.verbose) console.log("Gitlint");
2263
+ process.exitCode = argv.fix ? gitlintFix() : gitlint();
2264
+ }
2265
+ ).command(
2266
+ "gitignore-gen",
2267
+ "GitIgnore Gen - Generate .gitignore files",
2268
+ (yargs2) => {
2269
+ return yargs2;
2270
+ },
2271
+ (argv) => {
2272
+ if (argv.verbose) console.log("GitIgnore Gen");
2273
+ process.exitCode = gitignoreGen();
2274
+ }
2275
+ ).command(
2276
+ "npmignore-gen",
2277
+ "NpmIgnore Gen - Generate .npmignore files",
2278
+ (yargs2) => {
2279
+ return yargs2;
2280
+ },
2281
+ (argv) => {
2282
+ if (argv.verbose) console.log("NpmIgnore Gen");
2283
+ process.exitCode = npmignoreGen();
2284
+ }
2285
+ ).command(
2286
+ "retest",
2287
+ "Re-Test - Run Jest Tests with cleaned cache",
2288
+ (yargs2) => {
2289
+ return yargs2;
2290
+ },
2291
+ (argv) => {
2292
+ if (argv.verbose) console.log("Re-Testing");
2293
+ process.exitCode = retest();
2294
+ }
2295
+ ).command(
2296
+ "test",
2297
+ "Test - Run Jest Tests",
2298
+ (yargs2) => {
2299
+ return yargs2;
2300
+ },
2301
+ (argv) => {
2302
+ if (argv.verbose) console.log("Testing");
2303
+ process.exitCode = test();
2304
+ }
2305
+ ).command(
2306
+ "upplug",
2307
+ "UpPlug - Update Yarn Plugins",
2308
+ (yargs2) => {
2309
+ return yargs2;
2310
+ },
2311
+ (argv) => {
2312
+ if (argv.verbose) console.log("UpPlug");
2313
+ process.exitCode = updateYarnPlugins();
2314
+ }
2315
+ ).command(
2316
+ "upyarn",
2317
+ "UpYarn - Update Yarn Version",
2318
+ (yargs2) => {
2319
+ return yargs2;
2320
+ },
2321
+ (argv) => {
2322
+ if (argv.verbose) console.log("UpYarn");
2323
+ process.exitCode = updateYarnVersion();
2324
+ }
2325
+ ).command(
2326
+ "yarn3only",
2327
+ "Yarn3Only - Check if using Yarn v3",
2328
+ (yargs2) => {
2329
+ return yargs2;
2330
+ },
2331
+ (argv) => {
2332
+ if (argv.verbose) console.log("Yarn 3 Check");
2333
+ process.exitCode = yarn3Only();
2334
+ }
2335
+ );
2336
+ };
2663
2337
 
2664
2338
  // src/xy/xyDeployCommands.ts
2665
- var xyDeployCommands = /* @__PURE__ */ __name((args) => {
2666
- return args.command("deploy", "Deploy - Deploy patch", (yargs2) => {
2667
- return yargs2;
2668
- }, (argv) => {
2669
- if (argv.verbose) console.log("Deploy patch");
2670
- process.exitCode = deploy();
2671
- }).command("deploy-minor", "Deploy - Deploy minor", (yargs2) => {
2672
- return yargs2;
2673
- }, (argv) => {
2674
- if (argv.verbose) console.log("Deploy minor");
2675
- process.exitCode = deployMinor();
2676
- }).command("deploy-major", "Deploy - Deploy major", (yargs2) => {
2677
- return yargs2;
2678
- }, (argv) => {
2679
- if (argv.verbose) console.log("Deploy major");
2680
- process.exitCode = deployMajor();
2681
- }).command("deploy-next", "Deploy - Deploy next", (yargs2) => {
2682
- return yargs2;
2683
- }, (argv) => {
2684
- if (argv.verbose) console.log("Deploy next");
2685
- process.exitCode = deployNext();
2686
- });
2687
- }, "xyDeployCommands");
2339
+ var xyDeployCommands = (args) => {
2340
+ return args.command(
2341
+ "deploy",
2342
+ "Deploy - Deploy patch",
2343
+ (yargs2) => {
2344
+ return yargs2;
2345
+ },
2346
+ (argv) => {
2347
+ if (argv.verbose) console.log("Deploy patch");
2348
+ process.exitCode = deploy();
2349
+ }
2350
+ ).command(
2351
+ "deploy-minor",
2352
+ "Deploy - Deploy minor",
2353
+ (yargs2) => {
2354
+ return yargs2;
2355
+ },
2356
+ (argv) => {
2357
+ if (argv.verbose) console.log("Deploy minor");
2358
+ process.exitCode = deployMinor();
2359
+ }
2360
+ ).command(
2361
+ "deploy-major",
2362
+ "Deploy - Deploy major",
2363
+ (yargs2) => {
2364
+ return yargs2;
2365
+ },
2366
+ (argv) => {
2367
+ if (argv.verbose) console.log("Deploy major");
2368
+ process.exitCode = deployMajor();
2369
+ }
2370
+ ).command(
2371
+ "deploy-next",
2372
+ "Deploy - Deploy next",
2373
+ (yargs2) => {
2374
+ return yargs2;
2375
+ },
2376
+ (argv) => {
2377
+ if (argv.verbose) console.log("Deploy next");
2378
+ process.exitCode = deployNext();
2379
+ }
2380
+ );
2381
+ };
2688
2382
 
2689
2383
  // src/xy/xyInstallCommands.ts
2690
- var xyInstallCommands = /* @__PURE__ */ __name((args) => {
2691
- return args.command("clean [package]", "Clean", (yargs2) => {
2692
- return yargs2.positional("package", {
2693
- describe: "Specific package to clean"
2694
- });
2695
- }, async (argv) => {
2696
- if (argv.verbose) {
2697
- console.log(`Cleaning: ${argv.package ?? "all"}`);
2384
+ var xyInstallCommands = (args) => {
2385
+ return args.command(
2386
+ "clean [package]",
2387
+ "Clean",
2388
+ (yargs2) => {
2389
+ return yargs2.positional("package", { describe: "Specific package to clean" });
2390
+ },
2391
+ async (argv) => {
2392
+ if (argv.verbose) {
2393
+ console.log(`Cleaning: ${argv.package ?? "all"}`);
2394
+ }
2395
+ process.exitCode = await clean({
2396
+ pkg: argv.package,
2397
+ verbose: !!argv.verbose
2398
+ });
2698
2399
  }
2699
- process.exitCode = await clean({
2700
- pkg: argv.package,
2701
- verbose: !!argv.verbose
2702
- });
2703
- }).command("reinstall", "Reinstall - Clean & Install", (yargs2) => {
2704
- return yargs2;
2705
- }, (argv) => {
2706
- if (argv.verbose) console.log("Reinstalling");
2707
- process.exitCode = reinstall();
2708
- }).command("up", "Up - Update dependencies", (yargs2) => {
2709
- return yargs2;
2710
- }, (argv) => {
2711
- if (argv.verbose) console.log("Up");
2712
- process.exitCode = up();
2713
- }).command("updo", "Updo - Update dependencies [Interactive]", (yargs2) => {
2714
- return yargs2;
2715
- }, (argv) => {
2716
- if (argv.verbose) console.log("Updo");
2717
- process.exitCode = updo();
2718
- }).command("statics", "Statics - Confirming Static Packages", (yargs2) => {
2719
- return yargs2;
2720
- }, (argv) => {
2721
- if (argv.verbose) console.log("Statics");
2722
- process.exitCode = statics();
2723
- }).command("dupdeps", "Dupdeps - Duplicate Dependencies in package.json", (yargs2) => {
2724
- return yargs2;
2725
- }, (argv) => {
2726
- if (argv.verbose) console.log("Dupdeps");
2727
- process.exitCode = dupdeps();
2728
- });
2729
- }, "xyInstallCommands");
2400
+ ).command(
2401
+ "reinstall",
2402
+ "Reinstall - Clean & Install",
2403
+ (yargs2) => {
2404
+ return yargs2;
2405
+ },
2406
+ (argv) => {
2407
+ if (argv.verbose) console.log("Reinstalling");
2408
+ process.exitCode = reinstall();
2409
+ }
2410
+ ).command(
2411
+ "up",
2412
+ "Up - Update dependencies",
2413
+ (yargs2) => {
2414
+ return yargs2;
2415
+ },
2416
+ (argv) => {
2417
+ if (argv.verbose) console.log("Up");
2418
+ process.exitCode = up();
2419
+ }
2420
+ ).command(
2421
+ "updo",
2422
+ "Updo - Update dependencies [Interactive]",
2423
+ (yargs2) => {
2424
+ return yargs2;
2425
+ },
2426
+ (argv) => {
2427
+ if (argv.verbose) console.log("Updo");
2428
+ process.exitCode = updo();
2429
+ }
2430
+ ).command(
2431
+ "statics",
2432
+ "Statics - Confirming Static Packages",
2433
+ (yargs2) => {
2434
+ return yargs2;
2435
+ },
2436
+ (argv) => {
2437
+ if (argv.verbose) console.log("Statics");
2438
+ process.exitCode = statics();
2439
+ }
2440
+ ).command(
2441
+ "dupdeps",
2442
+ "Dupdeps - Duplicate Dependencies in package.json",
2443
+ (yargs2) => {
2444
+ return yargs2;
2445
+ },
2446
+ (argv) => {
2447
+ if (argv.verbose) console.log("Dupdeps");
2448
+ process.exitCode = dupdeps();
2449
+ }
2450
+ );
2451
+ };
2730
2452
 
2731
2453
  // src/xy/xyLintCommands.ts
2732
- import chalk31 from "chalk";
2733
- var xyLintCommands = /* @__PURE__ */ __name((args) => {
2734
- return args.command("cycle [package]", "Cycle - Check for dependency cycles", (yargs2) => {
2735
- return packagePositionalParam(yargs2);
2736
- }, async (argv) => {
2737
- const start = Date.now();
2738
- if (argv.verbose) console.log("Cycle");
2739
- process.exitCode = await cycle({
2740
- pkg: argv.package
2741
- });
2742
- console.log(chalk31.blue(`Finished in ${Date.now() - start}ms`));
2743
- }).command("lint [package]", "Lint - Run Eslint", (yargs2) => {
2744
- return packagePositionalParam(yargs2);
2745
- }, (argv) => {
2746
- if (argv.verbose) console.log("Lint");
2747
- const start = Date.now();
2748
- process.exitCode = argv.fix ? fix({
2749
- pkg: argv.package
2750
- }) : lint({
2751
- pkg: argv.package
2752
- });
2753
- console.log(chalk31.blue(`Finished in ${Date.now() - start}ms`));
2754
- }).command("fix [package]", "Fix - Run Eslint w/fix", (yargs2) => {
2755
- return packagePositionalParam(yargs2);
2756
- }, (argv) => {
2757
- const start = Date.now();
2758
- if (argv.verbose) console.log("Fix");
2759
- process.exitCode = fix();
2760
- console.log(chalk31.blue(`Finished in ${Date.now() - start}ms`));
2761
- }).command("relint [package]", "Relint - Clean & Lint", (yargs2) => {
2762
- return packagePositionalParam(yargs2);
2763
- }, (argv) => {
2764
- if (argv.verbose) console.log("Relinting");
2765
- const start = Date.now();
2766
- process.exitCode = relint();
2767
- console.log(chalk31.blue(`Finished in ${Date.now() - start}ms`));
2768
- }).command("publint [package]", "Publint - Run Publint", (yargs2) => {
2769
- return packagePositionalParam(yargs2);
2770
- }, async (argv) => {
2771
- if (argv.verbose) console.log("Publint");
2772
- const start = Date.now();
2773
- process.exitCode = await publint({
2774
- pkg: argv.package,
2775
- verbose: !!argv.verbose
2776
- });
2777
- console.log(chalk31.blue(`Finished in ${Date.now() - start}ms`));
2778
- }).command("knip", "Knip - Run Knip", (yargs2) => {
2779
- return packagePositionalParam(yargs2);
2780
- }, (argv) => {
2781
- if (argv.verbose) console.log("Knip");
2782
- const start = Date.now();
2783
- process.exitCode = knip();
2784
- console.log(chalk31.blue(`Knip finished in ${Date.now() - start}ms`));
2785
- }).command("sonar", "Sonar - Run Sonar Check", (yargs2) => {
2786
- return packagePositionalParam(yargs2);
2787
- }, (argv) => {
2788
- const start = Date.now();
2789
- if (argv.verbose) console.log("Sonar Check");
2790
- process.exitCode = sonar();
2791
- console.log(chalk31.blue(`Finished in ${Date.now() - start}ms`));
2792
- });
2793
- }, "xyLintCommands");
2454
+ import chalk32 from "chalk";
2455
+ var xyLintCommands = (args) => {
2456
+ return args.command(
2457
+ "cycle [package]",
2458
+ "Cycle - Check for dependency cycles",
2459
+ (yargs2) => {
2460
+ return packagePositionalParam(yargs2);
2461
+ },
2462
+ async (argv) => {
2463
+ const start = Date.now();
2464
+ if (argv.verbose) console.log("Cycle");
2465
+ process.exitCode = await cycle({ pkg: argv.package });
2466
+ console.log(chalk32.blue(`Finished in ${Date.now() - start}ms`));
2467
+ }
2468
+ ).command(
2469
+ "lint [package]",
2470
+ "Lint - Run Eslint",
2471
+ (yargs2) => {
2472
+ return packagePositionalParam(yargs2);
2473
+ },
2474
+ (argv) => {
2475
+ if (argv.verbose) console.log("Lint");
2476
+ const start = Date.now();
2477
+ process.exitCode = argv.fix ? fix({ pkg: argv.package }) : lint({ pkg: argv.package });
2478
+ console.log(chalk32.blue(`Finished in ${Date.now() - start}ms`));
2479
+ }
2480
+ ).command(
2481
+ "deplint [package]",
2482
+ "Deplint - Run Deplint",
2483
+ (yargs2) => {
2484
+ return packagePositionalParam(yargs2);
2485
+ },
2486
+ (argv) => {
2487
+ if (argv.verbose) console.log("Deplint");
2488
+ const start = Date.now();
2489
+ process.exitCode = deplint({ pkg: argv.package });
2490
+ console.log(chalk32.blue(`Finished in ${Date.now() - start}ms`));
2491
+ }
2492
+ ).command(
2493
+ "fix [package]",
2494
+ "Fix - Run Eslint w/fix",
2495
+ (yargs2) => {
2496
+ return packagePositionalParam(yargs2);
2497
+ },
2498
+ (argv) => {
2499
+ const start = Date.now();
2500
+ if (argv.verbose) console.log("Fix");
2501
+ process.exitCode = fix();
2502
+ console.log(chalk32.blue(`Finished in ${Date.now() - start}ms`));
2503
+ }
2504
+ ).command(
2505
+ "relint [package]",
2506
+ "Relint - Clean & Lint",
2507
+ (yargs2) => {
2508
+ return packagePositionalParam(yargs2);
2509
+ },
2510
+ (argv) => {
2511
+ if (argv.verbose) console.log("Relinting");
2512
+ const start = Date.now();
2513
+ process.exitCode = relint();
2514
+ console.log(chalk32.blue(`Finished in ${Date.now() - start}ms`));
2515
+ }
2516
+ ).command(
2517
+ "publint [package]",
2518
+ "Publint - Run Publint",
2519
+ (yargs2) => {
2520
+ return packagePositionalParam(yargs2);
2521
+ },
2522
+ async (argv) => {
2523
+ if (argv.verbose) console.log("Publint");
2524
+ const start = Date.now();
2525
+ process.exitCode = await publint({ pkg: argv.package, verbose: !!argv.verbose });
2526
+ console.log(chalk32.blue(`Finished in ${Date.now() - start}ms`));
2527
+ }
2528
+ ).command(
2529
+ "knip",
2530
+ "Knip - Run Knip",
2531
+ (yargs2) => {
2532
+ return packagePositionalParam(yargs2);
2533
+ },
2534
+ (argv) => {
2535
+ if (argv.verbose) console.log("Knip");
2536
+ const start = Date.now();
2537
+ process.exitCode = knip();
2538
+ console.log(chalk32.blue(`Knip finished in ${Date.now() - start}ms`));
2539
+ }
2540
+ ).command(
2541
+ "sonar",
2542
+ "Sonar - Run Sonar Check",
2543
+ (yargs2) => {
2544
+ return packagePositionalParam(yargs2);
2545
+ },
2546
+ (argv) => {
2547
+ const start = Date.now();
2548
+ if (argv.verbose) console.log("Sonar Check");
2549
+ process.exitCode = sonar();
2550
+ console.log(chalk32.blue(`Finished in ${Date.now() - start}ms`));
2551
+ }
2552
+ );
2553
+ };
2794
2554
 
2795
2555
  // src/xy/xyParseOptions.ts
2796
2556
  import yargs from "yargs";
2797
2557
  import { hideBin } from "yargs/helpers";
2798
- var xyParseOptions = /* @__PURE__ */ __name(() => {
2558
+ var xyParseOptions = () => {
2799
2559
  return yargs(hideBin(process.argv)).scriptName("yarn xy").option("jobs", {
2800
2560
  alias: "j",
2801
2561
  default: void 0,
@@ -2809,10 +2569,7 @@ var xyParseOptions = /* @__PURE__ */ __name(() => {
2809
2569
  }).option("target", {
2810
2570
  alias: "t",
2811
2571
  default: "esm",
2812
- choices: [
2813
- "esm",
2814
- "cjs"
2815
- ],
2572
+ choices: ["esm", "cjs"],
2816
2573
  description: "Limit output to specific target",
2817
2574
  type: "string"
2818
2575
  }).option("incremental", {
@@ -2837,23 +2594,20 @@ var xyParseOptions = /* @__PURE__ */ __name(() => {
2837
2594
  type: "boolean"
2838
2595
  }).option("types", {
2839
2596
  default: "tsc",
2840
- choices: [
2841
- "tsc",
2842
- "tsup"
2843
- ],
2597
+ choices: ["tsc", "tsup"],
2844
2598
  description: "Tool to generate Typescript types",
2845
2599
  type: "string"
2846
2600
  });
2847
- }, "xyParseOptions");
2601
+ };
2848
2602
 
2849
2603
  // src/xy/xy.ts
2850
- var xy = /* @__PURE__ */ __name(async () => {
2604
+ var xy = async () => {
2851
2605
  const options = xyParseOptions();
2852
2606
  return await xyBuildCommands(xyCommonCommands(xyInstallCommands(xyDeployCommands(xyLintCommands(options))))).demandCommand(1).command("*", "", () => {
2853
- console.error(chalk32.yellow(`Command not found [${chalk32.magenta(process.argv[2])}]`));
2854
- console.log(chalk32.gray("Try 'yarn xy --help' for list of commands"));
2607
+ console.error(chalk33.yellow(`Command not found [${chalk33.magenta(process.argv[2])}]`));
2608
+ console.log(chalk33.gray("Try 'yarn xy --help' for list of commands"));
2855
2609
  }).version().help().argv;
2856
- }, "xy");
2610
+ };
2857
2611
  export {
2858
2612
  CROSS_PLATFORM_NEWLINE,
2859
2613
  DuplicateDetector,
@@ -2880,6 +2634,7 @@ export {
2880
2634
  defaultBuildConfig,
2881
2635
  defaultReadFileSyncOptions,
2882
2636
  deleteGlob,
2637
+ deplint,
2883
2638
  deploy,
2884
2639
  deployMajor,
2885
2640
  deployMinor,