Documentation
¶
Overview ¶
Package project implements project-local devsys operations. M0.2 ships `workloom init` only; later milestones add the rest of the command family.
Index ¶
Constants ¶
const DevsysDirName = storage.DevsysDirName
DevsysDirName is the per-project state directory (方案 §14.3).
Variables ¶
This section is empty.
Functions ¶
func Slug ¶
Slug derives a devsys project identifier from a directory name: lowercase, [a-z0-9-] only, runs of other characters collapse to a single '-', leading and trailing '-' trimmed. Names that contain no usable characters (for example a fully non-ASCII directory name) fall back to a deterministic "project-<hash>" form so identifiers stay stable across machines.
Types ¶
type Options ¶
type Options struct {
// Now is the clock used for timestamps. Zero means time.Now().
Now time.Time
}
Options tunes Init; zero values are valid.
type PreconditionError ¶
type PreconditionError struct{ Msg string }
PreconditionError marks failures the user can fix in the environment (nested .devsys/, missing directory). The CLI maps it to its dedicated exit code so scripts can branch without parsing messages.
func (*PreconditionError) Error ¶
func (e *PreconditionError) Error() string
type Result ¶
type Result struct {
Root string // absolute project directory
ID string // project identifier (Slug of the root directory name)
Name string // root directory name
Created []string // paths created by this run, relative to Root, slash-separated, sorted
}
Result reports what Init created.
func Init ¶
Init creates the .devsys/ layout (方案 §14.3) in dir — the operator's directory after Abs — and returns what it created. Git is optional: the project identity is the directory that holds .devsys/, not a git toplevel. It is idempotent: existing files and directories are never modified or overwritten; only missing entries are added. Precondition failures happen before any filesystem change. Init never runs `git init`.