Skip to content

Commit

Permalink
brackets replaced to parenthesis in result filename, version to 3.2.0 (
Browse files Browse the repository at this point in the history
  • Loading branch information
jkanczler authored Sep 22, 2017
1 parent 224420a commit ba72989
Show file tree
Hide file tree
Showing 17 changed files with 96 additions and 45 deletions.
2 changes: 2 additions & 0 deletions DETAILS.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ ts-node options location | false | | Location of the ts-node options. If you lea

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

* 3.2.0 (22/09/2017)
* Support `[]` brackets in the display name of the task.
* 3.1.0 (21/09/2017)
* Support for TypeScript webpack configuration is added.
* The ts-node module location can be modified.
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ ts-node options location | false | | Location of the ts-node options. If you lea

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

* 3.2.0 (22/09/2017)
* Support `[]` brackets in the display name of the task.
* 3.1.0 (21/09/2017)
* Support for TypeScript webpack configuration is added.
* The ts-node module location can be modified.
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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": "3.1.0",
"version": "3.2.0",
"description": "webpack Visual Studio Team System (VSTS) Extension",
"main": "index.js",
"scripts": {
Expand Down
18 changes: 9 additions & 9 deletions samples/webpack-2/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions samples/webpack-3-with-issues/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions samples/webpack-3/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions samples/webpack-ts-config/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tasks/webpack-build-task/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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": "3.1.0",
"version": "3.2.0",
"description": "Webpack build task for Visual Studio Team System (VSTS)",
"main": "index.js",
"scripts": {},
Expand Down
3 changes: 2 additions & 1 deletion tasks/webpack-build-task/summarySectionBuilder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { IWebpackCompilationResult } from "../webpackCompiler";
const generateWebpackResultFilename = (workingFolder: string, taskDisplayName: string) => {
const webpackResultFilenamePostfix = ".webpack.result.md";

return path.join(workingFolder, `${filenamify(taskDisplayName).trim()}${webpackResultFilenamePostfix}`);
const filename = filenamify(taskDisplayName).replace(/\[/g, "(").replace(/\]/g, ")").trim();
return path.join(workingFolder, `${filename}${webpackResultFilenamePostfix}`);
};

const createWebpackResultMarkdownFile = (
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 @@ -16,7 +16,7 @@
],
"version": {
"Major": 3,
"Minor": 1,
"Minor": 2,
"Patch": 0
},
"minimumAgentVersion": "1.95.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import runTestTask from "./shared/testTaskRunner";

runTestTask({
webpackCompilationResult: {
toJson: () => {
return {
errors: [],
warnings: []
};
},
toString: (config: any) => {
return "shouldReplaceBracketsToParenthesisInFilename";
}
},
taskDisplayName: "webpack [something in brackets]",
mockWriteFile: true
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import * as path from "path";
import { MockTestRunner } from "vsts-task-lib/mock-test";
import { assert } from "chai";

const mockRunnerDefinitions = "mockRunnerDefinitions";

export const executeTest = (done: MochaDone) => {
const testPath = path.join(__dirname, mockRunnerDefinitions, "shouldReplaceBracketsToParenthesisInFilename.js");
const testRunner = new MockTestRunner(testPath);
testRunner.run();

assert.isTrue(testRunner.succeeded, "task should be succeeded");
assert.isFalse(testRunner.failed, "task should be not failed");

const resultFileIsAttached = testRunner.stdOutContained("##vso[task.addattachment type=Distributedtask.Core.Summary;name=webpack [something in brackets] result;]");
assert.isTrue(resultFileIsAttached, "result file should be attached");

const resultFilenameConverted = testRunner.stdOutContained("webpack (something in brackets).webpack.result.md");
assert.isTrue(resultFilenameConverted, "attached filename should contain normal parenthesis");

done();
};
9 changes: 8 additions & 1 deletion tasks/webpack-build-task/tests/suite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import * as shouldGenerateMarkdownFileInCaseOfASuccessfulRun from "./shouldGener
import * as shouldLogInformationAboutTheProcess from "./shouldLogInformationAboutTheProcess";
import * as shouldPartiallySucceedIfNoErrorsButAtLeastOneWarning from "./shouldPartiallySucceedIfNoErrorsButAtLeastOneWarning";
import * as shouldPartiallySucceedIfThereAreErrorsButTreatedAsWarning from "./shouldPartiallySucceedIfThereAreErrorsButTreatedAsWarning";
import * as shouldReplaceBracketsToParenthesisInFilename from "./shouldReplaceBracketsToParenthesisInFilename";
import * as shouldReportErrorDetailInCaseOfWebpackBuildFailure from "./shouldReportErrorDetailInCaseOfWebpackBuildFailure";
import * as shouldSucceedIfNoDisplayNameDefined from "./shouldSucceedIfNoDisplayNameDefined";
import * as shouldSucceedIfNoErrorsAndWarnings from "./shouldSucceedIfNoErrorsAndWarnings";
Expand All @@ -26,7 +27,8 @@ describe("webpack build task", () => {
"../../samples/webpack-3/webpack test.webpack.result.md",
"../../samples/webpack-3-with-issues/webpack test.webpack.result.md",
"../../samples/webpack-ts-config/webpack test.webpack.result.md",
"tests/webpack test.webpack.result.md"
"tests/webpack test.webpack.result.md",
"tests/webpack (something in brackets).webpack.result.md"
];

for (const fileToDelete of filesToDelete) {
Expand Down Expand Up @@ -92,6 +94,11 @@ describe("webpack build task", () => {
"should partially succeed if there are errors, but those are treated as warnings",
shouldPartiallySucceedIfThereAreErrorsButTreatedAsWarning.executeTest);

it(
"should replace brackets to parenthesis in filename",
shouldReplaceBracketsToParenthesisInFilename.executeTest
);

it(
"should report error detail in case of webpack build failure",
shouldReportErrorDetailInCaseOfWebpackBuildFailure.executeTest);
Expand Down
2 changes: 1 addition & 1 deletion version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default "__GitVersion.SemVer__".replace("GitVersion.SemVer", "3.1.0").replace(/__/g, "");
export default "__GitVersion.SemVer__".replace("GitVersion.SemVer", "3.2.0").replace(/__/g, "");
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": "3.1.0",
"version": "3.2.0",
"name": "webpack",
"description": "bundle your assets, scripts, images, styles",
"publisher": "Dealogic",
Expand Down

0 comments on commit ba72989

Please sign in to comment.