fix(create,starters): safe names and no overwrite in create; node starter awaits listen and declares engines #20

Merged
chrnx merged 1 commits from fix/create-names into develop 2026-10-31 04:00:21 +00:00
Owner

Step 4 of the RC.1 plan: the Matcha template and generator changes that do not depend on RC.1 being published.

create

  • The class name and token come from what was typed. current-user becomes CurrentUserStep, which provides currentUser. Before, it wrote current-userStep and return { current-user: null }, which does not parse. A single word is unchanged.
  • Rejects names that cannot be a class (2fast, us.ers).
  • For a step or provider, rejects a token core already provides: logger, rooms, events, bus (createApp refuses those), and the request tokens req, params, query, body, headers, cookies, inbound, abort (they would shadow what every route reads).
  • No longer overwrites an existing file. Running it twice used to silently discard edits.

starters

  • The node starter awaits app.listen(3000).
  • The node and edge starters declare engines: { node: ">=22" }.

Deferred until RC.1 is published

  • Bumping CORE_VERSION to the RC.1 version (the core-freshness job tracks it).
  • Removing the edge starter's npm:@jsr/... alias and .npmrc. The fix it works around (core#93) is in core's Unreleased section, so beta.2 on npm still cannot load on workerd.

Verification

  • cargo test: all suites pass, including 4 new create tests.
  • scripts/starter-smoke.sh node and edge pass.
Step 4 of the RC.1 plan: the Matcha template and generator changes that do not depend on RC.1 being published. ## create - The class name and token come from what was typed. `current-user` becomes `CurrentUserStep`, which provides `currentUser`. Before, it wrote `current-userStep` and `return { current-user: null }`, which does not parse. A single word is unchanged. - Rejects names that cannot be a class (`2fast`, `us.ers`). - For a step or provider, rejects a token core already provides: `logger`, `rooms`, `events`, `bus` (`createApp` refuses those), and the request tokens `req`, `params`, `query`, `body`, `headers`, `cookies`, `inbound`, `abort` (they would shadow what every route reads). - No longer overwrites an existing file. Running it twice used to silently discard edits. ## starters - The node starter awaits `app.listen(3000)`. - The node and edge starters declare `engines: { node: ">=22" }`. ## Deferred until RC.1 is published - Bumping `CORE_VERSION` to the RC.1 version (the `core-freshness` job tracks it). - Removing the edge starter's `npm:@jsr/...` alias and `.npmrc`. The fix it works around (core#93) is in core's Unreleased section, so beta.2 on npm still cannot load on workerd. ## Verification - `cargo test`: all suites pass, including 4 new create tests. - `scripts/starter-smoke.sh node` and `edge` pass.
chrnx added 1 commit 2026-10-31 02:01:11 +00:00
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
a8f1658e4d
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>
chrnx merged commit d9f2b07802 into develop 2026-10-31 04:00:21 +00:00
Sign in to join this conversation.