@systemfsoftware/stryker-js 3.0.2 → 5.0.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 +101 -0
- package/LICENSE +3 -15
- package/README.md +69 -21
- package/dist/Plugins-sA_9VKus.d.mts +96 -0
- package/dist/builtin-reporters-wAuKFSsd.mjs +672 -0
- package/dist/builtin-reporters.d.mts +14 -0
- package/dist/builtin-reporters.mjs +2 -0
- package/dist/compiler-Bq9Nelu8.mjs +48406 -0
- package/dist/config.d.mts +11 -0
- package/dist/config.mjs +7 -0
- package/dist/dist-B3nT7z4G.mjs +5155 -0
- package/dist/execAsync-CfPZgJSD.mjs +10 -0
- package/dist/execAsync-DdCu5QLN.mjs +10 -0
- package/dist/getMachineId-bsd-C6bLIaiv.mjs +27 -0
- package/dist/getMachineId-bsd-CXSiHDga.mjs +27 -0
- package/dist/getMachineId-darwin-D3cIKeqx.mjs +24 -0
- package/dist/getMachineId-darwin-DPZ0kdKD.mjs +24 -0
- package/dist/getMachineId-linux-CQwLSlZk.mjs +20 -0
- package/dist/getMachineId-linux-Ci8OVJU0.mjs +20 -0
- package/dist/getMachineId-unsupported-PX0hnW6X.mjs +15 -0
- package/dist/getMachineId-unsupported-_ExL3Avl.mjs +15 -0
- package/dist/getMachineId-win-BCsS9pC_.mjs +26 -0
- package/dist/getMachineId-win-D9Tb0p7w.mjs +26 -0
- package/dist/index.d.mts +1009 -8
- package/dist/index.mjs +3 -9
- package/dist/main.mjs +104333 -0
- package/dist/merge-config-BrrNQWje.mjs +16 -0
- package/dist/mutation-test.cell-RmF-sBUm.d.mts +509 -0
- package/dist/output-mode-CfGHDpi5.d.mts +17 -0
- package/dist/parser.wasm32-wasi.wasm +0 -0
- package/dist/plugin-loader.d.mts +106 -0
- package/dist/plugin-loader.mjs +2 -0
- package/dist/plugin-worker-entry-DNu0SHO8.mjs +1413 -0
- package/dist/promises.d.mts +5 -0
- package/dist/promises.mjs +14 -0
- package/dist/rolldown-runtime-Dr7-SnC6.mjs +45 -0
- package/dist/src-Bzh7ykDp.mjs +4724 -0
- package/dist/stryker-config-BlfHxS7n.d.mts +14 -0
- package/dist/wasm-Dr7kZatW.mjs +13017 -0
- package/package.json +81 -38
- package/dist/Checker-A8o5B3Ub.d.mts +0 -40
- package/dist/Checker-Bq8NXD8d.mjs +0 -25
- package/dist/Checker.d.mts +0 -2
- package/dist/Checker.mjs +0 -2
- package/dist/Evaluator-CnAN8-pZ.d.mts +0 -19
- package/dist/Evaluator.d.mts +0 -3
- package/dist/Evaluator.mjs +0 -9
- package/dist/ExitClass.d.mts +0 -9
- package/dist/ExitClass.mjs +0 -59
- package/dist/ExitClass.schema-BmOIK5zT.d.mts +0 -18
- package/dist/Ignorer-BUY68FZQ.d.mts +0 -21
- package/dist/Ignorer.d.mts +0 -2
- package/dist/Ignorer.mjs +0 -7
- package/dist/Metrics.d.mts +0 -7
- package/dist/Metrics.mjs +0 -79
- package/dist/Metrics.schema-BaVd6rXs.d.mts +0 -50
- package/dist/Metrics.schema-DZdoc46X.mjs +0 -27
- package/dist/Module-DHKEMAFI.d.mts +0 -31
- package/dist/Module.d.mts +0 -2
- package/dist/Module.mjs +0 -16
- package/dist/Mutant-Ci25PsWA.d.mts +0 -351
- package/dist/Mutant.d.mts +0 -3
- package/dist/Mutant.mjs +0 -90
- package/dist/Mutant.schema-H3r0ho_R.mjs +0 -34
- package/dist/Plugin-BtItMchw.d.mts +0 -153
- package/dist/Plugin-DXFdJP1l.mjs +0 -105
- package/dist/Plugin.d.mts +0 -2
- package/dist/Plugin.mjs +0 -2
- package/dist/Report.d.mts +0 -2
- package/dist/Report.mjs +0 -98
- package/dist/Report.schema-_buHXdnZ.d.mts +0 -251
- package/dist/Reporter-BWTwlSJf.mjs +0 -25
- package/dist/Reporter-C7ysGxqX.d.mts +0 -16
- package/dist/Reporter.d.mts +0 -4
- package/dist/Reporter.mjs +0 -3
- package/dist/ReporterEvent.d.mts +0 -2
- package/dist/ReporterEvent.mjs +0 -57
- package/dist/ReporterEvent.schema-BhtyYCZo.d.mts +0 -189
- package/dist/Run-BUpNSmcM.d.mts +0 -172
- package/dist/Run.d.mts +0 -2
- package/dist/Run.mjs +0 -56
- package/dist/Run.schema-DZve3k2m.mjs +0 -138
- package/dist/Schema-4oCWQ0P0.d.mts +0 -158
- package/dist/Schema-CMKdWMUN.mjs +0 -244
- package/dist/Schema.d.mts +0 -2
- package/dist/Schema.mjs +0 -2
- package/dist/TestRunner.d.mts +0 -2
- package/dist/TestRunner.mjs +0 -57
- package/dist/TestRunner.schema-Dy0Wdro2.mjs +0 -119
- package/dist/output-file.d.mts +0 -8
- package/dist/output-file.mjs +0 -8
- package/dist/provided-options.d.mts +0 -16
- package/dist/provided-options.mjs +0 -1
- package/dist/rolldown-runtime-D7D4PA-g.mjs +0 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,106 @@
|
|
|
1
1
|
# @systemfsoftware/stryker-js
|
|
2
2
|
|
|
3
|
+
## 5.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- Plugin entries in `plugins` and `appendPlugins` are now the entrypoints
|
|
8
|
+
themselves, as `file:` URLs, instead of package names Stryker resolved for you.
|
|
9
|
+
|
|
10
|
+
Stryker resolved every specifier against its own module before, so a plugin the
|
|
11
|
+
project had installed was only found when Node happened to walk to the right
|
|
12
|
+
`node_modules` from Stryker's location — which is not the project's location for
|
|
13
|
+
a global install, an `npx` run, or a strict isolated store. The project now
|
|
14
|
+
resolves each plugin itself, in the config module where the project's own
|
|
15
|
+
dependencies are visible:
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { defineConfig } from '@systemfsoftware/stryker-js/config'
|
|
19
|
+
|
|
20
|
+
export default defineConfig({
|
|
21
|
+
plugins: [import.meta.resolve('@acme/stryker-runner')],
|
|
22
|
+
})
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The `--plugins` and `--appendPlugins` flags take the same resolved URLs. A value
|
|
26
|
+
that is not a `file:` URL is refused with the entry named.
|
|
27
|
+
|
|
28
|
+
Stryker no longer reports an unresolved specifier as a warning it can continue
|
|
29
|
+
past, because it no longer resolves one: a plugin that cannot be loaded stops
|
|
30
|
+
the run and names the entry, and a plugin that loads but contributes nothing is
|
|
31
|
+
still reported as before.
|
|
32
|
+
|
|
33
|
+
- The engine and the CLI are one package. `@systemfsoftware/stryker-js` now ships
|
|
34
|
+
the `stryker` binary, the run engine, and the configuration surface, replacing
|
|
35
|
+
`@systemfsoftware/stryker-js-cli` and `@systemfsoftware/stryker-js-engine`, which
|
|
36
|
+
are discontinued.
|
|
37
|
+
|
|
38
|
+
Two subpaths are new:
|
|
39
|
+
|
|
40
|
+
- `./config` — `defineConfig`, `mergeConfig`, `ConfigEnv`, `StrykerConfig`. Use it
|
|
41
|
+
instead of hand-typing `stryker.config.ts` against the option type.
|
|
42
|
+
- `./promises` — `run`, the same run interpreted for promise callers, so an
|
|
43
|
+
embedding script does not need an Effect runtime.
|
|
44
|
+
|
|
45
|
+
Migrate by importing from `@systemfsoftware/stryker-js`. Everything the two
|
|
46
|
+
discontinued packages exported — the option type, `readConfig`, the plugin
|
|
47
|
+
loader, `WorkerLauncher`, and the exit classification — keeps its name and its
|
|
48
|
+
behavior at the new address.
|
|
49
|
+
|
|
50
|
+
`@systemfsoftware/stryker-js-language` is gone; it is replaced rather than
|
|
51
|
+
continued. The run-event vocabulary it was carrying — `RunEvents`, `RunIdentity`,
|
|
52
|
+
`RunPhase`, and the `Run*` event schemas — now ships from
|
|
53
|
+
`@systemfsoftware/stryker-js`. Two consequences follow for anyone who imported
|
|
54
|
+
it:
|
|
55
|
+
|
|
56
|
+
- The mutant model, the report schemas, and the checker, evaluator and
|
|
57
|
+
test-runner contracts come from `@systemfsoftware/stryker-js-instrumenter`
|
|
58
|
+
and `@systemfsoftware/stryker-js-plugin-interface`. Update those imports.
|
|
59
|
+
- The service identifiers `@systemfsoftware/stryker-js-language/RunEvents` and
|
|
60
|
+
`@systemfsoftware/stryker-js-language/RunIdentity` are now
|
|
61
|
+
`@systemfsoftware/stryker-js/RunEvents` and
|
|
62
|
+
`@systemfsoftware/stryker-js/RunEvents/RunIdentity`. A program that provides or
|
|
63
|
+
looks up either service by its identifier string must use the new one.
|
|
64
|
+
|
|
65
|
+
Two more changes reach programmatic callers:
|
|
66
|
+
|
|
67
|
+
- `testRunner: 'vm'` runs the test suite in memory. Stryker strips TypeScript from
|
|
68
|
+
the test files during preparation and evaluates them in a fresh V8 context per
|
|
69
|
+
mutant, so a run needs no child process and no manual bundling.
|
|
70
|
+
- `readConfig` and `resolveExtends` take the invocation a configuration is being
|
|
71
|
+
read for, so a `stryker.config.ts` may export a factory receiving
|
|
72
|
+
`{ command, isDryRun, mode, isCi }` and compute its settings per invocation.
|
|
73
|
+
Both keep working for a plain exported object; the extra argument is the
|
|
74
|
+
`command` and output `mode` the loader cannot see for itself.
|
|
75
|
+
|
|
76
|
+
## 4.0.0
|
|
77
|
+
|
|
78
|
+
### Major Changes
|
|
79
|
+
|
|
80
|
+
- The machine-stream event class `MutantTested` (tag `mutant`) is renamed `RunMutantTested`.
|
|
81
|
+
|
|
82
|
+
The reporter-protocol event class keeps the name `MutantTested`; the two classes described different events under one name. Serialized stream output is unchanged — the rename is the exported binding only. If you constructed or matched the machine-stream class, import `RunMutantTested` from `@systemfsoftware/stryker-js/Run`.
|
|
83
|
+
|
|
84
|
+
- Removed the unused `output-file` and `provided-options` entry points — neither carried vocabulary the rest of the package does not already provide.
|
|
85
|
+
|
|
86
|
+
If you imported `output-file`, write the directory and file through your own filesystem service. If you imported the `ProvidedStrykerOptions` alias, use `StrykerOptions` from `@systemfsoftware/stryker-js/Schema` instead.
|
|
87
|
+
|
|
88
|
+
- All subpath entry points are removed; the package exports one root specifier that enumerates every published symbol exactly once.
|
|
89
|
+
|
|
90
|
+
`@systemfsoftware/stryker-js/Checker`, `/Schema`, `/Run`, and every other concept specifier are gone. Import the same symbols from `@systemfsoftware/stryker-js` directly. Two names changed while the vocabulary merged into one surface:
|
|
91
|
+
|
|
92
|
+
- the machine-stream result type `MutantResult` is now `RunMutantResult` (the serialized report shape keeps the name `MutantResult`);
|
|
93
|
+
- the reporter barrel `./Reporter` merged into `ReporterEvent`: `ReporterFailed` now lives beside the event classes, and the unused `REPORTER_SCHEMA_VERSION` constant is deleted.
|
|
94
|
+
|
|
95
|
+
Duplicate publications of `MutantStatus`, `Position`, `Location`, and their schema values now resolve to the report-format home, so every symbol has exactly one import path.
|
|
96
|
+
|
|
97
|
+
### Patch Changes
|
|
98
|
+
|
|
99
|
+
- The recommended oxlint set now carries `workflow-variant-constructed` and `runtime-construction-placement` at `error`, and the make-keyed workflow rules recognize the `Workflow.total` and `Workflow.andThen` constructors as lawful workflow construction.
|
|
100
|
+
|
|
101
|
+
- Updated dependencies:
|
|
102
|
+
- @systemfsoftware/effect-cell-types@8.0.0
|
|
103
|
+
|
|
3
104
|
## 3.0.2
|
|
4
105
|
|
|
5
106
|
### Patch Changes
|
package/LICENSE
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Apache License
|
|
1
|
+
Apache License
|
|
4
2
|
Version 2.0, January 2004
|
|
5
3
|
http://www.apache.org/licenses/
|
|
6
4
|
|
|
@@ -180,7 +178,7 @@ Apache License
|
|
|
180
178
|
APPENDIX: How to apply the Apache License to your work.
|
|
181
179
|
|
|
182
180
|
To apply the Apache License to your work, attach the following
|
|
183
|
-
boilerplate notice, with the fields enclosed by brackets "
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "{}"
|
|
184
182
|
replaced with your own identifying information. (Don't include
|
|
185
183
|
the brackets!) The text should be enclosed in the appropriate
|
|
186
184
|
comment syntax for the file format. We also recommend that a
|
|
@@ -188,7 +186,7 @@ Apache License
|
|
|
188
186
|
same "printed page" as the copyright notice for easier
|
|
189
187
|
identification within third-party archives.
|
|
190
188
|
|
|
191
|
-
Copyright
|
|
189
|
+
Copyright {yyyy} {name of copyright owner}
|
|
192
190
|
|
|
193
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
194
192
|
you may not use this file except in compliance with the License.
|
|
@@ -201,13 +199,3 @@ Apache License
|
|
|
201
199
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
202
200
|
See the License for the specific language governing permissions and
|
|
203
201
|
limitations under the License.
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
----------------------------------------------------------------------
|
|
207
|
-
Third-party notices
|
|
208
|
-
|
|
209
|
-
Portions of this software are derived from @stryker-mutator/vitest-runner
|
|
210
|
-
v9.6.1 (upstream commit e1abfbe), part of StrykerJS
|
|
211
|
-
(https://github.com/stryker-mutator/stryker-js), which is licensed under the
|
|
212
|
-
Apache License, Version 2.0 — the same license this package is distributed
|
|
213
|
-
under. The derived files have been modified.
|
package/README.md
CHANGED
|
@@ -1,32 +1,80 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@systemfsoftware/stryker-js`
|
|
2
2
|
|
|
3
|
-
The mutation
|
|
4
|
-
|
|
5
|
-
mutation test lives in `@systemfsoftware/stryker-js-engine`.
|
|
3
|
+
The Stryker mutation testing tool: the `stryker` executable, the run engine it
|
|
4
|
+
drives, and the configuration surface a project writes its options against.
|
|
6
5
|
|
|
7
6
|
## Install
|
|
8
7
|
|
|
9
|
-
```
|
|
10
|
-
pnpm add @systemfsoftware/stryker-js
|
|
8
|
+
```bash
|
|
9
|
+
pnpm add -D @systemfsoftware/stryker-js
|
|
11
10
|
```
|
|
12
11
|
|
|
13
|
-
##
|
|
12
|
+
## Configure
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
```ts
|
|
15
|
+
// stryker.config.ts
|
|
16
|
+
import { defineConfig } from '@systemfsoftware/stryker-js/config'
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
export default defineConfig(({ isCi }) => ({
|
|
19
|
+
testRunner: 'vitest',
|
|
20
|
+
plugins: ['@systemfsoftware/stryker-js-vitest-runner'],
|
|
21
|
+
mutate: ['src/**/*.ts', '!src/**/*.test.ts'],
|
|
22
|
+
}))
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
`defineConfig` is an identity function: it preserves literal types and accepts
|
|
26
|
+
an object, a promise, or a function receiving `ConfigEnv` (`command`,
|
|
27
|
+
`isDryRun`, `mode`, `isCi`). `mergeConfig` composes a preset with overrides —
|
|
28
|
+
records merge key by key, and a scalar or array (the default plugin globs among
|
|
29
|
+
them) replaces the default outright.
|
|
30
|
+
|
|
31
|
+
## Run
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pnpm exec stryker run
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The **`command`** runner ships in the box: it shells out to a configured command
|
|
38
|
+
and reads its exit code.
|
|
39
|
+
|
|
40
|
+
Projects whose suites depend on a real module graph, DOM emulation, or per-test
|
|
41
|
+
coverage use the satellite `@systemfsoftware/stryker-js-vitest-runner` instead.
|
|
42
|
+
|
|
43
|
+
## Program from Effect
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
import { NodeRuntime } from '@effect/platform-node'
|
|
47
|
+
import { strykerCell } from '@systemfsoftware/stryker-js'
|
|
48
|
+
|
|
49
|
+
NodeRuntime.runMain(strykerCell({ mutate: ['src/**/*.ts'] }))
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
`strykerCell` is a lazy `Effect`, not a started promise. Callers that speak
|
|
53
|
+
promises import the wrapper instead:
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
import { run } from '@systemfsoftware/stryker-js/promises'
|
|
57
|
+
|
|
58
|
+
const report = await run({ testRunner: 'command' })
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Subpaths
|
|
62
|
+
|
|
63
|
+
| Subpath | What it is |
|
|
64
|
+
| --------------------- | ----------------------------------------------------------------- |
|
|
65
|
+
| `.` | Programmatic surface: Effect cells, layers and the run vocabulary |
|
|
66
|
+
| `./config` | `defineConfig`, `mergeConfig`, `ConfigEnv`, `StrykerConfig` |
|
|
67
|
+
| `./promises` | `run` — the same run, interpreted for promise callers |
|
|
68
|
+
| `./builtin-reporters` | The built-in reporter factories |
|
|
69
|
+
| `./plugin-loader` | Plugin discovery and worker-entry resolution |
|
|
70
|
+
|
|
71
|
+
## Related
|
|
72
|
+
|
|
73
|
+
- [`@systemfsoftware/stryker-js-instrumenter`](../stryker-js-instrumenter) — AST mutation and the mutant vocabulary
|
|
74
|
+
- [`@systemfsoftware/stryker-js-plugin-interface`](../stryker-js-plugin-interface) — the plugin boundary: RPC groups, payload schemas, typed failures
|
|
75
|
+
- [`@systemfsoftware/stryker-js-vitest-runner`](../stryker-js-vitest-runner) — the Vitest-backed test runner
|
|
76
|
+
- [`@systemfsoftware/stryker-js-html-reporter`](../stryker-js-html-reporter) — the HTML report
|
|
29
77
|
|
|
30
78
|
## License
|
|
31
79
|
|
|
32
|
-
Apache-2.0
|
|
80
|
+
Apache-2.0
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Path from "effect/Path";
|
|
3
|
+
import { ExitClass, WorkerPluginKind } from "@systemfsoftware/stryker-js-plugin-interface";
|
|
4
|
+
import "effect/Option";
|
|
5
|
+
import * as S from "effect/Schema";
|
|
6
|
+
import { Schema } from "effect";
|
|
7
|
+
import * as HashMap from "effect/HashMap";
|
|
8
|
+
import { Ignorer } from "@systemfsoftware/stryker-ignorer-interface";
|
|
9
|
+
//#region src/Run.schema.d.ts
|
|
10
|
+
declare const TypeId: '~stryker/mutation-run/StageError';
|
|
11
|
+
declare const StageError_base: S.Class<StageError, S.TaggedStruct<"StageError", {
|
|
12
|
+
readonly stage: S.Literals<readonly ["prepare", "instrument", "dryRun", "dryRunNoTests", "mutationTest"]>;
|
|
13
|
+
readonly reason: S.String;
|
|
14
|
+
readonly cause: S.optional<S.Defect>;
|
|
15
|
+
readonly command: S.optional<S.String>;
|
|
16
|
+
}>, import("effect/Cause").YieldableError>;
|
|
17
|
+
declare class StageError extends StageError_base {
|
|
18
|
+
readonly [TypeId]: "~stryker/mutation-run/StageError";
|
|
19
|
+
get exitClass(): ExitClass;
|
|
20
|
+
get message(): string;
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/Plugins.schema.d.ts
|
|
24
|
+
declare const PluginNotFoundError_base: Schema.Class<PluginNotFoundError, Schema.TaggedStruct<"PluginNotFoundError", {
|
|
25
|
+
readonly descriptor: Schema.String;
|
|
26
|
+
}>, import("effect/Cause").YieldableError>;
|
|
27
|
+
declare class PluginNotFoundError extends PluginNotFoundError_base {
|
|
28
|
+
readonly exitClass: 'ConfigError';
|
|
29
|
+
}
|
|
30
|
+
declare const PluginLoadFailedError_base: Schema.Class<PluginLoadFailedError, Schema.TaggedStruct<"PluginLoadFailedError", {
|
|
31
|
+
readonly descriptor: Schema.String;
|
|
32
|
+
readonly cause: Schema.Unknown;
|
|
33
|
+
}>, import("effect/Cause").YieldableError>;
|
|
34
|
+
declare class PluginLoadFailedError extends PluginLoadFailedError_base {
|
|
35
|
+
readonly exitClass: 'InternalError';
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/Plugins.d.ts
|
|
39
|
+
type PluginKind = WorkerPluginKind | 'Evaluator';
|
|
40
|
+
interface WorkerPluginDescriptor<K extends WorkerPluginKind = WorkerPluginKind> {
|
|
41
|
+
readonly kind: K;
|
|
42
|
+
readonly name: string;
|
|
43
|
+
readonly workerEntry: string;
|
|
44
|
+
}
|
|
45
|
+
interface EvaluatorPluginDescriptor {
|
|
46
|
+
readonly kind: 'Evaluator';
|
|
47
|
+
readonly name: string;
|
|
48
|
+
}
|
|
49
|
+
type AnyWorkerPluginDescriptor = { [K in WorkerPluginKind]: WorkerPluginDescriptor<K>; }[WorkerPluginKind];
|
|
50
|
+
type AnyPluginDescriptor = AnyWorkerPluginDescriptor | EvaluatorPluginDescriptor;
|
|
51
|
+
type PluginDescriptorOf<K extends PluginKind> = Extract<AnyPluginDescriptor, {
|
|
52
|
+
readonly kind: K;
|
|
53
|
+
}>;
|
|
54
|
+
type PluginDescriptor<K extends PluginKind = PluginKind> = PluginDescriptorOf<K>;
|
|
55
|
+
interface WorkerPluginSource<K extends WorkerPluginKind = WorkerPluginKind> {
|
|
56
|
+
readonly kind: K;
|
|
57
|
+
readonly name: string;
|
|
58
|
+
readonly modulePath: string;
|
|
59
|
+
readonly workerEntry: string;
|
|
60
|
+
}
|
|
61
|
+
interface EvaluatorPluginSource {
|
|
62
|
+
readonly kind: 'Evaluator';
|
|
63
|
+
readonly name: string;
|
|
64
|
+
readonly modulePath: string;
|
|
65
|
+
}
|
|
66
|
+
type AnyWorkerPluginSource = { [K in WorkerPluginKind]: WorkerPluginSource<K>; }[WorkerPluginKind];
|
|
67
|
+
type PluginSource = AnyWorkerPluginSource | EvaluatorPluginSource;
|
|
68
|
+
interface PluginLoaderEntryLike {
|
|
69
|
+
readonly moduleName: string;
|
|
70
|
+
readonly plugins: readonly PluginDescriptor[] | undefined;
|
|
71
|
+
readonly schemaContribution: Record<string, unknown> | undefined;
|
|
72
|
+
}
|
|
73
|
+
interface PluginLoadPlan {
|
|
74
|
+
readonly schemaContributions: readonly Record<string, unknown>[];
|
|
75
|
+
readonly pluginsByKind: HashMap.HashMap<PluginKind, readonly PluginDescriptor[]>;
|
|
76
|
+
readonly pluginModulePaths: readonly string[];
|
|
77
|
+
readonly pluginSources: readonly PluginSource[];
|
|
78
|
+
readonly shadowings: readonly {
|
|
79
|
+
readonly kind: PluginKind;
|
|
80
|
+
readonly name: string;
|
|
81
|
+
readonly shadowedIndex: number;
|
|
82
|
+
readonly winnerIndex: number;
|
|
83
|
+
}[];
|
|
84
|
+
}
|
|
85
|
+
interface LoadedPlugins {
|
|
86
|
+
readonly schemaContributions: readonly Record<string, unknown>[];
|
|
87
|
+
readonly pluginsByKind: HashMap.HashMap<PluginKind, readonly PluginDescriptor[]>;
|
|
88
|
+
readonly pluginModulePaths: readonly string[];
|
|
89
|
+
readonly pluginSources: readonly PluginSource[];
|
|
90
|
+
readonly ignorers: readonly Ignorer[];
|
|
91
|
+
}
|
|
92
|
+
declare function loadPlugins(pluginDescriptors: readonly string[]): Effect.Effect<LoadedPlugins, PluginLoadFailedError, Path.Path>;
|
|
93
|
+
declare function create<K extends PluginKind>(pluginsByKind: HashMap.HashMap<PluginKind, readonly AnyPluginDescriptor[]>, kind: K, name: string): Effect.Effect<PluginDescriptorOf<K>, PluginNotFoundError>;
|
|
94
|
+
declare function createAll<K extends PluginKind>(pluginsByKind: HashMap.HashMap<PluginKind, readonly AnyPluginDescriptor[]>, kind: K): Effect.Effect<readonly PluginDescriptorOf<K>[]>;
|
|
95
|
+
//#endregion
|
|
96
|
+
export { PluginLoadPlan as a, create as c, PluginLoadFailedError as d, PluginNotFoundError as f, PluginKind as i, createAll as l, PluginDescriptor as n, PluginLoaderEntryLike as o, StageError as p, PluginDescriptorOf as r, PluginSource as s, LoadedPlugins as t, loadPlugins as u };
|