@xylabs/ts-scripts-yarn3 7.0.0-rc.8 → 7.0.0

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