mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-25 14:25:02 +00:00
2.5 KiB
2.5 KiB
Codegen Studio Export
The Codegen Studio package now ships a fully reproducible starter bundle that can be downloaded as a .zip. The generator is exposed via a server-side service that blends the declarative packages system, C++ companion assets, and Next.js scaffolding.
API
- Endpoint:
POST /api/codegen/studio - Payload: JSON object
{ projectName, packageId, runtime, tone?, brief? } - Response: Streaming ZIP file with
Content-Type: application/zipandX-Codegen-Manifestcarrying the manifest metadata.
Example cURL:
curl -X POST http://localhost:3000/api/codegen/studio \
-H 'Content-Type: application/json' \
-d '{"projectName":"nebula-launch","packageId":"codegen_studio","runtime":"web","tone":"newsroom"}' \
-o nebula-launch.zip
Generated bundle contents
Every archive includes:
README.mdsummarizing the runtime, tone, and selected package.package.jsonwith baseline Next.js scripts and dependencies.src/app/page.tsxwith a simple hero section referencing the brief.cli/main.cppandcli/README.mdas the C++ companion (the CLI echoes the same spec).spec.jsondocumenting the manifest shipped with the zip.
The runtime-specific paragraph is drawn from the runtime value, and the CLI stub prints project, runtime, package, tone, and brief so Super God users can inspect it before shipping.
Interactive builder
- Path:
/codegen - Experience: A Material UI-powered scaffold designer that bundles the same payload used by the API and streams the ZIP for download.
- Feedback: Inline alerts surface success or failure so teams can iteratively tune briefs before sharing the starter kit with collaborators.
- Preview: A manifest panel summarizes the generated values (runtime, tone, package, timestamp) after each export.
- Bundle contents: The UI also renders the file list that will land inside the archive so creators can make last-second adjustments.
Development tooling
frontends/nextjs/src/lib/codegen/*houses the generator helpers: one function per file (createProjectTemplate,generateCodegenZip).- Vitest suites in
frontends/nextjs/src/lib/codegenverify the template structure and zipped contents. tools/validate-codegen-export.tsruns the generator end-to-end, materializes a temporary zip, and ensures required files exist so workflows can call it as a sanity check.
The CLI companion under packages/codegen_studio/static_content/cli/main.cpp now prints structured manifest details as the generator produces them.