@xylabs/ts-scripts-yarn3 3.15.16 → 4.0.0-rc.5

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 (335) hide show
  1. package/dist/actions/index.mjs +76 -275
  2. package/dist/actions/index.mjs.map +1 -1
  3. package/dist/actions/package/compile/compile.mjs +55 -254
  4. package/dist/actions/package/compile/compile.mjs.map +1 -1
  5. package/dist/actions/package/compile/index.mjs +55 -254
  6. package/dist/actions/package/compile/index.mjs.map +1 -1
  7. package/dist/actions/package/compile/packageCompileTsc.mjs +1 -1
  8. package/dist/actions/package/compile/packageCompileTsc.mjs.map +1 -1
  9. package/dist/actions/package/compile/packageCompileTscTypes.mjs +2 -36
  10. package/dist/actions/package/compile/packageCompileTscTypes.mjs.map +1 -1
  11. package/dist/actions/package/compile/packageCompileTsup.mjs +53 -252
  12. package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -1
  13. package/dist/actions/package/index.mjs +69 -268
  14. package/dist/actions/package/index.mjs.map +1 -1
  15. package/dist/actions/package/recompile.mjs +55 -254
  16. package/dist/actions/package/recompile.mjs.map +1 -1
  17. package/dist/bin/package/compile-only.mjs +57 -256
  18. package/dist/bin/package/compile-only.mjs.map +1 -1
  19. package/dist/bin/package/compile-tsup.mjs +55 -254
  20. package/dist/bin/package/compile-tsup.mjs.map +1 -1
  21. package/dist/bin/package/compile.mjs +57 -256
  22. package/dist/bin/package/compile.mjs.map +1 -1
  23. package/dist/bin/package/recompile.mjs +57 -256
  24. package/dist/bin/package/recompile.mjs.map +1 -1
  25. package/dist/index.mjs +86 -285
  26. package/dist/index.mjs.map +1 -1
  27. package/package.json +9 -19
  28. package/src/actions/package/compile/XyConfig.ts +2 -2
  29. package/src/actions/package/compile/packageCompileTsc.ts +1 -1
  30. package/src/actions/package/compile/packageCompileTscTypes.ts +3 -8
  31. package/src/actions/package/compile/packageCompileTsup.ts +52 -124
  32. package/tsup.config.ts +1 -1
  33. package/dist/actions/build.cjs +0 -208
  34. package/dist/actions/build.cjs.map +0 -1
  35. package/dist/actions/clean-docs.cjs +0 -74
  36. package/dist/actions/clean-docs.cjs.map +0 -1
  37. package/dist/actions/clean-eslint.cjs +0 -53
  38. package/dist/actions/clean-eslint.cjs.map +0 -1
  39. package/dist/actions/clean-jest.cjs +0 -147
  40. package/dist/actions/clean-jest.cjs.map +0 -1
  41. package/dist/actions/clean.cjs +0 -192
  42. package/dist/actions/clean.cjs.map +0 -1
  43. package/dist/actions/compile.cjs +0 -217
  44. package/dist/actions/compile.cjs.map +0 -1
  45. package/dist/actions/copy-assets.cjs +0 -121
  46. package/dist/actions/copy-assets.cjs.map +0 -1
  47. package/dist/actions/cycle.cjs +0 -156
  48. package/dist/actions/cycle.cjs.map +0 -1
  49. package/dist/actions/dead.cjs +0 -148
  50. package/dist/actions/dead.cjs.map +0 -1
  51. package/dist/actions/deploy-major.cjs +0 -160
  52. package/dist/actions/deploy-major.cjs.map +0 -1
  53. package/dist/actions/deploy-minor.cjs +0 -160
  54. package/dist/actions/deploy-minor.cjs.map +0 -1
  55. package/dist/actions/deploy-next.cjs +0 -160
  56. package/dist/actions/deploy-next.cjs.map +0 -1
  57. package/dist/actions/deploy.cjs +0 -160
  58. package/dist/actions/deploy.cjs.map +0 -1
  59. package/dist/actions/deps.cjs +0 -205
  60. package/dist/actions/deps.cjs.map +0 -1
  61. package/dist/actions/dupdeps.cjs +0 -226
  62. package/dist/actions/dupdeps.cjs.map +0 -1
  63. package/dist/actions/fix.cjs +0 -149
  64. package/dist/actions/fix.cjs.map +0 -1
  65. package/dist/actions/gen-docs.cjs +0 -186
  66. package/dist/actions/gen-docs.cjs.map +0 -1
  67. package/dist/actions/gitignore-gen.cjs +0 -138
  68. package/dist/actions/gitignore-gen.cjs.map +0 -1
  69. package/dist/actions/gitlint-fix.cjs +0 -69
  70. package/dist/actions/gitlint-fix.cjs.map +0 -1
  71. package/dist/actions/gitlint.cjs +0 -84
  72. package/dist/actions/gitlint.cjs.map +0 -1
  73. package/dist/actions/index.cjs +0 -2600
  74. package/dist/actions/index.cjs.map +0 -1
  75. package/dist/actions/license.cjs +0 -133
  76. package/dist/actions/license.cjs.map +0 -1
  77. package/dist/actions/lint-clean.cjs +0 -227
  78. package/dist/actions/lint-clean.cjs.map +0 -1
  79. package/dist/actions/lint-profile.cjs +0 -153
  80. package/dist/actions/lint-profile.cjs.map +0 -1
  81. package/dist/actions/lint.cjs +0 -217
  82. package/dist/actions/lint.cjs.map +0 -1
  83. package/dist/actions/npmignore-gen.cjs +0 -138
  84. package/dist/actions/npmignore-gen.cjs.map +0 -1
  85. package/dist/actions/package/clean-outputs.cjs +0 -56
  86. package/dist/actions/package/clean-outputs.cjs.map +0 -1
  87. package/dist/actions/package/clean-typescript.cjs +0 -56
  88. package/dist/actions/package/clean-typescript.cjs.map +0 -1
  89. package/dist/actions/package/clean.cjs +0 -83
  90. package/dist/actions/package/clean.cjs.map +0 -1
  91. package/dist/actions/package/compile/XyConfig.cjs +0 -19
  92. package/dist/actions/package/compile/XyConfig.cjs.map +0 -1
  93. package/dist/actions/package/compile/buildEntries.cjs +0 -68
  94. package/dist/actions/package/compile/buildEntries.cjs.map +0 -1
  95. package/dist/actions/package/compile/compile.cjs +0 -565
  96. package/dist/actions/package/compile/compile.cjs.map +0 -1
  97. package/dist/actions/package/compile/copyTypeFiles.cjs +0 -60
  98. package/dist/actions/package/compile/copyTypeFiles.cjs.map +0 -1
  99. package/dist/actions/package/compile/getCompilerOptions.cjs +0 -67
  100. package/dist/actions/package/compile/getCompilerOptions.cjs.map +0 -1
  101. package/dist/actions/package/compile/index.cjs +0 -571
  102. package/dist/actions/package/compile/index.cjs.map +0 -1
  103. package/dist/actions/package/compile/inputs.cjs +0 -79
  104. package/dist/actions/package/compile/inputs.cjs.map +0 -1
  105. package/dist/actions/package/compile/packageCompileTsc.cjs +0 -164
  106. package/dist/actions/package/compile/packageCompileTsc.cjs.map +0 -1
  107. package/dist/actions/package/compile/packageCompileTscTypes.cjs +0 -199
  108. package/dist/actions/package/compile/packageCompileTscTypes.cjs.map +0 -1
  109. package/dist/actions/package/compile/packageCompileTsup.cjs +0 -521
  110. package/dist/actions/package/compile/packageCompileTsup.cjs.map +0 -1
  111. package/dist/actions/package/copy-assets.cjs +0 -88
  112. package/dist/actions/package/copy-assets.cjs.map +0 -1
  113. package/dist/actions/package/deps.cjs +0 -214
  114. package/dist/actions/package/deps.cjs.map +0 -1
  115. package/dist/actions/package/gen-docs.cjs +0 -148
  116. package/dist/actions/package/gen-docs.cjs.map +0 -1
  117. package/dist/actions/package/index.cjs +0 -968
  118. package/dist/actions/package/index.cjs.map +0 -1
  119. package/dist/actions/package/publint.cjs +0 -80
  120. package/dist/actions/package/publint.cjs.map +0 -1
  121. package/dist/actions/package/recompile.cjs +0 -617
  122. package/dist/actions/package/recompile.cjs.map +0 -1
  123. package/dist/actions/publint.cjs +0 -237
  124. package/dist/actions/publint.cjs.map +0 -1
  125. package/dist/actions/rebuild.cjs +0 -148
  126. package/dist/actions/rebuild.cjs.map +0 -1
  127. package/dist/actions/recompile.cjs +0 -232
  128. package/dist/actions/recompile.cjs.map +0 -1
  129. package/dist/actions/reinstall.cjs +0 -183
  130. package/dist/actions/reinstall.cjs.map +0 -1
  131. package/dist/actions/relint.cjs +0 -185
  132. package/dist/actions/relint.cjs.map +0 -1
  133. package/dist/actions/retest.cjs +0 -154
  134. package/dist/actions/retest.cjs.map +0 -1
  135. package/dist/actions/sonar.cjs +0 -149
  136. package/dist/actions/sonar.cjs.map +0 -1
  137. package/dist/actions/statics.cjs +0 -234
  138. package/dist/actions/statics.cjs.map +0 -1
  139. package/dist/actions/test.cjs +0 -147
  140. package/dist/actions/test.cjs.map +0 -1
  141. package/dist/actions/up.cjs +0 -144
  142. package/dist/actions/up.cjs.map +0 -1
  143. package/dist/actions/updo.cjs +0 -152
  144. package/dist/actions/updo.cjs.map +0 -1
  145. package/dist/actions/upplug.cjs +0 -172
  146. package/dist/actions/upplug.cjs.map +0 -1
  147. package/dist/actions/upyarn.cjs +0 -148
  148. package/dist/actions/upyarn.cjs.map +0 -1
  149. package/dist/actions/yarn3only.cjs +0 -106
  150. package/dist/actions/yarn3only.cjs.map +0 -1
  151. package/dist/bin/build.cjs +0 -39
  152. package/dist/bin/build.cjs.map +0 -1
  153. package/dist/bin/clean.cjs +0 -39
  154. package/dist/bin/clean.cjs.map +0 -1
  155. package/dist/bin/compile-only.cjs +0 -39
  156. package/dist/bin/compile-only.cjs.map +0 -1
  157. package/dist/bin/compile.cjs +0 -39
  158. package/dist/bin/compile.cjs.map +0 -1
  159. package/dist/bin/cycle.cjs +0 -39
  160. package/dist/bin/cycle.cjs.map +0 -1
  161. package/dist/bin/dead.cjs +0 -39
  162. package/dist/bin/dead.cjs.map +0 -1
  163. package/dist/bin/deploy-major.cjs +0 -39
  164. package/dist/bin/deploy-major.cjs.map +0 -1
  165. package/dist/bin/deploy-minor.cjs +0 -39
  166. package/dist/bin/deploy-minor.cjs.map +0 -1
  167. package/dist/bin/deploy-next.cjs +0 -39
  168. package/dist/bin/deploy-next.cjs.map +0 -1
  169. package/dist/bin/deploy.cjs +0 -39
  170. package/dist/bin/deploy.cjs.map +0 -1
  171. package/dist/bin/deps.cjs +0 -39
  172. package/dist/bin/deps.cjs.map +0 -1
  173. package/dist/bin/fix.cjs +0 -39
  174. package/dist/bin/fix.cjs.map +0 -1
  175. package/dist/bin/gen-docs.cjs +0 -39
  176. package/dist/bin/gen-docs.cjs.map +0 -1
  177. package/dist/bin/gitlint-fix.cjs +0 -39
  178. package/dist/bin/gitlint-fix.cjs.map +0 -1
  179. package/dist/bin/gitlint.cjs +0 -39
  180. package/dist/bin/gitlint.cjs.map +0 -1
  181. package/dist/bin/license.cjs +0 -39
  182. package/dist/bin/license.cjs.map +0 -1
  183. package/dist/bin/lint-clean.cjs +0 -39
  184. package/dist/bin/lint-clean.cjs.map +0 -1
  185. package/dist/bin/lint-fast.cjs +0 -39
  186. package/dist/bin/lint-fast.cjs.map +0 -1
  187. package/dist/bin/lint-profile.cjs +0 -39
  188. package/dist/bin/lint-profile.cjs.map +0 -1
  189. package/dist/bin/lint.cjs +0 -39
  190. package/dist/bin/lint.cjs.map +0 -1
  191. package/dist/bin/package/clean-outputs.cjs +0 -51
  192. package/dist/bin/package/clean-outputs.cjs.map +0 -1
  193. package/dist/bin/package/clean-typescript.cjs +0 -51
  194. package/dist/bin/package/clean-typescript.cjs.map +0 -1
  195. package/dist/bin/package/clean.cjs +0 -76
  196. package/dist/bin/package/clean.cjs.map +0 -1
  197. package/dist/bin/package/compile-only.cjs +0 -564
  198. package/dist/bin/package/compile-only.cjs.map +0 -1
  199. package/dist/bin/package/compile-tsup.cjs +0 -519
  200. package/dist/bin/package/compile-tsup.cjs.map +0 -1
  201. package/dist/bin/package/compile.cjs +0 -567
  202. package/dist/bin/package/compile.cjs.map +0 -1
  203. package/dist/bin/package/copy-assets-cjs.cjs +0 -86
  204. package/dist/bin/package/copy-assets-cjs.cjs.map +0 -1
  205. package/dist/bin/package/copy-assets-esm.cjs +0 -86
  206. package/dist/bin/package/copy-assets-esm.cjs.map +0 -1
  207. package/dist/bin/package/deps.cjs +0 -208
  208. package/dist/bin/package/deps.cjs.map +0 -1
  209. package/dist/bin/package/gen-docs.cjs +0 -143
  210. package/dist/bin/package/gen-docs.cjs.map +0 -1
  211. package/dist/bin/package/publint.cjs +0 -77
  212. package/dist/bin/package/publint.cjs.map +0 -1
  213. package/dist/bin/package/recompile.cjs +0 -611
  214. package/dist/bin/package/recompile.cjs.map +0 -1
  215. package/dist/bin/publint.cjs +0 -39
  216. package/dist/bin/publint.cjs.map +0 -1
  217. package/dist/bin/rebuild.cjs +0 -39
  218. package/dist/bin/rebuild.cjs.map +0 -1
  219. package/dist/bin/recompile.cjs +0 -39
  220. package/dist/bin/recompile.cjs.map +0 -1
  221. package/dist/bin/reinstall.cjs +0 -39
  222. package/dist/bin/reinstall.cjs.map +0 -1
  223. package/dist/bin/relint.cjs +0 -39
  224. package/dist/bin/relint.cjs.map +0 -1
  225. package/dist/bin/sonar.cjs +0 -39
  226. package/dist/bin/sonar.cjs.map +0 -1
  227. package/dist/bin/test.cjs +0 -39
  228. package/dist/bin/test.cjs.map +0 -1
  229. package/dist/bin/up.cjs +0 -39
  230. package/dist/bin/up.cjs.map +0 -1
  231. package/dist/bin/updo.cjs +0 -39
  232. package/dist/bin/updo.cjs.map +0 -1
  233. package/dist/bin/upplug.cjs +0 -39
  234. package/dist/bin/upplug.cjs.map +0 -1
  235. package/dist/bin/upyarn.cjs +0 -39
  236. package/dist/bin/upyarn.cjs.map +0 -1
  237. package/dist/bin/xy-ts.cjs +0 -1890
  238. package/dist/bin/xy-ts.cjs.map +0 -1
  239. package/dist/bin/xy.cjs +0 -1890
  240. package/dist/bin/xy.cjs.map +0 -1
  241. package/dist/bin/yarn3only.cjs +0 -39
  242. package/dist/bin/yarn3only.cjs.map +0 -1
  243. package/dist/index.cjs +0 -3129
  244. package/dist/index.cjs.map +0 -1
  245. package/dist/index.d.cts +0 -359
  246. package/dist/lib/checkResult.cjs +0 -52
  247. package/dist/lib/checkResult.cjs.map +0 -1
  248. package/dist/lib/createBuildConfig.cjs +0 -93
  249. package/dist/lib/createBuildConfig.cjs.map +0 -1
  250. package/dist/lib/defaultBuildConfig.cjs +0 -52
  251. package/dist/lib/defaultBuildConfig.cjs.map +0 -1
  252. package/dist/lib/dependencies/DuplicateDetector.cjs +0 -124
  253. package/dist/lib/dependencies/DuplicateDetector.cjs.map +0 -1
  254. package/dist/lib/dependencies/detectDuplicateDependencies.cjs +0 -207
  255. package/dist/lib/dependencies/detectDuplicateDependencies.cjs.map +0 -1
  256. package/dist/lib/dependencies/index.cjs +0 -211
  257. package/dist/lib/dependencies/index.cjs.map +0 -1
  258. package/dist/lib/file/ReadFileSyncOptions.cjs +0 -33
  259. package/dist/lib/file/ReadFileSyncOptions.cjs.map +0 -1
  260. package/dist/lib/file/constants.cjs +0 -34
  261. package/dist/lib/file/constants.cjs.map +0 -1
  262. package/dist/lib/file/fileLines.cjs +0 -58
  263. package/dist/lib/file/fileLines.cjs.map +0 -1
  264. package/dist/lib/file/index.cjs +0 -74
  265. package/dist/lib/file/index.cjs.map +0 -1
  266. package/dist/lib/file/tryReadFileSync.cjs +0 -42
  267. package/dist/lib/file/tryReadFileSync.cjs.map +0 -1
  268. package/dist/lib/generateIgnoreFiles.cjs +0 -132
  269. package/dist/lib/generateIgnoreFiles.cjs.map +0 -1
  270. package/dist/lib/index.cjs +0 -614
  271. package/dist/lib/index.cjs.map +0 -1
  272. package/dist/lib/jsonFormatters.cjs +0 -37
  273. package/dist/lib/jsonFormatters.cjs.map +0 -1
  274. package/dist/lib/loadConfig.cjs +0 -59
  275. package/dist/lib/loadConfig.cjs.map +0 -1
  276. package/dist/lib/parsedPackageJSON.cjs +0 -37
  277. package/dist/lib/parsedPackageJSON.cjs.map +0 -1
  278. package/dist/lib/processEx.cjs +0 -72
  279. package/dist/lib/processEx.cjs.map +0 -1
  280. package/dist/lib/runSteps.cjs +0 -134
  281. package/dist/lib/runSteps.cjs.map +0 -1
  282. package/dist/lib/runStepsAsync.cjs +0 -147
  283. package/dist/lib/runStepsAsync.cjs.map +0 -1
  284. package/dist/lib/runXy.cjs +0 -150
  285. package/dist/lib/runXy.cjs.map +0 -1
  286. package/dist/lib/runXyWithWarning.cjs +0 -49
  287. package/dist/lib/runXyWithWarning.cjs.map +0 -1
  288. package/dist/lib/safeExit.cjs +0 -100
  289. package/dist/lib/safeExit.cjs.map +0 -1
  290. package/dist/lib/string/empty.cjs +0 -35
  291. package/dist/lib/string/empty.cjs.map +0 -1
  292. package/dist/lib/string/index.cjs +0 -45
  293. package/dist/lib/string/index.cjs.map +0 -1
  294. package/dist/lib/string/union.cjs +0 -35
  295. package/dist/lib/string/union.cjs.map +0 -1
  296. package/dist/lib/withErrnoException.cjs +0 -41
  297. package/dist/lib/withErrnoException.cjs.map +0 -1
  298. package/dist/lib/withError.cjs +0 -34
  299. package/dist/lib/withError.cjs.map +0 -1
  300. package/dist/lib/yarn/index.cjs +0 -93
  301. package/dist/lib/yarn/index.cjs.map +0 -1
  302. package/dist/lib/yarn/isYarnVersionOrGreater.cjs +0 -52
  303. package/dist/lib/yarn/isYarnVersionOrGreater.cjs.map +0 -1
  304. package/dist/lib/yarn/workspace/Workspace.cjs +0 -19
  305. package/dist/lib/yarn/workspace/Workspace.cjs.map +0 -1
  306. package/dist/lib/yarn/workspace/index.cjs +0 -60
  307. package/dist/lib/yarn/workspace/index.cjs.map +0 -1
  308. package/dist/lib/yarn/workspace/yarnWorkspace.cjs +0 -58
  309. package/dist/lib/yarn/workspace/yarnWorkspace.cjs.map +0 -1
  310. package/dist/lib/yarn/workspace/yarnWorkspaces.cjs +0 -49
  311. package/dist/lib/yarn/workspace/yarnWorkspaces.cjs.map +0 -1
  312. package/dist/lib/yarn/yarnInitCwd.cjs +0 -35
  313. package/dist/lib/yarn/yarnInitCwd.cjs.map +0 -1
  314. package/dist/loadPackageConfig.cjs +0 -39
  315. package/dist/loadPackageConfig.cjs.map +0 -1
  316. package/dist/types.d.cjs +0 -2
  317. package/dist/types.d.cjs.map +0 -1
  318. package/dist/xy/index.cjs +0 -1909
  319. package/dist/xy/index.cjs.map +0 -1
  320. package/dist/xy/param.cjs +0 -36
  321. package/dist/xy/param.cjs.map +0 -1
  322. package/dist/xy/xy.cjs +0 -1895
  323. package/dist/xy/xy.cjs.map +0 -1
  324. package/dist/xy/xyBuildCommands.cjs +0 -595
  325. package/dist/xy/xyBuildCommands.cjs.map +0 -1
  326. package/dist/xy/xyCommonCommands.cjs +0 -723
  327. package/dist/xy/xyCommonCommands.cjs.map +0 -1
  328. package/dist/xy/xyDeployCommands.cjs +0 -263
  329. package/dist/xy/xyDeployCommands.cjs.map +0 -1
  330. package/dist/xy/xyInstallCommands.cjs +0 -508
  331. package/dist/xy/xyInstallCommands.cjs.map +0 -1
  332. package/dist/xy/xyLintCommands.cjs +0 -466
  333. package/dist/xy/xyLintCommands.cjs.map +0 -1
  334. package/dist/xy/xyParseOptions.cjs +0 -84
  335. package/dist/xy/xyParseOptions.cjs.map +0 -1
