Skip to content

Commit 24ab43f

Browse files
committed
docs(ci): oxfmt CHANGELOG after changeset version
Add root version script (changeset version + format CHANGELOG.md) and wire changesets/action to bun run version. Document in packaging, docs index, and .changeset README.
1 parent 4dd1a78 commit 24ab43f

5 files changed

Lines changed: 13 additions & 8 deletions

File tree

.changeset/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ We have a quick list of common questions to get you started engaging with this p
99

1010
---
1111

12-
**This repo:** How versioning, **`NPM_TOKEN`**, and the GitHub workflow fit together for **`@stainless-code/codemap`** — see [docs/packaging.md § Releases](../docs/packaging.md#releases) (single place; don’t duplicate here).
12+
**This repo:** How versioning, **`NPM_TOKEN`**, **`bun run version`** (includes **oxfmt** after **`changeset version`**), and the GitHub workflow fit together — see [docs/packaging.md § Releases](../docs/packaging.md#releases) (single place; don’t duplicate here).

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ jobs:
4040
id: changesets
4141
uses: changesets/action@v1
4242
with:
43+
# Runs `changeset version` then oxfmt on CHANGELOG.md so `format:check` passes (see docs/packaging.md).
44+
version: bun run version
4345
publish: bun run release
4446
title: "chore: version packages"
4547
commit: "chore: version packages"

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Technical docs for **[@stainless-code/codemap](https://github.com/stainless-code
1414
| [fixtures/golden/](../fixtures/golden/) | [scenarios.json](../fixtures/golden/scenarios.json) + [minimal/](../fixtures/golden/minimal/)**`bun run test:golden`**; Tier B: [scenarios.external.example.json](../fixtures/golden/scenarios.external.example.json) + **`bun run test:golden:external`** ([benchmark § Fixtures](./benchmark.md#fixtures)) |
1515
| [fixtures/benchmark/](../fixtures/benchmark/) | Tracked [scenarios.example.json](../fixtures/benchmark/scenarios.example.json) — copy to `*.local.json` (gitignored) for [`CODEMAP_BENCHMARK_CONFIG`](./benchmark.md#custom-scenarios-codemap_benchmark_config) |
1616
| [fixtures/qa/](../fixtures/qa/) | [prompts.external.template.md](../fixtures/qa/prompts.external.template.md) — optional chat QA prompts for an external index (`*.local.md` gitignored) |
17-
| [packaging.md](./packaging.md) | **`CHANGELOG.md` / `dist/` / `templates/`** on npm, **engines**, [**Node vs Bun**](./packaging.md#node-vs-bun), [**Releases**](./packaging.md#releases) (Changesets) |
17+
| [packaging.md](./packaging.md) | **`CHANGELOG.md` / `dist/` / `templates/`** on npm, **engines**, [**Node vs Bun**](./packaging.md#node-vs-bun), [**Releases**](./packaging.md#releases) (Changesets; **`bun run version`** + oxfmt **`CHANGELOG.md`**) |
1818
| [roadmap.md](./roadmap.md) | Forward-looking backlog (not a `src/` inventory) |
1919

2020
## Single source of truth (do not duplicate)

docs/packaging.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,16 @@ Same schema and CLI; implementation differs by runtime. Details: [architecture.m
3232

3333
Releases use [**Changesets**](https://github.com/changesets/changesets). Repo config: [`.changeset/config.json`](../.changeset/config.json) (`$schema` targets **`@changesets/config`** — resolved version in **`bun.lock`**). Upstream CLI docs: [`.changeset/README.md`](../.changeset/README.md).
3434

35-
| Step | What happens |
36-
| ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
37-
| 1 | **`bun run changeset`** — add a changeset file under **`.changeset/`**, commit, open PR to **`main`**. |
38-
| 2 | **Merge** — on every push to **`main`**, [`.github/workflows/release.yml`](../.github/workflows/release.yml) runs [`changesets/action@v1`](https://github.com/changesets/action): opens/updates the **Version packages** PR when pending changesets exist; **`publish: bun run release`** runs **`changeset publish`**; **`createGithubReleases: true`**. |
39-
| 3 | **Secrets****`GITHUB_TOKEN`** is provided by Actions. **`NPM_TOKEN`** (npm [automation token](https://docs.npmjs.com/creating-and-viewing-access-tokens)) must be a **repository secret** for publishes to npm. If the Release job fails, use the workflow log (missing token, registry error, etc.) — don’t assume the cause from the job name alone. |
35+
| Step | What happens |
36+
| ---- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
37+
| 1 | **`bun run changeset`** — add a changeset file under **`.changeset/`**, commit, open PR to **`main`**. |
38+
| 2 | **Merge** — on every push to **`main`**, [`.github/workflows/release.yml`](../.github/workflows/release.yml) runs [`changesets/action@v1`](https://github.com/changesets/action): opens/updates the **Version packages** PR when pending changesets exist; **`version: bun run version`** runs **`changeset version`** then **`oxfmt`** on **`CHANGELOG.md`** so formatting matches **`bun run format:check`**; **`publish: bun run release`** runs **`changeset publish`**; **`createGithubReleases: true`**. |
39+
| 3 | **Secrets****`GITHUB_TOKEN`** is provided by Actions. **`NPM_TOKEN`** (npm [automation token](https://docs.npmjs.com/creating-and-viewing-access-tokens)) must be a **repository secret** for publishes to npm. If the Release job fails, use the workflow log (missing token, registry error, etc.) — don’t assume the cause from the job name alone. |
4040

4141
**Before tagging / publishing:** run **`bun run check`** on the branch that will ship. Pending **`.changeset/*.md`** files are turned into **`CHANGELOG.md`** entries and a version bump by the **Version packages** PR (do not hand-edit **`package.json`** version for Changesets-driven releases). Merge that PR to **`main`** to run **`changeset publish`** via the workflow.
4242

43+
**Formatting:** **`@changesets/changelog-github`** output does not match **oxfmt**’s Markdown rules. The root **`version`** script in **`package.json`** runs **`changeset version`** then **`bun run format CHANGELOG.md`**. Use **`bun run version`** locally instead of **`changeset version`** alone so CI and your machine stay aligned.
44+
4345
## Related
4446

4547
- [architecture.md](./architecture.md) — schema, layering, API, user config.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@
6767
"test:coverage": "bun test --coverage",
6868
"test:golden": "bun scripts/query-golden.ts",
6969
"test:golden:external": "bun scripts/query-golden.ts --corpus external",
70-
"typecheck": "tsgo --noEmit"
70+
"typecheck": "tsgo --noEmit",
71+
"version": "changeset version && bun run format CHANGELOG.md"
7172
},
7273
"dependencies": {
7374
"@clack/prompts": "^1.2.0",

0 commit comments

Comments
 (0)