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 version, updates the `package.json`s and the `CHANGELOG.md`s, and
deletes the files.

Expand Down Expand Up @@ -40,7 +40,7 @@ contradict each other, like a `datocms-react-ui@2.2.8` that requires

## 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 `2.3.0`)
Expand All @@ -53,5 +53,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.
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Use it instead of `npm link` (a symlinked React library breaks with duplicate-Re
## Gotchas

- Every user-visible change needs a changeset (`npx changeset`) in the same PR, or it ships with no release note. `patch` is for bug fixes only; new API surface is `minor`.
- Releasing (maintainers only): `npm run publish` from the root, on a clean `master`. It builds and tests, applies the pending changesets, publishes to npm, then tags, pushes, and opens the GitHub releases. An interrupted release is resumed by re-running it, never undone. See `toolchain/publish.mjs`.
- Releasing (maintainers only): `npm run release` from the root, on a clean `master`. It builds and tests, applies the pending changesets, publishes to npm, then tags, pushes, and opens the GitHub releases. An interrupted release is resumed by re-running it, never undone. The script is [`@datocms/release-toolchain`](https://github.com/datocms/release-toolchain), shared by every DatoCMS repository and pinned here by git tag.
- One `name@X.Y.Z` tag and one GitHub release **per package**. `changeset publish` does the publishing and the tagging itself, in that order and only for the packages npm accepted, so a tag can't outlive a failed publish. What is being released comes from `changeset publish-plan --output`, not from anything the script reconstructs. Each release's body is that package's own `CHANGELOG.md` section — when a package moved only because the other one did, that section is just its dependency bump, which is the honest thing to show. Releases up to v2.2.7 used a single `vX.Y.Z` tag instead; those tags stay where they are.

## More detail
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,24 @@ released together.
patch/minor/major, then writes a small markdown file under `.changeset/`
which you commit. `patch` is for bug fixes only; new API surface is
`minor`. See [`.changeset/README.md`](.changeset/README.md).
2. **Release.** From an up-to-date, clean `master`, run `npm run publish`.
2. **Release.** From an up-to-date, clean `master`, run `npm run release`.
It builds and tests first, then applies the pending changesets (bumping the
versions and writing the `CHANGELOG.md`s), publishes to npm, and only then
tags each package `name@X.Y.Z`, pushes, and publishes one GitHub release per
tag — its notes are the changelog entries changesets just wrote.

If a release is interrupted, **do not undo anything**: run `npm run publish`
If a release is interrupted, **do not undo anything**: run `npm run release`
again. It detects that some package is still missing from the registry and
resumes the publish instead of starting a new release.

`npm run publish-next` does the same under the `next` dist-tag, leaving
`npm run release:next` does the same under the `next` dist-tag, leaving
`latest` untouched; its GitHub releases are marked as prereleases, so they don't
become the repository's "Latest release" either.

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

## License

This repository is published under the [MIT](LICENSE.md) license.
Expand Down
28 changes: 27 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 @@ -7,7 +7,7 @@
"devDependencies": {
"@biomejs/biome": "1.6.4",
"@changesets/cli": "^3.0.1",
"@manypkg/get-packages": "^3.1.0",
"@datocms/release-toolchain": "github:datocms/release-toolchain#v1.2.0",
"@types/jest": "^29.2.1",
"@typescript-eslint/eslint-plugin": "^5.42.0",
"@typescript-eslint/parser": "^5.42.0",
Expand All @@ -28,8 +28,8 @@
"build": "turbo run build",
"lint": "biome ci packages",
"changeset": "changeset",
"publish": "node toolchain/publish.mjs",
"publish-next": "node toolchain/publish.mjs --tag next",
"release": "release-toolchain",
"release:next": "release-toolchain --tag next",
"format": "biome check toolchain packages --apply && biome format --write toolchain packages",
"prepare": "husky"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/react-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ rm -rf node_modules/datocms-react-ui node_modules/.vite && npm install

Every user-visible change needs a changeset: run `npx changeset` from the repo root in the same PR, pick the bump level (`patch` is for bug fixes only, new API surface is `minor`) and commit the file it writes under `.changeset/`.

To release, from an up-to-date, clean `master`, run `npm run publish` from the repo root. It builds and tests, applies the pending changesets — bumping whichever packages changed, and writing their `CHANGELOG.md`s — publishes to npm, and only then tags each package `name@X.Y.Z`, pushes, and publishes 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.
To release, from an up-to-date, clean `master`, run `npm run release` from the repo root. It builds and tests, applies the pending changesets — bumping whichever packages changed, and writing their `CHANGELOG.md`s — publishes to npm, and only then tags each package `name@X.Y.Z`, pushes, and publishes 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 release:next` for a prerelease under the `next` dist-tag.

For deeper architectural notes (CSS Modules pipeline, dual CJS/ESM output, theming via `ctx`), see [`AGENTS.md`](https://github.com/datocms/plugins-sdk/blob/master/packages/react-ui/AGENTS.md) in this directory.
2 changes: 1 addition & 1 deletion packages/sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ rm -rf node_modules/datocms-plugin-sdk node_modules/.vite && npm install

Every user-visible change needs a changeset: run `npx changeset` from the repo root in the same PR, pick the bump level (`patch` is for bug fixes only, new API surface is `minor`) and commit the file it writes under `.changeset/`.

To release, from an up-to-date, clean `master`, run `npm run publish` from the repo root. It builds and tests, applies the pending changesets — bumping whichever packages changed, and writing their `CHANGELOG.md`s — publishes to npm, and only then tags each package `name@X.Y.Z`, pushes, and publishes 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.
To release, from an up-to-date, clean `master`, run `npm run release` from the repo root. It builds and tests, applies the pending changesets — bumping whichever packages changed, and writing their `CHANGELOG.md`s — publishes to npm, and only then tags each package `name@X.Y.Z`, pushes, and publishes 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 release:next` for a prerelease under the `next` dist-tag.
8 changes: 0 additions & 8 deletions toolchain/README.md

This file was deleted.

Loading
Loading