package/dist/xy/xy.cjs DELETED
@@ -1,1895 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
9
- var __export = (target, all) => {
10
- for (var name in all)
11
- __defProp(target, name, { get: all[name], enumerable: true });
12
- };
13
- var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from))
16
- if (!__hasOwnProp.call(to, key) && key !== except)
17
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
- }
19
- return to;
20
- };
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
- mod
28
- ));
29
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
-
31
- // src/xy/xy.ts
32
- var xy_exports = {};
33
- __export(xy_exports, {
34
- xy: () => xy
35
- });
36
- module.exports = __toCommonJS(xy_exports);
37
- var import_chalk20 = __toESM(require("chalk"), 1);
38
-
39
- // src/actions/build.ts
40
- var import_chalk7 = __toESM(require("chalk"), 1);
41
-
42
- // src/lib/checkResult.ts
43
- var import_chalk = __toESM(require("chalk"), 1);
44
- var checkResult = /* @__PURE__ */ __name((name, result, level = "error", exitOnFail = false) => {
45
- if (result) {
46
- const exiting = exitOnFail ? "[Exiting Process]" : "[Continuing]";
47
- const chalkFunc = level === "error" ? import_chalk.default.red : import_chalk.default.yellow;
48
- console[level](chalkFunc(`${name} had ${result} failures ${exiting}`));
49
- if (exitOnFail) {
50
- process.exit(result);
51
- }
52
- }
53
- }, "checkResult");
54
-
55
- // src/lib/dependencies/detectDuplicateDependencies.ts
56
- var import_node_child_process = require("child_process");
57
-
58
- // src/lib/processEx.ts
59
- var import_chalk2 = __toESM(require("chalk"), 1);
60
-
61
- // src/lib/withError.ts
62
- var withError = /* @__PURE__ */ __name((ex, closure, predicate = (ex2) => ex2.name !== void 0 && ex2.message !== void 0) => {
63
- return predicate(ex) ? closure(ex) : void 0;
64
- }, "withError");
65
-
66
- // src/lib/withErrnoException.ts
67
- var withErrnoException = /* @__PURE__ */ __name((ex, closure) => {
68
- return withError(ex, closure, (ex2) => ex2.errno !== void 0);
69
- }, "withErrnoException");
70
-
71
- // src/lib/processEx.ts
72
- var processEx = /* @__PURE__ */ __name((ex) => {
73
- const error = typeof ex === "string" ? new Error(ex) : ex;
74
- const exitCode = withErrnoException(error, (error2) => {
75
- if (error2.code === "ENOENT") {
76
- console.error(import_chalk2.default.red(`'${error2.path}' not found.`));
77
- } else {
78
- console.error(import_chalk2.default.red(`Errno: ${error2.code}`));
79
- }
80
- return error2.errno ?? -1;
81
- }) ?? withError(error, (error2) => {
82
- console.error(import_chalk2.default.red(`${error2.name}: ${error2.message}`));
83
- return -1;
84
- }) ?? (() => {
85
- console.error(import_chalk2.default.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`));
86
- return -1;
87
- })();
88
- process.exit(process.exitCode ?? exitCode);
89
- }, "processEx");
90
-
91
- // src/lib/safeExit.ts
92
- var safeExit = /* @__PURE__ */ __name((func, exitOnFail = true) => {
93
- try {
94
- const result = func();
95
- if (result && exitOnFail) {
96
- process.exit(result);
97
- }
98
- return result;
99
- } catch (ex) {
100
- return processEx(ex);
101
- }
102
- }, "safeExit");
103
- var safeExitAsync = /* @__PURE__ */ __name(async (func, exitOnFail = true) => {
104
- try {
105
- const result = await func();
106
- if (result && exitOnFail) {
107
- process.exit(result);
108
- }
109
- return result;
110
- } catch (ex) {
111
- return processEx(ex);
112
- }
113
- }, "safeExitAsync");
114
-
115
- // src/lib/dependencies/DuplicateDetector.ts
116
- var import_node_os = require("os");
117
- var import_chalk3 = __toESM(require("chalk"), 1);
118
- var import_uniq = __toESM(require("lodash/uniq.js"), 1);
119
-
120
- // src/lib/jsonFormatters.ts
121
- var multiLineToJSONArray = /* @__PURE__ */ __name((output) => {
122
- const withCommas = output.replaceAll("\r\n", "").replaceAll("\n", ",");
123
- const cleanCollection = withCommas.slice(0, Math.max(0, withCommas.length - 1));
124
- const collection = `[${cleanCollection}]`;
125
- return JSON.parse(collection);
126
- }, "multiLineToJSONArray");
127
-
128
- // src/lib/dependencies/DuplicateDetector.ts
129
- var trimVirtualMeta = /* @__PURE__ */ __name((value) => {
130
- const virtualParts = value.split("virtual:");
131
- if (virtualParts.length > 1) {
132
- const hashParts = virtualParts[1].split("#");
133
- return virtualParts[0] + hashParts[1];
134
- } else {
135
- return value;
136
- }
137
- }, "trimVirtualMeta");
138
- var trimObjectDependencyVirtualMeta = /* @__PURE__ */ __name((obj) => {
139
- const resultObj = {};
140
- for (const [key, value] of Object.entries(obj)) {
141
- resultObj[trimVirtualMeta(key)] = {
142
- descriptor: trimVirtualMeta(value.descriptor),
143
- locator: trimVirtualMeta(value.locator)
144
- };
145
- }
146
- return resultObj;
147
- }, "trimObjectDependencyVirtualMeta");
148
- var trimDependencyVirtualMeta = /* @__PURE__ */ __name((dependencies) => {
149
- return dependencies.map((dependency) => {
150
- return {
151
- children: trimObjectDependencyVirtualMeta(dependency.children),
152
- value: trimVirtualMeta(dependency.value)
153
- };
154
- });
155
- }, "trimDependencyVirtualMeta");
156
- var DuplicateDetector = class {
157
- static {
158
- __name(this, "DuplicateDetector");
159
- }
160
- dependency;
161
- dependencyEntries;
162
- constructor(output, dependency) {
163
- this.dependency = dependency;
164
- this.dependencyEntries = trimDependencyVirtualMeta(multiLineToJSONArray(output));
165
- }
166
- detect() {
167
- const result = this.dependencyEntries.reduce(this.detectReducer, this.resultsFactory(this.dependency));
168
- if (result.duplicateVersions.length > 0) {
169
- console.log(import_chalk3.default.yellow(`${import_node_os.EOL}Duplicates found for: ${this.dependency}`));
170
- const duplicateVersions = result.duplicateVersions.toString().replaceAll(",", `${import_node_os.EOL} `);
171
- console.log(import_chalk3.default.grey(` ${duplicateVersions}`, import_node_os.EOL));
172
- return 1;
173
- } else {
174
- console.log(`${this.dependency} - OK`);
175
- return 0;
176
- }
177
- }
178
- detectReducer(acc, entry) {
179
- const version = Object.entries(entry.children).map(([k]) => k)[0];
180
- if (!acc.currentVersion) {
181
- acc.currentVersion = version;
182
- return acc;
183
- }
184
- if (acc.currentVersion && acc.currentVersion !== version && !version.includes("@virtual:")) {
185
- if (acc.duplicateVersions.length === 0) {
186
- acc.duplicateVersions.push(acc.currentVersion);
187
- }
188
- acc.duplicateVersions.push(version);
189
- acc.duplicateVersions = (0, import_uniq.default)(acc.duplicateVersions);
190
- }
191
- return acc;
192
- }
193
- resultsFactory = /* @__PURE__ */ __name((dependency) => ({
194
- currentVersion: void 0,
195
- dependency,
196
- duplicateVersions: []
197
- }), "resultsFactory");
198
- };
199
-
200
- // src/lib/dependencies/detectDuplicateDependencies.ts
201
- var detectDuplicateDependencies = /* @__PURE__ */ __name((depsFromPackageJSON, DefaultDependencies2) => {
202
- let exitCode = 0;
203
- const dependencies = depsFromPackageJSON?.length ? depsFromPackageJSON : DefaultDependencies2;
204
- return safeExit(() => {
205
- if (dependencies) {
206
- for (const dependency of dependencies) {
207
- let output;
208
- try {
209
- const cmd = `yarn why ${dependency} --json`;
210
- output = (0, import_node_child_process.execSync)(cmd).toString();
211
- } catch (e) {
212
- console.error(`Error running yarn why: ${e}`);
213
- exitCode = 1;
214
- continue;
215
- }
216
- if (output) {
217
- exitCode = new DuplicateDetector(output, dependency).detect();
218
- } else {
219
- console.log(`${dependency} - N/A`);
220
- if (depsFromPackageJSON) {
221
- exitCode = 1;
222
- console.log(`\u{1F6A8} Library ${dependency} was requested in package.json but not found`);
223
- }
224
- }
225
- }
226
- return exitCode;
227
- } else {
228
- console.log("\u{1F6A8} No dependencies where passed");
229
- return exitCode;
230
- }
231
- });
232
- }, "detectDuplicateDependencies");
233
-
234
- // src/lib/file/constants.ts
235
- var WINDOWS_NEWLINE_REGEX = /\r\n/g;
236
- var CROSS_PLATFORM_NEWLINE = "\n";
237
-
238
- // src/lib/file/fileLines.ts
239
- var import_node_fs = require("fs");
240
-
241
- // src/lib/string/empty.ts
242
- var empty = /* @__PURE__ */ __name((value) => value?.trim().length === 0, "empty");
243
- var notEmpty = /* @__PURE__ */ __name((value) => !empty(value), "notEmpty");
244
-
245
- // src/lib/string/union.ts
246
- var union = /* @__PURE__ */ __name((a, b) => /* @__PURE__ */ new Set([
247
- ...new Set(a),
248
- ...new Set(b)
249
- ]), "union");
250
-
251
- // src/lib/file/ReadFileSyncOptions.ts
252
- var defaultReadFileSyncOptions = {
253
- encoding: "utf8"
254
- };
255
-
256
- // src/lib/file/fileLines.ts
257
- var readLines = /* @__PURE__ */ __name((uri, options = defaultReadFileSyncOptions) => (0, import_node_fs.existsSync)(uri) ? (0, import_node_fs.readFileSync)(uri, options).replace(WINDOWS_NEWLINE_REGEX, CROSS_PLATFORM_NEWLINE).split(CROSS_PLATFORM_NEWLINE) : [], "readLines");
258
- var readNonEmptyLines = /* @__PURE__ */ __name((uri, options = defaultReadFileSyncOptions) => readLines(uri, options).filter(notEmpty), "readNonEmptyLines");
259
- var writeLines = /* @__PURE__ */ __name((uri, lines, options = defaultReadFileSyncOptions) => {
260
- const existing = (0, import_node_fs.existsSync)(uri) ? (0, import_node_fs.readFileSync)(uri, options) : void 0;
261
- const desired = lines.join(CROSS_PLATFORM_NEWLINE);
262
- if (existing !== desired) (0, import_node_fs.writeFileSync)(uri, desired, options);
263
- }, "writeLines");
264
-
265
- // src/lib/generateIgnoreFiles.ts
266
- var import_chalk4 = __toESM(require("chalk"), 1);
267
-
268
- // src/lib/yarn/isYarnVersionOrGreater.ts
269
- var import_node_child_process2 = require("child_process");
270
- var isYarnVersionOrGreater = /* @__PURE__ */ __name((major, minor, patch) => {
271
- const result = (0, import_node_child_process2.spawnSync)("yarn", [
272
- "-v"
273
- ], {
274
- encoding: "utf8",
275
- shell: true
276
- });
277
- const version = result.stdout.toString().replaceAll("\n", "");
278
- const versionNumbers = version.split(".").map((ver) => Number.parseInt(ver));
279
- const majorDelta = versionNumbers[0] - major;
280
- const minorDelta = versionNumbers[1] - (minor ?? versionNumbers[1]);
281
- const patchDelta = versionNumbers[2] - (patch ?? versionNumbers[2]);
282
- const majorOk = majorDelta >= 0;
283
- const minorOk = majorDelta > 0 || minorDelta >= 0;
284
- const patchOk = majorDelta > 0 || minorDelta > 0 || patchDelta >= 0;
285
- return [
286
- majorOk && minorOk && patchOk,
287
- version
288
- ];
289
- }, "isYarnVersionOrGreater");
290
-
291
- // src/lib/yarn/workspace/yarnWorkspaces.ts
292
- var import_node_child_process3 = require("child_process");
293
- var yarnWorkspaces = /* @__PURE__ */ __name(() => {
294
- const result = (0, import_node_child_process3.spawnSync)("yarn", [
295
- "workspaces",
296
- "list",
297
- "--json",
298
- "--recursive"
299
- ], {
300
- encoding: "utf8",
301
- shell: true
302
- });
303
- if (result.error) {
304
- throw result.error;
305
- }
306
- return result.stdout.toString().split("\n").slice(0, -1).map((item) => {
307
- return JSON.parse(item);
308
- });
309
- }, "yarnWorkspaces");
310
-
311
- // src/lib/yarn/workspace/yarnWorkspace.ts
312
- var yarnWorkspace = /* @__PURE__ */ __name((pkg) => {
313
- const workspace = yarnWorkspaces().find(({ name }) => name === pkg);
314
- if (!workspace) throw new Error(`Workspace ${pkg} not found`);
315
- return workspace;
316
- }, "yarnWorkspace");
317
-
318
- // src/lib/yarn/yarnInitCwd.ts
319
- var INIT_CWD = /* @__PURE__ */ __name(() => {
320
- if (!process.env.INIT_CWD) console.error("Missing INIT_CWD");
321
- return process.env.INIT_CWD;
322
- }, "INIT_CWD");
323
-
324
- // src/lib/generateIgnoreFiles.ts
325
- var mergeEntries = /* @__PURE__ */ __name((a, b) => [
326
- ...union(a, b)
327
- ].sort(), "mergeEntries");
328
- var generateIgnoreFiles = /* @__PURE__ */ __name((filename3, pkg) => {
329
- console.log(import_chalk4.default.green(`Generate ${filename3} Files`));
330
- const cwd = INIT_CWD() ?? ".";
331
- const workspaces = pkg ? [
332
- yarnWorkspace(pkg)
333
- ] : yarnWorkspaces();
334
- const readEntries = /* @__PURE__ */ __name((location) => readNonEmptyLines(`${location}/${filename3}`), "readEntries");
335
- const writeEntries = /* @__PURE__ */ __name((location, entries) => writeLines(`${location}/${filename3}`, entries), "writeEntries");
336
- const results = workspaces.map(({ location, name }) => {
337
- try {
338
- writeEntries(location, mergeEntries(readEntries(cwd), readEntries(location)));
339
- return 0;
340
- } catch (ex) {
341
- const error = ex;
342
- console.error(`Generate ${filename3} Files [${name}] [${error.message}]`);
343
- return 1;
344
- }
345
- });
346
- const succeeded = results.every((result) => result === 0);
347
- return succeeded ? 0 : 1;
348
- }, "generateIgnoreFiles");
349
-
350
- // src/lib/parsedPackageJSON.ts
351
- var import_node_fs2 = require("fs");
352
- var parsedPackageJSON = /* @__PURE__ */ __name((path3) => {
353
- const pathToPackageJSON = path3 ?? process.env.npm_package_json ?? "";
354
- const packageJSON = (0, import_node_fs2.readFileSync)(pathToPackageJSON).toString();
355
- return JSON.parse(packageJSON);
356
- }, "parsedPackageJSON");
357
-
358
- // src/lib/runSteps.ts
359
- var import_node_child_process4 = require("child_process");
360
- var import_node_fs3 = require("fs");
361
- var import_chalk5 = __toESM(require("chalk"), 1);
362
- var runSteps = /* @__PURE__ */ __name((name, steps, exitOnFail = true, messages) => {
363
- return safeExit(() => {
364
- const pkgName = process.env.npm_package_name;
365
- console.log(import_chalk5.default.green(`${name} [${pkgName}]`));
366
- let totalStatus = 0;
367
- for (const [i, [command, args, config]] of steps.entries()) {
368
- if (messages?.[i]) {
369
- console.log(import_chalk5.default.gray(messages?.[i]));
370
- }
371
- const argList = Array.isArray(args) ? args : args.split(" ");
372
- if (command === "node" && !(0, import_node_fs3.existsSync)(argList[0])) {
373
- throw new Error(`File not found [${argList[0]}]`);
374
- }
375
- const status = (0, import_node_child_process4.spawnSync)(command, Array.isArray(args) ? args : args.split(" "), {
376
- ...config,
377
- encoding: "utf8",
378
- env: {
379
- FORCE_COLOR: "3",
380
- ...process.env
381
- },
382
- shell: true,
383
- stdio: "inherit"
384
- }).status ?? 0;
385
- checkResult(name, status, "error", exitOnFail);
386
- totalStatus += status ?? 0;
387
- }
388
- return totalStatus;
389
- }, !!exitOnFail);
390
- }, "runSteps");
391
-
392
- // src/lib/runStepsAsync.ts
393
- var import_node_child_process5 = require("child_process");
394
- var import_node_fs4 = require("fs");
395
- var import_chalk6 = __toESM(require("chalk"), 1);
396
- var runStepAsync = /* @__PURE__ */ __name((name, step, exitOnFail = true, message) => {
397
- return new Promise((resolve) => {
398
- const [command, args, config] = step;
399
- if (message) {
400
- console.log(import_chalk6.default.gray(message));
401
- }
402
- const argList = Array.isArray(args) ? args : args.split(" ");
403
- if (command === "node" && !(0, import_node_fs4.existsSync)(argList[0])) {
404
- throw new Error(`File not found [${argList[0]}]`);
405
- }
406
- (0, import_node_child_process5.spawn)(command, Array.isArray(args) ? args : args.split(" "), {
407
- ...config,
408
- env: {
409
- FORCE_COLOR: "3",
410
- ...process.env
411
- },
412
- shell: true,
413
- stdio: "inherit"
414
- }).on("close", (code) => {
415
- if (code) {
416
- console.error(import_chalk6.default.red(`Command Exited With Non-Zero Result [${import_chalk6.default.gray(code)}] | ${import_chalk6.default.yellow(command)} ${import_chalk6.default.white(Array.isArray(args) ? args.join(" ") : args)}`));
417
- checkResult(name, code, "error", exitOnFail);
418
- resolve(code);
419
- } else {
420
- resolve(0);
421
- }
422
- });
423
- });
424
- }, "runStepAsync");
425
- var runStepsAsync = /* @__PURE__ */ __name(async (name, steps, exitOnFail = true, messages) => {
426
- return await safeExitAsync(async () => {
427
- const pkgName = process.env.npm_package_name;
428
- console.log(import_chalk6.default.green(`${name} [${pkgName}]`));
429
- let result = 0;
430
- for (const [i, step] of steps.entries()) {
431
- result += await runStepAsync(name, step, exitOnFail, messages?.[i]);
432
- }
433
- return result;
434
- });
435
- }, "runStepsAsync");
436
-
437
- // src/actions/build.ts
438
- var build = /* @__PURE__ */ __name(async ({ incremental, jobs, target, verbose, pkg }) => {
439
- const start = Date.now();
440
- const pkgOptions = pkg ? [
441
- pkg
442
- ] : [];
443
- const incrementalOptions = incremental ? [
444
- "-i"
445
- ] : [];
446
- const verboseOptions = verbose ? [
447
- "-v"
448
- ] : [];
449
- const targetOptions = target ? [
450
- "-t",
451
- target
452
- ] : [];
453
- const jobsOptions = jobs ? [
454
- "-j",
455
- `${jobs}`
456
- ] : [];
457
- if (jobs) {
458
- console.log(import_chalk7.default.blue(`Jobs set to [${jobs}]`));
459
- }
460
- const result = await runStepsAsync(`Build${incremental ? "-Incremental" : ""} [${pkg ?? "All"}]`, [
461
- [
462
- "yarn",
463
- [
464
- "xy",
465
- "compile",
466
- ...pkgOptions,
467
- ...targetOptions,
468
- ...verboseOptions,
469
- ...jobsOptions,
470
- ...incrementalOptions
471
- ]
472
- ],
473
- [
474
- "yarn",
475
- [
476
- "xy",
477
- "lint",
478
- ...pkgOptions,
479
- ...verboseOptions,
480
- ...incrementalOptions
481
- ]
482
- ],
483
- [
484
- "yarn",
485
- [
486
- "xy",
487
- "deps",
488
- ...pkgOptions,
489
- ...verboseOptions,
490
- ...jobsOptions,
491
- ...incrementalOptions
492
- ]
493
- ]
494
- ]);
495
- console.log(`${import_chalk7.default.gray("Built in")} [${import_chalk7.default.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${import_chalk7.default.gray("seconds")}`);
496
- return result;
497
- }, "build");
498
-
499
- // src/actions/clean.ts
500
- var clean = /* @__PURE__ */ __name(async ({ verbose, pkg }) => {
501
- return pkg ? await cleanPackage({
502
- pkg,
503
- verbose
504
- }) : cleanAll({
505
- verbose
506
- });
507
- }, "clean");
508
- var cleanPackage = /* @__PURE__ */ __name(({ pkg }) => {
509
- return runStepsAsync(`Clean [${pkg}]`, [
510
- [
511
- "yarn",
512
- [
513
- "workspace",
514
- pkg,
515
- "run",
516
- "package-clean"
517
- ]
518
- ]
519
- ]);
520
- }, "cleanPackage");
521
- var cleanAll = /* @__PURE__ */ __name(({ verbose }) => {
522
- const verboseOptions = verbose ? [
523
- "--verbose"
524
- ] : [
525
- "--no-verbose"
526
- ];
527
- return runStepsAsync("Clean", [
528
- [
529
- "yarn",
530
- [
531
- "workspaces foreach",
532
- "-pA",
533
- "--jobs 64",
534
- ...verboseOptions,
535
- "run",
536
- "package-clean"
537
- ]
538
- ]
539
- ]);
540
- }, "cleanAll");
541
-
542
- // src/actions/clean-docs.ts
543
- var import_node_path = __toESM(require("path"), 1);
544
- var import_chalk8 = __toESM(require("chalk"), 1);
545
- var import_rimraf = require("rimraf");
546
- var cleanDocs = /* @__PURE__ */ __name(() => {
547
- const pkgName = process.env.npm_package_name;
548
- console.log(import_chalk8.default.green(`Cleaning Docs [${pkgName}]`));
549
- for (const { location } of yarnWorkspaces()) (0, import_rimraf.rimrafSync)(import_node_path.default.join(location, "docs"), {
550
- glob: true
551
- });
552
- return 0;
553
- }, "cleanDocs");
554
-
555
- // src/actions/compile.ts
556
- var import_chalk9 = __toESM(require("chalk"), 1);
557
- var compile = /* @__PURE__ */ __name(({ verbose, target, pkg, incremental, publint: publint2 }) => {
558
- return pkg ? compilePackage({
559
- pkg,
560
- publint: publint2,
561
- target,
562
- verbose
563
- }) : compileAll({
564
- incremental,
565
- publint: publint2,
566
- target,
567
- verbose
568
- });
569
- }, "compile");
570
- var compilePackage = /* @__PURE__ */ __name(({ target, pkg }) => {
571
- const targetOptions = target ? [
572
- "-t",
573
- target
574
- ] : [];
575
- return runSteps(`Compile [${pkg}]`, [
576
- [
577
- "yarn",
578
- [
579
- "workspace",
580
- pkg,
581
- "run",
582
- "package-compile",
583
- ...targetOptions
584
- ]
585
- ]
586
- ]);
587
- }, "compilePackage");
588
- var compileAll = /* @__PURE__ */ __name(({ jobs, verbose, target, incremental }) => {
589
- const start = Date.now();
590
- const verboseOptions = verbose ? [
591
- "--verbose"
592
- ] : [
593
- "--no-verbose"
594
- ];
595
- const targetOptions = target ? [
596
- "-t",
597
- target
598
- ] : [];
599
- const incrementalOptions = incremental ? [
600
- "--since",
601
- "-Apt",
602
- "--topological-dev"
603
- ] : [
604
- "--parallel",
605
- "-Apt",
606
- "--topological-dev"
607
- ];
608
- const jobsOptions = jobs ? [
609
- "-j",
610
- `${jobs}`
611
- ] : [];
612
- if (jobs) {
613
- console.log(import_chalk9.default.blue(`Jobs set to [${jobs}]`));
614
- }
615
- const result = runSteps(`Compile${incremental ? "-Incremental" : ""} [All]`, [
616
- [
617
- "yarn",
618
- [
619
- "workspaces",
620
- "foreach",
621
- ...incrementalOptions,
622
- ...jobsOptions,
623
- ...verboseOptions,
624
- "run",
625
- "package-compile",
626
- ...targetOptions
627
- ]
628
- ]
629
- ]);
630
- console.log(`${import_chalk9.default.gray("Compiled in")} [${import_chalk9.default.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${import_chalk9.default.gray("seconds")}`);
631
- return result;
632
- }, "compileAll");
633
-
634
- // src/actions/copy-assets.ts
635
- var import_posix = __toESM(require("path/posix"), 1);
636
- var import_chalk10 = __toESM(require("chalk"), 1);
637
- var import_cpy = __toESM(require("cpy"), 1);
638
- var copyPackageTargetAssets = /* @__PURE__ */ __name(async (target, name, location) => {
639
- try {
640
- const values = await (0, import_cpy.default)([
641
- "**/*.jpg",
642
- "**/*.png",
643
- "**/*.gif",
644
- "**/*.svg",
645
- "**/*.webp",
646
- "**/*.sass",
647
- "**/*.scss",
648
- "**/*.gif",
649
- "**/*.css"
650
- ], `../dist/${target}`, {
651
- cwd: import_posix.default.join(process.cwd(), location, "src"),
652
- flat: false
653
- });
654
- for (const value of values) {
655
- console.log(`${value.split("/").pop()} => ./dist/${target}`);
656
- }
657
- return 0;
658
- } catch (reason) {
659
- console.log(`Copy Failed: ${name}: ${reason}`);
660
- return 1;
661
- }
662
- }, "copyPackageTargetAssets");
663
- var copyTargetAssets = /* @__PURE__ */ __name(async (target, pkg) => {
664
- const workspaces = yarnWorkspaces();
665
- console.log(import_chalk10.default.green(`Copying Assets [${target.toUpperCase()}]`));
666
- const workspaceList = workspaces.filter(({ name }) => {
667
- return pkg === void 0 || name === pkg;
668
- });
669
- if (workspaceList.length === 0) {
670
- console.error(`Package not found [${pkg}]`);
671
- } else {
672
- const results = await Promise.all(workspaceList.map(async (workspace) => {
673
- const { location, name } = workspace;
674
- return await copyPackageTargetAssets(target, name, location);
675
- }));
676
- return results.reduce((prev, result) => prev || result, 0);
677
- }
678
- return 0;
679
- }, "copyTargetAssets");
680
- var copyAssets = /* @__PURE__ */ __name(async ({ target, pkg }) => {
681
- switch (target) {
682
- case "esm": {
683
- return await copyTargetAssets("esm", pkg);
684
- }
685
- case "cjs": {
686
- return await copyTargetAssets("cjs", pkg);
687
- }
688
- default: {
689
- return await copyTargetAssets("esm", pkg) || await copyTargetAssets("cjs", pkg);
690
- }
691
- }
692
- }, "copyAssets");
693
-
694
- // src/actions/cycle.ts
695
- var cycle = /* @__PURE__ */ __name(() => {
696
- const rules = [
697
- `"'import/no-cycle': [1, { maxDepth: 6 }]"`,
698
- `"'import/no-internal-modules': ['off']"`
699
- ];
700
- return runSteps("Cycle", [
701
- [
702
- "yarn",
703
- [
704
- "eslint",
705
- ...rules.flatMap((rule) => [
706
- "--rule",
707
- rule
708
- ]),
709
- "--cache",
710
- "."
711
- ]
712
- ]
713
- ]);
714
- }, "cycle");
715
-
716
- // src/actions/dead.ts
717
- var dead = /* @__PURE__ */ __name(() => {
718
- return runSteps("Dead", [
719
- [
720
- "yarn",
721
- [
722
- "ts-prune",
723
- "-p",
724
- "tsconfig.json"
725
- ]
726
- ]
727
- ]);
728
- }, "dead");
729
-
730
- // src/actions/deploy.ts
731
- var deploy = /* @__PURE__ */ __name(() => {
732
- return runSteps("Deploy [Patch]", [
733
- [
734
- "yarn",
735
- "workspaces foreach --all version patch --deferred"
736
- ],
737
- [
738
- "yarn",
739
- "xy clean"
740
- ],
741
- [
742
- "yarn",
743
- "xy build"
744
- ],
745
- [
746
- "yarn",
747
- "version apply --all"
748
- ],
749
- [
750
- "yarn",
751
- "workspaces foreach --all --parallel npm publish"
752
- ]
753
- ]);
754
- }, "deploy");
755
-
756
- // src/actions/deploy-major.ts
757
- var deployMajor = /* @__PURE__ */ __name(() => {
758
- return runSteps("Deploy [Major]", [
759
- [
760
- "yarn",
761
- "workspaces foreach --all version major --deferred"
762
- ],
763
- [
764
- "yarn",
765
- "xy clean"
766
- ],
767
- [
768
- "yarn",
769
- "xy build"
770
- ],
771
- [
772
- "yarn",
773
- "version apply --all"
774
- ],
775
- [
776
- "yarn",
777
- "workspaces foreach --all --parallel npm publish"
778
- ]
779
- ]);
780
- }, "deployMajor");
781
-
782
- // src/actions/deploy-minor.ts
783
- var deployMinor = /* @__PURE__ */ __name(() => {
784
- return runSteps("Deploy [Minor]", [
785
- [
786
- "yarn",
787
- "workspaces foreach --all version minor --deferred"
788
- ],
789
- [
790
- "yarn",
791
- "xy clean"
792
- ],
793
- [
794
- "yarn",
795
- "xy build"
796
- ],
797
- [
798
- "yarn",
799
- "version apply --all"
800
- ],
801
- [
802
- "yarn",
803
- "workspaces foreach --all --parallel npm publish"
804
- ]
805
- ]);
806
- }, "deployMinor");
807
-
808
- // src/actions/deploy-next.ts
809
- var deployNext = /* @__PURE__ */ __name(() => {
810
- return runSteps("Deploy [Next]", [
811
- [
812
- "yarn",
813
- "workspaces foreach --all version minor --deferred"
814
- ],
815
- [
816
- "yarn",
817
- "xy clean"
818
- ],
819
- [
820
- "yarn",
821
- "xy build"
822
- ],
823
- [
824
- "yarn",
825
- "version apply --all --prerelease"
826
- ],
827
- [
828
- "yarn",
829
- "workspaces foreach --all --parallel npm publish --tag next"
830
- ]
831
- ]);
832
- }, "deployNext");
833
-
834
- // src/actions/deps.ts
835
- var import_chalk11 = __toESM(require("chalk"), 1);
836
- var deps = /* @__PURE__ */ __name(({ pkg, incremental }) => {
837
- pkg ? depsPackage({
838
- pkg
839
- }) : depsAll({
840
- incremental
841
- });
842
- return 0;
843
- }, "deps");
844
- var depsPackage = /* @__PURE__ */ __name(({ pkg }) => {
845
- const steps = [
846
- [
847
- "yarn",
848
- [
849
- "workspace",
850
- pkg,
851
- "run",
852
- "package-deps"
853
- ]
854
- ]
855
- ];
856
- return runSteps(`Deps [${pkg}]`, [
857
- ...steps
858
- ]);
859
- }, "depsPackage");
860
- var depsAll = /* @__PURE__ */ __name(({ incremental, jobs, verbose }) => {
861
- const start = Date.now();
862
- const jobsOptions = jobs ? [
863
- "-j",
864
- `${jobs}`
865
- ] : [];
866
- const verboseOptions = verbose ? [
867
- "--verbose"
868
- ] : [
869
- "--no-verbose"
870
- ];
871
- if (jobs) {
872
- console.log(import_chalk11.default.blue(`Jobs set to [${jobs}]`));
873
- }
874
- const incrementalOptions = incremental ? [
875
- "--since",
876
- "-pA"
877
- ] : [
878
- "-pA"
879
- ];
880
- const steps = [
881
- [
882
- "yarn",
883
- [
884
- "workspaces",
885
- "foreach",
886
- ...jobsOptions,
887
- ...incrementalOptions,
888
- ...verboseOptions,
889
- "run",
890
- "package-deps"
891
- ]
892
- ]
893
- ];
894
- const result = runSteps(`Deps${incremental ? "-Incremental" : ""} [All]`, [
895
- ...steps
896
- ]);
897
- console.log(`${import_chalk11.default.gray("Dep checked in")} [${import_chalk11.default.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${import_chalk11.default.gray("seconds")}`);
898
- return result;
899
- }, "depsAll");
900
-
901
- // src/actions/dupdeps.ts
902
- var import_chalk12 = __toESM(require("chalk"), 1);
903
- var dupdeps = /* @__PURE__ */ __name(() => {
904
- console.log(import_chalk12.default.green("Checking all Dependencies for Duplicates"));
905
- const allDependencies = parsedPackageJSON()?.dependencies;
906
- const dependencies = Object.entries(allDependencies).map(([k]) => k);
907
- return detectDuplicateDependencies(dependencies);
908
- }, "dupdeps");
909
-
910
- // src/actions/fix.ts
911
- var fix = /* @__PURE__ */ __name(() => {
912
- return runSteps("Fix", [
913
- [
914
- "yarn",
915
- [
916
- "eslint",
917
- ".",
918
- "--fix",
919
- "--cache"
920
- ]
921
- ]
922
- ]);
923
- }, "fix");
924
-
925
- // src/actions/gen-docs.ts
926
- var genDocs = /* @__PURE__ */ __name(({ pkg, incremental }) => {
927
- return pkg ? genDocsPackage({
928
- pkg
929
- }) : genDocsAll({
930
- incremental
931
- });
932
- }, "genDocs");
933
- var genDocsPackage = /* @__PURE__ */ __name(({ pkg }) => {
934
- const steps = [
935
- [
936
- "yarn",
937
- [
938
- "workspace",
939
- pkg,
940
- "run",
941
- "package-gen-docs"
942
- ]
943
- ]
944
- ];
945
- return runSteps(`GenDocs [${pkg}]`, [
946
- ...steps
947
- ]);
948
- }, "genDocsPackage");
949
- var genDocsAll = /* @__PURE__ */ __name(({ incremental }) => {
950
- const incrementalOptions = incremental ? [
951
- "--since",
952
- "-pA"
953
- ] : [
954
- "-pA"
955
- ];
956
- const steps = [
957
- [
958
- "yarn",
959
- [
960
- "workspaces",
961
- "foreach",
962
- ...incrementalOptions,
963
- "run",
964
- "package-gen-docs"
965
- ]
966
- ]
967
- ];
968
- return runSteps(`GenDocs [All${incremental ? "-Incremental" : ""}]`, [
969
- ...steps
970
- ]);
971
- }, "genDocsAll");
972
-
973
- // src/actions/gitignore-gen.ts
974
- var filename = ".gitignore";
975
- var gitignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename, pkg), "gitignoreGen");
976
-
977
- // src/actions/gitlint.ts
978
- var import_chalk13 = __toESM(require("chalk"), 1);
979
- var import_parse_git_config = __toESM(require("parse-git-config"), 1);
980
- var gitlint = /* @__PURE__ */ __name(() => {
981
- console.log(`
982
- Gitlint Start [${process.cwd()}]
983
- `);
984
- let valid = 0;
985
- let warnings = 0;
986
- const errors = 0;
987
- const gitConfig = import_parse_git_config.default.sync();
988
- const warn = /* @__PURE__ */ __name((message) => {
989
- console.warn(import_chalk13.default.yellow(`Warning: ${message}`));
990
- warnings++;
991
- }, "warn");
992
- if (gitConfig.core.ignorecase) {
993
- warn("Please set core.ignorecase to FALSE in .git/config file [run yarn gitlint-fix]");
994
- } else {
995
- valid++;
996
- }
997
- if (gitConfig.core.autocrlf === false) {
998
- valid++;
999
- } else {
1000
- warn("Please set core.autocrlf to FALSE in .git/config file [run yarn gitlint-fix]");
1001
- }
1002
- if (gitConfig.core.eol === "lf") {
1003
- valid++;
1004
- } else {
1005
- warn('Please set core.eol to "lf" in .git/config file [run yarn gitlint-fix]');
1006
- }
1007
- const resultMessages = [];
1008
- if (valid > 0) {
1009
- resultMessages.push(import_chalk13.default.green(`Passed: ${valid}`));
1010
- }
1011
- if (warnings > 0) {
1012
- resultMessages.push(import_chalk13.default.yellow(`Warnings: ${warnings}`));
1013
- }
1014
- if (errors > 0) {
1015
- resultMessages.push(import_chalk13.default.red(` Errors: ${errors}`));
1016
- }
1017
- console.warn(`Gitlint Finish [ ${resultMessages.join(" | ")} ]
1018
- `);
1019
- return warnings + errors === 0 ? 1 : 0;
1020
- }, "gitlint");
1021
-
1022
- // src/actions/gitlint-fix.ts
1023
- var import_node_child_process6 = require("child_process");
1024
- var import_chalk14 = __toESM(require("chalk"), 1);
1025
- var import_parse_git_config2 = __toESM(require("parse-git-config"), 1);
1026
- var gitlintFix = /* @__PURE__ */ __name(() => {
1027
- console.log(`
1028
- Gitlint Fix Start [${process.cwd()}]
1029
- `);
1030
- const gitConfig = import_parse_git_config2.default.sync();
1031
- if (gitConfig.core.ignorecase) {
1032
- (0, import_node_child_process6.execSync)("git config core.ignorecase false", {
1033
- stdio: "inherit"
1034
- });
1035
- console.warn(import_chalk14.default.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
1036
- }
1037
- if (gitConfig.core.autocrlf !== false) {
1038
- (0, import_node_child_process6.execSync)("git config core.autocrlf false", {
1039
- stdio: "inherit"
1040
- });
1041
- console.warn(import_chalk14.default.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
1042
- }
1043
- if (gitConfig.core.eol !== "lf") {
1044
- (0, import_node_child_process6.execSync)("git config core.eol lf", {
1045
- stdio: "inherit"
1046
- });
1047
- console.warn(import_chalk14.default.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
1048
- }
1049
- return 1;
1050
- }, "gitlintFix");
1051
-
1052
- // src/actions/license.ts
1053
- var import_chalk15 = __toESM(require("chalk"), 1);
1054
- var import_license_checker = require("license-checker");
1055
- var license = /* @__PURE__ */ __name(async (pkg) => {
1056
- const workspaces = yarnWorkspaces();
1057
- const workspaceList = workspaces.filter(({ name }) => {
1058
- return pkg === void 0 || name === pkg;
1059
- });
1060
- const exclude = /* @__PURE__ */ new Set([
1061
- "MIT",
1062
- "MIT*",
1063
- "ISC",
1064
- "Apache-2.0",
1065
- "BSD",
1066
- "BSD*",
1067
- "BSD-2-Clause",
1068
- "BSD-3-Clause",
1069
- "CC-BY-4.0",
1070
- "Unlicense",
1071
- "CC-BY-3.0",
1072
- "CC0-1.0",
1073
- "LGPL-3.0-only",
1074
- "LGPL-3.0",
1075
- "LGPL-3.0-or-later",
1076
- "Python-2.0"
1077
- ]);
1078
- console.log(import_chalk15.default.green("License Checker"));
1079
- return (await Promise.all(workspaceList.map(({ location, name }) => {
1080
- return new Promise((resolve) => {
1081
- (0, import_license_checker.init)({
1082
- production: true,
1083
- start: location
1084
- }, (error, packages) => {
1085
- if (error) {
1086
- console.error(import_chalk15.default.red(`License Checker [${name}] Error`));
1087
- console.error(import_chalk15.default.gray(error));
1088
- console.log("\n");
1089
- resolve(1);
1090
- } else {
1091
- console.log(import_chalk15.default.green(`License Checker [${name}]`));
1092
- let count = 0;
1093
- for (const [name2, info] of Object.entries(packages)) {
1094
- const licenses = Array.isArray(info.licenses) ? info.licenses : [
1095
- info.licenses
1096
- ];
1097
- for (let license2 of licenses) {
1098
- if (license2) {
1099
- if (license2[0] === "(" && license2.at(-1) === ")") {
1100
- license2 = license2.slice(1, -2);
1101
- }
1102
- const orLicenses = license2.split(" OR ");
1103
- let orLicenseFound = false;
1104
- for (const orLicense of orLicenses) {
1105
- if (exclude.has(orLicense)) {
1106
- orLicenseFound = true;
1107
- }
1108
- }
1109
- if (!orLicenseFound) {
1110
- count++;
1111
- console.warn(import_chalk15.default.yellow(`${name2}: Package License not allowed [${license2}]`));
1112
- }
1113
- }
1114
- }
1115
- }
1116
- console.log("\n");
1117
- resolve(count);
1118
- }
1119
- });
1120
- });
1121
- }))).reduce((prev, value) => prev || value, 0);
1122
- }, "license");
1123
-
1124
- // src/actions/lint.ts
1125
- var import_chalk16 = __toESM(require("chalk"), 1);
1126
- var import_eslint = require("eslint");
1127
- var dumpMessages = /* @__PURE__ */ __name((lintResults) => {
1128
- const colors = [
1129
- "white",
1130
- "yellow",
1131
- "red"
1132
- ];
1133
- const severity = [
1134
- "none",
1135
- "warning",
1136
- "error"
1137
- ];
1138
- for (const lintResult of lintResults) {
1139
- if (lintResult.messages.length > 0) {
1140
- console.log(import_chalk16.default.gray(`${lintResult.filePath}`));
1141
- for (const message of lintResult.messages) {
1142
- console.log(import_chalk16.default.gray(` ${message.line}:${message.column}`), import_chalk16.default[colors[message.severity]](` ${severity[message.severity]}`), import_chalk16.default.white(` ${message.message}`), import_chalk16.default.gray(` ${message.ruleId}`));
1143
- }
1144
- }
1145
- }
1146
- }, "dumpMessages");
1147
- var lintPackage = /* @__PURE__ */ __name(async ({ pkg }) => {
1148
- const workspace = yarnWorkspaces().find((workspace2) => workspace2.name === pkg);
1149
- if (!workspace) {
1150
- console.error(import_chalk16.default.red(`Unable to locate package [${import_chalk16.default.magenta(pkg)}]`));
1151
- process.exit(1);
1152
- }
1153
- const engine = new import_eslint.ESLint({
1154
- cache: true
1155
- });
1156
- const lintResults = await engine.lintFiles(workspace.location);
1157
- dumpMessages(lintResults);
1158
- return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
1159
- }, "lintPackage");
1160
- var lint = /* @__PURE__ */ __name(async ({ pkg } = {}) => {
1161
- return pkg ? await lintPackage({
1162
- pkg
1163
- }) : runSteps("Lint-Caching [All]", [
1164
- [
1165
- "yarn",
1166
- [
1167
- "eslint",
1168
- ".",
1169
- "--cache"
1170
- ]
1171
- ]
1172
- ]);
1173
- }, "lint");
1174
-
1175
- // src/actions/lint-profile.ts
1176
- var lintProfile = /* @__PURE__ */ __name(() => {
1177
- return runSteps("Lint Profile", [
1178
- [
1179
- "yarn",
1180
- [
1181
- "xy",
1182
- "lint"
1183
- ],
1184
- {
1185
- env: {
1186
- ...process.env,
1187
- TIMING: "1"
1188
- }
1189
- }
1190
- ]
1191
- ]);
1192
- }, "lintProfile");
1193
-
1194
- // src/actions/npmignore-gen.ts
1195
- var filename2 = ".npmignore";
1196
- var npmignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename2, pkg), "npmignoreGen");
1197
-
1198
- // src/actions/publint.ts
1199
- var publint = /* @__PURE__ */ __name(async ({ verbose, pkg }) => {
1200
- return pkg ? await publintPackage({
1201
- pkg,
1202
- verbose
1203
- }) : publintAll({
1204
- verbose
1205
- });
1206
- }, "publint");
1207
- var publintPackage = /* @__PURE__ */ __name(({ pkg }) => {
1208
- return runStepsAsync(`Publint [${pkg}]`, [
1209
- [
1210
- "yarn",
1211
- [
1212
- "workspace",
1213
- pkg,
1214
- "run",
1215
- "package-publint"
1216
- ]
1217
- ]
1218
- ]);
1219
- }, "publintPackage");
1220
- var publintAll = /* @__PURE__ */ __name(({ verbose }) => {
1221
- const verboseOptions = verbose ? [
1222
- "--verbose"
1223
- ] : [
1224
- "--no-verbose"
1225
- ];
1226
- return runSteps("Publint", [
1227
- [
1228
- "yarn",
1229
- [
1230
- "workspaces",
1231
- "foreach",
1232
- "-pA",
1233
- ...verboseOptions,
1234
- "run",
1235
- "package-publint"
1236
- ]
1237
- ]
1238
- ]);
1239
- }, "publintAll");
1240
-
1241
- // src/actions/rebuild.ts
1242
- var rebuild = /* @__PURE__ */ __name(({ target }) => {
1243
- return runSteps("Rebuild", [
1244
- [
1245
- "yarn",
1246
- "xy clean"
1247
- ],
1248
- [
1249
- "yarn",
1250
- target ? `xy build -t ${target}` : "xy build"
1251
- ]
1252
- ]);
1253
- }, "rebuild");
1254
-
1255
- // src/actions/recompile.ts
1256
- var import_chalk17 = __toESM(require("chalk"), 1);
1257
- var recompile = /* @__PURE__ */ __name(async ({ verbose, target, pkg, incremental }) => {
1258
- return pkg ? await recompilePackage({
1259
- pkg,
1260
- target,
1261
- verbose
1262
- }) : await recompileAll({
1263
- incremental,
1264
- target,
1265
- verbose
1266
- });
1267
- }, "recompile");
1268
- var recompilePackage = /* @__PURE__ */ __name(({ verbose, target, pkg }) => {
1269
- const targetOptions = target ? [
1270
- "-t",
1271
- target
1272
- ] : [];
1273
- const verboseOptions = verbose ? [
1274
- "--verbose"
1275
- ] : [
1276
- "--no-verbose"
1277
- ];
1278
- return runStepsAsync(`Recompile [${pkg}]`, [
1279
- [
1280
- "yarn",
1281
- [
1282
- "workspace",
1283
- pkg,
1284
- ...verboseOptions,
1285
- "run",
1286
- "package-recompile",
1287
- ...targetOptions
1288
- ]
1289
- ]
1290
- ]);
1291
- }, "recompilePackage");
1292
- var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, incremental }) => {
1293
- const start = Date.now();
1294
- const verboseOptions = verbose ? [
1295
- "--verbose"
1296
- ] : [
1297
- "--no-verbose"
1298
- ];
1299
- const targetOptions = target ? [
1300
- "-t",
1301
- target
1302
- ] : [];
1303
- const incrementalOptions = incremental ? [
1304
- "--since",
1305
- "-Apt",
1306
- "--topological-dev"
1307
- ] : [
1308
- "--parallel",
1309
- "-Apt",
1310
- "--topological-dev"
1311
- ];
1312
- const jobsOptions = jobs ? [
1313
- "-j",
1314
- `${jobs}`
1315
- ] : [];
1316
- if (jobs) {
1317
- console.log(import_chalk17.default.blue(`Jobs set to [${jobs}]`));
1318
- }
1319
- const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
1320
- [
1321
- "yarn",
1322
- [
1323
- "workspaces",
1324
- "foreach",
1325
- ...incrementalOptions,
1326
- ...jobsOptions,
1327
- ...verboseOptions,
1328
- "run",
1329
- "package-recompile",
1330
- ...targetOptions
1331
- ]
1332
- ]
1333
- ]);
1334
- console.log(`${import_chalk17.default.gray("Recompiled in")} [${import_chalk17.default.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${import_chalk17.default.gray("seconds")}`);
1335
- return result;
1336
- }, "recompileAll");
1337
-
1338
- // src/actions/reinstall.ts
1339
- var import_node_fs5 = require("fs");
1340
- var reinstall = /* @__PURE__ */ __name(() => {
1341
- console.log("Reinstall [Clear Lock File]");
1342
- (0, import_node_fs5.closeSync)((0, import_node_fs5.openSync)("./yarn.lock", "w"));
1343
- console.log("Reinstall [Clear Node Modules]");
1344
- const workspaces = yarnWorkspaces();
1345
- const result = workspaces.map(({ location, name }) => {
1346
- const dist = `${location}/node_modules`;
1347
- try {
1348
- (0, import_node_fs5.rmSync)(dist, {
1349
- force: true,
1350
- recursive: true
1351
- });
1352
- return 0;
1353
- } catch (ex) {
1354
- const error = ex;
1355
- console.error(`Reinstall [Clear Node Modules] Failed [${name}, ${error.message}]`);
1356
- return 1;
1357
- }
1358
- }).reduce((prev, result2) => prev || result2, 0);
1359
- return result || runSteps("Reinstall", [
1360
- [
1361
- "yarn",
1362
- "install --network-timeout 10000"
1363
- ]
1364
- ]);
1365
- }, "reinstall");
1366
-
1367
- // src/actions/relint.ts
1368
- var import_node_fs6 = require("fs");
1369
- var relint = /* @__PURE__ */ __name(() => {
1370
- console.log("Relint - Cleaning [.eslintcache]");
1371
- const workspaces = yarnWorkspaces();
1372
- const result = workspaces.map(({ location, name }) => {
1373
- const dist = `${location}/.eslintcache`;
1374
- try {
1375
- (0, import_node_fs6.rmSync)(dist, {
1376
- force: true,
1377
- recursive: true
1378
- });
1379
- return 0;
1380
- } catch (ex) {
1381
- const error = ex;
1382
- console.error(`Relint - Cleaning [.eslintcache] Failed [${name}, ${error.message}]`);
1383
- return 1;
1384
- }
1385
- }).reduce((prev, result2) => prev || result2, 0);
1386
- return result || runSteps("Relint", [
1387
- [
1388
- "yarn",
1389
- [
1390
- "eslint",
1391
- ".",
1392
- "--cache"
1393
- ]
1394
- ]
1395
- ]);
1396
- }, "relint");
1397
-
1398
- // src/actions/retest.ts
1399
- var retest = /* @__PURE__ */ __name(() => {
1400
- return runSteps("Test", [
1401
- [
1402
- "yarn",
1403
- [
1404
- "jest",
1405
- "--clearCache"
1406
- ]
1407
- ],
1408
- [
1409
- "yarn",
1410
- [
1411
- "jest",
1412
- "."
1413
- ]
1414
- ]
1415
- ]);
1416
- }, "retest");
1417
-
1418
- // src/actions/sonar.ts
1419
- var sonar = /* @__PURE__ */ __name(() => {
1420
- return runSteps("Sonar", [
1421
- [
1422
- "yarn",
1423
- [
1424
- "eslint",
1425
- "-c",
1426
- "sonar.eslintrc",
1427
- "."
1428
- ]
1429
- ]
1430
- ]);
1431
- }, "sonar");
1432
-
1433
- // src/actions/statics.ts
1434
- var import_chalk18 = __toESM(require("chalk"), 1);
1435
- var DefaultDependencies = [
1436
- "axios",
1437
- "@xylabs/pixel",
1438
- "react",
1439
- "graphql",
1440
- "react-router",
1441
- "@mui/material",
1442
- "@mui/system"
1443
- ];
1444
- var statics = /* @__PURE__ */ __name(() => {
1445
- console.log(import_chalk18.default.green("Check Required Static Dependencies"));
1446
- const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
1447
- return detectDuplicateDependencies(statics2, DefaultDependencies);
1448
- }, "statics");
1449
-
1450
- // src/actions/test.ts
1451
- var test = /* @__PURE__ */ __name(() => {
1452
- return runSteps("Test", [
1453
- [
1454
- "yarn",
1455
- [
1456
- "jest",
1457
- "."
1458
- ]
1459
- ]
1460
- ]);
1461
- }, "test");
1462
-
1463
- // src/actions/up.ts
1464
- var up = /* @__PURE__ */ __name(() => {
1465
- return runSteps("Up", [
1466
- [
1467
- "yarn",
1468
- "outdated"
1469
- ]
1470
- ]);
1471
- }, "up");
1472
-
1473
- // src/actions/updo.ts
1474
- var updo = /* @__PURE__ */ __name(() => {
1475
- return runSteps("Updo", [
1476
- [
1477
- "yarn",
1478
- "install"
1479
- ],
1480
- [
1481
- "yarn",
1482
- "upgrade-interactive"
1483
- ],
1484
- [
1485
- "yarn",
1486
- "dedupe"
1487
- ]
1488
- ]);
1489
- }, "updo");
1490
-
1491
- // src/actions/upplug.ts
1492
- var updateYarnPlugins = /* @__PURE__ */ __name(() => {
1493
- return runSteps("Update Yarn Plugins", [
1494
- [
1495
- "yarn",
1496
- [
1497
- "plugin",
1498
- "import",
1499
- "https://mskelton.dev/yarn-outdated/v3"
1500
- ]
1501
- ],
1502
- [
1503
- "yarn",
1504
- [
1505
- "plugin",
1506
- "import",
1507
- "version"
1508
- ]
1509
- ],
1510
- [
1511
- "yarn",
1512
- [
1513
- "plugin",
1514
- "import",
1515
- "interactive-tools"
1516
- ]
1517
- ],
1518
- [
1519
- "yarn",
1520
- [
1521
- "plugin",
1522
- "import",
1523
- "workspace-tools"
1524
- ]
1525
- ]
1526
- ]);
1527
- }, "updateYarnPlugins");
1528
-
1529
- // src/actions/upyarn.ts
1530
- var updateYarnVersion = /* @__PURE__ */ __name(() => {
1531
- return runSteps("Update Yarn Version", [
1532
- [
1533
- "yarn",
1534
- [
1535
- "set",
1536
- "version",
1537
- "latest"
1538
- ]
1539
- ]
1540
- ]);
1541
- }, "updateYarnVersion");
1542
-
1543
- // src/actions/yarn3only.ts
1544
- var yarn3Only = /* @__PURE__ */ __name(() => {
1545
- const [valid, version] = isYarnVersionOrGreater(3);
1546
- if (!valid) {
1547
- processEx(`Invalid Yarn version [${version}]`);
1548
- }
1549
- return 0;
1550
- }, "yarn3Only");
1551
-
1552
- // src/xy/xyBuildCommands.ts
1553
- var xyBuildCommands = /* @__PURE__ */ __name((args) => {
1554
- return args.command("build [package]", "Build - Compile & Lint", (yargs2) => {
1555
- return yargs2.positional("package", {
1556
- describe: "Specific package to build"
1557
- });
1558
- }, async (argv) => {
1559
- if (argv.verbose) {
1560
- console.log(`Building: ${argv.package ?? "all"}`);
1561
- }
1562
- process.exitCode = await build({
1563
- incremental: !!argv.incremental,
1564
- jobs: argv.jobs,
1565
- pkg: argv.package,
1566
- target: argv.target,
1567
- verbose: !!argv.verbose
1568
- });
1569
- }).command("compile [package]", "Compile with Typescript & Copy Images", (yargs2) => {
1570
- return yargs2.positional("package", {
1571
- describe: "Specific package to compile"
1572
- });
1573
- }, async (argv) => {
1574
- if (argv.verbose) {
1575
- console.log(`Compiling: ${argv.package ?? "all"}`);
1576
- }
1577
- process.exitCode = await compile({
1578
- incremental: !!argv.incremental,
1579
- jobs: argv.jobs,
1580
- pkg: argv.package,
1581
- target: argv.target,
1582
- verbose: !!argv.verbose
1583
- });
1584
- }).command("compile-only [package]", "Compile with Typescript & Copy Images (No Publint)", (yargs2) => {
1585
- return yargs2.positional("package", {
1586
- describe: "Specific package to compile"
1587
- });
1588
- }, async (argv) => {
1589
- if (argv.verbose) {
1590
- console.log(`Compiling: ${argv.package ?? "all"}`);
1591
- }
1592
- process.exitCode = await compile({
1593
- incremental: !!argv.incremental,
1594
- jobs: argv.jobs,
1595
- pkg: argv.package,
1596
- publint: false,
1597
- target: argv.target,
1598
- verbose: !!argv.verbose
1599
- });
1600
- }).command("recompile [package]", "Re-compile with Typescript & Copy Images", (yargs2) => {
1601
- return yargs2.positional("package", {
1602
- describe: "Specific package to re-compile"
1603
- });
1604
- }, async (argv) => {
1605
- if (argv.verbose) {
1606
- console.log(`Re-compiling: ${argv.package ?? "all"}`);
1607
- }
1608
- process.exitCode = await recompile({
1609
- incremental: !!argv.incremental,
1610
- jobs: argv.jobs,
1611
- pkg: argv.package,
1612
- target: argv.target,
1613
- verbose: !!argv.verbose
1614
- });
1615
- }).command("rebuild [package]", "Rebuild - Clean, Compile & Lint", (yargs2) => {
1616
- return yargs2.positional("package", {
1617
- describe: "Specific package to rebuild"
1618
- });
1619
- }, (argv) => {
1620
- if (argv.verbose) console.log(`Rebuilding: ${argv.package ?? "all"}`);
1621
- process.exitCode = rebuild({
1622
- target: argv.target
1623
- });
1624
- }).command("copy-assets [package]", "Copy Assets - Copy the assets from src to dist", (yargs2) => {
1625
- return yargs2.positional("package", {
1626
- describe: "Specific package to copy assets"
1627
- });
1628
- }, async (argv) => {
1629
- if (argv.verbose) console.log(`Copying Assets: ${argv.package ?? "all"}`);
1630
- process.exitCode = await copyAssets({
1631
- target: argv.target
1632
- });
1633
- });
1634
- }, "xyBuildCommands");
1635
-
1636
- // src/xy/param.ts
1637
- var packagePositionalParam = /* @__PURE__ */ __name((yargs2) => {
1638
- return yargs2.positional("package", {
1639
- describe: "Specific package to target"
1640
- });
1641
- }, "packagePositionalParam");
1642
-
1643
- // src/xy/xyCommonCommands.ts
1644
- var xyCommonCommands = /* @__PURE__ */ __name((args) => {
1645
- return args.command("license [package]", "License - Check licenses of dependencies", (yargs2) => {
1646
- return packagePositionalParam(yargs2);
1647
- }, async (argv) => {
1648
- if (argv.verbose) console.log(`License: ${argv.package ?? "all"}`);
1649
- process.exitCode = await license();
1650
- }).command("dead [package]", "Dead - Check for dead code", (yargs2) => {
1651
- return packagePositionalParam(yargs2);
1652
- }, (argv) => {
1653
- if (argv.verbose) console.log("Dead");
1654
- process.exitCode = dead();
1655
- }).command("deps [package]", "Deps - Check for unused or missing dependencies", (yargs2) => {
1656
- return packagePositionalParam(yargs2);
1657
- }, (argv) => {
1658
- if (argv.verbose) console.log(`Checking Dependencies: ${argv.package ?? "all"}`);
1659
- process.exitCode = deps({
1660
- incremental: !!argv.incremental,
1661
- jobs: argv.jobs,
1662
- pkg: argv.package
1663
- });
1664
- }).command("gen-docs [package]", "GenDocs - Generate TypeDocs", (yargs2) => {
1665
- return packagePositionalParam(yargs2);
1666
- }, (argv) => {
1667
- if (argv.verbose) console.log(`Generating TypeDocs: ${argv.package ?? "all"}`);
1668
- process.exitCode = genDocs({
1669
- incremental: !!argv.incremental,
1670
- pkg: argv.package
1671
- });
1672
- }).command("clean-docs", "CleanDocs - Clean TypeDocs", (yargs2) => yargs2, (argv) => {
1673
- if (argv.verbose) console.log("Cleaning TypeDocs: all");
1674
- process.exitCode = cleanDocs();
1675
- }).command("gitlint [package]", "Gitlint - Lint your git config", (yargs2) => {
1676
- return yargs2;
1677
- }, (argv) => {
1678
- if (argv.verbose) console.log("Gitlint");
1679
- process.exitCode = argv.fix ? gitlintFix() : gitlint();
1680
- }).command("gitignore-gen", "GitIgnore Gen - Generate .gitignore files", (yargs2) => {
1681
- return yargs2;
1682
- }, (argv) => {
1683
- if (argv.verbose) console.log("GitIgnore Gen");
1684
- process.exitCode = gitignoreGen();
1685
- }).command("npmignore-gen", "NpmIgnore Gen - Generate .npmignore files", (yargs2) => {
1686
- return yargs2;
1687
- }, (argv) => {
1688
- if (argv.verbose) console.log("NpmIgnore Gen");
1689
- process.exitCode = npmignoreGen();
1690
- }).command("retest", "Re-Test - Run Jest Tests with cleaned cache", (yargs2) => {
1691
- return yargs2;
1692
- }, (argv) => {
1693
- if (argv.verbose) console.log("Re-Testing");
1694
- process.exitCode = retest();
1695
- }).command("test", "Test - Run Jest Tests", (yargs2) => {
1696
- return yargs2;
1697
- }, (argv) => {
1698
- if (argv.verbose) console.log("Testing");
1699
- process.exitCode = test();
1700
- }).command("upplug", "UpPlug - Update Yarn Plugins", (yargs2) => {
1701
- return yargs2;
1702
- }, (argv) => {
1703
- if (argv.verbose) console.log("UpPlug");
1704
- process.exitCode = updateYarnPlugins();
1705
- }).command("upyarn", "UpYarn - Update Yarn Version", (yargs2) => {
1706
- return yargs2;
1707
- }, (argv) => {
1708
- if (argv.verbose) console.log("UpYarn");
1709
- process.exitCode = updateYarnVersion();
1710
- }).command("yarn3only", "Yarn3Only - Check if using Yarn v3", (yargs2) => {
1711
- return yargs2;
1712
- }, (argv) => {
1713
- if (argv.verbose) console.log("Yarn 3 Check");
1714
- process.exitCode = yarn3Only();
1715
- });
1716
- }, "xyCommonCommands");
1717
-
1718
- // src/xy/xyDeployCommands.ts
1719
- var xyDeployCommands = /* @__PURE__ */ __name((args) => {
1720
- return args.command("deploy", "Deploy - Deploy patch", (yargs2) => {
1721
- return yargs2;
1722
- }, (argv) => {
1723
- if (argv.verbose) console.log("Deploy patch");
1724
- process.exitCode = deploy();
1725
- }).command("deploy-minor", "Deploy - Deploy minor", (yargs2) => {
1726
- return yargs2;
1727
- }, (argv) => {
1728
- if (argv.verbose) console.log("Deploy minor");
1729
- process.exitCode = deployMinor();
1730
- }).command("deploy-major", "Deploy - Deploy major", (yargs2) => {
1731
- return yargs2;
1732
- }, (argv) => {
1733
- if (argv.verbose) console.log("Deploy major");
1734
- process.exitCode = deployMajor();
1735
- }).command("deploy-next", "Deploy - Deploy next", (yargs2) => {
1736
- return yargs2;
1737
- }, (argv) => {
1738
- if (argv.verbose) console.log("Deploy next");
1739
- process.exitCode = deployNext();
1740
- });
1741
- }, "xyDeployCommands");
1742
-
1743
- // src/xy/xyInstallCommands.ts
1744
- var xyInstallCommands = /* @__PURE__ */ __name((args) => {
1745
- return args.command("clean [package]", "Clean", (yargs2) => {
1746
- return yargs2.positional("package", {
1747
- describe: "Specific package to clean"
1748
- });
1749
- }, async (argv) => {
1750
- if (argv.verbose) {
1751
- console.log(`Cleaning: ${argv.package ?? "all"}`);
1752
- }
1753
- process.exitCode = await clean({
1754
- pkg: argv.package,
1755
- verbose: !!argv.verbose
1756
- });
1757
- }).command("reinstall", "Reinstall - Clean & Install", (yargs2) => {
1758
- return yargs2;
1759
- }, (argv) => {
1760
- if (argv.verbose) console.log("Reinstalling");
1761
- process.exitCode = reinstall();
1762
- }).command("up", "Up - Update dependencies", (yargs2) => {
1763
- return yargs2;
1764
- }, (argv) => {
1765
- if (argv.verbose) console.log("Up");
1766
- process.exitCode = up();
1767
- }).command("updo", "Updo - Update dependencies [Interactive]", (yargs2) => {
1768
- return yargs2;
1769
- }, (argv) => {
1770
- if (argv.verbose) console.log("Updo");
1771
- process.exitCode = updo();
1772
- }).command("statics", "Statics - Confirming Static Packages", (yargs2) => {
1773
- return yargs2;
1774
- }, (argv) => {
1775
- if (argv.verbose) console.log("Statics");
1776
- process.exitCode = statics();
1777
- }).command("dupdeps", "Dupdeps - Duplicate Dependencies in package.json", (yargs2) => {
1778
- return yargs2;
1779
- }, (argv) => {
1780
- if (argv.verbose) console.log("Dupdeps");
1781
- process.exitCode = dupdeps();
1782
- });
1783
- }, "xyInstallCommands");
1784
-
1785
- // src/xy/xyLintCommands.ts
1786
- var import_chalk19 = __toESM(require("chalk"), 1);
1787
- var xyLintCommands = /* @__PURE__ */ __name((args) => {
1788
- return args.command("cycle [package]", "Cycle - Check for dependency cycles", (yargs2) => {
1789
- return packagePositionalParam(yargs2);
1790
- }, (argv) => {
1791
- const start = Date.now();
1792
- if (argv.verbose) console.log("Cycle");
1793
- process.exitCode = cycle();
1794
- console.log(import_chalk19.default.blue(`Finished in ${Date.now() - start}ms`));
1795
- }).command("lint [package]", "Lint - Run Eslint", (yargs2) => {
1796
- return packagePositionalParam(yargs2);
1797
- }, async (argv) => {
1798
- if (argv.verbose) console.log("Lint");
1799
- const start = Date.now();
1800
- process.exitCode = argv.fix ? fix() : argv.profile ? lintProfile() : await lint({
1801
- pkg: argv.package
1802
- });
1803
- console.log(import_chalk19.default.blue(`Finished in ${Date.now() - start}ms`));
1804
- }).command("fix [package]", "Fix - Run Eslint w/fix", (yargs2) => {
1805
- return packagePositionalParam(yargs2);
1806
- }, (argv) => {
1807
- const start = Date.now();
1808
- if (argv.verbose) console.log("Fix");
1809
- process.exitCode = fix();
1810
- console.log(import_chalk19.default.blue(`Finished in ${Date.now() - start}ms`));
1811
- }).command("relint [package]", "Relint - Clean & Lint", (yargs2) => {
1812
- return packagePositionalParam(yargs2);
1813
- }, (argv) => {
1814
- if (argv.verbose) console.log("Relinting");
1815
- const start = Date.now();
1816
- process.exitCode = relint();
1817
- console.log(import_chalk19.default.blue(`Finished in ${Date.now() - start}ms`));
1818
- }).command("publint [package]", "Publint - Run Publint", (yargs2) => {
1819
- return packagePositionalParam(yargs2);
1820
- }, async (argv) => {
1821
- if (argv.verbose) console.log("Publint");
1822
- const start = Date.now();
1823
- process.exitCode = await publint({
1824
- pkg: argv.package,
1825
- verbose: !!argv.verbose
1826
- });
1827
- console.log(import_chalk19.default.blue(`Finished in ${Date.now() - start}ms`));
1828
- }).command("sonar", "Sonar - Run Sonar Check", (yargs2) => {
1829
- return packagePositionalParam(yargs2);
1830
- }, (argv) => {
1831
- const start = Date.now();
1832
- if (argv.verbose) console.log("Sonar Check");
1833
- process.exitCode = sonar();
1834
- console.log(import_chalk19.default.blue(`Finished in ${Date.now() - start}ms`));
1835
- });
1836
- }, "xyLintCommands");
1837
-
1838
- // src/xy/xyParseOptions.ts
1839
- var import_yargs = __toESM(require("yargs"), 1);
1840
- var import_helpers = require("yargs/helpers");
1841
- var xyParseOptions = /* @__PURE__ */ __name(() => {
1842
- return (0, import_yargs.default)((0, import_helpers.hideBin)(process.argv)).scriptName("yarn xy").option("jobs", {
1843
- alias: "j",
1844
- default: void 0,
1845
- description: "Max parallel jobs",
1846
- type: "number"
1847
- }).option("verbose", {
1848
- alias: "v",
1849
- default: false,
1850
- description: "Run with verbose logging",
1851
- type: "boolean"
1852
- }).option("target", {
1853
- alias: "t",
1854
- choices: [
1855
- "esm",
1856
- "cjs"
1857
- ],
1858
- description: "Limit output to specific target",
1859
- type: "string"
1860
- }).option("incremental", {
1861
- alias: "i",
1862
- default: false,
1863
- description: "Attempt to perform the action only on changed packages",
1864
- type: "boolean"
1865
- }).option("fix", {
1866
- alias: "f",
1867
- default: false,
1868
- description: "Try to fix errors",
1869
- type: "boolean"
1870
- }).option("cache", {
1871
- alias: "c",
1872
- default: false,
1873
- description: "Use caching for performance",
1874
- type: "boolean"
1875
- }).option("profile", {
1876
- alias: "p",
1877
- default: false,
1878
- description: "Profile action",
1879
- type: "boolean"
1880
- });
1881
- }, "xyParseOptions");
1882
-
1883
- // src/xy/xy.ts
1884
- var xy = /* @__PURE__ */ __name(async () => {
1885
- const options = xyParseOptions();
1886
- return await xyBuildCommands(xyCommonCommands(xyInstallCommands(xyDeployCommands(xyLintCommands(options))))).demandCommand(1).command("*", "", () => {
1887
- console.error(import_chalk20.default.yellow(`Command not found [${import_chalk20.default.magenta(process.argv[2])}]`));
1888
- console.log(import_chalk20.default.gray("Try 'yarn xy --help' for list of commands"));
1889
- }).version().help().argv;
1890
- }, "xy");
1891
- // Annotate the CommonJS export names for ESM import in node:
1892
- 0 && (module.exports = {
1893
- xy
1894
- });
1895
- //# sourceMappingURL=xy.cjs.map