@xylabs/toolchain 7.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (622) hide show
  1. package/dist/actions/analyze.mjs +140 -0
  2. package/dist/actions/analyze.mjs.map +1 -0
  3. package/dist/actions/build.mjs +173 -0
  4. package/dist/actions/build.mjs.map +1 -0
  5. package/dist/actions/claude-check.mjs +199 -0
  6. package/dist/actions/claude-check.mjs.map +1 -0
  7. package/dist/actions/claude-clean.mjs +70 -0
  8. package/dist/actions/claude-clean.mjs.map +1 -0
  9. package/dist/actions/claude-commands.mjs +126 -0
  10. package/dist/actions/claude-commands.mjs.map +1 -0
  11. package/dist/actions/claude-rules.mjs +151 -0
  12. package/dist/actions/claude-rules.mjs.map +1 -0
  13. package/dist/actions/claude-settings.mjs +99 -0
  14. package/dist/actions/claude-settings.mjs.map +1 -0
  15. package/dist/actions/claude-skills.mjs +131 -0
  16. package/dist/actions/claude-skills.mjs.map +1 -0
  17. package/dist/actions/clean-docs.mjs +66 -0
  18. package/dist/actions/clean-docs.mjs.map +1 -0
  19. package/dist/actions/clean-eslint.mjs +47 -0
  20. package/dist/actions/clean-eslint.mjs.map +1 -0
  21. package/dist/actions/clean.mjs +166 -0
  22. package/dist/actions/clean.mjs.map +1 -0
  23. package/dist/actions/compile.mjs +184 -0
  24. package/dist/actions/compile.mjs.map +1 -0
  25. package/dist/actions/copy-assets.mjs +81 -0
  26. package/dist/actions/copy-assets.mjs.map +1 -0
  27. package/dist/actions/cycle.mjs +275 -0
  28. package/dist/actions/cycle.mjs.map +1 -0
  29. package/dist/actions/dead.mjs +119 -0
  30. package/dist/actions/dead.mjs.map +1 -0
  31. package/dist/actions/deplint/checkPackage/checkPackage.mjs +1556 -0
  32. package/dist/actions/deplint/checkPackage/checkPackage.mjs.map +1 -0
  33. package/dist/actions/deplint/checkPackage/checkPackageTypes.mjs +1 -0
  34. package/dist/actions/deplint/checkPackage/checkPackageTypes.mjs.map +1 -0
  35. package/dist/actions/deplint/checkPackage/getMismatchedPeerDevVersions.mjs +77 -0
  36. package/dist/actions/deplint/checkPackage/getMismatchedPeerDevVersions.mjs.map +1 -0
  37. package/dist/actions/deplint/checkPackage/getUnlistedDependencies.mjs +158 -0
  38. package/dist/actions/deplint/checkPackage/getUnlistedDependencies.mjs.map +1 -0
  39. package/dist/actions/deplint/checkPackage/getUnlistedDevDependencies.mjs +125 -0
  40. package/dist/actions/deplint/checkPackage/getUnlistedDevDependencies.mjs.map +1 -0
  41. package/dist/actions/deplint/checkPackage/getUnnecessaryPeerDependencies.mjs +207 -0
  42. package/dist/actions/deplint/checkPackage/getUnnecessaryPeerDependencies.mjs.map +1 -0
  43. package/dist/actions/deplint/checkPackage/getUnsatisfiedPeerDependencies.mjs +318 -0
  44. package/dist/actions/deplint/checkPackage/getUnsatisfiedPeerDependencies.mjs.map +1 -0
  45. package/dist/actions/deplint/checkPackage/getUnusedDependencies.mjs +163 -0
  46. package/dist/actions/deplint/checkPackage/getUnusedDependencies.mjs.map +1 -0
  47. package/dist/actions/deplint/checkPackage/getUnusedDevDependencies.mjs +408 -0
  48. package/dist/actions/deplint/checkPackage/getUnusedDevDependencies.mjs.map +1 -0
  49. package/dist/actions/deplint/checkPackage/getUnusedPeerDependencies.mjs +75 -0
  50. package/dist/actions/deplint/checkPackage/getUnusedPeerDependencies.mjs.map +1 -0
  51. package/dist/actions/deplint/checkPackage/getWorkspaceVersionProblems.mjs +128 -0
  52. package/dist/actions/deplint/checkPackage/getWorkspaceVersionProblems.mjs.map +1 -0
  53. package/dist/actions/deplint/checkPackage/index.mjs +1609 -0
  54. package/dist/actions/deplint/checkPackage/index.mjs.map +1 -0
  55. package/dist/actions/deplint/deplint.mjs +1840 -0
  56. package/dist/actions/deplint/deplint.mjs.map +1 -0
  57. package/dist/actions/deplint/engine.mjs +1736 -0
  58. package/dist/actions/deplint/engine.mjs.map +1 -0
  59. package/dist/actions/deplint/findFiles.mjs +39 -0
  60. package/dist/actions/deplint/findFiles.mjs.map +1 -0
  61. package/dist/actions/deplint/findFilesByGlob.mjs +14 -0
  62. package/dist/actions/deplint/findFilesByGlob.mjs.map +1 -0
  63. package/dist/actions/deplint/fixer.mjs +103 -0
  64. package/dist/actions/deplint/fixer.mjs.map +1 -0
  65. package/dist/actions/deplint/getBasePackageName.mjs +13 -0
  66. package/dist/actions/deplint/getBasePackageName.mjs.map +1 -0
  67. package/dist/actions/deplint/getCliReferencedPackagesFromFiles.mjs +140 -0
  68. package/dist/actions/deplint/getCliReferencedPackagesFromFiles.mjs.map +1 -0
  69. package/dist/actions/deplint/getDependenciesFromPackageJson.mjs +29 -0
  70. package/dist/actions/deplint/getDependenciesFromPackageJson.mjs.map +1 -0
  71. package/dist/actions/deplint/getExtendsFromTsconfigs.mjs +68 -0
  72. package/dist/actions/deplint/getExtendsFromTsconfigs.mjs.map +1 -0
  73. package/dist/actions/deplint/getExternalImportsFromFiles.mjs +143 -0
  74. package/dist/actions/deplint/getExternalImportsFromFiles.mjs.map +1 -0
  75. package/dist/actions/deplint/getImportsFromFile.mjs +85 -0
  76. package/dist/actions/deplint/getImportsFromFile.mjs.map +1 -0
  77. package/dist/actions/deplint/getRequiredPeerDependencies.mjs +37 -0
  78. package/dist/actions/deplint/getRequiredPeerDependencies.mjs.map +1 -0
  79. package/dist/actions/deplint/getScriptReferencedPackages.mjs +83 -0
  80. package/dist/actions/deplint/getScriptReferencedPackages.mjs.map +1 -0
  81. package/dist/actions/deplint/implicitDevDependencies.mjs +116 -0
  82. package/dist/actions/deplint/implicitDevDependencies.mjs.map +1 -0
  83. package/dist/actions/deplint/index.mjs +1848 -0
  84. package/dist/actions/deplint/index.mjs.map +1 -0
  85. package/dist/actions/deplint/packageEditor.mjs +82 -0
  86. package/dist/actions/deplint/packageEditor.mjs.map +1 -0
  87. package/dist/actions/deplint/packageJsonEditor.mjs +101 -0
  88. package/dist/actions/deplint/packageJsonEditor.mjs.map +1 -0
  89. package/dist/actions/deplint/reporters.mjs +36 -0
  90. package/dist/actions/deplint/reporters.mjs.map +1 -0
  91. package/dist/actions/deplint/rules.mjs +1223 -0
  92. package/dist/actions/deplint/rules.mjs.map +1 -0
  93. package/dist/actions/deplint/snapshot.mjs +372 -0
  94. package/dist/actions/deplint/snapshot.mjs.map +1 -0
  95. package/dist/actions/deplint/tsScriptsAliases.mjs +20 -0
  96. package/dist/actions/deplint/tsScriptsAliases.mjs.map +1 -0
  97. package/dist/actions/deplint/types.mjs +1 -0
  98. package/dist/actions/deplint/types.mjs.map +1 -0
  99. package/dist/actions/deploy.mjs +194 -0
  100. package/dist/actions/deploy.mjs.map +1 -0
  101. package/dist/actions/dupdeps.mjs +226 -0
  102. package/dist/actions/dupdeps.mjs.map +1 -0
  103. package/dist/actions/eject.mjs +142 -0
  104. package/dist/actions/eject.mjs.map +1 -0
  105. package/dist/actions/fix.mjs +359 -0
  106. package/dist/actions/fix.mjs.map +1 -0
  107. package/dist/actions/gen-docs.mjs +155 -0
  108. package/dist/actions/gen-docs.mjs.map +1 -0
  109. package/dist/actions/gitignore.mjs +159 -0
  110. package/dist/actions/gitignore.mjs.map +1 -0
  111. package/dist/actions/gitlint-fix.mjs +27 -0
  112. package/dist/actions/gitlint-fix.mjs.map +1 -0
  113. package/dist/actions/gitlint.mjs +48 -0
  114. package/dist/actions/gitlint.mjs.map +1 -0
  115. package/dist/actions/index.mjs +8259 -0
  116. package/dist/actions/index.mjs.map +1 -0
  117. package/dist/actions/knip.mjs +119 -0
  118. package/dist/actions/knip.mjs.map +1 -0
  119. package/dist/actions/license.mjs +92 -0
  120. package/dist/actions/license.mjs.map +1 -0
  121. package/dist/actions/lint-init.mjs +275 -0
  122. package/dist/actions/lint-init.mjs.map +1 -0
  123. package/dist/actions/lint.mjs +356 -0
  124. package/dist/actions/lint.mjs.map +1 -0
  125. package/dist/actions/lintNext.mjs +209 -0
  126. package/dist/actions/lintNext.mjs.map +1 -0
  127. package/dist/actions/lintlint.mjs +341 -0
  128. package/dist/actions/lintlint.mjs.map +1 -0
  129. package/dist/actions/npmignore-gen.mjs +90 -0
  130. package/dist/actions/npmignore-gen.mjs.map +1 -0
  131. package/dist/actions/orphan.mjs +110 -0
  132. package/dist/actions/orphan.mjs.map +1 -0
  133. package/dist/actions/package/clean-outputs.mjs +50 -0
  134. package/dist/actions/package/clean-outputs.mjs.map +1 -0
  135. package/dist/actions/package/clean-typescript.mjs +50 -0
  136. package/dist/actions/package/clean-typescript.mjs.map +1 -0
  137. package/dist/actions/package/clean.mjs +69 -0
  138. package/dist/actions/package/clean.mjs.map +1 -0
  139. package/dist/actions/package/compile/XyConfig.mjs +32 -0
  140. package/dist/actions/package/compile/XyConfig.mjs.map +1 -0
  141. package/dist/actions/package/compile/buildEntries.mjs +53 -0
  142. package/dist/actions/package/compile/buildEntries.mjs.map +1 -0
  143. package/dist/actions/package/compile/compile.mjs +439 -0
  144. package/dist/actions/package/compile/compile.mjs.map +1 -0
  145. package/dist/actions/package/compile/copyTypeFiles.mjs +34 -0
  146. package/dist/actions/package/compile/copyTypeFiles.mjs.map +1 -0
  147. package/dist/actions/package/compile/deepMerge.mjs +27 -0
  148. package/dist/actions/package/compile/deepMerge.mjs.map +1 -0
  149. package/dist/actions/package/compile/getCompilerOptions.mjs +12 -0
  150. package/dist/actions/package/compile/getCompilerOptions.mjs.map +1 -0
  151. package/dist/actions/package/compile/index.mjs +472 -0
  152. package/dist/actions/package/compile/index.mjs.map +1 -0
  153. package/dist/actions/package/compile/inputs.mjs +22 -0
  154. package/dist/actions/package/compile/inputs.mjs.map +1 -0
  155. package/dist/actions/package/compile/packageCompileTsc.mjs +93 -0
  156. package/dist/actions/package/compile/packageCompileTsc.mjs.map +1 -0
  157. package/dist/actions/package/compile/packageCompileTscTypes.mjs +92 -0
  158. package/dist/actions/package/compile/packageCompileTscTypes.mjs.map +1 -0
  159. package/dist/actions/package/compile/packageCompileTsup.mjs +402 -0
  160. package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -0
  161. package/dist/actions/package/copy-assets.mjs +69 -0
  162. package/dist/actions/package/copy-assets.mjs.map +1 -0
  163. package/dist/actions/package/cycle.mjs +62 -0
  164. package/dist/actions/package/cycle.mjs.map +1 -0
  165. package/dist/actions/package/gen-docs.mjs +137 -0
  166. package/dist/actions/package/gen-docs.mjs.map +1 -0
  167. package/dist/actions/package/index.mjs +1131 -0
  168. package/dist/actions/package/index.mjs.map +1 -0
  169. package/dist/actions/package/lint.mjs +87 -0
  170. package/dist/actions/package/lint.mjs.map +1 -0
  171. package/dist/actions/package/publint.mjs +336 -0
  172. package/dist/actions/package/publint.mjs.map +1 -0
  173. package/dist/actions/package/recompile.mjs +510 -0
  174. package/dist/actions/package/recompile.mjs.map +1 -0
  175. package/dist/actions/package-lint-deps.mjs +348 -0
  176. package/dist/actions/package-lint-deps.mjs.map +1 -0
  177. package/dist/actions/package-lint.mjs +774 -0
  178. package/dist/actions/package-lint.mjs.map +1 -0
  179. package/dist/actions/packman/clean.mjs +144 -0
  180. package/dist/actions/packman/clean.mjs.map +1 -0
  181. package/dist/actions/packman/convert.mjs +1331 -0
  182. package/dist/actions/packman/convert.mjs.map +1 -0
  183. package/dist/actions/packman/convertToPnpm.mjs +295 -0
  184. package/dist/actions/packman/convertToPnpm.mjs.map +1 -0
  185. package/dist/actions/packman/convertToYarn.mjs +307 -0
  186. package/dist/actions/packman/convertToYarn.mjs.map +1 -0
  187. package/dist/actions/packman/index.mjs +1493 -0
  188. package/dist/actions/packman/index.mjs.map +1 -0
  189. package/dist/actions/packman/lint.mjs +109 -0
  190. package/dist/actions/packman/lint.mjs.map +1 -0
  191. package/dist/actions/packman/rewriteScripts.mjs +52 -0
  192. package/dist/actions/packman/rewriteScripts.mjs.map +1 -0
  193. package/dist/actions/packman/rewriteSourceImports.mjs +60 -0
  194. package/dist/actions/packman/rewriteSourceImports.mjs.map +1 -0
  195. package/dist/actions/packman/swapTsScriptsDependency.mjs +57 -0
  196. package/dist/actions/packman/swapTsScriptsDependency.mjs.map +1 -0
  197. package/dist/actions/publint.mjs +748 -0
  198. package/dist/actions/publint.mjs.map +1 -0
  199. package/dist/actions/publish.mjs +208 -0
  200. package/dist/actions/publish.mjs.map +1 -0
  201. package/dist/actions/reactTest.mjs +142 -0
  202. package/dist/actions/reactTest.mjs.map +1 -0
  203. package/dist/actions/readme-gen.mjs +362 -0
  204. package/dist/actions/readme-gen.mjs.map +1 -0
  205. package/dist/actions/readme-init.mjs +89 -0
  206. package/dist/actions/readme-init.mjs.map +1 -0
  207. package/dist/actions/readme-lint.mjs +147 -0
  208. package/dist/actions/readme-lint.mjs.map +1 -0
  209. package/dist/actions/rebuild.mjs +143 -0
  210. package/dist/actions/rebuild.mjs.map +1 -0
  211. package/dist/actions/recompile.mjs +196 -0
  212. package/dist/actions/recompile.mjs.map +1 -0
  213. package/dist/actions/reinstall.mjs +283 -0
  214. package/dist/actions/reinstall.mjs.map +1 -0
  215. package/dist/actions/relint.mjs +355 -0
  216. package/dist/actions/relint.mjs.map +1 -0
  217. package/dist/actions/repo-init.mjs +217 -0
  218. package/dist/actions/repo-init.mjs.map +1 -0
  219. package/dist/actions/retest.mjs +150 -0
  220. package/dist/actions/retest.mjs.map +1 -0
  221. package/dist/actions/sitemap.mjs +121 -0
  222. package/dist/actions/sitemap.mjs.map +1 -0
  223. package/dist/actions/sonar.mjs +119 -0
  224. package/dist/actions/sonar.mjs.map +1 -0
  225. package/dist/actions/start.mjs +142 -0
  226. package/dist/actions/start.mjs.map +1 -0
  227. package/dist/actions/statics.mjs +225 -0
  228. package/dist/actions/statics.mjs.map +1 -0
  229. package/dist/actions/test.mjs +144 -0
  230. package/dist/actions/test.mjs.map +1 -0
  231. package/dist/actions/up.mjs +140 -0
  232. package/dist/actions/up.mjs.map +1 -0
  233. package/dist/actions/updo.mjs +533 -0
  234. package/dist/actions/updo.mjs.map +1 -0
  235. package/dist/actions/upplug.mjs +124 -0
  236. package/dist/actions/upplug.mjs.map +1 -0
  237. package/dist/actions/upyarn.mjs +119 -0
  238. package/dist/actions/upyarn.mjs.map +1 -0
  239. package/dist/actions/yarn3only.mjs +60 -0
  240. package/dist/actions/yarn3only.mjs.map +1 -0
  241. package/dist/bin/package/build-only.mjs +451 -0
  242. package/dist/bin/package/build-only.mjs.map +1 -0
  243. package/dist/bin/package/build.mjs +451 -0
  244. package/dist/bin/package/build.mjs.map +1 -0
  245. package/dist/bin/package/clean-outputs.mjs +50 -0
  246. package/dist/bin/package/clean-outputs.mjs.map +1 -0
  247. package/dist/bin/package/clean-typescript.mjs +50 -0
  248. package/dist/bin/package/clean-typescript.mjs.map +1 -0
  249. package/dist/bin/package/clean.mjs +75 -0
  250. package/dist/bin/package/clean.mjs.map +1 -0
  251. package/dist/bin/package/compile-only.mjs +447 -0
  252. package/dist/bin/package/compile-only.mjs.map +1 -0
  253. package/dist/bin/package/compile-tsup.mjs +409 -0
  254. package/dist/bin/package/compile-tsup.mjs.map +1 -0
  255. package/dist/bin/package/compile.mjs +451 -0
  256. package/dist/bin/package/compile.mjs.map +1 -0
  257. package/dist/bin/package/copy-assets-cjs.mjs +75 -0
  258. package/dist/bin/package/copy-assets-cjs.mjs.map +1 -0
  259. package/dist/bin/package/copy-assets-esm.mjs +75 -0
  260. package/dist/bin/package/copy-assets-esm.mjs.map +1 -0
  261. package/dist/bin/package/cycle.mjs +72 -0
  262. package/dist/bin/package/cycle.mjs.map +1 -0
  263. package/dist/bin/package/fix.mjs +97 -0
  264. package/dist/bin/package/fix.mjs.map +1 -0
  265. package/dist/bin/package/gen-docs.mjs +142 -0
  266. package/dist/bin/package/gen-docs.mjs.map +1 -0
  267. package/dist/bin/package/lint-verbose.mjs +97 -0
  268. package/dist/bin/package/lint-verbose.mjs.map +1 -0
  269. package/dist/bin/package/lint.mjs +97 -0
  270. package/dist/bin/package/lint.mjs.map +1 -0
  271. package/dist/bin/package/publint.mjs +423 -0
  272. package/dist/bin/package/publint.mjs.map +1 -0
  273. package/dist/bin/package/recompile.mjs +516 -0
  274. package/dist/bin/package/recompile.mjs.map +1 -0
  275. package/dist/bin/package/relint.mjs +97 -0
  276. package/dist/bin/package/relint.mjs.map +1 -0
  277. package/dist/bin/run-or-exec.mjs +20 -0
  278. package/dist/bin/run-or-exec.mjs.map +1 -0
  279. package/dist/bin/xy.mjs +8885 -0
  280. package/dist/bin/xy.mjs.map +1 -0
  281. package/dist/index.d.ts +1102 -0
  282. package/dist/index.mjs +9986 -0
  283. package/dist/index.mjs.map +1 -0
  284. package/dist/lib/checkResult.mjs +16 -0
  285. package/dist/lib/checkResult.mjs.map +1 -0
  286. package/dist/lib/claudeMdTemplate.mjs +69 -0
  287. package/dist/lib/claudeMdTemplate.mjs.map +1 -0
  288. package/dist/lib/concurrency.mjs +38 -0
  289. package/dist/lib/concurrency.mjs.map +1 -0
  290. package/dist/lib/createBuildConfig.mjs +55 -0
  291. package/dist/lib/createBuildConfig.mjs.map +1 -0
  292. package/dist/lib/defaultBuildConfig.mjs +23 -0
  293. package/dist/lib/defaultBuildConfig.mjs.map +1 -0
  294. package/dist/lib/deleteGlob.mjs +13 -0
  295. package/dist/lib/deleteGlob.mjs.map +1 -0
  296. package/dist/lib/dependencies/DuplicateDetector.mjs +99 -0
  297. package/dist/lib/dependencies/DuplicateDetector.mjs.map +1 -0
  298. package/dist/lib/dependencies/detectDuplicateDependencies.mjs +203 -0
  299. package/dist/lib/dependencies/detectDuplicateDependencies.mjs.map +1 -0
  300. package/dist/lib/dependencies/index.mjs +281 -0
  301. package/dist/lib/dependencies/index.mjs.map +1 -0
  302. package/dist/lib/dependencies/workspaceCycles.mjs +79 -0
  303. package/dist/lib/dependencies/workspaceCycles.mjs.map +1 -0
  304. package/dist/lib/file/ReadFileSyncOptions.mjs +6 -0
  305. package/dist/lib/file/ReadFileSyncOptions.mjs.map +1 -0
  306. package/dist/lib/file/constants.mjs +8 -0
  307. package/dist/lib/file/constants.mjs.map +1 -0
  308. package/dist/lib/file/fileLines.mjs +32 -0
  309. package/dist/lib/file/fileLines.mjs.map +1 -0
  310. package/dist/lib/file/index.mjs +42 -0
  311. package/dist/lib/file/index.mjs.map +1 -0
  312. package/dist/lib/file/tryReadFileSync.mjs +14 -0
  313. package/dist/lib/file/tryReadFileSync.mjs.map +1 -0
  314. package/dist/lib/fillTemplate.mjs +8 -0
  315. package/dist/lib/fillTemplate.mjs.map +1 -0
  316. package/dist/lib/generateIgnoreFiles.mjs +86 -0
  317. package/dist/lib/generateIgnoreFiles.mjs.map +1 -0
  318. package/dist/lib/generateReadmeFiles.mjs +323 -0
  319. package/dist/lib/generateReadmeFiles.mjs.map +1 -0
  320. package/dist/lib/gitignoreTemplate.mjs +12 -0
  321. package/dist/lib/gitignoreTemplate.mjs.map +1 -0
  322. package/dist/lib/index.mjs +1627 -0
  323. package/dist/lib/index.mjs.map +1 -0
  324. package/dist/lib/initCwd.mjs +8 -0
  325. package/dist/lib/initCwd.mjs.map +1 -0
  326. package/dist/lib/jsonFormatters.mjs +11 -0
  327. package/dist/lib/jsonFormatters.mjs.map +1 -0
  328. package/dist/lib/latestVersions.mjs +12 -0
  329. package/dist/lib/latestVersions.mjs.map +1 -0
  330. package/dist/lib/loadConfig.mjs +72 -0
  331. package/dist/lib/loadConfig.mjs.map +1 -0
  332. package/dist/lib/packageName.mjs +26 -0
  333. package/dist/lib/packageName.mjs.map +1 -0
  334. package/dist/lib/parsedPackageJSON.mjs +11 -0
  335. package/dist/lib/parsedPackageJSON.mjs.map +1 -0
  336. package/dist/lib/processEx.mjs +36 -0
  337. package/dist/lib/processEx.mjs.map +1 -0
  338. package/dist/lib/repoTemplates.mjs +34 -0
  339. package/dist/lib/repoTemplates.mjs.map +1 -0
  340. package/dist/lib/runInstall.mjs +30 -0
  341. package/dist/lib/runInstall.mjs.map +1 -0
  342. package/dist/lib/runSteps.mjs +118 -0
  343. package/dist/lib/runSteps.mjs.map +1 -0
  344. package/dist/lib/runStepsAsync.mjs +136 -0
  345. package/dist/lib/runStepsAsync.mjs.map +1 -0
  346. package/dist/lib/runXy.mjs +147 -0
  347. package/dist/lib/runXy.mjs.map +1 -0
  348. package/dist/lib/runXyWithWarning.mjs +36 -0
  349. package/dist/lib/runXyWithWarning.mjs.map +1 -0
  350. package/dist/lib/safeExit.mjs +61 -0
  351. package/dist/lib/safeExit.mjs.map +1 -0
  352. package/dist/lib/string/empty.mjs +8 -0
  353. package/dist/lib/string/empty.mjs.map +1 -0
  354. package/dist/lib/string/index.mjs +12 -0
  355. package/dist/lib/string/index.mjs.map +1 -0
  356. package/dist/lib/string/union.mjs +6 -0
  357. package/dist/lib/string/union.mjs.map +1 -0
  358. package/dist/lib/tryRunLocalScript.mjs +57 -0
  359. package/dist/lib/tryRunLocalScript.mjs.map +1 -0
  360. package/dist/lib/updo/applyUpdates.mjs +44 -0
  361. package/dist/lib/updo/applyUpdates.mjs.map +1 -0
  362. package/dist/lib/updo/collectWorkspaceDeps.mjs +48 -0
  363. package/dist/lib/updo/collectWorkspaceDeps.mjs.map +1 -0
  364. package/dist/lib/updo/fetchRegistryInfo.mjs +53 -0
  365. package/dist/lib/updo/fetchRegistryInfo.mjs.map +1 -0
  366. package/dist/lib/updo/index.mjs +594 -0
  367. package/dist/lib/updo/index.mjs.map +1 -0
  368. package/dist/lib/updo/interactiveSelect.mjs +185 -0
  369. package/dist/lib/updo/interactiveSelect.mjs.map +1 -0
  370. package/dist/lib/updo/interfaces.mjs +1 -0
  371. package/dist/lib/updo/interfaces.mjs.map +1 -0
  372. package/dist/lib/updo/renderTable.mjs +79 -0
  373. package/dist/lib/updo/renderTable.mjs.map +1 -0
  374. package/dist/lib/updo/resolveVersions.mjs +49 -0
  375. package/dist/lib/updo/resolveVersions.mjs.map +1 -0
  376. package/dist/lib/updo/runUpdo.mjs +511 -0
  377. package/dist/lib/updo/runUpdo.mjs.map +1 -0
  378. package/dist/lib/withErrnoException.mjs +13 -0
  379. package/dist/lib/withErrnoException.mjs.map +1 -0
  380. package/dist/lib/withError.mjs +8 -0
  381. package/dist/lib/withError.mjs.map +1 -0
  382. package/dist/lib/yarn/index.mjs +39 -0
  383. package/dist/lib/yarn/index.mjs.map +1 -0
  384. package/dist/lib/yarn/isYarnVersionOrGreater.mjs +18 -0
  385. package/dist/lib/yarn/isYarnVersionOrGreater.mjs.map +1 -0
  386. package/dist/lib/yarn/workspace/Workspace.mjs +1 -0
  387. package/dist/lib/yarn/workspace/Workspace.mjs.map +1 -0
  388. package/dist/lib/yarn/workspace/index.mjs +23 -0
  389. package/dist/lib/yarn/workspace/index.mjs.map +1 -0
  390. package/dist/lib/yarn/workspace/yarnWorkspace.mjs +22 -0
  391. package/dist/lib/yarn/workspace/yarnWorkspace.mjs.map +1 -0
  392. package/dist/lib/yarn/workspace/yarnWorkspaces.mjs +15 -0
  393. package/dist/lib/yarn/workspace/yarnWorkspaces.mjs.map +1 -0
  394. package/dist/lib/yarn/yarnInitCwd.mjs +8 -0
  395. package/dist/lib/yarn/yarnInitCwd.mjs.map +1 -0
  396. package/dist/loadPackageConfig.mjs +18 -0
  397. package/dist/loadPackageConfig.mjs.map +1 -0
  398. package/dist/pm/PackageManager.mjs +1 -0
  399. package/dist/pm/PackageManager.mjs.map +1 -0
  400. package/dist/pm/detectPackageManager.mjs +10 -0
  401. package/dist/pm/detectPackageManager.mjs.map +1 -0
  402. package/dist/pm/detectReact.mjs +52 -0
  403. package/dist/pm/detectReact.mjs.map +1 -0
  404. package/dist/pm/index.mjs +263 -0
  405. package/dist/pm/index.mjs.map +1 -0
  406. package/dist/pm/pnpmPackageManager.mjs +97 -0
  407. package/dist/pm/pnpmPackageManager.mjs.map +1 -0
  408. package/dist/pm/registry.mjs +27 -0
  409. package/dist/pm/registry.mjs.map +1 -0
  410. package/dist/pm/yarnPackageManager.mjs +112 -0
  411. package/dist/pm/yarnPackageManager.mjs.map +1 -0
  412. package/dist/types.d.mjs +1 -0
  413. package/dist/types.d.mjs.map +1 -0
  414. package/dist/xy/build/buildCommand.mjs +194 -0
  415. package/dist/xy/build/buildCommand.mjs.map +1 -0
  416. package/dist/xy/build/compileCommand.mjs +203 -0
  417. package/dist/xy/build/compileCommand.mjs.map +1 -0
  418. package/dist/xy/build/compileOnlyCommand.mjs +204 -0
  419. package/dist/xy/build/compileOnlyCommand.mjs.map +1 -0
  420. package/dist/xy/build/copyAssetsCommand.mjs +92 -0
  421. package/dist/xy/build/copyAssetsCommand.mjs.map +1 -0
  422. package/dist/xy/build/index.mjs +487 -0
  423. package/dist/xy/build/index.mjs.map +1 -0
  424. package/dist/xy/build/rebuildCommand.mjs +156 -0
  425. package/dist/xy/build/rebuildCommand.mjs.map +1 -0
  426. package/dist/xy/build/recompileCommand.mjs +215 -0
  427. package/dist/xy/build/recompileCommand.mjs.map +1 -0
  428. package/dist/xy/common/checkCommand.mjs +1909 -0
  429. package/dist/xy/common/checkCommand.mjs.map +1 -0
  430. package/dist/xy/common/claude/checkCommand.mjs +207 -0
  431. package/dist/xy/common/claude/checkCommand.mjs.map +1 -0
  432. package/dist/xy/common/claude/cleanCommand.mjs +78 -0
  433. package/dist/xy/common/claude/cleanCommand.mjs.map +1 -0
  434. package/dist/xy/common/claude/commandsCommand.mjs +134 -0
  435. package/dist/xy/common/claude/commandsCommand.mjs.map +1 -0
  436. package/dist/xy/common/claude/index.mjs +734 -0
  437. package/dist/xy/common/claude/index.mjs.map +1 -0
  438. package/dist/xy/common/claude/initCommand.mjs +458 -0
  439. package/dist/xy/common/claude/initCommand.mjs.map +1 -0
  440. package/dist/xy/common/claude/rulesCommand.mjs +167 -0
  441. package/dist/xy/common/claude/rulesCommand.mjs.map +1 -0
  442. package/dist/xy/common/claude/settingsCommand.mjs +115 -0
  443. package/dist/xy/common/claude/settingsCommand.mjs.map +1 -0
  444. package/dist/xy/common/claude/skillsCommand.mjs +140 -0
  445. package/dist/xy/common/claude/skillsCommand.mjs.map +1 -0
  446. package/dist/xy/common/cleanDocsCommand.mjs +74 -0
  447. package/dist/xy/common/cleanDocsCommand.mjs.map +1 -0
  448. package/dist/xy/common/deadCommand.mjs +137 -0
  449. package/dist/xy/common/deadCommand.mjs.map +1 -0
  450. package/dist/xy/common/genDocsCommand.mjs +175 -0
  451. package/dist/xy/common/genDocsCommand.mjs.map +1 -0
  452. package/dist/xy/common/gitignoreCommand.mjs +165 -0
  453. package/dist/xy/common/gitignoreCommand.mjs.map +1 -0
  454. package/dist/xy/common/gitlintCommand.mjs +89 -0
  455. package/dist/xy/common/gitlintCommand.mjs.map +1 -0
  456. package/dist/xy/common/index.mjs +4654 -0
  457. package/dist/xy/common/index.mjs.map +1 -0
  458. package/dist/xy/common/licenseCommand.mjs +108 -0
  459. package/dist/xy/common/licenseCommand.mjs.map +1 -0
  460. package/dist/xy/common/npmignoreGenCommand.mjs +100 -0
  461. package/dist/xy/common/npmignoreGenCommand.mjs.map +1 -0
  462. package/dist/xy/common/orphan/cleanCommand.mjs +102 -0
  463. package/dist/xy/common/orphan/cleanCommand.mjs.map +1 -0
  464. package/dist/xy/common/orphan/index.mjs +138 -0
  465. package/dist/xy/common/orphan/index.mjs.map +1 -0
  466. package/dist/xy/common/orphan/listCommand.mjs +100 -0
  467. package/dist/xy/common/orphan/listCommand.mjs.map +1 -0
  468. package/dist/xy/common/packmanCommand.mjs +1538 -0
  469. package/dist/xy/common/packmanCommand.mjs.map +1 -0
  470. package/dist/xy/common/readme/genCommand.mjs +395 -0
  471. package/dist/xy/common/readme/genCommand.mjs.map +1 -0
  472. package/dist/xy/common/readme/index.mjs +538 -0
  473. package/dist/xy/common/readme/index.mjs.map +1 -0
  474. package/dist/xy/common/readme/initCommand.mjs +109 -0
  475. package/dist/xy/common/readme/initCommand.mjs.map +1 -0
  476. package/dist/xy/common/readme/lintCommand.mjs +181 -0
  477. package/dist/xy/common/readme/lintCommand.mjs.map +1 -0
  478. package/dist/xy/common/repo/index.mjs +1070 -0
  479. package/dist/xy/common/repo/index.mjs.map +1 -0
  480. package/dist/xy/common/repo/initCommand.mjs +273 -0
  481. package/dist/xy/common/repo/initCommand.mjs.map +1 -0
  482. package/dist/xy/common/repo/lintCommand.mjs +789 -0
  483. package/dist/xy/common/repo/lintCommand.mjs.map +1 -0
  484. package/dist/xy/common/retestCommand.mjs +163 -0
  485. package/dist/xy/common/retestCommand.mjs.map +1 -0
  486. package/dist/xy/common/testCommand.mjs +157 -0
  487. package/dist/xy/common/testCommand.mjs.map +1 -0
  488. package/dist/xy/deploy/deployCommand.mjs +214 -0
  489. package/dist/xy/deploy/deployCommand.mjs.map +1 -0
  490. package/dist/xy/deploy/index.mjs +289 -0
  491. package/dist/xy/deploy/index.mjs.map +1 -0
  492. package/dist/xy/deploy/publishCommand.mjs +218 -0
  493. package/dist/xy/deploy/publishCommand.mjs.map +1 -0
  494. package/dist/xy/index.mjs +8887 -0
  495. package/dist/xy/index.mjs.map +1 -0
  496. package/dist/xy/install/cleanCommand.mjs +182 -0
  497. package/dist/xy/install/cleanCommand.mjs.map +1 -0
  498. package/dist/xy/install/dupdepsCommand.mjs +234 -0
  499. package/dist/xy/install/dupdepsCommand.mjs.map +1 -0
  500. package/dist/xy/install/index.mjs +1006 -0
  501. package/dist/xy/install/index.mjs.map +1 -0
  502. package/dist/xy/install/reinstallCommand.mjs +292 -0
  503. package/dist/xy/install/reinstallCommand.mjs.map +1 -0
  504. package/dist/xy/install/staticsCommand.mjs +233 -0
  505. package/dist/xy/install/staticsCommand.mjs.map +1 -0
  506. package/dist/xy/install/upCommand.mjs +150 -0
  507. package/dist/xy/install/upCommand.mjs.map +1 -0
  508. package/dist/xy/install/updoCommand.mjs +550 -0
  509. package/dist/xy/install/updoCommand.mjs.map +1 -0
  510. package/dist/xy/lint/cycleCommand.mjs +289 -0
  511. package/dist/xy/lint/cycleCommand.mjs.map +1 -0
  512. package/dist/xy/lint/deplintCommand.mjs +1897 -0
  513. package/dist/xy/lint/deplintCommand.mjs.map +1 -0
  514. package/dist/xy/lint/fixCommand.mjs +398 -0
  515. package/dist/xy/lint/fixCommand.mjs.map +1 -0
  516. package/dist/xy/lint/index.mjs +3759 -0
  517. package/dist/xy/lint/index.mjs.map +1 -0
  518. package/dist/xy/lint/knipCommand.mjs +142 -0
  519. package/dist/xy/lint/knipCommand.mjs.map +1 -0
  520. package/dist/xy/lint/lint/index.mjs +695 -0
  521. package/dist/xy/lint/lint/index.mjs.map +1 -0
  522. package/dist/xy/lint/lint/initCommand.mjs +282 -0
  523. package/dist/xy/lint/lint/initCommand.mjs.map +1 -0
  524. package/dist/xy/lint/lint/runCommand.mjs +405 -0
  525. package/dist/xy/lint/lint/runCommand.mjs.map +1 -0
  526. package/dist/xy/lint/lintCommand.mjs +695 -0
  527. package/dist/xy/lint/lintCommand.mjs.map +1 -0
  528. package/dist/xy/lint/lintlintCommand.mjs +359 -0
  529. package/dist/xy/lint/lintlintCommand.mjs.map +1 -0
  530. package/dist/xy/lint/publintCommand.mjs +778 -0
  531. package/dist/xy/lint/publintCommand.mjs.map +1 -0
  532. package/dist/xy/lint/relintCommand.mjs +381 -0
  533. package/dist/xy/lint/relintCommand.mjs.map +1 -0
  534. package/dist/xy/lint/sonarCommand.mjs +137 -0
  535. package/dist/xy/lint/sonarCommand.mjs.map +1 -0
  536. package/dist/xy/param.mjs +8 -0
  537. package/dist/xy/param.mjs.map +1 -0
  538. package/dist/xy/react/analyzeCommand.mjs +150 -0
  539. package/dist/xy/react/analyzeCommand.mjs.map +1 -0
  540. package/dist/xy/react/ejectCommand.mjs +150 -0
  541. package/dist/xy/react/ejectCommand.mjs.map +1 -0
  542. package/dist/xy/react/index.mjs +202 -0
  543. package/dist/xy/react/index.mjs.map +1 -0
  544. package/dist/xy/react/sitemapCommand.mjs +129 -0
  545. package/dist/xy/react/sitemapCommand.mjs.map +1 -0
  546. package/dist/xy/react/startCommand.mjs +150 -0
  547. package/dist/xy/react/startCommand.mjs.map +1 -0
  548. package/dist/xy/xy.mjs +8879 -0
  549. package/dist/xy/xy.mjs.map +1 -0
  550. package/dist/xy/xyParseOptions.mjs +117 -0
  551. package/dist/xy/xyParseOptions.mjs.map +1 -0
  552. package/dist/xy/yarn/index.mjs +188 -0
  553. package/dist/xy/yarn/index.mjs.map +1 -0
  554. package/dist/xy/yarn/upplugCommand.mjs +134 -0
  555. package/dist/xy/yarn/upplugCommand.mjs.map +1 -0
  556. package/dist/xy/yarn/upyarnCommand.mjs +129 -0
  557. package/dist/xy/yarn/upyarnCommand.mjs.map +1 -0
  558. package/dist/xy/yarn/yarn3OnlyCommand.mjs +70 -0
  559. package/dist/xy/yarn/yarn3OnlyCommand.mjs.map +1 -0
  560. package/package.json +119 -0
  561. package/templates/claude/CLAUDE-local.md +4 -0
  562. package/templates/claude/CLAUDE-project.md +4 -0
  563. package/templates/claude/commands/xy-build.md +7 -0
  564. package/templates/claude/commands/xy-clean.md +7 -0
  565. package/templates/claude/commands/xy-compile.md +7 -0
  566. package/templates/claude/commands/xy-cycle.md +7 -0
  567. package/templates/claude/commands/xy-dead.md +7 -0
  568. package/templates/claude/commands/xy-deplint.md +7 -0
  569. package/templates/claude/commands/xy-deps.md +24 -0
  570. package/templates/claude/commands/xy-dupdeps.md +7 -0
  571. package/templates/claude/commands/xy-fix.md +7 -0
  572. package/templates/claude/commands/xy-gen-docs.md +7 -0
  573. package/templates/claude/commands/xy-gitignore.md +7 -0
  574. package/templates/claude/commands/xy-gitlint.md +7 -0
  575. package/templates/claude/commands/xy-knip.md +7 -0
  576. package/templates/claude/commands/xy-license.md +7 -0
  577. package/templates/claude/commands/xy-lint-rules.md +44 -0
  578. package/templates/claude/commands/xy-lint.md +7 -0
  579. package/templates/claude/commands/xy-publint.md +7 -0
  580. package/templates/claude/commands/xy-rebuild.md +7 -0
  581. package/templates/claude/commands/xy-recompile.md +7 -0
  582. package/templates/claude/commands/xy-reinstall.md +7 -0
  583. package/templates/claude/commands/xy-relint.md +7 -0
  584. package/templates/claude/commands/xy-retest.md +7 -0
  585. package/templates/claude/commands/xy-sonar.md +7 -0
  586. package/templates/claude/commands/xy-test.md +7 -0
  587. package/templates/claude/commands/xy-up.md +9 -0
  588. package/templates/claude/rules/xylabs-architecture.md +8 -0
  589. package/templates/claude/rules/xylabs-git-workflow.md +7 -0
  590. package/templates/claude/rules/xylabs-naming.md +7 -0
  591. package/templates/claude/rules/xylabs-style.md +17 -0
  592. package/templates/claude/skills/xylabs-e2e-setup/SKILL.md +223 -0
  593. package/templates/claude/skills/xylabs-xy-cli/SKILL.md +236 -0
  594. package/templates/claude/skills/xylabs-xy-deplint-fix/SKILL.md +122 -0
  595. package/templates/gitignore/gitignore/template.gitignore +51 -0
  596. package/templates/gitignore/template.gitignore +51 -0
  597. package/templates/readme/README.body.md +25 -0
  598. package/templates/readme/README.template.md +22 -0
  599. package/templates/repo/cli/package/package.json.tmpl +63 -0
  600. package/templates/repo/cli/package/src/__packageName__.ts.tmpl +21 -0
  601. package/templates/repo/cli/package/src/actions/index.ts +1 -0
  602. package/templates/repo/cli/package/src/actions/printVersion.ts.tmpl +8 -0
  603. package/templates/repo/cli/package/src/bin/__packageName__.ts.tmpl +12 -0
  604. package/templates/repo/cli/package/src/commands/index.ts +1 -0
  605. package/templates/repo/cli/package/src/commands/versionCommand.ts.tmpl +11 -0
  606. package/templates/repo/cli/package/src/index.ts.tmpl +1 -0
  607. package/templates/repo/cli/package/tsconfig.build.json +25 -0
  608. package/templates/repo/cli/package/tsconfig.json +4 -0
  609. package/templates/repo/cli/package/tsup.config.ts +15 -0
  610. package/templates/repo/cli/package/xy.config.ts +3 -0
  611. package/templates/repo/cli/root/CLAUDE.md.tmpl +38 -0
  612. package/templates/repo/cli/root/cspell.json.tmpl +13 -0
  613. package/templates/repo/cli/root/eslint.config.ts +28 -0
  614. package/templates/repo/cli/root/github/workflows/build-pnpm.yml.tmpl +34 -0
  615. package/templates/repo/cli/root/github/workflows/build-yarn.yml.tmpl +32 -0
  616. package/templates/repo/cli/root/gitignore.tmpl +47 -0
  617. package/templates/repo/cli/root/knip.config.ts +16 -0
  618. package/templates/repo/cli/root/package.json.tmpl +54 -0
  619. package/templates/repo/cli/root/pnpm-workspace.yaml +2 -0
  620. package/templates/repo/cli/root/tsconfig.json +4 -0
  621. package/templates/repo/cli/root/vitest.config.ts +31 -0
  622. package/templates/repo/cli/root/xy.config.ts.tmpl +5 -0
