@systemfsoftware/oxlint-plugin-effect-platform 1.1.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# @systemfsoftware/oxlint-plugin-effect-platform
|
|
2
|
+
|
|
3
|
+
## 1.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- `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.
|
|
8
|
+
|
|
9
|
+
## 1.2.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- Publish standalone domain-aligned oxlint plugins and shareable configurations for Effect Schema, DMMF workflows, Effect Platform runtime entrypoints, test discipline, and Cell Architecture.
|
|
14
|
+
|
|
15
|
+
Consolidates and supersedes the 12 retired legacy packages (`@systemfsoftware/all`, `@systemfsoftware/oxlint-config`, `@systemfsoftware/oxlint-plugin`, `@systemfsoftware/oxlint-plugin-recommended`, `@systemfsoftware/oxlint-plugin-effect-dmmf`, `@systemfsoftware/oxlint-plugin-effect-native`, `@systemfsoftware/oxlint-plugin-effect-entrypoint`, `@systemfsoftware/oxlint-plugin-effect-workflow`, `@systemfsoftware/oxlint-plugin-property-testing`, `@systemfsoftware/oxlint-plugin-structure`, `@systemfsoftware/oxlint-plugin-tag-discipline`, `@systemfsoftware/oxlint-plugin-test-hygiene`, `@systemfsoftware/oxlint-plugin-test-placement`).
|
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
|
|
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`
|
|
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
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
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
|
|
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.
|
|
4
|
+
"version": "1.3.0",
|
|
5
5
|
"author": "Ryan Lee <drdgvhbh@gmail.com>",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -44,11 +44,11 @@
|
|
|
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.
|
|
48
|
-
"@systemfsoftware/stryker-ignorer-in-source-vitest-block": "^0.1.
|
|
49
|
-
"@systemfsoftware/stryker-js": "^10.
|
|
50
|
-
"@systemfsoftware/stryker-js-typescript-checker": "^7.0.
|
|
51
|
-
"@systemfsoftware/stryker-js-vitest-runner": "^7.
|
|
47
|
+
"@systemfsoftware/stryker-ignorer-effect-schema-declarations": "^0.1.1",
|
|
48
|
+
"@systemfsoftware/stryker-ignorer-in-source-vitest-block": "^0.1.1",
|
|
49
|
+
"@systemfsoftware/stryker-js": "^10.1.1",
|
|
50
|
+
"@systemfsoftware/stryker-js-typescript-checker": "^7.0.5",
|
|
51
|
+
"@systemfsoftware/stryker-js-vitest-runner": "^7.1.1",
|
|
52
52
|
"@systemfsoftware/stryker-test-contribution": "^3.0.3",
|
|
53
53
|
"@types/node": "^26",
|
|
54
54
|
"@vitest/coverage-v8": "^5",
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"@systemfsoftware/oxlint-import-origin": "^0.1.0",
|
|
63
63
|
"@systemfsoftware/stryker-config": "^0.1.0",
|
|
64
64
|
"@systemfsoftware/tsconfig": "^1.3.6",
|
|
65
|
-
"@systemfsoftware/
|
|
66
|
-
"@systemfsoftware/
|
|
65
|
+
"@systemfsoftware/tsdown-config": "^0.1.0",
|
|
66
|
+
"@systemfsoftware/vitest-config": "^0.1.0"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"effect": "4.0.0-rc.116",
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Rule } from '@oxlint/plugins';
|
|
2
|
-
|
|
3
|
-
declare const _default: {
|
|
4
|
-
meta: {
|
|
5
|
-
name: string;
|
|
6
|
-
};
|
|
7
|
-
rules: {
|
|
8
|
-
'entrypoint-interprets-once': Rule;
|
|
9
|
-
'entrypoint-no-exports': Rule;
|
|
10
|
-
'entrypoint-not-imported': Rule;
|
|
11
|
-
'entrypoint-no-promise-wrapper': Rule;
|
|
12
|
-
'runtime-construction-placement': Rule;
|
|
13
|
-
};
|
|
14
|
-
configs: {
|
|
15
|
-
recommended: {
|
|
16
|
-
rules: {
|
|
17
|
-
readonly [x: string]: "error";
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
export default _default;
|
|
23
|
-
|
|
24
|
-
export { }
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Rule } from '@oxlint/plugins';
|
|
2
|
-
|
|
3
|
-
declare const _default: {
|
|
4
|
-
meta: {
|
|
5
|
-
name: string;
|
|
6
|
-
};
|
|
7
|
-
rules: {
|
|
8
|
-
'entrypoint-interprets-once': Rule;
|
|
9
|
-
'entrypoint-no-exports': Rule;
|
|
10
|
-
'entrypoint-not-imported': Rule;
|
|
11
|
-
'entrypoint-no-promise-wrapper': Rule;
|
|
12
|
-
'runtime-construction-placement': Rule;
|
|
13
|
-
};
|
|
14
|
-
configs: {
|
|
15
|
-
recommended: {
|
|
16
|
-
rules: {
|
|
17
|
-
readonly [x: string]: "error";
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
export default _default;
|
|
23
|
-
|
|
24
|
-
export { }
|