buildflow

package
v0.20.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 10 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 buildflow is the single entry point for "prepare a Next.js

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Opts

type Opts struct {
	ProjectDir string
	Cfg        *config.NextDeployConfig
	Force      bool
	Log        *shared.Logger
}

Opts configures a single Run invocation.

type Result

type Result struct {
	Payload nextcore.NextCorePayload
	// "serverless" or "vps". Resolved from Cfg + payload.
	EffectiveTarget string
	StandaloneDir   string

	// ReleaseDir / TarballPath are populated only on the VPS path —
	// the artifact `nextdeploy ship` uploads to the remote daemon.
	ReleaseDir  string
	TarballPath string

	// Skipped is true when the incremental check matched and no rebuild
	// was attempted. `nextdeploy build` treats this as "exit success";
	// ship treats it as "use the existing artifacts".
	Skipped bool
}

Result is the artifact set produced by a Run.

func Run

func Run(ctx context.Context, opts Opts) (*Result, error)

Run executes the unified build flow:

  1. Incremental skip (unless Force): if the git commit AND the config fingerprint are unchanged, skip `next build` — but still regenerate metadata and repackage the VPS artifact, so what ships always matches the current config.
  2. Generate metadata (nextcore.GenerateMetadata) — reads next.config and the routes/prerender manifests.
  3. Validate output mode + features against the resolved target.
  4. Decide whether `next build` needs to run, and with which flags (Cloudflare requires --webpack; AWS / VPS take the user's default).
  5. For VPS: copy public/ + static/ + metadata.json into the release directory and create app.tar.gz.
  6. Audit the standalone tree — informational warnings for size.

Jump to

Keyboard shortcuts

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