Skip to content

Commit

Permalink
docs: be clear about what module of semantic-release handles updating…
Browse files Browse the repository at this point in the history
… the package.json (semantic-release#1601)
  • Loading branch information
gsdevme authored Jul 12, 2020
1 parent b5c9dea commit 6d118c6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/support/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

## Why is the `package.json`’s version not updated in my repository?

**semantic-release** takes care of updating the `package.json`’s version before publishing to [npm](https://www.npmjs.com).
[`@semantic-release/npm`](https://github.com/semantic-release/npm) takes care of updating the `package.json`’s version before publishing to [npm](https://www.npmjs.com).

By default, only the published package will contain the version, which is the only place where it is *really* required, but the updated `package.json` will not be pushed to the Git repository

However, the [`@semantic-release/git`](https://github.com/semantic-release/git) plugin can be used to push the updated `package.json` as well as other files to the Git repository.

If you wish to only update the `package.json` and push via Git you can set the project to `"private": true,` within your `package.json` to prevent publishing to [npm](https://www.npmjs.com). This can be useful for using **semantic-release** with a non-node project.

## How can I use a npm build script that requires the `package.json`’s version ?

The `package.json`’s version will be updated by the `semantic-release` command just before publishing to [npm](https://www.npmjs.com), therefore it won't be available for scripts ran before the `semantic-release` command.
Expand Down

0 comments on commit 6d118c6

Please sign in to comment.