Commit Graph
9 Commits
Author SHA1 Message Date
chrnx 8e45c1170f feat(templates): scaffold against core 26.11.0-rc.1; edge installs core from npm
CI / check (pull_request) Successful in 36s
CI / starter (bun) (pull_request) Successful in 45s
CI / starter (deno) (pull_request) Failing after 32s
CI / starter (edge) (pull_request) Successful in 52s
CI / core-freshness (pull_request) Has been skipped
CI / starter (node) (pull_request) Successful in 35s
CI / installer (ubuntu-latest) (pull_request) Successful in 12s
CI / installer (macos-14) (pull_request) Successful in 4s
core#93 is fixed in RC.1: the npm ESM build's createRequire banner no longer throws on workerd, so the edge starter drops its .npmrc and the npm:@jsr alias and installs @green-tea/core from npm like every other runtime. doctor still reads the alias, so edge projects scaffolded before this keep working.

The weekly core-freshness job compares against core's latest dist-tag: release candidates and the stable release publish there, and beta stays on 26.9.0-beta.2.

Starter smoke passes locally on node, deno, bun and edge. Deno needs --minimum-dependency-age=0 until RC.1 is a day old.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-11-17 17:31:03 -06:00
chrnx a8f1658e4d fix(create,starters): safe names and no overwrite in create; node starter awaits listen and declares engines
CI / installer (macos-14) (pull_request) Successful in 3s
CI / check (pull_request) Successful in 27s
CI / starter (bun) (pull_request) Successful in 31s
CI / starter (deno) (pull_request) Successful in 33s
CI / starter (edge) (pull_request) Successful in 38s
CI / core-freshness (pull_request) Has been skipped
CI / installer (ubuntu-latest) (pull_request) Successful in 12s
CI / starter (node) (pull_request) Successful in 32s
matcha create derives the class name and its token from what was typed:
current-user becomes CurrentUserStep providing currentUser, where it used
to write a file that did not parse. It refuses names that cannot be a
class, and step or provider names whose token core already provides. It
also refuses to replace an existing file instead of silently discarding
edits.

The node starter awaits app.listen so boot and bind failures stop the
process with their own error, and the node and edge starters declare
engines node >=22 to match core.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-10-30 21:00:58 -05:00
chrnx 9641bd51a7 feat(agents): scaffold AGENTS.md and CLAUDE.md, and add matcha agents
CI / installer (macos-14) (pull_request) Successful in 2s
CI / check (pull_request) Successful in 26s
CI / starter (bun) (pull_request) Successful in 31s
CI / starter (deno) (pull_request) Successful in 32s
CI / starter (node) (pull_request) Successful in 33s
CI / core-freshness (pull_request) Has been skipped
CI / installer (ubuntu-latest) (pull_request) Successful in 10s
CI / starter (edge) (pull_request) Successful in 5m38s
LLM coding agents have no training data on green-tea, so they write
Express. Every starter now ships an AGENTS.md, with a CLAUDE.md that
imports it. It states the rules that differ: a graph, not a chain;
needs declared in the signature; the graph validated at boot; reuse
existing tokens. It also points the agent at matcha
routes|tokens|explain --json and at the llms.txt inside the installed
core.

matcha agents writes the same files into an older project, with the
core version that project actually depends on. It leaves existing
files alone unless --force is given.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-10-30 20:35:23 -05:00
chrnx efe7ad6027 feat(new): scaffold core 26.9.0-beta.2, and boot before binding on Deno and Bun
beta.2 made serveDeno and serveBun boot the app before they bind. The
starters called Deno.serve and Bun.serve with app.fetch directly, so a
provider that failed left an open port answering 500 to everything.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-09-24 12:58:16 -05:00
chrnxandClaude Opus 5 a3250da225 feat(edge): a Cloudflare Workers target, and a doctor for the quiet failures
`matcha new --runtime edge` scaffolds a Worker: `nodejs_compat`, `edgeHandler`
as the default export, and wrangler's `[assets]` serving `./public` so `/` is the
same page as on the other three runtimes and `/zen` the same stream from the
worker. `matcha run` is `wrangler dev`, which is real workerd, so edge stops
being a deploy-only target. Runtime detection puts `wrangler.toml` ahead of
`package.json`, since an edge project has both, and the graph resolves under
node — `src/app.ts` imports core, never `edgeHandler`.

