Skip to content

Commit

Permalink
fix file path parsing from loader messages (#80)
Browse files Browse the repository at this point in the history
File path parsing from loader messages is fixed
  • Loading branch information
jkanczler authored Aug 23, 2018
1 parent 333aa7a commit 7ce84f4
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion DETAILS.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ stats.js Location | true | ./node_modules/webpack/lib/Stats.js | Location of the

## <a id="release-notes"></a>Release Notes

* 4.1.1 (23/08/2018)
* 4.1.2 (23/08/2018)
* Errors and warnings can be reported as pull request comments (ts-loader and tslint-loader are supported, more will come).
* 4.0.4 (24/05/2018)
* Dependencies are updated to fix security vulnerabilities (though it was just in one of the samples).
Expand Down
2 changes: 1 addition & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
next-version: 4.1.1
next-version: 4.1.2
assembly-informational-format: '{SemVer}'
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ stats.js Location | true | ./node_modules/webpack/lib/Stats.js | Location of the

## <a id="release-notes"></a>Release Notes

* 4.1.1 (23/08/2018)
* 4.1.2 (23/08/2018)
* Errors and warnings can be reported as pull request comments (ts-loader and tslint-loader are supported, more will come).
* 4.0.4 (24/05/2018)
* Dependencies are updated to fix security vulnerabilities (though it was just in one of the samples).
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wepback-vsts-extension",
"version": "4.1.1",
"version": "4.1.2",
"description": "webpack Visual Studio Team System (VSTS) Extension",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion tasks/webpack-build-task/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "webpack-build-task",
"version": "4.1.1",
"version": "4.1.2",
"description": "Webpack build task for Visual Studio Team System (VSTS)",
"main": "index.js",
"scripts": {},
Expand Down
2 changes: 1 addition & 1 deletion tasks/webpack-build-task/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"version": {
"Major": 4,
"Minor": 1,
"Patch": 1
"Patch": 2
},
"minimumAgentVersion": "1.95.0",
"groups": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default (taskDisplayName: string, message: string): IMessage => {

const lines = message.split("\n");

const filePath = lines[0].slice(2);
const filePath = lines[0].slice(1);
const line = Number(lines[2].slice(1, lines[2].indexOf(",")));
const offset = Number(lines[2].slice(lines[2].indexOf(",") + 1, lines[2].indexOf("]")));
const messageWithTaskDisplayName = `${taskDisplayName}: ${message}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default (taskDisplayName: string, message: string): IMessage => {
return null;
}

const filePath = lines[1].slice(2);
const filePath = lines[1].slice(1);
const sublines = lines[2].split("\r\n");
const line = Number(lines[2].slice(sublines[0].lastIndexOf("(") + 1, sublines[0].lastIndexOf(",")));
const offset = Number(lines[2].slice(sublines[0].lastIndexOf(",") + 1, sublines[0].lastIndexOf(")")));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default () => {
const unparsedTsLintLoaderMessage = "./src/index.ts\nModule Error (from ./node_modules/tslint-loader/index.js):\n[132, 281]: Missing semicolon\n";
const parsedMessage = parseTsLintLoaderMessage("task", unparsedTsLintLoaderMessage);

assert.equal(parsedMessage.filePath, "src/index.ts");
assert.equal(parsedMessage.filePath, "/src/index.ts");
assert.equal(parsedMessage.message, `task: ${unparsedTsLintLoaderMessage}`);
assert.equal(parsedMessage.start.line, 132);
assert.equal(parsedMessage.start.offset, 281);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default () => {
const unparsedTsLoaderMessage = `C:\\W\\Playground\\webpack-format-messages\\src\\index.ts\n./src/index.ts\n[tsl] ERROR in C:\\W\\Playground\\webpack-format-messages\\src\\index.ts(456,918)\r\n TS2339: Property \'lo\' does not exist on type \'Console\'.`;
const parsedMessage = parseTsLoaderMessage("task", unparsedTsLoaderMessage);

assert.equal(parsedMessage.filePath, "src/index.ts");
assert.equal(parsedMessage.filePath, "/src/index.ts");
assert.equal(parsedMessage.message, `task: ${unparsedTsLoaderMessage}`);
assert.equal(parsedMessage.start.line, 456);
assert.equal(parsedMessage.start.offset, 918);
Expand Down
2 changes: 1 addition & 1 deletion vss-extension.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifestVersion": 1,
"id": "webpack-vsts-extension",
"version": "4.1.1",
"version": "4.1.2",
"name": "webpack",
"description": "bundle your assets, scripts, images, styles",
"publisher": "Dealogic",
Expand Down

0 comments on commit 7ce84f4

Please sign in to comment.