scaffold

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package scaffold generates a Cloudflare-ready fullstack Next.js starter (App Router + Drizzle + better-auth + R2 + Workers AI + proxy.ts guard) from embedded templates. It powers `nextdeploy init` when the user opts to scaffold a new app rather than deploy their existing one.

The DB layer is pluggable: "d1" (Cloudflare native SQLite) or "byo" (bring-your-own Postgres via Hyperdrive). A db-<variant> overlay is written on top of the shared base.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Scaffold

func Scaffold(opts Options) (written, skipped []string, err error)

Scaffold writes the base template plus the db-<variant> overlay into opts.Dir, substituting the app name. Existing files are never overwritten — their paths are returned in `skipped` so the caller can report them. Returns the written (created) paths and the skipped (pre-existing) paths, both sorted.

func TemplateFiles

func TemplateFiles(variant DBVariant) ([]string, error)

TemplateFiles returns the relative paths shipped for a given variant (base + overlay), sorted. Used by tests and the init summary.

Types

type DBVariant

type DBVariant string

DBVariant selects the database layer the template wires up.

const (
	DBD1  DBVariant = "d1"
	DBBYO DBVariant = "byo" // bring-your-own Postgres via Hyperdrive
)

type Options

type Options struct {
	AppName   string
	DBVariant DBVariant
	Dir       string // target directory (created if missing)
}

Options configures a scaffold run.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL