feat(add,create): matcha add cookie and matcha create transformer #21

Merged
chrnx merged 2 commits from feat/cookie-transformer into develop 2026-11-17 23:35:30 +00:00
Owner

Do not merge until @green-tea/core RC.1 is published. add cookie uses @cookie and setCookie(), which are new in RC.1. Against the published beta.2, the starter smoke fails with TS2305: no exported member 'cookie'. Once RC.1 is out, this branch also takes the CORE_VERSION bump and drops the edge starter's JSR alias (core#93), and WIP: comes off the title.

What it adds

  • matcha add cookie:
    • GET /prefs reads the cookie with @cookie('theme').
    • POST /prefs sets it through @Transformer and setCookie(), encoding the value. Core has no response-cookie API.
  • matcha create transformer <Name>: writes src/transformers/<name>.transformer.ts (a typed TransformerFn) and prints the @Transformer(...) line that attaches it. Nothing is wired into a module, since a transformer belongs to a route.
  • starter-smoke.sh covers both.

Verification

  • cargo test passes, with new tests for add cookie (including idempotency) and create transformer.
  • The starter smoke ran against the RC.1 candidate (core df2e4b4, packed) and passed on node, bun, edge and deno.
  • The starter smoke against the published beta.2 fails on node, as expected (see above).
**Do not merge until `@green-tea/core` RC.1 is published.** `add cookie` uses `@cookie` and `setCookie()`, which are new in RC.1. Against the published beta.2, the starter smoke fails with `TS2305: no exported member 'cookie'`. Once RC.1 is out, this branch also takes the `CORE_VERSION` bump and drops the edge starter's JSR alias (core#93), and `WIP:` comes off the title. ## What it adds - `matcha add cookie`: - `GET /prefs` reads the cookie with `@cookie('theme')`. - `POST /prefs` sets it through `@Transformer` and `setCookie()`, encoding the value. Core has no response-cookie API. - `matcha create transformer <Name>`: writes `src/transformers/<name>.transformer.ts` (a typed `TransformerFn`) and prints the `@Transformer(...)` line that attaches it. Nothing is wired into a module, since a transformer belongs to a route. - `starter-smoke.sh` covers both. ## Verification - `cargo test` passes, with new tests for `add cookie` (including idempotency) and `create transformer`. - The starter smoke ran against the RC.1 candidate (core `df2e4b4`, packed) and passed on node, bun, edge and deno. - The starter smoke against the published beta.2 fails on node, as expected (see above).
chrnx added 1 commit 2026-10-31 04:02:37 +00:00
feat(add,create): matcha add cookie and matcha create transformer
CI / installer (macos-14) (pull_request) Successful in 3s
CI / check (pull_request) Successful in 27s
CI / starter (bun) (pull_request) Failing after 31s
CI / starter (deno) (pull_request) Failing after 32s
CI / starter (edge) (pull_request) Failing after 37s
CI / core-freshness (pull_request) Has been skipped
CI / installer (ubuntu-latest) (pull_request) Successful in 9s
CI / starter (node) (pull_request) Failing after 32s
8bd558991d
add cookie reads a cookie with @cookie and sets one through a
@Transformer and setCookie, since core sends Set-Cookie only as a
header. create transformer writes a typed TransformerFn and prints how to
attach it; there is nothing to wire into a module. starter-smoke now
covers both.

add cookie uses @cookie and setCookie, which are new in core RC.1, so
this lands together with the CORE_VERSION bump.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
chrnx added 1 commit 2026-11-17 23:31:08 +00:00
feat(templates): scaffold against core 26.11.0-rc.1; edge installs core from npm
CI / installer (macos-14) (pull_request) Successful in 4s
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
8e45c1170f
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>
chrnx marked the pull request as ready for review 2026-11-17 23:35:26 +00:00
chrnx merged commit 04d7a25402 into develop 2026-11-17 23:35:30 +00:00
chrnx deleted branch feat/cookie-transformer 2026-11-17 23:35:32 +00:00
chrnx referenced this issue from a commit 2026-11-17 23:38:02 +00:00
Sign in to join this conversation.