Documentation
¶
Index ¶
- Constants
- func DeleteProcessedChanges(dir string, meta ReleaseMeta) error
- func MaxBump(changes []Change) string
- func NextVersion(current, bump string) (string, error)
- func ReadVersion(path string) (string, error)
- func TodayDate() string
- func WriteReleaseMeta(dir string, meta ReleaseMeta) error
- func WriteVersion(path, version string) error
- type Change
- type ReleaseMeta
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 NextVersion ¶
NextVersion applies the bump to a semver string "X.Y.Z".
func ReadVersion ¶
ReadVersion reads VERSION file from repo root
func WriteReleaseMeta ¶
func WriteReleaseMeta(dir string, meta ReleaseMeta) error
func WriteVersion ¶
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 ¶
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)
Click to show internal directories.
Click to hide internal directories.