Skip to content

Commit c9ce397

Browse files
authored
Chore/upgrade deps (#843)
* update deps * make comparison test pack a little more resilient * upgrade webpack version and comparison test output * tweak to test pack to cater for 'Module build failed (from ' in stats * remove start of line from regex * Move 'Module build failed' to normalize string * exclude 'Module Warning (from'
1 parent 158e331 commit c9ce397

File tree

44 files changed

+1093
-3285
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1093
-3285
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@
6767
"glob": "^7.1.1",
6868
"html-webpack-plugin": "^3.2.0",
6969
"husky": "^0.14.3",
70-
"jasmine-core": "^2.5.2",
71-
"karma": "^2.0.0",
70+
"jasmine-core": "^3.0.0",
71+
"karma": "^3.0.0",
7272
"karma-chrome-launcher": "^2.2.0",
7373
"karma-jasmine": "^1.0.0",
7474
"karma-mocha-reporter": "^2.0.0",
@@ -83,7 +83,7 @@
8383
"tslint-config-prettier": "^1.15.0",
8484
"typescript": "^3.0.1",
8585
"webpack": "^4.5.0",
86-
"webpack-cli": "^2.1.2"
86+
"webpack-cli": "^3.1.1"
8787
},
8888
"peerDependencies": {
8989
"typescript": "*"

test/comparison-tests/codeSplitting/expectedOutput-3.0/bundle.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
/******/ var chunkIds = data[0];
55
/******/ var moreModules = data[1];
66
/******/
7+
/******/
78
/******/ // add "moreModules" to the modules object,
89
/******/ // then flag all "chunkIds" as loaded and fire callback
910
/******/ var moduleId, chunkId, i = 0, resolves = [];
@@ -20,6 +21,7 @@
2021
/******/ }
2122
/******/ }
2223
/******/ if(parentJsonpFunction) parentJsonpFunction(data);
24+
/******/
2325
/******/ while(resolves.length) {
2426
/******/ resolves.shift()();
2527
/******/ }
@@ -96,11 +98,11 @@
9698
/******/
9799
/******/ script.charset = 'utf-8';
98100
/******/ script.timeout = 120;
99-
/******/
100101
/******/ if (__webpack_require__.nc) {
101102
/******/ script.setAttribute("nonce", __webpack_require__.nc);
102103
/******/ }
103104
/******/ script.src = jsonpScriptSrc(chunkId);
105+
/******/
104106
/******/ onScriptComplete = function (event) {
105107
/******/ // avoid mem leaks in IE.
106108
/******/ script.onerror = script.onload = null;

test/comparison-tests/codeSplitting/expectedOutput-3.0/output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Asset Size Chunks Chunk Names
2-
bundle.js 9.39 KiB main [emitted] main
2+
bundle.js 9.41 KiB main [emitted] main
33
0.bundle.js 592 bytes 0 [emitted]
44
Entrypoint main = bundle.js
55
[./a.ts] 36 bytes {main} [built]

test/comparison-tests/colors/expectedOutput-3.0/bundle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
/*! no static exports found */
9494
/***/ (function(module, exports) {
9595

96-
eval("throw new Error(\"Module parse failed: Unexpected token (2:1)/nYou may need an appropriate loader to handle this file type./n| var a;/n| == 0;/n| \");\n\n//# sourceURL=webpack:///./app.ts?");
96+
eval("throw new Error(\"Module parse failed: Unexpected token (2:1)/nYou may need an appropriate loader to handle this file type./n| var a;/n> == 0;/n| \");\n\n//# sourceURL=webpack:///./app.ts?");
9797

9898
/***/ })
9999

test/comparison-tests/colors/expectedOutput-3.0/output.transpiled.txt

Lines changed: 0 additions & 17 deletions
This file was deleted.

test/comparison-tests/colors/expectedOutput-3.0/output.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ bundle.js 3.89 KiB main [emitted] main
33
Entrypoint main = bundle.js
44
[./app.ts] 149 bytes {main} [built] [failed] [2 errors]
55

6-
ERROR in ./app.ts
6+
ERROR in ./app.ts 2:1
77
Module parse failed: Unexpected token (2:1)
88
You may need an appropriate loader to handle this file type.
99
| var a;
10-
| == 0;
10+
> == 0;
1111
|
1212

1313
ERROR in app.ts

test/comparison-tests/create-and-execute-test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,9 @@ function getNormalisedFileContent(file, location) {
392392
// Built at: 2/15/2018 8:33:18 PM
393393
// Built at: 2018-2-11 17:50:52 (any time is fine for us)
394394
.replace(/^Built at: .+$/gm, '')
395+
// We have 'Module build failed (from /index.js' on Windows and 'Module build failed (from index.js' on Linux
396+
.replace(/Module build failed \(from \//gm, 'Module build failed (from ')
397+
.replace(/Module Warning \(from \//gm, 'Module Warning (from ')
395398
// We don't want a difference in the number of kilobytes to fail the build
396399
.replace(/[\d]+([.][\d]*)? KiB/g, 'A-NUMBER-OF KiB')
397400
// We also don't want a difference in the number of bytes to fail the build

test/comparison-tests/errors/expectedOutput-3.0/bundle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
/*! no static exports found */
9494
/***/ (function(module, exports) {
9595

96-
eval("throw new Error(\"Module parse failed: Unexpected token (2:1)/nYou may need an appropriate loader to handle this file type./n| var a;/n| == 0;/n| \");\n\n//# sourceURL=webpack:///./app.ts?");
96+
eval("throw new Error(\"Module parse failed: Unexpected token (2:1)/nYou may need an appropriate loader to handle this file type./n| var a;/n> == 0;/n| \");\n\n//# sourceURL=webpack:///./app.ts?");
9797

9898
/***/ })
9999

test/comparison-tests/errors/expectedOutput-3.0/output.transpiled.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ ERROR in app.ts
88
[tsl] ERROR in app.ts(1,7)
99
 TS1005: ',' expected.
1010

11-
ERROR in ./app.ts
11+
ERROR in ./app.ts 2:1
1212
Module parse failed: Unexpected token (2:1)
1313
You may need an appropriate loader to handle this file type.
1414
| var a;
15-
| == 0;
15+
> == 0;
1616
|

test/comparison-tests/errors/expectedOutput-3.0/output.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ bundle.js 3.89 KiB main [emitted] main
33
Entrypoint main = bundle.js
44
[./app.ts] 149 bytes {main} [built] [failed] [2 errors]
55

6-
ERROR in ./app.ts
6+
ERROR in ./app.ts 2:1
77
Module parse failed: Unexpected token (2:1)
88
You may need an appropriate loader to handle this file type.
99
| var a;
10-
| == 0;
10+
> == 0;
1111
|
1212

1313
ERROR in app.ts

test/comparison-tests/es6codeSplitting/expectedOutput-3.0/bundle.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
/******/ var chunkIds = data[0];
55
/******/ var moreModules = data[1];
66
/******/
7+
/******/
78
/******/ // add "moreModules" to the modules object,
89
/******/ // then flag all "chunkIds" as loaded and fire callback
910
/******/ var moduleId, chunkId, i = 0, resolves = [];
@@ -20,6 +21,7 @@
2021
/******/ }
2122
/******/ }
2223
/******/ if(parentJsonpFunction) parentJsonpFunction(data);
24+
/******/
2325
/******/ while(resolves.length) {
2426
/******/ resolves.shift()();
2527
/******/ }
@@ -96,11 +98,11 @@
9698
/******/
9799
/******/ script.charset = 'utf-8';
98100
/******/ script.timeout = 120;
99-
/******/
100101
/******/ if (__webpack_require__.nc) {
101102
/******/ script.setAttribute("nonce", __webpack_require__.nc);
102103
/******/ }
103104
/******/ script.src = jsonpScriptSrc(chunkId);
105+
/******/
104106
/******/ onScriptComplete = function (event) {
105107
/******/ // avoid mem leaks in IE.
106108
/******/ script.onerror = script.onload = null;

test/comparison-tests/es6codeSplitting/expectedOutput-3.0/output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Asset Size Chunks Chunk Names
2-
bundle.js 9.96 KiB main [emitted] main
2+
bundle.js 9.97 KiB main [emitted] main
33
0.bundle.js 726 bytes 0 [emitted]
44
Entrypoint main = bundle.js
55
[./a.ts] 100 bytes {main} [built]

test/comparison-tests/instance/expectedOutput-3.0/bundle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
/*! no static exports found */
9494
/***/ (function(module, exports) {
9595

96-
eval("throw new Error(\"Module build failed: Error: /u001b[31mA file specified in tsconfig.json could not be found: C://source//ts-loader//.test//instance//i-dont-exist/u001b[39m/n at Object.loader (C://source//ts-loader//dist//index.js:18:18)\");\n\n//# sourceURL=webpack:///./a.ts?");
96+
eval("throw new Error(\"Module build failed (from C:/source/ts-loader/index.js):/nError: /u001b[31mA file specified in tsconfig.json could not be found: C://source//ts-loader//.test//instance//i-dont-exist/u001b[39m/n at Object.loader (C://source//ts-loader//dist//index.js:19:18)\");\n\n//# sourceURL=webpack:///./a.ts?");
9797

9898
/***/ })
9999

test/comparison-tests/instance/expectedOutput-3.0/bundle.transpiled.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
/*! no static exports found */
9494
/***/ (function(module, exports) {
9595

96-
eval("throw new Error(\"Module build failed: Error: /u001b[31mA file specified in tsconfig.json could not be found: C://source//ts-loader//.test//instance.transpile//i-dont-exist/u001b[39m/n at Object.loader (C://source//ts-loader//dist//index.js:18:18)\");\n\n//# sourceURL=webpack:///./a.ts?");
96+
eval("throw new Error(\"Module build failed (from C:/source/ts-loader/index.js):/nError: /u001b[31mA file specified in tsconfig.json could not be found: C://source//ts-loader//.test//instance.transpile//i-dont-exist/u001b[39m/n at Object.loader (C://source//ts-loader//dist//index.js:19:18)\");\n\n//# sourceURL=webpack:///./a.ts?");
9797

9898
/***/ })
9999

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
Asset Size Chunks Chunk Names
2-
bundle.js 3.99 KiB a [emitted] a
2+
bundle.js 4.03 KiB a [emitted] a
33
Entrypoint a = bundle.js
44
Entrypoint b =
5-
[./a.ts] 252 bytes {a} [built] [failed] [1 error]
6-
[./b.ts] 252 bytes {b} [built] [failed] [1 error]
5+
[./a.ts] 289 bytes {a} [built] [failed] [1 error]
6+
[./b.ts] 289 bytes {b} [built] [failed] [1 error]
77

88
ERROR in ./a.ts
9-
Module build failed: Error: A file specified in tsconfig.json could not be found: i-dont-exist
10-
at Object.loader (dist\index.js:18:18)
9+
Module build failed (from /index.js):
10+
Error: A file specified in tsconfig.json could not be found: i-dont-exist
11+
at Object.loader (dist\index.js:19:18)
1112

1213
ERROR in ./b.ts
13-
Module build failed: Error: A file specified in tsconfig.json could not be found: i-dont-exist
14-
at Object.loader (dist\index.js:18:18)
14+
Module build failed (from /index.js):
15+
Error: A file specified in tsconfig.json could not be found: i-dont-exist
16+
at Object.loader (dist\index.js:19:18)
1517

1618
ERROR in chunk b [entry]
1719
bundle.js
18-
Conflict: Multiple assets emit to the same filename bundle.js
20+
Conflict: Multiple chunks emit assets to the same filename bundle.js (chunks a and b)
Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
Asset Size Chunks Chunk Names
2-
bundle.js 3.98 KiB a [emitted] a
2+
bundle.js 4.02 KiB a [emitted] a
33
Entrypoint a = bundle.js
44
Entrypoint b =
5-
[./a.ts] 242 bytes {a} [built] [failed] [1 error]
6-
[./b.ts] 242 bytes {b} [built] [failed] [1 error]
5+
[./a.ts] 279 bytes {a} [built] [failed] [1 error]
6+
[./b.ts] 279 bytes {b} [built] [failed] [1 error]
77

88
ERROR in ./a.ts
9-
Module build failed: Error: A file specified in tsconfig.json could not be found: i-dont-exist
10-
at Object.loader (dist\index.js:18:18)
9+
Module build failed (from /index.js):
10+
Error: A file specified in tsconfig.json could not be found: i-dont-exist
11+
at Object.loader (dist\index.js:19:18)
1112

1213
ERROR in ./b.ts
13-
Module build failed: Error: A file specified in tsconfig.json could not be found: i-dont-exist
14-
at Object.loader (dist\index.js:18:18)
14+
Module build failed (from /index.js):
15+
Error: A file specified in tsconfig.json could not be found: i-dont-exist
16+
at Object.loader (dist\index.js:19:18)
1517

1618
ERROR in chunk b [entry]
1719
bundle.js
18-
Conflict: Multiple assets emit to the same filename bundle.js
20+
Conflict: Multiple chunks emit assets to the same filename bundle.js (chunks a and b)

test/comparison-tests/nodeModulesMeaningfulErrorWhenImportingTs/expectedOutput-3.0/bundle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ eval("\nexports.__esModule = true;\nvar a = __webpack_require__(/*! a */ \"./nod
105105
/*! no static exports found */
106106
/***/ (function(module, exports) {
107107

108-
eval("throw new Error(\"Module build failed: Error: TypeScript emitted no output for C://source//ts-loader//.test//nodeModulesMeaningfulErrorWhenImportingTs//node_modules//a//index.ts. By default, ts-loader will not compile .ts files in node_modules./nYou should not need to recompile .ts files there, but if you really want to, use the allowTsInNodeModules option./nSee: https://github.com/Microsoft/TypeScript/issues/12358/n at makeSourceMapAndFinish (C://source//ts-loader//dist//index.js:71:15)/n at successLoader (C://source//ts-loader//dist//index.js:61:9)/n at Object.loader (C://source//ts-loader//dist//index.js:21:12)\");\n\n//# sourceURL=webpack:///./node_modules/a/index.ts?");
108+
eval("throw new Error(\"Module build failed (from C:/source/ts-loader/index.js):/nError: TypeScript emitted no output for C://source//ts-loader//.test//nodeModulesMeaningfulErrorWhenImportingTs//node_modules//a//index.ts. By default, ts-loader will not compile .ts files in node_modules./nYou should not need to recompile .ts files there, but if you really want to, use the allowTsInNodeModules option./nSee: https://github.com/Microsoft/TypeScript/issues/12358/n at makeSourceMapAndFinish (C://source//ts-loader//dist//index.js:78:15)/n at successLoader (C://source//ts-loader//dist//index.js:68:9)/n at Object.loader (C://source//ts-loader//dist//index.js:22:12)\");\n\n//# sourceURL=webpack:///./node_modules/a/index.ts?");
109109

110110
/***/ })
111111

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
Asset Size Chunks Chunk Names
2-
bundle.js 4.83 KiB main [emitted] main
2+
bundle.js 4.87 KiB main [emitted] main
33
Entrypoint main = bundle.js
44
[./app.ts] 79 bytes {main} [built]
55
[./node_modules/a/index.ts] 669 bytes {main} [built] [failed] [1 error]
66

77
ERROR in ./node_modules/a/index.ts
8-
Module build failed: Error: TypeScript emitted no output for node_modules\a\index.ts. By default, ts-loader will not compile .ts files in node_modules.
8+
Module build failed (from /index.js):
9+
Error: TypeScript emitted no output for node_modules\a\index.ts. By default, ts-loader will not compile .ts files in node_modules.
910
You should not need to recompile .ts files there, but if you really want to, use the allowTsInNodeModules option.
1011
See: https://github.com/Microsoft/TypeScript/issues/12358
11-
at makeSourceMapAndFinish (dist\index.js:71:15)
12-
at successLoader (dist\index.js:61:9)
13-
at Object.loader (dist\index.js:21:12)
12+
at makeSourceMapAndFinish (dist\index.js:78:15)
13+
at successLoader (dist\index.js:68:9)
14+
at Object.loader (dist\index.js:22:12)
1415
@ ./app.ts 3:8-20

test/comparison-tests/projectReferencesNoSourceMap/expectedOutput-3.0/output.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ Entrypoint main = bundle.js
66
[./lib/index.ts] 263 bytes {main} [built] [1 warning]
77

88
WARNING in ./lib/index.ts
9-
Could not find source map file for referenced project output lib/index.js. Ensure the 'sourceMap' compiler option is enabled in lib/tsconfig.json to ensure Webpack can map project references to the appropriate source files.
9+
Module Warning (from /index.js):
10+
Could not find source map file for referenced project output lib\index.js. Ensure the 'sourceMap' compiler option is enabled in lib\tsconfig.json to ensure Webpack can map project references to the appropriate source files.
1011
@ ./app.ts 3:12-28

test/comparison-tests/projectReferencesNotBuilt/expectedOutput-3.0/bundle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */
105105
/*! no static exports found */
106106
/***/ (function(module, exports) {
107107

108-
eval("throw new Error(\"Module build failed: Error: Could not find output JavaScript file for input lib/index.ts (looked at lib/index.js)./nThe input file is part of a project reference located at lib/tsconfig.json, so ts-loader is looking for the project’s pre-built output on disk. Try running `tsc --build` to build project references./n at successLoader (/Users/Andrew/Developer/ts-loader/dist/index.js:45:19)/n at Object.loader (/Users/Andrew/Developer/ts-loader/dist/index.js:21:12)\");\n\n//# sourceURL=webpack:///./lib/index.ts?");
108+
eval("throw new Error(\"Module build failed (from C:/source/ts-loader/index.js):/nError: Could not find output JavaScript file for input lib//index.ts (looked at lib//index.js)./nThe input file is part of a project reference located at lib//tsconfig.json, so ts-loader is looking for the project’s pre-built output on disk. Try running `tsc --build` to build project references./n at successLoader (C://source//ts-loader//dist//index.js:46:19)/n at Object.loader (C://source//ts-loader//dist//index.js:22:12)\");\n\n//# sourceURL=webpack:///./lib/index.ts?");
109109

110110
/***/ })
111111

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
Asset Size Chunks Chunk Names
2-
bundle.js 4.64 KiB main [emitted] main
2+
bundle.js 4.68 KiB main [emitted] main
33
Entrypoint main = bundle.js
44
[./app.ts] 131 bytes {main} [built] [1 error]
5-
[./lib/index.ts] 490 bytes {main} [built] [failed] [1 error]
5+
[./lib/index.ts] 510 bytes {main} [built] [failed] [1 error]
66

77
ERROR in tsconfig.json
88
[tsl] ERROR
9-
 TS6305: Output file 'lib/index.d.ts' has not been built from source file 'lib/index.ts'.
9+
 TS6305: Output file '/.test/projectReferencesNotBuilt/lib/index.d.ts' has not been built from source file '/.test/projectReferencesNotBuilt/lib/index.ts'.
1010

1111
ERROR in ./lib/index.ts
12-
Module build failed: Error: Could not find output JavaScript file for input lib/index.ts (looked at lib/index.js).
13-
The input file is part of a project reference located at lib/tsconfig.json, so ts-loader is looking for the project’s pre-built output on disk. Try running `tsc --build` to build project references.
14-
at successLoader (dist/index.js:45:19)
15-
at Object.loader (dist/index.js:21:12)
12+
Module build failed (from /index.js):
13+
Error: Could not find output JavaScript file for input lib\index.ts (looked at lib\index.js).
14+
The input file is part of a project reference located at lib\tsconfig.json, so ts-loader is looking for the project’s pre-built output on disk. Try running `tsc --build` to build project references.
15+
at successLoader (dist\index.js:46:19)
16+
at Object.loader (dist\index.js:22:12)
1617
@ ./app.ts 3:12-28
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
Asset Size Chunks Chunk Names
2-
bundle.js 4.64 KiB main [emitted] main
2+
bundle.js 4.68 KiB main [emitted] main
33
Entrypoint main = bundle.js
44
[./app.ts] 131 bytes {main} [built]
5-
[./lib/index.ts] 490 bytes {main} [built] [failed] [1 error]
5+
[./lib/index.ts] 510 bytes {main} [built] [failed] [1 error]
66

77
ERROR in ./lib/index.ts
8-
Module build failed: Error: Could not find output JavaScript file for input lib/index.ts (looked at lib/index.js).
9-
The input file is part of a project reference located at lib/tsconfig.json, so ts-loader is looking for the project’s pre-built output on disk. Try running `tsc --build` to build project references.
10-
at successLoader (dist/index.js:45:19)
11-
at Object.loader (dist/index.js:21:12)
8+
Module build failed (from /index.js):
9+
Error: Could not find output JavaScript file for input lib\index.ts (looked at lib\index.js).
10+
The input file is part of a project reference located at lib\tsconfig.json, so ts-loader is looking for the project’s pre-built output on disk. Try running `tsc --build` to build project references.
11+
at successLoader (dist\index.js:46:19)
12+
at Object.loader (dist\index.js:22:12)
1213
@ ./app.ts 3:12-28
1314

1415
ERROR in tsconfig.json
1516
[tsl] ERROR
16-
 TS6305: Output file 'lib/index.d.ts' has not been built from source file 'lib/index.ts'.
17+
 TS6305: Output file '/.test/projectReferencesNotBuilt/lib/index.d.ts' has not been built from source file '/.test/projectReferencesNotBuilt/lib/index.ts'.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Asset Size Chunks Chunk Names
2+
bundle.js 4.28 KiB main [emitted] main
3+
Entrypoint main = bundle.js
4+
[./app.ts] 131 bytes {main} [built]
5+
[./lib/index.ts] 97 bytes {main} [built]

0 commit comments

Comments
 (0)