projectdef

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

README

pkg/projectdef

specscore-project.yaml schema and read/write operations for all repository config file types (spec, state, code, embedded state).

Outstanding Questions

None at this time.

Documentation

Index

Constants

View Source
const (
	SpecConfigFile = "specscore-spec-repo.yaml"
	CodeConfigFile = "specscore-code-repo.yaml"
)

Variables

This section is empty.

Functions

func WriteCodeConfig

func WriteCodeConfig(dir string, cfg CodeConfig) error

func WriteSpecConfig

func WriteSpecConfig(dir string, cfg SpecConfig) error

func WriteYAML added in v0.3.2

func WriteYAML(path string, v any) error

WriteYAML marshals v to YAML and writes it to path.

Types

type CodeConfig

type CodeConfig struct {
	SpecRepos []string `yaml:"spec_repos"`
}

func ReadCodeConfig

func ReadCodeConfig(dir string) (CodeConfig, error)

type PlanningConfig

type PlanningConfig struct {
	WhatsNext string `yaml:"whats_next"`
}

type SpecConfig

type SpecConfig struct {
	Title     string          `yaml:"title"`
	StateRepo string          `yaml:"state_repo"`
	Repos     []string        `yaml:"repos"`
	Planning  *PlanningConfig `yaml:"planning,omitempty"`
	Extras    map[string]any  `yaml:",inline"`
}

func ReadSpecConfig

func ReadSpecConfig(dir string) (SpecConfig, error)

func (SpecConfig) ParseStateRepo

func (c SpecConfig) ParseStateRepo() (mode, branch string)

ParseStateRepo parses the state_repo field. Returns (mode, branch):

  • ("worktree", branchName) for "worktree://branchName"
  • ("repo", "") for any other non-empty value
  • ("", "") if state_repo is empty

func (SpecConfig) WhatsNextMode

func (c SpecConfig) WhatsNextMode() string

WhatsNextMode returns the effective whats_next mode, defaulting to "disabled".

Jump to

Keyboard shortcuts

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