@shivaedev/quality 0.67.0 → 0.67.2
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 +14 -0
- package/README.md +5 -5
- package/biome/declarations.json +7 -1
- package/biome/preset.json +7 -1
- package/dist/adapters/buildEntryPaths.d.ts +3 -0
- package/dist/adapters/buildEntryPaths.d.ts.map +1 -0
- package/dist/adapters/buildEntryPaths.js +48 -0
- package/dist/adapters/buildEntryPaths.js.map +1 -0
- package/dist/adapters/buildEntryValue.d.ts +4 -0
- package/dist/adapters/buildEntryValue.d.ts.map +1 -0
- package/dist/adapters/buildEntryValue.js +47 -0
- package/dist/adapters/buildEntryValue.js.map +1 -0
- package/dist/adapters/bundlerEntries.d.ts +3 -0
- package/dist/adapters/bundlerEntries.d.ts.map +1 -0
- package/dist/adapters/bundlerEntries.js +49 -0
- package/dist/adapters/bundlerEntries.js.map +1 -0
- package/dist/adapters/callbackEscapes.d.ts +3 -0
- package/dist/adapters/callbackEscapes.d.ts.map +1 -0
- package/dist/adapters/callbackEscapes.js +24 -0
- package/dist/adapters/callbackEscapes.js.map +1 -0
- package/dist/adapters/composedContext.d.ts +3 -0
- package/dist/adapters/composedContext.d.ts.map +1 -0
- package/dist/adapters/composedContext.js +42 -0
- package/dist/adapters/composedContext.js.map +1 -0
- package/dist/adapters/containerDependency.d.ts +4 -0
- package/dist/adapters/containerDependency.d.ts.map +1 -0
- package/dist/adapters/containerDependency.js +28 -0
- package/dist/adapters/containerDependency.js.map +1 -0
- package/dist/adapters/contextCaptureFindings.d.ts.map +1 -1
- package/dist/adapters/contextCaptureFindings.js +3 -1
- package/dist/adapters/contextCaptureFindings.js.map +1 -1
- package/dist/adapters/foreignResources.d.ts +3 -0
- package/dist/adapters/foreignResources.d.ts.map +1 -0
- package/dist/adapters/foreignResources.js +80 -0
- package/dist/adapters/foreignResources.js.map +1 -0
- package/dist/adapters/frameworkCallback.d.ts +4 -0
- package/dist/adapters/frameworkCallback.d.ts.map +1 -0
- package/dist/adapters/frameworkCallback.js +92 -0
- package/dist/adapters/frameworkCallback.js.map +1 -0
- package/dist/adapters/frameworkOwner.d.ts +3 -0
- package/dist/adapters/frameworkOwner.d.ts.map +1 -0
- package/dist/adapters/frameworkOwner.js +35 -0
- package/dist/adapters/frameworkOwner.js.map +1 -0
- package/dist/adapters/importedCall.d.ts +6 -0
- package/dist/adapters/importedCall.d.ts.map +1 -0
- package/dist/adapters/importedCall.js +26 -0
- package/dist/adapters/importedCall.js.map +1 -0
- package/dist/adapters/isToolConfig.d.ts +2 -0
- package/dist/adapters/isToolConfig.d.ts.map +1 -0
- package/dist/adapters/isToolConfig.js +7 -0
- package/dist/adapters/isToolConfig.js.map +1 -0
- package/dist/adapters/knip/configuration.d.ts +1 -1
- package/dist/adapters/knip/configuration.d.ts.map +1 -1
- package/dist/adapters/knip/configuration.js +3 -2
- package/dist/adapters/knip/configuration.js.map +1 -1
- package/dist/adapters/knip/run.d.ts.map +1 -1
- package/dist/adapters/knip/run.js +3 -1
- package/dist/adapters/knip/run.js.map +1 -1
- package/dist/adapters/localFunctions.d.ts +3 -0
- package/dist/adapters/localFunctions.d.ts.map +1 -0
- package/dist/adapters/localFunctions.js +20 -0
- package/dist/adapters/localFunctions.js.map +1 -0
- package/dist/adapters/reachableBuildEntries.d.ts +5 -0
- package/dist/adapters/reachableBuildEntries.d.ts.map +1 -0
- package/dist/adapters/reachableBuildEntries.js +52 -0
- package/dist/adapters/reachableBuildEntries.js.map +1 -0
- package/dist/adapters/serviceStateProblems.d.ts.map +1 -1
- package/dist/adapters/serviceStateProblems.js +26 -14
- package/dist/adapters/serviceStateProblems.js.map +1 -1
- package/dist/inventory/programmaticEntries.d.ts +4 -0
- package/dist/inventory/programmaticEntries.d.ts.map +1 -0
- package/dist/inventory/programmaticEntries.js +9 -0
- package/dist/inventory/programmaticEntries.js.map +1 -0
- package/dist/rules/effect/contextCapture.js +1 -1
- package/dist/rules/effect/contextCapture.js.map +1 -1
- package/dist/rules/effect/program.d.ts +1 -0
- package/dist/rules/effect/program.d.ts.map +1 -1
- package/dist/rules/effect/program.js +17 -1
- package/dist/rules/effect/program.js.map +1 -1
- package/dist/rules/effect/serviceCatalog.d.ts.map +1 -1
- package/dist/rules/effect/serviceCatalog.js +10 -2
- package/dist/rules/effect/serviceCatalog.js.map +1 -1
- package/dist/rules/effect/serviceFindings.d.ts.map +1 -1
- package/dist/rules/effect/serviceFindings.js +33 -7
- package/dist/rules/effect/serviceFindings.js.map +1 -1
- package/dist/rules/effect/serviceOrigin.d.ts.map +1 -1
- package/dist/rules/effect/serviceOrigin.js +13 -1
- package/dist/rules/effect/serviceOrigin.js.map +1 -1
- package/dist/rules/effect/serviceParameters.d.ts.map +1 -1
- package/dist/rules/effect/serviceParameters.js +12 -12
- package/dist/rules/effect/serviceParameters.js.map +1 -1
- package/dist/rules/effect/serviceTypes.d.ts.map +1 -1
- package/dist/rules/effect/serviceTypes.js +5 -1
- package/dist/rules/effect/serviceTypes.js.map +1 -1
- package/dist/rules/files/namedAfterExport.d.ts.map +1 -1
- package/dist/rules/files/namedAfterExport.js +14 -13
- package/dist/rules/files/namedAfterExport.js.map +1 -1
- package/package.json +4 -3
- package/src/adapters/buildEntryPaths.ts +52 -0
- package/src/adapters/buildEntryValue.ts +52 -0
- package/src/adapters/bundlerEntries.ts +53 -0
- package/src/adapters/callbackEscapes.ts +32 -0
- package/src/adapters/composedContext.ts +48 -0
- package/src/adapters/containerDependency.ts +40 -0
- package/src/adapters/contextCaptureFindings.ts +3 -1
- package/src/adapters/foreignResources.ts +83 -0
- package/src/adapters/frameworkCallback.ts +106 -0
- package/src/adapters/frameworkOwner.ts +41 -0
- package/src/adapters/importedCall.ts +27 -0
- package/src/adapters/isToolConfig.ts +10 -0
- package/src/adapters/knip/configuration.ts +3 -2
- package/src/adapters/knip/run.ts +3 -1
- package/src/adapters/localFunctions.ts +22 -0
- package/src/adapters/reachableBuildEntries.ts +58 -0
- package/src/adapters/serviceStateProblems.ts +42 -17
- package/src/inventory/programmaticEntries.ts +10 -0
- package/src/rules/effect/contextCapture.ts +1 -1
- package/src/rules/effect/program.ts +19 -1
- package/src/rules/effect/serviceCatalog.ts +12 -2
- package/src/rules/effect/serviceFindings.ts +38 -7
- package/src/rules/effect/serviceOrigin.ts +14 -1
- package/src/rules/effect/serviceParameters.ts +13 -14
- package/src/rules/effect/serviceTypes.ts +11 -1
- package/src/rules/files/namedAfterExport.ts +19 -13
- package/dist/adapters/initializerDependency.d.ts +0 -3
- package/dist/adapters/initializerDependency.d.ts.map +0 -1
- package/dist/adapters/initializerDependency.js +0 -53
- package/dist/adapters/initializerDependency.js.map +0 -1
- package/src/adapters/initializerDependency.ts +0 -57
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.67.2 - 2026-11-06
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- Follow programmatic bundler entries reached through package build scripts when checking unused code and file names, including Electron main and preload adapters.
|
|
8
|
+
- Recognize dependency-cruiser tool configs in file naming and the shared Biome default-export policy while keeping ordinary modules subject to both checks.
|
|
9
|
+
|
|
10
|
+
## 0.67.1 - 2026-11-06
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Distinguish owned service state and adapter resources from captured environment dependencies, check local service plumbing, and accept environments assembled from Layers at composition roots.
|
|
15
|
+
- Reuse service analysis across parameter checks to avoid repeated traversal of shared types and declarations.
|
|
16
|
+
|
|
3
17
|
## 0.67.0 - 2026-11-06
|
|
4
18
|
|
|
5
19
|
### Fixed
|
package/README.md
CHANGED
|
@@ -122,7 +122,7 @@ Within Effect code, folders named `adapters/` or `test-support/`, at any depth,
|
|
|
122
122
|
|
|
123
123
|
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.
|
|
124
124
|
|
|
125
|
-
`effect/service-parameters` reports parameters carrying a service in exported functions and public methods, including returned factories. 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. Installed implementation shapes are discovered in the consuming repository's package scopes, alongside the framework service package's scope.
|
|
125
|
+
`effect/service-parameters` reports parameters carrying a service in exported and local functions and public methods, including returned factories. 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. Callbacks whose arguments are supplied by their owner keep those arguments; 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. 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, including 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.
|
|
126
126
|
|
|
127
127
|
Both rules refuse config exceptions and inline suppressions. Record existing debt with `quality baseline write --rule effect/boundary --file src/legacy.ts` and `quality baseline write --rule effect/service-parameters --file src/legacy.ts`; the normal report and baseline burn-down apply.
|
|
128
128
|
|
|
@@ -136,11 +136,11 @@ Import and local aliases, string literals and templates without substitutions ar
|
|
|
136
136
|
|
|
137
137
|
### Service assemblies
|
|
138
138
|
|
|
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
|
|
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 follows initializer values and returned closures to distinguish owned resources from dependencies: repositories, SQL clients, HTTP clients and configuration belong in `requires` and are yielded inside operations. Initializers hold owned scopes, acquired handles, caches, refs and locks, closures over those resources, 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
140
|
|
|
141
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
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`.
|
|
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. Composition roots and full-application test harnesses may close over contexts built from Layers, or capture an environment inside an application whose requirements are fully provided by Layers. This follows the construction rather than the filename or folder; an ambient context in an ordinary service remains a finding. 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`.
|
|
144
144
|
|
|
145
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.
|
|
146
146
|
|
|
@@ -407,7 +407,7 @@ Git calls `quality baseline merge <ancestor> <current> <other>`. Entries are key
|
|
|
407
407
|
|
|
408
408
|
### Unused code
|
|
409
409
|
|
|
410
|
-
`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. 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.
|
|
410
|
+
`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 and `Bun.build`, reading literal entry lists or maps, local constants and Node path `join` / `resolve` calls. 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. 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.
|
|
411
411
|
|
|
412
412
|
Package `exports` are public API, including wildcard targets and source conditions. Package `bin` and scripts, test and story globs, tool configs and `src/test-support` provide the other entry points. Imports reachable from those entries count as used. Source-conditioned package import aliases resolve to their sources before a build. Compiler mappings from `tsconfig.json` and `tsconfig.build.json` keep imports on their source files when build output exists. An internal module can be used while one of its exports remains unused. An application’s declared dependency entry points satisfy provided imports under the same policy as `imports/manifest`.
|
|
413
413
|
|
|
@@ -424,7 +424,7 @@ For adoption, run `quality baseline write --rule code/unused --file src/legacy.t
|
|
|
424
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.
|
|
425
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`.
|
|
426
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.
|
|
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.
|
|
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` 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. 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: `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.
|
|
428
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.
|
|
429
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.
|
|
430
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.
|
package/biome/declarations.json
CHANGED
|
@@ -15,7 +15,13 @@
|
|
|
15
15
|
"rule": "lint/correctness/noUnusedFunctionParameters"
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
|
-
"includes": [
|
|
18
|
+
"includes": [
|
|
19
|
+
"**/*.config.*",
|
|
20
|
+
"**/.dependency-cruiser.{ts,mts,cts,js,mjs,cjs}",
|
|
21
|
+
"**/.railway/railway.ts",
|
|
22
|
+
"**/.railway/railway.py",
|
|
23
|
+
"**/.railway/railway.go"
|
|
24
|
+
],
|
|
19
25
|
"reason": "Tools load their config files through the default export.",
|
|
20
26
|
"rule": "lint/style/noDefaultExport"
|
|
21
27
|
},
|
package/biome/preset.json
CHANGED
|
@@ -635,7 +635,13 @@
|
|
|
635
635
|
"includes": ["**", "!**/package.json"]
|
|
636
636
|
},
|
|
637
637
|
{
|
|
638
|
-
"includes": [
|
|
638
|
+
"includes": [
|
|
639
|
+
"**/*.config.*",
|
|
640
|
+
"**/.dependency-cruiser.{ts,mts,cts,js,mjs,cjs}",
|
|
641
|
+
"**/.railway/railway.ts",
|
|
642
|
+
"**/.railway/railway.py",
|
|
643
|
+
"**/.railway/railway.go"
|
|
644
|
+
],
|
|
639
645
|
"linter": {
|
|
640
646
|
"rules": {
|
|
641
647
|
"style": {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildEntryPaths.d.ts","sourceRoot":"","sources":["../../src/adapters/buildEntryPaths.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,YAAY,CAAC;AA+B5B,wBAAgB,eAAe,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,WAAW,CAAC,EAAE,CAAC,IAAI,CAAa,GAAG,SAAS,MAAM,EAAE,CAmBjJ"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { posix } from "node:path";
|
|
2
|
+
import ts from "typescript";
|
|
3
|
+
import { buildEntryValue, buildOption } from "./buildEntryValue.js";
|
|
4
|
+
import { importedCall } from "./importedCall.js";
|
|
5
|
+
function pathFromCall(node, cwd, paths) {
|
|
6
|
+
if (node.expression.getText() === "process.cwd" && node.arguments.length === 0) {
|
|
7
|
+
return [cwd];
|
|
8
|
+
}
|
|
9
|
+
const imported = importedCall(node);
|
|
10
|
+
if (imported === undefined || !/^(?:node:)?path$/u.test(imported.module) || (imported.name !== "join" && imported.name !== "resolve")) {
|
|
11
|
+
return [];
|
|
12
|
+
}
|
|
13
|
+
const parts = node.arguments.map(paths);
|
|
14
|
+
if (parts.some((part) => part.length !== 1)) {
|
|
15
|
+
return [];
|
|
16
|
+
}
|
|
17
|
+
const values = parts.flat();
|
|
18
|
+
return [imported.name === "resolve" ? posix.resolve(cwd, ...values) : posix.join(...values)];
|
|
19
|
+
}
|
|
20
|
+
function valuesOf(node) {
|
|
21
|
+
if (ts.isArrayLiteralExpression(node)) {
|
|
22
|
+
return node.elements;
|
|
23
|
+
}
|
|
24
|
+
if (!ts.isObjectLiteralExpression(node)) {
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
27
|
+
const input = buildOption(node, "in");
|
|
28
|
+
return input === undefined ? node.properties.flatMap((property) => (ts.isPropertyAssignment(property) ? [property.initializer] : [])) : [input];
|
|
29
|
+
}
|
|
30
|
+
export function buildEntryPaths(expression, cwd, file, active = new Set()) {
|
|
31
|
+
const node = buildEntryValue(expression);
|
|
32
|
+
if (active.has(node)) {
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
const visited = new Set([...active, node]);
|
|
36
|
+
function paths(value) {
|
|
37
|
+
return buildEntryPaths(value, cwd, file, visited);
|
|
38
|
+
}
|
|
39
|
+
if (ts.isStringLiteralLike(node)) {
|
|
40
|
+
return [node.text];
|
|
41
|
+
}
|
|
42
|
+
if ((ts.isIdentifier(node) && node.text === "__dirname")
|
|
43
|
+
|| (ts.isPropertyAccessExpression(node) && node.expression.kind === ts.SyntaxKind.MetaProperty && node.name.text === "dirname")) {
|
|
44
|
+
return [posix.dirname(file)];
|
|
45
|
+
}
|
|
46
|
+
return ts.isCallExpression(node) ? pathFromCall(node, cwd, paths) : valuesOf(node).flatMap(paths);
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=buildEntryPaths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildEntryPaths.js","sourceRoot":"","sources":["../../src/adapters/buildEntryPaths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,SAAS,YAAY,CAAC,IAAuB,EAAE,GAAW,EAAE,KAAuD;IAClH,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,KAAK,aAAa,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChF,OAAO,CAAC,GAAG,CAAC,CAAC;IACd,CAAC;IACD,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IACpC,IAAI,QAAQ,KAAK,SAAS,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,MAAM,IAAI,QAAQ,CAAC,IAAI,KAAK,SAAS,CAAC,EAAE,CAAC;QACvI,OAAO,EAAE,CAAC;IACX,CAAC;IACD,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACxC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC;QAC7C,OAAO,EAAE,CAAC;IACX,CAAC;IACD,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC5B,OAAO,CAAC,QAAQ,CAAC,IAAI,KAAK,S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C;IACD,IAAI,EAAE,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;QAClC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;IACD,IACC,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,KAAK,WAAW,CAAC;WACjD,CAAC,EAAE,CAAC,0BAA0B,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,KAAK,EAAE,CAAC,UAAU,CAAC,YAAY,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,EAC9H,CAAC;QACF,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9B,CAAC;IACD,OAAO,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AACnG,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
export declare function buildEntryValue(node: ts.Expression, active?: ReadonlySet<ts.Node>): ts.Expression;
|
|
3
|
+
export declare function buildOption(options: ts.ObjectLiteralExpression, name: string): ts.Expression | undefined;
|
|
4
|
+
//# sourceMappingURL=buildEntryValue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildEntryValue.d.ts","sourceRoot":"","sources":["../../src/adapters/buildEntryValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AA2B5B,wBAAgB,eAAe,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,EAAE,MAAM,GAAE,WAAW,CAAC,EAAE,CAAC,IAAI,CAAa,GAAG,EAAE,CAAC,UAAU,CAY5G;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,EAAE,CAAC,uBAAuB,EAAE,IAAI,EAAE,MAAM,GAAG,EAAE,CAAC,UAAU,GAAG,SAAS,CAUxG"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
function declaredValue(statements, name) {
|
|
3
|
+
for (const statement of statements) {
|
|
4
|
+
if (!(ts.isVariableStatement(statement) && statement.declarationList.flags & ts.NodeFlags.Const)) {
|
|
5
|
+
continue;
|
|
6
|
+
}
|
|
7
|
+
const declaration = statement.declarationList.declarations.find((entry) => ts.isIdentifier(entry.name) && entry.name.text === name);
|
|
8
|
+
if (declaration !== undefined) {
|
|
9
|
+
return declaration.initializer;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
function initializer(node) {
|
|
15
|
+
let scope = node.parent;
|
|
16
|
+
while (scope !== undefined) {
|
|
17
|
+
const value = ts.isSourceFile(scope) || ts.isBlock(scope) ? declaredValue(scope.statements, node.text) : undefined;
|
|
18
|
+
if (value !== undefined) {
|
|
19
|
+
return value;
|
|
20
|
+
}
|
|
21
|
+
scope = scope.parent;
|
|
22
|
+
}
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
export function buildEntryValue(node, active = new Set()) {
|
|
26
|
+
if (active.has(node)) {
|
|
27
|
+
return node;
|
|
28
|
+
}
|
|
29
|
+
const visited = new Set([...active, node]);
|
|
30
|
+
if (ts.isIdentifier(node)) {
|
|
31
|
+
const value = initializer(node);
|
|
32
|
+
return value === undefined ? node : buildEntryValue(value, visited);
|
|
33
|
+
}
|
|
34
|
+
return ts.isAsExpression(node) || ts.isSatisfiesExpression(node) || ts.isParenthesizedExpression(node)
|
|
35
|
+
? buildEntryValue(node.expression, visited)
|
|
36
|
+
: node;
|
|
37
|
+
}
|
|
38
|
+
export function buildOption(options, name) {
|
|
39
|
+
for (const property of options.properties) {
|
|
40
|
+
if ((ts.isPropertyAssignment(property) || ts.isShorthandPropertyAssignment(property))
|
|
41
|
+
&& property.name.getText().replace(/^["']|["']$/gu, "") === name) {
|
|
42
|
+
return ts.isPropertyAssignment(property) ? property.initializer : property.name;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=buildEntryValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildEntryValue.js","sourceRoot":"","sources":["../../src/adapters/buildEntryValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,SAAS,aAAa,CAAC,UAAmC,EAAE,IAAY;IACvE,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACpC,IAAI,CAAC,CAAC,EAAE,CAAC,mBAAmB,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,eAAe,CAAC,KAAK,GAAG,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;YAClG,SAAS;QACV,CAAC;QACD,MAAM,WAAW,GAAG,SAAS,CAAC,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;QACpI,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC/B,OAAO,WAAW,CAAC,WAAW,CAAC;QAChC,CAAC;IACF,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAED,SAAS,WAAW,CAAC,IAAmB;IACvC,IAAI,KAAK,GAAwB,IAAI,CAAC,MAAM,CAAC;IAC7C,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;QAC5B,MAAM,KAAK,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,C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,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,KAAK,IAAI,EAC/D,CAAC;YACF,OAAO,EAAE,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;QACjF,CAAC;IACF,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundlerEntries.d.ts","sourceRoot":"","sources":["../../src/adapters/bundlerEntries.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAiC3C,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAiBnG"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { posix } from "node:path";
|
|
2
|
+
import ts from "typescript";
|
|
3
|
+
import { parse } from "#rules/parse.ts";
|
|
4
|
+
import { buildEntryPaths } from "./buildEntryPaths.js";
|
|
5
|
+
import { buildEntryValue, buildOption } from "./buildEntryValue.js";
|
|
6
|
+
import { importedCall } from "./importedCall.js";
|
|
7
|
+
const ESBUILD = new Set(["build", "buildSync", "context"]);
|
|
8
|
+
function entryOption(call) {
|
|
9
|
+
const expression = call.expression;
|
|
10
|
+
if (ts.isPropertyAccessExpression(expression) && expression.expression.getText() === "Bun" && expression.name.text === "build") {
|
|
11
|
+
return "entrypoints";
|
|
12
|
+
}
|
|
13
|
+
const imported = importedCall(call);
|
|
14
|
+
return imported?.module === "esbuild" && ESBUILD.has(imported.name) ? "entryPoints" : undefined;
|
|
15
|
+
}
|
|
16
|
+
function entriesOf(call, file, cwd) {
|
|
17
|
+
const option = entryOption(call);
|
|
18
|
+
const [argument] = call.arguments;
|
|
19
|
+
const options = argument === undefined ? undefined : buildEntryValue(argument);
|
|
20
|
+
if (option === undefined || options === undefined || !ts.isObjectLiteralExpression(options)) {
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
const directory = buildOption(options, "absWorkingDir");
|
|
24
|
+
const working = directory === undefined ? cwd : buildEntryPaths(directory, cwd, file)[0];
|
|
25
|
+
if (working === undefined) {
|
|
26
|
+
return [];
|
|
27
|
+
}
|
|
28
|
+
const entries = buildOption(options, option);
|
|
29
|
+
return entries === undefined ? [] : buildEntryPaths(entries, cwd, file).map((path) => posix.resolve(cwd, working, path));
|
|
30
|
+
}
|
|
31
|
+
export function bundlerEntries(file, root, directory) {
|
|
32
|
+
if (!(file.text.includes("esbuild") || file.text.includes("Bun"))) {
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
const source = parse(file);
|
|
36
|
+
if (source === undefined) {
|
|
37
|
+
return [];
|
|
38
|
+
}
|
|
39
|
+
const entries = [];
|
|
40
|
+
function visit(node) {
|
|
41
|
+
if (ts.isCallExpression(node)) {
|
|
42
|
+
entries.push(...entriesOf(node, posix.join(root, file.path), posix.join(root, directory)).map((path) => posix.relative(root, path)));
|
|
43
|
+
}
|
|
44
|
+
ts.forEachChild(node, visit);
|
|
45
|
+
}
|
|
46
|
+
visit(source);
|
|
47
|
+
return entries;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=bundlerEntries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundlerEntries.js","sourceRoot":"","sources":["../../src/adapters/bundlerEntries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,s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,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;QACtI,CAAC;QACD,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC9B,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,CAAC;IACd,OAAO,OAAO,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callbackEscapes.d.ts","sourceRoot":"","sources":["../../src/adapters/callbackEscapes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,wBAAgB,eAAe,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,IAAI,EAAE,EAAE,CAAC,cAAc,EAAE,QAAQ,EAAE,EAAE,CAAC,IAAI,GAAG,OAAO,CA6B5G"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export function callbackEscapes(checker, call, callback) {
|
|
2
|
+
const seen = new Set();
|
|
3
|
+
function exposed(type) {
|
|
4
|
+
if (seen.has(type) || ["~effect/Effect", "~effect/Stream", "~effect/Layer"].some((brand) => type.getProperty(brand) !== undefined)) {
|
|
5
|
+
return false;
|
|
6
|
+
}
|
|
7
|
+
seen.add(type);
|
|
8
|
+
if (type.isUnionOrIntersection()) {
|
|
9
|
+
return type.types.some(exposed);
|
|
10
|
+
}
|
|
11
|
+
if (type
|
|
12
|
+
.getCallSignatures()
|
|
13
|
+
.some((signature) => signature.parameters.some((parameter) => parameter.declarations?.some((declaration) => declaration.parent === callback)))) {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
return (checker.getIndexInfosOfType(type).some((index) => exposed(index.type))
|
|
17
|
+
|| type
|
|
18
|
+
.getProperties()
|
|
19
|
+
.some((property) => (property.declarations ?? []).some((declaration) => declaration.getSourceFile() === callback.getSourceFile())
|
|
20
|
+
&& exposed(checker.getTypeOfSymbol(property))));
|
|
21
|
+
}
|
|
22
|
+
return exposed(checker.getTypeAtLocation(call));
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=callbackEscapes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callbackEscapes.js","sourceRoot":"","sources":["../../src/adapters/callbackEscapes.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,eAAe,CAAC,OAAuB,EAAE,IAAuB,EAAE,QAAiB;IAClG,MAAM,IAAI,GAAG,IAAI,GAAG,EAAW,CAAC;IAChC,SAAS,OAAO,CAAC,IAAa;QAC7B,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,eAAe,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC,EAAE,CAAC;YACpI,OAAO,KAAK,CAAC;QACd,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACf,IAAI,IAAI,CAAC,qBAAqB,EAAE,EAAE,CAAC;YAClC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACjC,CAAC;QACD,IACC,IAAI;aACF,iBAAiB,EAAE;aACnB,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,EAC9I,CAAC;YACF,OAAO,IAAI,CAAC;QACb,CAAC;QACD,OAAO,CACN,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;eACnE,IAAI;iBACL,aAAa,EAAE;iBACf,IAAI,CACJ,CAAC,QAAQ,EAAE,EAAE,CACZ,CAAC,QAAQ,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,aAAa,EAAE,KAAK,QAAQ,CAAC,aAAa,EAAE,CAAC;mBAC1G,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,CAC9C,CACF,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composedContext.d.ts","sourceRoot":"","sources":["../../src/adapters/composedContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAmB5B,wBAAgB,eAAe,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,WAAW,EAAE,EAAE,CAAC,UAAU,GAAG,OAAO,CA4B5F"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
import { effectApi, resolvedValue } from "#adapters/serviceModelSyntax.ts";
|
|
3
|
+
import { boundaryReference } from "#rules/effect/boundaryReference.ts";
|
|
4
|
+
function closedEffect(checker, node) {
|
|
5
|
+
const brand = checker.getTypeAtLocation(node).getProperty("~effect/Effect");
|
|
6
|
+
const requirement = brand === undefined ? undefined : checker.getTypeOfSymbol(brand).getProperty("_R");
|
|
7
|
+
const type = requirement === undefined ? undefined : checker.getTypeOfSymbol(requirement).getCallSignatures()[0]?.getReturnType();
|
|
8
|
+
return type !== undefined && (type.flags & ts.TypeFlags.Never) !== 0;
|
|
9
|
+
}
|
|
10
|
+
function layerProvision(checker, node) {
|
|
11
|
+
return (ts.isCallExpression(node)
|
|
12
|
+
&& effectApi(checker, node.expression, "provide")
|
|
13
|
+
&& node.arguments.some((argument) => checker.getTypeAtLocation(argument).getProperty("~effect/Layer") !== undefined));
|
|
14
|
+
}
|
|
15
|
+
export function composedContext(checker, environment) {
|
|
16
|
+
const value = resolvedValue(checker, environment);
|
|
17
|
+
if (!(ts.isYieldExpression(value) && value.expression !== undefined && ts.isCallExpression(value.expression))) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
const acquisition = value.expression;
|
|
21
|
+
const reference = boundaryReference(checker, acquisition.expression);
|
|
22
|
+
if (reference === "effect.Layer.build"
|
|
23
|
+
|| reference === "effect/Layer.build"
|
|
24
|
+
|| reference === "effect.Layer.buildWithScope"
|
|
25
|
+
|| reference === "effect/Layer.buildWithScope") {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
if (!effectApi(checker, acquisition.expression, "context")) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
let provided = false;
|
|
32
|
+
for (let ancestor = value.parent; ancestor !== undefined; ancestor = ancestor.parent) {
|
|
33
|
+
if (ts.isCallExpression(ancestor)) {
|
|
34
|
+
provided ||= layerProvision(checker, ancestor) || ancestor.arguments.some((argument) => layerProvision(checker, argument));
|
|
35
|
+
if (provided && closedEffect(checker, ancestor)) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=composedContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composedContext.js","sourceRoot":"","sources":["../../src/adapters/composedContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAEvE,SAAS,YAAY,CAAC,OAAuB,EAAE,IAAa;IAC3D,MAAM,KAAK,GAAG,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,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;IACrC,MAAM,SAAS,GAAG,iBAAiB,CAAC,OAAO,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;IACrE,IACC,SAAS,KAAK,oBAAoB;WAC/B,SAAS,KAAK,oBAAoB;WAClC,SAAS,KAAK,6BAA6B;WAC3C,SAAS,KAAK,6BAA6B,EAC7C,CAAC;QACF,OAAO,IAAI,CAAC;IACb,CAAC;IACD,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,WAAW,CAAC,UAAU,EAAE,SAAS,CAAC,EAAE,CAAC;QAC5D,OAAO,KAAK,CAAC;IACd,CAAC;IACD,IAAI,QAAQ,GAAG,KAAK,CAAC;IACrB,KAAK,IAAI,QAAQ,GAAwB,KAAK,CAAC,MAAM,EAAE,QAAQ,KAAK,SAAS,EAAE,QAAQ,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC;QAC3G,IAAI,EAAE,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,CAAC;YACnC,QAAQ,KAAK,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;YAC3H,IAAI,QAAQ,IAAI,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE,CAAC;gBACjD,OAAO,IAAI,CAAC;YACb,CAAC;QACF,CAAC;IACF,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
import type { serviceTypes } from "#rules/effect/serviceTypes.ts";
|
|
3
|
+
export declare function containerDependency(checker: ts.TypeChecker, type: ts.Type, services: ReturnType<typeof serviceTypes>, seen?: Set<ts.Type>): boolean;
|
|
4
|
+
//# sourceMappingURL=containerDependency.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"containerDependency.d.ts","sourceRoot":"","sources":["../../src/adapters/containerDependency.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAkBlE,wBAAgB,mBAAmB,CAClC,OAAO,EAAE,EAAE,CAAC,WAAW,EACvB,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,QAAQ,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,EACzC,IAAI,eAAqB,GACvB,OAAO,CAeT"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
const NATIVE = /\/effect\/(?:src|dist(?:\/dts)?)\/(?:Ref|SynchronizedRef|ScopedRef|Cache|ScopedCache|Deferred|Queue|PubSub|HashMap|HashSet)\.(?:d\.)?ts$/u;
|
|
3
|
+
const COLLECTIONS = new Set(["Map", "ReadonlyMap", "Set", "ReadonlySet", "Array", "ReadonlyArray"]);
|
|
4
|
+
function reference(type) {
|
|
5
|
+
return "objectFlags" in type && typeof type.objectFlags === "number" && (type.objectFlags & ts.ObjectFlags.Reference) !== 0;
|
|
6
|
+
}
|
|
7
|
+
function container(type) {
|
|
8
|
+
const symbol = type.getSymbol();
|
|
9
|
+
return (symbol?.declarations ?? []).some((declaration) => {
|
|
10
|
+
const file = declaration.getSourceFile().fileName.replaceAll("\\", "/");
|
|
11
|
+
return NATIVE.test(file) || (COLLECTIONS.has(symbol?.name ?? "") && /\/lib\.[^/]+\.d\.ts$/u.test(file));
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export function containerDependency(checker, type, services, seen = new Set()) {
|
|
15
|
+
if (seen.has(type) || !(type.flags & (ts.TypeFlags.Object | ts.TypeFlags.Union | ts.TypeFlags.Intersection)) || services.computation(type)) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
seen.add(type);
|
|
19
|
+
if (type.isUnionOrIntersection()) {
|
|
20
|
+
return type.types.some((part) => containerDependency(checker, part, services, seen));
|
|
21
|
+
}
|
|
22
|
+
if (container(type) && reference(type)) {
|
|
23
|
+
return checker.getTypeArguments(type).some((argument) => services.carries(argument) || containerDependency(checker, argument, services, seen));
|
|
24
|
+
}
|
|
25
|
+
return (type.getCallSignatures().length === 0
|
|
26
|
+
&& type.getProperties().some((property) => containerDependency(checker, checker.getTypeOfSymbol(property), services, seen)));
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=containerDependency.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"containerDependency.js","sourceRoot":"","sources":["../../src/adapters/containerDependency.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAG5B,MAAM,MAAM,GACX,2IAA2I,CAAC;AAC7I,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC;AAEpG,SAAS,SAAS,CAAC,IAAa;IAC/B,OAAO,aAAa,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,WAAW,KAAK,QAAQ,IAAI,CAAC,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAC7H,CAAC;AAED,SAAS,SAAS,CAAC,IAAa;IAC/B,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;IAChC,OAAO,CAAC,MAAM,EAAE,YAAY,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE;QACxD,MAAM,IAAI,GAAG,WAAW,CAAC,aAAa,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACxE,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,IAAI,EAAE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AC,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAC3H,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contextCaptureFindings.d.ts","sourceRoot":"","sources":["../../src/adapters/contextCaptureFindings.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"contextCaptureFindings.d.ts","sourceRoot":"","sources":["../../src/adapters/contextCaptureFindings.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAqBpD,eAAO,MAAM,sBAAsB,gEAiClC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { Effect } from "effect";
|
|
3
3
|
import ts from "typescript";
|
|
4
|
+
import { composedContext } from "#adapters/composedContext.ts";
|
|
4
5
|
import { effectApi } from "#adapters/serviceModelSyntax.ts";
|
|
5
6
|
import { effectProgram } from "#rules/effect/program.ts";
|
|
6
7
|
const RUNNERS = ["provideContext", "runPromiseWith", "runForkWith"];
|
|
@@ -33,7 +34,8 @@ export const contextCaptureFindings = Effect.fn("ContextCapture.contextCaptureFi
|
|
|
33
34
|
const syntax = source;
|
|
34
35
|
const findings = [];
|
|
35
36
|
function visit(node) {
|
|
36
|
-
|
|
37
|
+
const environment = ts.isCallExpression(node) ? node.arguments.at(-1) : undefined;
|
|
38
|
+
if (ts.isCallExpression(node) && reprovides(checker, node) && !(environment !== undefined && composedContext(checker, environment))) {
|
|
37
39
|
findings.push({
|
|
38
40
|
file: file.path,
|
|
39
41
|
line: syntax.getLineAndCharacterOfPosition(node.getStart(syntax)).line + 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,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AW,KAAK,SAAS,IAAI,eAAe,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC;gBACrI,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 @@
|
|
|
1
|
+
{"version":3,"file":"foreignResources.d.ts","sourceRoot":"","sources":["../../src/adapters/foreignResources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AA2C5B,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,UAAU,EAAE,eA2BvE,EAAE,CAAC,oBAAoB,KAAG,OAAO,CAYpD"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
import { serviceProperty } from "#adapters/serviceAssemblySyntax.ts";
|
|
3
|
+
import { effectApi, resolvedValue } from "#adapters/serviceModelSyntax.ts";
|
|
4
|
+
import { returnValues } from "#rules/stories/returnValues.ts";
|
|
5
|
+
function foreign(node) {
|
|
6
|
+
const file = node.getSourceFile().fileName.replaceAll("\\", "/");
|
|
7
|
+
return file.includes("/node_modules/") && !/\/(?:effect|@effect|@shivaedev)\//u.test(file);
|
|
8
|
+
}
|
|
9
|
+
function constructed(checker, node, seen = new Set()) {
|
|
10
|
+
if (seen.has(node)) {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
seen.add(node);
|
|
14
|
+
if (ts.isExpression(node)) {
|
|
15
|
+
const value = resolvedValue(checker, node);
|
|
16
|
+
if (value !== node) {
|
|
17
|
+
return constructed(checker, value, seen);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
if (ts.isCallExpression(node) || ts.isNewExpression(node)) {
|
|
21
|
+
return acquisition(checker, node, seen);
|
|
22
|
+
}
|
|
23
|
+
if (ts.isYieldExpression(node)) {
|
|
24
|
+
return node.expression === undefined ? false : constructed(checker, node.expression, seen);
|
|
25
|
+
}
|
|
26
|
+
return ts.isFunctionLike(node) && returnValues(node).some((value) => value !== undefined && constructed(checker, value, seen));
|
|
27
|
+
}
|
|
28
|
+
function acquisition(checker, node, seen) {
|
|
29
|
+
const signature = checker.getResolvedSignature(node);
|
|
30
|
+
if (signature?.declaration !== undefined && foreign(signature.declaration)) {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
if (!(ts.isCallExpression(node) && ["promise", "tryPromise", "sync", "acquireRelease"].some((name) => effectApi(checker, node.expression, name)))) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
const value = node.arguments[0];
|
|
37
|
+
const callback = value !== undefined && ts.isObjectLiteralExpression(value) ? serviceProperty(value, "try") : value;
|
|
38
|
+
return callback !== undefined && constructed(checker, callback, seen);
|
|
39
|
+
}
|
|
40
|
+
export function foreignResources(checker, sources) {
|
|
41
|
+
let calls;
|
|
42
|
+
function argumentsIn() {
|
|
43
|
+
if (calls !== undefined) {
|
|
44
|
+
return calls;
|
|
45
|
+
}
|
|
46
|
+
const arguments_ = new Map();
|
|
47
|
+
function visit(node) {
|
|
48
|
+
if (ts.isCallExpression(node)) {
|
|
49
|
+
const declaration = checker.getResolvedSignature(node)?.declaration;
|
|
50
|
+
for (const [index, parameter] of (declaration?.parameters ?? []).entries()) {
|
|
51
|
+
const argument = node.arguments[index];
|
|
52
|
+
if (argument !== undefined && ts.isParameter(parameter)) {
|
|
53
|
+
const values = arguments_.get(parameter) ?? [];
|
|
54
|
+
values.push(argument);
|
|
55
|
+
arguments_.set(parameter, values);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
ts.forEachChild(node, visit);
|
|
60
|
+
}
|
|
61
|
+
for (const source of sources) {
|
|
62
|
+
visit(source);
|
|
63
|
+
}
|
|
64
|
+
calls = arguments_;
|
|
65
|
+
return arguments_;
|
|
66
|
+
}
|
|
67
|
+
return (parameter) => {
|
|
68
|
+
const source = parameter.getSourceFile();
|
|
69
|
+
if (!/(?:^|\/)adapters\//u.test(source.fileName)) {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
const type = checker.getTypeAtLocation(parameter);
|
|
73
|
+
if (!(type.getSymbol()?.declarations ?? []).some(foreign) || type.getProperty("~effect/Context/Service") !== undefined) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
const values = argumentsIn().get(parameter) ?? [];
|
|
77
|
+
return values.length > 0 && values.every((value) => constructed(checker, value));
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=foreignResources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"foreignResources.js","sourceRoot":"","sources":["../../src/adapters/foreignResources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE9D,SAAS,OAAO,CAAC,IAAoB;IACpC,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACjE,OAAO,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,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