webpack-build-notifier
Advanced tools
Comparing version 0.1.17 to 0.1.18
15
index.js
@@ -106,4 +106,15 @@ /** | ||
* 2) {String} filepath - The path to the file containing the error/warning (if available). | ||
* This function must return a String. | ||
* The default messageFormatter will display the filename which contains the error/warning followed by the | ||
* error/warning message. | ||
* Note that the message will always be limited to 256 characters. | ||
*/ | ||
this.messageFormatter = cfg.messageFormatter || this.messageFormatter; | ||
this.messageFormatter = function(error, filepath) { | ||
var message = (cfg.messageFormatter || this.defaultMessageFormatter)(error, filepath); | ||
if (typeof message === "string") { | ||
return message.substr(0, 256); // limit message length to 256 characters, fixes #20 | ||
} else { | ||
throw "Invalid message type '" + typeof message + "'; messageFormatter must return a String."; | ||
} | ||
}; | ||
@@ -117,3 +128,3 @@ // add notification click handler to activate terminal window | ||
WebpackBuildNotifierPlugin.prototype.messageFormatter = function(error, filepath) { | ||
WebpackBuildNotifierPlugin.prototype.defaultMessageFormatter = function(error, filepath) { | ||
return filepath + os.EOL + (error.message ? error.message.replace(error.module ? error.module.resource : '', '') : ''); | ||
@@ -120,0 +131,0 @@ }; |
@@ -0,0 +0,0 @@ MIT License |
{ | ||
"name": "webpack-build-notifier", | ||
"version": "0.1.17", | ||
"version": "0.1.18", | ||
"description": "A Webpack plugin that generates OS notifications for build steps using node-notifier.", | ||
@@ -27,9 +27,8 @@ "main": "index.js", | ||
"ansi-regex": "^2.0.0", | ||
"node-notifier": "^4.1.0", | ||
"strip-ansi": "^3.0.1" | ||
"strip-ansi": "^3.0.1", | ||
"node-notifier": "^5.1.2" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^1.1.0", | ||
"node-notifier": "^4.3.1" | ||
"eslint": "^1.1.0" | ||
} | ||
} |
@@ -92,2 +92,7 @@ # webpack-build-notifier | ||
This function must return a String. | ||
The default messageFormatter will display the filename which contains the error/warning followed by the | ||
error/warning message. | ||
Note that the message will always be limited to 256 characters. | ||
#### onClick | ||
@@ -110,2 +115,7 @@ A function called when the notification is clicked. By default it activates the Terminal application. | ||
--------- | ||
#### 0.1.18 | ||
###### _November 30, 2017_ | ||
- Updated `node-notifier` package version to latest; enforced max message length to 256 to fix [#20](/../../issues/20). | ||
#### 0.1.17 | ||
@@ -112,0 +122,0 @@ ###### _November 6, 2017_ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
96386
1
192
182
+ Addedis-wsl@1.1.0(transitive)
+ Addednode-notifier@5.4.5(transitive)
- Removedansi-escapes@3.2.0(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedansicolors@0.3.2(transitive)
- Removedcardinal@2.1.1(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcli-table@0.3.11(transitive)
- Removedcli-usage@0.1.10(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedcolors@1.0.3(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedesprima@4.0.1(transitive)
- Removedhas-flag@2.0.03.0.0(transitive)
- Removedlodash@4.17.21(transitive)
- Removedlodash._arraycopy@3.0.0(transitive)
- Removedlodash._arrayeach@3.0.0(transitive)
- Removedlodash._baseassign@3.2.0(transitive)
- Removedlodash._baseclone@3.3.0(transitive)
- Removedlodash._basecopy@3.0.1(transitive)
- Removedlodash._basefor@3.0.3(transitive)
- Removedlodash._bindcallback@3.0.1(transitive)
- Removedlodash._getnative@3.9.1(transitive)
- Removedlodash.clonedeep@3.0.2(transitive)
- Removedlodash.isarguments@3.1.0(transitive)
- Removedlodash.isarray@3.0.4(transitive)
- Removedlodash.keys@3.1.2(transitive)
- Removedmarked@0.7.0(transitive)
- Removedmarked-terminal@3.3.0(transitive)
- Removedminimist@1.2.8(transitive)
- Removednode-emoji@1.11.0(transitive)
- Removednode-notifier@4.6.1(transitive)
- Removedredeyed@2.1.1(transitive)
- Removedsupports-color@5.5.0(transitive)
- Removedsupports-hyperlinks@1.0.1(transitive)
Updatednode-notifier@^5.1.2