Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .changeset/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Whenever you change something worth mentioning in a release, run `npx changeset`
and answer the two prompts (which packages, and whether it's a patch/minor/major).
That writes a small markdown file here, which you commit along with your changes.

At release time `npm run publish` consumes every pending file: it computes the
At release time `npm run release` consumes every pending file: it computes the
resulting versions, updates the `package.json`s and the `CHANGELOG.md`s, and
deletes the files.

Expand Down Expand Up @@ -39,7 +39,7 @@ though the version numbers will no longer move in lockstep to say so.

## Prereleases

`npm run publish-next` publishes under the `next` dist-tag, leaving `latest`
`npm run release:next` publishes under the `next` dist-tag, leaving `latest`
untouched. It works in two modes:

- **as-is** — the pending changesets produce a normal version (say `6.1.0`)
Expand All @@ -52,5 +52,5 @@ untouched. It works in two modes:
Either way the GitHub release is marked as a prerelease, so it never becomes
the repository's "Latest release".

`npm run publish` refuses to run while `.changeset/pre.json` exists, so a
`npm run release` refuses to run while `.changeset/pre.json` exists, so a
forgotten pre mode can't quietly turn a real release into a prerelease.
6 changes: 3 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ npx changeset # Pick the changed packages and the bump level
The ten packages version **independently**: a changeset bumps exactly the packages it names, plus any dependent whose declared range the new version falls outside. So the package list inside a changeset carries real weight. `patch` is for bug fixes only; new API surface is `minor`. See `.changeset/README.md`.

```bash
npm run publish # Build, test, version, publish to npm, tag, release notes
npm run publish-next # The same, under the 'next' dist-tag
npm run release # Build, test, version, publish to npm, tag, release notes
npm run release:next # The same, under the 'next' dist-tag
```

`toolchain/publish.mjs` implements it. The ordering is the point: everything fallible runs before anything irreversible, and npm is published before git is tagged, so a tag can never point at a version nobody can install. There is no rollback — every step is idempotent, so an interrupted release is resumed by re-running it. Tags are per package (`datocms-structured-text-utils@6.1.0`); the historical `vX.Y.Z` tags stay where they are.
[`@datocms/release-toolchain`](https://github.com/datocms/release-toolchain) implements it — one script shared by every DatoCMS repository, pinned here by git tag and never published to npm. The ordering is the point: everything fallible runs before anything irreversible, and npm is published before git is tagged, so a tag can never point at a version nobody can install. There is no rollback — every step is idempotent, so an interrupted release is resumed by re-running it. Tags are per package (`datocms-structured-text-utils@6.1.0`); the historical `vX.Y.Z` tags stay where they are.

## Architecture

Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,17 @@ writes under `.changeset/`. See [`.changeset/README.md`](.changeset/README.md)
for the details — in particular, the packages version **independently**, so
which ones you list matters.

To release, from an up-to-date, clean `main`, run `npm run publish` from the
To release, from an up-to-date, clean `main`, run `npm run release` from the
repo root. It builds and tests, applies the pending changesets — bumping only
the packages that changed and writing their `CHANGELOG.md`s — publishes to npm,
and only then tags each published package `name@X.Y.Z`, pushes, and creates a
GitHub release per tag whose notes come straight from those changelog entries.
An interrupted release is resumed by re-running it, never undone. Use
`npm run publish-next` for a prerelease under the `next` dist-tag.
`npm run release:next` for a prerelease under the `next` dist-tag.

The script itself lives in
[`@datocms/release-toolchain`](https://github.com/datocms/release-toolchain),
shared with every other DatoCMS repository and pinned here by tag.

## License

Expand Down
20 changes: 19 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
],
"devDependencies": {
"@changesets/cli": "^3.0.1",
"@manypkg/get-packages": "^3.1.0",
"@datocms/release-toolchain": "github:datocms/release-toolchain#v1.2.0",
"@types/jest": "^29.5.12",
"@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^8.0.0",
Expand All @@ -31,8 +31,8 @@
"test": "npm run lint && cross-env NODE_OPTIONS=--experimental-vm-modules jest",
"build": "turbo run build",
"changeset": "changeset",
"publish": "node toolchain/publish.mjs",
"publish-next": "node toolchain/publish.mjs --tag next",
"release": "release-toolchain",
"release:next": "release-toolchain --tag next",
"lint": "eslint . --ext .ts,.tsx",
"prettier": "prettier --write \"**/*.{ts,tsx,js,mjs,json,md,yml}\"",
"prettier:check": "prettier --check \"**/*.{ts,tsx,js,mjs,json,md,yml}\"",
Expand Down
8 changes: 0 additions & 8 deletions toolchain/README.md

This file was deleted.

276 changes: 0 additions & 276 deletions toolchain/publish.mjs

This file was deleted.

Loading