Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Reset version field in package.json after publish #5

Open
marcolink opened this issue Sep 21, 2018 · 2 comments
Open

Reset version field in package.json after publish #5

marcolink opened this issue Sep 21, 2018 · 2 comments
Assignees

Comments

@marcolink
Copy link
Contributor

marcolink commented Sep 21, 2018

Description

One downside of this plugin is a dirty repository after every release. There is no other way for npm publish then setting the version in package.json (please teach me if you know any other way). This is fine on a CI system like jenkins, because we can just ignore the changes. But if you run one of the release tasks (snapshot, candidate, release) locally, you will always end up with a changed version field in package.json.

One way could be, to store the initial value of version field, and restore it after the release.

{
    "version": "0.1.0"
}
@Larusso
Copy link
Member

Larusso commented Sep 23, 2018

You could also store a template value like 0.0.0 or if possible %VERSION% or something.
At best something that might fail if a manual release with npm is executed. But this is outside of the scope if this plugin.

@marcolink
Copy link
Contributor Author

yarn actually allows setting a version for yarn publish
https://yarnpkg.com/lang/en/docs/cli/publish/#toc-yarn-publish-new-version

In case of yarn, we don't have to set the version via package.json

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants