pnpm publish
Pubblica un pacchetto nel registro.
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.
Opzioni
--recursive, -r
Pubblica tutti i pacchetti dall'area di lavoro.
--json
Show information in JSON format.
--tag <tag>
Pubblica il pacchetto con il tag specificato. By default, pnpm publish updates
the latest tag.
Ad esempio:
# nella cartella del pacchetto foo
pnpm publish --tag next
# in un progetto dove vuoi usare la prossima versione di foo
pnpm add foo@next
--access <public|restricted>
Indica al registro se il pacchetto pubblicato deve essere pubblico o limitato.
--no-git-checks
Non controllare se il ramo corrente è il tuo ramo di pubblicazione, pulito e aggiornato con il remoto.
--publish-branch <branch>
- Default: master and main
- Types: String
Il ramo principale del repository utilizzato per pubblicare le ultime modifiche.
--force
Prova a pubblicare i pacchetti anche se la loro versione attuale è già presente nel registro.
--report-summary
Save the list of published packages to pnpm-publish-summary.json. Utile quando vengono utilizzati altri strumenti per segnalare l'elenco dei pacchetti pubblicati.
An example of a pnpm-publish-summary.json file:
{
"publishedPackages": [
{
"name": "foo",
"version": "1.0.0"
},
{
"name": "bar",
"version": "2.0.0"
}
]
}
--dry-run
Fa tutto ciò che farebbe una pubblicazione tranne la pubblicazione nel registro.
--otp
Quando si pubblicano pacchetti che richiedono l'autenticazione a due fattori, questa opzione può specificare una password monouso.
--filter <package_selector>
Configurazione
You can also set git-checks, publish-branch options in the .npmrc file.
Ad esempio:
git-checks=false
publish-branch=production
Life Cycle Scripts
prepublishOnlyprepublishprepackpreparepostpackpublishpostpublish