@xylabs/ts-scripts-yarn3 3.15.15 → 4.0.0-rc.10

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