@shivaedev/quality 0.45.0 → 0.47.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 (467) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/README.md +13 -7
  3. package/dist/PackageManifest.d.ts +25 -0
  4. package/dist/PackageManifest.d.ts.map +1 -0
  5. package/dist/PackageManifest.js +21 -0
  6. package/dist/PackageManifest.js.map +1 -0
  7. package/dist/adapters/TestOutput.d.ts +8 -0
  8. package/dist/adapters/TestOutput.d.ts.map +1 -0
  9. package/dist/adapters/TestOutput.js +5 -0
  10. package/dist/adapters/TestOutput.js.map +1 -0
  11. package/dist/adapters/biome/run.d.ts +17 -0
  12. package/dist/adapters/biome/run.d.ts.map +1 -0
  13. package/dist/adapters/biome/run.js +24 -0
  14. package/dist/adapters/biome/run.js.map +1 -0
  15. package/dist/adapters/knip/configuration.d.ts.map +1 -1
  16. package/dist/adapters/knip/configuration.js +2 -9
  17. package/dist/adapters/knip/configuration.js.map +1 -1
  18. package/dist/adapters/knip/entryPointFindings.d.ts.map +1 -1
  19. package/dist/adapters/knip/entryPointFindings.js +2 -1
  20. package/dist/adapters/knip/entryPointFindings.js.map +1 -1
  21. package/dist/adapters/knip/run.d.ts +3 -1
  22. package/dist/adapters/knip/run.d.ts.map +1 -1
  23. package/dist/adapters/knip/run.js +8 -8
  24. package/dist/adapters/knip/run.js.map +1 -1
  25. package/dist/adapters/manifestInventory.d.ts +23 -0
  26. package/dist/adapters/manifestInventory.d.ts.map +1 -0
  27. package/dist/adapters/manifestInventory.js +63 -0
  28. package/dist/adapters/manifestInventory.js.map +1 -0
  29. package/dist/adapters/manifestReader.d.ts +3 -0
  30. package/dist/adapters/manifestReader.d.ts.map +1 -0
  31. package/dist/adapters/manifestReader.js +8 -0
  32. package/dist/adapters/manifestReader.js.map +1 -0
  33. package/dist/adapters/testProjects.d.ts.map +1 -0
  34. package/dist/{testProjects.js → adapters/testProjects.js} +4 -3
  35. package/dist/adapters/testProjects.js.map +1 -0
  36. package/dist/appTestConfig.d.ts +1 -1
  37. package/dist/appTestConfig.d.ts.map +1 -1
  38. package/dist/appTestConfig.js +1 -1
  39. package/dist/appTestConfig.js.map +1 -1
  40. package/dist/baseline/format.js +2 -2
  41. package/dist/baseline/format.js.map +1 -1
  42. package/dist/baseline/installDriver.d.ts +2 -1
  43. package/dist/baseline/installDriver.d.ts.map +1 -1
  44. package/dist/baseline/installDriver.js.map +1 -1
  45. package/dist/baseline/legacy.js +2 -2
  46. package/dist/baseline/legacy.js.map +1 -1
  47. package/dist/baseline/merge.js +1 -1
  48. package/dist/baseline/merge.js.map +1 -1
  49. package/dist/baseline/shards.js +1 -1
  50. package/dist/baseline/shards.js.map +1 -1
  51. package/dist/biome/exceptionConfig.d.ts +7 -1
  52. package/dist/biome/exceptionConfig.d.ts.map +1 -1
  53. package/dist/biome/exceptionConfig.js +11 -25
  54. package/dist/biome/exceptionConfig.js.map +1 -1
  55. package/dist/biome/recommendedRules.d.ts +2 -1
  56. package/dist/biome/recommendedRules.d.ts.map +1 -1
  57. package/dist/biome/recommendedRules.js +11 -14
  58. package/dist/biome/recommendedRules.js.map +1 -1
  59. package/dist/biome/relocateConfig.d.ts +6 -0
  60. package/dist/biome/relocateConfig.d.ts.map +1 -0
  61. package/dist/biome/relocateConfig.js +49 -0
  62. package/dist/biome/relocateConfig.js.map +1 -0
  63. package/dist/biome/report.d.ts +28 -3
  64. package/dist/biome/report.d.ts.map +1 -1
  65. package/dist/biome/report.js +15 -12
  66. package/dist/biome/report.js.map +1 -1
  67. package/dist/biome/withoutEntryPointImports.d.ts.map +1 -1
  68. package/dist/biome/withoutEntryPointImports.js +2 -12
  69. package/dist/biome/withoutEntryPointImports.js.map +1 -1
  70. package/dist/cli/baseline.d.ts +4 -3
  71. package/dist/cli/baseline.d.ts.map +1 -1
  72. package/dist/cli/baseline.js.map +1 -1
  73. package/dist/cli/fix.d.ts +4 -3
  74. package/dist/cli/fix.d.ts.map +1 -1
  75. package/dist/cli/fix.js +3 -9
  76. package/dist/cli/fix.js.map +1 -1
  77. package/dist/cli/lint.d.ts +3 -2
  78. package/dist/cli/lint.d.ts.map +1 -1
  79. package/dist/cli/lint.js.map +1 -1
  80. package/dist/cli/migrateBaseline.d.ts +3 -2
  81. package/dist/cli/migrateBaseline.d.ts.map +1 -1
  82. package/dist/cli/migrateBaseline.js +2 -2
  83. package/dist/cli/migrateBaseline.js.map +1 -1
  84. package/dist/cli/migrateExceptions.d.ts.map +1 -1
  85. package/dist/cli/migrateExceptions.js +6 -4
  86. package/dist/cli/migrateExceptions.js.map +1 -1
  87. package/dist/cli/program.d.ts +1 -1
  88. package/dist/cli/program.d.ts.map +1 -1
  89. package/dist/cli/runMain.d.ts +3 -3
  90. package/dist/cli/runMain.d.ts.map +1 -1
  91. package/dist/cli/runMain.js.map +1 -1
  92. package/dist/cli/shrink.d.ts +3 -3
  93. package/dist/cli/shrink.d.ts.map +1 -1
  94. package/dist/cli/shrink.js.map +1 -1
  95. package/dist/config/decode.d.ts +1 -1
  96. package/dist/config/decode.d.ts.map +1 -1
  97. package/dist/config/decode.js +1 -2
  98. package/dist/config/decode.js.map +1 -1
  99. package/dist/config/load.js +2 -2
  100. package/dist/config/load.js.map +1 -1
  101. package/dist/config/resolve.d.ts +1 -1
  102. package/dist/decoded.d.ts +2 -3
  103. package/dist/decoded.d.ts.map +1 -1
  104. package/dist/decoded.js +6 -4
  105. package/dist/decoded.js.map +1 -1
  106. package/dist/docs/documentedModule.d.ts +0 -2
  107. package/dist/docs/documentedModule.d.ts.map +1 -1
  108. package/dist/docs/documentedModule.js +0 -3
  109. package/dist/docs/documentedModule.js.map +1 -1
  110. package/dist/docs/importFindings.d.ts.map +1 -1
  111. package/dist/docs/importFindings.js +0 -3
  112. package/dist/docs/importFindings.js.map +1 -1
  113. package/dist/engine/baselineFile.js +2 -2
  114. package/dist/engine/baselineFile.js.map +1 -1
  115. package/dist/engine/runRules.d.ts +3 -4
  116. package/dist/engine/runRules.d.ts.map +1 -1
  117. package/dist/engine/runRules.js +23 -8
  118. package/dist/engine/runRules.js.map +1 -1
  119. package/dist/engine/session.d.ts +4 -3
  120. package/dist/engine/session.d.ts.map +1 -1
  121. package/dist/engine/session.js +6 -7
  122. package/dist/engine/session.js.map +1 -1
  123. package/dist/exceptions/declaration.js +2 -2
  124. package/dist/exceptions/declaration.js.map +1 -1
  125. package/dist/exceptions/registry.d.ts.map +1 -1
  126. package/dist/exceptions/registry.js +2 -4
  127. package/dist/exceptions/registry.js.map +1 -1
  128. package/dist/failure.d.ts +5 -0
  129. package/dist/failure.d.ts.map +1 -1
  130. package/dist/failure.js +4 -0
  131. package/dist/failure.js.map +1 -1
  132. package/dist/git/base.d.ts +2 -1
  133. package/dist/git/base.d.ts.map +1 -1
  134. package/dist/git/base.js +6 -6
  135. package/dist/git/base.js.map +1 -1
  136. package/dist/git/command.d.ts +2 -3
  137. package/dist/git/command.d.ts.map +1 -1
  138. package/dist/git/command.js +6 -6
  139. package/dist/git/command.js.map +1 -1
  140. package/dist/git/history.d.ts +2 -2
  141. package/dist/git/history.d.ts.map +1 -1
  142. package/dist/git/history.js.map +1 -1
  143. package/dist/hooks/forwarding.js +2 -2
  144. package/dist/hooks/install.js +2 -2
  145. package/dist/hooks/install.js.map +1 -1
  146. package/dist/hooks/location.js +3 -3
  147. package/dist/hooks/preCommit.d.ts +1 -2
  148. package/dist/hooks/preCommit.d.ts.map +1 -1
  149. package/dist/hooks/preCommit.js +10 -11
  150. package/dist/hooks/preCommit.js.map +1 -1
  151. package/dist/hooks/status.js +1 -1
  152. package/dist/hooks/status.js.map +1 -1
  153. package/dist/hooks/uninstall.js +5 -5
  154. package/dist/hooks/uninstall.js.map +1 -1
  155. package/dist/imports/classifyRuntime.d.ts +10 -0
  156. package/dist/imports/classifyRuntime.d.ts.map +1 -0
  157. package/dist/imports/classifyRuntime.js +22 -0
  158. package/dist/imports/classifyRuntime.js.map +1 -0
  159. package/dist/imports/fences/declarations.d.ts.map +1 -1
  160. package/dist/imports/fences/declarations.js +1 -2
  161. package/dist/imports/fences/declarations.js.map +1 -1
  162. package/dist/imports/pnpmWorkspacePatterns.d.ts.map +1 -1
  163. package/dist/imports/pnpmWorkspacePatterns.js +2 -1
  164. package/dist/imports/pnpmWorkspacePatterns.js.map +1 -1
  165. package/dist/imports/runtime.d.ts +4 -3
  166. package/dist/imports/runtime.d.ts.map +1 -1
  167. package/dist/imports/runtime.js +35 -64
  168. package/dist/imports/runtime.js.map +1 -1
  169. package/dist/imports/withoutGenerated.d.ts +4 -2
  170. package/dist/imports/withoutGenerated.d.ts.map +1 -1
  171. package/dist/imports/withoutGenerated.js +22 -35
  172. package/dist/imports/withoutGenerated.js.map +1 -1
  173. package/dist/imports/workspace.d.ts.map +1 -1
  174. package/dist/imports/workspace.js +9 -19
  175. package/dist/imports/workspace.js.map +1 -1
  176. package/dist/inventory/collect.d.ts +5 -3
  177. package/dist/inventory/collect.d.ts.map +1 -1
  178. package/dist/inventory/collect.js +2 -1
  179. package/dist/inventory/collect.js.map +1 -1
  180. package/dist/inventory/filesystem.d.ts.map +1 -1
  181. package/dist/inventory/filesystem.js +2 -8
  182. package/dist/inventory/filesystem.js.map +1 -1
  183. package/dist/inventory/shadcnFolders.d.ts +4 -2
  184. package/dist/inventory/shadcnFolders.d.ts.map +1 -1
  185. package/dist/inventory/shadcnFolders.js.map +1 -1
  186. package/dist/inventory/trackedPaths.d.ts +5 -3
  187. package/dist/inventory/trackedPaths.d.ts.map +1 -1
  188. package/dist/inventory/trackedPaths.js +22 -24
  189. package/dist/inventory/trackedPaths.js.map +1 -1
  190. package/dist/inventory/walk.d.ts +5 -3
  191. package/dist/inventory/walk.d.ts.map +1 -1
  192. package/dist/inventory/walk.js +3 -9
  193. package/dist/inventory/walk.js.map +1 -1
  194. package/dist/manifests/entryPoints.d.ts.map +1 -1
  195. package/dist/manifests/entryPoints.js +2 -12
  196. package/dist/manifests/entryPoints.js.map +1 -1
  197. package/dist/manifests/sorted.d.ts +6 -5
  198. package/dist/manifests/sorted.d.ts.map +1 -1
  199. package/dist/manifests/sorted.js +14 -8
  200. package/dist/manifests/sorted.js.map +1 -1
  201. package/dist/naming/packageLayout.d.ts.map +1 -1
  202. package/dist/naming/packageLayout.js +2 -12
  203. package/dist/naming/packageLayout.js.map +1 -1
  204. package/dist/rule.d.ts +15 -10
  205. package/dist/rule.d.ts.map +1 -1
  206. package/dist/rule.js +9 -1
  207. package/dist/rule.js.map +1 -1
  208. package/dist/rules/biome.d.ts.map +1 -1
  209. package/dist/rules/biome.js +7 -4
  210. package/dist/rules/biome.js.map +1 -1
  211. package/dist/rules/builtIn.d.ts +14 -14
  212. package/dist/rules/builtIn.d.ts.map +1 -1
  213. package/dist/rules/builtIn.js +2 -0
  214. package/dist/rules/builtIn.js.map +1 -1
  215. package/dist/rules/comments/maxPerFile.d.ts +1 -1
  216. package/dist/rules/comments/maxPerFile.d.ts.map +1 -1
  217. package/dist/rules/comments/noBanner.d.ts +1 -1
  218. package/dist/rules/comments/noBanner.d.ts.map +1 -1
  219. package/dist/rules/comments/noEnvironmentPragma.d.ts +1 -1
  220. package/dist/rules/comments/noEnvironmentPragma.d.ts.map +1 -1
  221. package/dist/rules/comments/noEnvironmentPragma.js +1 -1
  222. package/dist/rules/comments/noEnvironmentPragma.js.map +1 -1
  223. package/dist/rules/comments/noJsdoc.d.ts +1 -1
  224. package/dist/rules/comments/noJsdoc.d.ts.map +1 -1
  225. package/dist/rules/comments/noLineReference.d.ts +1 -1
  226. package/dist/rules/comments/noLineReference.d.ts.map +1 -1
  227. package/dist/rules/comments/noPrReference.d.ts +1 -1
  228. package/dist/rules/comments/noPrReference.d.ts.map +1 -1
  229. package/dist/rules/comments/noTodo.d.ts +1 -1
  230. package/dist/rules/comments/noTodo.d.ts.map +1 -1
  231. package/dist/rules/docs/references.d.ts +1 -1
  232. package/dist/rules/docs/references.d.ts.map +1 -1
  233. package/dist/rules/docs/references.js +5 -8
  234. package/dist/rules/docs/references.js.map +1 -1
  235. package/dist/rules/docs/unversionedInstalls.d.ts +1 -1
  236. package/dist/rules/docs/unversionedInstalls.d.ts.map +1 -1
  237. package/dist/rules/docs/unversionedInstalls.js +1 -1
  238. package/dist/rules/docs/unversionedInstalls.js.map +1 -1
  239. package/dist/rules/effect/boundary.d.ts +1 -1
  240. package/dist/rules/effect/boundary.d.ts.map +1 -1
  241. package/dist/rules/effect/serviceParameters.d.ts +1 -1
  242. package/dist/rules/effect/serviceParameters.d.ts.map +1 -1
  243. package/dist/rules/effect/serviceTypes.d.ts.map +1 -1
  244. package/dist/rules/effect/serviceTypes.js +10 -0
  245. package/dist/rules/effect/serviceTypes.js.map +1 -1
  246. package/dist/rules/files/distinctCase.d.ts +1 -1
  247. package/dist/rules/files/distinctCase.d.ts.map +1 -1
  248. package/dist/rules/files/folderNames.d.ts +1 -1
  249. package/dist/rules/files/folderNames.d.ts.map +1 -1
  250. package/dist/rules/files/namedAfterExport.d.ts +1 -1
  251. package/dist/rules/files/namedAfterExport.d.ts.map +1 -1
  252. package/dist/rules/files/otherNames.d.ts +1 -1
  253. package/dist/rules/files/otherNames.d.ts.map +1 -1
  254. package/dist/rules/files/packageImports.d.ts.map +1 -1
  255. package/dist/rules/files/packageImports.js +2 -13
  256. package/dist/rules/files/packageImports.js.map +1 -1
  257. package/dist/rules/imports/aliased.d.ts +1 -1
  258. package/dist/rules/imports/aliased.d.ts.map +1 -1
  259. package/dist/rules/imports/cycles.d.ts +1 -1
  260. package/dist/rules/imports/cycles.d.ts.map +1 -1
  261. package/dist/rules/imports/fences.d.ts +1 -1
  262. package/dist/rules/imports/fences.d.ts.map +1 -1
  263. package/dist/rules/imports/manifest.d.ts +1 -1
  264. package/dist/rules/imports/manifest.d.ts.map +1 -1
  265. package/dist/rules/imports/manifest.js +14 -32
  266. package/dist/rules/imports/manifest.js.map +1 -1
  267. package/dist/rules/imports/noTestCode.d.ts +1 -1
  268. package/dist/rules/imports/noTestCode.d.ts.map +1 -1
  269. package/dist/rules/imports/resolvable.d.ts +1 -1
  270. package/dist/rules/imports/resolvable.d.ts.map +1 -1
  271. package/dist/rules/imports/resolvable.js +4 -3
  272. package/dist/rules/imports/resolvable.js.map +1 -1
  273. package/dist/rules/imports/runtime.d.ts +1 -1
  274. package/dist/rules/imports/runtime.d.ts.map +1 -1
  275. package/dist/rules/imports/runtime.js +29 -25
  276. package/dist/rules/imports/runtime.js.map +1 -1
  277. package/dist/rules/manifestsApplication.d.ts +1 -1
  278. package/dist/rules/manifestsApplication.d.ts.map +1 -1
  279. package/dist/rules/manifestsApplication.js +2 -12
  280. package/dist/rules/manifestsApplication.js.map +1 -1
  281. package/dist/rules/manifestsExportsShape.d.ts +1 -1
  282. package/dist/rules/manifestsExportsShape.d.ts.map +1 -1
  283. package/dist/rules/manifestsExportsShape.js +12 -7
  284. package/dist/rules/manifestsExportsShape.js.map +1 -1
  285. package/dist/rules/manifestsSorted.d.ts +1 -1
  286. package/dist/rules/manifestsSorted.d.ts.map +1 -1
  287. package/dist/rules/manifestsSorted.js +10 -14
  288. package/dist/rules/manifestsSorted.js.map +1 -1
  289. package/dist/rules/manifestsSourceFirst.d.ts +1 -1
  290. package/dist/rules/manifestsSourceFirst.d.ts.map +1 -1
  291. package/dist/rules/manifestsSourceFirst.js +20 -23
  292. package/dist/rules/manifestsSourceFirst.js.map +1 -1
  293. package/dist/rules/manifestsValid.d.ts +2 -0
  294. package/dist/rules/manifestsValid.d.ts.map +1 -0
  295. package/dist/rules/manifestsValid.js +10 -0
  296. package/dist/rules/manifestsValid.js.map +1 -0
  297. package/dist/rules/maxDepth.d.ts +1 -1
  298. package/dist/rules/maxDepth.d.ts.map +1 -1
  299. package/dist/rules/maxLines.d.ts +1 -1
  300. package/dist/rules/maxLines.d.ts.map +1 -1
  301. package/dist/rules/noBarrel.d.ts +1 -1
  302. package/dist/rules/noBarrel.d.ts.map +1 -1
  303. package/dist/rules/react/jsxConditionals.d.ts +1 -1
  304. package/dist/rules/react/jsxConditionals.d.ts.map +1 -1
  305. package/dist/rules/stories/authSql.d.ts +1 -1
  306. package/dist/rules/stories/authSql.d.ts.map +1 -1
  307. package/dist/rules/stories/domainOutcomes.d.ts +1 -1
  308. package/dist/rules/stories/domainOutcomes.d.ts.map +1 -1
  309. package/dist/rules/stories/domainOutcomes.js +3 -3
  310. package/dist/rules/stories/domainOutcomes.js.map +1 -1
  311. package/dist/rules/stories/engine.d.ts +1 -1
  312. package/dist/rules/stories/engine.d.ts.map +1 -1
  313. package/dist/rules/stories/groupedOutcomes.d.ts +1 -1
  314. package/dist/rules/stories/groupedOutcomes.d.ts.map +1 -1
  315. package/dist/rules/stories/groupedOutcomes.js +2 -2
  316. package/dist/rules/stories/groupedOutcomes.js.map +1 -1
  317. package/dist/rules/stories/httpStatus.d.ts +1 -1
  318. package/dist/rules/stories/httpStatus.d.ts.map +1 -1
  319. package/dist/rules/stories/namedValues.d.ts +1 -1
  320. package/dist/rules/stories/namedValues.d.ts.map +1 -1
  321. package/dist/rules/stories/noExpect.d.ts +1 -1
  322. package/dist/rules/stories/noExpect.d.ts.map +1 -1
  323. package/dist/rules/stories/noLimitImports.d.ts +1 -1
  324. package/dist/rules/stories/noLimitImports.d.ts.map +1 -1
  325. package/dist/rules/stories/prerequisites.d.ts.map +1 -1
  326. package/dist/rules/stories/prerequisites.js +3 -6
  327. package/dist/rules/stories/prerequisites.js.map +1 -1
  328. package/dist/rules/stories/queueSql.d.ts +1 -1
  329. package/dist/rules/stories/queueSql.d.ts.map +1 -1
  330. package/dist/rules/stories/setup.d.ts +1 -1
  331. package/dist/rules/stories/setup.d.ts.map +1 -1
  332. package/dist/rules/stories/sources.d.ts +4 -0
  333. package/dist/rules/stories/sources.d.ts.map +1 -0
  334. package/dist/rules/stories/{specSources.js → sources.js} +6 -6
  335. package/dist/rules/stories/sources.js.map +1 -0
  336. package/dist/rules/stories/specHelpers.d.ts +1 -1
  337. package/dist/rules/stories/specHelpers.d.ts.map +1 -1
  338. package/dist/rules/stories/specs.d.ts +1 -1
  339. package/dist/rules/stories/specs.d.ts.map +1 -1
  340. package/dist/rules/stories/waitOnEvents.d.ts +1 -1
  341. package/dist/rules/stories/waitOnEvents.d.ts.map +1 -1
  342. package/dist/rules/stories/waitOnEvents.js +4 -4
  343. package/dist/rules/stories/waitOnEvents.js.map +1 -1
  344. package/dist/rules/suppressions/biome/declarations.d.ts.map +1 -1
  345. package/dist/rules/suppressions/biome/declarations.js +2 -4
  346. package/dist/rules/suppressions/biome/declarations.js.map +1 -1
  347. package/dist/rules/suppressions/biome/resolvePackage.d.ts.map +1 -1
  348. package/dist/rules/suppressions/biome/resolvePackage.js +3 -15
  349. package/dist/rules/suppressions/biome/resolvePackage.js.map +1 -1
  350. package/dist/rules/suppressions/biomeOverrides.d.ts +1 -1
  351. package/dist/rules/suppressions/biomeOverrides.d.ts.map +1 -1
  352. package/dist/rules/suppressions/biomeRecommended.d.ts +6 -3
  353. package/dist/rules/suppressions/biomeRecommended.d.ts.map +1 -1
  354. package/dist/rules/suppressions/biomeRecommended.js +10 -7
  355. package/dist/rules/suppressions/biomeRecommended.js.map +1 -1
  356. package/dist/rules/suppressions/noDoubleCast.d.ts +1 -1
  357. package/dist/rules/suppressions/noDoubleCast.d.ts.map +1 -1
  358. package/dist/rules/suppressions/noIgnoreDeprecations.d.ts +1 -1
  359. package/dist/rules/suppressions/noIgnoreDeprecations.d.ts.map +1 -1
  360. package/dist/rules/suppressions/noIgnoreDeprecations.js +7 -7
  361. package/dist/rules/suppressions/noIgnoreDeprecations.js.map +1 -1
  362. package/dist/rules/suppressions/noInline.d.ts +1 -1
  363. package/dist/rules/suppressions/noInline.d.ts.map +1 -1
  364. package/dist/rules/test-names/colocated.d.ts +1 -1
  365. package/dist/rules/test-names/colocated.d.ts.map +1 -1
  366. package/dist/rules/test-names/follow.d.ts +1 -1
  367. package/dist/rules/test-names/follow.d.ts.map +1 -1
  368. package/dist/rules/unusedCode.d.ts +1 -1
  369. package/dist/rules/unusedCode.d.ts.map +1 -1
  370. package/package.json +2 -9
  371. package/src/PackageManifest.ts +24 -0
  372. package/src/adapters/TestOutput.ts +9 -0
  373. package/src/adapters/biome/run.ts +45 -0
  374. package/src/adapters/knip/configuration.ts +2 -10
  375. package/src/adapters/knip/entryPointFindings.ts +2 -1
  376. package/src/adapters/knip/run.ts +42 -44
  377. package/src/adapters/manifestInventory.ts +87 -0
  378. package/src/adapters/manifestReader.ts +11 -0
  379. package/src/{testProjects.ts → adapters/testProjects.ts} +4 -3
  380. package/src/appTestConfig.ts +1 -1
  381. package/src/baseline/format.ts +2 -2
  382. package/src/baseline/installDriver.ts +6 -2
  383. package/src/baseline/legacy.ts +2 -2
  384. package/src/baseline/merge.ts +1 -1
  385. package/src/baseline/shards.ts +1 -1
  386. package/src/biome/exceptionConfig.ts +19 -34
  387. package/src/biome/recommendedRules.ts +19 -17
  388. package/src/biome/relocateConfig.ts +59 -0
  389. package/src/biome/report.ts +21 -14
  390. package/src/biome/withoutEntryPointImports.ts +2 -12
  391. package/src/cli/baseline.ts +3 -2
  392. package/src/cli/fix.ts +16 -18
  393. package/src/cli/lint.ts +3 -2
  394. package/src/cli/migrateBaseline.ts +4 -3
  395. package/src/cli/migrateExceptions.ts +6 -4
  396. package/src/cli/runMain.ts +4 -2
  397. package/src/cli/shrink.ts +4 -4
  398. package/src/config/decode.ts +1 -3
  399. package/src/config/load.ts +2 -2
  400. package/src/decoded.ts +9 -5
  401. package/src/docs/documentedModule.ts +1 -4
  402. package/src/docs/importFindings.ts +0 -5
  403. package/src/engine/baselineFile.ts +2 -2
  404. package/src/engine/runRules.ts +34 -15
  405. package/src/engine/session.ts +14 -11
  406. package/src/exceptions/declaration.ts +2 -2
  407. package/src/exceptions/registry.ts +2 -4
  408. package/src/failure.ts +6 -1
  409. package/src/git/base.ts +16 -13
  410. package/src/git/command.ts +10 -9
  411. package/src/git/history.ts +6 -2
  412. package/src/hooks/forwarding.ts +2 -2
  413. package/src/hooks/install.ts +2 -2
  414. package/src/hooks/location.ts +3 -3
  415. package/src/hooks/preCommit.ts +10 -16
  416. package/src/hooks/status.ts +1 -1
  417. package/src/hooks/uninstall.ts +5 -5
  418. package/src/imports/classifyRuntime.ts +30 -0
  419. package/src/imports/fences/declarations.ts +1 -3
  420. package/src/imports/pnpmWorkspacePatterns.ts +3 -1
  421. package/src/imports/runtime.ts +48 -60
  422. package/src/imports/withoutGenerated.ts +25 -38
  423. package/src/imports/workspace.ts +9 -20
  424. package/src/inventory/collect.ts +7 -4
  425. package/src/inventory/filesystem.ts +2 -10
  426. package/src/inventory/shadcnFolders.ts +4 -2
  427. package/src/inventory/trackedPaths.ts +22 -24
  428. package/src/inventory/walk.ts +7 -11
  429. package/src/manifests/entryPoints.ts +2 -12
  430. package/src/manifests/sorted.ts +24 -10
  431. package/src/naming/packageLayout.ts +2 -12
  432. package/src/rule.ts +38 -19
  433. package/src/rules/biome.ts +9 -5
  434. package/src/rules/builtIn.ts +2 -0
  435. package/src/rules/comments/noEnvironmentPragma.ts +1 -1
  436. package/src/rules/docs/references.ts +8 -10
  437. package/src/rules/docs/unversionedInstalls.ts +1 -1
  438. package/src/rules/effect/serviceTypes.ts +13 -0
  439. package/src/rules/files/packageImports.ts +2 -13
  440. package/src/rules/imports/manifest.ts +15 -32
  441. package/src/rules/imports/resolvable.ts +4 -3
  442. package/src/rules/imports/runtime.ts +41 -35
  443. package/src/rules/manifestsApplication.ts +2 -12
  444. package/src/rules/manifestsExportsShape.ts +11 -8
  445. package/src/rules/manifestsSorted.ts +13 -16
  446. package/src/rules/manifestsSourceFirst.ts +24 -24
  447. package/src/rules/manifestsValid.ts +14 -0
  448. package/src/rules/stories/domainOutcomes.ts +3 -4
  449. package/src/rules/stories/groupedOutcomes.ts +2 -3
  450. package/src/rules/stories/prerequisites.ts +4 -8
  451. package/src/rules/stories/{specSources.ts → sources.ts} +5 -5
  452. package/src/rules/stories/waitOnEvents.ts +4 -5
  453. package/src/rules/suppressions/biome/declarations.ts +2 -4
  454. package/src/rules/suppressions/biome/resolvePackage.ts +5 -21
  455. package/src/rules/suppressions/biomeRecommended.ts +14 -9
  456. package/src/rules/suppressions/noIgnoreDeprecations.ts +11 -8
  457. package/dist/biome/run.d.ts +0 -8
  458. package/dist/biome/run.d.ts.map +0 -1
  459. package/dist/biome/run.js +0 -28
  460. package/dist/biome/run.js.map +0 -1
  461. package/dist/rules/stories/specSources.d.ts +0 -4
  462. package/dist/rules/stories/specSources.d.ts.map +0 -1
  463. package/dist/rules/stories/specSources.js.map +0 -1
  464. package/dist/testProjects.d.ts.map +0 -1
  465. package/dist/testProjects.js.map +0 -1
  466. package/src/biome/run.ts +0 -41
  467. /package/dist/{testProjects.d.ts → adapters/testProjects.d.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,54 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.47.0 - 2026-10-30
4
+
5
+ ### Fixed
6
+
7
+ - Run git inventory and generated-folder checks through the shared scoped Effect git runner so cancellation reaches their child processes.
8
+ - Return a tagged setup failure with Biome's exit code and output when a failed run supplies no usable report.
9
+
10
+ ### Breaking
11
+
12
+ - Rename `git` to `run` in `git/command.ts`; change imports and calls to `run`. Remove the `Git` type alias. Use `ChildProcessSpawner.ChildProcessSpawner` from `effect/process` for service requirements.
13
+ - Move `runBiome` and `BiomeRun` from `biome/run.ts` to `adapters/biome/run.ts`; change imports to that path.
14
+ - Inventory path functions and `withoutGenerated` now return Effects instead of Promises. Compose them in Effect and provide `ChildProcessSpawner` alongside `FileSystem` for inventory collection, walking, manifest sorting and snapshots.
15
+
16
+ ## 0.46.0 - 2026-10-30
17
+
18
+ ### Added
19
+
20
+ - Export every Quality module through its file path, including the DOM environment, unit I/O guard, tooling classifier, bundle-input analysis, shadcn inventory helpers and migration-file naming helpers.
21
+
22
+ ### Changed
23
+
24
+ - `tests/domain-outcomes`, `tests/grouped-outcomes` and `tests/wait-on-events` now read every story file, whatever its suffix, so a story named after its module such as `pane.dom.test.ts` follows the same rules as a `.spec.ts`. Type tests, unit tests and `test-support` files stay out of scope. Repair the new findings, or record them with `quality baseline write --rule <rule>` for each of the three rules.
25
+
26
+ ### Fixed
27
+
28
+ - Keep plain option objects such as `RequestInit`, including options nested inside Vitest types, out of service-parameter findings when an Effect service uses the same type. Service keys, callable services and method-bearing service implementations remain checked.
29
+ - Decode package manifests once per scan through a shared Schema, report an invalid manifest once with its path before dependent checks run, and surface read failures instead of treating them as missing files.
30
+ - Decode Quality configuration, baselines, registries and declarations directly with Effect Schema.
31
+ - Rule checks retain the caller's services and interruption instead of starting independent runtimes. The deprecation check reads configuration through the supplied file system and fails when a discovered configuration cannot be read.
32
+ - Read the CI test-output policy while building its Effect Layer, keeping the synchronous Vitest configuration bridge in an adapter.
33
+ - Keep the shared Vitest configuration loadable with both bundled and native config loaders.
34
+ - Scoped Biome configs preserve malformed VCS settings so the native tool reports them instead of applying defaults.
35
+ - Interrupting rules stops Biome and knip child processes and removes their scoped temporary configs before the run ends.
36
+ - A crashing rule prints its id and original stack through `Cause.pretty`. Setup failures retain their original cause as a non-enumerable property.
37
+
38
+ ### Breaking
39
+
40
+ - Invalid manifest fields now fail `manifests/valid`; correct malformed JSON and manifest field types before running lint or fix. Optional files are absent only for `NotFound`; repair unreadable paths instead of relying on them being ignored.
41
+ - `sortManifests` reports invalid data as `ManifestFailure`; handle that tag or repair the manifest before sorting.
42
+ - `decodeWith` accepts an Effect Schema instead of a Standard Schema; pass the original Effect Schema. Rule option schemas still use Standard Schema.
43
+ - `runtimeOf` and `runtimeDeclarationProblems` return Effects; yield their results in Effect programs. `sortingOf` expects validated JSON; validate a manifest through the shared inventory before sorting. `Inventory` includes `manifestFiles`; provide the repository's manifest paths when constructing an inventory.
44
+ - `manifests/exports-shape` rejects null export entries. Remove those entries so callers can import modules through the file-preserving wildcard; record existing blocks in the baseline while adopting the rule.
45
+ - `docs/references` reports null-blocked module paths as unavailable modules instead of private APIs, and `documentedModule` returns `kind: "missing"` for them. Handle `"missing"` instead of `"private"` when using that result, and remove the export blocks before documenting those paths.
46
+ - Import `testProjects` and `TestProjectsOptions` from `@shivaedev/quality/adapters/testProjects.ts` instead of `@shivaedev/quality/testProjects.ts`. The Vitest configuration entry point now lives with its adapter; no alias remains at the old path.
47
+ - Direct callers of the configured `suppressions/no-ignore-deprecations` check must provide Effect's `FileSystem` service. The Quality CLI already supplies it; custom runners can provide `NodeFileSystem.layer` at their entry point.
48
+ - Configured rules now return an Effect. Use `yield* configured.check(inputs)` and provide the services required by the check at your application's boundary; raw `Rule.configure` implementations must return an Effect check. `defineRule` still accepts synchronous and Promise checks, now also accepts Effect checks, and supplies `context.signal` for cancellable Promise work.
49
+ - `runBiome`, `biomeReport`, `recommendedRules`, `runKnip` and `withExceptionConfig` now return Effects. Compose them with `yield*` instead of awaiting them; supply the filesystem and child-process services, and scope `withExceptionConfig` and its Effect callback. Engine scans and CLI commands that run rules require both services too.
50
+ - Rule crashes are defects rather than `SetupFailure` values. Handle expected setup failures in the error channel and use Effect cause handling for rule defects.
51
+
3
52
  ## 0.45.0 - 2026-10-30
4
53
 
5
54
  ### Added
package/README.md CHANGED
@@ -28,6 +28,12 @@ Exceptions apply first, then the baseline. With the default rule settings, remai
28
28
 
29
29
  The work has three parts: connect the repository to the shared tools once; describe an import boundary when its architecture needs one; run the gate and repair findings every day. Writing local rules is not an adoption requirement.
30
30
 
31
+ ### Rule lifecycle
32
+
33
+ `defineRule` accepts synchronous, Promise and Effect checks. Promise checks receive an abort signal as `context.signal`; pass it to cancellable APIs. Effect checks compose filesystem and child-process work in the run's scope. Configured checks return Effects and preserve their service requirements; tool checks read `FileSystem` and `ChildProcessSpawner` from the environment.
34
+
35
+ Interrupting a run stops its Biome and knip processes and removes their scoped temporary configs before it ends. A rule crash is a defect; the CLI prints the rule id and original stack. Expected setup failures retain their underlying cause without including it in enumerable error data.
36
+
31
37
  ### Effect boundaries and services
32
38
 
33
39
  `effect/boundary` checks every TypeScript or JavaScript source in Quality's inventory, including shipped code, tooling and specs. It reports async functions, methods and arrows, await (including `for await`), `new Promise(...)`, `.then(...)`, try statements and throw statements. Model the work with Effect, fail with a tagged error, and use `Effect.die` for defects. Effect's resource and finalizer primitives model cleanup.
@@ -171,7 +177,7 @@ Quality's `tests/story-setup` rule reports top-level test functions named with t
171
177
 
172
178
  Specs keep expectations visible. `tests/spec-helpers` moves all module-level helper functions out of specs and into the kit; `tests/no-expect-in-support` moves `expect` calls into the spec, except in test-support files that register tests at module top level and are not imported by any module, so nested Vitest runs can execute them as test files with real assertions. `tests/named-values` rejects numeric literals passed to `toBe` or `toHaveLength` in specs, except zero and process exit codes asserted on an `exitCode` subject: assert the observed items or use a domain name that comes from the story's inputs or the product. For HTTP statuses, import `* as HttpStatus` from `effect/http/HttpStatus` and use `HttpStatus.fromLiteral("NotFound")`; subjects named `status` or `code` do not exempt numeric assertions. A spec-local numeric const that only feeds these matchers is reported, including aliases for zero and codes. `tests/no-limit-imports` rejects importing `MAX_*` constants from a `limits` module into specs, so a story proves behavior instead of copying an implementation cap.
173
179
 
174
- Three more rules keep a spec readable as a story, as the [story-testing skill](https://github.com/ShivaeDev/platform/blob/main/packages/skills/skills/story-testing/SKILL.md) describes. They read spec files, skip type and unit tests, and exempt the same test-story prerequisites as `tests/story-specs`. `tests/domain-outcomes` reports each use of Effect's `Exit`, `Cause` or `Result` module, each `_tag` read or destructuring, and each object literal tagged `"Success"` or `"Failure"`: the kit's verb or readout returns the outcome in the domain's words, such as `"unauthorized"`, and a trait builds any failing input. A domain's own tagged value, such as `{ _tag: "Resync" }`, passes. `tests/grouped-outcomes` reports each run of two or more consecutive `expect(yield* …)` statements once, at its first statement: write the outcomes as rows of one `outcomes` call. `tests/wait-on-events` reports `Effect.sleep`, `setTimeout` and `setInterval`, calls to an imported `eventually`, Vitest's fake timers, `vi.waitFor`, and `TestClock.adjust` and `TestClock.setTime`: settle on the engine's own signal through a kit verb, and when time passing is the behaviour, advance the clock in a verb named for it.
180
+ Three more rules keep a spec readable as a story, as the [story-testing skill](https://github.com/ShivaeDev/platform/blob/main/packages/skills/skills/story-testing/SKILL.md) describes. They read every story file, whatever its suffix: any `.test` or `.spec` file outside `test-support` that is not a type or unit test, such as `orders.spec.ts`, `pane.dom.test.ts` or `orders.slow.test.ts`. The suffix says where a test sits under `tests/follow`, not whether it is a story, and `tests/story-specs` already holds every such file to the story kit. They exempt the same test-story prerequisites as `tests/story-specs`. `tests/domain-outcomes` reports each use of Effect's `Exit`, `Cause` or `Result` module, each `_tag` read or destructuring, and each object literal tagged `"Success"` or `"Failure"`: the kit's verb or readout returns the outcome in the domain's words, such as `"unauthorized"`, and a trait builds any failing input. A domain's own tagged value, such as `{ _tag: "Resync" }`, passes. `tests/grouped-outcomes` reports each run of two or more consecutive `expect(yield* …)` statements once, at its first statement: write the outcomes as rows of one `outcomes` call. `tests/wait-on-events` reports `Effect.sleep`, `setTimeout` and `setInterval`, calls to an imported `eventually`, Vitest's fake timers, `vi.waitFor`, and `TestClock.adjust` and `TestClock.setTime`: settle on the engine's own signal through a kit verb, and when time passing is the behaviour, advance the clock in a verb named for it.
175
181
 
176
182
  `boundaries/queue-sql` rejects SQL mentioning the private `pgboss.` schema. Apps use their queue definitions and let workers process jobs; there is no queue-purge API by design. `boundaries/auth-sql` rejects SQL accessing Better Auth's `user`, `account`, `session` and `verification` tables. App tables reference users by foreign key: migrations may reference only `user(id)` with `ON DELETE CASCADE` or `ON DELETE SET NULL`. Import `userReference` from `@shivaedev/identity/server/better-auth/userReference.ts` and interpolate `sql(userReference.table)` and `sql(userReference.column)` in the reference. Apps use identity for account data; `options.owners` names platform's own auth implementation and its migrations. These rules inspect SQL templates, literal query calls and query variables, and inventoried `.sql` files. They do not evaluate arbitrary runtime SQL construction.
177
183
 
@@ -240,13 +246,13 @@ For adoption, run `quality baseline write --rule code/unused` and review the rec
240
246
  `quality lint` prints each failing rule's guidance with its findings, so the finding is the reference for what to change. The built-in rules fall into these groups:
241
247
  - **Structure:** `structure/max-lines` allows 150 lines in a source file and 300 in test code, `nesting/max-depth` rejects lines indented eight tabs deep, and `structure/no-barrel` rejects `index` modules. The preset rejects every re-export, types included; when `noExportedImports` suggests `export … from`, import the name where it is used instead. A module does one job.
242
248
  - **Comments:** the `comments/*` rules reject JSDoc, TODOs, banners, line and pull request references, environment pragmas and more than two comments per file. A comment says why, never what the code already says or what it used to be. A tool pragma such as `@jsxImportSource` counts as a comment until both `comments/no-jsdoc` and `comments/max-per-file` list its tag in their `allow` option.
243
- - **Documentation:** `docs/references` checks every Markdown file in the sources except `CHANGELOG.md`, whose released history keeps the links of its release. Relative links, reference definitions and `href`/`src` attributes reach an existing file or folder inside the repository, and a heading anchor matches one GitHub forms from the target's headings. A link to the repository's own GitHub tree, named by the root `package.json` `repository` field, is checked like a relative one unless it is pinned to a commit or a release tag. A published workspace package's README is shown on npm without the repository around it, so its links that leave the package use absolute URLs. Imports in TypeScript and JavaScript code blocks, workspace module paths such as `@scope/lib/repository.ts` written as inline code, `` `name` from `module` `` phrases and a package README's API rows resolve through the owning package's `exports` to a module that is not blocked, and every named import exists in that module unless it re-exports another. A linked document such as `CLAUDE.md` beside `AGENTS.md` is checked once, through its target. `docs/unversioned-installs` rejects a version after a package name in install commands, in shell code blocks and inline code; the package's own version ranges decide what installs, and a written version goes stale with the next release. A dist-tag such as `latest` passes.
249
+ - **Documentation:** `docs/references` checks every Markdown file in the sources except `CHANGELOG.md`, whose released history keeps the links of its release. Relative links, reference definitions and `href`/`src` attributes reach an existing file or folder inside the repository, and a heading anchor matches one GitHub forms from the target's headings. A link to the repository's own GitHub tree, named by the root `package.json` `repository` field, is checked like a relative one unless it is pinned to a commit or a release tag. A published workspace package's README is shown on npm without the repository around it, so its links that leave the package use absolute URLs. Imports in TypeScript and JavaScript code blocks, workspace module paths such as `@scope/lib/repository.ts` written as inline code, `` `name` from `module` `` phrases and a package README's API rows resolve through the owning package's `exports` to an exported module, and every named import exists in that module unless it re-exports another. A linked document such as `CLAUDE.md` beside `AGENTS.md` is checked once, through its target. `docs/unversioned-installs` rejects a version after a package name in install commands, in shell code blocks and inline code; the package's own version ranges decide what installs, and a written version goes stale with the next release. A dist-tag such as `latest` passes.
244
250
  - **Suppressions:** the `suppressions/*` rules reject inline lint and compiler directives, casts through `unknown`, `any` or `never`, Biome settings that weaken a check, recommended Biome rules the preset leaves below `error`, and `ignoreDeprecations`. None of them takes exceptions. A type test (`*.typecheck.test.ts`) may use `@ts-expect-error`; a test that must pass a rejected value at run time calls the API through `Reflect.apply`.
245
251
  - **Imports:** cycles, unresolvable imports, workspace imports missing from the manifest or an entry point, relative imports that leave their folder, production imports of test code, runtime folders and fences, as described above.
246
252
  - **Names and files:** the Biome preset's naming rules and plugins, and the `files/*` rules, which name a file after its main export with its folders as the prefix. `files/named-after-export` keeps the export’s full name while the file name omits words already supplied by any folder above it. In `spaces/client/`, a component exporting `CreateSpace` lives in `Create.tsx`: `spaces/` supplies “Space” even across the intervening `client/` folder. Keep the export named `CreateSpace`; `CreateSpace.tsx` would repeat a folder name. No naming rule renames anything; the author picks the name. A name an outside system owns, such as a query parameter or an environment variable, is written as a quoted key, which the naming rules skip. A `Schema.Struct` field stays camelCase even when quoted and maps to the outside name with `Schema.encodeKeys`. Biome's naming messages print only a pattern: spell acronyms as words (`HttpClient`, `userId`, `parseUrl`) rather than turning off `strictCase` as its hint suggests, give a type no `I` prefix, and name a type parameter `T`, `T` plus a PascalCase name (`TItem`), or Effect's `A`, `E` and `R`. No rule checks these, so review does: a boolean reads as a question (`isOpen`, `canRetry`) unless the DOM or React names it (`open`, `disabled`); a schema shares its name with its type (`type Item = typeof Item.Type`); an unused parameter is removed rather than renamed with the `_` prefix TypeScript accepts. The naming rules take repository facts: `toolOwned` lists `.gitignore` patterns whose names a tool fixes, and a configured list extends the rule's defaults, so list only repository-specific additions; `content` lists snake_case content folders and files; `tests/follow` and `tests/colocated` take `suites` for test folders with their own layout, such as a Playwright suite.
247
253
  - **React:** `react/jsx-conditionals` reports `&&` and ternaries in JSX children, including nested decisions. Decide before the JSX or extract a component that receives the data and returns `null` when it has nothing to show. Inside `.map`, extract an item component that makes its own decision. Conditional attributes such as `className` are accepted. This rule owns the check, so the shared Biome preset leaves `noLeakedRender` off.
248
254
  - **Tests:** `tests/follow` and `tests/colocated` keep a test beside the code it covers, named `<file>[.<modifier>].test.ts` or `<behaviour>[.<modifier>].spec.ts` with at most one modifier of `dom`, `slow`, `typecheck` and `unit`; a unit test runs without the DOM, so `.unit.dom` is rejected. `tests/colocated` always treats `__tests__/` as a test folder. It treats `test/`, `tests/` and `spec/` as test folders only when their directly contained checked files are all tests or test support; a product folder with source beside its specs is an ordinary source folder. Declared `suites` keep their own layout. Shared test support belongs in `test-support/`, the sanctioned test-only folder. A test covering a whole module may sit at its root or directly beside its folder. The story rules above keep setup in the kit.
249
- - **Manifests:** `manifests/sorted` keeps every `package.json` in sort-package-json order, and `manifests/source-first` puts the `source` condition first in `exports` and `imports`. `manifests/exports-shape` checks the package root and workspace members with exports. They use one file-preserving TypeScript wildcard: for example, `./*.ts` maps to `./src/*.ts`, `./dist/*.d.ts` and `./dist/*.js` under `source`, `types` and `default`. A subtree pattern such as `./server/*.ts` keeps that same subtree in its targets. An optional root entry, exact-path non-code assets such as JSON presets, `./package.json` and `null` blocks are allowed. A package without modules, such as a dependency shell, exports only exact assets and needs no wildcard. Import each module at its path under `src/`; named aliases, flattened paths, per-file module lists and additional non-null wildcards fail. `manifests/application` keeps an application on its entry points, as described above.
255
+ - **Manifests:** `manifests/valid` decodes every repository `package.json` through one shared Schema before dependent rules run and reports each invalid manifest once with its file path. Read failures other than `NotFound` fail the scan. `manifests/sorted` keeps every `package.json` in sort-package-json order, and `manifests/source-first` puts the `source` condition first in `exports` and `imports`. `manifests/exports-shape` checks the package root and workspace members with exports. They use one file-preserving TypeScript wildcard: for example, `./*.ts` maps to `./src/*.ts`, `./dist/*.d.ts` and `./dist/*.js` under `source`, `types` and `default`. A subtree pattern such as `./server/*.ts` keeps that same subtree in its targets. An optional root entry and exact-path non-code assets such as JSON presets and `./package.json` are allowed. Every module remains importable; `null` export entries fail with a request to remove the block. A package without modules, such as a dependency shell, exports only exact assets and needs no wildcard. Import each module at its path under `src/`; named aliases, flattened paths, per-file module lists and additional wildcards fail. `manifests/application` keeps an application on its entry points, as described above.
250
256
  - **Biome:** the `biome` rule reports Biome's error findings as `biome/<category>`. A Biome run that fails without an error finding, such as one whose config leaves no file to check, fails lint and fix with Biome's message. The preset leaves out the `.worktrees` folder at the root, so a checkout does not lint its linked worktrees, while a worktree inside it lints all of its own files. The preset's plugins ban ambient time, randomness, `console` and `process.env` in favour of Effect's services.
251
257
 
252
258
  ### Decide before JSX
@@ -304,7 +310,7 @@ Import names from their defining module; there is no root entry. The package's `
304
310
  | `imports/fence.ts` | `fence` |
305
311
  | `imports/fences/selectors.ts` | `packages`, `folders`, `files`, `modules`, `scopes`, `anyOf`, `workspace`, `anything`, `external` |
306
312
  | `imports/fences/model.ts` | `Fence`, `Target`, `Selector`, `Prohibition`, `Examples`, `Chain`, `ExampleStep`, `External` |
307
- | `testProjects.ts` | `testProjects`, `TestProjectsOptions` |
313
+ | `adapters/testProjects.ts` | `testProjects`, `TestProjectsOptions` |
308
314
  | `appViteConfig.ts` | `appViteConfig` |
309
315
  | `appTestConfig.ts` | `appTestConfig` |
310
316
  | `naming/testName.ts` | `testName`, `isTestCode`, `isTestSupport`, `ENVIRONMENTS`, `Environment`, `TestName` |
@@ -410,7 +416,7 @@ Use this in `vitest.config.ts`. It composes `testProjects` with browser and serv
410
416
  For Vitest, install `vitest`, and add `@shivaedev/test-story` and `happy-dom` when the repository has DOM tests, then use:
411
417
 
412
418
  ```ts
413
- import { testProjects } from "@shivaedev/quality/testProjects.ts";
419
+ import { testProjects } from "@shivaedev/quality/adapters/testProjects.ts";
414
420
  import { defineConfig } from "vitest/config";
415
421
 
416
422
  export default defineConfig({ test: testProjects() });
@@ -434,7 +440,7 @@ Coverage is opt-in: `testProjects({ coverage: true })` enables Vitest's V8 provi
434
440
  Outside CI, `testProjects` sets `silent: "passed-only"` so local runs show logs only from failing tests. When `CI` is set to a nonempty value, it sets `silent: false` so CI keeps all test logs. It leaves `reporters` unset so Vitest can auto-detect its agent reporter. If a repository adds a reporter, spread `configDefaults.reporters` instead of replacing the defaults:
435
441
 
436
442
  ```ts
437
- import { testProjects } from "@shivaedev/quality/testProjects.ts";
443
+ import { testProjects } from "@shivaedev/quality/adapters/testProjects.ts";
438
444
  import { configDefaults, defineConfig } from "vitest/config";
439
445
 
440
446
  export default defineConfig({
@@ -478,4 +484,4 @@ export default defineConfig({
478
484
  Quality merges the Biome settings at lint and fix time; do not add or mirror an override in `biome.json`. Files are explicit repository paths. Biome exceptions cover individual lint rules or assist actions; whole checks, rule groups and globs are rejected. `biome/files/includes` is the directory exclusion form: keep `**` and list negative patterns naming directories, such as `!**/test-support/generated`. Quality's shipped exceptions are part of its internal policy. [Exceptions and upgrades](https://github.com/ShivaeDev/platform/blob/main/packages/quality/docs/debt-and-hooks.md#exceptions) describes subjects, stale entries and the upgrade command.
479
485
  - The source inventory and Biome have their own scopes. `quality fix` runs Biome from the config's folder; it is not restricted to the source-rule inventory.
480
486
  - The installed hook checks files on disk, not only what is staged, and uses each committing worktree's config and dependencies. Installation sets repository-local `core.hooksPath`; the hook chains an executable global pre-commit hook without changing global configuration. Either hook's failure blocks the commit. `quality hooks status` reports when git's effective hooks path does not run Quality.
481
- - Workspace imports require a declaration in the importing package’s `dependencies`, `peerDependencies` or `optionalDependencies`. Tests, `test-support`, package-root tooling folders (`script`, `scripts`, `tooling`) and package-root config files may also use `devDependencies`. Explicitly export-blocked bundle inputs may use them when no runtime module reaches those inputs in the scanned import graph; an executable or another public export keeps its imports in the runtime boundary.
487
+ - Workspace imports require a declaration in the importing package’s `dependencies`, `peerDependencies` or `optionalDependencies`. Tests, `test-support`, package-root tooling folders (`script`, `scripts`, `tooling`) and package-root config files may also use `devDependencies`. Executables and public modules keep their imports in the runtime boundary.
@@ -0,0 +1,25 @@
1
+ import { Schema } from "effect";
2
+ export declare const PackageManifest: Schema.Struct<{
3
+ readonly bin: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.$Record<Schema.String, Schema.String>]>>;
4
+ readonly dependencies: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
5
+ readonly devDependencies: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
6
+ readonly engines: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
7
+ readonly exports: Schema.optionalKey<Schema.Unknown>;
8
+ readonly imports: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>;
9
+ readonly main: Schema.optionalKey<Schema.String>;
10
+ readonly name: Schema.optionalKey<Schema.String>;
11
+ readonly optionalDependencies: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
12
+ readonly packageManager: Schema.optionalKey<Schema.String>;
13
+ readonly peerDependencies: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
14
+ readonly private: Schema.optionalKey<Schema.Boolean>;
15
+ readonly quality: Schema.optionalKey<Schema.Struct<{
16
+ readonly runtime: Schema.optionalKey<Schema.Unknown>;
17
+ }>>;
18
+ readonly repository: Schema.optionalKey<Schema.Unknown>;
19
+ readonly scripts: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
20
+ readonly workspaces: Schema.optionalKey<Schema.Union<readonly [Schema.$Array<Schema.String>, Schema.Struct<{
21
+ readonly packages: Schema.$Array<Schema.String>;
22
+ }>]>>;
23
+ }>;
24
+ export type PackageManifest = typeof PackageManifest.Type;
25
+ //# sourceMappingURL=PackageManifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PackageManifest.d.ts","sourceRoot":"","sources":["../src/PackageManifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;EAiB1B,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { Schema } from "effect";
2
+ const Dependencies = Schema.Record(Schema.String, Schema.String);
3
+ export const PackageManifest = Schema.Struct({
4
+ bin: Schema.optionalKey(Schema.Union([Schema.String, Dependencies])),
5
+ dependencies: Schema.optionalKey(Dependencies),
6
+ devDependencies: Schema.optionalKey(Dependencies),
7
+ engines: Schema.optionalKey(Dependencies),
8
+ exports: Schema.optionalKey(Schema.Unknown),
9
+ imports: Schema.optionalKey(Schema.Record(Schema.String, Schema.Unknown)),
10
+ main: Schema.optionalKey(Schema.String),
11
+ name: Schema.optionalKey(Schema.String),
12
+ optionalDependencies: Schema.optionalKey(Dependencies),
13
+ packageManager: Schema.optionalKey(Schema.String),
14
+ peerDependencies: Schema.optionalKey(Dependencies),
15
+ private: Schema.optionalKey(Schema.Boolean),
16
+ quality: Schema.optionalKey(Schema.Struct({ runtime: Schema.optionalKey(Schema.Unknown) })),
17
+ repository: Schema.optionalKey(Schema.Unknown),
18
+ scripts: Schema.optionalKey(Dependencies),
19
+ workspaces: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Struct({ packages: Schema.Array(Schema.String) })])),
20
+ });
21
+ //# sourceMappingURL=PackageManifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PackageManifest.js","sourceRoot":"","sources":["../src/PackageManifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;AAEjE,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC;IAC5C,GAAG,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC;IACpE,YAAY,EAAE,MAAM,CAAC,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,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { Config, Context, Layer } from "effect";
2
+ import type { TestUserConfig } from "vitest/config";
3
+ declare const TestOutput_base: Context.ServiceClass<TestOutput, "@shivaedev/quality/TestOutput", Pick<TestUserConfig, "silent">>;
4
+ export declare class TestOutput extends TestOutput_base {
5
+ static readonly layer: Layer.Layer<TestOutput, Config.ConfigError, never>;
6
+ }
7
+ export {};
8
+ //# sourceMappingURL=TestOutput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TestOutput.d.ts","sourceRoot":"","sources":["../../src/adapters/TestOutput.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAU,KAAK,EAAE,MAAM,QAAQ,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;;AAEpD,qBAAa,UAAW,SAAQ,eAA8F;IAC7H,MAAM,CAAC,QAAQ,CAAC,KAAK,qDAGnB;CACF"}
@@ -0,0 +1,5 @@
1
+ import { Config, Context, Effect, Layer } from "effect";
2
+ export class TestOutput extends Context.Service()("@shivaedev/quality/TestOutput") {
3
+ static layer = Layer.effect(TestOutput, Effect.map(Config.String("CI").pipe(Config.withDefault("")), (ci) => ({ silent: ci ? false : "passed-only" })));
4
+ }
5
+ //# sourceMappingURL=TestOutput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TestOutput.js","sourceRoot":"","sources":["../../src/adapters/TestOutput.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAGxD,MAAM,OAAO,UAAW,SAAQ,OAAO,CAAC,OAAO,EAA8C,CAAC,+BAA+B,CAAC;IAC7H,MAAM,CAAU,KAAK,GAAG,KAAK,CAAC,MAAM,CACnC,UAAU,EACV,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC,CAAC,CAC9G,CAAC;CACF"}
@@ -0,0 +1,17 @@
1
+ import { Effect } from "effect";
2
+ export interface BiomeRun {
3
+ readonly code: number;
4
+ readonly stderr: string;
5
+ readonly stdout: string;
6
+ }
7
+ export declare const runBiome: (root: string, args: readonly string[], exceptions?: readonly {
8
+ readonly files: readonly [string, ...string[]];
9
+ readonly reason: string;
10
+ readonly rules: readonly [string, ...string[]];
11
+ readonly subject?: string;
12
+ }[] | undefined) => Effect.Effect<{
13
+ code: number;
14
+ stderr: string;
15
+ stdout: string;
16
+ }, import("../../inventory/filesystem.ts").FilesystemFailure | import("effect/PlatformError").PlatformError | import("effect/Schema").SchemaError | import("../../failure.ts").SetupFailure, import("../../rule.ts").RuleServices>;
17
+ //# sourceMappingURL=run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/adapters/biome/run.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAC;AAMxC,MAAM,WAAW,QAAQ;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACxB;AAID,eAAO,MAAM,QAAQ;;;;;;;;;kOA4BnB,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { createRequire } from "node:module";
2
+ import process from "node:process";
3
+ import { Effect, Stream } from "effect";
4
+ import { ChildProcess, ChildProcessSpawner } from "effect/process";
5
+ import { withExceptionConfig } from "#biome/exceptionConfig.ts";
6
+ import { shadcnFolders } from "#inventory/shadcnFolders.ts";
7
+ const BIN = createRequire(import.meta.url).resolve("@biomejs/biome/bin/biome");
8
+ export const runBiome = Effect.fn("Biome.runBiome")(function* (root, args, exceptions = []) {
9
+ const folders = yield* shadcnFolders(root);
10
+ const toolOwned = [
11
+ {
12
+ files: ["**", "!**/pnpm-lock.yaml", ...folders.map((folder) => `!${folder}`)],
13
+ reason: "pnpm writes its lockfiles; components.json assigns UI folders to the shadcn CLI.",
14
+ rules: ["biome/files/includes"],
15
+ },
16
+ ];
17
+ return yield* Effect.scoped(withExceptionConfig(root, [...exceptions, ...toolOwned], (configArgs) => Effect.gen(function* () {
18
+ const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
19
+ const child = yield* spawner.spawn(ChildProcess.make(process.execPath, [BIN, ...args, ...configArgs, "--colors=off"], { cwd: root, stdin: "ignore" }));
20
+ const [stdout, stderr, code] = yield* Effect.all([Stream.mkString(Stream.decodeText(child.stdout)), Stream.mkString(Stream.decodeText(child.stderr)), child.exitCode], { concurrency: "unbounded" });
21
+ return { code: Number(code), stderr, stdout };
22
+ })));
23
+ });
24
+ //# sourceMappingURL=run.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.js","sourceRoot":"","sources":["../../../src/adapters/biome/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAQ5D,MAAM,GAAG,GAAG,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAE/E,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,EAAE,CAAC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CAAC,QAAQ,CAAC,EACpH,EAAE,WAAW,EAAE,WAAW,EAAE,CAC5B,CAAC;QACF,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAC/C,CAAC,CAAC,CACF,CACD,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../src/adapters/knip/configuration.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAsB3C,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CzD"}
1
+ {"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../src/adapters/knip/configuration.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAe3C,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CzD"}
@@ -1,14 +1,8 @@
1
1
  import { posix } from "node:path";
2
- import { Schema } from "effect";
2
+ import { readPackageManifest } from "#adapters/manifestInventory.ts";
3
3
  import { exportedModule, exportTargets } from "#imports/packageExports.ts";
4
4
  import { packageOf, workspacePackages } from "#imports/workspace.ts";
5
5
  import { KNIP_ISSUES } from "./findings.js";
6
- const Manifest = Schema.Struct({
7
- bin: Schema.optional(Schema.Unknown),
8
- exports: Schema.optional(Schema.Unknown),
9
- imports: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
10
- scripts: Schema.optional(Schema.Record(Schema.String, Schema.String)),
11
- });
12
6
  const ENTRIES = ["**/*.{test,spec,stories,story}.{ts,tsx,mts,cts,js,jsx,mjs,cjs}", "src/test-support/**", "*.config.{ts,mts,cts,js,mjs,cjs}"];
13
7
  function importPaths(imports) {
14
8
  return Object.fromEntries(Object.entries(imports).flatMap(([name, target]) => {
@@ -20,8 +14,7 @@ function importPaths(imports) {
20
14
  export async function knipConfiguration(inputs) {
21
15
  const packages = await workspacePackages(inputs);
22
16
  const manifests = await Promise.all([".", ...packages.map(({ directory }) => directory)].map(async (directory) => {
23
- const text = await inputs.readText(posix.join(directory, "package.json"));
24
- const manifest = Schema.decodeUnknownSync(Schema.fromJsonString(Manifest))(text ?? "{}");
17
+ const manifest = (await readPackageManifest(inputs.readText, posix.join(directory, "package.json"))) ?? {};
25
18
  return { directory, manifest };
26
19
  }));
27
20
  const scripted = new Set(manifests.flatMap(({ directory, manifest }) => Object.values(manifest.scripts ?? {}).flatMap((script) => script.split(/[\s'"`;|&()]+/u).map((word) => posix.join(directory, word)))));
@@ -1 +1 @@
1
- {"version":3,"file":"configuration.js","sourceRoot":"","sources":["../../../src/adapters/knip/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC;IAC9B,GAAG,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC;IACpC,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC;IACxC,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IACtE,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC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uB,EAAE,KAAK;QAC9B,WAAW,EAAE,EAAE;QACf,YAAY,EAAE,EAAE;QAChB,aAAa,EAAE,EAAE;QACjB,gBAAgB,EAAE,EAAE;QACpB,gBAAgB,EAAE,EAAE;QACpB,OAAO,EAAE,WAAW;QACpB,mBAAmB,EAAE,KAAK;QAC1B,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;QACrE,IAAI,EAAE,EAAE;QACR,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC;KAC1C,CAAC;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"entryPointFindings.d.ts","sourceRoot":"","sources":["../../../src/adapters/knip/entryPointFindings.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGrD,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAuDlG"}
1
+ {"version":3,"file":"entryPointFindings.d.ts","sourceRoot":"","sources":["../../../src/adapters/knip/entryPointFindings.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGrD,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAuDlG"}
@@ -1,4 +1,5 @@
1
1
  import { join, posix } from "node:path";
2
+ import { readPackageManifest } from "#adapters/manifestInventory.ts";
2
3
  import { ambientModules } from "#imports/ambient.ts";
3
4
  import { importGraph } from "#imports/graph.ts";
4
5
  import { isTooling } from "#imports/isTooling.ts";
@@ -18,7 +19,7 @@ export async function entryPointFindings(inputs, findings) {
18
19
  const workspace = new Map(graph.packages.map(({ name, directory }) => [name, directory]));
19
20
  const directories = [".", ...graph.packages.map(({ directory }) => directory)];
20
21
  const policies = new Map(await Promise.all(directories.map(async (directory) => {
21
- const manifest = JSON.parse((await inputs.readText(posix.join(directory, "package.json"))) ?? "{}");
22
+ const manifest = await readPackageManifest(inputs.readText, posix.join(directory, "package.json"));
22
23
  return [directory, isApplication(manifest) ? await entryPointsOf(inputs, directory, manifest, workspace) : []];
23
24
  })));
24
25
  function owner(path) {
@@ -1 +1 @@
1
- {"version":3,"file":"entryPointFindings.js","sourceRoot":"","sources":["../../../src/adapters/knip/entryPointFindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,MAAkB,EAAE,QAAkB;IAC9E,MAAM,KAAK,GAAG,MAAM,WAAW,CAAC,MAAM,CAAC,CAAC;IACxC,MAAM,SAAS,GAAG,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3C,MAAM,OAAO,GAAG,cAAc,CAC7B,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAC/B,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,CAA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ClH,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC"}
@@ -1,3 +1,5 @@
1
+ import { Effect, FileSystem } from "effect";
2
+ import { ChildProcessSpawner } from "effect/process";
1
3
  import type { RuleInputs } from "#rule.ts";
2
- export declare function runKnip(inputs: RuleInputs): Promise<import("#rule.ts").Findings>;
4
+ export declare const runKnip: (inputs: RuleInputs) => Effect.Effect<import("#rule.ts").Findings, Error | import("effect/PlatformError").PlatformError, ChildProcessSpawner.ChildProcessSpawner | FileSystem.FileSystem>;
3
5
  //# sourceMappingURL=run.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/adapters/knip/run.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAO3C,wBAAsB,OAAO,CAAC,MAAM,EAAE,UAAU,wCA8C/C"}
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/adapters/knip/run.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAU,MAAM,QAAQ,CAAC;AACpD,OAAO,EAAgB,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAEnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAO3C,eAAO,MAAM,OAAO,2LA4ClB,CAAC"}
@@ -1,21 +1,21 @@
1
1
  import { createRequire } from "node:module";
2
2
  import { basename, dirname, join, posix } from "node:path";
3
3
  import process from "node:process";
4
- import { NodeServices } from "@effect/platform-node";
5
4
  import { Effect, FileSystem, Stream } from "effect";
6
5
  import { ChildProcess, ChildProcessSpawner } from "effect/process";
6
+ import { readPackageManifest } from "#adapters/manifestInventory.ts";
7
7
  import { knipConfiguration } from "./configuration.js";
8
8
  import { entryPointFindings } from "./entryPointFindings.js";
9
9
  import { KNIP_ISSUES, knipFindings } from "./findings.js";
10
10
  import { sourceConfig } from "./sourceConfig.js";
11
11
  const BIN = join(dirname(createRequire(import.meta.url).resolve("knip")), "..", "bin", "knip.js");
12
- export async function runKnip(inputs) {
13
- if ((await inputs.readText("package.json")) === undefined) {
12
+ export const runKnip = Effect.fn("Knip.runKnip")(function* (inputs) {
13
+ if ((yield* Effect.promise(() => readPackageManifest(inputs.readText, "package.json"))) === undefined) {
14
14
  return [];
15
15
  }
16
- const configuration = await knipConfiguration(inputs);
16
+ const configuration = yield* Effect.promise(() => knipConfiguration(inputs));
17
17
  const checked = new Set([...inputs.files, ...Object.keys(configuration.workspaces).map((directory) => posix.join(directory, "package.json"))]);
18
- const findings = await Effect.runPromise(Effect.scoped(Effect.gen(function* () {
18
+ const findings = yield* Effect.scoped(Effect.gen(function* () {
19
19
  const fs = yield* FileSystem.FileSystem;
20
20
  const temporary = yield* fs.makeTempDirectoryScoped({ prefix: "quality-knip-" });
21
21
  const config = join(temporary, "knip.json");
@@ -40,7 +40,7 @@ export async function runKnip(inputs) {
40
40
  return yield* Effect.fail(new Error(`knip failed: ${stderr || `exit code ${code}`}`));
41
41
  }
42
42
  return knipFindings(stdout).filter((finding) => checked.has(finding.file));
43
- })).pipe(Effect.provide(NodeServices.layer)));
44
- return entryPointFindings(inputs, findings);
45
- }
43
+ }));
44
+ return yield* Effect.promise(() => entryPointFindings(inputs, findings));
45
+ });
46
46
  //# sourceMappingURL=run.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"run.js","sourceRoot":"","sources":["../../../src/adapters/knip/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACpD,OA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AAC;QACvF,CAAC;QACD,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5E,CAAC,CAAC,CACF,CAAC;IACF,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC1E,CAAC,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { PackageManifest } from "#PackageManifest.ts";
2
+ import type { RuleInputs } from "#rule.ts";
3
+ type ReadText = RuleInputs["readText"];
4
+ declare const ManifestFailure_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
5
+ readonly _tag: "ManifestFailure";
6
+ } & Readonly<A>;
7
+ export declare class ManifestFailure extends ManifestFailure_base<{
8
+ readonly message: string;
9
+ readonly path: string;
10
+ }> {
11
+ }
12
+ export interface ManifestEntry {
13
+ readonly manifest: PackageManifest;
14
+ readonly text: string;
15
+ }
16
+ export declare function manifestEntry(readText: ReadText, path: string): Promise<ManifestEntry | undefined>;
17
+ export declare function readPackageManifest(readText: ReadText, path: string): Promise<PackageManifest | undefined>;
18
+ export declare function manifestText(readText: ReadText, path: string): Promise<string | undefined>;
19
+ export declare function manifestFiles(inputs: Pick<RuleInputs, "readText" | "files">): readonly string[];
20
+ export declare function setManifestFiles(readText: ReadText, files: readonly string[]): void;
21
+ export declare function loadPackageManifests(readText: ReadText, files: readonly string[]): Promise<readonly ManifestFailure[]>;
22
+ export {};
23
+ //# sourceMappingURL=manifestInventory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifestInventory.d.ts","sourceRoot":"","sources":["../../src/adapters/manifestInventory.ts"],"names":[],"mappings":"AAEA,O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";
4
+ export class ManifestFailure extends Data.TaggedError("ManifestFailure") {
5
+ }
6
+ const decodeManifest = Schema.decodeUnknownResult(Schema.fromJsonString(PackageManifest));
7
+ const inventories = new WeakMap();
8
+ function inventoryFor(readText) {
9
+ const known = inventories.get(readText);
10
+ if (known !== undefined) {
11
+ return known;
12
+ }
13
+ const inventory = { entries: new Map() };
14
+ inventories.set(readText, inventory);
15
+ return inventory;
16
+ }
17
+ async function decode(readText, path) {
18
+ const text = await readText(path);
19
+ if (text === undefined) {
20
+ return undefined;
21
+ }
22
+ const decoded = decodeManifest(text);
23
+ if (Result.isFailure(decoded)) {
24
+ throw new ManifestFailure({ message: `Invalid package manifest: ${decoded.failure.message}`, path });
25
+ }
26
+ return { manifest: decoded.success, text };
27
+ }
28
+ export function manifestEntry(readText, path) {
29
+ const inventory = inventoryFor(readText);
30
+ const normalized = posix.normalize(path);
31
+ const entry = inventory.entries.get(normalized) ?? decode(readText, normalized);
32
+ inventory.entries.set(normalized, entry);
33
+ return entry;
34
+ }
35
+ export async function readPackageManifest(readText, path) {
36
+ return (await manifestEntry(readText, path))?.manifest;
37
+ }
38
+ export async function manifestText(readText, path) {
39
+ return (await manifestEntry(readText, path))?.text;
40
+ }
41
+ export function manifestFiles(inputs) {
42
+ return inventoryFor(inputs.readText).files ?? inputs.files.filter((file) => posix.basename(file) === "package.json");
43
+ }
44
+ export function setManifestFiles(readText, files) {
45
+ inventoryFor(readText).files = files;
46
+ }
47
+ export async function loadPackageManifests(readText, files) {
48
+ inventoryFor(readText).files = files;
49
+ const failures = [];
50
+ for (const file of files) {
51
+ try {
52
+ await manifestEntry(readText, file);
53
+ }
54
+ catch (cause) {
55
+ if (!(cause instanceof ManifestFailure)) {
56
+ throw cause;
57
+ }
58
+ failures.push(cause);
59
+ }
60
+ }
61
+ return failures;
62
+ }
63
+ //# sourceMappingURL=manifestInventory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifestInventory.js","sourceRoot":"","sources":["../../src/adapters/man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AC,QAAQ,CAAC,CAAC,KAAK,GAAG,KAAK,CAAC;IACrC,MAAM,QAAQ,GAAsB,EAAE,CAAC;IACvC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QAC1B,IAAI,CAAC;YACJ,MAAM,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACrC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,IAAI,CAAC,CAAC,KAAK,YAAY,eAAe,CAAC,EAAE,CAAC;gBACzC,MAAM,KAAK,CAAC;YACb,CAAC;YACD,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;IACF,CAAC;IACD,OAAO,QAAQ,CAAC;AACjB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Effect, type FileSystem } from "effect";
2
+ export declare const manifestReader: (root: string) => Effect.Effect<(path: string) => Promise<string | undefined>, never, FileSystem.FileSystem>;
3
+ //# sourceMappingURL=manifestReader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifestReader.d.ts","sourceRoot":"","sources":["../../src/adapters/manifestReader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,KAAK,UAAU,EAAE,MAAM,QAAQ,CAAC;AAIjD,eAAO,MAAM,cAAc,8GAKzB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { resolve } from "node:path";
2
+ import { Effect } from "effect";
3
+ import { readOptionalText } from "#inventory/filesystem.ts";
4
+ export const manifestReader = Effect.fn("Manifests.manifestReader")(function* (root) {
5
+ const services = yield* Effect.context();
6
+ return (path) => Effect.runPromiseWith(services)(readOptionalText(resolve(root, path)));
7
+ });
8
+ //# sourceMappingURL=manifestReader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifestReader.js","sourceRoot":"","sources":["../../src/adapters/manifestReader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAmB,MAAM,QAAQ,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,EAAE,CAAC,0BAA0B,CAAC,CAAC,QAAQ,CAAC,EAC5E,IAAY;IAEZ,MAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,EAAyB,CAAC;IAChE,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,gBAAgB,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AACzF,CAAC,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testProjects.d.ts","sourceRoot":"","sources":["../../src/adapters/testProjects.ts"],"names":[],"mappings":"AAEA,OAAO,EAA0C,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAgB5F,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IACvC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;IACtE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC7B;AAmBD,wBAAgB,YAAY,CAAC,OAAO,GAAE,mBAAwB,GAAG,cAAc,CA+C9E"}