@@ -0,0 +1,748 @@
1
+ // src/actions/publint.ts
2
+ import chalk5 from "chalk";
3
+
4
+ // src/lib/concurrency.ts
5
+ import { AsyncLocalStorage } from "async_hooks";
6
+ var outputStorage = new AsyncLocalStorage();
7
+ var captureInstalled = false;
8
+ function installOutputCapture() {
9
+ if (captureInstalled) return;
10
+ captureInstalled = true;
11
+ const originalStdoutWrite = process.stdout.write.bind(process.stdout);
12
+ const originalStderrWrite = process.stderr.write.bind(process.stderr);
13
+ function intercept(original) {
14
+ return function(chunk, ...args) {
15
+ const buffer = outputStorage.getStore();
16
+ if (buffer) {
17
+ buffer.push(typeof chunk === "string" ? chunk : new TextDecoder().decode(chunk));
18
+ return true;
19
+ }
20
+ return original(chunk, ...args);
21
+ };
22
+ }
23
+ process.stdout.write = intercept(originalStdoutWrite);
24
+ process.stderr.write = intercept(originalStderrWrite);
25
+ }
26
+ async function runWithConcurrency(items, concurrency, fn) {
27
+ let next = 0;
28
+ async function worker() {
29
+ while (next < items.length) {
30
+ const i = next++;
31
+ await fn(items[i]);
32
+ }
33
+ }
34
+ await Promise.all(Array.from({ length: Math.min(concurrency, items.length) }, () => worker()));
35
+ }
36
+
37
+ // src/pm/detectPackageManager.ts
38
+ import { existsSync } from "fs";
39
+ function detectPackageManager() {
40
+ if (existsSync("pnpm-lock.yaml") || existsSync("pnpm-workspace.yaml")) return "pnpm";
41
+ return "yarn";
42
+ }
43
+
44
+ // src/pm/registry.ts
45
+ var implementations = /* @__PURE__ */ new Map();
46
+ function getPackageManager(name) {
47
+ const pmName = name ?? detectPackageManager();
48
+ const pm = implementations.get(pmName);
49
+ if (!pm) {
50
+ throw new Error(
51
+ `No package manager implementation registered for "${pmName}". Ensure registerPackageManager() has been called before getPackageManager().`
52
+ );
53
+ }
54
+ return pm;
55
+ }
56
+
57
+ // src/lib/initCwd.ts
58
+ function INIT_CWD() {
59
+ return process.env.INIT_CWD ?? process.cwd();
60
+ }
61
+
62
+ // src/lib/loadConfig.ts
63
+ import chalk from "chalk";
64
+ import { cosmiconfig } from "cosmiconfig";
65
+ import { TypeScriptLoader } from "cosmiconfig-typescript-loader";
66
+ import deepmerge from "deepmerge";
67
+ var config;
68
+ var rootConfigPath;
69
+ var workspaceConfigCache = /* @__PURE__ */ new Map();
70
+ var deprecationWarned = /* @__PURE__ */ new Set();
71
+ function createExplorer() {
72
+ return cosmiconfig("xy", { cache: true, loaders: { ".ts": TypeScriptLoader() } });
73
+ }
74
+ var loadConfig = async (params) => {
75
+ if (config === void 0) {
76
+ const cosmicConfigResult = await createExplorer().search();
77
+ config = cosmicConfigResult?.config ?? {};
78
+ rootConfigPath = cosmicConfigResult?.filepath;
79
+ const configFilePath = cosmicConfigResult?.filepath;
80
+ if (configFilePath !== void 0) {
81
+ console.log(chalk.green(`Loaded config from ${configFilePath}`));
82
+ if (config.verbose) {
83
+ console.log(chalk.gray(`${JSON.stringify(config, null, 2)}`));
84
+ }
85
+ }
86
+ }
87
+ return deepmerge(config, params ?? {});
88
+ };
89
+ async function loadWorkspaceConfig(workspaceDir) {
90
+ const cached = workspaceConfigCache.get(workspaceDir);
91
+ if (cached !== void 0) return cached;
92
+ const result = await createExplorer().search(workspaceDir);
93
+ if (!result || result.filepath === rootConfigPath) {
94
+ workspaceConfigCache.set(workspaceDir, {});
95
+ return {};
96
+ }
97
+ const wsConfig = result.config ?? {};
98
+ workspaceConfigCache.set(workspaceDir, wsConfig);
99
+ return wsConfig;
100
+ }
101
+ var DEPRECATED_COMMAND_FIELDS = /* @__PURE__ */ new Set(["deplint", "publint"]);
102
+ function resolveCommandField(cfg, commandName, configPath) {
103
+ const commands = cfg.commands;
104
+ const fromCommands = commands?.[commandName];
105
+ const fromTopLevel = cfg[commandName];
106
+ if (fromCommands !== void 0 && typeof fromCommands === "object") {
107
+ return fromCommands;
108
+ }
109
+ if (fromTopLevel !== void 0 && typeof fromTopLevel === "object" && DEPRECATED_COMMAND_FIELDS.has(commandName)) {
110
+ const key = `${configPath ?? "unknown"}:${commandName}`;
111
+ if (!deprecationWarned.has(key)) {
112
+ deprecationWarned.add(key);
113
+ console.warn(chalk.yellow(
114
+ `[xy] Deprecated: top-level "${commandName}" in ${configPath ?? "xy.config"} \u2014 move to "commands.${commandName}"`
115
+ ));
116
+ }
117
+ return fromTopLevel;
118
+ }
119
+ return {};
120
+ }
121
+ async function loadWorkspaceCommandConfig(workspaceDir, commandName) {
122
+ const root = await loadConfig();
123
+ const rootCmd = resolveCommandField(root, commandName, rootConfigPath);
124
+ const wsConfig = await loadWorkspaceConfig(workspaceDir);
125
+ const wsConfigPath = workspaceConfigCache.has(workspaceDir) ? workspaceDir : void 0;
126
+ const wsCmd = resolveCommandField(wsConfig, commandName, wsConfigPath);
127
+ return deepmerge(rootCmd, wsCmd);
128
+ }
129
+
130
+ // src/lib/runInstall.ts
131
+ import { spawnSync } from "child_process";
132
+ import chalk2 from "chalk";
133
+ function runInstall(cwd) {
134
+ const pm = detectPackageManager();
135
+ console.log(chalk2.gray(`Running ${pm} install...`));
136
+ const result = spawnSync(pm, ["install"], {
137
+ cwd,
138
+ stdio: "inherit"
139
+ });
140
+ if (result.status !== 0) {
141
+ console.warn(chalk2.yellow(`${pm} install failed`));
142
+ return false;
143
+ }
144
+ console.log(chalk2.green("Dependencies installed"));
145
+ return true;
146
+ }
147
+
148
+ // src/actions/package/compile/XyConfig.ts
149
+ var ALL_PUBLINT_CHECKS = [
150
+ "files",
151
+ "importToDefault",
152
+ "main",
153
+ "module",
154
+ "peerDeps",
155
+ "publint",
156
+ "resolutions",
157
+ "rootSource",
158
+ "rootTypes",
159
+ "sideEffects",
160
+ "source",
161
+ "types"
162
+ ];
163
+ var PUBLISH_ONLY_CHECKS = [
164
+ "files",
165
+ "importToDefault",
166
+ "main",
167
+ "module",
168
+ "publint",
169
+ "rootSource",
170
+ "rootTypes",
171
+ "sideEffects",
172
+ "source",
173
+ "types"
174
+ ];
175
+
176
+ // src/actions/package/publint.ts
177
+ import { promises as fs } from "fs";
178
+ import path from "path";
179
+ import chalk3 from "chalk";
180
+ import { glob } from "glob";
181
+ import sortPackageJson from "sort-package-json";
182
+ var removeSourceFromExports = (exports) => {
183
+ let removed = false;
184
+ for (const [key, value] of Object.entries(exports)) {
185
+ if (key === "source") {
186
+ delete exports[key];
187
+ removed = true;
188
+ } else if (typeof value === "object" && value !== null && removeSourceFromExports(value)) removed = true;
189
+ }
190
+ return removed;
191
+ };
192
+ var hasSourceInExports = (exports) => {
193
+ for (const [key, value] of Object.entries(exports)) {
194
+ if (key === "source") return true;
195
+ if (typeof value === "object" && value !== null && hasSourceInExports(value)) return true;
196
+ }
197
+ return false;
198
+ };
199
+ var hasImportKeyInExports = (exports) => {
200
+ for (const [key, value] of Object.entries(exports)) {
201
+ if (key === "import" && typeof value === "string" && value.endsWith(".mjs")) return true;
202
+ if (typeof value === "object" && value !== null && hasImportKeyInExports(value)) return true;
203
+ }
204
+ return false;
205
+ };
206
+ var replaceImportWithDefault = (exports) => {
207
+ let modified = false;
208
+ for (const [key, value] of Object.entries(exports)) {
209
+ if (key === "import" && typeof value === "string" && value.endsWith(".mjs")) {
210
+ if (exports.default === void 0) {
211
+ exports.default = value;
212
+ }
213
+ delete exports.import;
214
+ if (exports.types === void 0) {
215
+ exports.types = value.replace(/\.mjs$/, ".d.ts");
216
+ }
217
+ modified = true;
218
+ } else if (typeof value === "object" && value !== null && replaceImportWithDefault(value)) modified = true;
219
+ }
220
+ return modified;
221
+ };
222
+ var hasTypesInExports = (exports) => {
223
+ for (const [key, value] of Object.entries(exports)) {
224
+ if (key === "types") return true;
225
+ if (typeof value === "object" && value !== null && hasTypesInExports(value)) return true;
226
+ }
227
+ return false;
228
+ };
229
+ function ensureExportsPath(value) {
230
+ if (value.startsWith("./") || value.startsWith("../")) return value;
231
+ return `./${value}`;
232
+ }
233
+ function emptyCustomResult() {
234
+ return {
235
+ errors: 0,
236
+ modified: false,
237
+ warnings: 0
238
+ };
239
+ }
240
+ function mergeResults(target, source) {
241
+ target.errors += source.errors;
242
+ target.warnings += source.warnings;
243
+ target.modified = target.modified || source.modified;
244
+ }
245
+ function checkFiles(pkg, fix) {
246
+ const result = emptyCustomResult();
247
+ const files = pkg.files;
248
+ if (files === void 0) {
249
+ console.warn(chalk3.yellow('Publint [custom]: "files" field is missing'));
250
+ result.warnings++;
251
+ }
252
+ if (Array.isArray(files) && !files.includes("README.md")) {
253
+ files.push("README.md");
254
+ console.warn(chalk3.yellow('Publint [custom]: added "README.md" to "files"'));
255
+ result.modified = true;
256
+ result.warnings++;
257
+ }
258
+ if (Array.isArray(files) && files.includes("src")) {
259
+ if (fix) {
260
+ pkg.files = files.filter((f) => f !== "src");
261
+ console.warn(chalk3.yellow('Publint [custom]: removed "src" from "files"'));
262
+ result.modified = true;
263
+ } else {
264
+ console.warn(chalk3.yellow('Publint [custom]: "src" should not be in "files" (use --fix to remove)'));
265
+ }
266
+ result.warnings++;
267
+ }
268
+ return result;
269
+ }
270
+ function checkExportsSource(pkg, fix) {
271
+ const result = emptyCustomResult();
272
+ const exports = pkg.exports;
273
+ if (exports && typeof exports === "object" && hasSourceInExports(exports)) {
274
+ if (fix) {
275
+ removeSourceFromExports(exports);
276
+ console.warn(chalk3.yellow('Publint [custom]: removed "source" entries from "exports"'));
277
+ result.modified = true;
278
+ } else {
279
+ console.warn(chalk3.yellow('Publint [custom]: "source" entries should not be in "exports" (use --fix to remove)'));
280
+ }
281
+ result.warnings++;
282
+ }
283
+ return result;
284
+ }
285
+ function migrateFieldToExports(pkg, field, exportKey, fix) {
286
+ const result = emptyCustomResult();
287
+ if (pkg[field] === void 0) return result;
288
+ const fieldValue = pkg[field];
289
+ if (!fieldValue.endsWith(".js") && !fieldValue.endsWith(".mjs") && !fieldValue.endsWith(".cjs")) return result;
290
+ if (fix) {
291
+ const exportValue = ensureExportsPath(fieldValue);
292
+ const exports = pkg.exports;
293
+ if (exports && typeof exports === "object") {
294
+ const dot = exports["."];
295
+ if (dot && typeof dot === "object" && !dot[exportKey]) {
296
+ dot[exportKey] = exportValue;
297
+ console.warn(chalk3.yellow(`Publint [custom]: migrated "${field}" to "exports['.'].${exportKey}" (${fieldValue})`));
298
+ }
299
+ } else if (!pkg.exports) {
300
+ pkg.exports = { ".": { [exportKey]: exportValue } };
301
+ console.warn(chalk3.yellow(`Publint [custom]: migrated "${field}" to "exports" (.\u2192${fieldValue})`));
302
+ }
303
+ delete pkg[field];
304
+ console.warn(chalk3.yellow(`Publint [custom]: removed deprecated "${field}" field`));
305
+ result.modified = true;
306
+ } else {
307
+ console.warn(chalk3.yellow(`Publint [custom]: "${field}" field is deprecated, use "exports" instead (use --fix to remove)`));
308
+ }
309
+ result.warnings++;
310
+ return result;
311
+ }
312
+ function checkSideEffects(pkg) {
313
+ const result = emptyCustomResult();
314
+ if (pkg.sideEffects !== false) {
315
+ console.warn(chalk3.yellow('Publint [custom]: "sideEffects" field should be set to false'));
316
+ result.warnings++;
317
+ }
318
+ return result;
319
+ }
320
+ function checkRootSource(pkg, fix) {
321
+ const result = emptyCustomResult();
322
+ for (const field of ["source", "src"]) {
323
+ if (pkg[field] !== void 0) {
324
+ if (fix) {
325
+ delete pkg[field];
326
+ console.warn(chalk3.yellow(`Publint [custom]: removed root-level "${field}" field`));
327
+ result.modified = true;
328
+ } else {
329
+ console.warn(chalk3.yellow(`Publint [custom]: root-level "${field}" field should not be in package.json (use --fix to remove)`));
330
+ }
331
+ result.warnings++;
332
+ }
333
+ }
334
+ return result;
335
+ }
336
+ function checkResolutions(pkg) {
337
+ const result = emptyCustomResult();
338
+ if (pkg.resolutions !== void 0) {
339
+ console.warn(chalk3.yellow('Publint [custom]: "resolutions" in use'));
340
+ console.warn(chalk3.gray(JSON.stringify(pkg.resolutions, null, 2)));
341
+ result.warnings++;
342
+ }
343
+ return result;
344
+ }
345
+ function checkImportToDefault(pkg, fix) {
346
+ const result = emptyCustomResult();
347
+ const exports = pkg.exports;
348
+ if (!exports || typeof exports !== "object") return result;
349
+ if (!hasImportKeyInExports(exports)) return result;
350
+ if (fix) {
351
+ replaceImportWithDefault(exports);
352
+ console.warn(chalk3.yellow('Publint [custom]: renamed "import" to "default" in "exports" and ensured "types" siblings'));
353
+ result.modified = true;
354
+ } else {
355
+ console.warn(chalk3.yellow('Publint [custom]: "import" entries in "exports" should use "default" instead (use --fix to rename)'));
356
+ }
357
+ result.warnings++;
358
+ return result;
359
+ }
360
+ function checkRootTypes(pkg, fix) {
361
+ const result = emptyCustomResult();
362
+ if (pkg.types === void 0) return result;
363
+ const exports = pkg.exports;
364
+ if (!exports || typeof exports !== "object" || !hasTypesInExports(exports)) return result;
365
+ if (fix) {
366
+ delete pkg.types;
367
+ console.warn(chalk3.yellow('Publint [custom]: removed redundant root "types" field (already defined in "exports")'));
368
+ result.modified = true;
369
+ } else {
370
+ console.warn(chalk3.yellow('Publint [custom]: root "types" field is redundant when "exports" defines types (use --fix to remove)'));
371
+ }
372
+ result.warnings++;
373
+ return result;
374
+ }
375
+ function customPubLint(pkg, fix = false, exclude = /* @__PURE__ */ new Set()) {
376
+ const result = emptyCustomResult();
377
+ if (!exclude.has("files")) mergeResults(result, checkFiles(pkg, fix));
378
+ if (!exclude.has("source")) mergeResults(result, checkExportsSource(pkg, fix));
379
+ if (!exclude.has("rootSource")) mergeResults(result, checkRootSource(pkg, fix));
380
+ if (!exclude.has("main")) mergeResults(result, migrateFieldToExports(pkg, "main", "default", fix));
381
+ if (!exclude.has("types")) mergeResults(result, migrateFieldToExports(pkg, "types", "types", fix));
382
+ if (!exclude.has("module")) mergeResults(result, migrateFieldToExports(pkg, "module", "default", fix));
383
+ if (!exclude.has("importToDefault")) mergeResults(result, checkImportToDefault(pkg, fix));
384
+ if (!exclude.has("rootTypes")) mergeResults(result, checkRootTypes(pkg, fix));
385
+ if (!exclude.has("sideEffects")) mergeResults(result, checkSideEffects(pkg));
386
+ if (!exclude.has("resolutions")) mergeResults(result, checkResolutions(pkg));
387
+ return [result.errors, result.warnings, result.modified];
388
+ }
389
+ var ALWAYS_INCLUDED_PATTERNS = [
390
+ "package.json",
391
+ "README",
392
+ "README.*",
393
+ "LICENCE",
394
+ "LICENCE.*",
395
+ "LICENSE",
396
+ "LICENSE.*",
397
+ "CHANGELOG",
398
+ "CHANGELOG.*"
399
+ ];
400
+ async function resolvePackFiles(pkgDir, filesField) {
401
+ const patterns = [...ALWAYS_INCLUDED_PATTERNS];
402
+ if (filesField) {
403
+ for (const pattern of filesField) {
404
+ if (pattern.startsWith("!")) {
405
+ patterns.push(pattern);
406
+ } else {
407
+ patterns.push(pattern, `${pattern}/**`);
408
+ }
409
+ }
410
+ }
411
+ const matched = await glob(patterns, {
412
+ cwd: pkgDir,
413
+ nodir: true,
414
+ dot: false
415
+ });
416
+ const files = await Promise.all(
417
+ matched.map(async (rel) => {
418
+ const abs = path.join(pkgDir, rel);
419
+ const data = await fs.readFile(abs, "utf8").catch(() => "");
420
+ return { name: path.join(pkgDir, rel), data };
421
+ })
422
+ );
423
+ return files;
424
+ }
425
+ async function runPublintLibrary(pkgDir, pkg, strict, pack) {
426
+ const { publint: publint2 } = await import("publint");
427
+ let packOption = false;
428
+ if (pack) {
429
+ const files = await resolvePackFiles(pkgDir, pkg.files);
430
+ packOption = { files };
431
+ }
432
+ const { messages } = await publint2({
433
+ level: "suggestion",
434
+ pack: packOption,
435
+ pkgDir,
436
+ strict
437
+ });
438
+ const { formatMessage } = await import("publint/utils");
439
+ for (const message of messages) {
440
+ switch (message.type) {
441
+ case "error": {
442
+ console.error(chalk3.red(`[${message.code}] ${formatMessage(message, pkg)}`));
443
+ break;
444
+ }
445
+ case "warning": {
446
+ console.warn(chalk3.yellow(`[${message.code}] ${formatMessage(message, pkg)}`));
447
+ break;
448
+ }
449
+ default: {
450
+ console.log(chalk3.white(`[${message.code}] ${formatMessage(message, pkg)}`));
451
+ break;
452
+ }
453
+ }
454
+ }
455
+ return {
456
+ errors: messages.filter((message) => message.type === "error").length,
457
+ total: messages.length
458
+ };
459
+ }
460
+ var packagePublint = async ({
461
+ exclude = /* @__PURE__ */ new Set(),
462
+ fix = false,
463
+ pack = true,
464
+ pkgDir: pkgDirParam,
465
+ strict = true,
466
+ verbose: _verbose = false
467
+ } = {}) => {
468
+ const pkgDir = pkgDirParam ?? INIT_CWD();
469
+ const sortedPkg = sortPackageJson(await fs.readFile(`${pkgDir}/package.json`, "utf8"));
470
+ await fs.writeFile(`${pkgDir}/package.json`, sortedPkg);
471
+ const pkg = JSON.parse(await fs.readFile(`${pkgDir}/package.json`, "utf8"));
472
+ const effectiveExclude = pkg.private ? /* @__PURE__ */ new Set([...exclude, ...PUBLISH_ONLY_CHECKS]) : exclude;
473
+ console.log(chalk3.green(`Publint: ${String(pkg.name)}${pkg.private ? chalk3.gray(" (private)") : ""}`));
474
+ console.log(chalk3.gray(pkgDir));
475
+ let libraryErrors = 0;
476
+ if (!effectiveExclude.has("publint")) {
477
+ const library = await runPublintLibrary(pkgDir, pkg, strict, pack);
478
+ libraryErrors = library.errors;
479
+ }
480
+ const [errorCount, _warningCount, modified] = customPubLint(pkg, fix, effectiveExclude);
481
+ if (modified) {
482
+ const sorted = sortPackageJson(JSON.stringify(pkg, null, 2));
483
+ await fs.writeFile(`${pkgDir}/package.json`, sorted);
484
+ }
485
+ return libraryErrors + errorCount;
486
+ };
487
+
488
+ // src/actions/package-lint-deps.ts
489
+ import { readFileSync, writeFileSync } from "fs";
490
+ import PATH from "path";
491
+ import chalk4 from "chalk";
492
+ import semver from "semver";
493
+ function readWorkspacePackageJson(cwd, location) {
494
+ const pkgPath = PATH.resolve(cwd, location, "package.json");
495
+ try {
496
+ return JSON.parse(readFileSync(pkgPath, "utf8"));
497
+ } catch {
498
+ return void 0;
499
+ }
500
+ }
501
+ function writeWorkspacePackageJson(cwd, location, pkg) {
502
+ const pkgPath = PATH.resolve(cwd, location, "package.json");
503
+ writeFileSync(pkgPath, `${JSON.stringify(pkg, null, 2)}
504
+ `, "utf8");
505
+ }
506
+ function buildWorkspaceVersionMap(cwd, workspaces) {
507
+ const map = /* @__PURE__ */ new Map();
508
+ for (const { location, name } of workspaces) {
509
+ if (location === ".") continue;
510
+ const pkg = readWorkspacePackageJson(cwd, location);
511
+ if (!pkg) continue;
512
+ const version = pkg.version;
513
+ if (version) map.set(name, version);
514
+ }
515
+ return map;
516
+ }
517
+ function expectedPeerRange(devDepVersion, targetVersion) {
518
+ const parsed = semver.parse(targetVersion);
519
+ if (!parsed) return `~${targetVersion}`;
520
+ if (devDepVersion === "workspace:^") {
521
+ return `^${parsed.major}`;
522
+ }
523
+ return `~${parsed.major}.${parsed.minor}`;
524
+ }
525
+ function checkInternalPeerVersions(cwd, workspaces) {
526
+ const result = {
527
+ errors: [],
528
+ fixable: [],
529
+ warnings: []
530
+ };
531
+ const workspaceVersions = buildWorkspaceVersionMap(cwd, workspaces);
532
+ for (const { location, name } of workspaces) {
533
+ const pkg = readWorkspacePackageJson(cwd, location);
534
+ if (!pkg) continue;
535
+ const peerDeps = pkg.peerDependencies;
536
+ if (!peerDeps) continue;
537
+ const devDeps = pkg.devDependencies;
538
+ for (const [dep, version] of Object.entries(peerDeps)) {
539
+ const targetVersion = workspaceVersions.get(dep);
540
+ if (!targetVersion) continue;
541
+ if (version.startsWith("workspace:")) {
542
+ const expected2 = expectedPeerRange(devDeps?.[dep], targetVersion);
543
+ result.fixable.push(
544
+ `${name} (${location}) peerDependencies.${dep} uses workspace: protocol \u2014 should be "${expected2}"`
545
+ );
546
+ continue;
547
+ }
548
+ const expected = expectedPeerRange(devDeps?.[dep], targetVersion);
549
+ if (version !== expected && !semver.satisfies(targetVersion, version)) {
550
+ result.fixable.push(
551
+ `${name} (${location}) peerDependencies.${dep} is "${version}" \u2014 current version ${targetVersion} is not satisfied; expected "${expected}"`
552
+ );
553
+ }
554
+ }
555
+ }
556
+ return result;
557
+ }
558
+ function fixInternalPeerVersions(cwd, workspaces) {
559
+ const workspaceVersions = buildWorkspaceVersionMap(cwd, workspaces);
560
+ for (const { location, name } of workspaces) {
561
+ const pkg = readWorkspacePackageJson(cwd, location);
562
+ if (!pkg) continue;
563
+ const peerDeps = pkg.peerDependencies;
564
+ if (!peerDeps) continue;
565
+ const devDeps = pkg.devDependencies;
566
+ let modified = false;
567
+ for (const [dep, version] of Object.entries(peerDeps)) {
568
+ const targetVersion = workspaceVersions.get(dep);
569
+ if (!targetVersion) continue;
570
+ const expected = expectedPeerRange(devDeps?.[dep], targetVersion);
571
+ if (version !== expected) {
572
+ peerDeps[dep] = expected;
573
+ console.log(chalk4.green(` \u2714 Fixed: set peerDependencies.${dep} to "${expected}" in ${name} (${location})`));
574
+ modified = true;
575
+ }
576
+ }
577
+ if (modified) {
578
+ writeWorkspacePackageJson(cwd, location, pkg);
579
+ }
580
+ }
581
+ }
582
+
583
+ // src/actions/publint.ts
584
+ function resolveExclude(publintConfig, cliExclude, cliInclude) {
585
+ const hasExclude = (publintConfig.exclude?.length ?? 0) > 0 || (cliExclude?.length ?? 0) > 0;
586
+ const hasInclude = (publintConfig.include?.length ?? 0) > 0 || (cliInclude?.length ?? 0) > 0;
587
+ if (hasExclude && hasInclude) {
588
+ console.error(chalk5.red("Publint: --include and --exclude cannot be used together"));
589
+ return void 0;
590
+ }
591
+ if (hasInclude) {
592
+ const include = /* @__PURE__ */ new Set([
593
+ ...publintConfig.include ?? [],
594
+ ...cliInclude ?? []
595
+ ]);
596
+ return new Set(ALL_PUBLINT_CHECKS.filter((c) => !include.has(c)));
597
+ }
598
+ return /* @__PURE__ */ new Set([
599
+ ...publintConfig.exclude ?? [],
600
+ ...cliExclude ?? []
601
+ ]);
602
+ }
603
+ function normalizePublintConfig(value) {
604
+ if (typeof value === "object") return value;
605
+ return {};
606
+ }
607
+ async function loadPublintOptions() {
608
+ const config2 = await loadConfig();
609
+ const publintConfig = normalizePublintConfig(config2.commands?.publint ?? config2.publint);
610
+ const exclude = resolveExclude(publintConfig) ?? /* @__PURE__ */ new Set();
611
+ return { exclude, pack: publintConfig.pack ?? true };
612
+ }
613
+ var publint = async ({
614
+ cliExclude,
615
+ cliInclude,
616
+ fix,
617
+ jobs,
618
+ pack,
619
+ verbose,
620
+ pkg
621
+ }) => {
622
+ return pkg === void 0 ? await publintAll({
623
+ cliExclude,
624
+ cliInclude,
625
+ fix,
626
+ jobs,
627
+ pack,
628
+ verbose
629
+ }) : await publintSingle({
630
+ cliExclude,
631
+ cliInclude,
632
+ fix,
633
+ pack,
634
+ pkg,
635
+ verbose
636
+ });
637
+ };
638
+ function logPublintSummary(packages, errors, ms) {
639
+ const color = errors > 0 ? chalk5.red : chalk5.blue;
640
+ console.log(color(`Checked ${packages} package(s) in ${ms.toFixed(0)}ms with ${errors} issue(s) found.`));
641
+ }
642
+ var publintSingle = async ({
643
+ cliExclude,
644
+ cliInclude,
645
+ fix,
646
+ pack,
647
+ pkg,
648
+ verbose
649
+ }) => {
650
+ const start = performance.now();
651
+ const pm = getPackageManager();
652
+ const workspace = pm.findWorkspace(pkg);
653
+ if (!workspace) {
654
+ console.error(chalk5.red(`Publint: workspace "${pkg}" not found`));
655
+ return 1;
656
+ }
657
+ const wsPublintConfig = normalizePublintConfig(
658
+ await loadWorkspaceCommandConfig(workspace.location, "publint")
659
+ );
660
+ const exclude = resolveExclude(wsPublintConfig, cliExclude, cliInclude);
661
+ if (!exclude) return 1;
662
+ const shouldPack = pack ?? wsPublintConfig.pack ?? true;
663
+ const errors = await packagePublint({
664
+ exclude,
665
+ fix,
666
+ pack: shouldPack,
667
+ pkgDir: workspace.location,
668
+ verbose
669
+ });
670
+ logPublintSummary(1, errors, performance.now() - start);
671
+ return errors;
672
+ };
673
+ var publintAll = async ({
674
+ cliExclude,
675
+ cliInclude,
676
+ fix,
677
+ jobs,
678
+ pack,
679
+ verbose
680
+ }) => {
681
+ const start = performance.now();
682
+ const pm = getPackageManager();
683
+ const workspaces = pm.listWorkspaces();
684
+ const concurrency = jobs;
685
+ const results = Array.from({ length: workspaces.length }, () => ({ errors: 0, output: [] }));
686
+ installOutputCapture();
687
+ await runWithConcurrency(
688
+ workspaces.map((ws, i) => ({ i, ws })),
689
+ concurrency,
690
+ async ({ i, ws }) => {
691
+ const output = [];
692
+ await outputStorage.run(output, async () => {
693
+ try {
694
+ const wsPublintConfig = normalizePublintConfig(
695
+ await loadWorkspaceCommandConfig(ws.location, "publint")
696
+ );
697
+ const exclude = resolveExclude(wsPublintConfig, cliExclude, cliInclude) ?? /* @__PURE__ */ new Set();
698
+ const shouldPack = pack ?? wsPublintConfig.pack ?? true;
699
+ const errors = await packagePublint({
700
+ exclude,
701
+ fix,
702
+ pack: shouldPack,
703
+ pkgDir: ws.location,
704
+ verbose
705
+ });
706
+ results[i] = { errors, output };
707
+ } catch (ex) {
708
+ output.push(chalk5.red(`Publint failed for ${ws.name}: ${ex.message}
709
+ `));
710
+ results[i] = { errors: 1, output };
711
+ }
712
+ });
713
+ }
714
+ );
715
+ let totalErrors = 0;
716
+ for (const { errors, output } of results) {
717
+ for (const line of output) {
718
+ process.stdout.write(line);
719
+ }
720
+ totalErrors += errors;
721
+ }
722
+ const allExclude = resolveExclude({}, cliExclude, cliInclude) ?? /* @__PURE__ */ new Set();
723
+ if (!allExclude.has("peerDeps")) {
724
+ const cwd = INIT_CWD();
725
+ const peerResult = checkInternalPeerVersions(cwd, workspaces);
726
+ if (peerResult.fixable.length > 0) {
727
+ if (fix) {
728
+ fixInternalPeerVersions(cwd, workspaces);
729
+ runInstall();
730
+ } else {
731
+ for (const msg of peerResult.fixable) {
732
+ console.log(chalk5.red(` \u2717 ${msg} (fixable)`));
733
+ }
734
+ totalErrors += peerResult.fixable.length;
735
+ }
736
+ }
737
+ totalErrors += peerResult.errors.length;
738
+ }
739
+ logPublintSummary(workspaces.length, totalErrors, performance.now() - start);
740
+ return totalErrors;
741
+ };
742
+ export {
743
+ loadPublintOptions,
744
+ publint,
745
+ publintAll,
746
+ publintSingle
747
+ };
748
+ //# sourceMappingURL=publint.mjs.map