pnpm publish
레지스트리에 패키지를 게시합니다.
pnpm [-r] publish [<tarball|folder>] [--tag <tag>]
[--access <public|restricted>] [options]
워크스페이스 내부에 패키지를 게시할 때, 워크스페이스 루트의 LICENSE 파일은 패키지와 함께 포장됩니다(패키지 에 자체 라이선스가 있는 경우 제외).
게시하기 전에 package.json
의 publishConfig 필드를 사용하여 일부 필드를 재정의할 수 있습니다. 또한 publishConfig.directory
을 사용하여 게시된 하위 디렉터리를 커스터마이즈 할 수 있습니다(일반적으로 타사 빌드 도구 사용).
이 명령을 재귀적으로 실행할 때 (pnpm -r publish
), pnpm은 버전이 아직 레지스트리에 게시되지 않은 패키지 를 모두 게시합니다.
옵션
--recursive, -r
Publish all packages from the workspace.
--json
JSON 형식으로 정보를 표시합니다.
--tag <tag>
Publishes the package with the given tag. By default, pnpm publish
updates the latest
tag.
For example:
# foo 패키지 디렉토리 내부
pnpm publish --tag next
# foo의 다음 버전을 사용하려는 프로젝트에서
pnpm add foo@next
--access <public|restricted>
Tells the registry whether the published package should be public or restricted.
--no-git-checks
Don't check if current branch is your publish branch, clean, and up-to-date with remote.
--publish-branch
- 기본값: master 및 main
- 유형: String
최신 변경 사항을 게시하는 데 사용되는 저장소의 기본 브랜치입니다.
--force
현재 버전이 이미 레지스트리에 있는 경우에도 패키지를 게시하려고 합니다.
--report-summary
게시된 패키지 목록을 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
Does everything a publish would do except actually publishing to the registry.
--otp
When publishing packages that require two-factor authentication, this option can specify a one-time password.
--filter <package_selector>
환경설정
You can also set git-checks
, publish-branch
options in the .npmrc
file.
For example:
git-checks=false
publish-branch=production
Life Cycle Scripts
prepublishOnly
prepublish
prepack
prepare
postpack
publish
postpublish