Skip to content

Commit 4f32390

Browse files
committed
chore: min node version, dep updates and ts-loader in test matrix
1 parent baedfce commit 4f32390

11 files changed

+325
-232
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ install:
77
- yarn add $WEBPACK $TSLOADER $VUELOADER -D
88
- yarn lint
99
env:
10+
- WEBPACK=webpack@^4.0.0 TSLOADER=ts-loader@^5.0.0 VUELOADER=vue-loader@^15.2.4
1011
- WEBPACK=webpack@^4.0.0 TSLOADER=ts-loader@^4.3.0 VUELOADER=vue-loader@^15.2.4
1112
- WEBPACK=webpack@^3.10.0 TSLOADER=ts-loader@^3.4.0 VUELOADER=vue-loader@^13.5.0
1213
- WEBPACK=webpack@^2.7.0 TSLOADER=ts-loader@^3.4.0 VUELOADER=vue-loader@^13.5.0

CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
## v0.5.0
2+
* Removed unused dependency `resolve`.
3+
* Replace `lodash` usage with native calls.
4+
* Test against ts-loader v5
5+
* **Breaking changes**:
6+
* Dropped support for node v6, minimum is now v8.9
7+
* **Internal**:
8+
* Enable all strict type checks
9+
* Update dev dependencies
10+
11+
112
## v0.4.15
213

