Skip to content

Commit

Permalink
Chore/upgrade deps (#843)
Browse files Browse the repository at this point in the history
* 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'
  • Loading branch information
johnnyreilly authored Sep 28, 2018
1 parent 158e331 commit c9ce397
Show file tree
Hide file tree
Showing 44 changed files with 1,093 additions and 3,285 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
"glob": "^7.1.1",
"html-webpack-plugin": "^3.2.0",
"husky": "^0.14.3",
"jasmine-core": "^2.5.2",
"karma": "^2.0.0",
"jasmine-core": "^3.0.0",
"karma": "^3.0.0",
"karma-chrome-launcher": "^2.2.0",
"karma-jasmine": "^1.0.0",
"karma-mocha-reporter": "^2.0.0",
Expand All @@ -83,7 +83,7 @@
"tslint-config-prettier": "^1.15.0",
"typescript": "^3.0.1",
"webpack": "^4.5.0",
"webpack-cli": "^2.1.2"
"webpack-cli": "^3.1.1"
},
"peerDependencies": {
"typescript": "*"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/******/ var chunkIds = data[0];
/******/ var moreModules = data[1];
/******/
/******/
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0, resolves = [];
Expand All @@ -20,6 +21,7 @@
/******/ }
/******/ }
/******/ if(parentJsonpFunction) parentJsonpFunction(data);
/******/
/******/ while(resolves.length) {
/******/ resolves.shift()();
/******/ }
Expand Down Expand Up @@ -96,11 +98,11 @@
/******/
/******/ script.charset = 'utf-8';
/******/ script.timeout = 120;
/******/
/******/ if (__webpack_require__.nc) {
/******/ script.setAttribute("nonce", __webpack_require__.nc);
/******/ }
/******/ script.src = jsonpScriptSrc(chunkId);
/******/
/******/ onScriptComplete = function (event) {
/******/ // avoid mem leaks in IE.
/******/ script.onerror = script.onload = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Asset Size Chunks Chunk Names
bundle.js 9.39 KiB main [emitted] main
bundle.js 9.41 KiB main [emitted] main
0.bundle.js 592 bytes 0 [emitted]
Entrypoint main = bundle.js
[./a.ts] 36 bytes {main} [built]
Expand Down
2 changes: 1 addition & 1 deletion test/comparison-tests/colors/expectedOutput-3.0/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
/*! no static exports found */
/***/ (function(module, exports) {

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?");
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?");

/***/ })

Expand Down

This file was deleted.

4 changes: 2 additions & 2 deletions test/comparison-tests/colors/expectedOutput-3.0/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ bundle.js 3.89 KiB main [emitted] main
Entrypoint main = bundle.js
[./app.ts] 149 bytes {main} [built] [failed] [2 errors]

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

ERROR in app.ts
Expand Down
3 changes: 3 additions & 0 deletions test/comparison-tests/create-and-execute-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,9 @@ function getNormalisedFileContent(file, location) {
// Built at: 2/15/2018 8:33:18 PM
// Built at: 2018-2-11 17:50:52 (any time is fine for us)
.replace(/^Built at: .+$/gm, '')
// We have 'Module build failed (from /index.js' on Windows and 'Module build failed (from index.js' on Linux
.replace(/Module build failed \(from \//gm, 'Module build failed (from ')
.replace(/Module Warning \(from \//gm, 'Module Warning (from ')
// We don't want a difference in the number of kilobytes to fail the build
.replace(/[\d]+([.][\d]*)? KiB/g, 'A-NUMBER-OF KiB')
// We also don't want a difference in the number of bytes to fail the build
Expand Down
2 changes: 1 addition & 1 deletion test/comparison-tests/errors/expectedOutput-3.0/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
/*! no static exports found */
/***/ (function(module, exports) {

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?");
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?");

/***/ })

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ ERROR in app.ts
[tsl] ERROR in app.ts(1,7)
 TS1005: ',' expected.

ERROR in ./app.ts
ERROR in ./app.ts 2:1
Module parse failed: Unexpected token (2:1)
You may need an appropriate loader to handle this file type.
| var a;
| == 0;
> == 0;
|
4 changes: 2 additions & 2 deletions test/comparison-tests/errors/expectedOutput-3.0/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ bundle.js 3.89 KiB main [emitted] main
Entrypoint main = bundle.js
[./app.ts] 149 bytes {main} [built] [failed] [2 errors]

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

ERROR in app.ts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/******/ var chunkIds = data[0];
/******/ var moreModules = data[1];
/******/
/******/
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0, resolves = [];
Expand All @@ -20,6 +21,7 @@
/******/ }
/******/ }
/******/ if(parentJsonpFunction) parentJsonpFunction(data);
/******/
/******/ while(resolves.length) {
/******/ resolves.shift()();
/******/ }
Expand Down Expand Up @@ -96,11 +98,11 @@
/******/
/******/ script.charset = 'utf-8';
/******/ script.timeout = 120;
/******/
/******/ if (__webpack_require__.nc) {
/******/ script.setAttribute("nonce", __webpack_require__.nc);
/******/ }
/******/ script.src = jsonpScriptSrc(chunkId);
/******/
/******/ onScriptComplete = function (event) {
/******/ // avoid mem leaks in IE.
/******/ script.onerror = script.onload = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Asset Size Chunks Chunk Names
bundle.js 9.96 KiB main [emitted] main
bundle.js 9.97 KiB main [emitted] main
0.bundle.js 726 bytes 0 [emitted]
Entrypoint main = bundle.js
[./a.ts] 100 bytes {main} [built]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
/*! no static exports found */
/***/ (function(module, exports) {

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?");
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?");

/***/ })

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
/*! no static exports found */
/***/ (function(module, exports) {

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?");
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?");

/***/ })

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
Asset Size Chunks Chunk Names
bundle.js 3.99 KiB a [emitted] a
bundle.js 4.03 KiB a [emitted] a
Entrypoint a = bundle.js
Entrypoint b =
[./a.ts] 252 bytes {a} [built] [failed] [1 error]
[./b.ts] 252 bytes {b} [built] [failed] [1 error]
[./a.ts] 289 bytes {a} [built] [failed] [1 error]
[./b.ts] 289 bytes {b} [built] [failed] [1 error]

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

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

ERROR in chunk b [entry]
bundle.js
Conflict: Multiple assets emit to the same filename bundle.js
Conflict: Multiple chunks emit assets to the same filename bundle.js (chunks a and b)
18 changes: 10 additions & 8 deletions test/comparison-tests/instance/expectedOutput-3.0/output.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
Asset Size Chunks Chunk Names
bundle.js 3.98 KiB a [emitted] a
bundle.js 4.02 KiB a [emitted] a
Entrypoint a = bundle.js
Entrypoint b =
[./a.ts] 242 bytes {a} [built] [failed] [1 error]
[./b.ts] 242 bytes {b} [built] [failed] [1 error]
[./a.ts] 279 bytes {a} [built] [failed] [1 error]
[./b.ts] 279 bytes {b} [built] [failed] [1 error]

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

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

ERROR in chunk b [entry]
bundle.js
Conflict: Multiple assets emit to the same filename bundle.js
Conflict: Multiple chunks emit assets to the same filename bundle.js (chunks a and b)
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ eval("\nexports.__esModule = true;\nvar a = __webpack_require__(/*! a */ \"./nod
/*! no static exports found */
/***/ (function(module, exports) {

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?");
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?");

/***/ })

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
Asset Size Chunks Chunk Names
bundle.js 4.83 KiB main [emitted] main
bundle.js 4.87 KiB main [emitted] main
Entrypoint main = bundle.js
[./app.ts] 79 bytes {main} [built]
[./node_modules/a/index.ts] 669 bytes {main} [built] [failed] [1 error]

ERROR in ./node_modules/a/index.ts
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.
Module build failed (from /index.js):
Error: TypeScript emitted no output for node_modules\a\index.ts. By default, ts-loader will not compile .ts files in node_modules.
You should not need to recompile .ts files there, but if you really want to, use the allowTsInNodeModules option.
See: https://github.com/Microsoft/TypeScript/issues/12358
at makeSourceMapAndFinish (dist\index.js:71:15)
at successLoader (dist\index.js:61:9)
at Object.loader (dist\index.js:21:12)
at makeSourceMapAndFinish (dist\index.js:78:15)
at successLoader (dist\index.js:68:9)
at Object.loader (dist\index.js:22:12)
@ ./app.ts 3:8-20
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ Entrypoint main = bundle.js
[./lib/index.ts] 263 bytes {main} [built] [1 warning]

WARNING in ./lib/index.ts
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.
Module Warning (from /index.js):
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.
@ ./app.ts 3:12-28
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */
/*! no static exports found */
/***/ (function(module, exports) {

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?");
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?");

/***/ })

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
Asset Size Chunks Chunk Names
bundle.js 4.64 KiB main [emitted] main
bundle.js 4.68 KiB main [emitted] main
Entrypoint main = bundle.js
[./app.ts] 131 bytes {main} [built] [1 error]
[./lib/index.ts] 490 bytes {main} [built] [failed] [1 error]
[./lib/index.ts] 510 bytes {main} [built] [failed] [1 error]

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

ERROR in ./lib/index.ts
Module build failed: Error: Could not find output JavaScript file for input lib/index.ts (looked at lib/index.js).
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.
at successLoader (dist/index.js:45:19)
at Object.loader (dist/index.js:21:12)
Module build failed (from /index.js):
Error: Could not find output JavaScript file for input lib\index.ts (looked at lib\index.js).
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.
at successLoader (dist\index.js:46:19)
at Object.loader (dist\index.js:22:12)
@ ./app.ts 3:12-28
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
Asset Size Chunks Chunk Names
bundle.js 4.64 KiB main [emitted] main
bundle.js 4.68 KiB main [emitted] main
Entrypoint main = bundle.js
[./app.ts] 131 bytes {main} [built]
[./lib/index.ts] 490 bytes {main} [built] [failed] [1 error]
[./lib/index.ts] 510 bytes {main} [built] [failed] [1 error]

ERROR in ./lib/index.ts
Module build failed: Error: Could not find output JavaScript file for input lib/index.ts (looked at lib/index.js).
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.
at successLoader (dist/index.js:45:19)
at Object.loader (dist/index.js:21:12)
Module build failed (from /index.js):
Error: Could not find output JavaScript file for input lib\index.ts (looked at lib\index.js).
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.
at successLoader (dist\index.js:46:19)
at Object.loader (dist\index.js:22:12)
@ ./app.ts 3:12-28

ERROR in tsconfig.json
[tsl] ERROR
 TS6305: Output file 'lib/index.d.ts' has not been built from source file 'lib/index.ts'.
 TS6305: Output file '/.test/projectReferencesNotBuilt/lib/index.d.ts' has not been built from source file '/.test/projectReferencesNotBuilt/lib/index.ts'.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Asset Size Chunks Chunk Names
bundle.js 4.28 KiB main [emitted] main
Entrypoint main = bundle.js
[./app.ts] 131 bytes {main} [built]
[./lib/index.ts] 97 bytes {main} [built]
Loading

0 comments on commit c9ce397

Please sign in to comment.