cf7d30d8c224a37649a64e17b8eeb52a37d46deb
11
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
9379b58dd8 |
ci: move workflow actions off the deprecated Node 20 runtime
actions/checkout and actions/setup-node v4 -> v5, softprops/action-gh-release v2 -> v3; all three run on Node 24. setup-deno@v2, setup-bun@v2 and crates-io-auth-action@v1 already resolve to Node 24 releases. Jobs keep node-version 22. Refs Green-Tea/core#103 Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com> |
||
|
|
fc495fa3cb |
fix(ci): install bun in the release workflow
`release.yml` runs `npm run test:bun` but never installed bun. `ci.yml` gets away with one setup action per matrix entry; the release job runs every suite in the same job, so it needs both. Leaving it out does not skip the suite. `scripts/run-runtime.mjs` spawns `bun`, gets `ENOENT`, and `process.exit(status ?? 1)` turns a missing binary into a failure — verified: `spawnSync` on a missing command returns `status: null`, which that expression maps to 1. Nothing would have been published, since the gates run before the publish. What it would have cost is a tag sitting on GitHub with no release against it, which has to be deleted before the same tag can be tried again. Found during the pre-flight for the first tag, by checking which tools the steps use against which ones the job installs, rather than by pushing the tag and reading the failure. Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com> |
||
|
|
d5e8c8a827 |
fix(ci): stop a failed publish from reporting as a successful release
Two bugs in one line, both silent, both found in review before anything shipped.
**The pipe swallowed the exit status.** `deno publish | tee` reports the status
of the last command in the pipeline, and that is `tee`, which always succeeds.
GitHub's default shell is `bash -e` *without* `pipefail`, so a failed publish
would have been a green step — and the workflow would have gone on to cut a
GitHub release for it. Demonstrated rather than assumed:
bash -e -c 'false | tee /dev/null' -> exit 0
bash -eo pipefail -c 'false | tee /dev/null' -> exit 1
Naming `shell: bash` gets `-eo pipefail`.
**And the log was going to be empty anyway.** deno's logger is env_logger,
whose default target is stderr, so the `Successfully published` lines never
reach stdout. Measured against a real `deno publish`: 0 lines on stdout, all of
them on stderr. So `--notes` would have found nothing and announced that nothing
shipped, on every successful release. `2>&1` fixes it.
The second bug is the reason for the third change: `--notes` now refuses a log
carrying neither marker instead of reporting it as "nothing was published". A log
this script cannot read and a release where nothing shipped are indistinguishable
from the text, and guessing wrong is silent in the direction that matters. Now it
fails and says to check the redirect and the pipeline.
Verified all three paths: an empty log exits 1, an all-skipped log renders the
"already on JSR" line and exits 0, and a real publish log renders per-package
sections.
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
|
||
|
|
32baf0c592 |
ci: publish to JSR from a dated tag, and close the changelogs
Adds the release workflow and the script it leans on, plus the `[Unreleased]` sections these three packages have carried since they were written. **The tag is a date, not a version.** `release-26.9.23` says when; the release body says what moved. A version-shaped tag would be a lie here — three packages carry three independent versions, so `plugins-v26.9.0` would match none of them and invite being read as `@green-tea/jwt@26.9.0`. **Tag-driven, not push-driven.** JSR's own setup page offers an example that publishes on every push to `main`. For this repository that means every promotion publishes, and a JSR version can never be replaced or removed, so one distracted merge would burn a version number permanently. A tag is a decision; a merge is not. **Publishing all three at once is safe, and that is measured rather than assumed.** `deno publish` queries the registry per package and drops the ones already there (`filter_out_published_packages` in denoland/deno, cli/tools/publish/mod.rs); skipping logs a warning, and a workspace with nothing left to do exits 0 with "All packages are already published". So a tag cut after changing one package publishes that one and leaves the others alone, with no per-package logic here. `scripts/release.mjs --check` runs **before** the publish and refuses when a version about to ship has no changelog entry. That ordering is the point: core's equivalent runs after npm and JSR have already published, so a missing heading fails a release that has already shipped. Worth not inheriting. `--notes` builds the release body from what `deno publish` actually reported rather than from a prediction of it — predicting means duplicating Deno's filtering and being wrong about it silently. Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com> |
||
|
|
57c4707bc5 |
ci: run on both forges, and watch contrib
Adding `contrib` to the mirror without adding it here was a hole, not a gap. A pull request against a branch a workflow does not list triggers **nothing** — not a reduced set of checks, none — so an external contributor would have seen no signal at all, and neither would whoever merged their work. The branch and its CI had to land together; the previous commit shipped only half of that. So `contrib` joins `develop` and `main` in both trigger lists, and the three `github.server_url != 'https://github.com'` guards are gone. Their reason went with Verdaccio: the packages used to build against a core that existed only on an internal registry a public runner cannot reach, and they resolve `@green-tea/core` from npmjs.org now. Guarding CI to one forge while inviting contributions to the other cannot both be true. The dco job keeps `github.event_name == 'pull_request'`, matching core, so it reports on pull requests and costs nothing on push. Verified the way a public runner would: the workflow names no secrets and no internal hosts, and a fresh clone runs `npm ci`, lint, typecheck, the Node suite and `deno publish --dry-run` with nothing configured. Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com> |
||
|
|
e1ea1542c9 |
docs: add the community files GitHub expects before this goes public
The repository had a LICENSE and nothing else. Adds CONTRIBUTING, a code of conduct, a security policy, the DCO, issue templates and a pull request template — the set GitHub checks for, written for these packages rather than copied from core. **This adds a `contrib` branch, reversing a decision made earlier today.** The promotion originally mirrored `main` alone, on the reasoning that a repository with no documented contribution flow does not need a branch nobody targets. That reasoning held right up until we decided to document one. CONTRIBUTING has to send people somewhere, `main` is the wrong answer — a pull request there puts the forges out of step and breaks the next promotion — so `develop → contrib` is back, the same arrangement core runs. What is adapted rather than inherited: - Node 22, not core's 18, which is what every package here already requires. - No build step anywhere. JSR transpiles the source, so `deno publish --dry-run` is what stands in for one. - The four traps an assistant falls into *here*: turning `import type` into a value import, adding a build, writing for Node alone, and changing `engines` without the README's Runtimes table. - SECURITY scopes each package separately, and sends vulnerabilities in the framework itself to core — same people, but the advisory has to live where the fix does. There is also a plugin proposal template, which exists to ask the question that is cheaper in a paragraph than in a written pull request: whether a thing belongs in the official set at all, or is better as the author's own package. The template says the second outcome is first-class, because it usually is. Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com> |
||
|
|
a3f57e61d9 |
chore(ci): stop naming internal infrastructure in files that go public
`main` is about to be mirrored to a public repository for the first time, so everything in the tree becomes readable by anyone. Two things in here were written when only the development forge could see them. `ci.yml` carried the internal registry's hostname in a step that authenticated to it — twice. That step is also dead: `.npmrc` no longer points the @green-tea scope anywhere, and core resolves from npmjs.org. So this removes a published hostname and an instruction that does nothing, in the same edit. `AGENTS.md` named the origin by its repository path. Core's public copy says "Development lives on a private Gitea instance" and stops there, which is the right level: a reader learns the shape of the workflow without learning where it lives, and a path they cannot reach tells them nothing anyway. `promote.yml` keeps saying the forge by name, because core's public copy does and the two should read alike. Naming the product is not the problem; naming the host was. Checked the rest while here: no credentials, no keys, no personal paths or addresses, no issue templates routing anyone to a forge they cannot open. Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com> |
||
|
|
51c54c1cc4 |
ci(plugins): mirror Gitea main to GitHub main
The public repository exists but nothing populates it. This is the same promotion core uses, cut down to what this repository actually has: one branch. Only `main`, and no `contrib` counterpart. Core mirrors `develop` as `contrib` because outside contributions land there, and that flow is documented. Here it is not, so a second mirrored branch would be a branch nobody targets. Tags stay off the push, `--tags` included. Core's reason was that the same tag means one thing on each forge; here it is simpler and sharper — these packages publish to JSR, and a JSR version can never be replaced or removed, so a tag must never reach the public forge as a side effect of promoting a branch. The push is not forced, and the step fails early with a readable message when GH_PROMOTE_TOKEN is missing rather than building a remote URL with an empty credential and failing on the push with an authentication error instead. The secret is set on this repository; the guard is for whoever forks or rebuilds it. Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com> |
||
|
|
4caf8809df |
chore(plugins): publish to JSR alone, and drop the npm build
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> |
||
|
|
3b1eceecb9 |
build: publish a real build to npm, and the source to JSR
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> |
||
|
|
7be37f5184 |
ci: gate every package on Gitea
Lint, format, complexity, typecheck and the Node suite on the engines floor, then Deno and Bun for the packages that declare them. Gitea only until core comes from npm, because the version these packages build against lives on Verdaccio. The JSR dry-run is kept rather than deferred: it passes locally on Deno 2.9.6, because `nodeModulesDir: manual` resolves core from the tree `npm ci` installed, so JSR's checker never needs that version to exist on npm. Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com> |