314
* [Add `tslintAutoFix` option to be passed on to tslint to auto format typescript files](https://github.com/Realytics/fork-ts-checker-webpack-plugin/pull/174) (#174)

package.json

+13-13
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
"version": "0.4.15",
44
"description": "Runs typescript type checker and linter on separate process.",
55
"main": "lib/index.js",
6-
"types": "lib/types/index.d.ts",
6+
"types": "lib/index.d.ts",
77
"files": [
88
"lib"
99
],
1010
"scripts": {
1111
"build": "tsc --version && tsc --project \"./src\"",
1212
"test:unit": "mocha -R spec ./test/unit --exit",
13-
"test:integration": "mocha -R spec ./test/integration --exit",
13+
"test:integration": "mocha -R spec ./test/integration --exit && rimraf tmp",
1414
"test": "npm run build && npm run test:unit && npm run test:integration",
1515
"test:watch": "mocha -R spec --watch ./test/unit",
1616
"test:coverage": "rimraf coverage && istanbul cover -root lib --include-all-sources mocha -- -R spec ./test/unit ./test/integration",
@@ -37,7 +37,7 @@
3737
"webpack-plugin"
3838
],
3939
"engines": {
40-
"node": ">=6.11.5"
40+
"node": ">=8.9.0"
4141
},
4242
"author": "Piotr Oleś <[email protected]>",
4343
"contributors": [
@@ -53,23 +53,23 @@
5353
"@types/chokidar": "^1.7.5",
5454
"@types/micromatch": "^3.1.0",
5555
"@types/minimatch": "^3.0.1",
56-
"@types/node": "^8.0.26",
57-
"@types/webpack": "^4.4.9",
58-
"chai": "^3.5.0",
59-
"css-loader": "^0.28.7",
56+
"@types/node": "^8.10.38",
57+
"@types/webpack": "^4.4.19",
58+
"chai": "^4.2.0",
59+
"css-loader": "0.28.11",
6060
"eslint": "^5.7.0",
61-
"husky": "^1.1.2",
61+
"husky": "^1.1.4",
6262
"istanbul": "^0.4.5",
63-
"lint-staged": "^7.3.0",
63+
"lint-staged": "^8.0.5",
6464
"mocha": "^5.2.0",
6565
"mock-fs": "^4.3.0",
66-
"mock-require": "^2.0.2",
66+
"mock-require": "^3.0.2",
6767
"prettier": "^1.14.3",
6868
"rimraf": "^2.5.4",
69-
"sinon": "^2.3.1",
70-
"ts-loader": "4.3.0",
69+
"sinon": "^7.1.1",
70+
"ts-loader": "^5.3.0",
7171
"tslint": "^5.11.0",
72-
"tslint-config-prettier": "^1.15.0",
72+
"tslint-config-prettier": "^1.16.0",
7373
"typescript": "^3.0.1",
7474
"vue": "^2.5.16",
7575
"vue-class-component": "^6.1.1",

src/FilesRegister.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
import * as ts from 'typescript';
2+
import { RuleFailure } from 'tslint';
23

34
export interface DataShape {
45
source?: ts.SourceFile;
56
linted: boolean;
6-
lints: any[];
7+
lints: RuleFailure[];
78
}
89

910
export class FilesRegister {
1011
files: { [filePath: string]: { mtime?: number; data: DataShape } };
11-
dataFactory: (_data?: any) => DataShape; // It doesn't seem that the _data parameter is ever used?
12+
dataFactory: (_data?: DataShape) => DataShape; // It doesn't seem that the _data parameter is ever used?
1213

13-
constructor(dataFactory: (_data?: any) => DataShape) {
14+
constructor(dataFactory: (_data?: DataShape) => DataShape) {
1415
this.files = {};
1516
this.dataFactory = dataFactory;
1617
}

src/WorkResult.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
import { Message } from './Message';
22

33
export class WorkResult {
4-
workResult: {};
5-
workDomain: any[];
4+
workResult: {
5+
[key: string]: Message;
6+
} = {};
7+
workDomain: number[];
68

7-
constructor(workDomain: any[]) {
8-
this.workResult = {};
9+
constructor(workDomain: number[]) {
910
this.workDomain = workDomain;
1011
}
1112

1213
supports(workName: number) {
1314
return -1 !== this.workDomain.indexOf(workName);
1415
}
1516

16-
set(workName: number, result: any) {
17+
set(workName: number, result: Message) {
1718
if (!this.supports(workName)) {
1819
throw new Error(
1920
'Cannot set result - work "' + workName + '" is not supported.'

src/tsconfig.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
{
22
"compilerOptions": {
3-
"target": "es6",
3+
"target": "es2017",
44
"noImplicitReturns": true,
55
"noUnusedLocals": true,
66
"noUnusedParameters": true,
77
"suppressImplicitAnyIndexErrors": true,
88
"strict": true,
9-
"lib": ["es6", "dom"],
9+
"lib": ["es2017", "dom"],
1010
"module": "commonjs",
1111
"moduleResolution": "node",
1212
"declaration": true,
13-
"outDir": "../lib",
14-
"declarationDir": "../lib/types"
13+
"outDir": "../lib"
1514
}
1615
}

test/integration/index.spec.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ describe('[INTEGRATION] index', function() {
7575
it('should allow to pass no options', function() {
7676
expect(function() {
7777
new ForkTsCheckerWebpackPlugin();
78-
}).to.not.throw.error;
78+
}).to.not.throw();
7979
});
8080

8181
it('should detect paths', function() {
@@ -299,15 +299,15 @@ describe('[INTEGRATION] index', function() {
299299
createCompiler({
300300
tsconfig: '/some/path/that/not/exists/tsconfig.json'
301301
});
302-
}).to.throw.error;
302+
}).to.throw();
303303
});
304304

305305
it('should throw error if config container wrong tslint.json path', function() {
306306
expect(function() {
307307
createCompiler({
308308
tslint: '/some/path/that/not/exists/tslint.json'
309309
});
310-
}).to.throw.error;
310+
}).to.throw();
311311
});
312312

313313
it('should find the same errors on multi-process mode', function(callback) {
@@ -345,7 +345,7 @@ describe('[INTEGRATION] index', function() {
345345
it('should detect tslint path for true option', function() {
346346
expect(function() {
347347
createCompiler({ tslint: true });
348-
}).to.not.throw.error;
348+
}).to.not.throw();
349349
});
350350

351351
it('should allow delaying service-start', function(callback) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
function someFunctionName(param1,param2){return param1+param2};

test/unit/CancellationToken.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ describe('[UNIT] CancellationToken', function() {
7272
var tokenB = new CancellationToken('rgeer#R23r$#T$3t#$t43', true);
7373
expect(function() {
7474
tokenB.throwIfCancellationRequested();
75-
}).to.throw(ts.OperationCanceledException);
75+
}).to.throw().instanceOf(ts.OperationCanceledException);
7676
});
7777

7878
it('should write file in filesystem on requestCancellation', function() {

test/unit/NormalizedMessage.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe('[UNIT] NormalizedMessage', function() {
4444
it('should serialize and create from json', function() {
4545
var json = diagnosticMessage.toJSON();
4646

47-
expect(json).to.be.object;
47+
expect(json).to.be.an('object');
4848

4949
var jsonMessage = NormalizedMessage.createFromJSON(json);
5050

0 commit comments

Comments
 (0)