@systemfsoftware/stryker-js-typescript-checker 3.0.2 → 3.0.3
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 +9 -0
- package/dist/index.mjs +28 -17
- package/package.json +7 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @systemfsoftware/stryker-js-typescript-checker
|
|
2
2
|
|
|
3
|
+
## 3.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Refreshed builds on the platform-services dependency graph; the packages no longer reach for host builtins directly. No CLI flags or option names change.
|
|
8
|
+
|
|
9
|
+
- Updated dependencies:
|
|
10
|
+
- @systemfsoftware/stryker-js@0.2.0
|
|
11
|
+
|
|
3
12
|
## 3.0.2
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { readFileSync } from "fs";
|
|
2
1
|
import { Checker, CheckerFailed } from "@systemfsoftware/stryker-js/Checker";
|
|
3
2
|
import { RunConfiguration, declarePlugin } from "@systemfsoftware/stryker-js/Plugin";
|
|
4
3
|
import * as Effect from "effect/Effect";
|
|
@@ -6,7 +5,6 @@ import * as FileSystem from "effect/FileSystem";
|
|
|
6
5
|
import * as Layer from "effect/Layer";
|
|
7
6
|
import * as Path from "effect/Path";
|
|
8
7
|
import * as S from "effect/Schema";
|
|
9
|
-
import { EOL } from "os";
|
|
10
8
|
import { Cell, Wire, Workflow } from "@systemfsoftware/effect-cell-types";
|
|
11
9
|
import { Mutant, errorToString } from "@systemfsoftware/stryker-js/Mutant";
|
|
12
10
|
import { Predicate, Result, Schema } from "effect";
|
|
@@ -16,12 +14,31 @@ import * as MutableHashMap from "effect/MutableHashMap";
|
|
|
16
14
|
import * as Option from "effect/Option";
|
|
17
15
|
import { API, DiagnosticCategory } from "typescript/unstable/sync";
|
|
18
16
|
import * as Result$1 from "effect/Result";
|
|
19
|
-
import { createRequire } from "module";
|
|
20
17
|
import { StrykerOptionsSchema } from "@systemfsoftware/stryker-js/Schema";
|
|
21
18
|
import * as Context from "effect/Context";
|
|
22
19
|
import * as MutableHashSet from "effect/MutableHashSet";
|
|
23
20
|
import * as Ref from "effect/Ref";
|
|
24
21
|
import { SyntaxKind } from "typescript/unstable/ast";
|
|
22
|
+
//#region schema/typescript-checker-options.json
|
|
23
|
+
var typescript_checker_options_default = {
|
|
24
|
+
$schema: "http://json-schema.org/draft-07/schema",
|
|
25
|
+
title: "TypescriptCheckerPluginOptions",
|
|
26
|
+
type: "object",
|
|
27
|
+
additionalProperties: false,
|
|
28
|
+
properties: { "typescriptChecker": {
|
|
29
|
+
"description": "Configuration for @systemfsoftware/stryker-js-typescript-checker",
|
|
30
|
+
"title": "TypescriptCheckerOptions",
|
|
31
|
+
"additionalProperties": false,
|
|
32
|
+
"type": "object",
|
|
33
|
+
"default": {},
|
|
34
|
+
"properties": { "prioritizePerformanceOverAccuracy": {
|
|
35
|
+
"description": "Configures the performance of the TypescriptChecker. Setting this to false results in a slower, but more accurate result.",
|
|
36
|
+
"type": "boolean",
|
|
37
|
+
"default": true
|
|
38
|
+
} }
|
|
39
|
+
} }
|
|
40
|
+
};
|
|
41
|
+
//#endregion
|
|
25
42
|
//#region src/Checker.schema.ts
|
|
26
43
|
/**
|
|
27
44
|
* Checker — declarations for the TypeScript checker.
|
|
@@ -527,22 +544,16 @@ function retrieveReferencedProjects(config, fromDirName, pathService) {
|
|
|
527
544
|
}
|
|
528
545
|
//#endregion
|
|
529
546
|
//#region src/Compiler.ts
|
|
530
|
-
/**
|
|
531
|
-
* Compiler — capability that hosts the TypeScript language service, the
|
|
532
|
-
* in-memory file system, and the file-graph used for grouping.
|
|
533
|
-
*
|
|
534
|
-
* All `typescript/unstable/*` interaction is confined here; callers consume
|
|
535
|
-
* only the Effect-typed service surface.
|
|
536
|
-
*/
|
|
537
547
|
const normalizeFileName$1 = (fileName) => fileName.replace(/\\/g, "/");
|
|
538
548
|
const findSourceMapRegex = /\/\/# sourceMappingURL=(.+)$/m;
|
|
539
549
|
function getSourceMappingURL(content) {
|
|
540
550
|
return findSourceMapRegex.exec(content)?.[1];
|
|
541
551
|
}
|
|
542
552
|
let cachedTSVersion;
|
|
543
|
-
const getTSVersion = (fsService) => Effect.gen(function* () {
|
|
553
|
+
const getTSVersion = (fsService, pathService) => Effect.gen(function* () {
|
|
544
554
|
if (cachedTSVersion !== void 0) return cachedTSVersion;
|
|
545
|
-
const
|
|
555
|
+
const urlString = import.meta.resolve("typescript/package.json");
|
|
556
|
+
const pkgPath = yield* pathService.fromFileUrl(new URL(urlString));
|
|
546
557
|
const text = yield* fsService.readFileString(pkgPath);
|
|
547
558
|
const raw = JSON.parse(text);
|
|
548
559
|
let version = "";
|
|
@@ -565,8 +576,8 @@ function isSupportedTypescriptVersion(version) {
|
|
|
565
576
|
if (minor !== 0) return minor > 0;
|
|
566
577
|
return patch >= 0;
|
|
567
578
|
}
|
|
568
|
-
const guardTSVersion = (fsService) => Effect.gen(function* () {
|
|
569
|
-
const version = yield* getTSVersion(fsService);
|
|
579
|
+
const guardTSVersion = (fsService, pathService) => Effect.gen(function* () {
|
|
580
|
+
const version = yield* getTSVersion(fsService, pathService);
|
|
570
581
|
if (!isSupportedTypescriptVersion(version)) return yield* new UnsupportedTypeScriptVersionError({ version });
|
|
571
582
|
});
|
|
572
583
|
function makeScriptFile(content, fileName, modifiedTime = /* @__PURE__ */ new Date()) {
|
|
@@ -1042,7 +1053,7 @@ function makeTypescriptCompiler(options, fs, fsService, pathService) {
|
|
|
1042
1053
|
]).filter((diagnostic) => diagnostic.category === DiagnosticCategory.Error);
|
|
1043
1054
|
});
|
|
1044
1055
|
const init = Effect.gen(function* () {
|
|
1045
|
-
yield* guardTSVersion(fsService);
|
|
1056
|
+
yield* guardTSVersion(fsService, pathService);
|
|
1046
1057
|
const absoluteTsconfigFile = normalizeFileName$1(pathService.resolve(rawTsconfigFile));
|
|
1047
1058
|
yield* Ref.update(stateRef, (prev) => ({
|
|
1048
1059
|
...prev,
|
|
@@ -1174,7 +1185,7 @@ function makeCheckerService({ options, compiler }) {
|
|
|
1174
1185
|
return `${location}${severity} TS${error.code}: ${error.text}`;
|
|
1175
1186
|
});
|
|
1176
1187
|
const createErrorText = (errors) => Effect.gen(function* () {
|
|
1177
|
-
return (yield* Effect.forEach(errors, formatDiagnostic)).join(
|
|
1188
|
+
return (yield* Effect.forEach(errors, formatDiagnostic)).join("\n");
|
|
1178
1189
|
});
|
|
1179
1190
|
return {
|
|
1180
1191
|
init: Effect.gen(function* () {
|
|
@@ -1240,7 +1251,7 @@ const strykerPlugins = [declarePlugin("Checker", "typescript", Layer.effect(Chec
|
|
|
1240
1251
|
compiler: makeTypescriptCompiler(options, yield* makeHybridFileSystem(fsService), fsService, pathService)
|
|
1241
1252
|
});
|
|
1242
1253
|
})))];
|
|
1243
|
-
const rawSchema =
|
|
1254
|
+
const rawSchema = typescript_checker_options_default;
|
|
1244
1255
|
if (!S.is(S.Record(S.String, S.Unknown))(rawSchema)) throw new Error("Invalid typescript-checker schema file");
|
|
1245
1256
|
const strykerValidationSchema = rawSchema;
|
|
1246
1257
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@systemfsoftware/stryker-js-typescript-checker",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/systemfsoftware/systemfsoftware.git",
|
|
@@ -23,9 +23,10 @@
|
|
|
23
23
|
"effect": "^4.0.0-rc.112",
|
|
24
24
|
"typescript": "^7",
|
|
25
25
|
"@systemfsoftware/effect-cell-types": "^5.0.2",
|
|
26
|
-
"@systemfsoftware/stryker-js": "^0.
|
|
26
|
+
"@systemfsoftware/stryker-js": "^0.2.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
+
"@effect/platform-node": "^4.0.0-rc.112",
|
|
29
30
|
"@effect/platform-node-shared": "^4.0.0-rc.112",
|
|
30
31
|
"@std/jsonc": "npm:@jsr/std__jsonc@^1.0.2",
|
|
31
32
|
"@systemfsoftware/arethetypeswrong-cli": "^1.1.1",
|
|
@@ -34,13 +35,14 @@
|
|
|
34
35
|
"rimraf": "^6.1.3",
|
|
35
36
|
"tsdown": "^0.22.14",
|
|
36
37
|
"vitest": "^4",
|
|
37
|
-
"@systemfsoftware/all": "^1.0.2",
|
|
38
38
|
"@systemfsoftware/effect-gherkin-spec": "^4.0.0",
|
|
39
39
|
"@systemfsoftware/effect-schema-vite": "^2.0.2",
|
|
40
40
|
"@systemfsoftware/effect-schema-law": "^2.0.1",
|
|
41
|
+
"@systemfsoftware/all": "^1.1.0",
|
|
42
|
+
"@systemfsoftware/oxlint-config": "^0.1.0",
|
|
43
|
+
"@systemfsoftware/stryker-js-platform-node": "^0.2.0",
|
|
41
44
|
"@systemfsoftware/tsconfig": "^1.3.3",
|
|
42
|
-
"@systemfsoftware/vitest-config": "^0.1.0"
|
|
43
|
-
"@systemfsoftware/oxlint-config": "^0.1.0"
|
|
45
|
+
"@systemfsoftware/vitest-config": "^0.1.0"
|
|
44
46
|
},
|
|
45
47
|
"inlinedDependencies": {
|
|
46
48
|
"@jsr/std__jsonc": "1.0.2"
|