NPM Best Practice
Create a new Pull Request (PR)
Generally, you want to create a new branch before adding code to the repo. Before creating a new branch, make sure that the origin branch is up-to-date.
Update origin branch
-
git fetch
-
git pull
Create new branch
git checkout -b new_branch_name
Push changes to the origin branch
Notice: the message you add to your commit can contain keywords like 'close', 'fix', 'resolve'...
-
git add .
-
git commit -am "...message..."
-
git push -u origin new_branch_name
Switch to origin branch and delete local branch
-
git checkout dev
-
git branch -d new_branch_name
Publish the changes to NPM
When publishing the new version to NPM:
-
Change version inside package.json (depending on the change, minor or breaking change)
-
Login to npm with proper credentials:
npm login
-
Publish the new pakcage to npm:
npm publish