project

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: MIT Imports: 13 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 project implements project-local devsys operations. M0.2 ships `workloom init` only; later milestones add the rest of the command family.

Index

Constants

View Source
const DevsysDirName = storage.DevsysDirName

DevsysDirName is the per-project state directory (方案 §14.3).

Variables

This section is empty.

Functions

func Slug

func Slug(name string) string

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

func Init(dir string, opts Options) (*Result, error)

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`.

Jump to

Keyboard shortcuts

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