@systemfsoftware/oxlint-plugin-effect-platform 1.2.0 → 1.3.1

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @systemfsoftware/oxlint-plugin-effect-platform
2
2
 
3
+ ## 1.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Update peer and runtime dependency on `effect` and companion packages to `4.0.0-rc.117`.
8
+
9
+ ## 1.3.0
10
+
11
+ ### Minor Changes
12
+
13
+ - `runtime-construction-placement` no longer reports `Cell.provide`, which `@systemfsoftware/effect-cell-types` has removed. Its replacement, `Cell.provideContext`, takes a context that was already built, so calling it inside a function rebuilds nothing and is not reported.
14
+
3
15
  ## 1.2.0
4
16
 
5
17
  ### Minor Changes
package/README.md CHANGED
@@ -59,18 +59,18 @@ All five rules are in the recommended set, so the spread enables them at `error`
59
59
 
60
60
  ## Rules
61
61
 
62
- | Rule | Reports |
63
- | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
64
- | `entrypoint-interprets-once` | A `main.ts` with zero or more than one interpretation edge — `runMain` under any namespace, `Effect.run*`, `ManagedRuntime.make`, `Layer.toRuntime` |
65
- | `entrypoint-no-exports` | Any export from `main.ts`: named, default, `export *`, re-export, or type-only |
66
- | `entrypoint-not-imported` | Any static import, re-export, or dynamic `import()` of a `main` module, reported in the importing file — production, barrel, or test |
67
- | `entrypoint-no-promise-wrapper` | `runMain(Effect.tryPromise(...))` or `runMain(Effect.promise(...))`: the outer edge awaits a promise while the real fibers run in a runtime it cannot interrupt |
68
- | `runtime-construction-placement` | `ManagedRuntime.make`, `Layer.provide`, or `Cell.provide` inside a function body — wiring rebuilt per call — and `ManagedRuntime.make` at module scope, where importing the module starts fibers nothing can interrupt. It judges runtime code: a file under a `src/` directory segment, or a `*.test.ts` file; a package-root hook, config, or setup file is outside its subject |
62
+ | Rule | Reports |
63
+ | -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
64
+ | `entrypoint-interprets-once` | A `main.ts` with zero or more than one interpretation edge — `runMain` under any namespace, `Effect.run*`, `ManagedRuntime.make`, `Layer.toRuntime` |
65
+ | `entrypoint-no-exports` | Any export from `main.ts`: named, default, `export *`, re-export, or type-only |
66
+ | `entrypoint-not-imported` | Any static import, re-export, or dynamic `import()` of a `main` module, reported in the importing file — production, barrel, or test |
67
+ | `entrypoint-no-promise-wrapper` | `runMain(Effect.tryPromise(...))` or `runMain(Effect.promise(...))`: the outer edge awaits a promise while the real fibers run in a runtime it cannot interrupt |
68
+ | `runtime-construction-placement` | `ManagedRuntime.make` or `Layer.provide` inside a function body — wiring rebuilt per call — and `ManagedRuntime.make` at module scope, where importing the module starts fibers nothing can interrupt. It judges runtime code: a file under a `src/` directory segment, or a `*.test.ts` file; a package-root hook, config, or setup file is outside its subject |
69
69
 
70
70
  What the placement rule leaves alone, each a shape the rule's own fixtures pin:
71
71
 
72
72
  - A module-scope closure that memoizes the construction — written into a cache binding (`??=`, `||=`, plain assignment) or into a declarator whose binding a nested closure captures.
73
- - Module-scope layer composition: `Layer.provide` and `Cell.provide` at module scope build a graph, not a runtime.
73
+ - Module-scope layer composition: `Layer.provide` at module scope builds a graph, not a runtime. `Cell.provideContext(context)` is silent everywhere — binding a context built once constructs no runtime.
74
74
  - `cell.run(input)` at any depth, in any file.
75
75
  - `main.ts`, the interpretation edge: exempt from the module-scope verdict, because the process entry is where building the runtime is the point. Wiring built inside one of its functions still reports.
76
76
  - A package-root hook, config, or setup file: outside the rule's subject by location, which is why a test runner's hook module may compose at module scope.
