@systemfsoftware/stryker-js-instrumenter 8.0.2 → 9.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 +59 -0
- package/README.md +20 -0
- package/dist/index.d.mts +1763 -235
- package/dist/index.mjs +3309 -3860
- package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
- package/package.json +12 -19
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,64 @@
|
|
|
1
1
|
# @systemfsoftware/stryker-js-instrumenter
|
|
2
2
|
|
|
3
|
+
## 9.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- Mutant ids, mutator names and file names are now branded schemas, and the string helpers are replaced by codecs.
|
|
8
|
+
|
|
9
|
+
- Build ids and names with `MutantId`, `MutatorName` and `CanonicalFileName`. Empty values are refused.
|
|
10
|
+
- Replace `errorToString` with `ErrorText.fromCause` and `causeText` with `CauseText.fromCause`. Both return an `Option`.
|
|
11
|
+
- Replace `normalizeFileName` with a `CanonicalFileName` decode, and `isMutant` with `Schema.is(Mutant)`.
|
|
12
|
+
- Read the values formerly in `INSTRUMENTER_CONSTANTS` from the `InstrumenterContext` statics.
|
|
13
|
+
|
|
14
|
+
- Each package's main entry point now groups its exports into namespaces named after a capability, such as `Plugin`, `TestRunner` and `Report`.
|
|
15
|
+
|
|
16
|
+
- Import the namespace and qualify each name, for example `Plugin.TestRunnerRpcs` after importing `Plugin` from the plugin interface.
|
|
17
|
+
- Import instrumenter schemas such as `Location` and `MutantStatus` from the instrumenter's `Mutant` namespace, and plugin-interface names from the plugin interface, instead of through another package's entry point.
|
|
18
|
+
- The engine's `/config`, `/events` and `/promises` entry points are unchanged.
|
|
19
|
+
|
|
20
|
+
- HTML templates and Svelte components are no longer instrumented by this package
|
|
21
|
+
on their own: each format now comes from its framework plugin, the Angular
|
|
22
|
+
plugin for `.html`, `.htm`, and `.vue` and the Svelte plugin for `.svelte`, both
|
|
23
|
+
published alongside this release. Install the plugin whose format your project
|
|
24
|
+
uses and add it to `plugins`. A file whose extension no loaded format claims is
|
|
25
|
+
reported in the run's skipped files instead of being instrumented, and `svelte`
|
|
26
|
+
is no longer an optional peer dependency of this package; the
|
|
27
|
+
`angular-html-parser` dependency moves to the Angular plugin.
|
|
28
|
+
|
|
29
|
+
The Angular signal ignore rule is unaffected and continues to ship in
|
|
30
|
+
`@systemfsoftware/stryker-ignorer-angular`.
|
|
31
|
+
|
|
32
|
+
- The format registry can now be extended with a framework plugin's contribution:
|
|
33
|
+
`frameworkEntryOf` adapts a `Framework` into a registry entry whose parse,
|
|
34
|
+
transform, print, and disable-type-checks hooks delegate to the plugin over its
|
|
35
|
+
embedded document, and the AST union gains the embedded-document variant those
|
|
36
|
+
entries parse to.
|
|
37
|
+
|
|
38
|
+
A registry entry you build yourself must now declare the `owner` module of its
|
|
39
|
+
format, the `ownerVersion` incremental state keys on, and a `transform` hook; an
|
|
40
|
+
entry without them no longer type-checks.
|
|
41
|
+
|
|
42
|
+
### Patch Changes
|
|
43
|
+
|
|
44
|
+
- Every mutant now reports its position as 1-based coordinates — the base the
|
|
45
|
+
mutation-testing report schema uses, where the first line of a file and the
|
|
46
|
+
first character of a line both sit at the first position.
|
|
47
|
+
|
|
48
|
+
A mutant in a plain TypeScript or JavaScript file previously reported a line one
|
|
49
|
+
below its real position, so pointing a reader at the reported coordinates
|
|
50
|
+
highlighted the wrong line.
|
|
51
|
+
|
|
52
|
+
## 8.1.0
|
|
53
|
+
|
|
54
|
+
### Minor Changes
|
|
55
|
+
|
|
56
|
+
- Three opt-in mutators plant Effect concurrency faults on top of the default set, so a mutation run can check that your concurrency tests catch races. `AtomicUpdateSplit` splits read-modify-write calls on `Ref` and `SynchronizedRef` into a separate read, a yield, and a separate write. `SynchronizationRemoval` removes semaphore permits, `Effect.uninterruptible`, and `Effect.uninterruptibleMask`. `FinalizerEscape` stops `ensuring`, `onExit`, `onError`, `onInterrupt`, `acquireRelease`, and `acquireUseRelease` cleanup from running on interruption. All three are off by default. Enable any subset by listing them under `mutator: { optInMutations: [...] }` in your configuration. A name that is not an opt-in mutator fails the run, and the error lists the known names. The replacements use Effect 4 APIs, so a repository on Effect 3.x must not opt in.
|
|
57
|
+
|
|
58
|
+
### Patch Changes
|
|
59
|
+
|
|
60
|
+
- Disable comments with the `next-line` scope now ignore the mutants on the line directly below the comment and record the given reason. Before this fix they ignored nothing.
|
|
61
|
+
|
|
3
62
|
## 8.0.2
|
|
4
63
|
|
|
5
64
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -16,6 +16,26 @@ pnpm add @systemfsoftware/stryker-js-instrumenter
|
|
|
16
16
|
|
|
17
17
|
The instrumenter is used internally by the Stryker mutation testing framework to instrument source files with mutant coverage and switching logic.
|
|
18
18
|
|
|
19
|
+
File formats resolve through a format registry: `coreFormatRegistry` carries the built-in `js`/`ts`/`tsx` entries, `frameworkEntryOf` adapts a framework's `Framework` object into an entry, and `registerEntries` folds additions into a registry (an extension already claimed stays with the earlier entry). `instrument(files, options, registry)` and `disableTypeChecks(file, registry)` accept that registry — defaulting to the core one — and `instrument` returns the files it skipped because no entry claimed their extension.
|
|
20
|
+
|
|
21
|
+
## Opt-in mutators
|
|
22
|
+
|
|
23
|
+
Three mutators that plant Effect concurrency faults are available on request and stay out of the default set. Enable any subset in your Stryker config:
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"mutator": {
|
|
28
|
+
"optInMutations": ["AtomicUpdateSplit", "SynchronizationRemoval", "FinalizerEscape"]
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
- **AtomicUpdateSplit** turns read-modify-write calls such as `Ref.update` or `SynchronizedRef.modify` into a separate read, a yield, and a separate write, so an interleaved mutation can lose an update.
|
|
34
|
+
- **SynchronizationRemoval** drops the guarding effect of `Semaphore.withPermits`/`withPermit` and `Effect.uninterruptible`, letting code that assumed exclusivity or uninterruptibility run without it.
|
|
35
|
+
- **FinalizerEscape** weakens `Effect.ensuring`, `Effect.onExit`, `Effect.onError`, and `Effect.onInterrupt` so their cleanup no longer runs on interruption.
|
|
36
|
+
|
|
37
|
+
Naming a mutator that does not exist fails the run and lists the names that do. The replacements these mutators plant use Effect 4 APIs, so a repository on Effect 3.x must not opt in.
|
|
38
|
+
|
|
19
39
|
## License
|
|
20
40
|
|
|
21
41
|
Apache-2.0. Part of [systemfsoftware](https://github.com/systemfsoftware/stryker-js-effect/tree/main/packages/stryker-js-instrumenter#readme).
|