@hyperfrontend/workspace/executors/publishpublish
Publishes a library's build output to the npm registry, and skips a version the registry already has, so the same task can run again after a partial release.
{
"publish": {
"executor": "@hyperfrontend/workspace:publish",
"dependsOn": ["build"]
}
}
| Option | What it does |
|---|---|
--dryRun | Shows what would be published and uploads nothing |
--registry | The registry; defaults to the one npm is configured with |
--tag | The dist-tag; defaults to latest |
--access | The access of a scoped package; defaults to public |
--otp | A one-time password for two-factor publishing |
--provenance | Attaches the provenance statement npm signs with the CI identity token |
The token comes from NPM_TOKEN in the environment.
npx hf run my-utils:publish --dryRunAPI Reference§
ƒ Functions
§functionpublishExecutor(
publishExecutor( options: PublishExecutorOptions, context: ExecutorContext): Promise< ExecutorResult>
Publish executor for the libraries of a workspace.
Publishes a library's build output, wherever its
Publishes a library's build output, wherever its
build target writes it, to the npm registry with support for: - Dry-run mode to preview what would be published
- Custom registry URL
- NPM dist-tags
- Scope access control
- 2FA OTP support
Parameters
| Name | Type | Description |
|---|---|---|
§options | PublishExecutorOptions | Options for the publish executor |
§context | ExecutorContext | The workspace, the project and the target the task runs on |
Returns
Promise< ExecutorResult>Success status
Example
A `publish` target run after the build
{
"targets": {
"publish": {
"executor": "@hyperfrontend/workspace:publish",
"dependsOn": ["build"],
"options": { "access": "public", "tag": "latest", "provenance": true }
}
}
}
```
`npx hf run lib-core:publish --dryRun` previews the npm command; a version the registry already has is skipped with success.◈ Interfaces
Options for the publish executor.