@systemfsoftware/stryker-js-typescript-checker 1.4.1 → 2.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,46 @@
1
1
  # @systemfsoftware/stryker-js-typescript-checker
2
2
 
3
+ ## 2.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - The TypeScript compiler's methods return Effects instead of Promises, and the
8
+ compiler is acquired for the length of the check. An interrupted check now
9
+ releases the compiler instead of leaving it alive with the run's state still in
10
+ it.
11
+
12
+ Compiler failures are now a single tagged `CompilerFailed` error carrying a
13
+ `reason` — the compiler used before initialization, no projects found for the
14
+ tsconfig, an unknown file in the graph, or a project file missing from disk.
15
+ They were untagged `Error`s before, so anything catching them saw one
16
+ indistinguishable type.
17
+
18
+ Diagnostics and `tsconfig` resolution are unchanged.
19
+
20
+ ### Patch Changes
21
+
22
+ - The shared helpers package is gone. Nothing installs it any more, and the
23
+ handful of helpers worth sharing now live in the plugin contract next to the
24
+ types they serve:
25
+
26
+ - `strykerReportBugUrl`, `normalizeFileName`, `propertyPath`, `errorToString`
27
+ and `isErrnoException` from `@systemfsoftware/stryker-js-plugin-api/core`
28
+ - `noopLogger` from `@systemfsoftware/stryker-js-plugin-api/logging`
29
+ - `testFilesProvided` from `@systemfsoftware/stryker-js-plugin-api/test-runner`
30
+
31
+ If you imported any of those, change the specifier. Everything else it exported
32
+ had no consumer and is removed: use `Predicate.isNotNullish` from Effect in place
33
+ of `notEmpty`, and `RegExp.escape` in place of `escapeRegExp`.
34
+
35
+ - These packages no longer install dependencies they never imported, so installing them pulls less into your tree.
36
+
37
+ `tslib` is gone from all six. The mutation runner additionally stops installing `lodash.groupby`, `semver` and `source-map`, and the command line interface stops installing `@effect/platform-node-shared`. Nothing exported changes.
38
+
39
+ - Published packages no longer carry build artifacts left over from earlier builds. One package was shipping about a megabyte of bundled test-runner internals this way.
40
+
41
+ - Updated dependencies:
42
+ - @systemfsoftware/stryker-js-plugin-api@3.0.0
43
+
3
44
  ## 1.4.1
4
45
 
5
46
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,122 +1,6 @@
1
1
  import { PluginKind } from "@systemfsoftware/stryker-js-plugin-api/plugin";
