mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-25 06:14:59 +00:00
1.9 KiB
1.9 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.
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.