Skip to content

Commit

Permalink
feat(generators/app/templates): transition to use prepublishOnly in…
Browse files Browse the repository at this point in the history
… favor of `prepublish`

This is an npm@>=5 feature so also add an `engines` hint for it.

As per this `npm@5` warning:

> ```
> npm WARN prepublish-on-install As of npm@5, `prepublish` scripts are deprecated.
> npm WARN prepublish-on-install Use `prepare` for build steps and `prepublishOnly` for upload-only.
> npm WARN prepublish-on-install See the deprecation note in `npm help scripts` for more information.
> ```
  • Loading branch information
cueedee committed Oct 11, 2017
1 parent 6969a74 commit 0d2c82b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion generators/app/templates/@README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ This will:
* _\[... Ensure you have local ... and ... branches tracking their respective remote counterparts;\]_
* _\[... Set up the ... [branching model](#branching-model);\]_
* Install all required dependencies;
* The latter command will also invoke `grunt` (no args) for you, creating a production build in `./dist` (plus artifacts);


### Build
Expand Down
5 changes: 4 additions & 1 deletion generators/app/templates/@package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
"directories": {
"doc": "dist/doc"
},
"engines": {
"npm": ">=5"
},
"files": [
"AUTHORS",
"CHANGELOG.md",
Expand All @@ -55,7 +58,7 @@
"dist": "true",
"prebuild": "rm -rf \"${npm_package_config_dist}\"",
"predist": "npm run build",
"prepublish": "npm run dist",
"prepublishOnly": "npm run dist",
"release": "standard-version",
"test": "command -v grunt > /dev/null || { echo >&2 'It appears that \"grunt\" is not installed. Consider running \"[sudo ]npm install -g grunt-cli\" first.'; exit ; } && grunt test"
},
Expand Down

0 comments on commit 0d2c82b

Please sign in to comment.