projectdef

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 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 HubConfig added in v0.5.0

type HubConfig struct {
	Host string `yaml:"host"`
}

HubConfig controls optional Synchestra Hub integration. Presence of Host (non-empty) is the opt-in signal; when omitted, no Hub-related behavior (e.g. the hub-view-link lint rule) activates.

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"`
	Hub       *HubConfig      `yaml:"hub,omitempty"`
	Extras    map[string]any  `yaml:",inline"`
}

func ReadSpecConfig

func ReadSpecConfig(dir string) (SpecConfig, error)

func (SpecConfig) HubHost added in v0.5.0

func (c SpecConfig) HubHost() string

HubHost returns the configured Synchestra Hub base URL, or "" if Hub integration is not enabled for this project.

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