diff options
author | Hirse <jan.pilzer@gmx.de> | 2017-06-02 16:15:53 +0300 |
---|---|---|
committer | Kat Marchán <kzm@sykosomatic.org> | 2017-06-06 00:20:51 +0300 |
commit | 191d10a6616d72e26d89fd00f5a4f6158bfbc526 (patch) | |
tree | fda5e7570e789ff5468631c5ab754c7a981591f3 | |
parent | 6e12a5cc022cb5a157a37df7283b6d7b3d49bdab (diff) |
docs: fix up prepublish deprecation message
Fixes: #16685
PR-URL: https://github.com/npm/npm/pull/16918
Credit: @Hirse
Reviewed-By: @zkat
-rw-r--r-- | lib/install/action/prepare.js | 4 | ||||
-rw-r--r-- | lib/pack.js | 4 | ||||
-rw-r--r-- | test/tap/prepublish.js | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/lib/install/action/prepare.js b/lib/install/action/prepare.js index 771a2a939..5e4333a5b 100644 --- a/lib/install/action/prepare.js +++ b/lib/install/action/prepare.js @@ -11,8 +11,8 @@ module.exports = function (staging, pkg, log, next) { // see https://github.com/npm/npm/issues/10074 for details if (pkg.package && pkg.package.scripts && pkg.package.scripts.prepublish) { prepublishWarning([ - 'As of npm@5, `prepublish` scripts will run only for `npm publish`.', - '(In npm@4 and previous versions, it also runs for `npm install`.)', + 'As of npm@5, `prepublish` scripts are deprecated.', + 'Use `prepare` for build steps and `prepublishOnly` for upload-only.', 'See the deprecation note in `npm help scripts` for more information.' ]) } diff --git a/lib/pack.js b/lib/pack.js index 075a672d6..4552bbc49 100644 --- a/lib/pack.js +++ b/lib/pack.js @@ -92,8 +92,8 @@ function prepareDirectory (dir) { if (pkg.scripts && pkg.scripts.prepublish) { prepublishWarning([ 'As of npm@5, `prepublish` scripts are deprecated.', - 'Use `prepare` for build steps and `prepublishOnly` for upload-only', - 'See the deprecation note in `npm help scripts` for more information' + 'Use `prepare` for build steps and `prepublishOnly` for upload-only.', + 'See the deprecation note in `npm help scripts` for more information.' ]) } if (npm.config.get('ignore-prepublish')) { diff --git a/test/tap/prepublish.js b/test/tap/prepublish.js index 18bfe5f22..c71455a24 100644 --- a/test/tap/prepublish.js +++ b/test/tap/prepublish.js @@ -94,7 +94,7 @@ test('prepublish deprecation warning on `npm install`', function (t) { t.equal(code, 0, 'pack finished successfully') t.ifErr(err, 'pack finished successfully') - t.match(stderr, /`prepublish` scripts will run only for `npm publish`/) + t.match(stderr, /`prepublish` scripts are deprecated/) var c = stdout.trim() var regex = new RegExp('' + '> npm-test-prepublish@1.2.5 prepublish [^\\r\\n]+\\r?\\n' + |