# @vitejs/release-scripts

> @vitejs release scripts

Latest version **1.10.0** (published 2026-08-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install @vitejs/release-scripts
pnpm add @vitejs/release-scripts
yarn add @vitejs/release-scripts
bun add @vitejs/release-scripts
```

## Health

**Score 65/100 (B)** — status: active.

Positive: esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 1.10.0 |
| Published | 2026-08-28 |
| First published | 2023-01-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 9 |
| Unpacked size | 20 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 60 |
| Maintainers | yyx990803, vitebot |

## Links

- npm: https://www.npmjs.com/package/@vitejs/release-scripts
- Repository: https://github.com/vitejs/release-scripts
- Homepage: https://github.com/vitejs/release-scripts#readme
- Issues: https://github.com/vitejs/release-scripts/issues
- npm.io page: https://npm.io/package/@vitejs/release-scripts

## Dependencies (9)

- [mri](https://npm.io/package/mri.md) ^1.2.0
- [semver](https://npm.io/package/semver.md) ^7.8.5
- [prompts](https://npm.io/package/prompts.md) ^2.4.2
- [publint](https://npm.io/package/publint.md) ^0.3.24
- [tinyexec](https://npm.io/package/tinyexec.md) ^1.3.0
- [picocolors](https://npm.io/package/picocolors.md) ^1.1.1
- [conventional-changelog](https://npm.io/package/conventional-changelog.md) ^8.1.3
- [@conventional-changelog/template](https://npm.io/package/@conventional-changelog/template.md) ^1.4.0
- [conventional-changelog-conventionalcommits](https://npm.io/package/conventional-changelog-conventionalcommits.md) ^10.4.0

## Recent versions

- 1.10.0 (latest) — 2026-08-28
- 1.9.2 — 2026-08-20
- 1.9.1 — 2026-08-06
- 1.9.0 — 2026-08-06
- 1.8.0 — 2026-07-08
- 1.7.1 — 2026-05-11
- 1.7.0 — 2026-04-24
- 1.6.0 — 2025-07-03
- 1.5.0 — 2025-04-10
- 1.4.0 — 2025-03-26
- 1.3.3 — 2025-01-14
- 1.3.2 — 2024-07-30
- 1.3.1 — 2023-09-18
- 1.3.0 — 2023-09-04
- 1.2.1 — 2023-07-16
- … 3 more at https://npm.io/package/@vitejs/release-scripts/versions

## README

# @vitejs/release-scripts

This repo is used to share release & publish scripts for the org. Scripts should be executed from the workspace root via `node scripts/release.ts`

## prepareRelease

`prepareRelease` updates a package manifest without committing, tagging, or pushing. This is intended for release-PR workflows.

```ts
import { generateChangelog, prepareRelease } from "@vitejs/release-scripts";

await prepareRelease({
  pkg: "my-package",
  release: process.env.RELEASE ?? "next",
  generateChangelog: async (pkg) => {
    await generateChangelog({
      getPkgDir: () => `packages/${pkg}`,
      tagPrefix: `${pkg}@`,
    });
  },
});
```

`prepareRelease` returns the package, previous and next versions, and release tag. Pass `toTag`
when a repository does not use the default `<package>@<version>` convention.

## detectReleaseCommit

```ts
import { detectReleaseCommit } from "@vitejs/release-scripts";

const release = detectReleaseCommit({
  subject: "release: v1.2.3 (#42)",
  packages: ["vite", "create-vite"],
  defaultPackage: "vite",
});
```

Use `extractChangelogEntry({ changelogPath, version })` to obtain the Markdown body for a GitHub release or release PR.

## release

```ts
import { release } from "@vitejs/release-scripts";

release({
  // Name of the repo for CI link
  repo: "release-scripts",
  // List of options. Choice will be available in following callback as `pkg`
  packages: ["release-scripts"],
  toTag: (pkg, version) => (pkg === "vite" ? `v${version}` : `${pkg}@${version}`),
  // Not shared until we find a new changelog process
  logChangelog: (pkg) =>
    console.log(execSync("git log $(git describe --tags --abbrev=0)..HEAD --oneline").toString()),
  generateChangelog: (pkg, version) => {},
  // Use getPkgDir when not using a monorepo. Default to `packages/${pkg}`
  getPkgDir: (pkg) => ".",
});
```

## publish

```ts
import { publish } from "@vitejs/release-scripts";

publish({
  // Used when tag is not `pkg@version`
  defaultPackage: "release-scripts",
  // Use getPkgDir when not in a monorepo. Default to `packages/${pkg}`
  getPkgDir: (pkg) => ".",
  // Publish with provenance https://docs.npmjs.com/generating-provenance-statements
  provenance: true,
  // Package manager that runs the publish command
  packageManager: "pnpm",
});
```

---
_Source: https://npm.io/package/@vitejs/release-scripts · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
