@systemfsoftware/stryker-js 12.1.1 → 13.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 +65 -0
- package/dist/Run.schema-Bj7b_FMA.mjs +269 -0
- package/dist/{Run.schema-D7N2ILY3.d.mts → Run.schema-BlvpjFjJ.d.mts} +139 -61
- package/dist/{RunEnvironment.service-6aDpmGcD.d.mts → RunEnvironment.service-BJAsZsdn.d.mts} +124 -64
- package/dist/config.d.mts +3 -9
- package/dist/config.mjs +1 -1
- package/dist/{Run.schema-BaK_pxuK.mjs → dist-BscHZmXN.mjs} +1176 -1361
- package/dist/events.d.mts +2 -2
- package/dist/events.mjs +2 -2
- package/dist/{index-B8dqrKV1.d.mts → index-C09A80iv.d.mts} +698 -371
- package/dist/index.d.mts +169 -190
- package/dist/index.mjs +6 -5
- package/dist/main.mjs +30943 -27455
- package/dist/merge-config-DA_v1hGx.mjs +63 -0
- package/dist/{stryker-config.schema-DFWkz89S.d.mts → merge-config-X_AxYxMY.d.mts} +9 -2
- package/dist/promises.d.mts +3 -3
- package/dist/promises.mjs +4 -7
- package/dist/{run-stages.cell-CtFLJCm0.mjs → run-stages.cell-BN__EOCk.mjs} +3293 -3225
- package/package.json +7 -8
- package/dist/merge-config-ByZJPeQZ.mjs +0 -32
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import "./dist-BscHZmXN.mjs";
|
|
2
|
+
import * as Match from "effect/Match";
|
|
3
|
+
import * as Option from "effect/Option";
|
|
4
|
+
import * as Predicate from "effect/Predicate";
|
|
5
|
+
import { dual } from "effect/Function";
|
|
6
|
+
import * as Record from "effect/Record";
|
|
7
|
+
//#region src/config/merge-config.ts
|
|
8
|
+
/**
|
|
9
|
+
* Whether an entry takes part in a merge: a key literally named `__proto__` never does — the
|
|
10
|
+
* merged record must not gain a document-decided prototype — and an explicitly `undefined`
|
|
11
|
+
* value states that the author left the key unset, not that they want it set to nothing.
|
|
12
|
+
*/
|
|
13
|
+
const usable = (value, key) => key !== "__proto__" && value !== void 0;
|
|
14
|
+
const usableEntries = (source) => Record.filter(source, usable);
|
|
15
|
+
const isConfigRecord = (value) => Predicate.isObject(value);
|
|
16
|
+
const asConfigRecord = (value) => Option.filter(Option.fromUndefinedOr(value), isConfigRecord);
|
|
17
|
+
const mergeNested = (base, override) => Option.match(asConfigRecord(override), {
|
|
18
|
+
onNone: () => override,
|
|
19
|
+
onSome: (overrideRecord) => mergeRecords(base, overrideRecord)
|
|
20
|
+
});
|
|
21
|
+
const hasUsableMember = (key) => (merged) => merged.hasOwnProperty(key) && merged[key] !== void 0;
|
|
22
|
+
const ownValueOf = (merged, key) => Option.map(Option.liftPredicate(merged, hasUsableMember(key)), (present) => present[key]);
|
|
23
|
+
const baseRecordOf = (ownValue) => Option.filter(Option.flatMap(ownValue, Option.fromUndefinedOr), isConfigRecord);
|
|
24
|
+
const mergeKeyInto = (merged, override, key) => ({
|
|
25
|
+
...merged,
|
|
26
|
+
[key]: Option.match(baseRecordOf(ownValueOf(merged, key)), {
|
|
27
|
+
onNone: () => override,
|
|
28
|
+
onSome: (baseRecord) => mergeNested(baseRecord, override)
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
const mergeRecords = (base, overrides) => Record.reduce(usableEntries(overrides), usableEntries(base), mergeKeyInto);
|
|
32
|
+
const mergeConfig = dual(2, (defaults, overrides) => mergeRecords(defaults, overrides));
|
|
33
|
+
const isNonNullObject = (value) => typeof value === "object" && value !== null;
|
|
34
|
+
const asUnknownArray = (value) => Array.isArray(value) ? value : [];
|
|
35
|
+
const isFirstDescriptorOccurrence = (descriptors) => (descriptor, index) => typeof descriptor !== "string" || descriptors.slice(0, index).includes(descriptor) === false;
|
|
36
|
+
const mergePluginDescriptors = (parentPlugins, childPlugins) => {
|
|
37
|
+
const merged = [...parentPlugins, ...childPlugins];
|
|
38
|
+
return merged.filter(isFirstDescriptorOccurrence(merged));
|
|
39
|
+
};
|
|
40
|
+
const isConfigOptionsRecord = (value) => isNonNullObject(value) && Array.isArray(value) === false;
|
|
41
|
+
const mergeConfigRecords = (parentNested, childNested) => ({
|
|
42
|
+
...parentNested,
|
|
43
|
+
...childNested
|
|
44
|
+
});
|
|
45
|
+
const toConfigRecordOption = (value) => isConfigOptionsRecord(value) ? Option.some(value) : Option.none();
|
|
46
|
+
const inheritNested = (parentValue, childValue) => Option.match(Option.all([toConfigRecordOption(parentValue), toConfigRecordOption(childValue)]), {
|
|
47
|
+
onSome: ([parentNested, childNested]) => mergeConfigRecords(parentNested, childNested),
|
|
48
|
+
onNone: () => childValue
|
|
49
|
+
});
|
|
50
|
+
const inheritEntry = (out, key, parentValue, childValue) => Match.value(childValue).pipe(Match.when(null, () => {
|
|
51
|
+
const next = { ...out };
|
|
52
|
+
delete next[key];
|
|
53
|
+
return next;
|
|
54
|
+
}), Match.orElse(() => Match.value(key).pipe(Match.when("plugins", () => ({
|
|
55
|
+
...out,
|
|
56
|
+
[key]: mergePluginDescriptors(asUnknownArray(parentValue), asUnknownArray(childValue))
|
|
57
|
+
})), Match.orElse(() => ({
|
|
58
|
+
...out,
|
|
59
|
+
[key]: inheritNested(parentValue, childValue)
|
|
60
|
+
})))));
|
|
61
|
+
const mergeConfigs = dual(2, (parent, child) => Object.entries(child).reduce((out, entry) => inheritEntry(out, entry[0], parent[entry[0]], entry[1]), { ...parent }));
|
|
62
|
+
//#endregion
|
|
63
|
+
export { mergeConfigs as n, mergeConfig as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as mod_d_exports$2 } from "./index-
|
|
1
|
+
import { n as mod_d_exports$2 } from "./index-C09A80iv.mjs";
|
|
2
2
|
import * as S from "effect/Schema";
|
|
3
3
|
//#region src/config/stryker-config.schema.d.ts
|
|
4
4
|
type StrykerConfig = mod_d_exports$2.PartialStrykerOptions;
|
|
@@ -15,4 +15,11 @@ type ConfigEnv = typeof ConfigEnvSchema.Type;
|
|
|
15
15
|
type StrykerConfigFn = (env: ConfigEnv) => StrykerConfig | Promise<StrykerConfig>;
|
|
16
16
|
type StrykerConfigExport = StrykerConfig | Promise<StrykerConfig> | StrykerConfigFn;
|
|
17
17
|
//#endregion
|
|
18
|
-
|
|
18
|
+
//#region src/config/merge-config.d.ts
|
|
19
|
+
declare const mergeConfig: {
|
|
20
|
+
(overrides: StrykerConfig): (defaults: StrykerConfig) => StrykerConfig;
|
|
21
|
+
(defaults: StrykerConfig, overrides: StrykerConfig): StrykerConfig;
|
|
22
|
+
};
|
|
23
|
+
declare const mergeConfigs: ((child: mod_d_exports$2.PartialStrykerOptions) => (parent: mod_d_exports$2.PartialStrykerOptions) => mod_d_exports$2.PartialStrykerOptions) & ((parent: mod_d_exports$2.PartialStrykerOptions, child: mod_d_exports$2.PartialStrykerOptions) => mod_d_exports$2.PartialStrykerOptions);
|
|
24
|
+
//#endregion
|
|
25
|
+
export { ImmutablePrimitive as a, StrykerConfigExport as c, Immutable as i, StrykerConfigFn as l, mergeConfigs as n, Primitive as o, ConfigEnv as r, StrykerConfig as s, mergeConfig as t };
|
package/dist/promises.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as mod_d_exports$2 } from "./index-
|
|
2
|
-
import {
|
|
3
|
-
//#region src/
|
|
1
|
+
import { n as mod_d_exports$2 } from "./index-C09A80iv.mjs";
|
|
2
|
+
import { l as MutationTestDone } from "./RunEnvironment.service-BJAsZsdn.mjs";
|
|
3
|
+
//#region src/drivers/promise.d.ts
|
|
4
4
|
export declare const run: ((targetMutatePatterns?: readonly string[]) => (options: mod_d_exports$2.PartialStrykerOptions) => Promise<MutationTestDone>) & ((options: mod_d_exports$2.PartialStrykerOptions, targetMutatePatterns?: readonly string[]) => Promise<MutationTestDone>);
|
|
5
5
|
//#endregion
|
package/dist/promises.mjs
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h as nodePlatformLayer, n as strykerCell } from "./run-stages.cell-BN__EOCk.mjs";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
2
3
|
import { dual } from "effect/Function";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const run = dual((args) => args.length === 2 || Array.isArray(args[0]) === false, (options, targetMutatePatterns) => {
|
|
6
|
-
const runtime = ManagedRuntime.make(nodePlatformLayer);
|
|
7
|
-
return runtime.runPromise(strykerCell(options, targetMutatePatterns)).then((done) => runtime.dispose().then(() => done), (cause) => runtime.dispose().then(() => Promise.reject(cause)));
|
|
8
|
-
});
|
|
4
|
+
//#region src/drivers/promise.ts
|
|
5
|
+
const run = dual((args) => args.length === 2 || Array.isArray(args[0]) === false, (options, targetMutatePatterns) => Effect.runPromise(strykerCell(options, targetMutatePatterns).pipe(Effect.provide(nodePlatformLayer))));
|
|
9
6
|
//#endregion
|
|
10
7
|
export { run };
|