fork-ts-checker-webpack-plugin 0.2.6 → 0.2.10
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 +16 -0
- package/README.md +23 -3
- package/lib/CancellationToken.js +54 -64
- package/lib/FilesRegister.js +54 -64
- package/lib/FilesWatcher.js +58 -71
- package/lib/IncrementalChecker.js +172 -188
- package/lib/Message.js +2 -0
- package/lib/NormalizedMessage.js +162 -183
- package/lib/WorkResult.js +39 -44
- package/lib/WorkSet.js +21 -20
- package/lib/cluster.js +57 -78
- package/lib/formatter/codeframeFormatter.js +21 -37
- package/lib/formatter/defaultFormatter.js +15 -21
- package/lib/index.js +343 -414
- package/lib/service.js +34 -44
- package/package.json +17 -5
package/lib/service.js
CHANGED
|
@@ -1,52 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
checker.nextIteration();
|
|
19
|
-
|
|
20
|
-
try {
|
|
21
|
-
diagnostics = checker.getDiagnostics(cancellationToken);
|
|
22
|
-
if (checker.hasLinter()) {
|
|
23
|
-
lints = checker.getLints(cancellationToken);
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var process = require("process");
|
|
4
|
+
var ts = require("typescript");
|
|
5
|
+
var IncrementalChecker = require("./IncrementalChecker");
|
|
6
|
+
var CancellationToken = require("./CancellationToken");
|
|
7
|
+
var checker = new IncrementalChecker(process.env.TSCONFIG, process.env.TSLINT === '' ? false : process.env.TSLINT, process.env.WATCH === '' ? [] : process.env.WATCH.split('|'), parseInt(process.env.WORK_NUMBER, 10), parseInt(process.env.WORK_DIVISION, 10), process.env.CHECK_SYNTACTIC_ERRORS === 'true');
|
|
8
|
+
function run(cancellationToken) {
|
|
9
|
+
var diagnostics = [];
|
|
10
|
+
var lints = [];
|
|
11
|
+
checker.nextIteration();
|
|
12
|
+
try {
|
|
13
|
+
diagnostics = checker.getDiagnostics(cancellationToken);
|
|
14
|
+
if (checker.hasLinter()) {
|
|
15
|
+
lints = checker.getLints(cancellationToken);
|
|
16
|
+
}
|
|
24
17
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
catch (error) {
|
|
19
|
+
if (error instanceof ts.OperationCanceledException) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
throw error;
|
|
28
23
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
// channel closed...
|
|
41
|
-
process.exit();
|
|
24
|
+
if (!cancellationToken.isCancellationRequested()) {
|
|
25
|
+
try {
|
|
26
|
+
process.send({
|
|
27
|
+
diagnostics: diagnostics,
|
|
28
|
+
lints: lints
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
catch (e) {
|
|
32
|
+
// channel closed...
|
|
33
|
+
process.exit();
|
|
34
|
+
}
|
|
42
35
|
}
|
|
43
|
-
}
|
|
44
36
|
}
|
|
45
|
-
|
|
46
37
|
process.on('message', function (message) {
|
|
47
|
-
|
|
38
|
+
run(CancellationToken.createFromJSON(message));
|
|
48
39
|
});
|
|
49
|
-
|
|
50
40
|
process.on('SIGINT', function () {
|
|
51
|
-
|
|
41
|
+
process.exit();
|
|
52
42
|
});
|
package/package.json
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fork-ts-checker-webpack-plugin",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
4
4
|
"description": "Runs typescript type checker and linter on separate process.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"files": [
|
|
7
7
|
"lib"
|
|
8
8
|
],
|
|
9
9
|
"scripts": {
|
|
10
|
+
"build": "tsc --version && tsc --project \"./src\"",
|
|
10
11
|
"test:unit": "mocha -R spec ./test/unit",
|
|
11
12
|
"test:integration": "mocha -R spec ./test/integration && rimraf tmp",
|
|
12
|
-
"test": "npm run test:unit && npm run test:integration",
|
|
13
|
+
"test": "npm run build && npm run test:unit && npm run test:integration",
|
|
13
14
|
"test:watch": "mocha -R spec --watch ./test/unit",
|
|
14
|
-
"test:coverage": "rimraf coverage && istanbul cover -root lib --include-all-sources
|
|
15
|
+
"test:coverage": "rimraf coverage && istanbul cover -root lib --include-all-sources mocha -- -R spec ./test/unit ./test/integration",
|
|
15
16
|
"lint": "eslint ./lib ./test",
|
|
16
17
|
"lint:fix": "eslint ./lib ./test --fix"
|
|
17
18
|
},
|
|
@@ -40,6 +41,16 @@
|
|
|
40
41
|
"url": "https://github.com/Realytics/fork-ts-checker-webpack-plugin/issues"
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
44
|
+
"@types/babel-code-frame": "^6.20.1",
|
|
45
|
+
"@types/chalk": "^0.4.31",
|
|
46
|
+
"@types/chokidar": "^1.7.2",
|
|
47
|
+
"@types/lodash.endswith": "^4.2.3",
|
|
48
|
+
"@types/lodash.isfunction": "^3.0.3",
|
|
49
|
+
"@types/lodash.isstring": "^4.0.3",
|
|
50
|
+
"@types/lodash.startswith": "^4.2.3",
|
|
51
|
+
"@types/minimatch": "^3.0.1",
|
|
52
|
+
"@types/node": "^8.0.26",
|
|
53
|
+
"@types/webpack": "^3.0.10",
|
|
43
54
|
"chai": "^3.5.0",
|
|
44
55
|
"eslint": "^3.19.0",
|
|
45
56
|
"istanbul": "^0.4.5",
|
|
@@ -55,7 +66,7 @@
|
|
|
55
66
|
},
|
|
56
67
|
"peerDependencies": {
|
|
57
68
|
"typescript": "^2.1.0",
|
|
58
|
-
"webpack": "^2.
|
|
69
|
+
"webpack": "^2.3.0 || ^3.0.0"
|
|
59
70
|
},
|
|
60
71
|
"dependencies": {
|
|
61
72
|
"babel-code-frame": "^6.22.0",
|
|
@@ -64,6 +75,7 @@
|
|
|
64
75
|
"lodash.endswith": "^4.2.1",
|
|
65
76
|
"lodash.isfunction": "^3.0.8",
|
|
66
77
|
"lodash.isstring": "^4.0.1",
|
|
67
|
-
"lodash.startswith": "^4.2.1"
|
|
78
|
+
"lodash.startswith": "^4.2.1",
|
|
79
|
+
"minimatch": "^3.0.4"
|
|
68
80
|
}
|
|
69
81
|
}
|