chore(plugins): publish to JSR alone, and drop the npm build #5

Merged
chrnx merged 4 commits from chore/jsr-only-plugins into develop 2026-09-23 16:35:03 +00:00
Owner

Plugins now publish to JSR only. The npm half — a tsup config per package, a dual exports map, and a dist/ — is gone.

Why

npx jsr add @green-tea/<name> installs under npm, yarn, pnpm and bun through npm.jsr.io. Measured in a scratch project: it writes one line to .npmrc (@jsr:registry=https://npm.jsr.io) and adds an aliased dependency, so the import specifier stays @green-tea/<name> and the @jsr/ name appears only in the lockfile. require() against the ESM-only tarball works on Node 20.19 and 22 via require(esm).

So the second registry was buying a reader close to nothing, and costing a build that can go stale between a merge and a release.

Nothing is published yet. All three packages 404 on npm and JSR. This costs no consumer anything today, and it is the reversible direction: adding npm later breaks nobody, whereas removing it after a publish would.

JSR is also the only one of the two that records where a plugin runs, per package. That is not cosmetic here — jwt imports node:fs/promises and cannot serve workerd, while metrics imports nothing at all and runs everywhere. npm has nowhere to put that difference, so engines plus the README table (convention 9) was the only place it lived.

What changed

  • Deleted tsup.config.ts from all three packages, and main / module / types / exports / files / scripts from their package.json.
  • Dropped the root build script and tsup from devDependencies.
  • Removed the npm run build step from CI. deno publish --dry-run, already in the runtimes job, is the publish path these packages actually take.
  • Rewrote convention 11 in AGENTS.md.
  • test/workspace.test.ts now pins the JSR-only invariant instead of the dual-registry one: private must be true, and none of the npm entry-point fields may come back. private stops being a leftover and becomes the guard that makes an accidental npm publish fail.

Verified

lint clean (one pre-existing no-explicit-any warning in test/helpers.ts)
format:check / typecheck / complexity:check clean
npm test 60/60
test:deno / test:bun 31 / 31
test:edge no package declares workerd — unchanged
deno publish --dry-run all three simulate clean; slow-types check passes
npm audit --omit=dev 0 vulnerabilities

Two things deliberately left alone

The CI job is still called build even though it no longer builds. Renaming it changes a required status check on the protected branches, which deserves its own change rather than riding along here.

metrics and rate-limit import nothing and could plausibly declare workerd, which would give test:edge something to run. Worth looking at when the runtimeCompat entries are filled in on JSR — same question, and it should be answered once.

Plugins now publish to JSR only. The npm half — a `tsup` config per package, a dual `exports` map, and a `dist/` — is gone. ## Why `npx jsr add @green-tea/<name>` installs under npm, yarn, pnpm and bun through `npm.jsr.io`. Measured in a scratch project: it writes **one line** to `.npmrc` (`@jsr:registry=https://npm.jsr.io`) and adds an aliased dependency, so **the import specifier stays `@green-tea/<name>`** and the `@jsr/` name appears only in the lockfile. `require()` against the ESM-only tarball works on Node 20.19 and 22 via `require(esm)`. So the second registry was buying a reader close to nothing, and costing a build that can go stale between a merge and a release. **Nothing is published yet.** All three packages 404 on npm *and* JSR. This costs no consumer anything today, and it is the reversible direction: adding npm later breaks nobody, whereas removing it after a publish would. JSR is also the only one of the two that records **where a plugin runs**, per package. That is not cosmetic here — `jwt` imports `node:fs/promises` and cannot serve workerd, while `metrics` imports nothing at all and runs everywhere. npm has nowhere to put that difference, so `engines` plus the README table (convention 9) was the only place it lived. ## What changed - Deleted `tsup.config.ts` from all three packages, and `main` / `module` / `types` / `exports` / `files` / `scripts` from their `package.json`. - Dropped the root `build` script and `tsup` from devDependencies. - Removed the `npm run build` step from CI. `deno publish --dry-run`, already in the `runtimes` job, is the publish path these packages actually take. - Rewrote convention 11 in `AGENTS.md`. - `test/workspace.test.ts` now pins the JSR-only invariant instead of the dual-registry one: `private` must be `true`, and none of the npm entry-point fields may come back. `private` stops being a leftover and becomes the guard that makes an accidental `npm publish` fail. ## Verified | | | |---|---| | `lint` | clean (one pre-existing `no-explicit-any` warning in `test/helpers.ts`) | | `format:check` / `typecheck` / `complexity:check` | clean | | `npm test` | 60/60 | | `test:deno` / `test:bun` | 31 / 31 | | `test:edge` | no package declares workerd — unchanged | | `deno publish --dry-run` | all three simulate clean; slow-types check passes | | `npm audit --omit=dev` | 0 vulnerabilities | ## Two things deliberately left alone **The CI job is still called `build`** even though it no longer builds. Renaming it changes a required status check on the protected branches, which deserves its own change rather than riding along here. **`metrics` and `rate-limit` import nothing and could plausibly declare `workerd`**, which would give `test:edge` something to run. Worth looking at when the `runtimeCompat` entries are filled in on JSR — same question, and it should be answered once.
chrnx added 1 commit 2026-09-23 15:14:08 +00:00
chore(plugins): publish to JSR alone, and drop the npm build
CI / dco (pull_request) Successful in 4s
CI / build (pull_request) Failing after 8s
CI / runtimes (bun) (pull_request) Failing after 7s
CI / runtimes (deno) (pull_request) Failing after 9s
CI / runtimes (edge) (pull_request) Failing after 7s
4caf8809df
The second registry was costing a tsup config per package, a dual `exports`
map and a `dist/` that could go stale between a merge and a release — and it
was not buying a reader anything. `npx jsr add @green-tea/<name>` installs
under npm, yarn, pnpm and bun through `npm.jsr.io`: one line in `.npmrc`, and
the import specifier stays `@green-tea/<name>`. The `@jsr/` name only ever
appears in the lockfile.

Nothing is published yet — all three packages are absent from both registries
— so this costs no consumer anything, and it is the reversible direction:
adding npm later breaks nobody, while removing it after a publish would.

JSR is also the only one of the two that can record *where a plugin runs*, per
package, which is not cosmetic for a framework whose claim is one app on four
runtimes. `jwt` needs `node:fs/promises` and cannot serve workerd; `metrics`
imports nothing and runs everywhere. npm has nowhere to put that.

`private: true` stays and becomes the guard: an accidental `npm publish` now
fails rather than shipping entry points that describe a build nobody runs.
`test/workspace.test.ts` pins that invariant instead of the dual-registry one.

The CI job keeps the name `build` deliberately — renaming it would change a
required status check on the protected branches, which is a separate change.
`deno publish --dry-run` in the `runtimes` job now stands in for the build, and
it is the publish path these packages actually take.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
chrnx added 1 commit 2026-09-23 15:22:03 +00:00
fix(ci): resolve core from npm, not Verdaccio
CI / dco (pull_request) Successful in 6s
CI / build (pull_request) Successful in 14s
CI / runtimes (bun) (pull_request) Successful in 11s
CI / runtimes (deno) (pull_request) Successful in 12s
CI / runtimes (edge) (pull_request) Successful in 9s
8499aaa760
`npm ci` has been failing on `develop` with `EINTEGRITY` for `@green-tea/core`,
independently of any branch — verified by running it on a clean clone of
`develop` before touching anything. Every job that installs was red; only `dco`,
which does not, was green.

Verdaccio proxies npmjs.org. When core 26.9.0-beta.2 was published for real on
2026-09-22, the staged tarball under the same version was superseded by the
upstream one, and the integrity recorded in the lockfile stopped matching what
the registry serves. Nothing in this repository changed; the thing it pinned
did.

`.npmrc` existed only because that version lived on Verdaccio alone, which its
own comment said would end at Plan B3. It ended early: core is on npmjs.org, so
the scope line goes and the lockfile now resolves from
`registry.npmjs.org` with the integrity npm published.

The `if:` guards keeping CI on Gitea stay. Their stated reason is gone — a
GitHub runner can reach npm — but turning CI on over there is its own change,
and the repository has no GitHub mirror yet.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
chrnx added 1 commit 2026-09-23 15:26:20 +00:00
docs(plugins): say how to install now that npm is not an option
CI / dco (pull_request) Successful in 5s
CI / build (pull_request) Successful in 15s
CI / runtimes (bun) (pull_request) Successful in 11s
CI / runtimes (edge) (pull_request) Successful in 9s
CI / runtimes (deno) (pull_request) Successful in 11s
16f8329794
The READMEs still described a dual publish, and none of them carried an install
command at all — so the instruction a reader would infer, `npm i
@green-tea/jwt`, is the one command that no longer works. Each package README is
also the page JSR renders, which makes it the first thing anyone sees.

Adds `npx jsr add` to all three, with the deno and bun forms, and says plainly
that there is no npmjs.org package rather than letting someone find out from a
404.

Also corrects a claim in the root README that this branch made false: "installing
one never pulls a second copy of core". Measured while deciding this change — a
plugin names an exact core in `deno.json`, and across a minor boundary npm nests
a second copy instead of deduplicating. The copy is inert, since a plugin's built
code never imports core, and that is worth saying precisely: what is guaranteed
is which core *runs*, not how many are on disk.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
chrnx added 1 commit 2026-09-23 16:24:20 +00:00
docs(plugins): give each package a header, and stop leaning on a marketplace
CI / dco (pull_request) Successful in 7s
CI / build (pull_request) Successful in 12s
CI / runtimes (bun) (pull_request) Successful in 12s
CI / runtimes (deno) (pull_request) Successful in 11s
CI / runtimes (edge) (pull_request) Successful in 10s
686a4527cf
Each README now opens the way core's does — logo, name, one line saying what
the package is for. The package README is the page JSR renders, so it is the
first thing anyone sees, and three of them opened with a bare `# @green-tea/x`.

The logo is an absolute URL rather than a relative path, deliberately. Core's
README points at `./assets/logo.png`, and core's `publish.include` does not ship
`assets/` — so that image 404s on core's JSR page today. Repeating the pattern
three more times would have repeated the bug three more times.

Also drops the claim that npmjs.org discovery does not matter "where the
marketplace is the channel anyway". There is no marketplace yet, and a plugin
should stand on its own rather than on a site that has not shipped. The cost is
now stated plainly instead of argued away.

Corrects "their built code never imports it": with JSR publishing the source,
the build is JSR's, not ours. What holds is that a type import leaves nothing
behind, so the published JavaScript never mentions core.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
chrnx merged commit ea25331631 into develop 2026-09-23 16:35:03 +00:00
chrnx deleted branch chore/jsr-only-plugins 2026-09-23 16:35:04 +00:00
Sign in to join this conversation.