@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,778 @@
1
+ // src/lib/concurrency.ts
2
+ import { AsyncLocalStorage } from "async_hooks";
3
+ var outputStorage = new AsyncLocalStorage();
4
+ var captureInstalled = false;
5
+ function installOutputCapture() {
6
+ if (captureInstalled) return;
7
+ captureInstalled = true;
8
+ const originalStdoutWrite = process.stdout.write.bind(process.stdout);
9
+ const originalStderrWrite = process.stderr.write.bind(process.stderr);
10
+ function intercept(original) {
11
+ return function(chunk, ...args) {
12
+ const buffer = outputStorage.getStore();
13
+ if (buffer) {
14
+ buffer.push(typeof chunk === "string" ? chunk : new TextDecoder().decode(chunk));
15
+ return true;
16
+ }
17
+ return original(chunk, ...args);
18
+ };
19
+ }
20
+ process.stdout.write = intercept(originalStdoutWrite);
21
+ process.stderr.write = intercept(originalStderrWrite);
22
+ }
23
+ async function runWithConcurrency(items, concurrency, fn) {
24
+ let next = 0;
25
+ async function worker() {
26
+ while (next < items.length) {
27
+ const i = next++;
28
+ await fn(items[i]);
29
+ }
30
+ }
31
+ await Promise.all(Array.from({ length: Math.min(concurrency, items.length) }, () => worker()));
32
+ }
33
+
34
+ // src/pm/detectPackageManager.ts
35
+ import { existsSync } from "fs";
36
+ function detectPackageManager() {
37
+ if (existsSync("pnpm-lock.yaml") || existsSync("pnpm-workspace.yaml")) return "pnpm";
38
+ return "yarn";
39
+ }
40
+
41
+ // src/pm/registry.ts
42
+ var implementations = /* @__PURE__ */ new Map();
43
+ function getPackageManager(name) {
44
+ const pmName = name ?? detectPackageManager();
45
+ const pm = implementations.get(pmName);
46
+ if (!pm) {
47
+ throw new Error(
48
+ `No package manager implementation registered for "${pmName}". Ensure registerPackageManager() has been called before getPackageManager().`
49
+ );
50
+ }
51
+ return pm;
52
+ }
53
+
54
+ // src/lib/initCwd.ts
55
+ function INIT_CWD() {
56
+ return process.env.INIT_CWD ?? process.cwd();
57
+ }
58
+
59
+ // src/lib/loadConfig.ts
60
+ import chalk from "chalk";
61
+ import { cosmiconfig } from "cosmiconfig";
62
+ import { TypeScriptLoader } from "cosmiconfig-typescript-loader";
63
+ import deepmerge from "deepmerge";
64
+ var config;
65
+ var rootConfigPath;
66
+ var workspaceConfigCache = /* @__PURE__ */ new Map();
67
+ var deprecationWarned = /* @__PURE__ */ new Set();
68
+ function createExplorer() {
69
+ return cosmiconfig("xy", { cache: true, loaders: { ".ts": TypeScriptLoader() } });
70
+ }
71
+ var loadConfig = async (params) => {
72
+ if (config === void 0) {
73
+ const cosmicConfigResult = await createExplorer().search();
74
+ config = cosmicConfigResult?.config ?? {};
75
+ rootConfigPath = cosmicConfigResult?.filepath;
76
+ const configFilePath = cosmicConfigResult?.filepath;
77
+ if (configFilePath !== void 0) {
78
+ console.log(chalk.green(`Loaded config from ${configFilePath}`));
79
+ if (config.verbose) {
80
+ console.log(chalk.gray(`${JSON.stringify(config, null, 2)}`));
81
+ }
82
+ }
83
+ }
84
+ return deepmerge(config, params ?? {});
85
+ };
86
+ async function loadWorkspaceConfig(workspaceDir) {
87
+ const cached = workspaceConfigCache.get(workspaceDir);
88
+ if (cached !== void 0) return cached;
89
+ const result = await createExplorer().search(workspaceDir);
90
+ if (!result || result.filepath === rootConfigPath) {
91
+ workspaceConfigCache.set(workspaceDir, {});
92
+ return {};
93
+ }
94
+ const wsConfig = result.config ?? {};
95
+ workspaceConfigCache.set(workspaceDir, wsConfig);
96
+ return wsConfig;
97
+ }
98
+ var DEPRECATED_COMMAND_FIELDS = /* @__PURE__ */ new Set(["deplint", "publint"]);
99
+ function resolveCommandField(cfg, commandName, configPath) {
100
+ const commands = cfg.commands;
101
+ const fromCommands = commands?.[commandName];
102
+ const fromTopLevel = cfg[commandName];
103
+ if (fromCommands !== void 0 && typeof fromCommands === "object") {
104
+ return fromCommands;
105
+ }
106
+ if (fromTopLevel !== void 0 && typeof fromTopLevel === "object" && DEPRECATED_COMMAND_FIELDS.has(commandName)) {
107
+ const key = `${configPath ?? "unknown"}:${commandName}`;
108
+ if (!deprecationWarned.has(key)) {
109
+ deprecationWarned.add(key);
110
+ console.warn(chalk.yellow(
111
+ `[xy] Deprecated: top-level "${commandName}" in ${configPath ?? "xy.config"} \u2014 move to "commands.${commandName}"`
112
+ ));
113
+ }
114
+ return fromTopLevel;
115
+ }
116
+ return {};
117
+ }
118
+ async function loadWorkspaceCommandConfig(workspaceDir, commandName) {
119
+ const root = await loadConfig();
120
+ const rootCmd = resolveCommandField(root, commandName, rootConfigPath);
121
+ const wsConfig = await loadWorkspaceConfig(workspaceDir);
122
+ const wsConfigPath = workspaceConfigCache.has(workspaceDir) ? workspaceDir : void 0;
123
+ const wsCmd = resolveCommandField(wsConfig, commandName, wsConfigPath);
124
+ return deepmerge(rootCmd, wsCmd);
125
+ }
126
+
127
+ // src/lib/runInstall.ts
128
+ import { spawnSync } from "child_process";
129
+ import chalk2 from "chalk";
130
+ function runInstall(cwd) {
131
+ const pm = detectPackageManager();
132
+ console.log(chalk2.gray(`Running ${pm} install...`));
133
+ const result = spawnSync(pm, ["install"], {
134
+ cwd,
135
+ stdio: "inherit"
136
+ });
137
+ if (result.status !== 0) {
138
+ console.warn(chalk2.yellow(`${pm} install failed`));
139
+ return false;
140
+ }
141
+ console.log(chalk2.green("Dependencies installed"));
142
+ return true;
143
+ }
144
+
145
+ // src/actions/package-lint-deps.ts
146
+ import { readFileSync, writeFileSync } from "fs";
147
+ import PATH from "path";
148
+ import chalk3 from "chalk";
149
+ import semver from "semver";
150
+ function readWorkspacePackageJson(cwd, location) {
151
+ const pkgPath = PATH.resolve(cwd, location, "package.json");
152
+ try {
153
+ return JSON.parse(readFileSync(pkgPath, "utf8"));
154
+ } catch {
155
+ return void 0;
156
+ }
157
+ }
158
+ function writeWorkspacePackageJson(cwd, location, pkg) {
159
+ const pkgPath = PATH.resolve(cwd, location, "package.json");
160
+ writeFileSync(pkgPath, `${JSON.stringify(pkg, null, 2)}
161
+ `, "utf8");
162
+ }
163
+ function buildWorkspaceVersionMap(cwd, workspaces) {
164
+ const map = /* @__PURE__ */ new Map();
165
+ for (const { location, name } of workspaces) {
166
+ if (location === ".") continue;
167
+ const pkg = readWorkspacePackageJson(cwd, location);
168
+ if (!pkg) continue;
169
+ const version = pkg.version;
170
+ if (version) map.set(name, version);
171
+ }
172
+ return map;
173
+ }
174
+ function expectedPeerRange(devDepVersion, targetVersion) {
175
+ const parsed = semver.parse(targetVersion);
176
+ if (!parsed) return `~${targetVersion}`;
177
+ if (devDepVersion === "workspace:^") {
178
+ return `^${parsed.major}`;
179
+ }
180
+ return `~${parsed.major}.${parsed.minor}`;
181
+ }
182
+ function checkInternalPeerVersions(cwd, workspaces) {
183
+ const result = {
184
+ errors: [],
185
+ fixable: [],
186
+ warnings: []
187
+ };
188
+ const workspaceVersions = buildWorkspaceVersionMap(cwd, workspaces);
189
+ for (const { location, name } of workspaces) {
190
+ const pkg = readWorkspacePackageJson(cwd, location);
191
+ if (!pkg) continue;
192
+ const peerDeps = pkg.peerDependencies;
193
+ if (!peerDeps) continue;
194
+ const devDeps = pkg.devDependencies;
195
+ for (const [dep, version] of Object.entries(peerDeps)) {
196
+ const targetVersion = workspaceVersions.get(dep);
197
+ if (!targetVersion) continue;
198
+ if (version.startsWith("workspace:")) {
199
+ const expected2 = expectedPeerRange(devDeps?.[dep], targetVersion);
200
+ result.fixable.push(
201
+ `${name} (${location}) peerDependencies.${dep} uses workspace: protocol \u2014 should be "${expected2}"`
202
+ );
203
+ continue;
204
+ }
205
+ const expected = expectedPeerRange(devDeps?.[dep], targetVersion);
206
+ if (version !== expected && !semver.satisfies(targetVersion, version)) {
207
+ result.fixable.push(
208
+ `${name} (${location}) peerDependencies.${dep} is "${version}" \u2014 current version ${targetVersion} is not satisfied; expected "${expected}"`
209
+ );
210
+ }
211
+ }
212
+ }
213
+ return result;
214
+ }
215
+ function fixInternalPeerVersions(cwd, workspaces) {
216
+ const workspaceVersions = buildWorkspaceVersionMap(cwd, workspaces);
217
+ for (const { location, name } of workspaces) {
218
+ const pkg = readWorkspacePackageJson(cwd, location);
219
+ if (!pkg) continue;
220
+ const peerDeps = pkg.peerDependencies;
221
+ if (!peerDeps) continue;
222
+ const devDeps = pkg.devDependencies;
223
+ let modified = false;
224
+ for (const [dep, version] of Object.entries(peerDeps)) {
225
+ const targetVersion = workspaceVersions.get(dep);
226
+ if (!targetVersion) continue;
227
+ const expected = expectedPeerRange(devDeps?.[dep], targetVersion);
228
+ if (version !== expected) {
229
+ peerDeps[dep] = expected;
230
+ console.log(chalk3.green(` \u2714 Fixed: set peerDependencies.${dep} to "${expected}" in ${name} (${location})`));
231
+ modified = true;
232
+ }
233
+ }
234
+ if (modified) {
235
+ writeWorkspacePackageJson(cwd, location, pkg);
236
+ }
237
+ }
238
+ }
239
+
240
+ // src/actions/package/compile/XyConfig.ts
241
+ var ALL_PUBLINT_CHECKS = [
242
+ "files",
243
+ "importToDefault",
244
+ "main",
245
+ "module",
246
+ "peerDeps",
247
+ "publint",
248
+ "resolutions",
249
+ "rootSource",
250
+ "rootTypes",
251
+ "sideEffects",
252
+ "source",
253
+ "types"
254
+ ];
255
+ var PUBLISH_ONLY_CHECKS = [
256
+ "files",
257
+ "importToDefault",
258
+ "main",
259
+ "module",
260
+ "publint",
261
+ "rootSource",
262
+ "rootTypes",
263
+ "sideEffects",
264
+ "source",
265
+ "types"
266
+ ];
267
+
268
+ // src/actions/package/publint.ts
269
+ import { promises as fs } from "fs";
270
+ import path from "path";
271
+ import chalk4 from "chalk";
272
+ import { glob } from "glob";
273
+ import sortPackageJson from "sort-package-json";
274
+ var removeSourceFromExports = (exports) => {
275
+ let removed = false;
276
+ for (const [key, value] of Object.entries(exports)) {
277
+ if (key === "source") {
278
+ delete exports[key];
279
+ removed = true;
280
+ } else if (typeof value === "object" && value !== null && removeSourceFromExports(value)) removed = true;
281
+ }
282
+ return removed;
283
+ };
284
+ var hasSourceInExports = (exports) => {
285
+ for (const [key, value] of Object.entries(exports)) {
286
+ if (key === "source") return true;
287
+ if (typeof value === "object" && value !== null && hasSourceInExports(value)) return true;
288
+ }
289
+ return false;
290
+ };
291
+ var hasImportKeyInExports = (exports) => {
292
+ for (const [key, value] of Object.entries(exports)) {
293
+ if (key === "import" && typeof value === "string" && value.endsWith(".mjs")) return true;
294
+ if (typeof value === "object" && value !== null && hasImportKeyInExports(value)) return true;
295
+ }
296
+ return false;
297
+ };
298
+ var replaceImportWithDefault = (exports) => {
299
+ let modified = false;
300
+ for (const [key, value] of Object.entries(exports)) {
301
+ if (key === "import" && typeof value === "string" && value.endsWith(".mjs")) {
302
+ if (exports.default === void 0) {
303
+ exports.default = value;
304
+ }
305
+ delete exports.import;
306
+ if (exports.types === void 0) {
307
+ exports.types = value.replace(/\.mjs$/, ".d.ts");
308
+ }
309
+ modified = true;
310
+ } else if (typeof value === "object" && value !== null && replaceImportWithDefault(value)) modified = true;
311
+ }
312
+ return modified;
313
+ };
314
+ var hasTypesInExports = (exports) => {
315
+ for (const [key, value] of Object.entries(exports)) {
316
+ if (key === "types") return true;
317
+ if (typeof value === "object" && value !== null && hasTypesInExports(value)) return true;
318
+ }
319
+ return false;
320
+ };
321
+ function ensureExportsPath(value) {
322
+ if (value.startsWith("./") || value.startsWith("../")) return value;
323
+ return `./${value}`;
324
+ }
325
+ function emptyCustomResult() {
326
+ return {
327
+ errors: 0,
328
+ modified: false,
329
+ warnings: 0
330
+ };
331
+ }
332
+ function mergeResults(target, source) {
333
+ target.errors += source.errors;
334
+ target.warnings += source.warnings;
335
+ target.modified = target.modified || source.modified;
336
+ }
337
+ function checkFiles(pkg, fix) {
338
+ const result = emptyCustomResult();
339
+ const files = pkg.files;
340
+ if (files === void 0) {
341
+ console.warn(chalk4.yellow('Publint [custom]: "files" field is missing'));
342
+ result.warnings++;
343
+ }
344
+ if (Array.isArray(files) && !files.includes("README.md")) {
345
+ files.push("README.md");
346
+ console.warn(chalk4.yellow('Publint [custom]: added "README.md" to "files"'));
347
+ result.modified = true;
348
+ result.warnings++;
349
+ }
350
+ if (Array.isArray(files) && files.includes("src")) {
351
+ if (fix) {
352
+ pkg.files = files.filter((f) => f !== "src");
353
+ console.warn(chalk4.yellow('Publint [custom]: removed "src" from "files"'));
354
+ result.modified = true;
355
+ } else {
356
+ console.warn(chalk4.yellow('Publint [custom]: "src" should not be in "files" (use --fix to remove)'));
357
+ }
358
+ result.warnings++;
359
+ }
360
+ return result;
361
+ }
362
+ function checkExportsSource(pkg, fix) {
363
+ const result = emptyCustomResult();
364
+ const exports = pkg.exports;
365
+ if (exports && typeof exports === "object" && hasSourceInExports(exports)) {
366
+ if (fix) {
367
+ removeSourceFromExports(exports);
368
+ console.warn(chalk4.yellow('Publint [custom]: removed "source" entries from "exports"'));
369
+ result.modified = true;
370
+ } else {
371
+ console.warn(chalk4.yellow('Publint [custom]: "source" entries should not be in "exports" (use --fix to remove)'));
372
+ }
373
+ result.warnings++;
374
+ }
375
+ return result;
376
+ }
377
+ function migrateFieldToExports(pkg, field, exportKey, fix) {
378
+ const result = emptyCustomResult();
379
+ if (pkg[field] === void 0) return result;
380
+ const fieldValue = pkg[field];
381
+ if (!fieldValue.endsWith(".js") && !fieldValue.endsWith(".mjs") && !fieldValue.endsWith(".cjs")) return result;
382
+ if (fix) {
383
+ const exportValue = ensureExportsPath(fieldValue);
384
+ const exports = pkg.exports;
385
+ if (exports && typeof exports === "object") {
386
+ const dot = exports["."];
387
+ if (dot && typeof dot === "object" && !dot[exportKey]) {
388
+ dot[exportKey] = exportValue;
389
+ console.warn(chalk4.yellow(`Publint [custom]: migrated "${field}" to "exports['.'].${exportKey}" (${fieldValue})`));
390
+ }
391
+ } else if (!pkg.exports) {
392
+ pkg.exports = { ".": { [exportKey]: exportValue } };
393
+ console.warn(chalk4.yellow(`Publint [custom]: migrated "${field}" to "exports" (.\u2192${fieldValue})`));
394
+ }
395
+ delete pkg[field];
396
+ console.warn(chalk4.yellow(`Publint [custom]: removed deprecated "${field}" field`));
397
+ result.modified = true;
398
+ } else {
399
+ console.warn(chalk4.yellow(`Publint [custom]: "${field}" field is deprecated, use "exports" instead (use --fix to remove)`));
400
+ }
401
+ result.warnings++;
402
+ return result;
403
+ }
404
+ function checkSideEffects(pkg) {
405
+ const result = emptyCustomResult();
406
+ if (pkg.sideEffects !== false) {
407
+ console.warn(chalk4.yellow('Publint [custom]: "sideEffects" field should be set to false'));
408
+ result.warnings++;
409
+ }
410
+ return result;
411
+ }
412
+ function checkRootSource(pkg, fix) {
413
+ const result = emptyCustomResult();
414
+ for (const field of ["source", "src"]) {
415
+ if (pkg[field] !== void 0) {
416
+ if (fix) {
417
+ delete pkg[field];
418
+ console.warn(chalk4.yellow(`Publint [custom]: removed root-level "${field}" field`));
419
+ result.modified = true;
420
+ } else {
421
+ console.warn(chalk4.yellow(`Publint [custom]: root-level "${field}" field should not be in package.json (use --fix to remove)`));
422
+ }
423
+ result.warnings++;
424
+ }
425
+ }
426
+ return result;
427
+ }
428
+ function checkResolutions(pkg) {
429
+ const result = emptyCustomResult();
430
+ if (pkg.resolutions !== void 0) {
431
+ console.warn(chalk4.yellow('Publint [custom]: "resolutions" in use'));
432
+ console.warn(chalk4.gray(JSON.stringify(pkg.resolutions, null, 2)));
433
+ result.warnings++;
434
+ }
435
+ return result;
436
+ }
437
+ function checkImportToDefault(pkg, fix) {
438
+ const result = emptyCustomResult();
439
+ const exports = pkg.exports;
440
+ if (!exports || typeof exports !== "object") return result;
441
+ if (!hasImportKeyInExports(exports)) return result;
442
+ if (fix) {
443
+ replaceImportWithDefault(exports);
444
+ console.warn(chalk4.yellow('Publint [custom]: renamed "import" to "default" in "exports" and ensured "types" siblings'));
445
+ result.modified = true;
446
+ } else {
447
+ console.warn(chalk4.yellow('Publint [custom]: "import" entries in "exports" should use "default" instead (use --fix to rename)'));
448
+ }
449
+ result.warnings++;
450
+ return result;
451
+ }
452
+ function checkRootTypes(pkg, fix) {
453
+ const result = emptyCustomResult();
454
+ if (pkg.types === void 0) return result;
455
+ const exports = pkg.exports;
456
+ if (!exports || typeof exports !== "object" || !hasTypesInExports(exports)) return result;
457
+ if (fix) {
458
+ delete pkg.types;
459
+ console.warn(chalk4.yellow('Publint [custom]: removed redundant root "types" field (already defined in "exports")'));
460
+ result.modified = true;
461
+ } else {
462
+ console.warn(chalk4.yellow('Publint [custom]: root "types" field is redundant when "exports" defines types (use --fix to remove)'));
463
+ }
464
+ result.warnings++;
465
+ return result;
466
+ }
467
+ function customPubLint(pkg, fix = false, exclude = /* @__PURE__ */ new Set()) {
468
+ const result = emptyCustomResult();
469
+ if (!exclude.has("files")) mergeResults(result, checkFiles(pkg, fix));
470
+ if (!exclude.has("source")) mergeResults(result, checkExportsSource(pkg, fix));
471
+ if (!exclude.has("rootSource")) mergeResults(result, checkRootSource(pkg, fix));
472
+ if (!exclude.has("main")) mergeResults(result, migrateFieldToExports(pkg, "main", "default", fix));
473
+ if (!exclude.has("types")) mergeResults(result, migrateFieldToExports(pkg, "types", "types", fix));
474
+ if (!exclude.has("module")) mergeResults(result, migrateFieldToExports(pkg, "module", "default", fix));
475
+ if (!exclude.has("importToDefault")) mergeResults(result, checkImportToDefault(pkg, fix));
476
+ if (!exclude.has("rootTypes")) mergeResults(result, checkRootTypes(pkg, fix));
477
+ if (!exclude.has("sideEffects")) mergeResults(result, checkSideEffects(pkg));
478
+ if (!exclude.has("resolutions")) mergeResults(result, checkResolutions(pkg));
479
+ return [result.errors, result.warnings, result.modified];
480
+ }
481
+ var ALWAYS_INCLUDED_PATTERNS = [
482
+ "package.json",
483
+ "README",
484
+ "README.*",
485
+ "LICENCE",
486
+ "LICENCE.*",
487
+ "LICENSE",
488
+ "LICENSE.*",
489
+ "CHANGELOG",
490
+ "CHANGELOG.*"
491
+ ];
492
+ async function resolvePackFiles(pkgDir, filesField) {
493
+ const patterns = [...ALWAYS_INCLUDED_PATTERNS];
494
+ if (filesField) {
495
+ for (const pattern of filesField) {
496
+ if (pattern.startsWith("!")) {
497
+ patterns.push(pattern);
498
+ } else {
499
+ patterns.push(pattern, `${pattern}/**`);
500
+ }
501
+ }
502
+ }
503
+ const matched = await glob(patterns, {
504
+ cwd: pkgDir,
505
+ nodir: true,
506
+ dot: false
507
+ });
508
+ const files = await Promise.all(
509
+ matched.map(async (rel) => {
510
+ const abs = path.join(pkgDir, rel);
511
+ const data = await fs.readFile(abs, "utf8").catch(() => "");
512
+ return { name: path.join(pkgDir, rel), data };
513
+ })
514
+ );
515
+ return files;
516
+ }
517
+ async function runPublintLibrary(pkgDir, pkg, strict, pack) {
518
+ const { publint: publint2 } = await import("publint");
519
+ let packOption = false;
520
+ if (pack) {
521
+ const files = await resolvePackFiles(pkgDir, pkg.files);
522
+ packOption = { files };
523
+ }
524
+ const { messages } = await publint2({
525
+ level: "suggestion",
526
+ pack: packOption,
527
+ pkgDir,
528
+ strict
529
+ });
530
+ const { formatMessage } = await import("publint/utils");
531
+ for (const message of messages) {
532
+ switch (message.type) {
533
+ case "error": {
534
+ console.error(chalk4.red(`[${message.code}] ${formatMessage(message, pkg)}`));
535
+ break;
536
+ }
537
+ case "warning": {
538
+ console.warn(chalk4.yellow(`[${message.code}] ${formatMessage(message, pkg)}`));
539
+ break;
540
+ }
541
+ default: {
542
+ console.log(chalk4.white(`[${message.code}] ${formatMessage(message, pkg)}`));
543
+ break;
544
+ }
545
+ }
546
+ }
547
+ return {
548
+ errors: messages.filter((message) => message.type === "error").length,
549
+ total: messages.length
550
+ };
551
+ }
552
+ var packagePublint = async ({
553
+ exclude = /* @__PURE__ */ new Set(),
554
+ fix = false,
555
+ pack = true,
556
+ pkgDir: pkgDirParam,
557
+ strict = true,
558
+ verbose: _verbose = false
559
+ } = {}) => {
560
+ const pkgDir = pkgDirParam ?? INIT_CWD();
561
+ const sortedPkg = sortPackageJson(await fs.readFile(`${pkgDir}/package.json`, "utf8"));
562
+ await fs.writeFile(`${pkgDir}/package.json`, sortedPkg);
563
+ const pkg = JSON.parse(await fs.readFile(`${pkgDir}/package.json`, "utf8"));
564
+ const effectiveExclude = pkg.private ? /* @__PURE__ */ new Set([...exclude, ...PUBLISH_ONLY_CHECKS]) : exclude;
565
+ console.log(chalk4.green(`Publint: ${String(pkg.name)}${pkg.private ? chalk4.gray(" (private)") : ""}`));
566
+ console.log(chalk4.gray(pkgDir));
567
+ let libraryErrors = 0;
568
+ if (!effectiveExclude.has("publint")) {
569
+ const library = await runPublintLibrary(pkgDir, pkg, strict, pack);
570
+ libraryErrors = library.errors;
571
+ }
572
+ const [errorCount, _warningCount, modified] = customPubLint(pkg, fix, effectiveExclude);
573
+ if (modified) {
574
+ const sorted = sortPackageJson(JSON.stringify(pkg, null, 2));
575
+ await fs.writeFile(`${pkgDir}/package.json`, sorted);
576
+ }
577
+ return libraryErrors + errorCount;
578
+ };
579
+
580
+ // src/actions/publint.ts
581
+ import chalk5 from "chalk";
582
+ function resolveExclude(publintConfig, cliExclude, cliInclude) {
583
+ const hasExclude = (publintConfig.exclude?.length ?? 0) > 0 || (cliExclude?.length ?? 0) > 0;
584
+ const hasInclude = (publintConfig.include?.length ?? 0) > 0 || (cliInclude?.length ?? 0) > 0;
585
+ if (hasExclude && hasInclude) {
586
+ console.error(chalk5.red("Publint: --include and --exclude cannot be used together"));
587
+ return void 0;
588
+ }
589
+ if (hasInclude) {
590
+ const include = /* @__PURE__ */ new Set([
591
+ ...publintConfig.include ?? [],
592
+ ...cliInclude ?? []
593
+ ]);
594
+ return new Set(ALL_PUBLINT_CHECKS.filter((c) => !include.has(c)));
595
+ }
596
+ return /* @__PURE__ */ new Set([
597
+ ...publintConfig.exclude ?? [],
598
+ ...cliExclude ?? []
599
+ ]);
600
+ }
601
+ function normalizePublintConfig(value) {
602
+ if (typeof value === "object") return value;
603
+ return {};
604
+ }
605
+ var publint = async ({
606
+ cliExclude,
607
+ cliInclude,
608
+ fix,
609
+ jobs,
610
+ pack,
611
+ verbose,
612
+ pkg
613
+ }) => {
614
+ return pkg === void 0 ? await publintAll({
615
+ cliExclude,
616
+ cliInclude,
617
+ fix,
618
+ jobs,
619
+ pack,
620
+ verbose
621
+ }) : await publintSingle({
622
+ cliExclude,
623
+ cliInclude,
624
+ fix,
625
+ pack,
626
+ pkg,
627
+ verbose
628
+ });
629
+ };
630
+ function logPublintSummary(packages, errors, ms) {
631
+ const color = errors > 0 ? chalk5.red : chalk5.blue;
632
+ console.log(color(`Checked ${packages} package(s) in ${ms.toFixed(0)}ms with ${errors} issue(s) found.`));
633
+ }
634
+ var publintSingle = async ({
635
+ cliExclude,
636
+ cliInclude,
637
+ fix,
638
+ pack,
639
+ pkg,
640
+ verbose
641
+ }) => {
642
+ const start = performance.now();
643
+ const pm = getPackageManager();
644
+ const workspace = pm.findWorkspace(pkg);
645
+ if (!workspace) {
646
+ console.error(chalk5.red(`Publint: workspace "${pkg}" not found`));
647
+ return 1;
648
+ }
649
+ const wsPublintConfig = normalizePublintConfig(
650
+ await loadWorkspaceCommandConfig(workspace.location, "publint")
651
+ );
652
+ const exclude = resolveExclude(wsPublintConfig, cliExclude, cliInclude);
653
+ if (!exclude) return 1;
654
+ const shouldPack = pack ?? wsPublintConfig.pack ?? true;
655
+ const errors = await packagePublint({
656
+ exclude,
657
+ fix,
658
+ pack: shouldPack,
659
+ pkgDir: workspace.location,
660
+ verbose
661
+ });
662
+ logPublintSummary(1, errors, performance.now() - start);
663
+ return errors;
664
+ };
665
+ var publintAll = async ({
666
+ cliExclude,
667
+ cliInclude,
668
+ fix,
669
+ jobs,
670
+ pack,
671
+ verbose
672
+ }) => {
673
+ const start = performance.now();
674
+ const pm = getPackageManager();
675
+ const workspaces = pm.listWorkspaces();
676
+ const concurrency = jobs;
677
+ const results = Array.from({ length: workspaces.length }, () => ({ errors: 0, output: [] }));
678
+ installOutputCapture();
679
+ await runWithConcurrency(
680
+ workspaces.map((ws, i) => ({ i, ws })),
681
+ concurrency,
682
+ async ({ i, ws }) => {
683
+ const output = [];
684
+ await outputStorage.run(output, async () => {
685
+ try {
686
+ const wsPublintConfig = normalizePublintConfig(
687
+ await loadWorkspaceCommandConfig(ws.location, "publint")
688
+ );
689
+ const exclude = resolveExclude(wsPublintConfig, cliExclude, cliInclude) ?? /* @__PURE__ */ new Set();
690
+ const shouldPack = pack ?? wsPublintConfig.pack ?? true;
691
+ const errors = await packagePublint({
692
+ exclude,
693
+ fix,
694
+ pack: shouldPack,
695
+ pkgDir: ws.location,
696
+ verbose
697
+ });
698
+ results[i] = { errors, output };
699
+ } catch (ex) {
700
+ output.push(chalk5.red(`Publint failed for ${ws.name}: ${ex.message}
701
+ `));
702
+ results[i] = { errors: 1, output };
703
+ }
704
+ });
705
+ }
706
+ );
707
+ let totalErrors = 0;
708
+ for (const { errors, output } of results) {
709
+ for (const line of output) {
710
+ process.stdout.write(line);
711
+ }
712
+ totalErrors += errors;
713
+ }
714
+ const allExclude = resolveExclude({}, cliExclude, cliInclude) ?? /* @__PURE__ */ new Set();
715
+ if (!allExclude.has("peerDeps")) {
716
+ const cwd = INIT_CWD();
717
+ const peerResult = checkInternalPeerVersions(cwd, workspaces);
718
+ if (peerResult.fixable.length > 0) {
719
+ if (fix) {
720
+ fixInternalPeerVersions(cwd, workspaces);
721
+ runInstall();
722
+ } else {
723
+ for (const msg of peerResult.fixable) {
724
+ console.log(chalk5.red(` \u2717 ${msg} (fixable)`));
725
+ }
726
+ totalErrors += peerResult.fixable.length;
727
+ }
728
+ }
729
+ totalErrors += peerResult.errors.length;
730
+ }
731
+ logPublintSummary(workspaces.length, totalErrors, performance.now() - start);
732
+ return totalErrors;
733
+ };
734
+
735
+ // src/xy/param.ts
736
+ var packagePositionalParam = (yargs) => {
737
+ return yargs.positional("package", { describe: "Specific package to target", type: "string" });
738
+ };
739
+
740
+ // src/xy/lint/publintCommand.ts
741
+ var publintCommand = {
742
+ command: "publint [package]",
743
+ describe: "Publint - Run Publint",
744
+ builder: (yargs) => {
745
+ return packagePositionalParam(yargs).option("fix", {
746
+ describe: 'Auto-fix issues (e.g. remove "src" from files, "source" from exports, root-level "source"/"src" fields)',
747
+ type: "boolean",
748
+ default: false
749
+ }).option("exclude", {
750
+ alias: "e",
751
+ description: "Checks to skip (comma-separated): publint, files, source, rootSource, main, types, module, sideEffects, resolutions, peerDeps",
752
+ type: "string"
753
+ }).option("include", {
754
+ description: "Only run these checks (comma-separated): publint, files, source, rootSource, main, types, module, sideEffects, resolutions, peerDeps",
755
+ type: "string"
756
+ }).option("pack", {
757
+ description: "Run pack before publint to verify published files (default: true)",
758
+ type: "boolean"
759
+ });
760
+ },
761
+ handler: async (argv) => {
762
+ if (argv.verbose) console.log("Publint");
763
+ const parseList = (raw) => raw?.split(",").map((v) => v.trim()).filter(Boolean);
764
+ process.exitCode = await publint({
765
+ cliExclude: parseList(argv.exclude),
766
+ cliInclude: parseList(argv.include),
767
+ fix: !!argv.fix,
768
+ jobs: argv.jobs,
769
+ pack: argv.pack,
770
+ pkg: argv.package,
771
+ verbose: !!argv.verbose
772
+ });
773
+ }
774
+ };
775
+ export {
776
+ publintCommand
777
+ };
778
+ //# sourceMappingURL=publintCommand.mjs.map