Skip to content

npm yarn Publish Guide

Kohhee Peace edited this page May 27, 2022 · 1 revision

How to

1. Git clone master

git clone https://github.com/kohheepeace/mr-pdf.git

2. yarn version

$ yarn version
info Current version: 1.0.9
question New version: 👉 Here type new version...

this yarn version is equivalent with

  1. update package.json version to v1.1.0
  2. Then commit "v1.1.0"
  3. git tag v1.1.0

3. git push

In step 2, we created new commit and tag so push it to Github.

git push
git push --tags

4. yarn build and yarn publish

This will publish your package to npm.

yarn build
yarn publish

But in this repo, we're using prepare scripts not to forget build before publish.

"scripts": {
  "prepare": "tsc"
},

https://docs.npmjs.com/cli/v7/using-npm/scripts#life-cycle-scripts

5. Check npmjs.com

Check new version is correctly published. 👇

https://www.npmjs.com/package/mr-pdf

Refs