@systemfsoftware/stryker-js-instrumenter 8.1.0 → 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 CHANGED
@@ -1,5 +1,54 @@
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
+
3
52
  ## 8.1.0
4
53
 
5
54
  ### Minor Changes
package/README.md CHANGED
@@ -16,6 +16,8 @@ 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
+
19
21
  ## Opt-in mutators
20
22
 
21
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: