Summary
Admin-facing theme installer: zip upload endpoint, manifest validation, sandboxed esbuild compile of .tsx templates, forbidden-import linter, engineVersion check, SHA-256 of package, signature verification for registry installs. Outputs a theme row + extracted files in themes/{id}/.
Design reference
- docs/03-theme-system.md §12 (Theme Installer & Switcher)
- docs/03-theme-system.md §12.2 (Validation)
- docs/03-theme-system.md §12.3 (Security considerations)
Acceptance criteria
Dependencies
#5
Complexity
L
Summary
Admin-facing theme installer: zip upload endpoint, manifest validation, sandboxed esbuild compile of
.tsxtemplates, forbidden-import linter,engineVersioncheck, SHA-256 of package, signature verification for registry installs. Outputs athemerow + extracted files inthemes/{id}/.Design reference
Acceptance criteria
POST /api/v1/admin/themesaccepts atheme.zip(admin only)package.json.gonext.kind === "theme"theme.jsonagainst schema (theme.json v1 schema and validator #5).tsxfile in a sandbox; surfaces syntax errorsnode:fs,node:child_process, cookie-write APIs fromnext/headersengineVersionagainst host CMS versionDependencies
#5
Complexity
L