package/dist/index.mjs CHANGED
@@ -732,29 +732,15 @@ const resolveIdentifierOrigin = (identifier, getScope, depth) => {
732
732
  const isRuntimeCodeFile = (filename) => /(?:^|[\\/])src[\\/]/u.test(filename) || filename.endsWith(".test.ts");
733
733
  const isInterpretationEdge = (filename) => /(?:^|[\\/])main\.ts$/u.test(filename);
734
734
  const EFFECT_MODULE = "effect";
735
- const CELL_MODULE = "@systemfsoftware/effect-cell-types";
736
- const MANAGED_RUNTIME_NAMESPACE = "ManagedRuntime";
737
- const LAYER_NAMESPACE = "Layer";
738
- const CELL_NAMESPACE = "Cell";
739
- const MAKE_MEMBER = "make";
740
- const PROVIDE_MEMBER = "provide";
741
- const TRACKED_WIRING_CALLS = [
742
- {
743
- source: EFFECT_MODULE,
744
- namespace: MANAGED_RUNTIME_NAMESPACE,
745
- member: MAKE_MEMBER
746
- },
747
- {
748
- source: EFFECT_MODULE,
749
- namespace: LAYER_NAMESPACE,
750
- member: PROVIDE_MEMBER
751
- },
752
- {
753
- source: CELL_MODULE,
754
- namespace: CELL_NAMESPACE,
755
- member: PROVIDE_MEMBER
756
- }
757
- ];
735
+ const TRACKED_WIRING_CALLS = [{
736
+ source: EFFECT_MODULE,
737
+ namespace: "ManagedRuntime",
738
+ member: "make"
739
+ }, {
740
+ source: EFFECT_MODULE,
741
+ namespace: "Layer",
742
+ member: "provide"
743
+ }];
758
744
  const MEMOIZING_ASSIGNMENT_OPERATORS = [
759
745
  "=",
760
746
  "||=",
@@ -769,7 +755,7 @@ const EAGER_CONSTRUCTION_FIX = "wrap the construction in a module-scope memoizin
769
755
  const PLACEMENT_MESSAGE = "{{name}} is forbidden. Expected: {{expected}}. Actual: {{actual}}. Fix: {{fix}}.";
770
756
  const meta = {
771
757
  type: "problem",
772
- docs: { description: "`ManagedRuntime.make`, `Layer.provide`, or `Cell.provide` inside a function body rebuilds wiring per call; `ManagedRuntime.make` evaluated at module scope constructs the runtime at import time. The rule judges runtime code: files under a `src/` directory segment and `*.test.ts` files; a package-root hook, config, or setup file is outside its subject, `.tst.ts` type-test files run nowhere, and `main.ts` is exempt from the module-scope verdict as the interpretation edge. Lawful and silent in scope: a memoized module-scope closure, module-scope graph composition, `cell.run(input)` at any depth. Shapes, bounds, and examples: the README." },
758
+ docs: { description: "`ManagedRuntime.make` or `Layer.provide` inside a function body rebuilds wiring per call; `ManagedRuntime.make` evaluated at module scope constructs the runtime at import time. The rule judges runtime code: files under a `src/` directory segment and `*.test.ts` files; a package-root hook, config, or setup file is outside its subject, `.tst.ts` type-test files run nowhere, and `main.ts` is exempt from the module-scope verdict as the interpretation edge. Lawful and silent in scope: a memoized module-scope closure, module-scope graph composition, `cell.run(input)` at any depth. Shapes, bounds, and examples: the README." },
773
759
  schema: [],
774
760
  messages: {
775
761
  wiringPerCall: PLACEMENT_MESSAGE,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@systemfsoftware/oxlint-plugin-effect-platform",
3
3
  "license": "Apache-2.0",
4
- "version": "1.2.0",
4
+ "version": "1.3.1",
5
5
  "author": "Ryan Lee <drdgvhbh@gmail.com>",
6
6
  "repository": {
7
7
  "type": "git",
@@ -44,29 +44,29 @@
44
44
  "devDependencies": {
45
45
  "@microsoft/api-extractor": "^7.59.1",
46
46
  "@systemfsoftware/arethetypeswrong-cli": "^4.2.0",
47
- "@systemfsoftware/stryker-ignorer-effect-schema-declarations": "^0.1.0",
48
- "@systemfsoftware/stryker-ignorer-in-source-vitest-block": "^0.1.0",
49
- "@systemfsoftware/stryker-js": "^10.0.1",
50
- "@systemfsoftware/stryker-js-typescript-checker": "^7.0.4",
51
- "@systemfsoftware/stryker-js-vitest-runner": "^7.0.1",
47
+ "@systemfsoftware/oxlint-import-origin": "^0.1.0",
48
+ "@systemfsoftware/stryker-config": "^0.1.0",
49
+ "@systemfsoftware/stryker-ignorer-effect-schema-declarations": "^0.1.1",
50
+ "@systemfsoftware/stryker-ignorer-in-source-vitest-block": "^0.1.1",
51
+ "@systemfsoftware/stryker-js": "^10.1.1",
52
+ "@systemfsoftware/stryker-js-typescript-checker": "^7.0.5",
53
+ "@systemfsoftware/stryker-js-vitest-runner": "^7.1.1",
52
54
  "@systemfsoftware/stryker-test-contribution": "^3.0.3",
55
+ "@systemfsoftware/tsconfig": "^2.0.1",
56
+ "@systemfsoftware/tsdown-config": "^0.1.0",
57
+ "@systemfsoftware/vitest-config": "^0.1.0",
53
58
  "@types/node": "^26",
54
59
  "@vitest/coverage-v8": "^5",
55
- "effect": "4.0.0-rc.116",
60
+ "effect": "4.0.0-rc.117",
56
61
  "fast-check": "^4",
57
62
  "oxlint": "~1.82.0",
58
63
  "rimraf": "^6.1.3",
59
64
  "tsdown": "^0.23.0",
60
65
  "typescript": "^7",
61
- "vitest": "^5",
62
- "@systemfsoftware/oxlint-import-origin": "^0.1.0",
63
- "@systemfsoftware/tsdown-config": "^0.1.0",
64
- "@systemfsoftware/stryker-config": "^0.1.0",
65
- "@systemfsoftware/tsconfig": "^1.3.6",
66
- "@systemfsoftware/vitest-config": "^0.1.0"
66
+ "vitest": "^5"
67
67
  },
68
68
  "peerDependencies": {
69
- "effect": "4.0.0-rc.116",
69
+ "effect": "4.0.0-rc.117",
70
70
  "typescript": ">=5.0.0"
71
71
  },
72
72
  "publishConfig": {
@@ -75,7 +75,7 @@
75
75
  "scripts": {
76
76
  "build": "tsdown -l warn && pnpm api:check",
77
77
  "clean": "rimraf dist",
78
- "typecheck": "tsc --noEmit --incremental",
78
+ "typecheck": "tsc -b",
79
79
  "test": "vitest run",
80
80
  "mutation": "stryker run",
81
81
  "mutation:full": "stryker run --force",