Commit Graph
17 Commits
Author SHA1 Message Date
chrnx 52241cc9a6 fix(plugin): let a generated package run deno test straight away
With a package.json beside deno.json, Deno expects node_modules to be
installed, so deno test failed until a deno install, and then failed
to type-check node:assert without @types/node. nodeModulesDir "auto"
installs on demand, and the package now passes deno test, node --test
and bun test as generated.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-09-24 13:00:43 -05:00
chrnx 42c1148903 feat(plugin): --package scaffolds a JSR-first plugin package
The directory must be empty, so a package never mixes into another
project. JSR is the default and the README says why; JSR + npm adds an
ESM-only tsc build, since npm consumers need compiled output, and
suggests the green-tea- name without enforcing it.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-09-24 12:57:32 -05:00
chrnx 3c3b7aaf8e feat(plugin): matcha create plugin scaffolds an in-app plugin and wires it
In-app is the default. Each plugin gets its own folder under plugins/
(or --folder), so it can be exported as a package later, and the
factory is registered in createApp({ plugins }). A plugins value that
is not an array literal is left alone with a hint, as modules already
is.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-09-24 12:54:51 -05:00
chrnx 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>
2026-09-05 16:01:49 -05:00
chrnxandClaude Opus 5 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
2026-09-05 14:59:57 -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 7b632e5170 feat(create): implement step, provider, and module generators
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-12 19:14:16 -05:00
chrnx 1b5922c4de fix(new): default runtime is node (framework is node-first)
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-12 13:13:02 -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 2f9b656692 fix(add): merge imports into existing brace + capability idempotency; fmt
- wire::add_import now merges a new symbol into an already-present
  `import { ... } from '<from>';` brace instead of appending a second,
  colliding import line for the same module (a duplicate ESM binding
  is a hard SyntaxError/TS2300, not a harmless dupe as previously
  assumed). Falls back to appending a new line when the module isn't
  imported yet, or if the brace-merge edit fails the parses_clean
  guard.
- cmd_add::run gains a capability-level idempotency guard, keyed on
  each capability's unique route-path literal, so `matcha add <cap>`
  run twice no longer appends a duplicate handler + route.
- cargo fmt --all across the crate; drop the stale #[allow(dead_code)]
  on wire::parses_clean now that it's demonstrably live.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-11 13:52:21 -05:00
chrnx 0aee29478b test(add): cover insert_method revert/not-found paths and only_controller errors
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-11 13:38:09 -05:00
chrnx 4fe5b53e7f feat: matcha add appends capability handler to the controller
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-11 13:33:32 -05:00
chrnx 81af7c1c2a feat: matcha create controller with tree-sitter auto-wire + emit-only fallback
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-11 13:24:29 -05:00
chrnx 8d31faa27e feat: matcha new --template-url via shallow git clone
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-11 13:06:19 -05:00
chrnx c382602ca7 fix(new): no orphan dir on error path; drop stale dead_code allow
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-11 13:03:01 -05:00
chrnx 7044e50982 feat: matcha new scaffolds from embedded starter
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-11 12:59:38 -05:00
chrnx fbb9282f7e feat: matcha binary skeleton with clap command surface
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-11 12:41:27 -05:00