2
- import { CheckResult, Checker } from "@systemfsoftware/stryker-js-plugin-api/check";
3
- import { Diagnostic } from "typescript/unstable/sync";
4
- import { Mutant, StrykerOptions } from "@systemfsoftware/stryker-js-plugin-api/core";
5
- import { Logger } from "@systemfsoftware/stryker-js-plugin-api/logging";
6
- import { FileSystem, FileSystemEntries } from "typescript/unstable/fs";
7
- //#region src/grouping/ts-file-node.d.ts
8
- declare class TSFileNode {
9
- fileName: string;
10
- parents: TSFileNode[];
11
- children: TSFileNode[];
12
- constructor(fileName: string, parents: TSFileNode[], children: TSFileNode[]);
13
- getAllParentReferencesIncludingSelf(allParentReferences?: Set<TSFileNode>): Set<TSFileNode>;
14
- getAllChildReferencesIncludingSelf(allChildReferences?: Set<TSFileNode>): Set<TSFileNode>;
15
- getMutantsWithReferenceToChildrenOrSelf(mutants: Mutant[], nodesChecked?: string[]): Mutant[];
16
- }
17
- //#endregion
18
- //#region src/project/script-file.d.ts
19
- declare class ScriptFile {
20
- content: string;
21
- fileName: string;
22
- modifiedTime: Date;
23
- private readonly originalContent;
24
- constructor(content: string, fileName: string, modifiedTime?: Date);
25
- write(content: string): void;
26
- mutate(mutant: Pick<Mutant, 'location' | 'replacement'>): void;
27
- private getOffset;
28
- resetMutant(): void;
29
- private touch;
30
- }
31
- //#endregion
32
- //#region src/project/hybrid-file-system.d.ts
33
- /**
34
- * A very simple hybrid file system.
35
- * * Readonly from disk
36
- * * Writes in-memory
37
- * * Hard caching
38
- * * Ability to mutate one file
39
- */
40
- declare class HybridFileSystem implements FileSystem {
41
- private readonly files;
42
- /**
43
- * Map of absolute tsconfig file paths to their adjusted JSON content.
44
- * This allows the TS7 API to read overridden compiler options.
45
- */
46
- tsConfigOverrides: Map<string, string>;
47
- readFile: (fileName: string) => string | null | undefined;
48
- fileExists: (fileName: string) => boolean | undefined;
49
- directoryExists: () => boolean | undefined;
50
- getAccessibleEntries: () => FileSystemEntries | undefined;
51
- realpath: () => string | undefined;
52
- writeFile(fileName: string, data: string): void;
53
- getFile(fileName: string): ScriptFile | undefined;
54
- mutateFile(fileName: string, mutant: Parameters<ScriptFile['mutate']>[0]): void;
55
- resetFile(fileName: string): void;
56
- existsInMemory(fileName: string): boolean;
57
- private fileNameIsBuildInfo;
58
- }
59
- //#endregion
60
- //#region src/typescript-compiler.d.ts
61
- interface ITypescriptCompiler {
62
- init(): Promise<Diagnostic[]>;
63
- check(mutants: Mutant[]): Promise<Diagnostic[]>;
64
- }
65
- interface IFileRelationCreator {
66
- get nodes(): Map<string, TSFileNode>;
67
- }
68
- declare class TypescriptCompiler implements ITypescriptCompiler, IFileRelationCreator {
69
- private readonly log;
70
- private readonly options;
71
- private readonly fs;
72
- static inject: ["logger", "options", "fs"];
73
- private readonly allTSConfigFiles;
74
- private readonly tsconfigFile;
75
- private api?;
76
- private snapshot?;
77
- private readonly sourceFiles;
78
- private readonly _nodes;
79
- private lastMutants;
80
- private lastMutatedFileNames;
81
- constructor(log: Logger, options: StrykerOptions, fs: HybridFileSystem);
82
- init(): Promise<Diagnostic[]>;
83
- check(mutants: Mutant[]): Promise<Diagnostic[]>;
84
- get nodes(): Map<string, TSFileNode>;
85
- close(): void;
86
- getLineAndCharacterOfPosition(fileName: string, position: number): {
87
- line: number;
88
- character: number;
89
- } | undefined;
90
- private getPrograms;
91
- private collectAllTSConfigFiles;
92
- private buildDependencyGraph;
93
- private extractImports;
94
- private resolveModuleSpecifier;
95
- private getResolutionCandidates;
96
- private resolveTSInputFile;
97
- private guardTSConfigFileExists;
98
- }
99
- //#endregion
100
- //#region src/typescript-checker.d.ts
101
- declare class TypescriptChecker implements Checker {
102
- private readonly logger;
103
- private readonly tsCompiler;
104
- static inject: ["logger", "options", "tsCompiler"];
105
- private readonly options;
106
- constructor(logger: Logger, options: StrykerOptions, tsCompiler: TypescriptCompiler);
107
- init(): Promise<void>;
108
- check(mutants: Mutant[]): Promise<Record<string, CheckResult>>;
109
- group(mutants: Mutant[]): Promise<string[][]>;
110
- private checkErrors;
111
- private createErrorText;
112
- private formatDiagnostic;
113
- }
114
- //#endregion
115
2
  //#region src/index.d.ts
116
- declare const strykerPlugins: import("@systemfsoftware/stryker-js-plugin-api/plugin").FactoryPlugin<PluginKind.Checker, ["$injector"]>[];
117
- declare const createTypescriptChecker: ((injector: import("@systemfsoftware/stryker-js-plugin-api/plugin").Injector<import("@systemfsoftware/stryker-js-plugin-api/plugin").PluginContext>) => TypescriptChecker) & {
118
- inject: ["$injector"];
119
- };
3
+ declare const strykerPlugins: import("@systemfsoftware/stryker-js-plugin-api/plugin").PluginContribution<PluginKind.Checker>[];
120
4
  declare const strykerValidationSchema: Record<string, unknown>;
121
5
  //#endregion
122
- export { createTypescriptChecker, strykerPlugins, strykerValidationSchema };
6
+ export { strykerPlugins, strykerValidationSchema };