0
0

More than 3 years have passed since last update.

npmパッケージを公開するならnpが便利!

Posted at

よくある困りごと

npmパッケージを公開・更新する場合、手順を忘れがちですよね(少なくとも私はそうです)。
これから紹介するnpコマンドを使えば、楽にnpmパッケージの公開、更新、さらにはGitHubのtagまで切ってくれる。最高です。

npコマンドの導入

yarn global add np

npを実行すると、バージョンの選択画面が表示され、major, minor, patchのアップデートかどうかの選択肢が出る。

patchを選択した場合
$ np
Publish a new version of パッケージ名 (current: 1.0.3)

Commits:
- コミット内容

Commit Range:
v1.0.3...master

? Select semver increment or specify new version patch  1.0.4

  ✔ Prerequisite check
  ✔ Git
  ↓ Cleanup [skipped]
  ✔ Installing dependencies using Yarn
  ✔ Running tests using Yarn
  ✔ Bumping version using Yarn
  ✔ Publishing package using Yarn
  ↓ Pushing tags [skipped]
    → Upstream branch not found; not pushing.
  ✔ Creating release draft on GitHub

 パッケージ名 1.0.4 published 🎉

参照

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0