@shivaedev/quality 0.65.0 → 0.67.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 (289) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +17 -7
  3. package/dist/adapters/asymmetricMatcher.d.ts +3 -0
  4. package/dist/adapters/asymmetricMatcher.d.ts.map +1 -0
  5. package/dist/adapters/asymmetricMatcher.js +27 -0
  6. package/dist/adapters/asymmetricMatcher.js.map +1 -0
  7. package/dist/adapters/callerContextData.d.ts +3 -0
  8. package/dist/adapters/callerContextData.d.ts.map +1 -0
  9. package/dist/adapters/callerContextData.js +42 -0
  10. package/dist/adapters/callerContextData.js.map +1 -0
  11. package/dist/adapters/contextCaptureFindings.d.ts +4 -0
  12. package/dist/adapters/contextCaptureFindings.d.ts.map +1 -0
  13. package/dist/adapters/contextCaptureFindings.js +49 -0
  14. package/dist/adapters/contextCaptureFindings.js.map +1 -0
  15. package/dist/adapters/import-compiler/browserChecker.d.ts +4 -0
  16. package/dist/adapters/import-compiler/browserChecker.d.ts.map +1 -0
  17. package/dist/adapters/import-compiler/browserChecker.js +4 -0
  18. package/dist/adapters/import-compiler/browserChecker.js.map +1 -0
  19. package/dist/adapters/import-compiler/departures.d.ts +5 -0
  20. package/dist/adapters/import-compiler/departures.d.ts.map +1 -0
  21. package/dist/adapters/import-compiler/departures.js +5 -0
  22. package/dist/adapters/import-compiler/departures.js.map +1 -0
  23. package/dist/adapters/import-compiler/graph.d.ts +4 -0
  24. package/dist/adapters/import-compiler/graph.d.ts.map +1 -0
  25. package/dist/adapters/import-compiler/graph.js +6 -0
  26. package/dist/adapters/import-compiler/graph.js.map +1 -0
  27. package/dist/adapters/import-compiler/service.d.ts +10 -0
  28. package/dist/adapters/import-compiler/service.d.ts.map +1 -0
  29. package/dist/adapters/import-compiler/service.js +16 -0
  30. package/dist/adapters/import-compiler/service.js.map +1 -0
  31. package/dist/adapters/initializerDependency.d.ts +3 -0
  32. package/dist/adapters/initializerDependency.d.ts.map +1 -0
  33. package/dist/adapters/initializerDependency.js +53 -0
  34. package/dist/adapters/initializerDependency.js.map +1 -0
  35. package/dist/adapters/knip/configuration.d.ts.map +1 -1
  36. package/dist/adapters/knip/configuration.js +2 -1
  37. package/dist/adapters/knip/configuration.js.map +1 -1
  38. package/dist/adapters/pureReader.d.ts +3 -0
  39. package/dist/adapters/pureReader.d.ts.map +1 -0
  40. package/dist/adapters/pureReader.js +52 -0
  41. package/dist/adapters/pureReader.js.map +1 -0
  42. package/dist/adapters/readConfig.js +1 -1
  43. package/dist/adapters/readConfig.js.map +1 -1
  44. package/dist/adapters/scriptPaths.d.ts +2 -0
  45. package/dist/adapters/scriptPaths.d.ts.map +1 -0
  46. package/dist/adapters/scriptPaths.js +5 -0
  47. package/dist/adapters/scriptPaths.js.map +1 -0
  48. package/dist/adapters/serviceDefinitionProblems.js +1 -1
  49. package/dist/adapters/serviceDefinitionProblems.js.map +1 -1
  50. package/dist/adapters/serviceFolderFindings.d.ts.map +1 -1
  51. package/dist/adapters/serviceFolderFindings.js +12 -0
  52. package/dist/adapters/serviceFolderFindings.js.map +1 -1
  53. package/dist/adapters/serviceModelFindings.d.ts +4 -0
  54. package/dist/adapters/serviceModelFindings.d.ts.map +1 -0
  55. package/dist/adapters/serviceModelFindings.js +48 -0
  56. package/dist/adapters/serviceModelFindings.js.map +1 -0
  57. package/dist/adapters/serviceModelSyntax.d.ts +5 -0
  58. package/dist/adapters/serviceModelSyntax.d.ts.map +1 -0
  59. package/dist/adapters/serviceModelSyntax.js +53 -0
  60. package/dist/adapters/serviceModelSyntax.js.map +1 -0
  61. package/dist/adapters/serviceOperationProblems.d.ts +8 -0
  62. package/dist/adapters/serviceOperationProblems.d.ts.map +1 -0
  63. package/dist/adapters/serviceOperationProblems.js +108 -0
  64. package/dist/adapters/serviceOperationProblems.js.map +1 -0
  65. package/dist/adapters/serviceStateProblems.d.ts +7 -0
  66. package/dist/adapters/serviceStateProblems.d.ts.map +1 -0
  67. package/dist/adapters/serviceStateProblems.js +66 -0
  68. package/dist/adapters/serviceStateProblems.js.map +1 -0
  69. package/dist/adapters/specReaderSources.d.ts +7 -0
  70. package/dist/adapters/specReaderSources.d.ts.map +1 -0
  71. package/dist/adapters/specReaderSources.js +73 -0
  72. package/dist/adapters/specReaderSources.js.map +1 -0
  73. package/dist/cli/args.js +2 -2
  74. package/dist/cli/args.js.map +1 -1
  75. package/dist/cli/fix.d.ts +0 -1
  76. package/dist/cli/fix.d.ts.map +1 -1
  77. package/dist/cli/fix.js +1 -1
  78. package/dist/cli/fix.js.map +1 -1
  79. package/dist/cli/limits.d.ts +2 -0
  80. package/dist/cli/limits.d.ts.map +1 -0
  81. package/dist/cli/limits.js +2 -0
  82. package/dist/cli/limits.js.map +1 -0
  83. package/dist/cli/{options.d.ts → misplaced.d.ts} +1 -1
  84. package/dist/cli/misplaced.d.ts.map +1 -0
  85. package/dist/cli/{options.js → misplaced.js} +1 -1
  86. package/dist/cli/misplaced.js.map +1 -0
  87. package/dist/cli/program.js +1 -1
  88. package/dist/cli/program.js.map +1 -1
  89. package/dist/cli/subcommands.d.ts +2 -0
  90. package/dist/cli/subcommands.d.ts.map +1 -0
  91. package/dist/cli/subcommands.js +6 -0
  92. package/dist/cli/subcommands.js.map +1 -0
  93. package/dist/cli/{messages.d.ts → usage.d.ts} +1 -2
  94. package/dist/cli/usage.d.ts.map +1 -0
  95. package/{src/cli/messages.ts → dist/cli/usage.js} +1 -6
  96. package/dist/cli/usage.js.map +1 -0
  97. package/dist/config/defaultExtensions.d.ts +2 -0
  98. package/dist/config/defaultExtensions.d.ts.map +1 -0
  99. package/{src/config/constants.ts → dist/config/defaultExtensions.js} +1 -2
  100. package/dist/config/defaultExtensions.js.map +1 -0
  101. package/dist/config/file.d.ts +2 -0
  102. package/dist/config/file.d.ts.map +1 -0
  103. package/dist/config/file.js +2 -0
  104. package/dist/config/file.js.map +1 -0
  105. package/dist/config/load.js +1 -1
  106. package/dist/config/load.js.map +1 -1
  107. package/dist/hooks/install.js +1 -1
  108. package/dist/hooks/install.js.map +1 -1
  109. package/dist/imports/browserGlobals.js +1 -1
  110. package/dist/imports/browserGlobals.js.map +1 -1
  111. package/dist/imports/departures.js +1 -1
  112. package/dist/imports/departures.js.map +1 -1
  113. package/dist/imports/graph.js +1 -1
  114. package/dist/imports/graph.js.map +1 -1
  115. package/dist/imports/testComposition.d.ts +4 -0
  116. package/dist/imports/testComposition.d.ts.map +1 -0
  117. package/dist/imports/testComposition.js +38 -0
  118. package/dist/imports/testComposition.js.map +1 -0
  119. package/dist/naming/adapters/plainData.d.ts +5 -0
  120. package/dist/naming/adapters/plainData.d.ts.map +1 -0
  121. package/dist/naming/adapters/plainData.js +77 -0
  122. package/dist/naming/adapters/plainData.js.map +1 -0
  123. package/dist/naming/constantModule.d.ts +3 -0
  124. package/dist/naming/constantModule.d.ts.map +1 -0
  125. package/dist/naming/constantModule.js +25 -0
  126. package/dist/naming/constantModule.js.map +1 -0
  127. package/dist/naming/{migrationFile.d.ts → isMigrationFile.d.ts} +1 -1
  128. package/dist/naming/isMigrationFile.d.ts.map +1 -0
  129. package/dist/naming/{migrationFile.js → isMigrationFile.js} +1 -1
  130. package/dist/naming/isMigrationFile.js.map +1 -0
  131. package/dist/naming/ownExports.d.ts +0 -1
  132. package/dist/naming/ownExports.d.ts.map +1 -1
  133. package/dist/naming/ownExports.js +11 -25
  134. package/dist/naming/ownExports.js.map +1 -1
  135. package/dist/naming/packageTests.d.ts +7 -0
  136. package/dist/naming/packageTests.d.ts.map +1 -0
  137. package/dist/naming/packageTests.js +21 -0
  138. package/dist/naming/packageTests.js.map +1 -0
  139. package/dist/naming/testCode.d.ts +4 -0
  140. package/dist/naming/testCode.d.ts.map +1 -0
  141. package/dist/naming/testCode.js +46 -0
  142. package/dist/naming/testCode.js.map +1 -0
  143. package/dist/rules/builtIn.d.ts +2 -2
  144. package/dist/rules/builtIn.d.ts.map +1 -1
  145. package/dist/rules/builtIn.js +2 -20
  146. package/dist/rules/builtIn.js.map +1 -1
  147. package/dist/rules/comments/kinds.js +1 -1
  148. package/dist/rules/comments/kinds.js.map +1 -1
  149. package/dist/rules/effect/contextCapture.d.ts +2 -0
  150. package/dist/rules/effect/contextCapture.d.ts.map +1 -0
  151. package/dist/rules/effect/contextCapture.js +9 -0
  152. package/dist/rules/effect/contextCapture.js.map +1 -0
  153. package/dist/rules/effect/policy.d.ts +2 -0
  154. package/dist/rules/effect/policy.d.ts.map +1 -0
  155. package/dist/rules/effect/policy.js +27 -0
  156. package/dist/rules/effect/policy.js.map +1 -0
  157. package/dist/rules/effect/serviceCatalog.d.ts +2 -2
  158. package/dist/rules/effect/serviceCatalog.d.ts.map +1 -1
  159. package/dist/rules/effect/serviceCatalog.js +14 -10
  160. package/dist/rules/effect/serviceCatalog.js.map +1 -1
  161. package/dist/rules/effect/serviceDefinitionAssembly.js +1 -1
  162. package/dist/rules/effect/serviceDefinitionAssembly.js.map +1 -1
  163. package/dist/rules/effect/serviceFolders.js +1 -1
  164. package/dist/rules/effect/serviceFolders.js.map +1 -1
  165. package/dist/rules/effect/serviceModel.d.ts +2 -0
  166. package/dist/rules/effect/serviceModel.d.ts.map +1 -0
  167. package/dist/rules/effect/serviceModel.js +9 -0
  168. package/dist/rules/effect/serviceModel.js.map +1 -0
  169. package/dist/rules/effect/serviceTypes.d.ts +2 -2
  170. package/dist/rules/effect/serviceTypes.d.ts.map +1 -1
  171. package/dist/rules/effect/serviceTypes.js +15 -3
  172. package/dist/rules/effect/serviceTypes.js.map +1 -1
  173. package/dist/rules/files/namedAfterExport.d.ts.map +1 -1
  174. package/dist/rules/files/namedAfterExport.js +38 -13
  175. package/dist/rules/files/namedAfterExport.js.map +1 -1
  176. package/dist/rules/imports/manifest.d.ts.map +1 -1
  177. package/dist/rules/imports/manifest.js +9 -11
  178. package/dist/rules/imports/manifest.js.map +1 -1
  179. package/dist/rules/imports/noTestCode.d.ts.map +1 -1
  180. package/dist/rules/imports/noTestCode.js +13 -9
  181. package/dist/rules/imports/noTestCode.js.map +1 -1
  182. package/dist/rules/maxLines.d.ts.map +1 -1
  183. package/dist/rules/maxLines.js +7 -2
  184. package/dist/rules/maxLines.js.map +1 -1
  185. package/dist/rules/stories/specHelpers.d.ts.map +1 -1
  186. package/dist/rules/stories/specHelpers.js +8 -4
  187. package/dist/rules/stories/specHelpers.js.map +1 -1
  188. package/dist/rules/suppressions/{directives.d.ts → in.d.ts} +1 -1
  189. package/dist/rules/suppressions/in.d.ts.map +1 -0
  190. package/dist/rules/suppressions/{directives.js → in.js} +1 -1
  191. package/dist/rules/suppressions/in.js.map +1 -0
  192. package/dist/rules/suppressions/noInline.js +1 -1
  193. package/dist/rules/suppressions/noInline.js.map +1 -1
  194. package/dist/rules/test-names/colocated.d.ts.map +1 -1
  195. package/dist/rules/test-names/colocated.js +7 -4
  196. package/dist/rules/test-names/colocated.js.map +1 -1
  197. package/dist/rules/test-names/follow.d.ts.map +1 -1
  198. package/dist/rules/test-names/follow.js +13 -6
  199. package/dist/rules/test-names/follow.js.map +1 -1
  200. package/package.json +4 -4
  201. package/src/adapters/asymmetricMatcher.ts +33 -0
  202. package/src/adapters/callerContextData.ts +46 -0
  203. package/src/adapters/contextCaptureFindings.ts +58 -0
  204. package/src/adapters/import-compiler/browserChecker.ts +5 -0
  205. package/src/adapters/import-compiler/departures.ts +9 -0
  206. package/src/adapters/import-compiler/graph.ts +9 -0
  207. package/src/adapters/import-compiler/service.ts +17 -0
  208. package/src/adapters/initializerDependency.ts +57 -0
  209. package/src/adapters/knip/configuration.ts +2 -5
  210. package/src/adapters/pureReader.ts +56 -0
  211. package/src/adapters/readConfig.ts +1 -1
  212. package/src/adapters/scriptPaths.ts +5 -0
  213. package/src/adapters/serviceDefinitionProblems.ts +1 -1
  214. package/src/adapters/serviceFolderFindings.ts +14 -0
  215. package/src/adapters/serviceModelFindings.ts +52 -0
  216. package/src/adapters/serviceModelSyntax.ts +58 -0
  217. package/src/adapters/serviceOperationProblems.ts +131 -0
  218. package/src/adapters/serviceStateProblems.ts +86 -0
  219. package/src/adapters/specReaderSources.ts +77 -0
  220. package/src/cli/args.ts +2 -2
  221. package/src/cli/fix.ts +1 -2
  222. package/src/cli/limits.ts +1 -0
  223. package/src/cli/program.ts +1 -1
  224. package/src/cli/subcommands.ts +5 -0
  225. package/{dist/cli/messages.js → src/cli/usage.ts} +0 -6
  226. package/{dist/config/constants.js → src/config/defaultExtensions.ts} +0 -2
  227. package/src/config/file.ts +1 -0
  228. package/src/config/load.ts +1 -1
  229. package/src/hooks/install.ts +1 -1
  230. package/src/imports/browserGlobals.ts +1 -1
  231. package/src/imports/departures.ts +1 -1
  232. package/src/imports/graph.ts +1 -1
  233. package/src/imports/testComposition.ts +47 -0
  234. package/src/naming/adapters/plainData.ts +88 -0
  235. package/src/naming/constantModule.ts +28 -0
  236. package/src/naming/ownExports.ts +11 -28
  237. package/src/naming/packageTests.ts +24 -0
  238. package/src/naming/testCode.ts +62 -0
  239. package/src/rules/builtIn.ts +2 -20
  240. package/src/rules/comments/kinds.ts +1 -1
  241. package/src/rules/effect/contextCapture.ts +10 -0
  242. package/src/rules/effect/policy.ts +27 -0
  243. package/src/rules/effect/serviceCatalog.ts +15 -10
  244. package/src/rules/effect/serviceDefinitionAssembly.ts +1 -1
  245. package/src/rules/effect/serviceFolders.ts +1 -1
  246. package/src/rules/effect/serviceModel.ts +10 -0
  247. package/src/rules/effect/serviceTypes.ts +15 -3
  248. package/src/rules/files/namedAfterExport.ts +43 -13
  249. package/src/rules/imports/manifest.ts +18 -10
  250. package/src/rules/imports/noTestCode.ts +13 -12
  251. package/src/rules/maxLines.ts +7 -3
  252. package/src/rules/stories/specHelpers.ts +14 -4
  253. package/src/rules/suppressions/noInline.ts +1 -1
  254. package/src/rules/test-names/colocated.ts +7 -4
  255. package/src/rules/test-names/follow.ts +13 -6
  256. package/dist/adapters/ImportCompiler.d.ts +0 -10
  257. package/dist/adapters/ImportCompiler.d.ts.map +0 -1
  258. package/dist/adapters/ImportCompiler.js +0 -16
  259. package/dist/adapters/ImportCompiler.js.map +0 -1
  260. package/dist/adapters/imports/analyzeDepartures.d.ts +0 -5
  261. package/dist/adapters/imports/analyzeDepartures.d.ts.map +0 -1
  262. package/dist/adapters/imports/analyzeDepartures.js +0 -5
  263. package/dist/adapters/imports/analyzeDepartures.js.map +0 -1
  264. package/dist/adapters/imports/analyzeGraph.d.ts +0 -4
  265. package/dist/adapters/imports/analyzeGraph.d.ts.map +0 -1
  266. package/dist/adapters/imports/analyzeGraph.js +0 -6
  267. package/dist/adapters/imports/analyzeGraph.js.map +0 -1
  268. package/dist/adapters/imports/checkBrowser.d.ts +0 -4
  269. package/dist/adapters/imports/checkBrowser.d.ts.map +0 -1
  270. package/dist/adapters/imports/checkBrowser.js +0 -4
  271. package/dist/adapters/imports/checkBrowser.js.map +0 -1
  272. package/dist/cli/messages.d.ts.map +0 -1
  273. package/dist/cli/messages.js.map +0 -1
  274. package/dist/cli/options.d.ts.map +0 -1
  275. package/dist/cli/options.js.map +0 -1
  276. package/dist/config/constants.d.ts +0 -3
  277. package/dist/config/constants.d.ts.map +0 -1
  278. package/dist/config/constants.js.map +0 -1
  279. package/dist/naming/migrationFile.d.ts.map +0 -1
  280. package/dist/naming/migrationFile.js.map +0 -1
  281. package/dist/rules/suppressions/directives.d.ts.map +0 -1
  282. package/dist/rules/suppressions/directives.js.map +0 -1
  283. package/src/adapters/ImportCompiler.ts +0 -17
  284. package/src/adapters/imports/analyzeDepartures.ts +0 -9
  285. package/src/adapters/imports/analyzeGraph.ts +0 -9
  286. package/src/adapters/imports/checkBrowser.ts +0 -5
  287. /package/src/cli/{options.ts → misplaced.ts} +0 -0
  288. /package/src/naming/{migrationFile.ts → isMigrationFile.ts} +0 -0
  289. /package/src/rules/suppressions/{directives.ts → in.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.67.0 - 2026-11-06
4
+
5
+ ### Fixed
6
+
7
+ - Classify package-owned `test/` trees beside `src/` and private workspace packages consumed only by tests as development code for dependency, test-import and line-limit checks. Production consumers keep composition packages in the production boundary.
8
+ - Recognise package-owned test suites as covering their package's source tree, and allow pure matchers and readers beside specs while keeping setup and action helpers in story kits.
9
+
10
+ ### Breaking
11
+
12
+ - Name plain-data constants modules in camelCase for words every constant shares, or use `limits.ts` for max/min/limit constants and `defaults.ts` for default constants. Rename single-constant PascalCase files such as `ProfileKey.ts` to `profileKey.ts`; split unrelated constants or group heterogeneous copy in one named record. Rename files whose names came from a private constant or an extra constant beside their one other runtime export to match that export. The same rules apply to test-support kits; computed values, schemas, Layers and functions do not count as constants.
13
+ - Direct module imports move from `config/constants.ts` to `config/file.ts` or `config/defaultExtensions.ts`, from `cli/messages.ts` to `cli/usage.ts` or `cli/subcommands.ts`, from `cli/options.ts` to `cli/misplaced.ts`, from `naming/migrationFile.ts` to `naming/isMigrationFile.ts`, and from `rules/suppressions/directives.ts` to `rules/suppressions/in.ts`. Import `MAX_FIX_ROUNDS` from `cli/limits.ts` instead of `cli/fix.ts`.
14
+
15
+ ## 0.66.0 - 2026-11-05
16
+
17
+ ### Breaking
18
+
19
+ - Import `ImportCompiler` from `@shivaedev/quality/adapters/import-compiler/service.ts` instead of `@shivaedev/quality/adapters/ImportCompiler.ts`. Its methods and single Layer remain the same.
20
+ - Replace direct imports of `analyzeGraph`, `analyzeDepartures` and `checkBrowser` from the corresponding `@shivaedev/quality/adapters/imports/` modules with `graph`, `departures` and `browserChecker` from the corresponding `@shivaedev/quality/adapters/import-compiler/` modules. Their spans now match the service operations: `ImportCompiler.graph`, `ImportCompiler.departures` and `ImportCompiler.browserChecker`.
21
+ - Enforce the service model in every `defineService` folder. Move declarations to `service.ts`, keep each operation in its own sibling file, and export it with `Effect.fn("Service.operation")`, including operations returned by owned-state factories. Yield dependencies inside operations instead of keeping them in initializer state; keep context runners in `adapters/` or `test-support/`. Existing consumers can review and record retained debt with Quality's first-adoption baseline command for `effect/service-model`, `effect/service-folders` and `effect/context-capture`.
22
+
3
23
  ## 0.65.0 - 2026-11-05
4
24
 
5
25
  ### Breaking
package/README.md CHANGED
@@ -68,6 +68,10 @@ Seed a `quality.config.ts` that registers the custom rule to test the whole gate
68
68
 
69
69
  For an existing kit, compose the lower-level helpers through its local test-support facade: `seedTree` and `removeSeededTrees` from `@shivaedev/quality/testing/adapters/tree.ts` manage fixture files; `scanned` and `findingsIn` from `@shivaedev/quality/testing/adapters/imports.ts` collect inventory and run a configured rule; `runQuality` from `@shivaedev/quality/testing/adapters/cli.ts` runs commands in process. Yield `runQuality(root, "lint")` as an Effect in the kit so it uses the story's controlled clock. These helpers use the same engine as the rule story kit.
70
70
 
71
+ ### Import compiler service
72
+
73
+ Import `ImportCompiler` from `@shivaedev/quality/adapters/import-compiler/service.ts`. Its Layer supplies the compiler operations through one `ImportCompiler.layer`; callers yield the service and call `graph`, `departures` or `browserChecker`. Each operation lives beside the service declaration and traces as `ImportCompiler.graph`, `ImportCompiler.departures` or `ImportCompiler.browserChecker`. The service owns no initializer state and requires no additional services.
74
+
71
75
  ### Dependency pins and repository hygiene
72
76
 
73
77
  `manifests/no-test-kits` rejects runtime packages that expose a `testing` module or declare `@shivaedev/test`, `@shivaedev/test-story`, `@shivaedev/test-sql`, `@shivaedev/test-kits` or `vitest` in dependencies, optional dependencies or peers. It checks explicit export names and targets, including conditions and fallback arrays, and inventoried testing modules exposed through wildcards. Blocked exports and development dependencies pass. Private applications and the test-tooling packages quality, vitest-rerun, test, test-story, test-sql and test-kits are exempt. Move reusable runtime-package helpers into test-kits and keep test dependencies in development dependencies.
@@ -88,7 +92,7 @@ export default defineConfig({
88
92
 
89
93
  `docs/agent-links` requires each inventoried `CLAUDE.md`, including dangling links, to be a symlink to an existing `AGENTS.md` file beside it. Keep the instructions in that sibling file.
90
94
 
91
- `effect/service-folders` checks folders directly beneath a `services/` grouping. Each has a `service.ts` with exactly one named exported const initialized by a direct `defineService` call. Type exports may stay; other runtime exports belong in focused files. The existing `effect/service-definition-assembly` check enforces the operation inventory. Files named `service.ts` outside this grouping keep their existing rules.
95
+ `effect/service-folders` checks every folder with a `defineService` declaration and folders directly beneath a `services/` grouping. Each has a `service.ts` with exactly one named exported const initialized by a direct `defineService` call. Type exports may stay; other runtime exports belong in focused files. The existing `effect/service-definition-assembly` check enforces the operation inventory.
92
96
 
93
97
  ### Folders that are not Effect code
94
98
 
@@ -132,7 +136,11 @@ Import and local aliases, string literals and templates without substitutions ar
132
136
 
133
137
  ### Service assemblies
134
138
 
135
- `effect/service-definition-assembly` keeps top-level `defineService` declarations as operation inventories. List `id`, `requires`, `initialize` and `methods` directly. Import a named initializer Effect or use `Effect.void`; the methods arrow returns a literal record of imported named operations or calls to imported state factories. `genericMethod` can wrap either form. Keep implementation bodies in focused files outside the assembly. Quality's existing Biome checks own `Effect.fn` span names.
139
+ `effect/service-definition-assembly` keeps top-level `defineService` declarations as operation inventories. List `id`, `requires`, `initialize` and `methods` directly. Import a named initializer Effect or use `Effect.void`; the methods arrow returns a literal record of imported named operations. A state factory may capture only owned lifetime state. `genericMethod` can wrap either form. Keep implementation bodies in focused files outside the assembly. `effect/service-model` follows each inventory entry, including state factory returns and piped bodies, to require `Effect.fn("Service.operation")`, with the service name taken from the last segment of its id. Keep each exported operation in its own sibling file, following the repository's filename conventions, including folder prefixes. It checks initializer success types and returned closures for dependencies: repositories, SQL clients, HTTP clients and configuration belong in `requires` and are yielded inside operations. Initializers hold owned caches, refs and locks, and context data captured at setup, such as a caller id or the data-only value of a native `SessionUser`, `Subject` or `Identity` tag. Caller tags are identified by their original declaration names, so import aliases preserve that role; a callable capability inside a caller value remains a dependency. The Layer registration chooses their lifetime.
140
+
141
+ `effect/service-folders` applies wherever a file declares `defineService`, as well as to conventional `services/<name>` folders. Each service has its own folder. Its declaration belongs in `service.ts` with one named service export, beside its operation files. A second declaration beside an existing `service.ts` belongs in a separate service folder.
142
+
143
+ `effect/context-capture` rejects `Effect.provideContext`, `runPromiseWith` and `runForkWith` calls in core code, including imported aliases and destructured runners. It also checks the native Context overload of `Effect.provide`; Layer provision stays available. Yield the environment instead of capturing and re-providing it; runtime bridges belong in `adapters/` or `test-support/`. These service rules permit no config exceptions or inline suppressions. To adopt the policy in an existing repository, review retained findings and record them with `quality baseline write --first-adoption --rule effect/service-model --rule effect/service-folders --rule effect/context-capture`.
136
144
 
137
145
  The rule reports hidden configurations and method records, configuration and operation spreads, computed members, local implementations and inline bodies, including in adapters and tests. It takes no config exceptions or inline suppressions. See the [service guide](https://github.com/ShivaeDev/platform/tree/main/packages/service#1-assemble-the-service-from-focused-files) for the shape.
138
146
 
@@ -207,7 +215,7 @@ For an application setup script, use `quality setup`. It installs the same hook
207
215
 
208
216
  Installing the package does not install a hook. `hooks install` writes the repository's pre-commit hook. A hook Quality did not write is kept unless `--force` replaces it. For an existing repository, `quality baseline write` records error-level findings when there is no baseline; ordinary later writes require `--rule <id>` and `--file <path>`. Each selected path must be changed since `HEAD`; stage new files first. `quality baseline write --first-adoption` also records every rule repo-wide when there is no baseline, including rules that permit config exceptions. With an existing baseline, first-adoption writes require explicit `--rule <id>` selections for a policy upgrade; omitting them refuses the write. Ordinary later writes still require changed file selections.
209
217
 
210
- When upgrading Quality, the starter and apps generated by create-app provide `pnpm baseline write --rule <id> --file <path>`. Record each new rule’s findings in the changed files, review the baseline diff, and land the upgrade before burning down that debt. Checks remain strict for findings above the recorded counts. After repairs, run `pnpm baseline tighten` to lower the touched files’ debt.
218
+ Apps generated by create-app provide `pnpm baseline write --rule <id> --file <path>` for adopting Quality upgrades in existing application code. Review the recorded findings and burn them down with `pnpm baseline tighten`; checks remain strict above the recorded counts. The starter stays free of Quality debt, so newly generated apps start with an empty baseline.
211
219
 
212
220
  Use `pnpm format --rule react/jsx-conditionals` (or `quality fix --rule react/jsx-conditionals`) for mechanical repairs. It extracts a conditional child into a variable before its return when the enclosing intrinsic elements or fragments have no attributes or other children. It preserves the conditional expression, including falsy values such as `0`, and leaves mapped children, component elements and evaluation-sensitive cases for manual repair. Remaining findings are printed and exit 1 even when the baseline covers them. The rule-specific command does not run Biome’s unsafe fixes.
213
221
 
@@ -259,6 +267,8 @@ Tooling is server code in every package, including the workspace root: files und
259
267
 
260
268
  The manifest owns ordinary workspace dependencies. An **application** is a package whose manifest depends on `@shivaedev/platform`, the dependency shell that brings every runtime piece of the ShivaeDev framework. It imports each piece by its own name without listing it: `imports/manifest` and the `biome` rule's undeclared-dependency check count an import as declared when an entry point the application declares lists the piece among its dependencies. `@shivaedev/platform` is the entry point for any code and `@shivaedev/test-story` for test code, tooling and test support only. When a private package's import would be covered by an entry point it lacks, the finding names the entry point to add. `manifests/application` asks an application for `publicHoistPattern: ["@shivaedev/*"]` in the nearest `pnpm-workspace.yaml`, searching upward from the package, because pnpm does not link the pieces where the application can resolve them otherwise. It also rejects a dependency entry beside the entry point that already brings it, such as `@shivaedev/sql` beside `@shivaedev/platform`, and names the entry to remove. A library never depends on platform, so it declares every piece it imports.
261
269
 
270
+ Quality classifies a package's own `test/**` tree beside `src/` as test code for `imports/manifest`, `imports/no-test-code` and `structure/max-lines`. Helpers there may use development dependencies and the test line cap, while production imports of those helpers still fail. A private workspace package is test composition when it is reached from tests and every external consumer is test code or another test-composition package. Package names and paths do not determine this role. Published packages, packages with a `bin` entry or a source or built module named in a non-test script, and private packages without test consumers remain production code; any production consumer, including a type import, restores production classification through the composition chain. Scripts named `test` or `test:*` remain test entry points.
271
+
262
272
  When a package promises more, put `quality.fences.config.ts` beside its `package.json`, exporting an array of fences as the default. Quality discovers this file at the repository root and in workspace packages, even when `sources` includes only their source folders. The root config does not list boundary files.
263
273
 
264
274
  A **fence** is a prohibition on imports, with a reason and one illegal and one legal example. Quality validates all discovered fences together, so duplicate names or contradictory examples stop the run. An unreadable file or invalid default export also stops the run. The `imports/fences` rule checks them with Quality's shared import graph, resolver and report.
@@ -319,7 +329,7 @@ Every package tests its real engine through its own story kit, so setup and acti
319
329
 
320
330
  Quality's `tests/story-setup` rule reports top-level test functions named with the words `seed`, `make`, `build` or `setup`, and fixture-writing calls imported from Node's `fs` or `fs/promises`. It leaves source and `test-support/` files alone. This is a check for those syntax patterns; a passing test file still needs review of what it tests.
321
331
 
322
- 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.
332
+ Specs keep expectations visible. `tests/spec-helpers` keeps setup and action helpers in the kit; pure matchers and readers may stay beside their specs. It recognises property reads and non-mutating methods that TypeScript resolves to native collections and strings, and Vitest’s imported asymmetric matcher factories such as `expect.objectContaining`. It still reports mutation, asynchronous work and unknown calls; `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.
323
333
 
324
334
  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. Together with `tests/spec-helpers`, `tests/named-values` and `tests/no-limit-imports`, they read files whose test declarations trace to a story kit, whatever their suffix: a `.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.
325
335
 
@@ -414,11 +424,11 @@ For adoption, run `quality baseline write --rule code/unused --file src/legacy.t
414
424
  - **Hidden casts:** `suppressions/no-double-cast` also checks code outside `adapters/` and `test-support/` for concrete annotations on `JSON.parse` results, unchecked `Reflect.get` bindings, SQL tagged-template row generics, identity overloads whose implementation returns `unknown`, context retagging through `Context.makeUnsafe(...mapUnsafe)`, and writes to readonly properties or native Scope state. Keep untrusted values as `unknown` and decode them with `Schema.decodeUnknownEffect`; decode SQL rows with `SqlSchema` rather than declaring their shape. Give an identity implementation its declared return type, preserve the Context service type, and use native constructors or lifecycle operations instead of changing native fields. Constructor initialization, mutable object writes and extensions that do not replace readonly fields are accepted. These checks read syntax and TypeScript declarations; they do not prove that arbitrary helper functions validate their input.
415
425
  - **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`.
416
426
  - **Imports:** cycles, unresolvable imports, workspace imports missing from the manifest or an entry point, relative imports that leave their folder (except a module’s client or server `registration.ts` or `registration.tsx` importing its own `<module>/admin/` subtree), production imports of test code, runtime folders and fences, as described above.
417
- - **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` accepts a file named after its single exported constant, such as `liveQueryWindow.ts` exporting `const liveQueryWindow`. It 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. Inside a module’s `client/admin/` or `server/admin/` subtree, file names may repeat words from above `admin/`: `src/modules/inbox/client/admin/inboxRoutes.ts` may export `inboxRoutes`. Names must still match their exports and omit words repeated by folders within the admin subtree. 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.
427
+ - **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` names a constants module in camelCase for what its exported data shares: `maxItems.ts` exports `MAX_ITEMS`, `timeouts.ts` holds `INSPECT_TIMEOUT_MILLIS` and `REMOTE_TIMEOUT_MILLIS`, `limits.ts` holds constants carrying max, min or limit, and `defaults.ts` holds constants carrying default. Each constant must carry every word of the module name, singular or plural; split unrelated constants or put heterogeneous copy in a single exported record named after itself. Only literal data, arrays and objects of it, and CONSTANT_CASE references count, with types derived from those constants allowed. Schemas, Layers, services, Effects, functions, classes and computed values stay runtime exports. One remaining runtime export names the file even beside constants; two or more use a camelCase topic file. Private constants do not name a file. The same model applies in `src/test-support`. It 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. Inside a module’s `client/admin/` or `server/admin/` subtree, file names may repeat words from above `admin/`: `src/modules/inbox/client/admin/inboxRoutes.ts` may export `inboxRoutes`. Names must still match their exports and omit words repeated by folders within the admin subtree. 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.
418
428
  - **Change keys:** `boundaries/imported-change-keys` reports literal collection and bucket names in Reactivity invalidations and mutations, SQL `invalidateOnCommit`, and the `changes` key encoders. Import the owning declaration and use its name, list, item or bucket key. Literal record IDs and bucket values are accepted, as are names at their collection declaration.
419
429
  - **SQL transactions:** `effect/sql-transact` reports native `sql.withTransaction` calls around repository writes, `transact` or `invalidateOnCommit`. Begin the outer transaction with `transact(effect, { onSqlError })` so changed keys follow its commit. The rule resolves native SQL and repository declarations and follows direct calls, pipes, local aliases and source helpers. Native read-only and raw SQL transactions and unrelated transaction methods remain supported.
420
430
  - **React:** `react/jsx-conditionals` reports `&&` and ternaries in the JSX children a component returns, including nested decisions and returned `.map` items. Decisions in a `const` above the return, JSX built inside library callbacks and conditional attributes are accepted. A ternary with two plain string or number literal branches, such as `{on ? "On" : "Off"}`, is accepted; branches that select JSX, components or computed values still need a decision before the JSX. This rule owns the check, so the shared Biome preset leaves `noLeakedRender` off.
421
- - **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.
431
+ - **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. A package-owned `test/` tree beside its `src/` is an accepted suite: `.test` files follow the corresponding `src/` path, and `.spec` files name behaviours there. This works for workspace members and standalone packages. Outside those trees, `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.
422
432
  - **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. An unreadable manifest or one removed after discovery becomes a `manifests/valid` finding. Optional lookups still treat `NotFound` as absence. `manifests/sorted` keeps every `package.json` in sort-package-json order, and `manifests/source-first` puts the `@shivaedev/source` or `source` condition first in `exports` and `imports`. `manifests/exports-shape` checks the package root and workspace members. They use one file-preserving TypeScript wildcard: for example, `./*.ts` maps to `./src/*.ts`, `./dist/*.d.ts` and `./dist/*.js` under `@shivaedev/source` (or an application’s own `source`), `types` and `default`. Packages with `"private": true` may instead map the wildcard directly to source (`"./*.ts": "./src/*.ts"`); published packages require the full source, types and default conditions. 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. When declared, the standard imports must preserve their roots: `#*.ts` maps directly to `./src/*.ts` or uses `@shivaedev/source` (or an application’s own `source`) `./src/*.ts`, types `./dist/*.d.ts` and default `./dist/*.js`; `#test/*` maps to `./src/test-support/*`. Include subfolders in specifiers, such as `#server/module.ts`. Other aliases are allowed. `manifests/application` keeps an application on its entry points, as described above.
423
433
  - **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.
424
434
 
@@ -704,4 +714,4 @@ export default defineConfig({
704
714
  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.
705
715
  - 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.
706
716
  - 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.
707
- - 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.
717
+ - Workspace imports require a declaration in the importing package’s `dependencies`, `peerDependencies` or `optionalDependencies`. Tests, `test-support`, package-owned `test/` trees beside `src/`, private test-composition packages, 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,3 @@
1
+ import ts from "typescript";
2
+ export declare function asymmetricMatcher(call: ts.CallExpression, checker: ts.TypeChecker): boolean;
3
+ //# sourceMappingURL=asymmetricMatcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asymmetricMatcher.d.ts","sourceRoot":"","sources":["../../src/adapters/asymmetricMatcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AA6B5B,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,EAAE,OAAO,EAAE,EAAE,CAAC,WAAW,GAAG,OAAO,CAG3F"}
@@ -0,0 +1,27 @@
1
+ import ts from "typescript";
2
+ import { importFrom } from "#rules/stories/importOrigin.ts";
3
+ import { unwrapped } from "#rules/stories/syntax.ts";
4
+ const MATCHERS = new Set(["any", "anything", "arrayContaining", "objectContaining", "stringContaining", "stringMatching"]);
5
+ function importedExpect(node, checker) {
6
+ const value = unwrapped(node);
7
+ if (ts.isPropertyAccessExpression(value) && value.name.text === "not") {
8
+ return importedExpect(value.expression, checker);
9
+ }
10
+ const namespace = ts.isPropertyAccessExpression(value) && value.name.text === "expect";
11
+ const receiver = namespace ? value.expression : value;
12
+ if (!ts.isIdentifier(receiver)) {
13
+ return false;
14
+ }
15
+ return (checker.getSymbolAtLocation(receiver)?.declarations?.some((declaration) => {
16
+ const from = importFrom(declaration);
17
+ return ((from === "vitest" || from === "@effect/vitest")
18
+ && (namespace
19
+ ? ts.isNamespaceImport(declaration)
20
+ : ts.isImportSpecifier(declaration) && (declaration.propertyName ?? declaration.name).text === "expect"));
21
+ }) === true);
22
+ }
23
+ export function asymmetricMatcher(call, checker) {
24
+ const target = unwrapped(call.expression);
25
+ return ts.isPropertyAccessExpression(target) && MATCHERS.has(target.name.text) && importedExpect(target.expression, checker);
26
+ }
27
+ //# sourceMappingURL=asymmetricMatcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asymmetricMatcher.js","sourceRoot":"","sources":["../../src/adapters/asymmetricMatcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAE3H,SAAS,cAAc,CAAC,IAAmB,EAAE,OAAuB;IACnE,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IAC9B,IAAI,EAAE,CAAC,0BAA0B,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC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UAAU,EAAE,OAAO,CAAC,CAAC;AAC9H,CAAC"}
@@ -0,0 +1,3 @@
1
+ import ts from "typescript";
2
+ export declare function callerContextData(checker: ts.TypeChecker, type: ts.Type, name: string): boolean;
3
+ //# sourceMappingURL=callerContextData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"callerContextData.d.ts","sourceRoot":"","sources":["../../src/adapters/callerContextData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AA2C5B,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAE/F"}
@@ -0,0 +1,42 @@
1
+ import ts from "typescript";
2
+ const CALLERS = new Set(["SessionUser", "Subject", "Identity", "SessionUserWithProviderAccounts"]);
3
+ function data(checker, value, seen) {
4
+ if (seen.has(value)) {
5
+ return true;
6
+ }
7
+ seen.add(value);
8
+ if (value.flags & (ts.TypeFlags.Any | ts.TypeFlags.Unknown)) {
9
+ return false;
10
+ }
11
+ if (value.flags
12
+ & (ts.TypeFlags.StringLike
13
+ | ts.TypeFlags.NumberLike
14
+ | ts.TypeFlags.BooleanLike
15
+ | ts.TypeFlags.ESSymbolLike
16
+ | ts.TypeFlags.BigIntLike
17
+ | ts.TypeFlags.Null
18
+ | ts.TypeFlags.Undefined
19
+ | ts.TypeFlags.Never)) {
20
+ return true;
21
+ }
22
+ if (value.isUnionOrIntersection()) {
23
+ return value.types.every((part) => data(checker, part, seen));
24
+ }
25
+ if (value.getProperty("~effect/Context/Service") !== undefined || value.getProperty("~effect/Context") !== undefined) {
26
+ return false;
27
+ }
28
+ if (value.getProperty("~effect/Effect") !== undefined) {
29
+ return true;
30
+ }
31
+ if (value.getCallSignatures().length > 0 || value.getConstructSignatures().length > 0) {
32
+ return false;
33
+ }
34
+ const element = checker.getIndexTypeOfType(value, ts.IndexKind.Number);
35
+ return element === undefined
36
+ ? value.getProperties().every((property) => data(checker, checker.getTypeOfSymbol(property), seen))
37
+ : data(checker, element, seen);
38
+ }
39
+ export function callerContextData(checker, type, name) {
40
+ return CALLERS.has(name) && data(checker, type, new Set());
41
+ }
42
+ //# sourceMappingURL=callerContextData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"callerContextData.js","sourceRoot":"","sources":["../../src/adapters/callerContextData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,iCAAiC,CAAC,CAAC,CAAC;AAEnG,SAAS,IAAI,CAAC,OAAuB,EAAE,KAAc,EAAE,IAAkB;IACxE,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,IAAI,CAAC;IACb,CAAC;IACD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAChB,IAAI,KAAK,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;QAC7D,OAAO,KAAK,CAAC;IACd,CAAC;IACD,IACC,KAAK,CAAC,KAAK;UACT,CAAC,EAAE,CAAC,SAAS,CAAC,UAAU;cACvB,EAAE,CAAC,SAAS,CAAC,UAAU;cACvB,EAAE,CAAC,SAAS,CAAC,WAAW;cACxB,EAAE,CAAC,SAAS,CAAC,YAAY;cACzB,EAAE,CAAC,SAAS,CAAC,UAAU;cACvB,EAAE,CAAC,SAAS,CAAC,IAAI;cACjB,EAAE,CAAC,SAAS,CAAC,SAAS;cACtB,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,EACrB,CAAC;QACF,OAAO,IAAI,CAAC;IACb,CAAC;IACD,IAAI,KAAK,CAAC,qBAAqB,EAAE,EAAE,CAAC;QACnC,OAAO,KAAK,CAAC,KAAK,CA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const contextCaptureFindings: (inputs: RuleInputs) => Effect.Effect<Finding[], never, never>;
4
+ //# sourceMappingURL=contextCaptureFindings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contextCaptureFindings.d.ts","sourceRoot":"","sources":["../../src/adapters/contextCaptureFindings.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAqBpD,eAAO,MAAM,sBAAsB,gEAgClC,CAAC"}
@@ -0,0 +1,49 @@
1
+ import { join } from "node:path";
2
+ import { Effect } from "effect";
3
+ import ts from "typescript";
4
+ import { effectApi } from "#adapters/serviceModelSyntax.ts";
5
+ import { effectProgram } from "#rules/effect/program.ts";
6
+ const RUNNERS = ["provideContext", "runPromiseWith", "runForkWith"];
7
+ const PROVIDERS = [...RUNNERS, "provide"];
8
+ function context(type) {
9
+ return type.isUnionOrIntersection() ? type.types.some(context) : type.getProperty("~effect/Context") !== undefined;
10
+ }
11
+ function reprovides(checker, call) {
12
+ if (RUNNERS.some((name) => effectApi(checker, call.expression, name))) {
13
+ return true;
14
+ }
15
+ if (!effectApi(checker, call.expression, "provide")) {
16
+ return false;
17
+ }
18
+ const environment = call.arguments.at(-1);
19
+ return environment !== undefined && context(checker.getTypeAtLocation(environment));
20
+ }
21
+ export const contextCaptureFindings = Effect.fn("ContextCapture.contextCaptureFindings")((inputs) => Effect.sync(() => {
22
+ const sources = inputs.sources.filter((file) => !/(?:^|\/)(?:adapters|test-support)\//u.test(file.path) && PROVIDERS.some((name) => file.text.includes(name)));
23
+ if (sources.length === 0) {
24
+ return [];
25
+ }
26
+ const program = effectProgram({ ...inputs, sources });
27
+ const checker = program.getTypeChecker();
28
+ return sources.flatMap((file) => {
29
+ const source = program.getSourceFile(join(inputs.root, file.path));
30
+ if (source === undefined) {
31
+ return [];
32
+ }
33
+ const syntax = source;
34
+ const findings = [];
35
+ function visit(node) {
36
+ if (ts.isCallExpression(node) && reprovides(checker, node)) {
37
+ findings.push({
38
+ file: file.path,
39
+ line: syntax.getLineAndCharacterOfPosition(node.getStart(syntax)).line + 1,
40
+ message: "Do not re-provide a captured Effect context in core code. Declare service requirements once and yield dependencies and the caller from the environment. Register the Layer at the host; put runtime bridges in adapters/ or test-support/.",
41
+ });
42
+ }
43
+ ts.forEachChild(node, visit);
44
+ }
45
+ visit(source);
46
+ return findings;
47
+ });
48
+ }));
49
+ //# sourceMappingURL=contextCaptureFindings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contextCaptureFindings.js","sourceRoot":"","sources":["../../src/adapters/contextCaptureFindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,MAAM,OAAO,GAAG,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,CAAC,CAAC;AACpE,MAAM,SAAS,GAAG,CAAC,GAAG,OAAO,EAAE,SAAS,CAAC,CAAC;AAE1C,SAAS,OAAO,CAAC,IAAa;IAC7B,OAAO,IAAI,CAAC,qBAAqB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC,KAAK,SAAS,CAAC;AACpH,CAAC;AAED,SAAS,UAAU,CAAC,OAAuB,EAAE,IAAuB;IACnE,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,EAAE,CA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YAC1B,OAAO,EAAE,CAAC;QACX,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,CAAC;QACtB,MAAM,QAAQ,GAAc,EAAE,CAAC;QAC/B,SAAS,KAAK,CAAC,IAAa;YAC3B,IAAI,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC;gBAC5D,QAAQ,CAAC,IAAI,CAAC;oBACb,IAAI,EAAE,IAAI,CAAC,IAAI;oBACf,IAAI,EAAE,MAAM,CAAC,6BAA6B,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC;oBAC1E,OAAO,EACN,4OAA4O;iBAC7O,CAAC,CAAC;YACJ,CAAC;YACD,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC9B,CAAC;QACD,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,OAAO,QAAQ,CAAC;IACjB,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CACF,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Effect } from "effect";
2
+ import type ts from "typescript";
3
+ export declare const browserChecker: (source: ts.SourceFile) => Effect.Effect<ts.TypeChecker, never, never>;
4
+ //# sourceMappingURL=browserChecker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browserChecker.d.ts","sourceRoot":"","sources":["../../../src/adapters/import-compiler/browserChecker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAGjC,eAAO,MAAM,cAAc,wEAAyH,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Effect } from "effect";
2
+ import { browserChecker as createBrowserChecker } from "#adapters/imports/browserChecker.ts";
3
+ export const browserChecker = Effect.fn("ImportCompiler.browserChecker")((source) => Effect.sync(() => createBrowserChecker(source)));
4
+ //# sourceMappingURL=browserChecker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browserChecker.js","sourceRoot":"","sources":["../../../src/adapters/import-compiler/browserChecker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,cAAc,IAAI,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAE7F,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,EAAE,CAAC,+BAA+B,CAAC,CAAC,CAAC,MAAqB,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { Effect } from "effect";
2
+ import type { WorkspacePackage } from "#imports/workspace.ts";
3
+ import type { RuleInputs } from "#rule.ts";
4
+ export declare const departures: (inputs: RuleInputs, packages: readonly WorkspacePackage[]) => Effect.Effect<readonly import("../../imports/departures.ts").Departure[], import("../ImportAnalysisFailure.ts").ImportAnalysisFailure, never>;
5
+ //# sourceMappingURL=departures.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"departures.d.ts","sourceRoot":"","sources":["../../../src/adapters/import-compiler/departures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,eAAO,MAAM,UAAU,8MAEtB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { Effect } from "effect";
2
+ import { analysisFailure } from "#adapters/imports/analysisFailure.ts";
3
+ import { departures as findDepartures } from "#adapters/imports/departures.ts";
4
+ export const departures = Effect.fn("ImportCompiler.departures")((inputs, packages) => Effect.try({ catch: (cause) => analysisFailure(inputs.root, cause), try: () => findDepartures(inputs, packages) }));
5
+ //# sourceMappingURL=departures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"departures.js","sourceRoot":"","sources":["../../../src/adapters/import-compiler/departures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAI/E,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,EAAE,CAAC,2BAA2B,CAAC,CAAC,CAAC,MAAkB,EAAE,QAAqC,EAAE,EAAE,CAC9H,MAAM,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,eAAe,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC,CAClH,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Effect } from "effect";
2
+ import type { RuleInputs } from "#rule.ts";
3
+ export declare const graph: (inputs: RuleInputs) => Effect.Effect<Pick<import("../../imports/graph.ts").ImportGraph, "configFindings" | "edges" | "modules" | "unresolved">, import("../ImportAnalysisFailure.ts").ImportAnalysisFailure, never>;
4
+ //# sourceMappingURL=graph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../src/adapters/import-compiler/graph.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,eAAO,MAAM,KAAK,sNAEjB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { realpathSync } from "node:fs";
2
+ import { Effect } from "effect";
3
+ import { analysisFailure } from "#adapters/imports/analysisFailure.ts";
4
+ import { graph as buildGraph } from "#adapters/imports/graph.ts";
5
+ export const graph = Effect.fn("ImportCompiler.graph")((inputs) => Effect.try({ catch: (cause) => analysisFailure(inputs.root, cause), try: () => buildGraph(inputs, realpathSync(inputs.root)) }));
6
+ //# sourceMappingURL=graph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.js","sourceRoot":"","sources":["../../../src/adapters/import-compiler/graph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAGjE,MAAM,CAAC,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC,sBAAsB,CAAC,CAAC,CAAC,MAAkB,EAAE,EAAE,CAC7E,MAAM,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,eAAe,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAC/H,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { Effect } from "effect";
2
+ import type ts from "typescript";
3
+ export declare const ImportCompiler: import("effect/Context").Service<"@shivaedev/quality/ImportCompiler", Readonly<{
4
+ readonly browserChecker: (source: ts.SourceFile) => Effect.Effect<ts.TypeChecker, never, never>;
5
+ readonly departures: (inputs: import("../../rule.ts").RuleInputs, packages: readonly import("../../imports/workspace.ts").WorkspacePackage[]) => Effect.Effect<readonly import("../../imports/departures.ts").Departure[], import("../ImportAnalysisFailure.ts").ImportAnalysisFailure, never>;
6
+ readonly graph: (inputs: import("../../rule.ts").RuleInputs) => Effect.Effect<Pick<import("../../imports/graph.ts").ImportGraph, "configFindings" | "edges" | "modules" | "unresolved">, import("../ImportAnalysisFailure.ts").ImportAnalysisFailure, never>;
7
+ }>> & {
8
+ readonly layer: import("effect/Layer").Layer<"@shivaedev/quality/ImportCompiler", never, never>;
9
+ };
10
+ //# sourceMappingURL=service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/adapters/import-compiler/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAMjC,eAAO,MAAM,cAAc;;;;;;CASzB,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { Effect } from "effect";
2
+ import { defineService } from "@shivaedev/service/defineService.ts";
3
+ import { browserChecker } from "./browserChecker.js";
4
+ import { departures } from "./departures.js";
5
+ import { graph } from "./graph.js";
6
+ export const ImportCompiler = defineService({
7
+ id: "@shivaedev/quality/ImportCompiler",
8
+ initialize: Effect.void,
9
+ methods: () => ({
10
+ browserChecker: browserChecker,
11
+ departures,
12
+ graph,
13
+ }),
14
+ requires: [],
15
+ });
16
+ //# sourceMappingURL=service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.js","sourceRoot":"","sources":["../../../src/adapters/import-compiler/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAC;IAC3C,EAAE,EAAE,mCAAmC;IACvC,UAAU,EAAE,MAAM,CAAC,IAAI;IACvB,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;QACf,cAAc,EAAE,cAAiF;QACjG,UAAU;QACV,KAAK;KACL,CAAC;IACF,QAAQ,EAAE,EAAE;CACZ,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import ts from "typescript";
2
+ export declare function initializerDependency(checker: ts.TypeChecker, type: ts.Type, seen?: Set<ts.Type>): boolean;
3
+ //# sourceMappingURL=initializerDependency.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"initializerDependency.d.ts","sourceRoot":"","sources":["../../src/adapters/initializerDependency.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AA8B5B,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,IAAI,eAAqB,GAAG,OAAO,CA0BhH"}
@@ -0,0 +1,53 @@
1
+ import ts from "typescript";
2
+ import { effectSuccess } from "#adapters/serviceModelSyntax.ts";
3
+ const DATA = ts.TypeFlags.StringLike
4
+ | ts.TypeFlags.NumberLike
5
+ | ts.TypeFlags.BooleanLike
6
+ | ts.TypeFlags.ESSymbolLike
7
+ | ts.TypeFlags.BigIntLike
8
+ | ts.TypeFlags.Null
9
+ | ts.TypeFlags.Undefined
10
+ | ts.TypeFlags.Void
11
+ | ts.TypeFlags.Never
12
+ | ts.TypeFlags.Unknown
13
+ | ts.TypeFlags.Any;
14
+ const OWNED = /\/effect\/(?:src|dist(?:\/dts)?)\/(?:Ref|SynchronizedRef|ScopedRef|Cache|ScopedCache|Semaphore|Deferred)\.(?:d\.)?ts$/u;
15
+ const COLLECTIONS = new Set(["Map", "ReadonlyMap", "Set", "ReadonlySet", "Array", "ReadonlyArray"]);
16
+ function owned(type) {
17
+ const symbol = type.getSymbol();
18
+ return (symbol?.declarations ?? []).some((declaration) => {
19
+ const path = declaration.getSourceFile().fileName.replaceAll("\\", "/");
20
+ return OWNED.test(path) || (COLLECTIONS.has(symbol?.name ?? "") && /\/lib\.[^/]+\.d\.ts$/u.test(path));
21
+ });
22
+ }
23
+ function reference(type) {
24
+ return "objectFlags" in type && typeof type.objectFlags === "number" && (type.objectFlags & ts.ObjectFlags.Reference) !== 0;
25
+ }
26
+ export function initializerDependency(checker, type, seen = new Set()) {
27
+ if (seen.has(type) || type.flags & DATA) {
28
+ return false;
29
+ }
30
+ seen.add(type);
31
+ if (type.isUnionOrIntersection()) {
32
+ return type.types.some((part) => initializerDependency(checker, part, seen));
33
+ }
34
+ const success = effectSuccess(checker, type);
35
+ if (success !== undefined) {
36
+ return initializerDependency(checker, success, seen);
37
+ }
38
+ if (owned(type)) {
39
+ const arguments_ = reference(type) ? checker.getTypeArguments(type) : [];
40
+ return arguments_.some((argument) => initializerDependency(checker, argument, seen));
41
+ }
42
+ for (const signature of type.getCallSignatures()) {
43
+ const result = signature.getReturnType();
44
+ if (effectSuccess(checker, result) !== undefined || (result.getProperty("then") !== undefined && result.getSymbol()?.name === "Promise")) {
45
+ return true;
46
+ }
47
+ if (initializerDependency(checker, result, seen)) {
48
+ return true;
49
+ }
50
+ }
51
+ return type.getProperties().some((property) => initializerDependency(checker, checker.getTypeOfSymbol(property), seen));
52
+ }
53
+ //# sourceMappingURL=initializerDependency.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"initializerDependency.js","sourceRoot":"","sources":["../../src/adapters/initializerDependency.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAEhE,MAAM,IAAI,GACT,EAAE,CAAC,SAAS,CAAC,UAAU;MACrB,EAAE,CAAC,SAAS,CAAC,UAAU;MACvB,EAAE,CAAC,SAAS,CAAC,WAAW;MACxB,EAAE,CAAC,SAAS,CAAC,YAAY;MACzB,EAAE,CAAC,SAAS,CAAC,UAAU;MACvB,EAAE,CAAC,SAAS,CAAC,IAAI;MACjB,EAAE,CAAC,SAAS,CAAC,SAAS;MACtB,EAAE,CA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,CAAC;IACD,OAAO,IAAI,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,qBAAqB,CAAC,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AACzH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../src/adapters/knip/configuration.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAsB3C,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,GAAE,SAAS,MAAM,EAAO;;;;;;;;;;;;;;;;;;;;;;;;;yBAqC/E,MAAM;;;;GAqBnB"}
1
+ {"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../src/adapters/knip/configuration.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAsB3C,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,GAAE,SAAS,MAAM,EAAO;;;;;;;;;;;;;;;;;;;;;;;;;yBAiC/E,MAAM;;;;GAqBnB"}
@@ -1,5 +1,6 @@
1
1
  import { posix } from "node:path";
2
2
  import { readPackageManifest } from "#adapters/manifestInventory.ts";
3
+ import { scriptPaths } from "#adapters/scriptPaths.ts";
3
4
  import { exportedModule, exportTargets } from "#imports/packageExports.ts";
4
5
  import { packageOf, workspacePackages } from "#imports/workspace.ts";
5
6
  import { SHADCN_FILE_GLOB } from "#inventory/shadcnFiles.ts";
@@ -26,7 +27,7 @@ export async function knipConfiguration(inputs, toolOwned = []) {
26
27
  const manifest = (await readPackageManifest(inputs.readText, posix.join(directory, "package.json"))) ?? {};
27
28
  return { directory, manifest };
28
29
  }));
29
- const scripted = new Set(manifests.flatMap(({ directory, manifest }) => Object.values(manifest.scripts ?? {}).flatMap((script) => script.split(/[\s'"`;|&()]+/u).map((word) => posix.join(directory, word)))));
30
+ const scripted = new Set(manifests.flatMap(({ directory, manifest }) => scriptPaths(directory, manifest.scripts ?? {})));
30
31
  const workspaces = manifests.map(({ directory, manifest }) => {
31
32
  const sources = inputs.sources
32
33
  .filter(({ path }) => (packageOf(packages, path)?.directory ?? ".") === directory)
@@ -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,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,OAAO,GAAG,CAAC,gEAAgE,EAAE,qBAAqB,EAAE,kCAAkC,CAAC,CAAC;AAE9I,SAAS,WAAW,CAAC,OAA0C;IAC9D,OAAO,MAAM,CAAC,WAAW,CACxB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE;QAClD,IAAI,QAAQ,GAAG,MAAM,CAAC;QACtB,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;YACnD,IAAI,mBAAmB,IAAI,MAAM,EAAE,CAAC;gBACnC,QAAQ,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;YACxC,CAAC;iBAAM,IAAI,QAAQ,IAAI,MAAM,EAAE,CAAC;gBAC/B,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC;YAC1B,CAAC;QACF,CAAC;QACD,MAAM,KA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AAC;gBAC1C,OAAO,EAAE,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC;gBACvC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,wCAAwC,EAAE,0DAA0D,CAAC,EAAE;aAC1H;SACQ,CAAC;IACZ,CAAC,CAAC,CAAC;IACH,OAAO;QACN,OAAO,EAAE,EAAE;QACX,MAAM,EAAE,EAAE;QACV,cAAc,EAAE,EAAE;QAClB,kBAAkB,EAAE,EAAE;QACtB,uBAAuB,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"}
@@ -0,0 +1,3 @@
1
+ import ts from "typescript";
2
+ export declare function pureReader(name: ts.Node, readCall: (call: ts.CallExpression) => boolean): boolean;
3
+ //# sourceMappingURL=pureReader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pureReader.d.ts","sourceRoot":"","sources":["../../src/adapters/pureReader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAoC5B,wBAAgB,UAAU,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,KAAK,OAAO,GAAG,OAAO,CAmBjG"}