@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/build.ts
5
2
  import chalk5 from "chalk";
6
3
 
7
4
  // src/lib/checkResult.ts
8
5
  import chalk from "chalk";
9
- var checkResult = /* @__PURE__ */ __name((name, result, level = "error", exitOnFail = false) => {
6
+ var checkResult = (name, result, level = "error", exitOnFail = false) => {
10
7
  if (result) {
11
8
  const exiting = exitOnFail ? "[Exiting Process]" : "[Continuing]";
12
9
  const chalkFunc = level === "error" ? chalk.red : chalk.yellow;
@@ -15,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,8 +58,8 @@ var safeExit = /* @__PURE__ */ __name((func, exitOnFail = true) => {
61
58
  } catch (ex) {
62
59
  return processEx(ex);
63
60
  }
64
- }, "safeExit");
65
- var safeExitAsync = /* @__PURE__ */ __name(async (func, exitOnFail = true) => {
61
+ };
62
+ var safeExitAsync = async (func, exitOnFail = true) => {
66
63
  try {
67
64
  const result = await func();
68
65
  if (result && exitOnFail) {
@@ -72,33 +69,25 @@ var safeExitAsync = /* @__PURE__ */ __name(async (func, exitOnFail = true) => {
72
69
  } catch (ex) {
73
70
  return processEx(ex);
74
71
  }
75
- }, "safeExitAsync");
72
+ };
76
73
 
77
74
  // src/lib/yarn/workspace/yarnWorkspaces.ts
78
75
  import { spawnSync } from "child_process";
79
- var yarnWorkspaces = /* @__PURE__ */ __name(() => {
80
- const result = spawnSync("yarn", [
81
- "workspaces",
82
- "list",
83
- "--json",
84
- "--recursive"
85
- ], {
86
- encoding: "utf8",
87
- shell: true
88
- });
76
+ var yarnWorkspaces = () => {
77
+ const result = spawnSync("yarn", ["workspaces", "list", "--json", "--recursive"], { encoding: "utf8", shell: true });
89
78
  if (result.error) {
90
79
  throw result.error;
91
80
  }
92
81
  return result.stdout.toString().split("\n").slice(0, -1).map((item) => {
93
82
  return JSON.parse(item);
94
83
  });
95
- }, "yarnWorkspaces");
84
+ };
96
85
 
97
86
  // src/lib/runSteps.ts
98
87
  import { spawnSync as spawnSync2 } from "child_process";
99
88
  import { existsSync } from "fs";
100
89
  import chalk3 from "chalk";
101
- var runSteps = /* @__PURE__ */ __name((name, steps, exitOnFail = true, messages) => {
90
+ var runSteps = (name, steps, exitOnFail = true, messages) => {
102
91
  return safeExit(() => {
103
92
  const pkgName = process.env.npm_package_name;
104
93
  console.log(chalk3.green(`${name} [${pkgName}]`));
@@ -114,10 +103,7 @@ var runSteps = /* @__PURE__ */ __name((name, steps, exitOnFail = true, messages)
114
103
  const status = spawnSync2(command, Array.isArray(args) ? args : args.split(" "), {
115
104
  ...config,
116
105
  encoding: "utf8",
117
- env: {
118
- FORCE_COLOR: "3",
119
- ...process.env
120
- },
106
+ env: { FORCE_COLOR: "3", ...process.env },
121
107
  shell: true,
122
108
  stdio: "inherit"
123
109
  }).status ?? 0;
@@ -126,13 +112,13 @@ var runSteps = /* @__PURE__ */ __name((name, steps, exitOnFail = true, messages)
126
112
  }
127
113
  return totalStatus;
128
114
  }, !!exitOnFail);
129
- }, "runSteps");
115
+ };
130
116
 
131
117
  // src/lib/runStepsAsync.ts
132
118
  import { spawn } from "child_process";
133
119
  import { existsSync as existsSync2 } from "fs";
134
120
  import chalk4 from "chalk";
135
- var runStepAsync = /* @__PURE__ */ __name((name, step, exitOnFail = true, message) => {
121
+ var runStepAsync = (name, step, exitOnFail = true, message) => {
136
122
  return new Promise((resolve) => {
137
123
  const [command, args, config] = step;
138
124
  if (message) {
@@ -144,15 +130,18 @@ var runStepAsync = /* @__PURE__ */ __name((name, step, exitOnFail = true, messag
144
130
  }
145
131
  spawn(command, Array.isArray(args) ? args : args.split(" "), {
146
132
  ...config,
147
- env: {
148
- FORCE_COLOR: "3",
149
- ...process.env
150
- },
133
+ env: { FORCE_COLOR: "3", ...process.env },
151
134
  shell: true,
152
135
  stdio: "inherit"
153
136
  }).on("close", (code) => {
154
137
  if (code) {
155
- console.error(chalk4.red(`Command Exited With Non-Zero Result [${chalk4.gray(code)}] | ${chalk4.yellow(command)} ${chalk4.white(Array.isArray(args) ? args.join(" ") : args)}`));
138
+ console.error(
139
+ chalk4.red(
140
+ `Command Exited With Non-Zero Result [${chalk4.gray(code)}] | ${chalk4.yellow(command)} ${chalk4.white(
141
+ Array.isArray(args) ? args.join(" ") : args
142
+ )}`
143
+ )
144
+ );
156
145
  checkResult(name, code, "error", exitOnFail);
157
146
  resolve(code);
158
147
  } else {
@@ -160,8 +149,8 @@ var runStepAsync = /* @__PURE__ */ __name((name, step, exitOnFail = true, messag
160
149
  }
161
150
  });
162
151
  });
163
- }, "runStepAsync");
164
- var runStepsAsync = /* @__PURE__ */ __name(async (name, steps, exitOnFail = true, messages) => {
152
+ };
153
+ var runStepsAsync = async (name, steps, exitOnFail = true, messages) => {
165
154
  return await safeExitAsync(async () => {
166
155
  const pkgName = process.env.npm_package_name;
167
156
  console.log(chalk4.green(`${name} [${pkgName}]`));
@@ -171,86 +160,45 @@ var runStepsAsync = /* @__PURE__ */ __name(async (name, steps, exitOnFail = true
171
160
  }
172
161
  return result;
173
162
  });
174
- }, "runStepsAsync");
163
+ };
175
164
 
176
165
  // src/actions/build.ts
177
- var build = /* @__PURE__ */ __name(async ({ incremental, jobs, target, verbose, pkg }) => {
166
+ var build = async ({
167
+ incremental,
168
+ jobs,
169
+ target,
170
+ verbose,
171
+ pkg
172
+ }) => {
178
173
  const start = Date.now();
179
- const pkgOptions = pkg === void 0 ? [] : [
180
- pkg
181
- ];
182
- const incrementalOptions = incremental ? [
183
- "-i"
184
- ] : [];
185
- const verboseOptions = verbose ? [
186
- "-v"
187
- ] : [];
188
- const targetOptions = target === void 0 ? [] : [
189
- "-t",
190
- target
191
- ];
192
- const jobsOptions = jobs === void 0 ? [] : [
193
- "-j",
194
- `${jobs}`
195
- ];
174
+ const pkgOptions = pkg === void 0 ? [] : [pkg];
175
+ const incrementalOptions = incremental ? ["-i"] : [];
176
+ const verboseOptions = verbose ? ["-v"] : [];
177
+ const targetOptions = target === void 0 ? [] : ["-t", target];
178
+ const jobsOptions = jobs === void 0 ? [] : ["-j", `${jobs}`];
196
179
  if (jobs !== void 0) {
197
180
  console.log(chalk5.blue(`Jobs set to [${jobs}]`));
198
181
  }
199
182
  const result = await runStepsAsync(`Build${incremental ? "-Incremental" : ""} [${pkg ?? "All"}]`, [
200
- [
201
- "yarn",
202
- [
203
- "xy",
204
- "compile",
205
- ...pkgOptions,
206
- ...targetOptions,
207
- ...verboseOptions,
208
- ...jobsOptions,
209
- ...incrementalOptions,
210
- "--types",
211
- "tsup"
212
- ]
213
- ],
214
- [
215
- "yarn",
216
- [
217
- "xy",
218
- "publint",
219
- ...pkgOptions,
220
- ...verboseOptions,
221
- ...jobsOptions,
222
- ...incrementalOptions
223
- ]
224
- ],
225
- [
226
- "yarn",
227
- [
228
- "xy",
229
- "deplint",
230
- ...pkgOptions,
231
- ...verboseOptions,
232
- ...jobsOptions,
233
- ...incrementalOptions
234
- ]
235
- ],
236
- [
237
- "yarn",
238
- [
239
- "xy",
240
- "lint",
241
- ...pkgOptions,
242
- ...verboseOptions,
243
- ...incrementalOptions
244
- ]
245
- ]
183
+ ["yarn", ["xy", "compile", ...pkgOptions, ...targetOptions, ...verboseOptions, ...jobsOptions, ...incrementalOptions, "--types", "tsup"]],
184
+ ["yarn", ["xy", "publint", ...pkgOptions, ...verboseOptions, ...jobsOptions, ...incrementalOptions]],
185
+ ["yarn", ["xy", "deplint", ...pkgOptions, ...verboseOptions, ...jobsOptions, ...incrementalOptions]],
186
+ ["yarn", ["xy", "lint", ...pkgOptions, ...verboseOptions, ...incrementalOptions]]
246
187
  ]);
247
188
  console.log(`${chalk5.gray("Built in")} [${chalk5.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk5.gray("seconds")}`);
248
189
  return result;
249
- }, "build");
190
+ };
250
191
 
251
192
  // src/actions/compile.ts
252
193
  import chalk6 from "chalk";
253
- var compile = /* @__PURE__ */ __name(({ verbose, target, pkg, incremental, publint, jobs }) => {
194
+ var compile = ({
195
+ verbose,
196
+ target,
197
+ pkg,
198
+ incremental,
199
+ publint,
200
+ jobs
201
+ }) => {
254
202
  return pkg ? compilePackage({
255
203
  pkg,
256
204
  publint,
@@ -263,91 +211,58 @@ var compile = /* @__PURE__ */ __name(({ verbose, target, pkg, incremental, publi
263
211
  verbose,
264
212
  jobs
265
213
  });
266
- }, "compile");
267
- var compilePackage = /* @__PURE__ */ __name(({ target, pkg }) => {
268
- const targetOptions = target ? [
269
- "-t",
270
- target
271
- ] : [];
272
- return runSteps(`Compile [${pkg}]`, [
273
- [
274
- "yarn",
275
- [
276
- "workspace",
277
- pkg,
278
- "run",
279
- "package-compile",
280
- ...targetOptions
281
- ]
282
- ]
283
- ]);
284
- }, "compilePackage");
285
- var compileAll = /* @__PURE__ */ __name(({ jobs, verbose, target, incremental }) => {
214
+ };
215
+ var compilePackage = ({ target, pkg }) => {
216
+ const targetOptions = target ? ["-t", target] : [];
217
+ return runSteps(
218
+ `Compile [${pkg}]`,
219
+ [["yarn", ["workspace", pkg, "run", "package-compile", ...targetOptions]]]
220
+ );
221
+ };
222
+ var compileAll = ({
223
+ jobs,
224
+ verbose,
225
+ target,
226
+ incremental
227
+ }) => {
286
228
  const start = Date.now();
287
- const verboseOptions = verbose ? [
288
- "--verbose"
289
- ] : [
290
- "--no-verbose"
291
- ];
292
- const targetOptions = target ? [
293
- "-t",
294
- target
295
- ] : [];
296
- const incrementalOptions = incremental ? [
297
- "--since",
298
- "-Apt",
299
- "--topological-dev"
300
- ] : [
301
- "--parallel",
302
- "-Apt",
303
- "--topological-dev"
304
- ];
305
- const jobsOptions = jobs ? [
306
- "-j",
307
- `${jobs}`
308
- ] : [];
229
+ const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
230
+ const targetOptions = target ? ["-t", target] : [];
231
+ const incrementalOptions = incremental ? ["--since", "-Apt", "--topological-dev"] : ["--parallel", "-Apt", "--topological-dev"];
232
+ const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
309
233
  if (jobs) {
310
234
  console.log(chalk6.blue(`Jobs set to [${jobs}]`));
311
235
  }
312
236
  const result = runSteps(`Compile${incremental ? "-Incremental" : ""} [All]`, [
313
- [
314
- "yarn",
315
- [
316
- "workspaces",
317
- "foreach",
318
- ...incrementalOptions,
319
- ...jobsOptions,
320
- ...verboseOptions,
321
- "run",
322
- "package-compile",
323
- ...targetOptions
324
- ]
325
- ]
237
+ ["yarn", [
238
+ "workspaces",
239
+ "foreach",
240
+ ...incrementalOptions,
241
+ ...jobsOptions,
242
+ ...verboseOptions,
243
+ "run",
244
+ "package-compile",
245
+ ...targetOptions
246
+ ]]
326
247
  ]);
327
248
  console.log(`${chalk6.gray("Compiled in")} [${chalk6.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk6.gray("seconds")}`);
328
249
  return result;
329
- }, "compileAll");
250
+ };
330
251
 
331
252
  // src/actions/copy-assets.ts
332
253
  import path from "path/posix";
333
254
  import chalk7 from "chalk";
334
255
  import cpy from "cpy";
335
- var copyPackageTargetAssets = /* @__PURE__ */ __name(async (target, name, location) => {
256
+ var copyPackageTargetAssets = async (target, name, location) => {
336
257
  try {
337
- const values = await cpy([
338
- "**/*.jpg",
339
- "**/*.png",
340
- "**/*.gif",
341
- "**/*.svg",
342
- "**/*.webp",
343
- "**/*.sass",
344
- "**/*.scss",
345
- "**/*.gif",
346
- "**/*.css"
347
- ], `../dist/${target}`, {
348
- cwd: path.join(process.cwd(), location, "src"),
349
- flat: false
350
- });
258
+ const values = await cpy(
259
+ ["**/*.jpg", "**/*.png", "**/*.gif", "**/*.svg", "**/*.webp", "**/*.sass", "**/*.scss", "**/*.gif", "**/*.css"],
260
+ `../dist/${target}`,
261
+ {
262
+ cwd: path.join(process.cwd(), location, "src"),
263
+ flat: false
264
+ }
265
+ );
351
266
  for (const value of values) {
352
267
  console.log(`${value.split("/").pop()} => ./dist/${target}`);
353
268
  }
@@ -356,8 +271,8 @@ var copyPackageTargetAssets = /* @__PURE__ */ __name(async (target, name, locati
356
271
  console.log(`Copy Failed: ${name}: ${reason}`);
357
272
  return 1;
358
273
  }
359
- }, "copyPackageTargetAssets");
360
- var copyTargetAssets = /* @__PURE__ */ __name(async (target, pkg) => {
274
+ };
275
+ var copyTargetAssets = async (target, pkg) => {
361
276
  const workspaces = yarnWorkspaces();
362
277
  console.log(chalk7.green(`Copying Assets [${target.toUpperCase()}]`));
363
278
  const workspaceList = workspaces.filter(({ name }) => {
@@ -366,15 +281,17 @@ var copyTargetAssets = /* @__PURE__ */ __name(async (target, pkg) => {
366
281
  if (workspaceList.length === 0) {
367
282
  console.error(`Package not found [${pkg}]`);
368
283
  } else {
369
- const results = await Promise.all(workspaceList.map(async (workspace) => {
370
- const { location, name } = workspace;
371
- return await copyPackageTargetAssets(target, name, location);
372
- }));
284
+ const results = await Promise.all(
285
+ workspaceList.map(async (workspace) => {
286
+ const { location, name } = workspace;
287
+ return await copyPackageTargetAssets(target, name, location);
288
+ })
289
+ );
373
290
  return results.reduce((prev, result) => prev || result, 0);
374
291
  }
375
292
  return 0;
376
- }, "copyTargetAssets");
377
- var copyAssets = /* @__PURE__ */ __name(async ({ target, pkg }) => {
293
+ };
294
+ var copyAssets = async ({ target, pkg }) => {
378
295
  switch (target) {
379
296
  case "esm": {
380
297
  return await copyTargetAssets("esm", pkg);
@@ -386,25 +303,24 @@ var copyAssets = /* @__PURE__ */ __name(async ({ target, pkg }) => {
386
303
  return await copyTargetAssets("esm", pkg) || await copyTargetAssets("cjs", pkg);
387
304
  }
388
305
  }
389
- }, "copyAssets");
306
+ };
390
307
 
391
308
  // src/actions/rebuild.ts
392
- var rebuild = /* @__PURE__ */ __name(({ target }) => {
309
+ var rebuild = ({ target }) => {
393
310
  return runSteps("Rebuild", [
394
- [
395
- "yarn",
396
- "xy clean"
397
- ],
398
- [
399
- "yarn",
400
- target ? `xy build -t ${target}` : "xy build"
401
- ]
311
+ ["yarn", "xy clean"],
312
+ ["yarn", target ? `xy build -t ${target}` : "xy build"]
402
313
  ]);
403
- }, "rebuild");
314
+ };
404
315
 
405
316
  // src/actions/recompile.ts
406
317
  import chalk8 from "chalk";
407
- var recompile = /* @__PURE__ */ __name(async ({ verbose, target, pkg, incremental }) => {
318
+ var recompile = async ({
319
+ verbose,
320
+ target,
321
+ pkg,
322
+ incremental
323
+ }) => {
408
324
  return pkg ? await recompilePackage({
409
325
  pkg,
410
326
  target,
@@ -414,49 +330,25 @@ var recompile = /* @__PURE__ */ __name(async ({ verbose, target, pkg, incrementa
414
330
  target,
415
331
  verbose
416
332
  });
417
- }, "recompile");
418
- var recompilePackage = /* @__PURE__ */ __name(({ target, pkg }) => {
419
- const targetOptions = target ? [
420
- "-t",
421
- target
422
- ] : [];
423
- return runStepsAsync(`Recompile [${pkg}]`, [
424
- [
425
- "yarn",
426
- [
427
- "workspace",
428
- pkg,
429
- "run",
430
- "package-recompile",
431
- ...targetOptions
432
- ]
433
- ]
434
- ]);
435
- }, "recompilePackage");
436
- var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, incremental }) => {
333
+ };
334
+ var recompilePackage = ({ target, pkg }) => {
335
+ const targetOptions = target ? ["-t", target] : [];
336
+ return runStepsAsync(
337
+ `Recompile [${pkg}]`,
338
+ [["yarn", ["workspace", pkg, "run", "package-recompile", ...targetOptions]]]
339
+ );
340
+ };
341
+ var recompileAll = async ({
342
+ jobs,
343
+ verbose,
344
+ target,
345
+ incremental
346
+ }) => {
437
347
  const start = Date.now();
438
- const verboseOptions = verbose ? [
439
- "--verbose"
440
- ] : [
441
- "--no-verbose"
442
- ];
443
- const targetOptions = target ? [
444
- "-t",
445
- target
446
- ] : [];
447
- const incrementalOptions = incremental ? [
448
- "--since",
449
- "-Apt",
450
- "--topological-dev"
451
- ] : [
452
- "--parallel",
453
- "-Apt",
454
- "--topological-dev"
455
- ];
456
- const jobsOptions = jobs ? [
457
- "-j",
458
- `${jobs}`
459
- ] : [];
348
+ const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
349
+ const targetOptions = target ? ["-t", target] : [];
350
+ const incrementalOptions = incremental ? ["--since", "-Apt", "--topological-dev"] : ["--parallel", "-Apt", "--topological-dev"];
351
+ const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
460
352
  if (jobs) {
461
353
  console.log(chalk8.blue(`Jobs set to [${jobs}]`));
462
354
  }
@@ -488,93 +380,109 @@ var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, increm
488
380
  ]
489
381
  ]
490
382
  ]);
491
- console.log(`${chalk8.gray("Recompiled in")} [${chalk8.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk8.gray("seconds")}`);
383
+ console.log(
384
+ `${chalk8.gray("Recompiled in")} [${chalk8.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk8.gray("seconds")}`
385
+ );
492
386
  return result;
493
- }, "recompileAll");
387
+ };
494
388
 
495
389
  // src/xy/xyBuildCommands.ts
496
- var xyBuildCommands = /* @__PURE__ */ __name((args) => {
497
- return args.command("build [package]", "Build - Compile & Lint", (yargs) => {
498
- return yargs.positional("package", {
499
- describe: "Specific package to build"
500
- });
501
- }, async (argv) => {
502
- if (argv.verbose) {
503
- console.log(`Building: ${argv.package ?? "all"}`);
390
+ var xyBuildCommands = (args) => {
391
+ return args.command(
392
+ "build [package]",
393
+ "Build - Compile & Lint",
394
+ (yargs) => {
395
+ return yargs.positional("package", { describe: "Specific package to build" });
396
+ },
397
+ async (argv) => {
398
+ if (argv.verbose) {
399
+ console.log(`Building: ${argv.package ?? "all"}`);
400
+ }
401
+ process.exitCode = await build({
402
+ incremental: !!argv.incremental,
403
+ jobs: argv.jobs,
404
+ pkg: argv.package,
405
+ target: argv.target,
406
+ verbose: !!argv.verbose
407
+ });
504
408
  }
505
- process.exitCode = await build({
506
- incremental: !!argv.incremental,
507
- jobs: argv.jobs,
508
- pkg: argv.package,
509
- target: argv.target,
510
- verbose: !!argv.verbose
511
- });
512
- }).command("compile [package]", "Compile with Typescript & Copy Images", (yargs) => {
513
- return yargs.positional("package", {
514
- describe: "Specific package to compile"
515
- });
516
- }, (argv) => {
517
- if (argv.verbose) {
518
- console.log(`Compiling: ${argv.package ?? "all"}`);
409
+ ).command(
410
+ "compile [package]",
411
+ "Compile with Typescript & Copy Images",
412
+ (yargs) => {
413
+ return yargs.positional("package", { describe: "Specific package to compile" });
414
+ },
415
+ (argv) => {
416
+ if (argv.verbose) {
417
+ console.log(`Compiling: ${argv.package ?? "all"}`);
418
+ }
419
+ process.exitCode = compile({
420
+ incremental: !!argv.incremental,
421
+ jobs: argv.jobs,
422
+ pkg: argv.package,
423
+ target: argv.target,
424
+ verbose: !!argv.verbose
425
+ });
519
426
  }
520
- process.exitCode = compile({
521
- incremental: !!argv.incremental,
522
- jobs: argv.jobs,
523
- pkg: argv.package,
524
- target: argv.target,
525
- verbose: !!argv.verbose
526
- });
527
- }).command("compile-only [package]", "Compile with Typescript & Copy Images (No Publint)", (yargs) => {
528
- return yargs.positional("package", {
529
- describe: "Specific package to compile"
530
- });
531
- }, (argv) => {
532
- if (argv.verbose) {
533
- console.log(`Compiling: ${argv.package ?? "all"}`);
427
+ ).command(
428
+ "compile-only [package]",
429
+ "Compile with Typescript & Copy Images (No Publint)",
430
+ (yargs) => {
431
+ return yargs.positional("package", { describe: "Specific package to compile" });
432
+ },
433
+ (argv) => {
434
+ if (argv.verbose) {
435
+ console.log(`Compiling: ${argv.package ?? "all"}`);
436
+ }
437
+ process.exitCode = compile({
438
+ incremental: !!argv.incremental,
439
+ jobs: argv.jobs,
440
+ pkg: argv.package,
441
+ publint: false,
442
+ target: argv.target,
443
+ verbose: !!argv.verbose
444
+ });
534
445
  }
535
- process.exitCode = compile({
536
- incremental: !!argv.incremental,
537
- jobs: argv.jobs,
538
- pkg: argv.package,
539
- publint: false,
540
- target: argv.target,
541
- verbose: !!argv.verbose
542
- });
543
- }).command("recompile [package]", "Re-compile with Typescript & Copy Images", (yargs) => {
544
- return yargs.positional("package", {
545
- describe: "Specific package to re-compile"
546
- });
547
- }, async (argv) => {
548
- if (argv.verbose) {
549
- console.log(`Re-compiling: ${argv.package ?? "all"}`);
446
+ ).command(
447
+ "recompile [package]",
448
+ "Re-compile with Typescript & Copy Images",
449
+ (yargs) => {
450
+ return yargs.positional("package", { describe: "Specific package to re-compile" });
451
+ },
452
+ async (argv) => {
453
+ if (argv.verbose) {
454
+ console.log(`Re-compiling: ${argv.package ?? "all"}`);
455
+ }
456
+ process.exitCode = await recompile({
457
+ incremental: !!argv.incremental,
458
+ jobs: argv.jobs,
459
+ pkg: argv.package,
460
+ target: argv.target,
461
+ verbose: !!argv.verbose
462
+ });
550
463
  }
551
- process.exitCode = await recompile({
552
- incremental: !!argv.incremental,
553
- jobs: argv.jobs,
554
- pkg: argv.package,
555
- target: argv.target,
556
- verbose: !!argv.verbose
557
- });
558
- }).command("rebuild [package]", "Rebuild - Clean, Compile & Lint", (yargs) => {
559
- return yargs.positional("package", {
560
- describe: "Specific package to rebuild"
561
- });
562
- }, (argv) => {
563
- if (argv.verbose) console.log(`Rebuilding: ${argv.package ?? "all"}`);
564
- process.exitCode = rebuild({
565
- target: argv.target
566
- });
567
- }).command("copy-assets [package]", "Copy Assets - Copy the assets from src to dist", (yargs) => {
568
- return yargs.positional("package", {
569
- describe: "Specific package to copy assets"
570
- });
571
- }, async (argv) => {
572
- if (argv.verbose) console.log(`Copying Assets: ${argv.package ?? "all"}`);
573
- process.exitCode = await copyAssets({
574
- target: argv.target
575
- });
576
- });
577
- }, "xyBuildCommands");
464
+ ).command(
465
+ "rebuild [package]",
466
+ "Rebuild - Clean, Compile & Lint",
467
+ (yargs) => {
468
+ return yargs.positional("package", { describe: "Specific package to rebuild" });
469
+ },
470
+ (argv) => {
471
+ if (argv.verbose) console.log(`Rebuilding: ${argv.package ?? "all"}`);
472
+ process.exitCode = rebuild({ target: argv.target });
473
+ }
474
+ ).command(
475
+ "copy-assets [package]",
476
+ "Copy Assets - Copy the assets from src to dist",
477
+ (yargs) => {
478
+ return yargs.positional("package", { describe: "Specific package to copy assets" });
479
+ },
480
+ async (argv) => {
481
+ if (argv.verbose) console.log(`Copying Assets: ${argv.package ?? "all"}`);
482
+ process.exitCode = await copyAssets({ target: argv.target });
483
+ }
484
+ );
485
+ };
578
486
  export {
579
487
  xyBuildCommands
580
488
  };