feat/agents-md
4
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
5c8f72b409 |
feat(openapi): the OpenAPI document, and the paperwork the crate shipped without
`Cargo.toml` has declared `license = "MIT"` since the first release and the published crate carried no license text, so anyone vendoring the source had the claim without the grant. `LICENSE` is that text. `DCO` is the certificate the README has been requiring a sign-off against without shipping, and `CONTRIBUTING.md` says how — including that GitHub is a mirror of `main` and tags, so a pull request there is carried upstream by a maintainer rather than merged, which would put the two forges out of sync. `CHANGELOG.md` reconstructs 26.7.0 and 26.8.0-beta.0 from their tags. The CLI ships on its own version line, so the header says what that does and does not mean about the core version a scaffold is pinned to, and each entry says when that pin moved. `matcha openapi` prints core's structural OpenAPI 3.1 for the route table — `--title`, `--api-version`, `--out`. It reuses the entry resolution and the generated-script runner that `graph` and `explain` already had, so it is the same `app.ready()` that resolves the graph without booting providers. Structural is the honest word: paths, methods and parameters come from the decorators, and nothing invents a response schema. The loose end from the capability table is closed. `cli.rs` still carried its own copies of the `create` kinds and the `add` capabilities, so adding either meant editing two files that could disagree — a value the parser accepts and the dispatcher rejects. Both now read the list from the module that owns it, and the three `create` piece kinds became rows in a table rather than near-identical match arms, which also retires a `too_many_arguments` allow. Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com> |
||
|
|
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 |
||
|
|
0a2713d377 |
feat(add): ws and upload handlers, --controller, and a resumable sse stub
`matcha add` covered three capabilities against a framework that has shipped
several more, and one of the three did not work.
`ws` and `upload` are new. Both name the optional peer dependency they need on
success — core lazy-requires `ws` and `busboy`, so a missing one is an error at
the first request rather than at boot, and the moment to mention it is when the
handler is written rather than when it 501s.
The `sse` stub predates 26.9: it yielded bare values, so an `EventSource`
reconnect restarted the iterable from its beginning and lost the gap in silence.
It now tags each event with `sse(data, { id })` and reads `last-event-id` to
resume — verified end to end, a reconnect at id 41 resumes at 42.
`buffer` returned `Buffer.from('hello')` and never could have worked: the
capability is named for the *transport*, `TransformerFn` returns `body: string`,
and the default `JsonTransformer` is `JSON.stringify` — so the route answered
`{"type":"Buffer","data":[104,...]}`. It now demonstrates `@Transformer`, which
is what actually governs a whole-response route, and answers `text/csv`.
`add` refused to act when a project had more than one controller. It still
refuses to guess, but it lists the candidates and `--controller <path>` is the
way through.
The starter smoke now adds every capability and type-checks them together, and
caught what unit tests could not: `MultipartBody` in a decorated signature is
TS1272 under `isolatedModules` + `emitDecoratorMetadata`, so the handler
compiled on node and bun and failed on Deno. Types in decorated signatures now
go through `wire::add_type_import`, and `find_named_imports` became type-aware
in both directions — merging a value symbol into an `import type` line would
erase the decorator at runtime.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012x1UPw987zNSxjH2DxHy2C
|
||
|
|
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 |