What to build
Update the templates/default/ scaffolding template (used by npm create @sundayceo) to include a server entry file and Cloudflare Workers configuration as the default deployment target.
New files to add to templates/default/
src/server.ts — server entry composing the request handler with the Cloudflare adapter:
import { cloudflare } from "@sundayceo/framework/cloudflare";
import { app } from "./app";
import { routes, templates } from "./routes.gen";
export default cloudflare({
app,
getRoutes: () => routes,
loadRouteModule: (route) => route.load(),
loadTemplate: (id) => templates[id]().then((m) => m.default),
});
wrangler.jsonc — basic Wrangler configuration pointing at the built server entry.
Files to update
templates/default/package.json: Update the build script to vite build --ssr src/server.ts. Add wrangler as a devDependency. Add deploy script.
templates/default/src/app.ts: Add the Register declaration alongside createApp.
packages/cli/src/scaffold.ts: Add .jsonc to text extensions for placeholder replacement.
Acceptance criteria
Blocked by
What to build
Update the
templates/default/scaffolding template (used bynpm create @sundayceo) to include a server entry file and Cloudflare Workers configuration as the default deployment target.New files to add to
templates/default/src/server.ts— server entry composing the request handler with the Cloudflare adapter:wrangler.jsonc— basic Wrangler configuration pointing at the built server entry.Files to update
templates/default/package.json: Update thebuildscript tovite build --ssr src/server.ts. Addwrangleras a devDependency. Adddeployscript.templates/default/src/app.ts: Add theRegisterdeclaration alongsidecreateApp.packages/cli/src/scaffold.ts: Add.jsoncto text extensions for placeholder replacement.Acceptance criteria
src/server.tswith Cloudflare adapterwrangler.jsoncwith basic configpackage.jsonhas correct build script for SSRsrc/app.tsincludes theRegistermodule augmentationpnpm dev(Vite dev server)wrangler deployafter buildBlocked by