Commit Graph
61 Commits
Author SHA1 Message Date
chrnx 88090f34a2 fix(install): resolve latest without the rate-limited API, and test the installer
`install.sh` asked the release API for the latest tag. That API allows 60
requests an hour per IP without a token, which one office behind a NAT or a CI
runner exhausts — and a throttled response has no `tag_name`, so the installer
reported "could not resolve latest release tag" and gave no hint that rate
limiting was the cause. It now follows the `/releases/latest` redirect, which
carries no such limit and which Gitea implements identically, and keeps the API
as the fallback for the wget path that cannot read the effective URL. Verified
against the real release: resolves v26.8.0-beta.0, verifies the checksum, and
the installed binary runs.

Releases with a hyphen in the tag are now flagged as prereleases. Nothing set
the flag, so every beta answered `/releases/latest` — the very thing the
installer resolves by default. That is harmless while every release is a beta
and wrong the moment a stable one exists, because the next beta published after
it would silently displace it for everyone installing without MATCHA_VERSION.

`test_install.sh` has existed since the installer landed and no workflow ever
ran it — the same shape as the starter gap: a check that exists, passes, and
guards nothing. CI runs it now on Linux and macOS with shellcheck alongside, and
it covers a third case, since the branch this commit changes fails by producing
a message: an unresolvable `latest` must name MATCHA_VERSION and must leave no
binary behind.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-09-05 16:12:36 -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 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 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 8910fe22ee Merge pull request 'docs: point the public install paths at reachable hosts' (#8) from docs/public-install-paths into develop
CI / check (push) Successful in 37s
CI / check (pull_request) Successful in 25s
Reviewed-on: #8
2026-08-07 19:47:17 +00:00
chrnxandClaude Opus 5 95b7b92fdf docs: describe what the CLI actually does differently
CI / check (pull_request) Successful in 26s
crates.io shows this line in search results and on the crate page, and
"scaffold and manage graph-based apps" describes every scaffolder ever
written.

The differentiator is that `matcha create` wires what it generates into its
`@Module` — a generic generator drops files and leaves the wiring to you.
Say that, plus runtime detection and the no-JS-runtime install, since those
are the parts a reader cannot get elsewhere.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-07 14:40:54 -05:00
chrnxandClaude Opus 5 3e6fa7797b chore: bump to 26.8.0-beta.0 so the README fix reaches crates.io
CI / check (pull_request) Successful in 26s
Cargo embeds README.md into the published .crate, so crates.io keeps serving
whatever was there at publish time. The install-path fix in this branch is
invisible to anyone reading crates.io until a new version ships — and that page
is the whole point, since it is where the broken curl command is currently
advertised.

Calendar versioning, same as the core package: this is the first matcha cut in
August 2026.

Note for tagging: the previous release tagged `v26.7.0` while Cargo.toml said
`26.7.0-beta.0`. Tag this one `v26.8.0-beta.0` so the tag and the crate version
match.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-07 14:18:44 -05:00
chrnxandClaude Opus 5 f88c11ac0b docs: point the public install paths at reachable hosts
CI / check (pull_request) Successful in 26s
The README is what crates.io publishes, and it documented two install paths
that cannot work from outside the network — the curl one-liner and
`cargo install --git` both pointed at the internal Gitea host — while omitting
the one path that does work today: `cargo install matcha-cli`.

That is very likely most of why matcha has 16 downloads against the core
package's 159 a week.

- Lead with `cargo install matcha-cli`. Verified working from crates.io.
- Curl one-liner now uses the GitHub raw URL, which is reachable (200).
- `cargo install --git` points at the GitHub mirror.
- install.sh defaults REPO_BASE / API_BASE to GitHub. Both env vars still
  override, and Gitea's release API is GitHub-compatible for the two calls
  this script makes, so installing from the internal host still works.

Note: the prebuilt-binary path stays broken until releases exist on GitHub.
The v26.7.0 tag is mirrored there but release.yml has never fired on GitHub —
zero tag-triggered runs. Tracked separately.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-07 14:13:32 -05:00
chrnx bee7580ab4 Merge pull request 'ci: crates.io Trusted Publishing (OIDC, no token)' (#6) from ci/trusted-publishing into develop
CI / check (push) Successful in 27s
2026-07-18 20:18:12 +00:00
chrnx b8aac3bb6a ci: publish to crates.io via OIDC Trusted Publishing (no token)
Replaces CARGO_TOKEN with crates.io Trusted Publishing: id-token: write + rust-lang/crates-io-auth-action exchanges the OIDC token for a short-lived crates.io token. Requires a trusted publisher configured on crates.io (Expressive-Tea/matcha, release.yml).

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-18 14:54:25 -05:00
chrnx 88dd2035c4 Merge pull request 'feat: matcha-cli crate + two-forge CI/CD' (#4) from feat/ci-cargo-crates into develop 2026-07-18 19:00:58 +00:00
chrnx dfba02a7ce feat: rename crate to matcha-cli + two-forge CI/CD workflows
Crate renamed matcha->matcha-cli for crates.io (the name matcha is taken); binary stays matcha. Adds description/license/repository and CalVer prerelease version. New .github/workflows: ci (fmt+clippy+test), promote (main+tags -> GitHub), release (relocated from .gitea + crates.io publish on GitHub only). Cargo.lock regenerated; gate passes locally.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-18 13:58:18 -05:00
chrnx cc943079a4 Merge branch 'main' into develop 2026-07-13 00:24:36 +00:00
chrnx beaba7ce80 Merge feature/matcha-create-generators: create step/provider/module 2026-07-12 19:22:03 -05:00
chrnx 0427c89752 fix(wire): refuse to create a duplicate key when the existing value isn't an array
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-12 19:21:39 -05:00
chrnx c9cad458bc chore(wire): drop stale dead_code allow on add_to_createapp_modules
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-12 19:16:09 -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 59004c4b5e feat(wire): create @Module key if absent + createApp modules target
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-12 19:10:58 -05:00
chrnx 17a3936733 Merge develop: idempotent release prepare job 2026-07-12 18:28:27 -05:00
chrnx a112235ca6 Merge fix/release-idempotent: prevent Gitea re-release 404 2026-07-12 18:28:25 -05:00
chrnx f77bd4d774 ci: prepare job deletes existing release before build (Gitea asset-replace 404 workaround)
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-12 18:28:25 -05:00
chrnx 060f135eb4 Merge develop: installer latest-URL fix + matcha --version 2026-07-12 18:18:18 -05:00
chrnx 756dbed5d9 Merge branch 'develop' of ssh://git.svc.zoit.services:2232/Green-Tea/matcha into develop 2026-07-12 18:14:38 -05:00
chrnx 6841a2102d Merge fix/installer-latest-url: installer latest-URL fix + matcha --version 2026-07-12 18:14:04 -05:00
chrnx 112f8da22c fix: installer resolves latest via host-root API (was 404 on repo-path); add matcha --version
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-12 18:13:54 -05:00
chrnx 274b40c13a Merge pull request 'Develop' (#2) from develop into main
Reviewed-on: #2
2026-07-12 23:03:57 +00:00
chrnx 03597499cd Merge branch 'main' into develop 2026-07-12 23:03:43 +00:00
chrnx 5ac79e91c0 Merge feature/matcha-installer: curl|sh installer + release CI 2026-07-12 18:00:39 -05:00
chrnx 787890e5c9 fix(install): tolerate whitespace in latest-tag JSON; doc env vars on pipe
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-12 18:00:29 -05:00
chrnx 8c515a30a2 docs: install via curl|sh, cargo install --git as from-source
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-12 17:57:06 -05:00
chrnx 98394ceb8a ci: fail-fast=false so a flaky leg can't publish a partial release
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-12 17:56:40 -05:00
chrnx 3ad7ac0dea ci: release workflow builds binaries and publishes to Gitea Releases
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-12 17:52:23 -05:00
chrnx ee7eccc0de test: shellcheck-clean fixture checksum generation (SC2015)
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-12 17:51:30 -05:00
chrnx 832fbbb943 feat: curl|sh installer with sha256 verification
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-12 17:46:42 -05:00
chrnx ca27e31648 Merge pull request 'Develop' (#1) from develop into main
Reviewed-on: #1
2026-07-12 21:37:14 +00:00
chrnx 1b438278c6 chore: stop tracking AI/scratch docs (.specs); keep tree to project docs only
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-12 16:35:21 -05:00
chrnx 78e7d9b15b Merge feature/matcha-multi-runtime: node/deno/bun starters via --runtime (default node) 2026-07-12 13:16:39 -05:00
chrnx e6ee9e84e8 chore: drop now-stale dead_code allows in runtime.rs; spec default=node erratum
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-12 13:16:27 -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 c63c121787 Merge feature/matcha-v1-cli: matcha v1 CLI (new/run/create/add) 2026-07-12 13:01:34 -05:00
chrnx a2610fa019 chore: adopt calver versioning (26.7.0)
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-12 13:01:34 -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 65ecba05d1 docs: matcha README with usage and runtime detection
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-11 13:39:37 -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 72e984d35c feat: optional --check delegates type-check to detected runtime
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-11 13:28:40 -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 49909ed821 fix(wire): scope @Module array search to the Module decorator, not any object literal
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-11 13:20:39 -05:00