Documentation
¶
Overview ¶
Package composer implements `sf composer` — compact, TOON-first views over a tree of PHP packages described by composer.json files. It replaces the recurring, token-expensive pattern of `cat`-ing each package's composer.json (plus `git tag` and grepping phpstan.neon) just to learn the shape of a monorepo or a collection of sibling library repos.
sf composer ls [root] one digest row per package across a tree sf composer show <pkg> full metadata for a single package sf composer check [pkg] run each package's own quality gate, summarised
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCommand ¶
NewCommand returns the `composer` group (`sf composer …`).
Types ¶
type CheckOptions ¶
type CheckOptions struct {
Root string // tree to scan (default: cwd)
Target string // optional single package (name suffix or dir basename); empty = all
Format string
}
CheckOptions controls a `composer check` run.
type CheckResult ¶
type CheckResult struct {
Name string `json:"name"`
Dir string `json:"dir"`
OK bool `json:"ok"`
Exit int `json:"exit"`
DurationMs int64 `json:"dur_ms"`
Fail string `json:"fail,omitempty"`
}
CheckResult is the outcome of running one package's `check` script.
type Detail ¶
type Detail struct {
Name string `json:"name"`
Dir string `json:"dir"`
Version string `json:"version"`
Type string `json:"type"`
PHP string `json:"php"`
PHPStan string `json:"phpstan"`
Namespace string `json:"namespace,omitempty"`
Scripts []kv `json:"scripts,omitempty"`
Require []kv `json:"require,omitempty"`
RequireDev []kv `json:"require_dev,omitempty"`
}
Detail is the full single-package view shown by `composer show`.
func CollectOne ¶
CollectOne finds the package matching target under root and returns its Detail.
type Pkg ¶
type Pkg struct {
Name string `json:"name"`
Dir string `json:"dir"` // relative to scan root
Version string `json:"version"`
Type string `json:"type"`
PHP string `json:"php"`
PHPStan string `json:"phpstan"`
Namespace string `json:"namespace,omitempty"`
Scripts []string `json:"scripts,omitempty"`
Require []string `json:"require,omitempty"`
RequireDev []string `json:"require_dev,omitempty"`
}
Pkg is one package's digest, as shown by `composer ls`.
type ShowOptions ¶
type ShowOptions struct {
Root string // tree to search (default: cwd)
Target string // package name, name suffix, dir basename, or path
Format string
}
ShowOptions controls a `composer show` run.