scaffold

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 platform overlays into opts.Dir, substituting the app name and platform details. 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
	Platform        Platform
	DBVariant       DBVariant
	EnableGoSidecar bool
	Dir             string // target directory (created if missing)
}

Options configures a scaffold run.

type Platform added in v0.19.0

type Platform string

Platform selects the deployment target platform.

const (
	PlatformCloudflare Platform = "cloudflare"
	PlatformVPS        Platform = "vps"
	PlatformAWS        Platform = "aws"
)

Jump to

Keyboard shortcuts

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