CodeVetter · Repo Unpack · Data flow
changesets/changesets
Release intent enters through CLI selections or editable changeset files. Schema validation and workspace discovery normalize configuration before the planner builds package-indexed state. Version application persists calculated results, while publishing independently compares current manifests against registry state. Artifact and reporting files are additional output boundaries with different formats and trust assumptions.
- normalizeOptions expands comma-separated bump/ignore values, removes aliases, keeps the last repeated scalar, and converts numeric-looking options to strings; CHANGESETS_OUTPUT supplies missing output paths.
- readConfig loads config.json from the discovered workspace root; validateConfig applies Valibot parsing, normalizeWrittenConfig, and package-aware validation rules before returning config or errors.
- writeChangeset converts releases and summary into quoted YAML frontmatter plus Markdown, assigns a human-readable ID, writes .changeset/<id>.md, and invokes the configured/detected formatter.
- readChangesets combines root and pre-directory Markdown, optionally filters by Git ref, excludes hidden/helper files, and returns parseChangesetFile results with path-derived IDs; parsing validates release names and types.
- flattenReleases builds a package-to-release Map, retains every contributing changeset ID, and selects the highest bump; assembleReleasePlan repeatedly mutates that state through dependents, fixed constraints, and links.
- applyReleasePlan attaches Git commit metadata for changelog generators, edits package and root dependency fields, formats changelogs, then archives active-prerelease changesets or removes consumed ordinary changesets while preserving skipped ones.
- getUnpublishedPackages queues registry info calls, compares local versions against published versions, assigns access/tag, and sortReleases produces dependency-ordered chunks excluding dev dependencies; shared limits are 40 registry requests and 10 publishes.
- pack records relative tarball paths and SHA-256 integrity in a versioned JSON plan; publication resolves those paths, while Git-tag reporting appends NDJSON events and flushes the stream on async disposal.