jake f195505a48 feat: add third-party registry support with @namespace/id module addressing
- Add `packages/registry/src/registry-config.ts` with a Zod schema for the `registries` field in `stanza.json` (string URL prefix or `{ url, indexUrl?, headers?, params? }` object), plus `parseModuleSpec` to split `@ns/id` specs and `expandEnv` to substitute `${VAR}` tokens in header values (dropping the header silently when the env var is unset)
- Replace `loadRegistry` with `loadRegistries(manifest)` in `registry-loader.ts`; the loader reads `registries` from `stanza.json`, builds a per-namespace fetch client with auth headers, and routes module loads to the correct HTTP endpoint — `@stanza` remains the implicit default namespace backed by the existing registry URL
- Update `add`, `remove`, `search`, and `list` commands to accept `[@<namespace>/]<id>` syntax; `namespace` is recorded alongside each module entry in `stanza.json` at install time so `remove` knows which registry to refetch from
- Enforce that codemods are catalog-only: third-party modules may reference first-party codemod IDs but cannot introduce new ones; catalog ID validation runs before any writes so unknown IDs are caught on `--dry-run` too
- Add a full third-party registry test suite in `commands.test.ts` using a stub `node:http` server: covers install + manifest recording, unknown-namespace rejection, remove round-trip (asserts correct namespace URL is hit), `${ENV_VAR}` header expansion, and codemod-catalog enforcement
- Export `DEFAULT_NAMESPACE` and `parseModuleSpec` from `@stanza/registry`; telemetry `cli_module` events now include a `namespace` field so first- vs. third-party installs can be distinguished in PostHog
- Add `apps/web/content/docs/authoring.mdx` covering the full module-authoring reference (schema fields, templates, adapters, codemods, third-party registry config)
2026-05-26 20:12:01 -04:00
2026-05-22 18:37:24 -04:00
2026-05-22 18:37:24 -04:00
2026-05-20 11:52:53 -04:00

Stanza

Modular monorepo template CLI — aka shadcn for full-stack TypeScript projects.

npm init stanza my-revolutionary-app

Pick a framework, ORM, database, auth provider, and UI — get a clean monorepo with idiomatic code, vendored into your repo. Layer in more modules later with stanza-cli add.

Warning

Major work in progress! See the module registry for the roadmap.

Why Stanza?

  • add works after init. Run stanza add on an existing project — it's manifest-driven and peer-aware, so it picks the right adapter for your stack and wires deps, env, and templates into the correct workspace package.
  • Your code, vendored. Generated files land in your repo verbatim. There's no Stanza runtime to install or carry around.
  • Open registry. Modules are static JSON. Point the CLI at your own host and serve custom modules.

Quick start

npm init stanza my-app
cd my-app
npm install
npm run dev

Add a module to an existing project at any time:

npx stanza-cli add auth better-auth

auth, db, and orm install into their own internal workspace packages (packages/auth/, packages/db/, named @<your-app>/auth, @<your-app>/db); your app consumes them via workspace:*. Swapping an auth provider replaces the contents of packages/auth/ without touching your app's imports.

Docs

Full guides and the CLI reference live at stanza.tools/docs. Assemble a stack visually with the builder at stanza.tools.

What's inside

apps/
  cli/            # stanza-cli — the CLI binary
  web/            # https://stanza.tools (TanStack Start)
packages/
  registry/       # shared schema, slot/peer/capability resolver
  codemods/       # ts-morph helpers for region-aware patching
  create-stanza/  # `npm init stanza` template shim
registry/
  modules/        # first-party modules (framework, orm, db, auth, ui, tooling, testing)

License

MIT

S
Description
🥁 shadcn for infrastructure.
https://stanza.tools
Readme MIT
3.7 MiB
Languages
TypeScript 91.5%
MDX 6.1%
CSS 2.2%
JavaScript 0.2%