pnpm publish
npm レジストリにパッケージを公開します。
pnpm [-r] publish [<tarball|folder>] [--tag <tag>]
[--access <public|restricted>] [options]
When publishing a package inside a workspace, the LICENSE file from the root of the workspace is packed with the package (unless the package has a license of its own).
You may override some fields before publish, using the
publishConfig field in package.json.
You also can use the publishConfig.directory to customize the published subdirectory (usually using third party build tools).
When running this command recursively (pnpm -r publish), pnpm will publish all
the packages that have versions not yet published to the registry.
Options
--recursive, -r
ワークスペースの全てのパッケージを公開します。
--json
Show information in JSON format.
--tag <tag>
指定したタグでパッケージを公開します。 By default, pnpm publish updates
the latest tag.
例:
# inside the foo package directory
pnpm publish --tag next
# in a project where you want to use the next version of foo
pnpm add foo@next
--access <public|restricted>
公開したパッケージを公開アクセス可能にするべきか、制限するべきかをレジストリに通知します。
--no-git-checks
現在のブランチがあなたの公開ブランチであるか、クリーンであるか、リモートの最新版であるかはチェックしません。
--publish-branch <branch>
- Default: master and main
- Types: String
最新の変更を公開するために使用する、リポジトリの基本ブランチ名を指定します。
--force
現在のバージョンがすでにレジストリに公開済みでも、パッケージの公開を試みます。
--report-summary
Save the list of published packages to pnpm-publish-summary.json. なんらかの仕組みで公開済みパッケージの一覧を報告するときに便利です。
An example of a pnpm-publish-summary.json file:
{
"publishedPackages": [
{
"name": "foo",
"version": "1.0.0"
},
{
"name": "bar",
"version": "2.0.0"
}
]
}
--dry-run
publish の機能をすべて実行しますが、レジストリに実際に公開は行いません。
--otp
2要素認証が必要なパッケージを公開する場合、このオプションでワンタイムパスワードを指定することができます。
--filter <package_selector>
設定
You can also set git-checks, publish-branch options in the .npmrc file.
例:
git-checks=false
publish-branch=production
ライフサイクルスクリプト
prepublishOnlyprepublishprepackpreparepostpackpublishpostpublish