MAINTAINING.md
This file
Path
docs/MAINTAINING.md
73 lines · 3.5 KiB · Markdown
Last changed by
ci: write the tag version into deno.json before publishing to JSR (#5469)Yusuke Wadabefore adoption271dd0b
History of this fileTake it
feat(adapters): add @hono/bun as a workspace package (#5447)Yusuke Wadabefore adoptionfc2343d
lines 1–15why, one step back1# Maintaining23Notes for maintainers of this repository.45## Adapters67Runtime adapters live in `adapters/*` and are published as separate packages (`@hono/bun`, ...). Each directory is a pnpm workspace package. The root package is `hono` itself.89### Layout1011```12adapters/bun/13 src/ # imports hono via `hono`, `hono/ws`, ... (workspace link)14 src/*.test.ts # runs with `bun test`15 package.json # peerDependencies: hono >=x.y.zchore(adapters/bun): ship ESM only (#5462)Yusuke Wadabefore adoption4d9f2a2
line 16why, one step back16 vite.config.ts # `vp pack` config (ESM only)feat(adapters): add @hono/bun as a workspace package (#5447)Yusuke Wadabefore adoptionfc2343d
lines 17–46why, one step back17```1819### Commands2021From the repository root:2223```sh24pnpm run build:adapters # build every adapter25pnpm run test:adapters # tsc + bun test for every adapter26pnpm --filter @hono/bun run test27```2829CI runs `ci-adapters.yml` for changes under `adapters/**` (and `src/**`, since adapters depend on `hono`). The main `ci.yml` skips changes that only touch `adapters/**`.3031### Versioning3233- Adapter versions are independent from `hono`. Do not bump them when `hono` is released.34- Compatibility is expressed by `peerDependencies.hono` in each adapter. Raise the lower bound when an adapter starts using something newer.35- Git tags are `@hono/<name>@<version>`. Only `hono` uses `v<version>`.3637### Releasing3839```sh40pnpm run release:adapter bun patch # or minor, major, or an exact x.y.z41```4243This bumps `adapters/bun/package.json`, commits, creates an annotated tag `@hono/bun@<version>` and pushes. The `release.yml` workflow then packs the adapter and runs `npm stage publish`. Approve the staged version on npm (2FA) to make it public.4445At the end the script prints a release-note draft built from the commits that touched `adapters/bun` since the previous adapter tag, plus a prefilled GitHub "new release" link. Creating a GitHub Release is optional.46feat(adapters/deno): publish to JSR (#5465)Yusuke Wadabefore adoption1c6e060
lines 47–48why, one step back47### JSR48feat(adapters/netlify): publish to JSR (#5468)Yusuke Wadabefore adoption72f0d8d
line 49why, one step back49`@hono/deno` and `@hono/netlify` are also published to JSR. Each has a `deno.json` that is the JSR package config: its `imports`feat(adapters/deno): publish to JSR (#5465)Yusuke Wadabefore adoption1c6e060
line 50why, one step back50map `hono` to `jsr:@hono/hono`, and its `version` stays `0.0.0` like the root `jsr.json`.ci: write the tag version into deno.json before publishing to JSR (#5469)Yusuke Wadabefore adoption271dd0b
line 51why, one step back51The `release.yml` workflow writes the version from the tag into `deno.json` and runs `deno publish` when the tagged adapter has a `deno.json`.feat(adapters/deno): publish to JSR (#5465)Yusuke Wadabefore adoption1c6e060
line 52why, one step back52Before the first release, create the package on jsr.io under the `@hono` scope and link the `honojs/hono`ci: write the tag version into deno.json before publishing to JSR (#5469)Yusuke Wadabefore adoption271dd0b
line 53why, one step back53repository so the workflow can publish with OIDC. `deno publish --dry-run --set-version 0.0.1` in the adapter directory checks the package locally (`--set-version` is fine for a dry run; the real publish needs the version in `deno.json`).feat(adapters/deno): publish to JSR (#5465)Yusuke Wadabefore adoption1c6e060
line 54why, one step back54test: move adapter runtime tests into `adapters/*` (#5466)Yusuke Wadabefore adoption645ddd6
lines 55–57why, one step back55Tests under `adapters/deno/test` run on Deno (`pnpm --filter @hono/deno run test:deno`) with `test/deno.json`,56which maps `hono` to the working tree instead.57feat(adapters): add @hono/bun as a workspace package (#5447)Yusuke Wadabefore adoptionfc2343d
lines 58–73why, one step back58### Adding a new adapter59601. Copy `adapters/bun` as `adapters/<name>` and adjust `package.json` (`name`, `description`) and the sources.612. The workspace picks it up automatically (`pnpm-workspace.yaml` has `adapters/*`).623. Add it to the corresponding `src/adapter/<name>` with `@deprecated` on each export, pointing to the new package.634. **First publish is manual.** See below.645. From the second release on, use `pnpm run release:adapter <name> <bump>`.6566#### First publish of a new adapter6768npm only allows a Trusted Publisher on a package that already exists, so the first version is published from a maintainer's machine:69701. Set the version in `adapters/<name>/package.json` and merge it.712. Build it: `pnpm --filter @hono/<name> run build` (`pnpm publish` does not build).723. In `adapters/<name>`, run `pnpm publish --access public` with your npm 2FA.734. On npmjs.com, open the package settings and add a Trusted Publisher: repository `honojs/hono`, workflow `release.yml`.