@williamthorsen/release-kit 10.4.4 → 10.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.readyup/kits/default.js +10 -3
- package/.readyup/kits/npm-auto-publish.js +11 -3
- package/.readyup/manifest.json +11 -11
- package/CHANGELOG.md +20 -0
- package/README.md +10 -2
- package/dist/esm/assertCleanWorkingTree.d.ts +5 -0
- package/dist/esm/buildChangelogEntries.d.ts +22 -0
- package/dist/esm/buildDependencyGraph.d.ts +16 -0
- package/dist/esm/buildEmptyReleaseEntry.d.ts +8 -0
- package/dist/esm/buildReleaseSummary.d.ts +10 -0
- package/dist/esm/buildSyntheticChangelogEntry.d.ts +6 -0
- package/dist/esm/bumpVersion.d.ts +8 -0
- package/dist/esm/changelogJsonFile.d.ts +11 -0
- package/dist/esm/changelogJsonUtils.d.ts +16 -0
- package/dist/esm/changelogOverrides.d.ts +143 -0
- package/dist/esm/checkWorkTypesDrift.d.ts +25 -0
- package/dist/esm/collectPolicyViolations.d.ts +9 -0
- package/dist/esm/commitCommand.d.ts +6 -0
- package/dist/esm/compareVersions.d.ts +7 -0
- package/dist/esm/createGithubRelease.d.ts +30 -0
- package/dist/esm/createGithubReleaseCommand.d.ts +7 -0
- package/dist/esm/createTags.d.ts +5 -0
- package/dist/esm/decideRelease.d.ts +37 -0
- package/dist/esm/defaults.d.ts +25 -0
- package/dist/esm/defineConfig.d.ts +9 -0
- package/dist/esm/deleteFileIfExists.d.ts +1 -0
- package/dist/esm/deriveWorkspaceConfig.d.ts +9 -0
- package/dist/esm/detectPackageManager.d.ts +6 -0
- package/dist/esm/detectUndeclaredTagPrefixes.d.ts +18 -0
- package/dist/esm/determineBumpFromCommits.d.ts +5 -0
- package/dist/esm/determineBumpType.d.ts +12 -0
- package/dist/esm/discoverWorkspaces.d.ts +12 -0
- package/dist/esm/format.d.ts +3 -0
- package/dist/esm/formatPrivateSkip.d.ts +6 -0
- package/dist/esm/generateChangelogs.d.ts +25 -0
- package/dist/esm/getCommitsSinceTarget.d.ts +16 -0
- package/dist/esm/hasPrettierConfig.d.ts +6 -0
- package/dist/esm/help/prepareHelp.d.ts +6 -0
- package/dist/esm/init/checks.d.ts +4 -0
- package/dist/esm/init/detectRepoType.d.ts +7 -0
- package/dist/esm/init/initCommand.d.ts +6 -0
- package/dist/esm/init/parseJsonRecord.d.ts +4 -0
- package/dist/esm/init/scaffold.d.ts +3 -1
- package/dist/esm/init/templates.d.ts +13 -0
- package/dist/esm/injectReleaseNotesIntoReadme.d.ts +39 -0
- package/dist/esm/injectSection.d.ts +6 -0
- package/dist/esm/loadConfig.d.ts +46 -0
- package/dist/esm/loadValidatedConfig.d.ts +8 -0
- package/dist/esm/parseCommitMessage.d.ts +42 -0
- package/dist/esm/parseRequestedTags.d.ts +7 -0
- package/dist/esm/planReleaseNotesPreviews.d.ts +20 -0
- package/dist/esm/planVersionBump.d.ts +12 -0
- package/dist/esm/prepareCommand.d.ts +10 -0
- package/dist/esm/previewTagPrefixes.d.ts +21 -1
- package/dist/esm/propagateBumps.d.ts +15 -0
- package/dist/esm/publish.d.ts +1 -0
- package/dist/esm/publishCommand.d.ts +4 -0
- package/dist/esm/pushCommand.d.ts +4 -0
- package/dist/esm/pushRelease.d.ts +6 -0
- package/dist/esm/readCurrentVersion.d.ts +1 -0
- package/dist/esm/releaseFiles.d.ts +22 -0
- package/dist/esm/releasePlan.d.ts +23 -0
- package/dist/esm/releasePrepare.d.ts +40 -0
- package/dist/esm/releasePrepareMono.d.ts +8 -0
- package/dist/esm/releasePrepareProject.d.ts +42 -0
- package/dist/esm/renderChangelogMarkdown.d.ts +17 -0
- package/dist/esm/renderReleaseNotes.d.ts +25 -0
- package/dist/esm/reportPrepare.d.ts +14 -0
- package/dist/esm/resolveCliffConfigPath.d.ts +10 -0
- package/dist/esm/resolveCommandTags.d.ts +13 -1
- package/dist/esm/resolveReleaseNotesConfig.d.ts +14 -0
- package/dist/esm/resolveReleaseTags.d.ts +22 -0
- package/dist/esm/runGitCliff.d.ts +43 -0
- package/dist/esm/showTagPrefixesCommand.d.ts +11 -0
- package/dist/esm/stripScope.d.ts +7 -0
- package/dist/esm/sync-labels/generateCommand.d.ts +17 -0
- package/dist/esm/sync-labels/initCommand.d.ts +9 -0
- package/dist/esm/sync-labels/presets.d.ts +6 -0
- package/dist/esm/sync-labels/resolveLabels.d.ts +10 -0
- package/dist/esm/sync-labels/retiredConfig.d.ts +8 -0
- package/dist/esm/sync-labels/syncCommand.d.ts +6 -0
- package/dist/esm/sync-labels/templates.d.ts +14 -0
- package/dist/esm/sync-labels/types.d.ts +4 -0
- package/dist/esm/syncWorkTypes.d.ts +18 -0
- package/dist/esm/tagCommand.d.ts +1 -0
- package/dist/esm/typeGuards.d.ts +2 -0
- package/dist/esm/types.d.ts +293 -0
- package/dist/esm/validateConfig.d.ts +14 -1
- package/dist/esm/validateOnlyExcludesStrandedDependents.d.ts +21 -0
- package/dist/esm/validateOverridesCommand.d.ts +30 -0
- package/dist/esm/workTypesData.d.ts +27 -0
- package/dist/esm/workTypesUtils.d.ts +17 -0
- package/package.json +8 -8
|
@@ -1,2 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Invokes `git-cliff` via `npx` and returns the output it produced.
|
|
3
|
+
*
|
|
4
|
+
* Single entry point for `git-cliff` invocations from `release-kit`. Owns three pieces of shared lifecycle
|
|
5
|
+
* that would otherwise duplicate (and silently drift) across call sites: the npx flags, the spawned-process
|
|
6
|
+
* environment, and the temp dir holding both the `.template`→`.toml` config copy and cliff's output file.
|
|
7
|
+
*
|
|
8
|
+
* Output is routed through `--output` to a temp file and read back. `--context` emits a workspace's
|
|
9
|
+
* entire matching tag history on every run, so its size grows without bound with the repo;
|
|
10
|
+
* a file accommodates that, while a pipe is bounded by `maxBuffer`.
|
|
11
|
+
*
|
|
12
|
+
* The `--prefer-offline` flag and `npm_config_progress=false` env entry are deliberate: `--prefer-offline` skips
|
|
13
|
+
* npx's per-call npm-registry revalidation HTTP round-trip (~2.5 s per invocation on a warm cache), and
|
|
14
|
+
* `npm_config_progress=false` suppresses npx's animated stderr spinner, which otherwise renders as a transient flicker.
|
|
15
|
+
*
|
|
16
|
+
* Because `--prefer-offline` also suppresses npx's cache-staleness check, the cached `git-cliff` binary
|
|
17
|
+
* would otherwise drift further and further behind upstream, with each cliff invocation re-emitting the
|
|
18
|
+
* "A new version of git-cliff is available" notice and the local cache never updating.
|
|
19
|
+
* `refreshGitCliffCache` (below) revalidates the cache once at the top of each `prepare` run so that
|
|
20
|
+
* subsequent `--prefer-offline` calls run against a current binary.
|
|
21
|
+
*
|
|
22
|
+
* The helper injects `--config <path>` and `--output <path>` itself — callers must NOT include either in `cliffArgs`.
|
|
23
|
+
* `--output` is appended last so a caller that passes one anyway cannot redirect the output the helper then reads.
|
|
24
|
+
* The caller is responsible for resolving the cliff config path (via `resolveCliffConfigPath`) before calling,
|
|
25
|
+
* since the resolution depends on the caller's `import.meta.url`.
|
|
26
|
+
*
|
|
27
|
+
* Errors from `execFileSync` are not caught: callers wrap with site-specific messages.
|
|
28
|
+
* The temp-dir cleanup runs in a `finally` so it still happens on throw.
|
|
29
|
+
*/
|
|
1
30
|
export declare function runGitCliff(cliffConfigPath: string, cliffArgs: readonly string[]): string;
|
|
31
|
+
/**
|
|
32
|
+
* Revalidate npx's cache for `git-cliff` once per `prepare` run.
|
|
33
|
+
*
|
|
34
|
+
* Spawns `npx --yes git-cliff --version` *without* `--prefer-offline`, so that npm performs its normal
|
|
35
|
+
* registry-staleness check and refreshes the cached binary if a newer version is available.
|
|
36
|
+
* Subsequent `runGitCliff` calls within the same run keep `--prefer-offline` (preserving the per-call perf win)
|
|
37
|
+
* but now run against an up-to-date cache, so git-cliff's own self-update notice no longer fires repeatedly.
|
|
38
|
+
*
|
|
39
|
+
* Stdio: stdin ignored, stdout piped (the version line is suppressed as noise), stderr inherited (npm errors and
|
|
40
|
+
* any rare upgrade notice surface, but only once per run). `maxBuffer` is declared even though the piped output
|
|
41
|
+
* is a single version line, because every call that pipes stdout declares one.
|
|
42
|
+
*
|
|
43
|
+
* Errors propagate unchanged — a failed cache refresh fails the prepare run loudly rather than silently degrading.
|
|
44
|
+
*/
|
|
2
45
|
export declare function refreshGitCliffCache(): void;
|
|
@@ -1 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Orchestrate the CLI `show-tag-prefixes` command.
|
|
3
|
+
*
|
|
4
|
+
* Prints a per-workspace table of derived prefixes, tag counts, and declared legacy
|
|
5
|
+
* entries, followed by an "Undeclared tag prefixes" section when candidate-shaped tags
|
|
6
|
+
* exist outside the known set. Exits `0` on full derivation success and no collisions;
|
|
7
|
+
* `1` on any derivation failure or collision. Undeclared candidates do not affect the
|
|
8
|
+
* exit code.
|
|
9
|
+
*
|
|
10
|
+
* @returns The exit code the caller should use.
|
|
11
|
+
*/
|
|
1
12
|
export declare function showTagPrefixesCommand(): Promise<number>;
|
package/dist/esm/stripScope.d.ts
CHANGED
|
@@ -1 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strip scope indicators from a raw commit message.
|
|
3
|
+
*
|
|
4
|
+
* Handles `scope|type: desc`, `type(scope): desc`, and messages with
|
|
5
|
+
* ticket prefixes (e.g., `#72 release-kit|fix: ...`). Returns the
|
|
6
|
+
* message unchanged when no scope is detected.
|
|
7
|
+
*/
|
|
1
8
|
export declare function stripScope(message: string): string;
|
|
@@ -1,10 +1,27 @@
|
|
|
1
1
|
import type { RepoLabelsConfig } from '../types.js';
|
|
2
2
|
import type { LabelDefinition } from './types.js';
|
|
3
|
+
/** Output path for the generated labels file. */
|
|
3
4
|
export declare const LABELS_OUTPUT_PATH = ".github/labels.yaml";
|
|
5
|
+
/** Formats resolved labels as YAML with generated header including preset hashes. */
|
|
4
6
|
export declare function formatLabelsYaml(labels: LabelDefinition[], presetHashes: Map<string, string>): string;
|
|
7
|
+
/**
|
|
8
|
+
* Loads `.config/release-kit.config.ts` and returns its `repoLabels` block.
|
|
9
|
+
*
|
|
10
|
+
* Reports an actionable error and returns `undefined` when the config file is missing,
|
|
11
|
+
* fails to load or validate, or carries no `repoLabels` block.
|
|
12
|
+
*/
|
|
5
13
|
export declare function loadRepoLabelsConfig(): Promise<RepoLabelsConfig | undefined>;
|
|
14
|
+
/** Options for the `sync-labels generate` subcommand. */
|
|
6
15
|
interface GenerateOptions {
|
|
16
|
+
/** Compare the regenerated content against the committed file instead of writing. */
|
|
7
17
|
check?: boolean;
|
|
8
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Runs the `sync-labels generate` command.
|
|
21
|
+
*
|
|
22
|
+
* Loads the `repoLabels` block from `.config/release-kit.config.ts`, resolves presets and label adjustments,
|
|
23
|
+
* and writes `.github/labels.yaml` -- or, with `check`, regenerates in memory and reports whether the committed file
|
|
24
|
+
* is stale, writing nothing. Returns 0 on success, 1 on failure.
|
|
25
|
+
*/
|
|
9
26
|
export declare function generateCommand({ check }?: GenerateOptions): Promise<number>;
|
|
10
27
|
export {};
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
+
/** Options for the `sync-labels init` subcommand. */
|
|
1
2
|
interface InitOptions {
|
|
2
3
|
dryRun: boolean;
|
|
3
4
|
force: boolean;
|
|
4
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* Run the `sync-labels init` subcommand.
|
|
8
|
+
*
|
|
9
|
+
* Discovers workspaces and retired packages, scaffolds the caller workflow, then seeds the
|
|
10
|
+
* `repoLabels` block: into a new `.config/release-kit.config.ts` when none exists, or
|
|
11
|
+
* printed to stdout for manual paste when the file is already there — an existing,
|
|
12
|
+
* hand-authored config is never rewritten. Returns 0 on success, 1 on failure.
|
|
13
|
+
*/
|
|
5
14
|
export declare function syncLabelsInitCommand({ dryRun, force }: InitOptions): Promise<number>;
|
|
6
15
|
export {};
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import type { LabelDefinition } from './types.js';
|
|
2
|
+
/** Computes SHA-256 hex digest of a preset file's raw content. Throws if the preset does not exist. */
|
|
2
3
|
export declare function hashPresetFile(presetName: string): string;
|
|
4
|
+
/**
|
|
5
|
+
* Loads a named preset from the bundled YAML files.
|
|
6
|
+
*
|
|
7
|
+
* Returns the parsed label definitions. Throws if the preset does not exist or has invalid content.
|
|
8
|
+
*/
|
|
3
9
|
export declare function loadPreset(presetName: string): LabelDefinition[];
|
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
import type { RepoLabelsConfig } from '../types.js';
|
|
2
2
|
import type { LabelDefinition } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Resolves the repository's label set from a `repoLabels` config block.
|
|
5
|
+
*
|
|
6
|
+
* Resolution is an ordered fold with last-writer-wins: presets are loaded in `extends` order (a later preset replaces
|
|
7
|
+
* an earlier preset's label of the same name), then the `labels` record is applied: An entry adds a label, replaces
|
|
8
|
+
* one an earlier layer defined, or removes it (`null`). Replacement is wholesale, so an entry omitting `description`
|
|
9
|
+
* drops the one an earlier layer supplied rather than inheriting it.
|
|
10
|
+
* Throws only on a dangling `null`: a removal naming a label no preset defined, which is a stale reference that
|
|
11
|
+
* would otherwise produce no output diff to review.
|
|
12
|
+
*/
|
|
3
13
|
export declare function resolveLabels(config: RepoLabelsConfig): LabelDefinition[];
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
+
/** Path of the retired standalone sync-labels config file. */
|
|
1
2
|
export declare const RETIRED_SYNC_LABELS_CONFIG_PATH = ".config/sync-labels.config.ts";
|
|
3
|
+
/**
|
|
4
|
+
* Report an actionable migration error when the retired standalone config file is present.
|
|
5
|
+
*
|
|
6
|
+
* Returns `true` when the file exists, in which case the caller must abort. The check is
|
|
7
|
+
* unconditional on config content: file presence alone triggers it, so a half-migrated
|
|
8
|
+
* repo cannot silently lose its custom labels.
|
|
9
|
+
*/
|
|
2
10
|
export declare function checkRetiredSyncLabelsConfig(): boolean;
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import type { LabelDefinition } from './types.js';
|
|
2
|
+
/** Generates the caller workflow YAML for `sync-labels`. */
|
|
2
3
|
export declare function syncLabelsWorkflow(): string;
|
|
4
|
+
/**
|
|
5
|
+
* Generates scope labels from workspace paths and retired-package names.
|
|
6
|
+
*
|
|
7
|
+
* Workspace labels are named after the path basename; retired-package labels after the unscoped package name.
|
|
8
|
+
* None carries a description: GitHub renders a described label taller and more prominently than a bare one, and
|
|
9
|
+
* the scope labels are meant to read as a compact group.
|
|
10
|
+
* Describing only the retired scopes would single them out for that prominence.
|
|
11
|
+
*/
|
|
3
12
|
export declare function buildScopeLabels(workspacePaths: string[], retiredNames?: string[]): LabelDefinition[];
|
|
13
|
+
/**
|
|
14
|
+
* Renders the `repoLabels` config block, indented for pasting into the object passed to `defineConfig` in
|
|
15
|
+
* `.config/release-kit.config.ts`.
|
|
16
|
+
*/
|
|
4
17
|
export declare function renderRepoLabelsBlock(scopeLabels: LabelDefinition[]): string;
|
|
18
|
+
/** Generates a new `.config/release-kit.config.ts` carrying the `repoLabels` block. */
|
|
5
19
|
export declare function repoLabelsConfigScript(scopeLabels: LabelDefinition[]): string;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
/** A single GitHub label definition compatible with EndBug/label-sync. */
|
|
1
2
|
export interface LabelDefinition {
|
|
3
|
+
/** Display name of the label. */
|
|
2
4
|
name: string;
|
|
5
|
+
/** Hex color code without the leading `#`. */
|
|
3
6
|
color: string;
|
|
7
|
+
/** Short description shown in the GitHub UI. Absent when the label carries none. */
|
|
4
8
|
description?: string;
|
|
5
9
|
}
|
|
@@ -1,10 +1,28 @@
|
|
|
1
|
+
/** Outcome of a sync operation. */
|
|
1
2
|
export interface SyncResult {
|
|
3
|
+
/**
|
|
4
|
+
* Process exit code semantics:
|
|
5
|
+
* - `0` — sync succeeded (file may be unchanged).
|
|
6
|
+
* - `2` — network error or local write failure.
|
|
7
|
+
* - `3` — schema mismatch (upstream JSON does not parse or fails the shape check).
|
|
8
|
+
*/
|
|
2
9
|
exitCode: 0 | 2 | 3;
|
|
3
10
|
message: string;
|
|
4
11
|
}
|
|
12
|
+
/** Minimal injection seam so unit tests can substitute a deterministic fetcher. */
|
|
5
13
|
export interface SyncWorkTypesDependencies {
|
|
14
|
+
/** Absolute path of the local `work-types.json`. Defaults to the bundled file. */
|
|
6
15
|
localPath?: string;
|
|
16
|
+
/** HTTP fetcher. Defaults to global `fetch`. */
|
|
7
17
|
fetch?: typeof globalThis.fetch;
|
|
18
|
+
/** Override the upstream URL (used by tests). */
|
|
8
19
|
upstreamUrl?: string;
|
|
9
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Fetch the upstream `work-types.json`, validate its top-level shape, and overwrite the
|
|
23
|
+
* locally-bundled copy with the formatted upstream contents.
|
|
24
|
+
*
|
|
25
|
+
* Output is reformatted to match the local file's conventions (2-space indent, trailing
|
|
26
|
+
* newline) so subsequent diffs are content-driven, not whitespace-driven.
|
|
27
|
+
*/
|
|
10
28
|
export declare function syncWorkTypes(dependencies?: SyncWorkTypesDependencies): Promise<SyncResult>;
|
package/dist/esm/tagCommand.d.ts
CHANGED
package/dist/esm/typeGuards.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
/** Check whether a value is a plain object (non-null, non-array). */
|
|
1
2
|
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
3
|
+
/** Narrow an `unknown` value to `unknown[]` via `Array.isArray`, avoiding `any[]`. */
|
|
2
4
|
export declare function isUnknownArray(value: unknown): value is unknown[];
|