changesets

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultDir      = ".changesets"
	ReleaseMetaFile = "current-release.json"
	VersionFile     = "VERSION"
	ChangelogFile   = "CHANGELOG.md"

	BumpMajor = "major"
	BumpMinor = "minor"
	BumpPatch = "patch"
)

Variables

This section is empty.

Functions

func DeleteProcessedChanges

func DeleteProcessedChanges(dir string, meta ReleaseMeta) error

DeleteProcessedChanges removes the .md files included in a release and the meta file itself.

func MaxBump

func MaxBump(changes []Change) string

MaxBump returns the highest bump level across all changes.

func NextVersion

func NextVersion(current, bump string) (string, error)

NextVersion applies the bump to a semver string "X.Y.Z".

func ReadVersion

func ReadVersion(path string) (string, error)

ReadVersion reads VERSION file from repo root

func TodayDate

func TodayDate() string

TodayDate returns YYYY-MM-DD in local time.

func WriteReleaseMeta

func WriteReleaseMeta(dir string, meta ReleaseMeta) error

func WriteVersion

func WriteVersion(path, version string) error

Types

type Change

type Change struct {
	File  string `json:"file"`
	Title string `json:"title"`
	Bump  string `json:"bump"` // "patch" | "minor" | "major"
	Date  string `json:"date"` // "YYYY-MM-DD"
	Note  string `json:"note"` // full markdown body
}

func LoadPending

func LoadPending(dir string) ([]Change, error)

LoadPending reads all .md files in .changesets (except those starting with "_") and parses their frontmatter + body into Change structs.

type ReleaseMeta

type ReleaseMeta struct {
	Version         string   `json:"version"`
	PreviousVersion string   `json:"previous_version"`
	Created         string   `json:"created"` // ISO timestamp
	Changes         []Change `json:"changes"`
}

func ReadReleaseMeta

func ReadReleaseMeta(dir string) (ReleaseMeta, error)

Jump to

Keyboard shortcuts

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