packagist

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package packagist implements `sf packagist status` — per-package release health for a tree of PHP packages: the latest local git tag vs whether that tag is pushed to origin vs the latest version published on Packagist. It answers the recurring "which packages still need a tag or a Packagist update?" question (the webhook does not auto-fire for every package) without re-deriving the publish recipe each time.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCommand

func NewCommand() *cobra.Command

NewCommand returns the `packagist` group (`sf packagist …`).

func Run

func Run(opts Options, w io.Writer) error

Run collects release status for every package under root and renders it.

func RunRelease

func RunRelease(opts ReleaseOptions, w io.Writer) error

RunRelease tags + pushes + triggers a Packagist update for one package, then verifies the new version appears. Mutating + network; honour --dry-run first.

Types

type Options

type Options struct {
	Root    string
	Format  string
	Offline bool // skip Packagist/remote network probes (tags only)
}

Options controls a `packagist status` run.

type ReleaseOptions

type ReleaseOptions struct {
	Root       string
	Target     string // package name / dir basename
	Version    string // semver tag to create/push (e.g. 2.1.0)
	Message    string // annotated-tag message (default: "Release <version>")
	Username   string // Packagist API username (default: the vendor prefix of the resolved package's composer.json name)
	AllowDirty bool
	DryRun     bool
	Timeout    time.Duration // verify poll budget
}

ReleaseOptions controls a `packagist release` run.

type ReleaseResult

type ReleaseResult struct {
	Package          string   `json:"package"`
	Dir              string   `json:"dir"`
	Version          string   `json:"version"`
	TagCreated       bool     `json:"tag_created"`
	TagPushed        bool     `json:"tag_pushed"`
	PackagistUpdated bool     `json:"packagist_updated"`
	Verified         bool     `json:"verified"`
	Packagist        string   `json:"packagist"`
	Steps            []string `json:"steps"`
}

ReleaseResult is the step-by-step outcome of a release.

type Status

type Status struct {
	Name      string `json:"name"`
	Dir       string `json:"dir"`
	LocalTag  string `json:"local_tag"`
	Pushed    string `json:"pushed"`    // yes | no | ?
	Packagist string `json:"packagist"` // latest published version, "" = none/unknown
	State     string `json:"state"`
}

Status is one package's release health.

func Collect

func Collect(root string, offline bool, fetch fetcher) ([]Status, error)

Collect builds the release status for each package under root. The fetcher is injectable for testing; when offline, Packagist/remote probes are skipped.

Jump to

Keyboard shortcuts

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