CodeVetter · Repo Unpack · Extension points
semantic-release/semantic-release
The lifecycle definition table is the core extension registry. Users extend behavior through package plugins, inline hook functions, and shareable configuration modules. Branch policy and typed API contracts provide separate extension surfaces, with explicit validation and result transformation rules.
- PLUGINS_DEFINITIONS registers verifyConditions, analyzeCommits, verifyRelease, generateNotes, prepare, publish, addChannel, success, and fail, with per-stage required/dryRun/validation/pipeline rules.
- A configured plugin object contributes only exports matching registered lifecycle names; each contributed function receives immutable pluginName metadata and retains list order.
- Plugin configuration accepts names, name/config tuples, and path-bearing objects; API callers can supply inline plugin objects, while individual stages accept functions.
- loadPlugin resolves relative to a shareable configuration when recorded, otherwise from core or cwd, and supports function inputs, default exports, and ESM named exports.
- Stage-specific options override collected plugin hooks; a plain options object without path is merged into existing stage plugin configurations before normalization.
- pipeline exposes settleAll, getNextInput, and transform; definitions use these for aggregated verification errors, accumulated notes, prepare HEAD refresh, and enriched publication results.
- Shareable configuration modules merge in sequence and record plugin origins; branch patterns can interpolate name into properties, while branch definitions provide classification and validation hooks.
- index.d.ts exposes stage-specific contexts, branch/release types, configuration, and the asynchronous API signature; extensions changing runtime shapes should also inspect these public declarations.