Publishers
Publisher plugins run after git push during the version command. Use them to publish your package to a registry or any other distribution channel.
Built-in Publishers
| Plugin | Description |
|---|---|
createNpmPublisher | Publish to the npm registry |
Custom Publishers
You can write your own publisher by implementing the PublisherPlugin type:
import type { PublisherPlugin } from "cngpac";
const myPublisher: PublisherPlugin = async ({ pkgJsonPath, versionBump }) => {
// ...publish logic...
};
A publisher receives:
| Property | Type | Description |
|---|---|---|
pkgJsonPath | PkgFileAbsPath | Absolute path to package.json |
versionBump | VersionBump | Version bump information |
Register it in your config:
export default defineConfig({
// ...
publishers: [myPublisher],
});