Getting there turned up a core defect, filed as Green-Tea/core#93: the npm ESM
build cannot load on workerd at all. tsup's `createRequire(import.meta.url)`
banner runs at module scope and `import.meta.url` is undefined there, so
`@green-tea/core/edge` throws before any of its own code runs — while
`src/node-require.ts` is written precisely to make that lazy and survivable.
core's own edge test cannot see it: it bundles `src/`, so `dist/` is the one
artifact users install and the one nothing exercises. The scaffold installs from
JSR, which publishes source with no banner and boots clean; the `.npmrc` says why
and links the issue, and both it and the alias can go once it is fixed.

`matcha doctor` reports the misconfigurations that fail confusingly rather than
loudly: `experimentalDecorators` missing, which turns every `@Route` into a
syntax error blaming the decorator; a core pin that cannot resolve or that does
not match what is installed; an entry that does not export `app`; and `@Ws` or
multipart routes whose lazy-loaded peer dependency is absent, which compile and
then fail at the first request. Every check is a file read — no runtime spawned,
nothing fetched — so it works before the project installs. It reads the installed
version from the package's own manifest rather than core's exported `VERSION`,
which is stale in the published artifact (Green-Tea/core#92) and would give the
wrong answer to the one check that exists to catch a wrong version.

The starter smoke and the CI matrix gained edge as a fourth runtime.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012x1UPw987zNSxjH2DxHy2C
2026-09-05 15:09:55 -05:00
chrnxandClaude Opus 5 827e6863ad feat(graph): draw the graph, and stop scaffolding a two-month-old core
The CLI's last feature work was 12 July; core has shipped 26.8 and 26.9 since.
Two consequences, fixed together because they share an entry-file convention.

Every runtime overlay pinned `^26.7.0-beta.0`. Core is prerelease-only, and
npm's semver excludes a prerelease from any range whose comparators carry a
different major.minor.patch — so that caret is not a loose pin, it is a pin to
the oldest matching prerelease that nothing can move off. Every project
`matcha new` has produced since July installed 26.7.0-beta.0 and could not
upgrade: no logger, no request budget, no resumable `@Sse` id, and none of the
crashes 26.9 fixed. The pin is now exact, lives in one `CORE_VERSION` const,
and Deno resolves through JSR — which is core's native path for Deno and the
one 26.9 repaired.

Nothing caught that because CI never ran JavaScript. `cargo test` proves the CLI
writes the files it means to write; it cannot prove those files describe a
project the current core will run. `scripts/starter-smoke.sh` scaffolds,
installs, type-checks, boots, curls `/` and the `/zen` stream, and introspects a
real starter per runtime; a weekly job fails when the pin falls behind the
`beta` dist-tag. The smoke immediately found a second defect: the bun overlay
carried no Bun types, so `tsc --noEmit` — and therefore `matcha create --check`
— failed on every bun project the CLI has ever scaffolded.

`matcha graph` and `matcha explain <pattern>` close the widest gap in the
surface: the framework's claim is that an API is a graph rather than a
middleware chain, `toMermaid`/`toDOT`/`graph`/`explain` have been exported all
along, and the CLI could not draw any of it. Both reach the app through
`app.ready()`, which resolves the graph and is documented as deliberately not
running provider factories — asking for a diagram must not open your database
connections. Formatting lives in the generated script rather than in Rust,
which keeps serde out for output `console.log` already has the values for.

That needed an app the CLI can import without binding a port, so the starter
now composes the graph in `src/app.ts` and leaves `src/main.ts` holding only
the serve call. `create module` follows, preferring `src/app.ts` and falling
back to `src/main.ts` so projects scaffolded before the split keep working.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012x1UPw987zNSxjH2DxHy2C
2026-09-05 14:30:19 -05:00
chrnx e8cd20b7ec feat(new): multi-runtime starter (node/deno/bun) via --runtime, shared + overlay templates
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-12 13:11:12 -05:00
chrnx dba24aa50a fix(starter): make scaffolded app runnable — mountpoint, Deno entrypoint, import map
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-11 12:56:54 -05:00
chrnx 281e8ccc17 feat: embed official starter template with token substitution
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-11 12:49:53 -05:00