Documentation
¶
Overview ¶
Package build generates the dist/ directory of the framework from src/: the unminified and minified bundles (script and ES module), the extensions, the ypy.max bundle, the editor files, the skills, the type declarations and the brotli copies.
Generate returns the whole output in memory so the same code serves the build (write it), the drift gate (compare it with the disk) and the size gate (measure it).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Write ¶
Write writes the output under dir, through an os.Root: no path can leave dir, and a symlink where an output file goes is replaced by the file (never written through). A full build (PartAll) first removes the stale files (see Compare), so the result does not keep files of a previous layout; it only does so in a directory that is empty, holds a ypy build or only entries the build writes, and refuses any other (a mistaken --out ~ would delete the user's files).
Types ¶
type Drift ¶
type Drift struct {
Missing []string // generated but not on disk
Changed []string // on disk with other bytes
Stale []string // on disk, owned by the build, not generated
}
Drift describes how the disk differs from the generated output.
type Options ¶
type Options struct {
// Root is the repository root: it holds src/.
Root string
// Only limits the output to one part; PartAll builds everything.
Only Part
}
Options configure Generate.
type Output ¶
Output is the generated tree: slash separated paths relative to the output directory, mapped to their bytes.
type Part ¶
type Part string
Part selects a slice of the output.
type SizeRow ¶
SizeRow is one measured file against its budget.