Skip to content

Publish Configuration

Configure NPM publishing.

packageManager

Set the package manager to use for publishing:

ts
import { defineConfig } from 'relizy'

export default defineConfig({
  publish: {
    packageManager: 'pnpm', // 'npm' | 'yarn' | 'pnpm' | 'bun'
  },
})

registry

Use a custom npm registry:

ts
import { defineConfig } from 'relizy'

export default defineConfig({
  publish: {
    registry: 'https://registry.npmjs.org',
  },
})

Registry resolution

When registry is not set, Relizy resolves the effective registry from your environment (npm config get registry), which respects the registry= value in your .npmrc and falls back to https://registry.npmjs.org/.

This means a custom registry (for example a corporate proxy) configured in your .npmrc is honored automatically. Set publish.registry explicitly only when you want to force a specific registry regardless of your .npmrc.

tag

Set npm dist-tag:

ts
import { defineConfig } from 'relizy'

export default defineConfig({
  publish: {
    tag: 'latest', // or 'beta', 'next', etc.
  },
})

access

Set package access level:

ts
import { defineConfig } from 'relizy'

export default defineConfig({
  publish: {
    access: 'public', // or 'restricted'
  },
})

otp

Provide OTP (One-Time Password) for npm publishing with 2FA enabled:

ts
import { defineConfig } from 'relizy'

export default defineConfig({
  publish: {
    otp: '123456',
  },
})

packages

Glob pattern matching for packages to publish (useful for monorepos):

ts
import { defineConfig } from 'relizy'

export default defineConfig({
  publish: {
    packages: ['packages/*'],
  },
})

buildCmd

Command to build your packages before publishing:

ts
import { defineConfig } from 'relizy'

export default defineConfig({
  publish: {
    buildCmd: 'pnpm build',
  },
})

token

NPM token for authentication. Only supported for pnpm and npm:

ts
import { defineConfig } from 'relizy'

export default defineConfig({
  publish: {
    token: process.env.NPM_TOKEN,
  },
})

TIP

You can also configure the token in the tokens.registry field or via environment variables: NPM_TOKEN, RELIZY_NPM_TOKEN, or NODE_AUTH_TOKEN.

safetyCheck

Enable or disable the safety check before publishing. When enabled, Relizy will verify that the required tokens are set.

  • Type: boolean
  • Default: true
ts
import { defineConfig } from 'relizy'

export default defineConfig({
  publish: {
    safetyCheck: true,
  },
})

safetyCheckTimeout

Maximum time, in milliseconds, allowed for the registry authentication safety check (npm/pnpm whoami) before it is aborted. This prevents the release from hanging indefinitely when the registry, or a proxy in front of it, never answers.

  • Type: number
  • Default: 15000
ts
import { defineConfig } from 'relizy'

export default defineConfig({
  publish: {
    safetyCheckTimeout: 15000,
  },
})

TIP

If your registry is behind a slow proxy and you hit timeouts, increase this value. To skip the authentication check entirely, run the command with --no-safety-check.

Complete Example

ts
import { defineConfig } from 'relizy'

export default defineConfig({
  publish: {
    packageManager: 'pnpm',
    registry: 'https://registry.npmjs.org',
    tag: 'latest',
    access: 'public',
    packages: ['packages/*'],
    buildCmd: 'pnpm build',
    token: process.env.NPM_TOKEN,
    safetyCheck: true,
    safetyCheckTimeout: 15000,
  },
})

Released under the MIT License.