Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Version npm package on release #1

Open
shrink opened this issue May 20, 2021 · 0 comments
Open

WIP: Version npm package on release #1

shrink opened this issue May 20, 2021 · 0 comments

Comments

@shrink
Copy link
Member

shrink commented May 20, 2021

npm's package.json requires a version parameter when publishing and so most npm projects include the version number in the project's package.json source code. However, most package managers don't require this and some go as far as to discourage it (see: composer.json) because it creates a relationship between source code and version, which should ideally be owned by the package manager.

A standard package-management workflow is possible using native npm features. The version command will set the version in package.json without committing using the no-git-tag-version argument.

dev:~$ npm --no-git-tag-version version 1.0.0

This composite GitHub action should:

  1. Document why it isn't necessary to include a version in package.json
  2. Fetch the version from the ref using battila7/get-version-action
  3. Run npm's version cli command (without tagging)
  4. Publish (optional, can defer to another action)

The workflow is very simple but uncommon in the npm world (I have not found an example) so the value of this project is more in educating people to this workflow, the functionality is very simple.

@shrink shrink self-assigned this May 20, 2021
@shrink shrink changed the title WIP: Release npm package without explicit version WIP: Version npm package on release May 20, 2021
@shrink shrink removed their assignment Jun 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant