@xylabs/ts-scripts-yarn3 7.0.2 → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (270) hide show
  1. package/dist/actions/build.mjs +39 -87
  2. package/dist/actions/build.mjs.map +1 -1
  3. package/dist/actions/clean-docs.mjs +8 -22
  4. package/dist/actions/clean-docs.mjs.map +1 -1
  5. package/dist/actions/clean-eslint.mjs +5 -11
  6. package/dist/actions/clean-eslint.mjs.map +1 -1
  7. package/dist/actions/clean-jest.mjs +16 -29
  8. package/dist/actions/clean-jest.mjs.map +1 -1
  9. package/dist/actions/clean.mjs +32 -63
  10. package/dist/actions/clean.mjs.map +1 -1
  11. package/dist/actions/compile.mjs +50 -76
  12. package/dist/actions/compile.mjs.map +1 -1
  13. package/dist/actions/copy-assets.mjs +23 -38
  14. package/dist/actions/copy-assets.mjs.map +1 -1
  15. package/dist/actions/cycle.mjs +28 -57
  16. package/dist/actions/cycle.mjs.map +1 -1
  17. package/dist/actions/dead.mjs +16 -31
  18. package/dist/actions/dead.mjs.map +1 -1
  19. package/dist/actions/deplint/checkPackage/checkPackage.mjs +48 -71
  20. package/dist/actions/deplint/checkPackage/checkPackage.mjs.map +1 -1
  21. package/dist/actions/deplint/checkPackage/getUnlistedDependencies.mjs +5 -5
  22. package/dist/actions/deplint/checkPackage/getUnlistedDependencies.mjs.map +1 -1
  23. package/dist/actions/deplint/checkPackage/getUnlistedDevDependencies.mjs +9 -5
  24. package/dist/actions/deplint/checkPackage/getUnlistedDevDependencies.mjs.map +1 -1
  25. package/dist/actions/deplint/checkPackage/getUnusedDependencies.mjs +5 -5
  26. package/dist/actions/deplint/checkPackage/getUnusedDependencies.mjs.map +1 -1
  27. package/dist/actions/deplint/checkPackage/getUnusedPeerDependencies.mjs +0 -4
  28. package/dist/actions/deplint/checkPackage/getUnusedPeerDependencies.mjs.map +1 -1
  29. package/dist/actions/deplint/checkPackage/index.mjs +48 -71
  30. package/dist/actions/deplint/checkPackage/index.mjs.map +1 -1
  31. package/dist/actions/deplint/deplint.mjs +61 -86
  32. package/dist/actions/deplint/deplint.mjs.map +1 -1
  33. package/dist/actions/deplint/findFiles.mjs +4 -20
  34. package/dist/actions/deplint/findFiles.mjs.map +1 -1
  35. package/dist/actions/deplint/findFilesByGlob.mjs +1 -8
  36. package/dist/actions/deplint/findFilesByGlob.mjs.map +1 -1
  37. package/dist/actions/deplint/getBasePackageName.mjs +0 -4
  38. package/dist/actions/deplint/getBasePackageName.mjs.map +1 -1
  39. package/dist/actions/deplint/getDependenciesFromPackageJson.mjs +0 -4
  40. package/dist/actions/deplint/getDependenciesFromPackageJson.mjs.map +1 -1
  41. package/dist/actions/deplint/getExternalImportsFromFiles.mjs +12 -24
  42. package/dist/actions/deplint/getExternalImportsFromFiles.mjs.map +1 -1
  43. package/dist/actions/deplint/getImportsFromFile.mjs +9 -16
  44. package/dist/actions/deplint/getImportsFromFile.mjs.map +1 -1
  45. package/dist/actions/deplint/index.mjs +61 -86
  46. package/dist/actions/deplint/index.mjs.map +1 -1
  47. package/dist/actions/deploy-major.mjs +26 -57
  48. package/dist/actions/deploy-major.mjs.map +1 -1
  49. package/dist/actions/deploy-minor.mjs +26 -57
  50. package/dist/actions/deploy-minor.mjs.map +1 -1
  51. package/dist/actions/deploy-next.mjs +26 -57
  52. package/dist/actions/deploy-next.mjs.map +1 -1
  53. package/dist/actions/deploy.mjs +26 -57
  54. package/dist/actions/deploy.mjs.map +1 -1
  55. package/dist/actions/dupdeps.mjs +26 -37
  56. package/dist/actions/dupdeps.mjs.map +1 -1
  57. package/dist/actions/fix.mjs +36 -54
  58. package/dist/actions/fix.mjs.map +1 -1
  59. package/dist/actions/gen-docs.mjs +25 -65
  60. package/dist/actions/gen-docs.mjs.map +1 -1
  61. package/dist/actions/gitignore-gen.mjs +28 -44
  62. package/dist/actions/gitignore-gen.mjs.map +1 -1
  63. package/dist/actions/gitlint-fix.mjs +5 -14
  64. package/dist/actions/gitlint-fix.mjs.map +1 -1
  65. package/dist/actions/gitlint.mjs +4 -7
  66. package/dist/actions/gitlint.mjs.map +1 -1
  67. package/dist/actions/index.mjs +705 -1251
  68. package/dist/actions/index.mjs.map +1 -1
  69. package/dist/actions/knip.mjs +16 -31
  70. package/dist/actions/knip.mjs.map +1 -1
  71. package/dist/actions/license.mjs +37 -51
  72. package/dist/actions/license.mjs.map +1 -1
  73. package/dist/actions/lint.mjs +33 -48
  74. package/dist/actions/lint.mjs.map +1 -1
  75. package/dist/actions/npmignore-gen.mjs +28 -44
  76. package/dist/actions/npmignore-gen.mjs.map +1 -1
  77. package/dist/actions/package/clean-outputs.mjs +6 -16
  78. package/dist/actions/package/clean-outputs.mjs.map +1 -1
  79. package/dist/actions/package/clean-typescript.mjs +6 -16
  80. package/dist/actions/package/clean-typescript.mjs.map +1 -1
  81. package/dist/actions/package/clean.mjs +12 -29
  82. package/dist/actions/package/clean.mjs.map +1 -1
  83. package/dist/actions/package/compile/buildEntries.mjs +19 -34
  84. package/dist/actions/package/compile/buildEntries.mjs.map +1 -1
  85. package/dist/actions/package/compile/compile.mjs +165 -195
  86. package/dist/actions/package/compile/compile.mjs.map +1 -1
  87. package/dist/actions/package/compile/copyTypeFiles.mjs +20 -23
  88. package/dist/actions/package/compile/copyTypeFiles.mjs.map +1 -1
  89. package/dist/actions/package/compile/deepMerge.mjs +0 -5
  90. package/dist/actions/package/compile/deepMerge.mjs.map +1 -1
  91. package/dist/actions/package/compile/getCompilerOptions.mjs +2 -5
  92. package/dist/actions/package/compile/getCompilerOptions.mjs.map +1 -1
  93. package/dist/actions/package/compile/index.mjs +165 -195
  94. package/dist/actions/package/compile/index.mjs.map +1 -1
  95. package/dist/actions/package/compile/inputs.mjs +15 -25
  96. package/dist/actions/package/compile/inputs.mjs.map +1 -1
  97. package/dist/actions/package/compile/packageCompileTsc.mjs +25 -17
  98. package/dist/actions/package/compile/packageCompileTsc.mjs.map +1 -1
  99. package/dist/actions/package/compile/packageCompileTscTypes.mjs +19 -36
  100. package/dist/actions/package/compile/packageCompileTscTypes.mjs.map +1 -1
  101. package/dist/actions/package/compile/packageCompileTsup.mjs +160 -185
  102. package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -1
  103. package/dist/actions/package/copy-assets.mjs +12 -21
  104. package/dist/actions/package/copy-assets.mjs.map +1 -1
  105. package/dist/actions/package/cycle.mjs +5 -14
  106. package/dist/actions/package/cycle.mjs.map +1 -1
  107. package/dist/actions/package/gen-docs.mjs +11 -12
  108. package/dist/actions/package/gen-docs.mjs.map +1 -1
  109. package/dist/actions/package/index.mjs +236 -308
  110. package/dist/actions/package/index.mjs.map +1 -1
  111. package/dist/actions/package/lint.mjs +16 -39
  112. package/dist/actions/package/lint.mjs.map +1 -1
  113. package/dist/actions/package/publint.mjs +13 -14
  114. package/dist/actions/package/publint.mjs.map +1 -1
  115. package/dist/actions/package/recompile.mjs +179 -223
  116. package/dist/actions/package/recompile.mjs.map +1 -1
  117. package/dist/actions/publint.mjs +37 -71
  118. package/dist/actions/publint.mjs.map +1 -1
  119. package/dist/actions/rebuild.mjs +17 -29
  120. package/dist/actions/rebuild.mjs.map +1 -1
  121. package/dist/actions/recompile.mjs +50 -67
  122. package/dist/actions/recompile.mjs.map +1 -1
  123. package/dist/actions/reinstall.mjs +25 -43
  124. package/dist/actions/reinstall.mjs.map +1 -1
  125. package/dist/actions/relint.mjs +40 -63
  126. package/dist/actions/relint.mjs.map +1 -1
  127. package/dist/actions/retest.mjs +17 -35
  128. package/dist/actions/retest.mjs.map +1 -1
  129. package/dist/actions/sonar.mjs +16 -32
  130. package/dist/actions/sonar.mjs.map +1 -1
  131. package/dist/actions/statics.mjs +27 -46
  132. package/dist/actions/statics.mjs.map +1 -1
  133. package/dist/actions/test.mjs +16 -30
  134. package/dist/actions/test.mjs.map +1 -1
  135. package/dist/actions/up.mjs +16 -27
  136. package/dist/actions/up.mjs.map +1 -1
  137. package/dist/actions/updo.mjs +18 -33
  138. package/dist/actions/updo.mjs.map +1 -1
  139. package/dist/actions/upplug.mjs +19 -53
  140. package/dist/actions/upplug.mjs.map +1 -1
  141. package/dist/actions/upyarn.mjs +16 -31
  142. package/dist/actions/upyarn.mjs.map +1 -1
  143. package/dist/actions/yarn3only.mjs +12 -23
  144. package/dist/actions/yarn3only.mjs.map +1 -1
  145. package/dist/bin/package/build-only.mjs +165 -194
  146. package/dist/bin/package/build-only.mjs.map +1 -1
  147. package/dist/bin/package/build.mjs +166 -197
  148. package/dist/bin/package/build.mjs.map +1 -1
  149. package/dist/bin/package/clean-outputs.mjs +6 -15
  150. package/dist/bin/package/clean-outputs.mjs.map +1 -1
  151. package/dist/bin/package/clean-typescript.mjs +6 -15
  152. package/dist/bin/package/clean-typescript.mjs.map +1 -1
  153. package/dist/bin/package/clean.mjs +12 -28
  154. package/dist/bin/package/clean.mjs.map +1 -1
  155. package/dist/bin/package/compile-only.mjs +165 -194
  156. package/dist/bin/package/compile-only.mjs.map +1 -1
  157. package/dist/bin/package/compile-tsup.mjs +160 -184
  158. package/dist/bin/package/compile-tsup.mjs.map +1 -1
  159. package/dist/bin/package/compile.mjs +165 -194
  160. package/dist/bin/package/compile.mjs.map +1 -1
  161. package/dist/bin/package/copy-assets-cjs.mjs +13 -23
  162. package/dist/bin/package/copy-assets-cjs.mjs.map +1 -1
  163. package/dist/bin/package/copy-assets-esm.mjs +13 -23
  164. package/dist/bin/package/copy-assets-esm.mjs.map +1 -1
  165. package/dist/bin/package/cycle.mjs +5 -13
  166. package/dist/bin/package/cycle.mjs.map +1 -1
  167. package/dist/bin/package/fix.mjs +16 -38
  168. package/dist/bin/package/fix.mjs.map +1 -1
  169. package/dist/bin/package/gen-docs.mjs +11 -11
  170. package/dist/bin/package/gen-docs.mjs.map +1 -1
  171. package/dist/bin/package/lint.mjs +16 -38
  172. package/dist/bin/package/lint.mjs.map +1 -1
  173. package/dist/bin/package/publint.mjs +13 -13
  174. package/dist/bin/package/publint.mjs.map +1 -1
  175. package/dist/bin/package/recompile.mjs +179 -222
  176. package/dist/bin/package/recompile.mjs.map +1 -1
  177. package/dist/bin/package/relint.mjs +16 -38
  178. package/dist/bin/package/relint.mjs.map +1 -1
  179. package/dist/bin/xy.mjs +932 -1266
  180. package/dist/bin/xy.mjs.map +1 -1
  181. package/dist/index.mjs +1191 -1612
  182. package/dist/index.mjs.map +1 -1
  183. package/dist/lib/checkResult.mjs +2 -5
  184. package/dist/lib/checkResult.mjs.map +1 -1
  185. package/dist/lib/createBuildConfig.mjs +9 -24
  186. package/dist/lib/createBuildConfig.mjs.map +1 -1
  187. package/dist/lib/defaultBuildConfig.mjs +2 -6
  188. package/dist/lib/defaultBuildConfig.mjs.map +1 -1
  189. package/dist/lib/deleteGlob.mjs +3 -9
  190. package/dist/lib/deleteGlob.mjs.map +1 -1
  191. package/dist/lib/dependencies/DuplicateDetector.mjs +12 -23
  192. package/dist/lib/dependencies/DuplicateDetector.mjs.map +1 -1
  193. package/dist/lib/dependencies/detectDuplicateDependencies.mjs +22 -33
  194. package/dist/lib/dependencies/detectDuplicateDependencies.mjs.map +1 -1
  195. package/dist/lib/dependencies/index.mjs +22 -33
  196. package/dist/lib/dependencies/index.mjs.map +1 -1
  197. package/dist/lib/file/ReadFileSyncOptions.mjs +1 -3
  198. package/dist/lib/file/ReadFileSyncOptions.mjs.map +1 -1
  199. package/dist/lib/file/constants.mjs.map +1 -1
  200. package/dist/lib/file/fileLines.mjs +12 -13
  201. package/dist/lib/file/fileLines.mjs.map +1 -1
  202. package/dist/lib/file/index.mjs +14 -15
  203. package/dist/lib/file/index.mjs.map +1 -1
  204. package/dist/lib/file/tryReadFileSync.mjs +3 -8
  205. package/dist/lib/file/tryReadFileSync.mjs.map +1 -1
  206. package/dist/lib/generateIgnoreFiles.mjs +27 -43
  207. package/dist/lib/generateIgnoreFiles.mjs.map +1 -1
  208. package/dist/lib/index.mjs +99 -157
  209. package/dist/lib/index.mjs.map +1 -1
  210. package/dist/lib/jsonFormatters.mjs +2 -5
  211. package/dist/lib/jsonFormatters.mjs.map +1 -1
  212. package/dist/lib/loadConfig.mjs +3 -11
  213. package/dist/lib/loadConfig.mjs.map +1 -1
  214. package/dist/lib/parsedPackageJSON.mjs +2 -5
  215. package/dist/lib/parsedPackageJSON.mjs.map +1 -1
  216. package/dist/lib/processEx.mjs +6 -9
  217. package/dist/lib/processEx.mjs.map +1 -1
  218. package/dist/lib/runSteps.mjs +13 -19
  219. package/dist/lib/runSteps.mjs.map +1 -1
  220. package/dist/lib/runStepsAsync.mjs +22 -22
  221. package/dist/lib/runStepsAsync.mjs.map +1 -1
  222. package/dist/lib/runXy.mjs +19 -31
  223. package/dist/lib/runXy.mjs.map +1 -1
  224. package/dist/lib/runXyWithWarning.mjs +2 -5
  225. package/dist/lib/runXyWithWarning.mjs.map +1 -1
  226. package/dist/lib/safeExit.mjs +10 -13
  227. package/dist/lib/safeExit.mjs.map +1 -1
  228. package/dist/lib/string/empty.mjs +2 -5
  229. package/dist/lib/string/empty.mjs.map +1 -1
  230. package/dist/lib/string/index.mjs +3 -9
  231. package/dist/lib/string/index.mjs.map +1 -1
  232. package/dist/lib/string/union.mjs +1 -7
  233. package/dist/lib/string/union.mjs.map +1 -1
  234. package/dist/lib/withErrnoException.mjs +4 -7
  235. package/dist/lib/withErrnoException.mjs.map +1 -1
  236. package/dist/lib/withError.mjs +2 -5
  237. package/dist/lib/withError.mjs.map +1 -1
  238. package/dist/lib/yarn/index.mjs +11 -30
  239. package/dist/lib/yarn/index.mjs.map +1 -1
  240. package/dist/lib/yarn/isYarnVersionOrGreater.mjs +4 -15
  241. package/dist/lib/yarn/isYarnVersionOrGreater.mjs.map +1 -1
  242. package/dist/lib/yarn/workspace/index.mjs +5 -16
  243. package/dist/lib/yarn/workspace/index.mjs.map +1 -1
  244. package/dist/lib/yarn/workspace/yarnWorkspace.mjs +5 -16
  245. package/dist/lib/yarn/workspace/yarnWorkspace.mjs.map +1 -1
  246. package/dist/lib/yarn/workspace/yarnWorkspaces.mjs +3 -14
  247. package/dist/lib/yarn/workspace/yarnWorkspaces.mjs.map +1 -1
  248. package/dist/lib/yarn/yarnInitCwd.mjs +2 -5
  249. package/dist/lib/yarn/yarnInitCwd.mjs.map +1 -1
  250. package/dist/loadPackageConfig.mjs +3 -8
  251. package/dist/loadPackageConfig.mjs.map +1 -1
  252. package/dist/xy/index.mjs +932 -1267
  253. package/dist/xy/index.mjs.map +1 -1
  254. package/dist/xy/param.mjs +3 -9
  255. package/dist/xy/param.mjs.map +1 -1
  256. package/dist/xy/xy.mjs +932 -1267
  257. package/dist/xy/xy.mjs.map +1 -1
  258. package/dist/xy/xyBuildCommands.mjs +228 -320
  259. package/dist/xy/xyBuildCommands.mjs.map +1 -1
  260. package/dist/xy/xyCommonCommands.mjs +251 -336
  261. package/dist/xy/xyCommonCommands.mjs.map +1 -1
  262. package/dist/xy/xyDeployCommands.mjs +99 -161
  263. package/dist/xy/xyDeployCommands.mjs.map +1 -1
  264. package/dist/xy/xyInstallCommands.mjs +145 -193
  265. package/dist/xy/xyInstallCommands.mjs.map +1 -1
  266. package/dist/xy/xyLintCommands.mjs +302 -403
  267. package/dist/xy/xyLintCommands.mjs.map +1 -1
  268. package/dist/xy/xyParseOptions.mjs +2 -5
  269. package/dist/xy/xyParseOptions.mjs.map +1 -1
  270. package/package.json +8 -9
@@ -1,12 +1,9 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
1
  // src/actions/deploy-next.ts
5
2
  import { readFileSync } from "fs";
6
3
 
7
4
  // src/lib/checkResult.ts
8
5
  import chalk from "chalk";
9
- var checkResult = /* @__PURE__ */ __name((name, result, level = "error", exitOnFail = false) => {
6
+ var checkResult = (name, result, level = "error", exitOnFail = false) => {
10
7
  if (result) {
11
8
  const exiting = exitOnFail ? "[Exiting Process]" : "[Continuing]";
12
9
  const chalkFunc = level === "error" ? chalk.red : chalk.yellow;
@@ -15,23 +12,23 @@ var checkResult = /* @__PURE__ */ __name((name, result, level = "error", exitOnF
15
12
  process.exit(result);
16
13
  }
17
14
  }
18
- }, "checkResult");
15
+ };
19
16
 
20
17
  // src/lib/processEx.ts
21
18
  import chalk2 from "chalk";
22
19
 
23
20
  // src/lib/withError.ts
24
- var withError = /* @__PURE__ */ __name((ex, closure, predicate = (ex2) => !!ex2.name && !!ex2.message) => {
21
+ var withError = (ex, closure, predicate = (ex2) => !!ex2.name && !!ex2.message) => {
25
22
  return predicate(ex) ? closure(ex) : void 0;
26
- }, "withError");
23
+ };
27
24
 
28
25
  // src/lib/withErrnoException.ts
29
- var withErrnoException = /* @__PURE__ */ __name((ex, closure) => {
26
+ var withErrnoException = (ex, closure) => {
30
27
  return withError(ex, closure, (ex2) => ex2.errno !== void 0);
31
- }, "withErrnoException");
28
+ };
32
29
 
33
30
  // src/lib/processEx.ts
34
- var processEx = /* @__PURE__ */ __name((ex) => {
31
+ var processEx = (ex) => {
35
32
  const error = typeof ex === "string" ? new Error(ex) : ex;
36
33
  const exitCode = withErrnoException(error, (error2) => {
37
34
  if (error2.code === "ENOENT") {
@@ -48,10 +45,10 @@ var processEx = /* @__PURE__ */ __name((ex) => {
48
45
  return -1;
49
46
  })();
50
47
  process.exit(process.exitCode ?? exitCode);
51
- }, "processEx");
48
+ };
52
49
 
53
50
  // src/lib/safeExit.ts
54
- var safeExit = /* @__PURE__ */ __name((func, exitOnFail = true) => {
51
+ var safeExit = (func, exitOnFail = true) => {
55
52
  try {
56
53
  const result = func();
57
54
  if (result && exitOnFail) {
@@ -61,33 +58,25 @@ var safeExit = /* @__PURE__ */ __name((func, exitOnFail = true) => {
61
58
  } catch (ex) {
62
59
  return processEx(ex);
63
60
  }
64
- }, "safeExit");
61
+ };
65
62
 
66
63
  // src/lib/yarn/workspace/yarnWorkspaces.ts
67
64
  import { spawnSync } from "child_process";
68
- var yarnWorkspaces = /* @__PURE__ */ __name(() => {
69
- const result = spawnSync("yarn", [
70
- "workspaces",
71
- "list",
72
- "--json",
73
- "--recursive"
74
- ], {
75
- encoding: "utf8",
76
- shell: true
77
- });
65
+ var yarnWorkspaces = () => {
66
+ const result = spawnSync("yarn", ["workspaces", "list", "--json", "--recursive"], { encoding: "utf8", shell: true });
78
67
  if (result.error) {
79
68
  throw result.error;
80
69
  }
81
70
  return result.stdout.toString().split("\n").slice(0, -1).map((item) => {
82
71
  return JSON.parse(item);
83
72
  });
84
- }, "yarnWorkspaces");
73
+ };
85
74
 
86
75
  // src/lib/runSteps.ts
87
76
  import { spawnSync as spawnSync2 } from "child_process";
88
77
  import { existsSync } from "fs";
89
78
  import chalk3 from "chalk";
90
- var runSteps = /* @__PURE__ */ __name((name, steps, exitOnFail = true, messages) => {
79
+ var runSteps = (name, steps, exitOnFail = true, messages) => {
91
80
  return safeExit(() => {
92
81
  const pkgName = process.env.npm_package_name;
93
82
  console.log(chalk3.green(`${name} [${pkgName}]`));
@@ -103,10 +92,7 @@ var runSteps = /* @__PURE__ */ __name((name, steps, exitOnFail = true, messages)
103
92
  const status = spawnSync2(command, Array.isArray(args) ? args : args.split(" "), {
104
93
  ...config,
105
94
  encoding: "utf8",
106
- env: {
107
- FORCE_COLOR: "3",
108
- ...process.env
109
- },
95
+ env: { FORCE_COLOR: "3", ...process.env },
110
96
  shell: true,
111
97
  stdio: "inherit"
112
98
  }).status ?? 0;
@@ -115,48 +101,31 @@ var runSteps = /* @__PURE__ */ __name((name, steps, exitOnFail = true, messages)
115
101
  }
116
102
  return totalStatus;
117
103
  }, !!exitOnFail);
118
- }, "runSteps");
104
+ };
119
105
 
120
106
  // src/actions/deploy-next.ts
121
- var privatePackageExcludeList = /* @__PURE__ */ __name(() => {
107
+ var privatePackageExcludeList = () => {
122
108
  const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
123
109
  workspace,
124
- JSON.parse(readFileSync(`${workspace.location}/package.json`, {
125
- encoding: "utf8"
126
- }))
110
+ JSON.parse(readFileSync(`${workspace.location}/package.json`, { encoding: "utf8" }))
127
111
  ]);
128
112
  const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
129
113
  const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
130
114
  return excludeList;
131
- }, "privatePackageExcludeList");
132
- var deployNext = /* @__PURE__ */ __name(() => {
115
+ };
116
+ var deployNext = () => {
133
117
  const excludeList = privatePackageExcludeList();
134
118
  if (excludeList.length > 0) {
135
119
  console.log("Excluding private packages from deployment:", excludeList);
136
120
  }
137
121
  return runSteps("Deploy [Next]", [
138
- [
139
- "yarn",
140
- "workspaces foreach --all version minor --deferred"
141
- ],
142
- [
143
- "yarn",
144
- "xy clean"
145
- ],
146
- [
147
- "yarn",
148
- "xy build"
149
- ],
150
- [
151
- "yarn",
152
- "version apply --all --prerelease"
153
- ],
154
- [
155
- "yarn",
156
- `workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish --tag next`
157
- ]
122
+ ["yarn", "workspaces foreach --all version minor --deferred"],
123
+ ["yarn", "xy clean"],
124
+ ["yarn", "xy build"],
125
+ ["yarn", "version apply --all --prerelease"],
126
+ ["yarn", `workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish --tag next`]
158
127
  ]);
159
- }, "deployNext");
128
+ };
160
129
  export {
161
130
  deployNext
162
131
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/actions/deploy-next.ts","../../src/lib/checkResult.ts","../../src/lib/processEx.ts","../../src/lib/withError.ts","../../src/lib/withErrnoException.ts","../../src/lib/safeExit.ts","../../src/lib/yarn/workspace/yarnWorkspaces.ts","../../src/lib/runSteps.ts"],"sourcesContent":["import { readFileSync } from 'node:fs'\n\nimport type { Workspace } from '../lib/index.ts'\nimport { runSteps, yarnWorkspaces } from '../lib/index.ts'\n\nconst privatePackageExcludeList = () => {\n const possibleDeployablePackages: [Workspace, { private?: boolean }][] = yarnWorkspaces().map(workspace => [workspace,\n JSON.parse(readFileSync(`${workspace.location}/package.json`, { encoding: 'utf8' })) as object])\n\n const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace)\n const excludeList = privatePackages.map(workspace => `--exclude ${workspace.name}`)\n return excludeList\n}\n\nexport const deployNext = () => {\n const excludeList = privatePackageExcludeList()\n if (excludeList.length > 0) {\n console.log('Excluding private packages from deployment:', excludeList)\n }\n return runSteps('Deploy [Next]', [\n ['yarn', 'workspaces foreach --all version minor --deferred'],\n ['yarn', 'xy clean'],\n ['yarn', 'xy build'],\n ['yarn', 'version apply --all --prerelease'],\n ['yarn', `workspaces foreach --all ${excludeList.join(' ')} --parallel npm publish --tag next`],\n ])\n}\n","import chalk from 'chalk'\n\nexport const checkResult = (name: string, result: number, level: 'error' | 'warn' = 'error', exitOnFail = false) => {\n if (result) {\n const exiting = exitOnFail ? '[Exiting Process]' : '[Continuing]'\n const chalkFunc = level === 'error' ? chalk.red : chalk.yellow\n console[level](chalkFunc(`${name} had ${result} failures ${exiting}`))\n if (exitOnFail) {\n process.exit(result)\n }\n }\n}\n","import chalk from 'chalk'\n\nimport { withErrnoException } from './withErrnoException.ts'\nimport { withError } from './withError.ts'\n\nexport const processEx = (ex: unknown) => {\n const error = typeof ex === 'string' ? new Error(ex) : ex\n const exitCode\n = withErrnoException(error, (error) => {\n if (error.code === 'ENOENT') {\n console.error(chalk.red(`'${error.path}' not found.`))\n } else {\n console.error(chalk.red(`Errno: ${error.code}`))\n }\n return error.errno ?? -1\n })\n ?? withError(error, (error) => {\n console.error(chalk.red(`${error.name}: ${error.message}`))\n return -1\n })\n ?? (() => {\n console.error(chalk.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`))\n return -1\n })()\n // This allows us to use a previously set exit code\n process.exit(process.exitCode ?? exitCode)\n}\n","export const withError = <T extends Error = Error>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ex: any,\n closure: (error: T) => number,\n predicate = (ex: T) => (!!ex.name && !!ex.message),\n) => {\n return predicate(ex as T) ? closure(ex as T) : undefined\n}\n","import { withError } from './withError.ts'\n\nexport const withErrnoException = <T extends NodeJS.ErrnoException = NodeJS.ErrnoException>(\n ex: unknown, closure: (error: T) => number,\n) => {\n return withError<T>(ex, closure, (ex: unknown) => (ex as NodeJS.ErrnoException).errno !== undefined)\n}\n","/** Catch child process a crash and returns the code */\n\nimport { processEx } from './processEx.ts'\n\nconst safeExit = (func: () => number, exitOnFail = true): number => {\n try {\n const result = func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nconst safeExitAsync = async (func: () => Promise<number>, exitOnFail = true): Promise<number> => {\n try {\n const result = await func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nexport { safeExit, safeExitAsync }\n","import { spawnSync } from 'node:child_process'\n\nimport type { Workspace } from './Workspace.ts'\n\nexport const yarnWorkspaces = (): Workspace[] => {\n const result = spawnSync('yarn', ['workspaces', 'list', '--json', '--recursive'], { encoding: 'utf8', shell: true })\n if (result.error) {\n throw result.error\n }\n return (\n result.stdout\n .toString()\n // NOTE: This probably doesn't work on Windows\n // TODO: Replace /r/n with /n first\n .split('\\n')\n .slice(0, -1)\n .map((item) => {\n return JSON.parse(item)\n })\n )\n}\n","import type { SpawnSyncOptionsWithBufferEncoding } from 'node:child_process'\nimport { spawnSync } from 'node:child_process'\nimport { existsSync } from 'node:fs'\n\nimport chalk from 'chalk'\n\nimport { checkResult } from './checkResult.ts'\nimport { safeExit } from './safeExit.ts'\n\nexport type ScriptStep\n = | [/* command */ 'yarn' | 'node' | 'ts-node-script' | 'tsc' | 'jest', /* arg */ string | string[]]\n | [/* command */ string, /* arg */ string | string[], /* config */ SpawnSyncOptionsWithBufferEncoding]\n\nexport const runSteps = (name: string, steps: ScriptStep[], exitOnFail = true, messages?: string[]): number => {\n return safeExit(() => {\n const pkgName = process.env.npm_package_name\n console.log(chalk.green(`${name} [${pkgName}]`))\n let totalStatus = 0\n for (const [i, [command, args, config]] of steps.entries()) {\n if (messages?.[i]) {\n console.log(chalk.gray(messages?.[i]))\n }\n const argList = Array.isArray(args) ? args : args.split(' ')\n if (command === 'node' && !existsSync(argList[0])) {\n throw new Error(`File not found [${argList[0]}]`)\n }\n const status\n = spawnSync(command, Array.isArray(args) ? args : args.split(' '), {\n ...config,\n encoding: 'utf8',\n env: { FORCE_COLOR: '3', ...process.env },\n shell: true,\n stdio: 'inherit',\n }).status ?? 0\n checkResult(name, status, 'error', exitOnFail)\n totalStatus += status ?? 0\n }\n return totalStatus\n }, !!exitOnFail)\n}\n"],"mappings":";;;;AAAA,SAASA,oBAAoB;;;ACA7B,OAAOC,WAAW;AAEX,IAAMC,cAAc,wBAACC,MAAcC,QAAgBC,QAA0B,SAASC,aAAa,UAAK;AAC7G,MAAIF,QAAQ;AACV,UAAMG,UAAUD,aAAa,sBAAsB;AACnD,UAAME,YAAYH,UAAU,UAAUI,MAAMC,MAAMD,MAAME;AACxDC,YAAQP,KAAAA,EAAOG,UAAU,GAAGL,IAAAA,QAAYC,MAAAA,aAAmBG,OAAAA,EAAS,CAAA;AACpE,QAAID,YAAY;AACdO,cAAQC,KAAKV,MAAAA;IACf;EACF;AACF,GAT2B;;;ACF3B,OAAOW,YAAW;;;ACAX,IAAMC,YAAY,wBAEvBC,IACAC,SACAC,YAAY,CAACF,QAAW,CAAC,CAACA,IAAGG,QAAQ,CAAC,CAACH,IAAGI,YAAQ;AAElD,SAAOF,UAAUF,EAAAA,IAAWC,QAAQD,EAAAA,IAAWK;AACjD,GAPyB;;;ACElB,IAAMC,qBAAqB,wBAChCC,IAAaC,YAAAA;AAEb,SAAOC,UAAaF,IAAIC,SAAS,CAACD,QAAiBA,IAA6BG,UAAUC,MAAAA;AAC5F,GAJkC;;;AFG3B,IAAMC,YAAY,wBAACC,OAAAA;AACxB,QAAMC,QAAQ,OAAOD,OAAO,WAAW,IAAIE,MAAMF,EAAAA,IAAMA;AACvD,QAAMG,WACFC,mBAAmBH,OAAO,CAACA,WAAAA;AAC3B,QAAIA,OAAM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,CAAC,CAACC,SAAAA,MAAeA,SAAAA;AAC1G,QAAMW,cAAcL,gBAAgBP,IAAIC,CAAAA,cAAa,aAAaA,UAAUY,IAAI,EAAE;AAClF,SAAOD;AACT,GAPkC;AAS3B,IAAME,aAAa,6BAAA;AACxB,QAAMF,cAAcf,0BAAAA;AACpB,MAAIe,YAAYG,SAAS,GAAG;AAC1BC,YAAQC,IAAI,+CAA+CL,WAAAA;EAC7D;AACA,SAAOM,SAAS,iBAAiB;IAC/B;MAAC;MAAQ;;IACT;MAAC;MAAQ;;IACT;MAAC;MAAQ;;IACT;MAAC;MAAQ;;IACT;MAAC;MAAQ,4BAA4BN,YAAYO,KAAK,GAAA,CAAA;;GACvD;AACH,GAZ0B;","names":["readFileSync","chalk","checkResult","name","result","level","exitOnFail","exiting","chalkFunc","chalk","red","yellow","console","process","exit","chalk","withError","ex","closure","predicate","name","message","undefined","withErrnoException","ex","closure","withError","errno","undefined","processEx","ex","error","Error","exitCode","withErrnoException","code","console","chalk","red","path","errno","withError","name","message","JSON","stringify","process","exit","safeExit","func","exitOnFail","result","process","exit","ex","processEx","spawnSync","yarnWorkspaces","result","spawnSync","encoding","shell","error","stdout","toString","split","slice","map","item","JSON","parse","spawnSync","existsSync","chalk","runSteps","name","steps","exitOnFail","messages","safeExit","pkgName","process","env","npm_package_name","console","log","chalk","green","totalStatus","i","command","args","config","entries","gray","argList","Array","isArray","split","existsSync","Error","status","spawnSync","encoding","FORCE_COLOR","shell","stdio","checkResult","privatePackageExcludeList","possibleDeployablePackages","yarnWorkspaces","map","workspace","JSON","parse","readFileSync","location","encoding","privatePackages","filter","_","pkg","private","excludeList","name","deployNext","length","console","log","runSteps","join"]}
1
+ {"version":3,"sources":["../../src/actions/deploy-next.ts","../../src/lib/checkResult.ts","../../src/lib/processEx.ts","../../src/lib/withError.ts","../../src/lib/withErrnoException.ts","../../src/lib/safeExit.ts","../../src/lib/yarn/workspace/yarnWorkspaces.ts","../../src/lib/runSteps.ts"],"sourcesContent":["import { readFileSync } from 'node:fs'\n\nimport type { Workspace } from '../lib/index.ts'\nimport { runSteps, yarnWorkspaces } from '../lib/index.ts'\n\nconst privatePackageExcludeList = () => {\n const possibleDeployablePackages: [Workspace, { private?: boolean }][] = yarnWorkspaces().map(workspace => [workspace,\n JSON.parse(readFileSync(`${workspace.location}/package.json`, { encoding: 'utf8' })) as object])\n\n const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace)\n const excludeList = privatePackages.map(workspace => `--exclude ${workspace.name}`)\n return excludeList\n}\n\nexport const deployNext = () => {\n const excludeList = privatePackageExcludeList()\n if (excludeList.length > 0) {\n console.log('Excluding private packages from deployment:', excludeList)\n }\n return runSteps('Deploy [Next]', [\n ['yarn', 'workspaces foreach --all version minor --deferred'],\n ['yarn', 'xy clean'],\n ['yarn', 'xy build'],\n ['yarn', 'version apply --all --prerelease'],\n ['yarn', `workspaces foreach --all ${excludeList.join(' ')} --parallel npm publish --tag next`],\n ])\n}\n","import chalk from 'chalk'\n\nexport const checkResult = (name: string, result: number, level: 'error' | 'warn' = 'error', exitOnFail = false) => {\n if (result) {\n const exiting = exitOnFail ? '[Exiting Process]' : '[Continuing]'\n const chalkFunc = level === 'error' ? chalk.red : chalk.yellow\n console[level](chalkFunc(`${name} had ${result} failures ${exiting}`))\n if (exitOnFail) {\n process.exit(result)\n }\n }\n}\n","import chalk from 'chalk'\n\nimport { withErrnoException } from './withErrnoException.ts'\nimport { withError } from './withError.ts'\n\nexport const processEx = (ex: unknown) => {\n const error = typeof ex === 'string' ? new Error(ex) : ex\n const exitCode\n = withErrnoException(error, (error) => {\n if (error.code === 'ENOENT') {\n console.error(chalk.red(`'${error.path}' not found.`))\n } else {\n console.error(chalk.red(`Errno: ${error.code}`))\n }\n return error.errno ?? -1\n })\n ?? withError(error, (error) => {\n console.error(chalk.red(`${error.name}: ${error.message}`))\n return -1\n })\n ?? (() => {\n console.error(chalk.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`))\n return -1\n })()\n // This allows us to use a previously set exit code\n process.exit(process.exitCode ?? exitCode)\n}\n","export const withError = <T extends Error = Error>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ex: any,\n closure: (error: T) => number,\n predicate = (ex: T) => (!!ex.name && !!ex.message),\n) => {\n return predicate(ex as T) ? closure(ex as T) : undefined\n}\n","import { withError } from './withError.ts'\n\nexport const withErrnoException = <T extends NodeJS.ErrnoException = NodeJS.ErrnoException>(\n ex: unknown, closure: (error: T) => number,\n) => {\n return withError<T>(ex, closure, (ex: unknown) => (ex as NodeJS.ErrnoException).errno !== undefined)\n}\n","/** Catch child process a crash and returns the code */\n\nimport { processEx } from './processEx.ts'\n\nconst safeExit = (func: () => number, exitOnFail = true): number => {\n try {\n const result = func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nconst safeExitAsync = async (func: () => Promise<number>, exitOnFail = true): Promise<number> => {\n try {\n const result = await func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nexport { safeExit, safeExitAsync }\n","import { spawnSync } from 'node:child_process'\n\nimport type { Workspace } from './Workspace.ts'\n\nexport const yarnWorkspaces = (): Workspace[] => {\n const result = spawnSync('yarn', ['workspaces', 'list', '--json', '--recursive'], { encoding: 'utf8', shell: true })\n if (result.error) {\n throw result.error\n }\n return (\n result.stdout\n .toString()\n // NOTE: This probably doesn't work on Windows\n // TODO: Replace /r/n with /n first\n .split('\\n')\n .slice(0, -1)\n .map((item) => {\n return JSON.parse(item)\n })\n )\n}\n","import type { SpawnSyncOptionsWithBufferEncoding } from 'node:child_process'\nimport { spawnSync } from 'node:child_process'\nimport { existsSync } from 'node:fs'\n\nimport chalk from 'chalk'\n\nimport { checkResult } from './checkResult.ts'\nimport { safeExit } from './safeExit.ts'\n\nexport type ScriptStep\n = | [/* command */ 'yarn' | 'node' | 'ts-node-script' | 'tsc' | 'jest', /* arg */ string | string[]]\n | [/* command */ string, /* arg */ string | string[], /* config */ SpawnSyncOptionsWithBufferEncoding]\n\nexport const runSteps = (name: string, steps: ScriptStep[], exitOnFail = true, messages?: string[]): number => {\n return safeExit(() => {\n const pkgName = process.env.npm_package_name\n console.log(chalk.green(`${name} [${pkgName}]`))\n let totalStatus = 0\n for (const [i, [command, args, config]] of steps.entries()) {\n if (messages?.[i]) {\n console.log(chalk.gray(messages?.[i]))\n }\n const argList = Array.isArray(args) ? args : args.split(' ')\n if (command === 'node' && !existsSync(argList[0])) {\n throw new Error(`File not found [${argList[0]}]`)\n }\n const status\n = spawnSync(command, Array.isArray(args) ? args : args.split(' '), {\n ...config,\n encoding: 'utf8',\n env: { FORCE_COLOR: '3', ...process.env },\n shell: true,\n stdio: 'inherit',\n }).status ?? 0\n checkResult(name, status, 'error', exitOnFail)\n totalStatus += status ?? 0\n }\n return totalStatus\n }, !!exitOnFail)\n}\n"],"mappings":";AAAA,SAAS,oBAAoB;;;ACA7B,OAAO,WAAW;AAEX,IAAM,cAAc,CAAC,MAAc,QAAgB,QAA0B,SAAS,aAAa,UAAU;AAClH,MAAI,QAAQ;AACV,UAAM,UAAU,aAAa,sBAAsB;AACnD,UAAM,YAAY,UAAU,UAAU,MAAM,MAAM,MAAM;AACxD,YAAQ,KAAK,EAAE,UAAU,GAAG,IAAI,QAAQ,MAAM,aAAa,OAAO,EAAE,CAAC;AACrE,QAAI,YAAY;AACd,cAAQ,KAAK,MAAM;AAAA,IACrB;AAAA,EACF;AACF;;;ACXA,OAAOA,YAAW;;;ACAX,IAAM,YAAY,CAEvB,IACA,SACA,YAAY,CAACC,QAAW,CAAC,CAACA,IAAG,QAAQ,CAAC,CAACA,IAAG,YACvC;AACH,SAAO,UAAU,EAAO,IAAI,QAAQ,EAAO,IAAI;AACjD;;;ACLO,IAAM,qBAAqB,CAChC,IAAa,YACV;AACH,SAAO,UAAa,IAAI,SAAS,CAACC,QAAiBA,IAA6B,UAAU,MAAS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W,CAAC;AAEjG,QAAM,kBAAkB,2BAA2B,OAAO,CAAC,CAAC,GAAG,GAAG,MAAM,IAAI,OAAO,EAAE,IAAI,CAAC,CAAC,SAAS,MAAM,SAAS;AACnH,QAAM,cAAc,gBAAgB,IAAI,eAAa,aAAa,UAAU,IAAI,EAAE;AAClF,SAAO;AACT;AAEO,IAAM,aAAa,MAAM;AAC9B,QAAM,cAAc,0BAA0B;AAC9C,MAAI,YAAY,SAAS,GAAG;AAC1B,YAAQ,IAAI,+CAA+C,WAAW;AAAA,EACxE;AACA,SAAO,SAAS,iBAAiB;AAAA,IAC/B,CAAC,QAAQ,mDAAmD;AAAA,IAC5D,CAAC,QAAQ,UAAU;AAAA,IACnB,CAAC,QAAQ,UAAU;AAAA,IACnB,CAAC,QAAQ,kCAAkC;AAAA,IAC3C,CAAC,QAAQ,4BAA4B,YAAY,KAAK,GAAG,CAAC,oCAAoC;AAAA,EAChG,CAAC;AACH;","names":["chalk","ex","ex","error","chalk","spawnSync","chalk","chalk","spawnSync"]}
@@ -1,12 +1,9 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
1
  // src/actions/deploy.ts
5
2
  import { readFileSync } from "fs";
6
3
 
7
4
  // src/lib/checkResult.ts
8
5
  import chalk from "chalk";
9
- var checkResult = /* @__PURE__ */ __name((name, result, level = "error", exitOnFail = false) => {
6
+ var checkResult = (name, result, level = "error", exitOnFail = false) => {
10
7
  if (result) {
11
8
  const exiting = exitOnFail ? "[Exiting Process]" : "[Continuing]";
12
9
  const chalkFunc = level === "error" ? chalk.red : chalk.yellow;
@@ -15,23 +12,23 @@ var checkResult = /* @__PURE__ */ __name((name, result, level = "error", exitOnF
15
12
  process.exit(result);
16
13
  }
17
14
  }
18
- }, "checkResult");
15
+ };
19
16
 
20
17
  // src/lib/processEx.ts
21
18
  import chalk2 from "chalk";
22
19
 
23
20
  // src/lib/withError.ts
24
- var withError = /* @__PURE__ */ __name((ex, closure, predicate = (ex2) => !!ex2.name && !!ex2.message) => {
21
+ var withError = (ex, closure, predicate = (ex2) => !!ex2.name && !!ex2.message) => {
25
22
  return predicate(ex) ? closure(ex) : void 0;
26
- }, "withError");
23
+ };
27
24
 
28
25
  // src/lib/withErrnoException.ts
29
- var withErrnoException = /* @__PURE__ */ __name((ex, closure) => {
26
+ var withErrnoException = (ex, closure) => {
30
27
  return withError(ex, closure, (ex2) => ex2.errno !== void 0);
31
- }, "withErrnoException");
28
+ };
32
29
 
33
30
  // src/lib/processEx.ts
34
- var processEx = /* @__PURE__ */ __name((ex) => {
31
+ var processEx = (ex) => {
35
32
  const error = typeof ex === "string" ? new Error(ex) : ex;
36
33
  const exitCode = withErrnoException(error, (error2) => {
37
34
  if (error2.code === "ENOENT") {
@@ -48,10 +45,10 @@ var processEx = /* @__PURE__ */ __name((ex) => {
48
45
  return -1;
49
46
  })();
50
47
  process.exit(process.exitCode ?? exitCode);
51
- }, "processEx");
48
+ };
52
49
 
53
50
  // src/lib/safeExit.ts
54
- var safeExit = /* @__PURE__ */ __name((func, exitOnFail = true) => {
51
+ var safeExit = (func, exitOnFail = true) => {
55
52
  try {
56
53
  const result = func();
57
54
  if (result && exitOnFail) {
@@ -61,33 +58,25 @@ var safeExit = /* @__PURE__ */ __name((func, exitOnFail = true) => {
61
58
  } catch (ex) {
62
59
  return processEx(ex);
63
60
  }
64
- }, "safeExit");
61
+ };
65
62
 
66
63
  // src/lib/yarn/workspace/yarnWorkspaces.ts
67
64
  import { spawnSync } from "child_process";
68
- var yarnWorkspaces = /* @__PURE__ */ __name(() => {
69
- const result = spawnSync("yarn", [
70
- "workspaces",
71
- "list",
72
- "--json",
73
- "--recursive"
74
- ], {
75
- encoding: "utf8",
76
- shell: true
77
- });
65
+ var yarnWorkspaces = () => {
66
+ const result = spawnSync("yarn", ["workspaces", "list", "--json", "--recursive"], { encoding: "utf8", shell: true });
78
67
  if (result.error) {
79
68
  throw result.error;
80
69
  }
81
70
  return result.stdout.toString().split("\n").slice(0, -1).map((item) => {
82
71
  return JSON.parse(item);
83
72
  });
84
- }, "yarnWorkspaces");
73
+ };
85
74
 
86
75
  // src/lib/runSteps.ts
87
76
  import { spawnSync as spawnSync2 } from "child_process";
88
77
  import { existsSync } from "fs";
89
78
  import chalk3 from "chalk";
90
- var runSteps = /* @__PURE__ */ __name((name, steps, exitOnFail = true, messages) => {
79
+ var runSteps = (name, steps, exitOnFail = true, messages) => {
91
80
  return safeExit(() => {
92
81
  const pkgName = process.env.npm_package_name;
93
82
  console.log(chalk3.green(`${name} [${pkgName}]`));
@@ -103,10 +92,7 @@ var runSteps = /* @__PURE__ */ __name((name, steps, exitOnFail = true, messages)
103
92
  const status = spawnSync2(command, Array.isArray(args) ? args : args.split(" "), {
104
93
  ...config,
105
94
  encoding: "utf8",
106
- env: {
107
- FORCE_COLOR: "3",
108
- ...process.env
109
- },
95
+ env: { FORCE_COLOR: "3", ...process.env },
110
96
  shell: true,
111
97
  stdio: "inherit"
112
98
  }).status ?? 0;
@@ -115,48 +101,31 @@ var runSteps = /* @__PURE__ */ __name((name, steps, exitOnFail = true, messages)
115
101
  }
116
102
  return totalStatus;
117
103
  }, !!exitOnFail);
118
- }, "runSteps");
104
+ };
119
105
 
120
106
  // src/actions/deploy.ts
121
- var privatePackageExcludeList = /* @__PURE__ */ __name(() => {
107
+ var privatePackageExcludeList = () => {
122
108
  const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
123
109
  workspace,
124
- JSON.parse(readFileSync(`${workspace.location}/package.json`, {
125
- encoding: "utf8"
126
- }))
110
+ JSON.parse(readFileSync(`${workspace.location}/package.json`, { encoding: "utf8" }))
127
111
  ]);
128
112
  const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
129
113
  const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
130
114
  return excludeList;
131
- }, "privatePackageExcludeList");
132
- var deploy = /* @__PURE__ */ __name(() => {
115
+ };
116
+ var deploy = () => {
133
117
  const excludeList = privatePackageExcludeList();
134
118
  if (excludeList.length > 0) {
135
119
  console.log("Excluding private packages from deployment:", excludeList);
136
120
  }
137
121
  return runSteps("Deploy [Patch]", [
138
- [
139
- "yarn",
140
- "workspaces foreach --all version patch --deferred"
141
- ],
142
- [
143
- "yarn",
144
- "xy clean"
145
- ],
146
- [
147
- "yarn",
148
- "xy build"
149
- ],
150
- [
151
- "yarn",
152
- "version apply --all"
153
- ],
154
- [
155
- "yarn",
156
- `workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish`
157
- ]
122
+ ["yarn", "workspaces foreach --all version patch --deferred"],
123
+ ["yarn", "xy clean"],
124
+ ["yarn", "xy build"],
125
+ ["yarn", "version apply --all"],
126
+ ["yarn", `workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish`]
158
127
  ]);
159
- }, "deploy");
128
+ };
160
129
  export {
161
130
  deploy
162
131
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/actions/deploy.ts","../../src/lib/checkResult.ts","../../src/lib/processEx.ts","../../src/lib/withError.ts","../../src/lib/withErrnoException.ts","../../src/lib/safeExit.ts","../../src/lib/yarn/workspace/yarnWorkspaces.ts","../../src/lib/runSteps.ts"],"sourcesContent":["import { readFileSync } from 'node:fs'\n\nimport type { Workspace } from '../lib/index.ts'\nimport { runSteps, yarnWorkspaces } from '../lib/index.ts'\n\nconst privatePackageExcludeList = () => {\n const possibleDeployablePackages: [Workspace, { private?: boolean }][] = yarnWorkspaces().map(workspace => [workspace,\n JSON.parse(readFileSync(`${workspace.location}/package.json`, { encoding: 'utf8' })) as object])\n\n const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace)\n const excludeList = privatePackages.map(workspace => `--exclude ${workspace.name}`)\n return excludeList\n}\n\nexport const deploy = () => {\n const excludeList = privatePackageExcludeList()\n if (excludeList.length > 0) {\n console.log('Excluding private packages from deployment:', excludeList)\n }\n\n return runSteps('Deploy [Patch]', [\n ['yarn', 'workspaces foreach --all version patch --deferred'],\n ['yarn', 'xy clean'],\n ['yarn', 'xy build'],\n ['yarn', 'version apply --all'],\n ['yarn', `workspaces foreach --all ${excludeList.join(' ')} --parallel npm publish`],\n ])\n}\n","import chalk from 'chalk'\n\nexport const checkResult = (name: string, result: number, level: 'error' | 'warn' = 'error', exitOnFail = false) => {\n if (result) {\n const exiting = exitOnFail ? '[Exiting Process]' : '[Continuing]'\n const chalkFunc = level === 'error' ? chalk.red : chalk.yellow\n console[level](chalkFunc(`${name} had ${result} failures ${exiting}`))\n if (exitOnFail) {\n process.exit(result)\n }\n }\n}\n","import chalk from 'chalk'\n\nimport { withErrnoException } from './withErrnoException.ts'\nimport { withError } from './withError.ts'\n\nexport const processEx = (ex: unknown) => {\n const error = typeof ex === 'string' ? new Error(ex) : ex\n const exitCode\n = withErrnoException(error, (error) => {\n if (error.code === 'ENOENT') {\n console.error(chalk.red(`'${error.path}' not found.`))\n } else {\n console.error(chalk.red(`Errno: ${error.code}`))\n }\n return error.errno ?? -1\n })\n ?? withError(error, (error) => {\n console.error(chalk.red(`${error.name}: ${error.message}`))\n return -1\n })\n ?? (() => {\n console.error(chalk.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`))\n return -1\n })()\n // This allows us to use a previously set exit code\n process.exit(process.exitCode ?? exitCode)\n}\n","export const withError = <T extends Error = Error>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ex: any,\n closure: (error: T) => number,\n predicate = (ex: T) => (!!ex.name && !!ex.message),\n) => {\n return predicate(ex as T) ? closure(ex as T) : undefined\n}\n","import { withError } from './withError.ts'\n\nexport const withErrnoException = <T extends NodeJS.ErrnoException = NodeJS.ErrnoException>(\n ex: unknown, closure: (error: T) => number,\n) => {\n return withError<T>(ex, closure, (ex: unknown) => (ex as NodeJS.ErrnoException).errno !== undefined)\n}\n","/** Catch child process a crash and returns the code */\n\nimport { processEx } from './processEx.ts'\n\nconst safeExit = (func: () => number, exitOnFail = true): number => {\n try {\n const result = func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nconst safeExitAsync = async (func: () => Promise<number>, exitOnFail = true): Promise<number> => {\n try {\n const result = await func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nexport { safeExit, safeExitAsync }\n","import { spawnSync } from 'node:child_process'\n\nimport type { Workspace } from './Workspace.ts'\n\nexport const yarnWorkspaces = (): Workspace[] => {\n const result = spawnSync('yarn', ['workspaces', 'list', '--json', '--recursive'], { encoding: 'utf8', shell: true })\n if (result.error) {\n throw result.error\n }\n return (\n result.stdout\n .toString()\n // NOTE: This probably doesn't work on Windows\n // TODO: Replace /r/n with /n first\n .split('\\n')\n .slice(0, -1)\n .map((item) => {\n return JSON.parse(item)\n })\n )\n}\n","import type { SpawnSyncOptionsWithBufferEncoding } from 'node:child_process'\nimport { spawnSync } from 'node:child_process'\nimport { existsSync } from 'node:fs'\n\nimport chalk from 'chalk'\n\nimport { checkResult } from './checkResult.ts'\nimport { safeExit } from './safeExit.ts'\n\nexport type ScriptStep\n = | [/* command */ 'yarn' | 'node' | 'ts-node-script' | 'tsc' | 'jest', /* arg */ string | string[]]\n | [/* command */ string, /* arg */ string | string[], /* config */ SpawnSyncOptionsWithBufferEncoding]\n\nexport const runSteps = (name: string, steps: ScriptStep[], exitOnFail = true, messages?: string[]): number => {\n return safeExit(() => {\n const pkgName = process.env.npm_package_name\n console.log(chalk.green(`${name} [${pkgName}]`))\n let totalStatus = 0\n for (const [i, [command, args, config]] of steps.entries()) {\n if (messages?.[i]) {\n console.log(chalk.gray(messages?.[i]))\n }\n const argList = Array.isArray(args) ? args : args.split(' ')\n if (command === 'node' && !existsSync(argList[0])) {\n throw new Error(`File not found [${argList[0]}]`)\n }\n const status\n = spawnSync(command, Array.isArray(args) ? args : args.split(' '), {\n ...config,\n encoding: 'utf8',\n env: { FORCE_COLOR: '3', ...process.env },\n shell: true,\n stdio: 'inherit',\n }).status ?? 0\n checkResult(name, status, 'error', exitOnFail)\n totalStatus += status ?? 0\n }\n return totalStatus\n }, !!exitOnFail)\n}\n"],"mappings":";;;;AAAA,SAASA,oBAAoB;;;ACA7B,OAAOC,WAAW;AAEX,IAAMC,cAAc,wBAACC,MAAcC,QAAgBC,QAA0B,SAASC,aAAa,UAAK;AAC7G,MAAIF,QAAQ;AACV,UAAMG,UAAUD,aAAa,sBAAsB;AACnD,UAAME,YAAYH,UAAU,UAAUI,MAAMC,MAAMD,MAAME;AACxDC,YAAQP,KAAAA,EAAOG,UAAU,GAAGL,IAAAA,QAAYC,MAAAA,aAAmBG,OAAAA,EAAS,CAAA;AACpE,QAAID,YAAY;AACdO,cAAQC,KAAKV,MAAAA;IACf;EACF;AACF,GAT2B;;;ACF3B,OAAOW,YAAW;;;ACAX,IAAMC,YAAY,wBAEvBC,IACAC,SACAC,YAAY,CAACF,QAAW,CAAC,CAACA,IAAGG,QAAQ,CAAC,CAACH,IAAGI,YAAQ;AAElD,SAAOF,UAAUF,EAAAA,IAAWC,QAAQD,EAAAA,IAAWK;AACjD,GAPyB;;;ACElB,IAAMC,qBAAqB,wBAChCC,IAAaC,YAAAA;AAEb,SAAOC,UAAaF,IAAIC,SAAS,CAACD,QAAiBA,IAA6BG,UAAUC,MAAAA;AAC5F,GAJkC;;;AFG3B,IAAMC,YAAY,wBAACC,OAAAA;AACxB,QAAMC,QAAQ,OAAOD,OAAO,WAAW,IAAIE,MAAMF,EAAAA,IAAMA;AACvD,QAAMG,WACFC,mBAAmBH,OAAO,CAACA,WAAAA;AAC3B,QAAIA,OAAMI,SAAS,UAAU;AAC3BC,cAAQL,MAAMM,OAAMC,IAAI,IAAIP,OAAMQ,IAAI,cAAc,CAAA;IACtD,OAAO;AACLH,cAAQL,MAAMM,OAAMC,IAAI,UAAUP,OAAMI,IAAI,EAAE,CAAA;IAChD;AACA,WAAOJ,OAAMS,SAAS;EACxB,CAAA,KACGC,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,SAAS,GAAG;AAC1BC,YAAQC,IAAI,+CAA+CL,WAAAA;EAC7D;AAEA,SAAOM,SAAS,kBAAkB;IAChC;MAAC;MAAQ;;IACT;MAAC;MAAQ;;IACT;MAAC;MAAQ;;IACT;MAAC;MAAQ;;IACT;MAAC;MAAQ,4BAA4BN,YAAYO,KAAK,GAAA,CAAA;;GACvD;AACH,GAbsB;","names":["readFileSync","chalk","checkResult","name","result","level","exitOnFail","exiting","chalkFunc","chalk","red","yellow","console","process","exit","chalk","withError","ex","closure","predicate","name","message","undefined","withErrnoException","ex","closure","withError","errno","undefined","processEx","ex","error","Error","exitCode","withErrnoException","code","console","chalk","red","path","errno","withError","name","message","JSON","stringify","process","exit","safeExit","func","exitOnFail","result","process","exit","ex","processEx","spawnSync","yarnWorkspaces","result","spawnSync","encoding","shell","error","stdout","toString","split","slice","map","item","JSON","parse","spawnSync","existsSync","chalk","runSteps","name","steps","exitOnFail","messages","safeExit","pkgName","process","env","npm_package_name","console","log","chalk","green","totalStatus","i","command","args","config","entries","gray","argList","Array","isArray","split","existsSync","Error","status","spawnSync","encoding","FORCE_COLOR","shell","stdio","checkResult","privatePackageExcludeList","possibleDeployablePackages","yarnWorkspaces","map","workspace","JSON","parse","readFileSync","location","encoding","privatePackages","filter","_","pkg","private","excludeList","name","deploy","length","console","log","runSteps","join"]}
1
+ {"version":3,"sources":["../../src/actions/deploy.ts","../../src/lib/checkResult.ts","../../src/lib/processEx.ts","../../src/lib/withError.ts","../../src/lib/withErrnoException.ts","../../src/lib/safeExit.ts","../../src/lib/yarn/workspace/yarnWorkspaces.ts","../../src/lib/runSteps.ts"],"sourcesContent":["import { readFileSync } from 'node:fs'\n\nimport type { Workspace } from '../lib/index.ts'\nimport { runSteps, yarnWorkspaces } from '../lib/index.ts'\n\nconst privatePackageExcludeList = () => {\n const possibleDeployablePackages: [Workspace, { private?: boolean }][] = yarnWorkspaces().map(workspace => [workspace,\n JSON.parse(readFileSync(`${workspace.location}/package.json`, { encoding: 'utf8' })) as object])\n\n const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace)\n const excludeList = privatePackages.map(workspace => `--exclude ${workspace.name}`)\n return excludeList\n}\n\nexport const deploy = () => {\n const excludeList = privatePackageExcludeList()\n if (excludeList.length > 0) {\n console.log('Excluding private packages from deployment:', excludeList)\n }\n\n return runSteps('Deploy [Patch]', [\n ['yarn', 'workspaces foreach --all version patch --deferred'],\n ['yarn', 'xy clean'],\n ['yarn', 'xy build'],\n ['yarn', 'version apply --all'],\n ['yarn', `workspaces foreach --all ${excludeList.join(' ')} --parallel npm publish`],\n ])\n}\n","import chalk from 'chalk'\n\nexport const checkResult = (name: string, result: number, level: 'error' | 'warn' = 'error', exitOnFail = false) => {\n if (result) {\n const exiting = exitOnFail ? '[Exiting Process]' : '[Continuing]'\n const chalkFunc = level === 'error' ? chalk.red : chalk.yellow\n console[level](chalkFunc(`${name} had ${result} failures ${exiting}`))\n if (exitOnFail) {\n process.exit(result)\n }\n }\n}\n","import chalk from 'chalk'\n\nimport { withErrnoException } from './withErrnoException.ts'\nimport { withError } from './withError.ts'\n\nexport const processEx = (ex: unknown) => {\n const error = typeof ex === 'string' ? new Error(ex) : ex\n const exitCode\n = withErrnoException(error, (error) => {\n if (error.code === 'ENOENT') {\n console.error(chalk.red(`'${error.path}' not found.`))\n } else {\n console.error(chalk.red(`Errno: ${error.code}`))\n }\n return error.errno ?? -1\n })\n ?? withError(error, (error) => {\n console.error(chalk.red(`${error.name}: ${error.message}`))\n return -1\n })\n ?? (() => {\n console.error(chalk.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`))\n return -1\n })()\n // This allows us to use a previously set exit code\n process.exit(process.exitCode ?? exitCode)\n}\n","export const withError = <T extends Error = Error>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ex: any,\n closure: (error: T) => number,\n predicate = (ex: T) => (!!ex.name && !!ex.message),\n) => {\n return predicate(ex as T) ? closure(ex as T) : undefined\n}\n","import { withError } from './withError.ts'\n\nexport const withErrnoException = <T extends NodeJS.ErrnoException = NodeJS.ErrnoException>(\n ex: unknown, closure: (error: T) => number,\n) => {\n return withError<T>(ex, closure, (ex: unknown) => (ex as NodeJS.ErrnoException).errno !== undefined)\n}\n","/** Catch child process a crash and returns the code */\n\nimport { processEx } from './processEx.ts'\n\nconst safeExit = (func: () => number, exitOnFail = true): number => {\n try {\n const result = func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nconst safeExitAsync = async (func: () => Promise<number>, exitOnFail = true): Promise<number> => {\n try {\n const result = await func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nexport { safeExit, safeExitAsync }\n","import { spawnSync } from 'node:child_process'\n\nimport type { Workspace } from './Workspace.ts'\n\nexport const yarnWorkspaces = (): Workspace[] => {\n const result = spawnSync('yarn', ['workspaces', 'list', '--json', '--recursive'], { encoding: 'utf8', shell: true })\n if (result.error) {\n throw result.error\n }\n return (\n result.stdout\n .toString()\n // NOTE: This probably doesn't work on Windows\n // TODO: Replace /r/n with /n first\n .split('\\n')\n .slice(0, -1)\n .map((item) => {\n return JSON.parse(item)\n })\n )\n}\n","import type { SpawnSyncOptionsWithBufferEncoding } from 'node:child_process'\nimport { spawnSync } from 'node:child_process'\nimport { existsSync } from 'node:fs'\n\nimport chalk from 'chalk'\n\nimport { checkResult } from './checkResult.ts'\nimport { safeExit } from './safeExit.ts'\n\nexport type ScriptStep\n = | [/* command */ 'yarn' | 'node' | 'ts-node-script' | 'tsc' | 'jest', /* arg */ string | string[]]\n | [/* command */ string, /* arg */ string | string[], /* config */ SpawnSyncOptionsWithBufferEncoding]\n\nexport const runSteps = (name: string, steps: ScriptStep[], exitOnFail = true, messages?: string[]): number => {\n return safeExit(() => {\n const pkgName = process.env.npm_package_name\n console.log(chalk.green(`${name} [${pkgName}]`))\n let totalStatus = 0\n for (const [i, [command, args, config]] of steps.entries()) {\n if (messages?.[i]) {\n console.log(chalk.gray(messages?.[i]))\n }\n const argList = Array.isArray(args) ? args : args.split(' ')\n if (command === 'node' && !existsSync(argList[0])) {\n throw new Error(`File not found [${argList[0]}]`)\n }\n const status\n = spawnSync(command, Array.isArray(args) ? args : args.split(' '), {\n ...config,\n encoding: 'utf8',\n env: { FORCE_COLOR: '3', ...process.env },\n shell: true,\n stdio: 'inherit',\n }).status ?? 0\n checkResult(name, status, 'error', exitOnFail)\n totalStatus += status ?? 0\n }\n return totalStatus\n }, !!exitOnFail)\n}\n"],"mappings":";AAAA,SAAS,oBAAoB;;;ACA7B,OAAO,WAAW;AAEX,IAAM,cAAc,CAAC,MAAc,QAAgB,QAA0B,SAAS,aAAa,UAAU;AAClH,MAAI,QAAQ;AACV,UAAM,UAAU,aAAa,sBAAsB;AACnD,UAAM,YAAY,UAAU,UAAU,MAAM,MAAM,MAAM;AACxD,YAAQ,KAAK,EAAE,UAAU,GAAG,IAAI,QAAQ,MAAM,aAAa,OAAO,EAAE,CAAC;AACrE,QAAI,YAAY;AACd,cAAQ,KAAK,MAAM;AAAA,IACrB;AAAA,EACF;AACF;;;ACXA,OAAOA,YAAW;;;ACAX,IAAM,YAAY,CAEvB,IACA,SACA,YAAY,CAACC,QAAW,CAAC,CAACA,IAAG,QAAQ,CAAC,CAACA,IAAG,YACvC;AACH,SAAO,UAAU,EAAO,IAAI,QAAQ,EAAO,IAAI;AACjD;;;ACLO,IAAM,qBAAqB,CAChC,IAAa,YACV;AACH,SAAO,UAAa,IAAI,SAAS,CAACC,QAAiBA,IAA6B,UAAU,MAAS;AACrG;;;AFDO,IAAM,YAAY,CAAC,OAAgB;AACxC,QAAM,QAAQ,OAAO,OAAO,WAAW,IAAI,MAAM,EAAE,IAAI;AACvD,QAAM,WACF,mBAAmB,OAAO,CAACC,WAAU;AACrC,QAAIA,OAAM,SAAS,UAAU;AAC3B,cAAQ,MAAMC,OAAM,IAAI,IAAID,OAAM,IAA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MAAM;AAC1B,QAAM,cAAc,0BAA0B;AAC9C,MAAI,YAAY,SAAS,GAAG;AAC1B,YAAQ,IAAI,+CAA+C,WAAW;AAAA,EACxE;AAEA,SAAO,SAAS,kBAAkB;AAAA,IAChC,CAAC,QAAQ,mDAAmD;AAAA,IAC5D,CAAC,QAAQ,UAAU;AAAA,IACnB,CAAC,QAAQ,UAAU;AAAA,IACnB,CAAC,QAAQ,qBAAqB;AAAA,IAC9B,CAAC,QAAQ,4BAA4B,YAAY,KAAK,GAAG,CAAC,yBAAyB;AAAA,EACrF,CAAC;AACH;","names":["chalk","ex","ex","error","chalk","spawnSync","chalk","chalk","spawnSync"]}
@@ -1,6 +1,3 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
1
  // src/actions/dupdeps.ts
5
2
  import chalk3 from "chalk";
6
3
 
@@ -11,17 +8,17 @@ import { execSync } from "child_process";
11
8
  import chalk from "chalk";
12
9
 
13
10
  // src/lib/withError.ts
14
- var withError = /* @__PURE__ */ __name((ex, closure, predicate = (ex2) => !!ex2.name && !!ex2.message) => {
11
+ var withError = (ex, closure, predicate = (ex2) => !!ex2.name && !!ex2.message) => {
15
12
  return predicate(ex) ? closure(ex) : void 0;
16
- }, "withError");
13
+ };
17
14
 
18
15
  // src/lib/withErrnoException.ts
19
- var withErrnoException = /* @__PURE__ */ __name((ex, closure) => {
16
+ var withErrnoException = (ex, closure) => {
20
17
  return withError(ex, closure, (ex2) => ex2.errno !== void 0);
21
- }, "withErrnoException");
18
+ };
22
19
 
23
20
  // src/lib/processEx.ts
24
- var processEx = /* @__PURE__ */ __name((ex) => {
21
+ var processEx = (ex) => {
25
22
  const error = typeof ex === "string" ? new Error(ex) : ex;
26
23
  const exitCode = withErrnoException(error, (error2) => {
27
24
  if (error2.code === "ENOENT") {
@@ -38,10 +35,10 @@ var processEx = /* @__PURE__ */ __name((ex) => {
38
35
  return -1;
39
36
  })();
40
37
  process.exit(process.exitCode ?? exitCode);
41
- }, "processEx");
38
+ };
42
39
 
43
40
  // src/lib/safeExit.ts
44
- var safeExit = /* @__PURE__ */ __name((func, exitOnFail = true) => {
41
+ var safeExit = (func, exitOnFail = true) => {
45
42
  try {
46
43
  const result = func();
47
44
  if (result && exitOnFail) {
@@ -51,22 +48,22 @@ var safeExit = /* @__PURE__ */ __name((func, exitOnFail = true) => {
51
48
  } catch (ex) {
52
49
  return processEx(ex);
53
50
  }
54
- }, "safeExit");
51
+ };
55
52
 
56
53
  // src/lib/dependencies/DuplicateDetector.ts
57
54
  import { EOL } from "os";
58
55
  import chalk2 from "chalk";
59
56
 
60
57
  // src/lib/jsonFormatters.ts
61
- var multiLineToJSONArray = /* @__PURE__ */ __name((output) => {
58
+ var multiLineToJSONArray = (output) => {
62
59
  const withCommas = output.replaceAll("\r\n", "").replaceAll("\n", ",");
63
60
  const cleanCollection = withCommas.slice(0, Math.max(0, withCommas.length - 1));
64
61
  const collection = `[${cleanCollection}]`;
65
62
  return JSON.parse(collection);
66
- }, "multiLineToJSONArray");
63
+ };
67
64
 
68
65
  // src/lib/dependencies/DuplicateDetector.ts
69
- var trimVirtualMeta = /* @__PURE__ */ __name((value) => {
66
+ var trimVirtualMeta = (value) => {
70
67
  const virtualParts = value.split("virtual:");
71
68
  if (virtualParts.length > 1) {
72
69
  const hashParts = virtualParts[1].split("#");
@@ -74,8 +71,8 @@ var trimVirtualMeta = /* @__PURE__ */ __name((value) => {
74
71
  } else {
75
72
  return value;
76
73
  }
77
- }, "trimVirtualMeta");
78
- var trimObjectDependencyVirtualMeta = /* @__PURE__ */ __name((obj) => {
74
+ };
75
+ var trimObjectDependencyVirtualMeta = (obj) => {
79
76
  const resultObj = {};
80
77
  for (const [key, value] of Object.entries(obj)) {
81
78
  resultObj[trimVirtualMeta(key)] = {
@@ -84,19 +81,13 @@ var trimObjectDependencyVirtualMeta = /* @__PURE__ */ __name((obj) => {
84
81
  };
85
82
  }
86
83
  return resultObj;
87
- }, "trimObjectDependencyVirtualMeta");
88
- var trimDependencyVirtualMeta = /* @__PURE__ */ __name((dependencies) => {
84
+ };
85
+ var trimDependencyVirtualMeta = (dependencies) => {
89
86
  return dependencies.map((dependency) => {
90
- return {
91
- children: trimObjectDependencyVirtualMeta(dependency.children),
92
- value: trimVirtualMeta(dependency.value)
93
- };
87
+ return { children: trimObjectDependencyVirtualMeta(dependency.children), value: trimVirtualMeta(dependency.value) };
94
88
  });
95
- }, "trimDependencyVirtualMeta");
89
+ };
96
90
  var DuplicateDetector = class {
97
- static {
98
- __name(this, "DuplicateDetector");
99
- }
100
91
  dependency;
101
92
  dependencyEntries;
102
93
  constructor(output, dependency) {
@@ -126,21 +117,19 @@ var DuplicateDetector = class {
126
117
  acc.duplicateVersions.push(acc.currentVersion);
127
118
  }
128
119
  acc.duplicateVersions.push(version);
129
- acc.duplicateVersions = [
130
- ...new Set(acc.duplicateVersions)
131
- ];
120
+ acc.duplicateVersions = [...new Set(acc.duplicateVersions)];
132
121
  }
133
122
  return acc;
134
123
  }
135
- resultsFactory = /* @__PURE__ */ __name((dependency) => ({
124
+ resultsFactory = (dependency) => ({
136
125
  currentVersion: void 0,
137
126
  dependency,
138
127
  duplicateVersions: []
139
- }), "resultsFactory");
128
+ });
140
129
  };
141
130
 
142
131
  // src/lib/dependencies/detectDuplicateDependencies.ts
143
- var detectDuplicateDependencies = /* @__PURE__ */ __name((depsFromPackageJSON, DefaultDependencies) => {
132
+ var detectDuplicateDependencies = (depsFromPackageJSON, DefaultDependencies) => {
144
133
  let exitCode = 0;
145
134
  const dependencies = depsFromPackageJSON?.length ? depsFromPackageJSON : DefaultDependencies;
146
135
  return safeExit(() => {
@@ -171,23 +160,23 @@ var detectDuplicateDependencies = /* @__PURE__ */ __name((depsFromPackageJSON, D
171
160
  return exitCode;
172
161
  }
173
162
  });
174
- }, "detectDuplicateDependencies");
163
+ };
175
164
 
176
165
  // src/lib/parsedPackageJSON.ts
177
166
  import { readFileSync } from "fs";
178
- var parsedPackageJSON = /* @__PURE__ */ __name((path) => {
167
+ var parsedPackageJSON = (path) => {
179
168
  const pathToPackageJSON = path ?? process.env.npm_package_json ?? "";
180
169
  const packageJSON = readFileSync(pathToPackageJSON).toString();
181
170
  return JSON.parse(packageJSON);
182
- }, "parsedPackageJSON");
171
+ };
183
172
 
184
173
  // src/actions/dupdeps.ts
185
- var dupdeps = /* @__PURE__ */ __name(() => {
174
+ var dupdeps = () => {
186
175
  console.log(chalk3.green("Checking all Dependencies for Duplicates"));
187
176
  const allDependencies = parsedPackageJSON()?.dependencies;
188
177
  const dependencies = Object.entries(allDependencies).map(([k]) => k);
189
178
  return detectDuplicateDependencies(dependencies);
190
- }, "dupdeps");
179
+ };
191
180
  export {
192
181
  dupdeps
193
182
  };