Every package exported ./src/index.ts and had no build at all, which made the npm half of the dual publish unusable. Measured against the staging registry with @green-tea/metrics installed into a clean project:
Consumer
Before
Node 22
ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING
Node --experimental-strip-types
same error — the flag does not lift it
Deno via npm
same error
Bun
worked
Node refuses to strip types under node_modules unconditionally, so this was not a version floor or a missing flag. The release pipeline in spec 2.4 has no build step, so it would have published that to both registries at once.
What changed
JSR needs no help. It transpiles on publish and hands Node an ESM package with generated declarations — verified by unpacking a real npm.jsr.io tarball. So deno.json is untouched and keeps exporting src/.
The build exists for npm alone, as CJS and ESM. Core is "type": "commonjs" and publishes both formats for all four entry points, so a CJS application has to be able to require() a plugin.
Core stays external in the declarations. tsup bundles devDependencies by default and convention rule 8 puts core there, so without external: ['@green-tea/core'] every plugin would ship a frozen private copy of a contract core owns.
Also: eslint.config.mjs ignored a bare 'dist', which never matched packages/*/dist — the linter started analysing the build output the moment one existed.
Verification
Packed all three and consumed them from outside the workspace, rather than only compiling them:
Check
Result
Node require()
passes
Node import
passes
Bun
passes
Deno via npm
passes
tsc under node16 and bundler
clean
Tarball now carries dist/ + README + CHANGELOG and nothing else; it used to ship test/.
Gates
Two new tests per package in test/workspace.test.ts pin that npm is served dist/ and JSR src/, plus files and the build scripts. Confirmed they bite: restoring exports: './src/index.ts' on metrics fails both. npm run build added to CI, and convention rule 11 records why the two registries are fed different things.
Still private: true — nothing is published by this PR.
Every package exported `./src/index.ts` and had no build at all, which made the npm half of the dual publish unusable. Measured against the staging registry with `@green-tea/metrics` installed into a clean project:
| Consumer | Before |
| --- | --- |
| Node 22 | `ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING` |
| Node `--experimental-strip-types` | same error — the flag does not lift it |
| Deno via npm | same error |
| Bun | worked |
Node refuses to strip types under `node_modules` unconditionally, so this was not a version floor or a missing flag. The release pipeline in spec 2.4 has no build step, so it would have published that to both registries at once.
## What changed
**JSR needs no help.** It transpiles on publish and hands Node an ESM package with generated declarations — verified by unpacking a real `npm.jsr.io` tarball. So `deno.json` is untouched and keeps exporting `src/`.
**The build exists for npm alone**, as CJS *and* ESM. Core is `"type": "commonjs"` and publishes both formats for all four entry points, so a CJS application has to be able to `require()` a plugin.
**Core stays external in the declarations.** tsup bundles devDependencies by default and convention rule 8 puts core there, so without `external: ['@green-tea/core']` every plugin would ship a frozen private copy of a contract core owns.
Also: `eslint.config.mjs` ignored a bare `'dist'`, which never matched `packages/*/dist` — the linter started analysing the build output the moment one existed.
## Verification
Packed all three and consumed them from outside the workspace, rather than only compiling them:
| Check | Result |
| --- | --- |
| Node `require()` | passes |
| Node `import` | passes |
| Bun | passes |
| Deno via npm | passes |
| `tsc` under `node16` and `bundler` | clean |
Tarball now carries `dist/` + README + CHANGELOG and nothing else; it used to ship `test/`.
## Gates
Two new tests per package in `test/workspace.test.ts` pin that npm is served `dist/` and JSR `src/`, plus `files` and the build scripts. Confirmed they bite: restoring `exports: './src/index.ts'` on metrics fails both. `npm run build` added to CI, and convention rule 11 records why the two registries are fed different things.
Still `private: true` — nothing is published by this PR.
Every package exported `./src/index.ts` and had no build at all, which made the
npm half of the dual publish unusable. Measured against a staging registry with
`@green-tea/metrics` installed into a clean project: Node threw
ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING, `--experimental-strip-types` threw
the same error because Node refuses to strip types under `node_modules`
unconditionally, and Deno-via-npm threw it too. Only Bun could import it. The
release pipeline would have published that to both registries at once.
JSR needs no help — it transpiles on publish and hands Node an ESM package with
generated declarations — so `deno.json` keeps exporting `src/`. The build exists
for npm alone, as CJS and ESM: core is `"type": "commonjs"` and publishes both,
so a CJS application has to be able to `require()` a plugin.
Core stays external in the declarations. tsup bundles devDependencies by
default, and convention rule 8 puts core there, so without that line every
plugin would have shipped a frozen private copy of a contract core owns.
Verified by packing all three and consuming them from outside the workspace:
`require()` and `import` both resolve under Node, Bun and Deno, and `tsc`
type-checks clean under `node16` and `bundler` resolution.
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
chrnx
merged commit dcc9c3d42b into develop2026-09-19 17:06:44 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Every package exported
./src/index.tsand had no build at all, which made the npm half of the dual publish unusable. Measured against the staging registry with@green-tea/metricsinstalled into a clean project:ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING--experimental-strip-typesNode refuses to strip types under
node_modulesunconditionally, so this was not a version floor or a missing flag. The release pipeline in spec 2.4 has no build step, so it would have published that to both registries at once.What changed
JSR needs no help. It transpiles on publish and hands Node an ESM package with generated declarations — verified by unpacking a real
npm.jsr.iotarball. Sodeno.jsonis untouched and keeps exportingsrc/.The build exists for npm alone, as CJS and ESM. Core is
"type": "commonjs"and publishes both formats for all four entry points, so a CJS application has to be able torequire()a plugin.Core stays external in the declarations. tsup bundles devDependencies by default and convention rule 8 puts core there, so without
external: ['@green-tea/core']every plugin would ship a frozen private copy of a contract core owns.Also:
eslint.config.mjsignored a bare'dist', which never matchedpackages/*/dist— the linter started analysing the build output the moment one existed.Verification
Packed all three and consumed them from outside the workspace, rather than only compiling them:
require()importtscundernode16andbundlerTarball now carries
dist/+ README + CHANGELOG and nothing else; it used to shiptest/.Gates
Two new tests per package in
test/workspace.test.tspin that npm is serveddist/and JSRsrc/, plusfilesand the build scripts. Confirmed they bite: restoringexports: './src/index.ts'on metrics fails both.npm run buildadded to CI, and convention rule 11 records why the two registries are fed different things.Still
private: true— nothing is published by this PR.