@systemfsoftware/stryker-js-plugin-interface 4.0.0 → 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 +19 -0
- package/dist/index.d.mts +170 -108
- package/package.json +5 -5
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# @systemfsoftware/stryker-js-plugin-interface
|
|
2
|
+
|
|
3
|
+
## 5.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- The plugin system now runs each configured TestRunner/Checker/Reporter plugin in its own spawned process over an @effect/rpc wire: plugins load from the project's config-declared specifiers (no glob discovery), boundary failures are typed errors, and plugin spans link into the host trace. Breaking: the in-process plugin Layer contract is removed.
|
|
8
|
+
|
|
9
|
+
- `@systemfsoftware/stryker-js` is renamed to `@systemfsoftware/stryker-js-language`, and the plugin boundary now ships as the two packages `@systemfsoftware/stryker-js-plugin-interface` and `@systemfsoftware/stryker-js-plugin-runtime`.
|
|
10
|
+
|
|
11
|
+
`@systemfsoftware/stryker-js-plugin-interface` owns the contract both sides of the process split agree on: the per-kind `@effect/rpc` groups (`TestRunnerRpcs`, `CheckerRpcs`, `ReporterRpcs`), the boundary payload schemas, the typed boundary errors (`BoundaryPayloadRejected`, `BoundaryUnrecognizedSignal`), the spawn contract (`WorkerPluginKind`, `WorkerPluginSpawnSchema`, `WorkerEntryUrl`), and the trace-context contract (`TraceContextMiddleware`, `PropagatedTrace`, `TracedRpc`, `formatTraceparent`, `parseTraceparent`, `TraceContextReference`, `TRACEPARENT_HEADER`, `TRACESTATE_HEADER`).
|
|
12
|
+
|
|
13
|
+
`@systemfsoftware/stryker-js-plugin-runtime` owns what a plugin process actually runs: the worker server layer a plugin's `main.ts` launches (`workerServerLayer`, `nodeModuleLayer`), the worker and host OTel bootstraps (`startWorkerTelemetry`, `startHostTelemetry`), the worker-options wire codec (`encodeWorkerOptions`, `decodeWorkerOptions`, `readWorkerOptionsFromEnv`), and the trace-context middleware implementations (`layerTraceContextClient`, `layerTraceContextServer`, `withLinkedSpan`, `tracePartsOf`).
|
|
14
|
+
|
|
15
|
+
To migrate, update the package name on every import that is not a plugin symbol to `@systemfsoftware/stryker-js-language`; install `@systemfsoftware/stryker-js-plugin-interface` and import the contract symbols listed above from it, and install `@systemfsoftware/stryker-js-plugin-runtime` for the worker-side symbols. The former in-process surface (`declarePlugin`, `composePlugins`, `PluginContribution`, `PluginLayerContribution`, `PluginKind`, `PluginEnvironment`, `RunConfiguration`, `SandboxDirectory`) no longer exists: a plugin now declares `strykerPlugins: readonly { kind, name }[]` and a worker entry exported under `./worker` (or a `bin`) that serves the per-kind `RpcServer`.
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Maintenance release. Every published entry point, export, option, and behaviour is exactly as it was.
|
package/dist/index.d.mts
CHANGED
|
@@ -1,108 +1,170 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
readonly
|
|
31
|
-
readonly
|
|
32
|
-
|
|
33
|
-
}>;
|
|
34
|
-
|
|
35
|
-
export declare
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export declare const
|
|
53
|
-
|
|
54
|
-
export declare const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
export declare
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
export declare
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
export
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
declare const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
export declare
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
export declare
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
export
|
|
99
|
-
|
|
100
|
-
export declare
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
1
|
+
import { CheckerFailed } from '@systemfsoftware/stryker-js-language';
|
|
2
|
+
import { CheckResultSchema } from '@systemfsoftware/stryker-js-language';
|
|
3
|
+
import * as Context from 'effect/Context';
|
|
4
|
+
import { DryRunCompleted } from '@systemfsoftware/stryker-js-language';
|
|
5
|
+
import { DryRunResultSchema } from '@systemfsoftware/stryker-js-language';
|
|
6
|
+
import { Mutant } from '@systemfsoftware/stryker-js-language';
|
|
7
|
+
import { MutantRunResultSchema } from '@systemfsoftware/stryker-js-language';
|
|
8
|
+
import { MutantTested } from '@systemfsoftware/stryker-js-language';
|
|
9
|
+
import { MutationTestingPlanReady } from '@systemfsoftware/stryker-js-language';
|
|
10
|
+
import { MutationTestReportReady } from '@systemfsoftware/stryker-js-language';
|
|
11
|
+
import * as Option from 'effect/Option';
|
|
12
|
+
import { ReporterEventUnion } from '@systemfsoftware/stryker-js-language';
|
|
13
|
+
import { ReporterFailed } from '@systemfsoftware/stryker-js-language';
|
|
14
|
+
import * as Rpc from 'effect/unstable/rpc/Rpc';
|
|
15
|
+
import * as RpcGroup from 'effect/unstable/rpc/RpcGroup';
|
|
16
|
+
import * as RpcMiddleware from 'effect/unstable/rpc/RpcMiddleware';
|
|
17
|
+
import * as S from 'effect/Schema';
|
|
18
|
+
import { Schema } from 'effect';
|
|
19
|
+
import { TestRunnerCapabilitiesSchema } from '@systemfsoftware/stryker-js-language';
|
|
20
|
+
import { TestRunnerFailed } from '@systemfsoftware/stryker-js-language';
|
|
21
|
+
import { YieldableError } from 'effect/Cause';
|
|
22
|
+
|
|
23
|
+
export declare type BoundaryError = typeof BoundaryErrorSchema.Type;
|
|
24
|
+
|
|
25
|
+
export declare const BoundaryErrorSchema: S.Union<readonly [typeof BoundaryPayloadRejected, typeof BoundaryUnrecognizedSignal, typeof TestRunnerFailed, typeof CheckerFailed, typeof ReporterFailed]>;
|
|
26
|
+
|
|
27
|
+
export declare class BoundaryPayloadRejected extends BoundaryPayloadRejected_base {}
|
|
28
|
+
|
|
29
|
+
declare const BoundaryPayloadRejected_base: S.Class<BoundaryPayloadRejected, S.TaggedStruct<"BoundaryPayloadRejected", {
|
|
30
|
+
readonly pluginName: S.String;
|
|
31
|
+
readonly method: S.String;
|
|
32
|
+
readonly cause: S.String;
|
|
33
|
+
}>, YieldableError>;
|
|
34
|
+
|
|
35
|
+
export declare class BoundaryUnrecognizedSignal extends BoundaryUnrecognizedSignal_base {}
|
|
36
|
+
|
|
37
|
+
declare const BoundaryUnrecognizedSignal_base: S.Class<BoundaryUnrecognizedSignal, S.TaggedStruct<"BoundaryUnrecognizedSignal", {
|
|
38
|
+
readonly pluginName: S.String;
|
|
39
|
+
readonly method: S.String;
|
|
40
|
+
readonly signal: S.String;
|
|
41
|
+
}>, YieldableError>;
|
|
42
|
+
|
|
43
|
+
export declare const CheckerCheckResult: S.$Record<S.String, S.Union<readonly [S.Struct<{
|
|
44
|
+
readonly status: S.Literal<"passed">;
|
|
45
|
+
}>, S.Struct<{
|
|
46
|
+
readonly status: S.Literal<"compileError">;
|
|
47
|
+
readonly reason: S.String;
|
|
48
|
+
}>]>>;
|
|
49
|
+
|
|
50
|
+
export { CheckerFailed }
|
|
51
|
+
|
|
52
|
+
export declare const CheckerGroupResult: S.$Array<S.$Array<S.String>>;
|
|
53
|
+
|
|
54
|
+
export declare const CheckerRequest: S.Struct<{
|
|
55
|
+
readonly checkerName: S.String;
|
|
56
|
+
readonly mutants: S.$Array<typeof Mutant>;
|
|
57
|
+
}>;
|
|
58
|
+
|
|
59
|
+
export declare type CheckerRequest = typeof CheckerRequest.Type;
|
|
60
|
+
|
|
61
|
+
export declare const CheckerRpcs: RpcGroup.RpcGroup<TracedRpc<'check', typeof CheckerRequest, typeof CheckerCheckResult, typeof CheckerFailed> | TracedRpc<'group', typeof CheckerRequest, typeof CheckerGroupResult, typeof CheckerFailed>>;
|
|
62
|
+
|
|
63
|
+
export { CheckResultSchema }
|
|
64
|
+
|
|
65
|
+
export { DryRunResultSchema }
|
|
66
|
+
|
|
67
|
+
export declare const formatTraceparent: (parts: TraceContextParts) => Traceparent;
|
|
68
|
+
|
|
69
|
+
export { MutantRunResultSchema }
|
|
70
|
+
|
|
71
|
+
export declare const parseTraceparent: (value: string) => Option.Option<TraceContextParts>;
|
|
72
|
+
|
|
73
|
+
export declare class PropagatedTrace extends PropagatedTrace_base {}
|
|
74
|
+
|
|
75
|
+
declare const PropagatedTrace_base: Context.ServiceClass<PropagatedTrace, "@systemfsoftware/stryker-js-plugin-interface/TraceContextRpc/PropagatedTrace", Option.Option<TraceContextParts>>;
|
|
76
|
+
|
|
77
|
+
export declare const ReporterAck: S.Void;
|
|
78
|
+
|
|
79
|
+
export declare const ReporterDrained: S.Void;
|
|
80
|
+
|
|
81
|
+
export declare const ReporterEventBatch: S.$Array<S.Union<readonly [DryRunCompleted, MutationTestingPlanReady, MutantTested, MutationTestReportReady]>>;
|
|
82
|
+
|
|
83
|
+
export declare type ReporterEventBatch = typeof ReporterEventBatch.Type;
|
|
84
|
+
|
|
85
|
+
export { ReporterEventUnion }
|
|
86
|
+
|
|
87
|
+
export { ReporterFailed }
|
|
88
|
+
|
|
89
|
+
export declare const ReporterInitOptions: S.Struct<{
|
|
90
|
+
readonly traceparent: S.optionalKey<S.String>;
|
|
91
|
+
readonly tracestate: S.optionalKey<S.String>;
|
|
92
|
+
}>;
|
|
93
|
+
|
|
94
|
+
export declare type ReporterInitOptions = typeof ReporterInitOptions.Type;
|
|
95
|
+
|
|
96
|
+
export declare const ReporterRpcs: RpcGroup.RpcGroup<TracedRpc<'init', typeof ReporterInitOptions, typeof ReporterAck, typeof ReporterFailed> | TracedRpc<'onEventBatch', typeof ReporterEventBatch, typeof ReporterAck, typeof ReporterFailed> | TracedRpc<'flush', Schema.Void, typeof ReporterDrained, typeof ReporterFailed>>;
|
|
97
|
+
|
|
98
|
+
export { TestRunnerCapabilitiesSchema }
|
|
99
|
+
|
|
100
|
+
export declare const TestRunnerDryRunRequest: S.Struct<{
|
|
101
|
+
readonly options: S.Struct<{
|
|
102
|
+
readonly timeout: S.Finite;
|
|
103
|
+
readonly disableBail: S.Boolean;
|
|
104
|
+
readonly coverageAnalysis: S.Literals<readonly ["off", "all", "perTest"]>;
|
|
105
|
+
readonly files: S.optionalKey<S.$Array<S.String>>;
|
|
106
|
+
readonly testFiles: S.optionalKey<S.$Array<S.String>>;
|
|
107
|
+
}>;
|
|
108
|
+
}>;
|
|
109
|
+
|
|
110
|
+
export declare type TestRunnerDryRunRequest = typeof TestRunnerDryRunRequest.Type;
|
|
111
|
+
|
|
112
|
+
export { TestRunnerFailed }
|
|
113
|
+
|
|
114
|
+
export declare const TestRunnerMutantRunRequest: S.Struct<{
|
|
115
|
+
readonly options: S.Struct<{
|
|
116
|
+
readonly timeout: S.Finite;
|
|
117
|
+
readonly disableBail: S.Boolean;
|
|
118
|
+
readonly activeMutant: typeof Mutant;
|
|
119
|
+
readonly sandboxFileName: S.String;
|
|
120
|
+
readonly mutantActivation: S.Literals<readonly ["runtime", "static"]>;
|
|
121
|
+
readonly reloadEnvironment: S.Boolean;
|
|
122
|
+
readonly testFilter: S.optionalKey<S.$Array<S.String>>;
|
|
123
|
+
readonly hitLimit: S.optionalKey<S.Finite>;
|
|
124
|
+
}>;
|
|
125
|
+
}>;
|
|
126
|
+
|
|
127
|
+
export declare type TestRunnerMutantRunRequest = typeof TestRunnerMutantRunRequest.Type;
|
|
128
|
+
|
|
129
|
+
export declare const TestRunnerRpcs: RpcGroup.RpcGroup<TracedRpc<'capabilities', Schema.Void, typeof TestRunnerCapabilitiesSchema, typeof TestRunnerFailed> | TracedRpc<'dryRun', typeof TestRunnerDryRunRequest, typeof DryRunResultSchema, typeof TestRunnerFailed> | TracedRpc<'mutantRun', typeof TestRunnerMutantRunRequest, typeof MutantRunResultSchema, typeof TestRunnerFailed>>;
|
|
130
|
+
|
|
131
|
+
export declare class TraceContextMiddleware extends TraceContextMiddleware_base {}
|
|
132
|
+
|
|
133
|
+
declare const TraceContextMiddleware_base: RpcMiddleware.ServiceClass<TraceContextMiddleware, "@systemfsoftware/stryker-js-plugin-interface/TraceContextMiddleware", typeof PropagatedTrace, Schema.Never, never, never, true>;
|
|
134
|
+
|
|
135
|
+
export declare interface TraceContextParts {
|
|
136
|
+
readonly version: string;
|
|
137
|
+
readonly traceId: string;
|
|
138
|
+
readonly spanId: string;
|
|
139
|
+
readonly traceFlags: number;
|
|
140
|
+
readonly traceState?: string | undefined;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export declare const TraceContextReference: Context.Reference<Option.Option<TraceContextParts>>;
|
|
144
|
+
|
|
145
|
+
export declare type TracedRpc<Tag extends string, Payload extends Schema.Top = Schema.Void, Success extends Schema.Top = Schema.Void, Error extends Schema.Top = Schema.Never> = Rpc.Rpc<Tag, Payload, Success, Error, typeof TraceContextMiddleware, RpcMiddleware.ApplyServices<typeof TraceContextMiddleware['Identifier'], never>>;
|
|
146
|
+
|
|
147
|
+
export declare const Traceparent: S.String;
|
|
148
|
+
|
|
149
|
+
export declare type Traceparent = typeof Traceparent.Type;
|
|
150
|
+
|
|
151
|
+
export declare const TRACEPARENT_HEADER = "traceparent";
|
|
152
|
+
|
|
153
|
+
export declare const TRACESTATE_HEADER = "tracestate";
|
|
154
|
+
|
|
155
|
+
export declare const WorkerEntryUrl: S.String;
|
|
156
|
+
|
|
157
|
+
export declare type WorkerEntryUrl = typeof WorkerEntryUrl.Type;
|
|
158
|
+
|
|
159
|
+
export declare const WorkerPluginKind: S.Literals<readonly ["TestRunner", "Checker", "Reporter"]>;
|
|
160
|
+
|
|
161
|
+
export declare type WorkerPluginKind = typeof WorkerPluginKind.Type;
|
|
162
|
+
|
|
163
|
+
export declare type WorkerPluginSpawn = typeof WorkerPluginSpawnSchema.Type;
|
|
164
|
+
|
|
165
|
+
export declare const WorkerPluginSpawnSchema: S.Struct<{
|
|
166
|
+
readonly kind: S.Literals<readonly ["TestRunner", "Checker", "Reporter"]>;
|
|
167
|
+
readonly entrypoint: S.String;
|
|
168
|
+
}>;
|
|
169
|
+
|
|
170
|
+
export { }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@systemfsoftware/stryker-js-plugin-interface",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/systemfsoftware/stryker-js-effect.git",
|
|
@@ -19,9 +19,10 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"effect": "4.0.0-rc.112",
|
|
22
|
-
"@systemfsoftware/stryker-js-language": "^
|
|
22
|
+
"@systemfsoftware/stryker-js-language": "^5.0.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
+
"@effect/tsgo": "^0.45.0",
|
|
25
26
|
"@microsoft/api-extractor": "^7",
|
|
26
27
|
"@systemfsoftware/all": "^2",
|
|
27
28
|
"@systemfsoftware/arethetypeswrong-cli": "^4",
|
|
@@ -35,9 +36,8 @@
|
|
|
35
36
|
"tsdown": "^0.23.0",
|
|
36
37
|
"typescript": "^7",
|
|
37
38
|
"vitest": "^4",
|
|
38
|
-
"@
|
|
39
|
-
"@systemfsoftware/vitest-config": "^0.1.0"
|
|
40
|
-
"@systemfsoftware/tsdown-config": "^0.1.0"
|
|
39
|
+
"@systemfsoftware/tsdown-config": "^0.1.0",
|
|
40
|
+
"@systemfsoftware/vitest-config": "^0.1.0"
|
|
41
41
|
},
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public",
|