Skip to content

Commit 92815ae

Browse files
committed
docs: releasing flow + monorepo split rationale
1 parent ecaea3c commit 92815ae

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ When changing Masker behavior, prefer adding a shared fixture (so both ports sta
7979

8080
Update the relevant package README whenever the public API or config changes, or when documentation becomes ambiguous or untrue.
8181

82+
## Releasing
83+
84+
See the [Releasing section in the root README](README.md#releasing) for the per-package recipes. Two non-obvious things:
85+
86+
- `npm version` in `packages/js/` only bumps files in a monorepo — it doesn't auto-commit/tag. The README recipe handles this explicitly.
87+
- The PHP package publishes via a read-only mirror at `gabepri/auto-html-i18n-php` because Packagist requires `composer.json` at the repo root. The mirror is auto-rebuilt by [.github/workflows/split-php.yml](.github/workflows/split-php.yml) using an SSH deploy key (secret name `PHP_SPLIT_DEPLOY_KEY`). Never push to the mirror directly — always edit `packages/php/` here.
88+
8289
## Git Conventions
8390

8491
- Keep commit messages very short (under 100 chars preferred)

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,38 @@ packages/
2020
fixtures/ Shared JSON test cases (Masker behavior parity)
2121
```
2222

23+
This monorepo is the source of truth for both packages. There's also a read-only mirror at [`gabepri/auto-html-i18n-php`](https://github.com/gabepri/auto-html-i18n-php) that contains only `packages/php/` at the repo root — it exists because Packagist requires `composer.json` at the root of a repo and doesn't support monorepo subdirectories. The mirror is auto-rebuilt on every push to `main` and on every `v*` tag by [.github/workflows/split-php.yml](.github/workflows/split-php.yml). **Don't push to the mirror directly** — it'll be overwritten on the next split.
24+
25+
## Releasing
26+
27+
Each package versions independently.
28+
29+
### JS (npm)
30+
31+
```bash
32+
cd packages/js
33+
npm version <patch|minor|major> # bumps package.json + package-lock.json
34+
cd ../..
35+
VER=$(node -p "require('./packages/js/package.json').version")
36+
git add packages/js/package.json packages/js/package-lock.json
37+
git commit -m "$VER"
38+
git tag "v$VER"
39+
git push origin main "v$VER"
40+
gh release create "v$VER" --generate-notes
41+
```
42+
43+
In a monorepo, `npm version` only bumps the file — it doesn't auto-commit/tag, so the steps above do that explicitly. The release-creation event triggers [.github/workflows/publish.yml](.github/workflows/publish.yml), which publishes to npm via OIDC trusted publishing (no token in repo). First-time publishing of a new package name requires `--access public` in the workflow and a trusted-publisher entry on npmjs.com.
44+
45+
### PHP (Composer / Packagist)
46+
47+
```bash
48+
git tag v1.0.1 && git push origin v1.0.1
49+
```
50+
51+
That's it. The split workflow mirrors `packages/php/` to `auto-html-i18n-php` with the new tag, and Packagist's webhook on the mirror auto-syncs within a minute.
52+
53+
The split uses an SSH deploy key — public key on the mirror repo, private key as the `PHP_SPLIT_DEPLOY_KEY` secret on this repo. Rotate by regenerating the keypair (`ssh-keygen -t ed25519`) and updating both sides.
54+
2355
## License
2456

2557
MIT — see [LICENSE](LICENSE).

0 commit comments

Comments
 (0)