@shivaedev/quality 0.74.1 → 0.74.3
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.
- package/CHANGELOG.md +16 -0
- package/README.md +6 -6
- package/dist/adapters/clientHandle.d.ts +3 -0
- package/dist/adapters/clientHandle.d.ts.map +1 -0
- package/dist/adapters/clientHandle.js +6 -0
- package/dist/adapters/clientHandle.js.map +1 -0
- package/dist/adapters/declarationTagParameter.d.ts +3 -0
- package/dist/adapters/declarationTagParameter.d.ts.map +1 -0
- package/dist/adapters/declarationTagParameter.js +125 -0
- package/dist/adapters/declarationTagParameter.js.map +1 -0
- package/dist/adapters/frameworkCallback.d.ts +1 -0
- package/dist/adapters/frameworkCallback.d.ts.map +1 -1
- package/dist/adapters/frameworkCallback.js +1 -1
- package/dist/adapters/frameworkCallback.js.map +1 -1
- package/dist/adapters/imports/departures.d.ts.map +1 -1
- package/dist/adapters/imports/departures.js +7 -1
- package/dist/adapters/imports/departures.js.map +1 -1
- package/dist/adapters/isToolConfig.d.ts.map +1 -1
- package/dist/adapters/isToolConfig.js +5 -1
- package/dist/adapters/isToolConfig.js.map +1 -1
- package/dist/adapters/outsideImportFindings.d.ts.map +1 -1
- package/dist/adapters/outsideImportFindings.js +21 -15
- package/dist/adapters/outsideImportFindings.js.map +1 -1
- package/dist/adapters/plainFunction.d.ts +3 -0
- package/dist/adapters/plainFunction.d.ts.map +1 -0
- package/dist/adapters/plainFunction.js +19 -0
- package/dist/adapters/plainFunction.js.map +1 -0
- package/dist/adapters/serviceModelSyntax.d.ts +1 -0
- package/dist/adapters/serviceModelSyntax.d.ts.map +1 -1
- package/dist/adapters/serviceModelSyntax.js +1 -1
- package/dist/adapters/serviceModelSyntax.js.map +1 -1
- package/dist/adapters/valueType.d.ts +3 -0
- package/dist/adapters/valueType.d.ts.map +1 -0
- package/dist/adapters/valueType.js +16 -0
- package/dist/adapters/valueType.js.map +1 -0
- package/dist/imports/isTooling.d.ts +1 -0
- package/dist/imports/isTooling.d.ts.map +1 -1
- package/dist/imports/isTooling.js +6 -3
- package/dist/imports/isTooling.js.map +1 -1
- package/dist/rules/effect/adapterImports.js +1 -1
- package/dist/rules/effect/adapterImports.js.map +1 -1
- package/dist/rules/effect/boundary.d.ts.map +1 -1
- package/dist/rules/effect/boundary.js +9 -7
- package/dist/rules/effect/boundary.js.map +1 -1
- package/dist/rules/effect/boundaryReference.d.ts +3 -0
- package/dist/rules/effect/boundaryReference.d.ts.map +1 -1
- package/dist/rules/effect/boundaryReference.js +23 -2
- package/dist/rules/effect/boundaryReference.js.map +1 -1
- package/dist/rules/effect/serviceCatalog.d.ts +1 -0
- package/dist/rules/effect/serviceCatalog.d.ts.map +1 -1
- package/dist/rules/effect/serviceFindings.d.ts.map +1 -1
- package/dist/rules/effect/serviceFindings.js +7 -1
- package/dist/rules/effect/serviceFindings.js.map +1 -1
- package/dist/rules/effect/serviceParameters.js +1 -1
- package/dist/rules/effect/serviceParameters.js.map +1 -1
- package/dist/rules/effect/serviceTypes.d.ts +1 -0
- package/dist/rules/effect/serviceTypes.d.ts.map +1 -1
- package/dist/rules/effect/serviceTypes.js +15 -19
- package/dist/rules/effect/serviceTypes.js.map +1 -1
- package/dist/rules/imports/aliased.js +1 -1
- package/dist/rules/imports/aliased.js.map +1 -1
- package/package.json +4 -4
- package/src/adapters/clientHandle.ts +11 -0
- package/src/adapters/declarationTagParameter.ts +146 -0
- package/src/adapters/frameworkCallback.ts +1 -1
- package/src/adapters/imports/departures.ts +7 -1
- package/src/adapters/isToolConfig.ts +7 -3
- package/src/adapters/outsideImportFindings.ts +22 -15
- package/src/adapters/plainFunction.ts +22 -0
- package/src/adapters/serviceModelSyntax.ts +1 -1
- package/src/adapters/valueType.ts +18 -0
- package/src/imports/isTooling.ts +7 -3
- package/src/rules/effect/adapterImports.ts +1 -1
- package/src/rules/effect/boundary.ts +25 -17
- package/src/rules/effect/boundaryReference.ts +30 -2
- package/src/rules/effect/serviceFindings.ts +7 -1
- package/src/rules/effect/serviceParameters.ts +1 -1
- package/src/rules/effect/serviceTypes.ts +15 -21
- package/src/rules/imports/aliased.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.74.3 - 2026-11-08
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- `effect/adapter-imports` accepts value imports of `node:path`, `node:path/posix` and `node:path/win32` in every file, because path functions only compute strings. File-system, process and other Node builtins still need an `adapters/` module.
|
|
8
|
+
|
|
9
|
+
## 0.74.2 - 2026-11-08
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- `effect/adapter-imports` and `effect/boundary` accept a tool config directly in a package's folder, such as `vitest.config.ts`, because the tool loads it from that fixed path; configs deeper in the package stay checked.
|
|
14
|
+
- `effect/adapter-imports` accepts `node:process` in entry modules (cli, main and entry files, `runMain` callers and the `import.meta.url` argv guard), so it no longer contradicts Biome's `noProcessGlobal`; other builtins there, and `node:process` elsewhere, stay reported.
|
|
15
|
+
- `effect/adapter-imports` accepts Vitest imports in every test and spec, also in packages that list Vitest as a peer; Vitest in shipped source stays reported.
|
|
16
|
+
- `code/unused` and `files/named-after-export` treat `.railway/postgres-schedules.ts`, which `@shivaedev/deploy` loads from its default path, as an entry that keeps its name.
|
|
17
|
+
- `imports/aliased` accepts relative imports between tool configs directly in a package's folder, which no `#` alias reaches.
|
|
18
|
+
|
|
3
19
|
## 0.74.1 - 2026-11-08
|
|
4
20
|
|
|
5
21
|
### Fixed
|
package/README.md
CHANGED
|
@@ -130,11 +130,11 @@ It also reports synchronous calls imported from `node:fs` and `node:child_proces
|
|
|
130
130
|
|
|
131
131
|
`Effect.run*` references in core are reported even without Clock, Config or Random. Yield the computation so it uses the caller's runtime. Runners are accepted in `cli.ts`, `main.ts(x)`, `entry.ts(x)`, `*-cli.ts`, tool configs and tests, modules that call `runMain`, and modules with the `fileURLToPath(import.meta.url) === process.argv[1]` entry guard. Browser bootstraps use the `main` or `entry` filename convention; the starter uses `examples/starter/src/client/main.tsx`. These entry-point conventions accept runners only; the other boundary checks still apply.
|
|
132
132
|
|
|
133
|
-
Within Effect code, folders named `adapters/` or `test-support/`, at any depth, are exempt from this boundary rule. An `adapters/` folder bridges an outside library and hands the rest of the application Effect values. The name is fixed by convention, with no config or copied Biome plugin globs. Adapter code still follows `effect/service-parameters` and the ambient time, randomness, console and environment bans.
|
|
133
|
+
Within Effect code, folders named `adapters/` or `test-support/`, at any depth, are exempt from this boundary rule, and so is a tool config directly in a package's folder (`*.config.ts` beside its `package.json`, such as `vitest.config.ts`), because the tool loads it from that fixed path. A config deeper in the package, such as `src/domEnvironment.config.ts`, is checked. An `adapters/` folder bridges an outside library and hands the rest of the application Effect values. The name is fixed by convention, with no config or copied Biome plugin globs. Adapter code still follows `effect/service-parameters` and the ambient time, randomness, console and environment bans.
|
|
134
134
|
|
|
135
135
|
The `ambient-runtime` Biome plugin also reports `Effect.run*` calls whose computation contains `Clock`, `Config` or `Random`, `currentTimeMillisUnsafe`, crypto UUIDs and bytes, `performance.now`, process arguments, working directory and exit state, `globalThis.process.env`, timeouts and microtasks. Yield service computations in the caller's Effect so its environment controls them. These additional checks apply to core TypeScript code. They accept `cli.ts`, `main.ts(x)`, `entry.ts(x)`, `*-cli.ts`, modules that call `runMain`, use `NodeRuntime.runMain` or guard execution with `fileURLToPath(import.meta.url) === process.argv[1]`, tool configs, tests, `adapters/` and `test-support/`. The existing `Date.now()`, `new Date()`, `Math.random()`, console and direct `process.env` bans still apply there.
|
|
136
136
|
|
|
137
|
-
`effect/service-parameters` reports parameters carrying a service in exported and local functions and public methods, including returned factories and function-typed parameters returning services. It follows service classes and tags, non-empty Contexts and service implementation shapes through aliases, interfaces, generic constraints, inferred parameters and destructuring. Read services from Effect's environment instead. An Effect or Stream requiring a service is a computation and is accepted. Methods implementing a service and functions constructing Layers may take services as parameters. Within Effect code, `test-support/` folders are exempt from this rule; `adapters/` folders are checked. Module-level PascalCase functions returning React nodes or elements are components: their props and callback prop signatures may carry services,
|
|
137
|
+
`effect/service-parameters` reports parameters carrying a service in exported and local functions and public methods, including returned factories and function-typed parameters returning services. It follows service classes and tags, non-empty Contexts and service implementation shapes through aliases, interfaces, generic constraints, inferred parameters and destructuring. Read services from Effect's environment instead. An Effect or Stream requiring a service is a computation and is accepted. Methods implementing a service and functions constructing Layers may take services as parameters. Within Effect code, `test-support/` folders are exempt from this rule; `adapters/` folders are checked. Module-level PascalCase functions returning React nodes or elements are components: their props and callback prop signatures may carry services. A plain function, one that is neither an `Effect.fn` or `Effect.gen` body nor nested in one, may take an `AtomRegistry` or `AtomRpcClient` because it has no Effect environment to yield the handle from, even when it builds Effects for later; an `Effect.fn` taking the same handle still fails, and so does a parameter that carries another service beside it. A tag that a function never yields, calls or provides and only hands to a `.middleware(tag)` declaration or `Context.pick`, directly or through a local helper that does the same, is a declaration and is accepted. Callbacks whose arguments are supplied by their owner keep those arguments, including object methods contextually typed by a foreign signature, inline host plugin methods and methods implementing a foreign interface; wrapping and returning a callback as a runtime operation still checks it. Test-kit registrations do not turn plain kit state into runtime service plumbing. Type predicates inspect service values without declaring a runtime dependency. Operation parameters supplied exclusively by the service's `methods: (state)` argument, directly or through other such parameters and internal helpers, carry owned initializer state, including members of the Layer’s own Scope and parameters in helpers wrapped with `Effect.fn`. A hand-built state object or an independent Scope parameter still counts as service plumbing. Owned fibers, closeable scopes and native atom evaluation contexts follow Effect's lifecycle conventions; wrapping a function with `Effect.fn` still checks its parameters. An adapter may pass a foreign resource between its functions when the calls supply values constructed through an outside library or received by its host callbacks, including local construction helpers and an Effect acquisition wrapper; reading that resource from the environment still counts as service plumbing. Installed implementation shapes are discovered in the consuming repository's package scopes, alongside the framework service package's scope.
|
|
138
138
|
|
|
139
139
|
Both rules refuse config exceptions and inline suppressions. Record existing debt with `quality baseline write --rule effect/boundary` and `quality baseline write --rule effect/service-parameters`; the normal report and baseline burn-down apply.
|
|
140
140
|
|
|
@@ -158,9 +158,9 @@ The rule reports hidden configurations and method records, configuration and ope
|
|
|
158
158
|
|
|
159
159
|
### Outside library imports
|
|
160
160
|
|
|
161
|
-
`effect/adapter-imports` reports value imports of non-Effect dependencies, peers and optional dependencies, and Node builtins, at the import site. It includes side-effect imports, value re-exports, literal dynamic imports and `require` calls. Each package is checked against its own manifest; dev-only tools and workspace modules are accepted. Type-only imports and re-exports are accepted, including inline `type` specifiers when every binding is a type.
|
|
161
|
+
`effect/adapter-imports` reports value imports of non-Effect dependencies, peers and optional dependencies, and Node builtins, at the import site. It includes side-effect imports, value re-exports, literal dynamic imports and `require` calls. Each package is checked against its own manifest; dev-only tools and workspace modules are accepted. Type-only imports and re-exports are accepted, including inline `type` specifiers when every binding is a type. `node:path`, `node:path/posix` and `node:path/win32` are accepted everywhere, shipped code included: their functions only compute strings. File-system, process and other Node builtins still go through adapters.
|
|
162
162
|
|
|
163
|
-
Move the integration into an `adapters/` folder and expose Effect values to the rest of the application. Use `import type` when only a type is needed. Folders named `adapters/` and `test-support/`, Effect packages (`effect` and `@effect/*`, including `@effect/platform-node`), native `@shivaedev/*` framework packages,
|
|
163
|
+
Move the integration into an `adapters/` folder and expose Effect values to the rest of the application. Use `import type` when only a type is needed. Folders named `adapters/` and `test-support/`, tool configs directly in a package's folder (such as `vitest.config.ts`, which the tool loads from that fixed path), Effect packages (`effect` and `@effect/*`, including `@effect/platform-node`), native `@shivaedev/*` framework packages, Vitest imports in every test and spec, and rendering libraries in `client/` folders are accepted. The client rendering libraries are `react`, `react-dom`, `recharts`, `lucide-react`, `@base-ui/react`, `@tanstack/react-router`, `@tanstack/react-table`, `class-variance-authority`, `cn`, `clsx` and `tailwind-merge`, including their subpath imports. Import UI components, routing and styling helpers directly in client code. Recharts is the stack's charting library; build charts with shadcn's Chart component (`ChartContainer` and friends) rather than raw recharts primitives where shadcn covers the case. Libraries that perform I/O or manage external state, such as `axios`, `better-auth/react`, `@tanstack/react-query` and `zustand`, still need adapters there. Other outside libraries and non-client rendering imports still need adapters. Entry modules (`cli.ts`, `main.ts(x)`, `entry.ts(x)`, `*-cli.ts`, modules that call `runMain` and modules with the `fileURLToPath(import.meta.url) === process.argv[1]` guard) may import `node:process` to read arguments and the working directory; their other imports, and `node:process` in any other module, test or config, still need adapters. Vitest in shipped source and configs deeper in a package are still reported.
|
|
164
164
|
|
|
165
165
|
The rule refuses config exceptions and inline suppressions. For existing debt, run `quality baseline write --rule effect/adapter-imports`; baseline shards keep one entry per file with its finding count. Run `quality baseline tighten` after moving integrations.
|
|
166
166
|
|
|
@@ -436,7 +436,7 @@ Git calls `quality baseline merge <ancestor> <current> <other>`. Entries are key
|
|
|
436
436
|
|
|
437
437
|
### Unused code
|
|
438
438
|
|
|
439
|
-
`code/unused` uses knip to report unused files, value and type exports, unused dependencies (including development and optional peer dependencies), and imports missing from the package manifest in every workspace. It runs through `quality lint` and the normal report and baseline. The rule accepts no options or permanent exceptions; Quality supplies knip’s entry points without a repository knip config. It follows package scripts through their imports to esbuild `build`, `buildSync` and `context` calls, Rolldown `build` and `watch` calls (including config arrays), and `Bun.build`, reading literal entry lists or maps, local constants, array spreads, arguments passed through local or imported build helpers, mapped config array elements, builds inside Effect acquisition callbacks, and Node path `join`, `resolve` and `dirname` calls, including `fileURLToPath(import.meta.url)`. Conventional tool configs, including dependency-cruiser configs and nested Vitest configs, are entries too. Relative paths use the script package’s working directory (or esbuild’s `absWorkingDir`); `import.meta.dirname` and `__dirname` refer to the build helper’s folder. Node path calls use the script package’s process directory even when the bundler sets a different working directory. Entry files and their imports count as used without fake imports. Package names in a traced build's `external` option, including a list imported from another module or narrowed with `.filter`, count as use of the bundling package's declared dependencies, because the bundle imports them at runtime. Node module resolution through `createRequire(...).resolve(...)` also counts as dependency use; an ordinary object’s `resolve` method does not. Unrelated strings and entries in abandoned build helpers do not establish reachability. Runtime modules supplied by a host can be declared in an ambient script included by the importing file’s TypeScript project. These declarations satisfy the missing-dependency check only in that project; undeclared imports still fail.
|
|
439
|
+
`code/unused` uses knip to report unused files, value and type exports, unused dependencies (including development and optional peer dependencies), and imports missing from the package manifest in every workspace. It runs through `quality lint` and the normal report and baseline. The rule accepts no options or permanent exceptions; Quality supplies knip’s entry points without a repository knip config. It follows package scripts through their imports to esbuild `build`, `buildSync` and `context` calls, Rolldown `build` and `watch` calls (including config arrays), and `Bun.build`, reading literal entry lists or maps, local constants, array spreads, arguments passed through local or imported build helpers, mapped config array elements, builds inside Effect acquisition callbacks, and Node path `join`, `resolve` and `dirname` calls, including `fileURLToPath(import.meta.url)`. Conventional tool configs, including dependency-cruiser configs and nested Vitest configs, are entries too, and so is `.railway/postgres-schedules.ts`, which `@shivaedev/deploy` loads from its default path; `files/named-after-export` lets it keep that name. Other modules in `.railway/` are checked as usual. Relative paths use the script package’s working directory (or esbuild’s `absWorkingDir`); `import.meta.dirname` and `__dirname` refer to the build helper’s folder. Node path calls use the script package’s process directory even when the bundler sets a different working directory. Entry files and their imports count as used without fake imports. Package names in a traced build's `external` option, including a list imported from another module or narrowed with `.filter`, count as use of the bundling package's declared dependencies, because the bundle imports them at runtime. Node module resolution through `createRequire(...).resolve(...)` also counts as dependency use; an ordinary object’s `resolve` method does not. Unrelated strings and entries in abandoned build helpers do not establish reachability. Runtime modules supplied by a host can be declared in an ambient script included by the importing file’s TypeScript project. These declarations satisfy the missing-dependency check only in that project; undeclared imports still fail.
|
|
440
440
|
|
|
441
441
|
Declare files reached only through runtime-built paths with repository-relative `entries` paths or globs. Quality passes these entries to knip, so the files and their imports count as used. A path or glob that matches no file fails the run and names the unmatched pattern. This covers spawned scripts and roots chosen at runtime:
|
|
442
442
|
|
|
@@ -460,7 +460,7 @@ For adoption, run `quality baseline write --rule code/unused` and review the rec
|
|
|
460
460
|
- **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.
|
|
461
461
|
- **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.
|
|
462
462
|
- **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`.
|
|
463
|
-
- **Imports:** cycles, unresolvable imports, workspace imports missing from the manifest or an entry point, relative imports of own modules (including same-folder files and registration subtrees; use the package’s `#` aliases), production imports of test code, runtime folders and fences, as described above.
|
|
463
|
+
- **Imports:** cycles, unresolvable imports, workspace imports missing from the manifest or an entry point, relative imports of own modules (including same-folder files and registration subtrees; use the package’s `#` aliases, except between tool configs directly in a package's folder, such as `vitest.coverage.config.ts` importing `./vitest.config.ts`, which no alias reaches), production imports of test code, runtime folders and fences, as described above.
|
|
464
464
|
- **Names and files:** `files/folder-names` accepts an unscoped package name matching any trailing run of its folder path joined with hyphens, with singular or plural segments. For example, `packages/server/domains/agents` accepts `domain-agents` or `agents`, and `apps/testing` accepts `app-testing`; unrelated or stale package names still fail. The Biome preset's naming rules and plugins, together with the remaining `files/*` rules, name a file after its main export with its folders as the prefix. Root authority documents such as `DESIGN.md`, `ARCHITECTURE.md` and `GLOSSARY.md` are accepted beside `AGENTS.md`. `files/named-after-export` accepts programmatic bundler entries, including main and preload adapters, and tool-discovered config names such as `.dependency-cruiser.ts`. Tool config recognition follows the shared Biome default-export policy, so these configs may also use their required default export. The Quality gate also accepts Vitest configs and reporters named by explicit `--config` or `--reporter` paths in package scripts, and adapter plugins whose default export implements an imported foreign Plugin type. Ordinary modules retain their naming and default-export checks. `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: `options.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.
|
|
465
465
|
- **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.
|
|
466
466
|
- **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.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clientHandle.d.ts","sourceRoot":"","sources":["../../src/adapters/clientHandle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAGjC,wBAAgB,YAAY,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,OAAO,CAOnD"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// A registry or RPC client is the handle a plain function, which has no Effect environment, works through.
|
|
2
|
+
export function clientHandle(type) {
|
|
3
|
+
return (type.getProperty("~effect/reactivity/AtomRegistry") !== undefined
|
|
4
|
+
|| (type.getProperty("mutation")?.declarations ?? []).some((declaration) => /\/effect\/(?:src|dist)\/reactivity\/AtomRpc\.(?:d\.)?ts$/u.test(declaration.getSourceFile().fileName.replaceAll("\\", "/"))));
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=clientHandle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clientHandle.js","sourceRoot":"","sources":["../../src/adapters/clientHandle.ts"],"names":[],"mappings":"AAEA,2GAA2G;AAC3G,MAAM,UAAU,YAAY,CAAC,IAAa;IACzC,OAAO,CACN,IAAI,CAAC,WAAW,CAAC,iCAAiC,CAAC,KAAK,SAAS;WAC9D,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,YAAY,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE,CAC1E,2DAA2D,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAC5H,CACD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declarationTagParameter.d.ts","sourceRoot":"","sources":["../../src/adapters/declarationTagParameter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AA6E5B,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,OAAO,cAsDhE,EAAE,CAAC,oBAAoB,KAAG,OAAO,CAcpE"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
import { declarationOf, resolvedValue } from "#adapters/serviceModelSyntax.ts";
|
|
3
|
+
const RPC_MIDDLEWARE = "~effect/rpc/RpcMiddleware";
|
|
4
|
+
function implementationParameter(checker, parameter) {
|
|
5
|
+
const fn = parameter.parent;
|
|
6
|
+
if (!(ts.isFunctionDeclaration(fn) || ts.isMethodDeclaration(fn)) || fn.body !== undefined || fn.name === undefined) {
|
|
7
|
+
return parameter;
|
|
8
|
+
}
|
|
9
|
+
const implementation = checker
|
|
10
|
+
.getSymbolAtLocation(fn.name)
|
|
11
|
+
?.declarations?.find((declaration) => (ts.isFunctionDeclaration(declaration) || ts.isMethodDeclaration(declaration)) && declaration.body !== undefined);
|
|
12
|
+
return implementation !== undefined && (ts.isFunctionDeclaration(implementation) || ts.isMethodDeclaration(implementation))
|
|
13
|
+
? (implementation.parameters[fn.parameters.indexOf(parameter)] ?? parameter)
|
|
14
|
+
: parameter;
|
|
15
|
+
}
|
|
16
|
+
function functionBody(parameter) {
|
|
17
|
+
const fn = parameter.parent;
|
|
18
|
+
return ts.isFunctionDeclaration(fn) || ts.isFunctionExpression(fn) || ts.isArrowFunction(fn) || ts.isMethodDeclaration(fn) ? fn.body : undefined;
|
|
19
|
+
}
|
|
20
|
+
function contextPick(checker, callee) {
|
|
21
|
+
const declaration = declarationOf(checker, ts.isPropertyAccessExpression(callee) ? callee.name : callee);
|
|
22
|
+
return (declaration !== undefined
|
|
23
|
+
&& ts.isVariableDeclaration(declaration)
|
|
24
|
+
&& declaration.name.getText() === "pick"
|
|
25
|
+
&& /\/effect\/(?:src|dist(?:\/dts)?)\/Context\.(?:d\.)?ts$/u.test(declaration.getSourceFile().fileName.replaceAll("\\", "/")));
|
|
26
|
+
}
|
|
27
|
+
function middlewareMember(expression) {
|
|
28
|
+
return ts.isPropertyAccessExpression(expression) && expression.name.text === "middleware";
|
|
29
|
+
}
|
|
30
|
+
function middlewareCall(checker, callee) {
|
|
31
|
+
if (middlewareMember(callee)) {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
const value = resolvedValue(checker, callee);
|
|
35
|
+
return (ts.isCallExpression(value)
|
|
36
|
+
&& ts.isPropertyAccessExpression(value.expression)
|
|
37
|
+
&& value.expression.name.text === "bind"
|
|
38
|
+
&& middlewareMember(value.expression.expression));
|
|
39
|
+
}
|
|
40
|
+
function referredSymbol(checker, node) {
|
|
41
|
+
return ts.isShorthandPropertyAssignment(node.parent) ? checker.getShorthandAssignmentValueSymbol(node.parent) : checker.getSymbolAtLocation(node);
|
|
42
|
+
}
|
|
43
|
+
function everyReference(checker, body, name, permitted) {
|
|
44
|
+
const symbol = checker.getSymbolAtLocation(name);
|
|
45
|
+
function visit(node) {
|
|
46
|
+
if (ts.isIdentifier(node) && node !== name && referredSymbol(checker, node) === symbol && !permitted(node)) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
return ts.forEachChild(node, (child) => !visit(child)) !== true;
|
|
50
|
+
}
|
|
51
|
+
return visit(body);
|
|
52
|
+
}
|
|
53
|
+
function calledMethod(checker, member) {
|
|
54
|
+
if (!(ts.isCallExpression(member.parent) && member.parent.expression === member)) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
return (!ts.isPropertyAccessExpression(member)
|
|
58
|
+
|| ((checker.getSymbolAtLocation(member.name)?.flags ?? ts.SymbolFlags.Method) & ts.SymbolFlags.Method) !== 0);
|
|
59
|
+
}
|
|
60
|
+
export function declarationTagParameter(checker, carries) {
|
|
61
|
+
const known = new Map();
|
|
62
|
+
function middlewareTag(node) {
|
|
63
|
+
return checker.getApparentType(checker.getTypeAtLocation(node)).getProperty(RPC_MIDDLEWARE) !== undefined;
|
|
64
|
+
}
|
|
65
|
+
function middlewareSignature(parameter) {
|
|
66
|
+
const member = ts.isFunctionTypeNode(parameter.parent) ? parameter.parent.parent : parameter.parent;
|
|
67
|
+
return (ts.isPropertySignature(member) || ts.isMethodSignature(member)) && member.name.getText() === "middleware" && middlewareTag(parameter);
|
|
68
|
+
}
|
|
69
|
+
function forwardsDeclaration(call, argument) {
|
|
70
|
+
const target = checker.getResolvedSignature(call)?.declaration?.parameters[call.arguments.indexOf(argument)];
|
|
71
|
+
return target !== undefined && ts.isParameter(target) && !ts.isSpreadElement(argument) && declarationOnly(target);
|
|
72
|
+
}
|
|
73
|
+
function declares(value) {
|
|
74
|
+
const argument = ts.isSpreadElement(value.parent) ? value.parent : value;
|
|
75
|
+
const call = argument.parent;
|
|
76
|
+
if (!(ts.isCallExpression(call) && call.arguments.includes(argument))) {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
return (contextPick(checker, call.expression)
|
|
80
|
+
|| (middlewareCall(checker, call.expression) && middlewareTag(value))
|
|
81
|
+
|| forwardsDeclaration(call, argument));
|
|
82
|
+
}
|
|
83
|
+
function carrier(value) {
|
|
84
|
+
const parent = value.parent;
|
|
85
|
+
if (ts.isNonNullExpression(parent) || ts.isParenthesizedExpression(parent)) {
|
|
86
|
+
return carrier(parent);
|
|
87
|
+
}
|
|
88
|
+
if ((ts.isPropertyAccessExpression(parent) || ts.isElementAccessExpression(parent)) && parent.expression === value) {
|
|
89
|
+
return carries(checker.getTypeAtLocation(parent)) ? carrier(parent) : parent;
|
|
90
|
+
}
|
|
91
|
+
return value;
|
|
92
|
+
}
|
|
93
|
+
function onlyDeclared(body, name, seen) {
|
|
94
|
+
if (!ts.isIdentifier(name)) {
|
|
95
|
+
return name.elements.every((element) => ts.isOmittedExpression(element) || !carries(checker.getTypeAtLocation(element.name)) || onlyDeclared(body, element.name, seen));
|
|
96
|
+
}
|
|
97
|
+
return everyReference(checker, body, name, (reference) => {
|
|
98
|
+
const value = carrier(reference);
|
|
99
|
+
if (!carries(checker.getTypeAtLocation(value))) {
|
|
100
|
+
return !calledMethod(checker, value);
|
|
101
|
+
}
|
|
102
|
+
if (ts.isVariableDeclaration(value.parent) && value.parent.initializer === value) {
|
|
103
|
+
return onlyDeclared(body, value.parent.name, seen);
|
|
104
|
+
}
|
|
105
|
+
const declaration = declares(value);
|
|
106
|
+
seen.declared ||= declaration;
|
|
107
|
+
return declaration;
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
function declarationOnly(declared) {
|
|
111
|
+
const parameter = implementationParameter(checker, declared);
|
|
112
|
+
const cached = known.get(parameter);
|
|
113
|
+
if (cached !== undefined) {
|
|
114
|
+
return cached;
|
|
115
|
+
}
|
|
116
|
+
known.set(parameter, false);
|
|
117
|
+
const body = functionBody(parameter);
|
|
118
|
+
const seen = { declared: false };
|
|
119
|
+
const result = middlewareSignature(parameter) || (body !== undefined && onlyDeclared(body, parameter.name, seen) && seen.declared);
|
|
120
|
+
known.set(parameter, result);
|
|
121
|
+
return result;
|
|
122
|
+
}
|
|
123
|
+
return declarationOnly;
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=declarationTagParameter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declarationTagParameter.js","sourceRoot":"","sources":["../../src/adapters/declarationTagParameter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAE/E,MAAM,cAAc,GAAG,2BAA2B,CAAC;AAEnD,SAAS,uBAAuB,CAAC,OAAuB,EAAE,SAAkC;IAC3F,MAAM,EAAE,GAAG,SAAS,CAAC,MAAM,CAAC;IAC5B,IAAI,CAAC,CAAC,EAAE,CAAC,qBAAqB,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,KAAK,SAAS,IAAI,EAAE,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QACrH,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,MAAM,cAAc,GAAG,OAAO;SAC5B,mBAAmB,CAAC,EAAE,CAAC,IAAI,CAAC;QAC7B,EAAE,YAAY,EAAE,IAAI,CACnB,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC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,MAAM,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,WAAW,KAAK,KAAK,EAAE,CAAC;gBAClF,OAAO,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACpD,CAAC;YACD,MAAM,WAAW,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;YACpC,IAAI,CAAC,QAAQ,KAAK,WAAW,CAAC;YAC9B,OAAO,WAAW,CAAC;QACpB,CAAC,CAAC,CAAC;IACJ,CAAC;IACD,SAAS,eAAe,CAAC,QAAiC;QACzD,MAAM,SAAS,GAAG,uBAAuB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QAC7D,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACpC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YAC1B,OAAO,MAAM,CAAC;QACf,CAAC;QACD,KAAK,CAAC,GAAG,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAC5B,MAAM,IAAI,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;QACrC,MAAM,IAAI,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,mBAAmB,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,YAAY,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC;QACnI,KAAK,CAAC,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAC7B,OAAO,MAAM,CAAC;IACf,CAAC;IACD,OAAO,eAAe,CAAC;AACxB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
|
+
export declare function wrapsEffectFunction(checker: ts.TypeChecker, expression: ts.Expression): boolean;
|
|
2
3
|
export declare function frameworkCallback(checker: ts.TypeChecker, node: ts.Node, local: ReadonlySet<ts.SourceFile>, seen?: Set<ts.Node>): boolean;
|
|
3
4
|
export declare function parameterSite(checker: ts.TypeChecker, parameter: ts.ParameterDeclaration, local: ReadonlySet<ts.SourceFile>): ts.ParameterDeclaration;
|
|
4
5
|
//# sourceMappingURL=frameworkCallback.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frameworkCallback.d.ts","sourceRoot":"","sources":["../../src/adapters/frameworkCallback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"frameworkCallback.d.ts","sourceRoot":"","sources":["../../src/adapters/frameworkCallback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAU5B,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,CAAC,UAAU,GAAG,OAAO,CAW/F;AAOD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,WAAW,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,IAAI,eAAqB,GAAG,OAAO,CA0C/I;AAgBD,wBAAgB,aAAa,CAC5B,OAAO,EAAE,EAAE,CAAC,WAAW,EACvB,SAAS,EAAE,EAAE,CAAC,oBAAoB,EAClC,KAAK,EAAE,WAAW,CAAC,EAAE,CAAC,UAAU,CAAC,GAC/B,EAAE,CAAC,oBAAoB,CAuBzB"}
|
|
@@ -6,7 +6,7 @@ import { effectApi, resolvedValue } from "#adapters/serviceModelSyntax.ts";
|
|
|
6
6
|
function supplied(signature, local) {
|
|
7
7
|
return signature.declaration !== undefined && !local.has(signature.declaration.getSourceFile());
|
|
8
8
|
}
|
|
9
|
-
function wrapsEffectFunction(checker, expression) {
|
|
9
|
+
export function wrapsEffectFunction(checker, expression) {
|
|
10
10
|
let callee = expression;
|
|
11
11
|
let value = ts.isIdentifier(callee) ? resolvedValue(checker, callee) : callee;
|
|
12
12
|
while (ts.isCallExpression(value)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frameworkCallback.js","sourceRoot":"","sources":["../../src/adapters/frameworkCallback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAE3E,SAAS,QAAQ,CAAC,SAAuB,EAAE,KAAiC;IAC3E,OAAO,SAAS,CAAC,WAAW,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,WAAW,CAAC,aAAa,EAAE,CAAC,CAAC;AACjG,CAAC;AAED,
|
|
1
|
+
{"version":3,"file":"frameworkCallback.js","sourceRoot":"","sources":["../../src/adapters/frameworkCallback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAE3E,SAAS,QAAQ,CAAC,SAAuB,EAAE,KAAiC;IAC3E,OAAO,SAAS,CAAC,WAAW,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,WAAW,CAAC,aAAa,EAAE,CAAC,CAAC;AACjG,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,OAAuB,EAAE,UAAyB;IAC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tF,MAAM,IAAI,GAAG,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;QACnE,IAAI,IAAI,KAAK,SAAS,IAAI,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;YAChD,OAAO,IAAI,CAAC;QACb,CAAC;IACF,CAAC;IACD,MAAM,QAAQ,GAAG,EAAE,CAAC,MAAM,CAAC;IAC3B,IAAI,CAAC,CAAC,EAAE,CAAC,qBAAqB,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,IAAI,KAAK,SAAS,IAAI,EAAE,CAAC,kBAAkB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;QAClH,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,OAAO,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,IAAI,SAAS,CAAC;AAChF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"departures.d.ts","sourceRoot":"","sources":["../../../src/adapters/imports/departures.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"departures.d.ts","sourceRoot":"","sources":["../../../src/adapters/imports/departures.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAIxD,OAAO,EAAa,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAuC3C,wBAAgB,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,gBAAgB,EAAE,GAAG,SAAS,SAAS,EAAE,CAY1G"}
|
|
@@ -2,6 +2,7 @@ import { realpathSync } from "node:fs";
|
|
|
2
2
|
import { posix } from "node:path";
|
|
3
3
|
import { projectsFor } from "#adapters/imports/projects.ts";
|
|
4
4
|
import { resolveImport } from "#adapters/imports/resolve.ts";
|
|
5
|
+
import { isPackageRootConfig } from "#imports/isTooling.ts";
|
|
5
6
|
import { specifierSites } from "#imports/specifiers.ts";
|
|
6
7
|
import { packageOf } from "#imports/workspace.ts";
|
|
7
8
|
import { parse } from "#rules/parse.ts";
|
|
@@ -20,7 +21,12 @@ function departureAt(context, site) {
|
|
|
20
21
|
const target = resolveImport(context.root, noAmbient, request, context.from, context.project);
|
|
21
22
|
const local = target?.kind === "file" ? target.path : undefined;
|
|
22
23
|
const owner = local === undefined ? undefined : packageOf(context.packages, local);
|
|
23
|
-
const
|
|
24
|
+
const home = packageOf(context.packages, context.path);
|
|
25
|
+
const directory = home?.directory ?? ".";
|
|
26
|
+
if (local !== undefined && isPackageRootConfig(directory, context.path) && isPackageRootConfig(directory, local)) {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
const workspace = owner !== undefined && owner !== home ? owner.name : undefined;
|
|
24
30
|
return { ...site, file: context.path, installed: target?.kind === "external" ? target.package : undefined, workspace };
|
|
25
31
|
}
|
|
26
32
|
export function departures(inputs, packages) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"departures.js","sourceRoot":"","sources":["../../../src/adapters/imports/departures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAgB,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAG7D,OAAO,EAAsB,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAyB,MAAM,uBAAuB,CAAC;AAEzE,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,MAAM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CAAC;QACzC,MAAM,OAAO,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC;QACpF,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IACnF,CAAC,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isToolConfig.d.ts","sourceRoot":"","sources":["../../src/adapters/isToolConfig.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"isToolConfig.d.ts","sourceRoot":"","sources":["../../src/adapters/isToolConfig.ts"],"names":[],"mappings":"AAWA,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAElD"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { posix } from "node:path";
|
|
2
2
|
import preset from "#biome-preset" with { type: "json" };
|
|
3
|
-
const PATTERNS =
|
|
3
|
+
const PATTERNS = [
|
|
4
|
+
...preset.overrides.flatMap((override) => override.includes.includes("**/*.config.*") && override.linter?.rules?.style?.noDefaultExport === "off" ? override.includes : []),
|
|
5
|
+
// @shivaedev/deploy loads this module from its default path, so no import reaches it.
|
|
6
|
+
"**/.railway/postgres-schedules.ts",
|
|
7
|
+
];
|
|
4
8
|
export function isToolConfig(path) {
|
|
5
9
|
return PATTERNS.some((pattern) => posix.matchesGlob(path, pattern));
|
|
6
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isToolConfig.js","sourceRoot":"","sources":["../../src/adapters/isToolConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,MAAM,MAAM,eAAe,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAEzD,MAAM,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"isToolConfig.js","sourceRoot":"","sources":["../../src/adapters/isToolConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,MAAM,MAAM,eAAe,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAEzD,MAAM,QAAQ,GAAG;IAChB,GAAG,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE,CACxC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,eAAe,KAAK,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAChI;IACD,sFAAsF;IACtF,mCAAmC;CACnC,CAAC;AAEF,MAAM,UAAU,YAAY,CAAC,IAAY;IACxC,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;AACrE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outsideImportFindings.d.ts","sourceRoot":"","sources":["../../src/adapters/outsideImportFindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"outsideImportFindings.d.ts","sourceRoot":"","sources":["../../src/adapters/outsideImportFindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAOhF,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAiCpD,eAAO,MAAM,qBAAqB,yFA6ChC,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import { readPackageManifest } from "#adapters/manifestInventory.ts";
|
|
3
3
|
import { importGraph } from "#imports/graph.ts";
|
|
4
|
+
import { isPackageRootConfig } from "#imports/isTooling.ts";
|
|
4
5
|
import { packageNameOf } from "#imports/packageName.ts";
|
|
5
6
|
import { packageOf } from "#imports/workspace.ts";
|
|
6
7
|
import { testName } from "#naming/testName.ts";
|
|
8
|
+
import { entryModules } from "#rules/effect/boundaryReference.ts";
|
|
7
9
|
const CLIENT_RENDERING_LIBRARIES = new Set([
|
|
8
10
|
"react",
|
|
9
11
|
"react-dom",
|
|
@@ -17,9 +19,13 @@ const CLIENT_RENDERING_LIBRARIES = new Set([
|
|
|
17
19
|
"clsx",
|
|
18
20
|
"tailwind-merge",
|
|
19
21
|
]);
|
|
20
|
-
|
|
22
|
+
// Path functions compute strings and touch no file system or process state, so they need no adapter.
|
|
23
|
+
const PURE_BUILTINS = new Set(["node:path", "node:path/posix", "node:path/win32"]);
|
|
24
|
+
function exempt(directory, path, name) {
|
|
21
25
|
return (/(?:^|\/)(?:adapters|test-support)\//u.test(path)
|
|
22
|
-
|| (name
|
|
26
|
+
|| PURE_BUILTINS.has(name)
|
|
27
|
+
|| isPackageRootConfig(directory, path)
|
|
28
|
+
|| (name === "vitest" && testName(path) !== undefined)
|
|
23
29
|
|| name === "effect"
|
|
24
30
|
|| name.startsWith("@effect/")
|
|
25
31
|
|| name.startsWith("@shivaedev/")
|
|
@@ -42,22 +48,22 @@ export const outsideImportFindings = Effect.fn("Imports.outsideImportFindings")(
|
|
|
42
48
|
.filter((edge) => edge.missing === undefined && !/^[.#/]/u.test(edge.specifier))
|
|
43
49
|
.map((edge) => ({ ...edge, name: packageNameOf(edge.specifier) })),
|
|
44
50
|
];
|
|
45
|
-
|
|
51
|
+
const outside = sites.filter((site) => {
|
|
46
52
|
const directory = packageOf(graph.packages, site.from)?.directory ?? ".";
|
|
47
|
-
|
|
53
|
+
return !(workspace.has(site.name)
|
|
48
54
|
|| site.type
|
|
49
55
|
|| site.kind !== "import"
|
|
50
|
-
|| exempt(site.from, site.name)
|
|
51
|
-
|| !(site.name.startsWith("node:") || runtime.get(directory)?.has(site.name)))
|
|
52
|
-
return [];
|
|
53
|
-
}
|
|
54
|
-
return [
|
|
55
|
-
{
|
|
56
|
-
file: site.from,
|
|
57
|
-
line: site.line,
|
|
58
|
-
message: `Imports outside library "${site.specifier}" as a value. Move the integration into an adapters/ module with explicit imports that exposes Effect values; use import type for types. Read environment variables with Config instead of process.env, including in adapters/.`,
|
|
59
|
-
},
|
|
60
|
-
];
|
|
56
|
+
|| exempt(directory, site.from, site.name)
|
|
57
|
+
|| !(site.name.startsWith("node:") || runtime.get(directory)?.has(site.name)));
|
|
61
58
|
});
|
|
59
|
+
const processImporters = new Set(outside.flatMap((site) => (site.name === "node:process" ? [site.from] : [])));
|
|
60
|
+
const entries = entryModules(inputs.sources.filter((file) => processImporters.has(file.path)));
|
|
61
|
+
return outside
|
|
62
|
+
.filter((site) => !(site.name === "node:process" && entries.has(site.from)))
|
|
63
|
+
.map((site) => ({
|
|
64
|
+
file: site.from,
|
|
65
|
+
line: site.line,
|
|
66
|
+
message: `Imports outside library "${site.specifier}" as a value. Move the integration into an adapters/ module with explicit imports that exposes Effect values; use import type for types. Read environment variables with Config instead of process.env, including in adapters/.`,
|
|
67
|
+
}));
|
|
62
68
|
});
|
|
63
69
|
//# sourceMappingURL=outsideImportFindings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outsideImportFindings.js","sourceRoot":"","sources":["../../src/adapters/outsideImportFindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAA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CAAC,IAAI,GAAG,OAAO,CAO3E"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
import { wrapsEffectFunction } from "#adapters/frameworkCallback.ts";
|
|
3
|
+
function effectBody(checker, node) {
|
|
4
|
+
if ((ts.isFunctionDeclaration(node) || ts.isFunctionExpression(node) || ts.isMethodDeclaration(node)) && node.asteriskToken !== undefined) {
|
|
5
|
+
return true;
|
|
6
|
+
}
|
|
7
|
+
return ((ts.isArrowFunction(node) || ts.isFunctionExpression(node))
|
|
8
|
+
&& ts.isCallExpression(node.parent)
|
|
9
|
+
&& wrapsEffectFunction(checker, node.parent.expression));
|
|
10
|
+
}
|
|
11
|
+
export function plainFunction(checker, fn) {
|
|
12
|
+
for (let node = fn; node !== undefined; node = node.parent) {
|
|
13
|
+
if (effectBody(checker, node)) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=plainFunction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plainFunction.js","sourceRoot":"","sources":["../../src/adapters/plainFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAErE,SAAS,UAAU,CAAC,OAAuB,EAAE,IAAa;IACzD,IAAI,CAAC,EAAE,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;QAC3I,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO,CACN,CAAC,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;WACxD,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC;WAChC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CACvD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,OAAuB,EAAE,EAAW;IACjE,KAAK,IAAI,IAAI,GAAwB,EAAE,EAAE,IAAI,KAAK,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QACjF,IAAI,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC;YAC/B,OAAO,KAAK,CAAC;QACd,CAAC;IACF,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
2
|
export declare function effectApi(checker: ts.TypeChecker, node: ts.Node, name: string): boolean;
|
|
3
|
+
export declare function declarationOf(checker: ts.TypeChecker, node: ts.Node): ts.Declaration | undefined;
|
|
3
4
|
export declare function resolvedValue(checker: ts.TypeChecker, expression: ts.Expression, seen?: Set<ts.Node>): ts.Node;
|
|
4
5
|
export declare function effectSuccess(checker: ts.TypeChecker, type: ts.Type): ts.Type | undefined;
|
|
5
6
|
//# sourceMappingURL=serviceModelSyntax.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serviceModelSyntax.d.ts","sourceRoot":"","sources":["../../src/adapters/serviceModelSyntax.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAI5B,wBAAgB,SAAS,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAuBvF;
|
|
1
|
+
{"version":3,"file":"serviceModelSyntax.d.ts","sourceRoot":"","sources":["../../src/adapters/serviceModelSyntax.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAI5B,wBAAgB,SAAS,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAuBvF;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,WAAW,GAAG,SAAS,CAShG;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,CAAC,UAAU,EAAE,IAAI,eAAqB,GAAG,EAAE,CAAC,IAAI,CAWpH;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,IAAI,GAAG,SAAS,CAIzF"}
|
|
@@ -23,7 +23,7 @@ export function effectApi(checker, node, name) {
|
|
|
23
23
|
&& ts.isIdentifier(declaration.name)
|
|
24
24
|
&& declaration.name.text === name);
|
|
25
25
|
}
|
|
26
|
-
function declarationOf(checker, node) {
|
|
26
|
+
export function declarationOf(checker, node) {
|
|
27
27
|
const symbol = ts.isShorthandPropertyAssignment(node.parent)
|
|
28
28
|
? checker.getShorthandAssignmentValueSymbol(node.parent)
|
|
29
29
|
: checker.getSymbolAtLocation(node);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serviceModelSyntax.js","sourceRoot":"","sources":["../../src/adapters/serviceModelSyntax.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAEvE,MAAM,UAAU,SAAS,CAAC,OAAuB,EAAE,IAAa,EAAE,IAAY;IAC7E,IAAI,EAAE,CAAC,yBAAyB,CAAC,IAAI,CA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CAAC,CAAC,CAAC,KAAK,CAAC;AAC1I,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,OAAuB,EAAE,IAAa;IACnE,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;IACjD,MAAM,OAAO,GAAG,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACnG,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC;AACrH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"valueType.d.ts","sourceRoot":"","sources":["../../src/adapters/valueType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAG5B,wBAAgB,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,OAAO,CAchD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
import { browserLibraryType } from "#adapters/browserLibraryType.ts";
|
|
3
|
+
export function valueType(type) {
|
|
4
|
+
return (browserLibraryType(type)
|
|
5
|
+
|| (type.flags
|
|
6
|
+
& (ts.TypeFlags.Any
|
|
7
|
+
| ts.TypeFlags.Unknown
|
|
8
|
+
| ts.TypeFlags.Never
|
|
9
|
+
| ts.TypeFlags.StringLike
|
|
10
|
+
| ts.TypeFlags.NumberLike
|
|
11
|
+
| ts.TypeFlags.BooleanLike
|
|
12
|
+
| ts.TypeFlags.ESSymbolLike
|
|
13
|
+
| ts.TypeFlags.BigIntLike))
|
|
14
|
+
!== 0);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=valueType.js.map
|