@williamthorsen/release-kit 11.0.0 โ 13.0.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/.meta/changelog.json +274 -2
- package/.readyup/kits/default.js +18 -33
- package/.readyup/kits/npm-auto-publish.js +24 -23
- package/.readyup/manifest.json +16 -11
- package/CHANGELOG.md +98 -0
- package/README.md +57 -69
- package/bin/release-kit.js +1 -1
- package/dist/esm/assertCleanWorkingTree.d.ts +1 -5
- package/dist/esm/assertTaggedBaseline.d.ts +29 -0
- package/dist/esm/assertTaggedBaseline.js +41 -0
- package/dist/esm/attachChangelogDiagnostics.d.ts +4 -0
- package/dist/esm/attachChangelogDiagnostics.js +14 -0
- package/dist/esm/bin/release-kit.js +88 -24
- package/dist/esm/buildChangelogEntries.d.ts +69 -17
- package/dist/esm/buildChangelogEntries.js +222 -120
- package/dist/esm/buildDependencyGraph.d.ts +6 -6
- package/dist/esm/buildEmptyReleaseEntry.d.ts +1 -8
- package/dist/esm/buildReleaseSummary.d.ts +2 -8
- package/dist/esm/buildReleaseSummary.js +2 -2
- package/dist/esm/buildSyntheticChangelogEntry.d.ts +3 -5
- package/dist/esm/buildSyntheticChangelogEntry.js +2 -2
- package/dist/esm/bumpVersion.d.ts +1 -8
- package/dist/esm/changelogJsonFile.d.ts +5 -7
- package/dist/esm/changelogJsonFile.js +2 -17
- package/dist/esm/changelogJsonUtils.d.ts +7 -10
- package/dist/esm/changelogOverrides.d.ts +79 -100
- package/dist/esm/changelogOverrides.js +138 -58
- package/dist/esm/classifyChangelogCommit.d.ts +36 -0
- package/dist/esm/classifyChangelogCommit.js +34 -0
- package/dist/esm/commitCommand.d.ts +2 -4
- package/dist/esm/compareVersions.d.ts +10 -4
- package/dist/esm/compareVersions.js +16 -0
- package/dist/esm/configFlagSchema.d.ts +1 -1
- package/dist/esm/createGithubRelease.d.ts +7 -19
- package/dist/esm/createGithubReleaseCommand.d.ts +5 -5
- package/dist/esm/createGithubReleaseCommand.js +9 -9
- package/dist/esm/createTags.d.ts +2 -3
- package/dist/esm/decideRelease.d.ts +11 -41
- package/dist/esm/decideRelease.js +5 -27
- package/dist/esm/defaults.d.ts +5 -24
- package/dist/esm/defaults.js +7 -5
- package/dist/esm/defineConfig.d.ts +1 -1
- package/dist/esm/deleteFileIfExists.d.ts +1 -1
- package/dist/esm/deriveReleaseNotesConfig.d.ts +20 -0
- package/dist/esm/deriveReleaseNotesConfig.js +21 -0
- package/dist/esm/deriveWorkspaceConfig.d.ts +3 -5
- package/dist/esm/detectPackageManager.d.ts +2 -4
- package/dist/esm/detectUndeclaredTagPrefixes.d.ts +4 -6
- package/dist/esm/detectUndeclaredTagPrefixes.js +1 -1
- package/dist/esm/determineBumpType.d.ts +11 -11
- package/dist/esm/determineBumpType.js +6 -7
- package/dist/esm/discoverWorkspaces.d.ts +14 -15
- package/dist/esm/discoverWorkspaces.js +12 -12
- package/dist/esm/enterRepoRoot.d.ts +12 -0
- package/dist/esm/enterRepoRoot.js +16 -0
- package/dist/esm/enumerateReleaseWindows.d.ts +50 -0
- package/dist/esm/enumerateReleaseWindows.js +124 -0
- package/dist/esm/extractMigration.d.ts +6 -8
- package/dist/esm/findUnroutedEntryScopes.d.ts +16 -0
- package/dist/esm/findUnroutedEntryScopes.js +57 -0
- package/dist/esm/formatExcludedSkip.d.ts +3 -0
- package/dist/esm/formatExcludedSkip.js +3 -0
- package/dist/esm/formatPrivateSkip.d.ts +1 -6
- package/dist/esm/generateChangelogs.d.ts +13 -26
- package/dist/esm/generateChangelogs.js +0 -14
- package/dist/esm/glyphs.d.ts +2 -2
- package/dist/esm/help/prepareHelp.d.ts +3 -4
- package/dist/esm/help/prepareHelp.js +7 -8
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/init/checks.d.ts +3 -3
- package/dist/esm/init/checks.js +4 -1
- package/dist/esm/init/detectRepoType.d.ts +2 -3
- package/dist/esm/init/hasProvenance.d.ts +2 -0
- package/dist/esm/init/hasProvenance.js +3 -0
- package/dist/esm/init/initCommand.d.ts +3 -6
- package/dist/esm/init/initCommand.js +11 -11
- package/dist/esm/init/parseJsonRecord.d.ts +1 -4
- package/dist/esm/init/scaffold.d.ts +1 -3
- package/dist/esm/init/scaffold.js +2 -30
- package/dist/esm/init/templates.d.ts +9 -11
- package/dist/esm/init/templates.js +12 -11
- package/dist/esm/init/updateTemplatesCommand.d.ts +13 -0
- package/dist/esm/init/updateTemplatesCommand.js +64 -0
- package/dist/esm/injectReleaseNotesIntoReadme.d.ts +12 -17
- package/dist/esm/injectSection.d.ts +3 -3
- package/dist/esm/loadConfig.d.ts +16 -14
- package/dist/esm/loadConfig.js +2 -5
- package/dist/esm/loadValidatedConfig.d.ts +16 -19
- package/dist/esm/loadValidatedConfig.js +6 -1
- package/dist/esm/packsPath.d.ts +9 -9
- package/dist/esm/parseChangeRecordBlock.d.ts +37 -0
- package/dist/esm/parseChangeRecordBlock.js +134 -0
- package/dist/esm/parseCommitMessage.d.ts +42 -32
- package/dist/esm/parseCommitMessage.js +33 -41
- package/dist/esm/parseRequestedTags.d.ts +3 -3
- package/dist/esm/planReleaseNotesPreviews.d.ts +6 -6
- package/dist/esm/planVersionBump.d.ts +5 -3
- package/dist/esm/planVersionBump.js +3 -0
- package/dist/esm/prepareCommand.d.ts +4 -7
- package/dist/esm/prepareCommand.js +17 -18
- package/dist/esm/previewTagPrefixes.d.ts +8 -10
- package/dist/esm/propagateBumps.d.ts +6 -7
- package/dist/esm/publish.d.ts +1 -1
- package/dist/esm/publishCommand.d.ts +4 -3
- package/dist/esm/publishCommand.js +8 -8
- package/dist/esm/pushCommand.d.ts +4 -3
- package/dist/esm/pushCommand.js +8 -2
- package/dist/esm/pushRelease.d.ts +2 -2
- package/dist/esm/readChangelogSections.d.ts +33 -0
- package/dist/esm/readChangelogSections.js +80 -0
- package/dist/esm/releaseFiles.d.ts +5 -7
- package/dist/esm/releasePlan.d.ts +11 -13
- package/dist/esm/releasePrepare.d.ts +25 -25
- package/dist/esm/releasePrepare.js +80 -80
- package/dist/esm/releasePrepareMono.d.ts +9 -7
- package/dist/esm/releasePrepareMono.js +114 -99
- package/dist/esm/releasePrepareProject.d.ts +19 -29
- package/dist/esm/releasePrepareProject.js +46 -45
- package/dist/esm/renderChangelogMarkdown.d.ts +10 -4
- package/dist/esm/renderChangelogMarkdown.js +27 -2
- package/dist/esm/renderReleaseNotes.d.ts +3 -11
- package/dist/esm/renderReleaseNotes.js +2 -6
- package/dist/esm/reportPrepare.d.ts +4 -5
- package/dist/esm/reportPrepare.js +67 -42
- package/dist/esm/resolveCommandTags.d.ts +15 -11
- package/dist/esm/resolveCommandTags.js +35 -5
- package/dist/esm/resolveConfigFlag.d.ts +7 -0
- package/dist/esm/resolveConfigFlag.js +4 -0
- package/dist/esm/resolveReleaseTags.d.ts +6 -8
- package/dist/esm/resolveReleaseTags.js +1 -1
- package/dist/esm/resolveStylesOrExit.d.ts +2 -2
- package/dist/esm/showTagPrefixesCommand.d.ts +7 -10
- package/dist/esm/showTagPrefixesCommand.js +4 -4
- package/dist/esm/stripEmojiPrefix.d.ts +1 -0
- package/dist/esm/stripScope.d.ts +2 -2
- package/dist/esm/stripScope.js +3 -3
- package/dist/esm/sync-labels/generateCommand.d.ts +11 -10
- package/dist/esm/sync-labels/generateCommand.js +11 -8
- package/dist/esm/sync-labels/initCommand.d.ts +6 -7
- package/dist/esm/sync-labels/initCommand.js +2 -2
- package/dist/esm/sync-labels/presets.d.ts +5 -4
- package/dist/esm/sync-labels/presets.js +9 -9
- package/dist/esm/sync-labels/resolveLabels.d.ts +7 -7
- package/dist/esm/sync-labels/resolveLabels.js +1 -1
- package/dist/esm/sync-labels/retiredConfig.d.ts +4 -5
- package/dist/esm/sync-labels/syncCommand.d.ts +1 -4
- package/dist/esm/sync-labels/templates.d.ts +3 -3
- package/dist/esm/sync-labels/templates.js +3 -3
- package/dist/esm/sync-labels/typeLabels.d.ts +14 -0
- package/dist/esm/sync-labels/typeLabels.js +38 -0
- package/dist/esm/sync-labels/types.d.ts +1 -1
- package/dist/esm/tagCommand.d.ts +1 -1
- package/dist/esm/typeGuards.d.ts +2 -2
- package/dist/esm/types.d.ts +185 -116
- package/dist/esm/types.js +2 -2
- package/dist/esm/validateConfig.d.ts +2 -11
- package/dist/esm/validateConfig.js +5 -1
- package/dist/esm/validateOnlyExcludesStrandedDependents.d.ts +14 -12
- package/dist/esm/validateOverridesCommand.d.ts +19 -21
- package/dist/esm/validateOverridesCommand.js +16 -23
- package/docs/api.md +6 -6
- package/docs/changelogs.md +90 -28
- package/docs/configuration.md +30 -29
- package/docs/editorial-overrides.md +90 -31
- package/docs/labels.md +21 -19
- package/docs/project-releases.md +14 -14
- package/docs/publishing.md +5 -5
- package/docs/readiness-checks.md +3 -3
- package/docs/releasing.md +54 -24
- package/docs/work-types.md +46 -58
- package/package.json +7 -7
- package/presets/labels/common.yaml +1 -41
- package/schemas/changelog-overrides.json +39 -0
- package/cliff.toml.template +0 -65
- package/dist/esm/collectPolicyViolations.d.ts +0 -15
- package/dist/esm/collectPolicyViolations.js +0 -12
- package/dist/esm/determineBumpFromCommits.d.ts +0 -17
- package/dist/esm/determineBumpFromCommits.js +0 -28
- package/dist/esm/getCommitsSinceTarget.d.ts +0 -21
- package/dist/esm/getCommitsSinceTarget.js +0 -66
- package/dist/esm/resolveCliffConfigPath.d.ts +0 -11
- package/dist/esm/resolveCliffConfigPath.js +0 -20
- package/dist/esm/resolveReleaseNotesConfig.d.ts +0 -26
- package/dist/esm/resolveReleaseNotesConfig.js +0 -29
- package/dist/esm/runGitCliff.d.ts +0 -38
- package/dist/esm/runGitCliff.js +0 -25
- package/dist/esm/workTypesData.d.ts +0 -50
- package/dist/esm/workTypesData.js +0 -145
- package/schemas/label-map.json +0 -24
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Commit } from './types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Gets commits since the latest baseline tag matching any of the given prefixes.
|
|
4
|
-
*
|
|
5
|
-
* Uses `git log` to retrieve commit messages and hashes between the closest reachable
|
|
6
|
-
* baseline tag and HEAD. When no tag matches any prefix, all commits reachable from HEAD
|
|
7
|
-
* are returned.
|
|
8
|
-
*
|
|
9
|
-
* Callers must pass at least one prefix; the single-prefix case is the common one (the
|
|
10
|
-
* workspace's derived prefix). Multiple prefixes are used to include historical tag prefixes
|
|
11
|
-
* from `legacyIdentities`.
|
|
12
|
-
*
|
|
13
|
-
* @param tagPrefixes - Tag prefixes to search as a union (e.g., `['core-v', 'old-core-v']`).
|
|
14
|
-
* @param paths - Optional glob patterns to filter commits by path (appended after `--` in `git log`).
|
|
15
|
-
* Path patterns use POSIX-style forward slashes; Windows compatibility is not guaranteed.
|
|
16
|
-
* @returns An object with the found tag (if any) and the list of commits.
|
|
17
|
-
*/
|
|
18
|
-
export declare function getCommitsSinceTarget(tagPrefixes: readonly string[], paths?: string[]): {
|
|
19
|
-
tag: string | undefined;
|
|
20
|
-
commits: Commit[];
|
|
21
|
-
};
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { execFileSync } from 'node:child_process';
|
|
2
|
-
import { GIT_OUTPUT_LIMIT } from '@williamthorsen/nmr-core';
|
|
3
|
-
import { chainError } from '@williamthorsen/toolbelt.errors/candidate';
|
|
4
|
-
const FIELD_SEPARATOR = '\u{1F}';
|
|
5
|
-
function isNoTagError(err) {
|
|
6
|
-
return typeof err === 'object' && err !== null && 'status' in err && err.status === 128;
|
|
7
|
-
}
|
|
8
|
-
function findLatestTag(tagPrefixes) {
|
|
9
|
-
if (tagPrefixes.length === 0) {
|
|
10
|
-
throw new Error('findLatestTag: tagPrefixes must contain at least one entry');
|
|
11
|
-
}
|
|
12
|
-
const matchArgs = tagPrefixes.map((prefix) => `--match=${prefix}*`);
|
|
13
|
-
try {
|
|
14
|
-
const tagResult = execFileSync('git', ['describe', '--tags', '--abbrev=0', ...matchArgs], {
|
|
15
|
-
encoding: 'utf8',
|
|
16
|
-
maxBuffer: GIT_OUTPUT_LIMIT,
|
|
17
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
18
|
-
}).trim();
|
|
19
|
-
return tagResult || undefined;
|
|
20
|
-
}
|
|
21
|
-
catch (error) {
|
|
22
|
-
if (isNoTagError(error)) {
|
|
23
|
-
return undefined;
|
|
24
|
-
}
|
|
25
|
-
throw chainError(`Failed to run 'git describe'`, error);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
const RELEASE_COMMIT_PREFIX = 'release:';
|
|
29
|
-
function parseLogOutput(logOutput) {
|
|
30
|
-
const commits = [];
|
|
31
|
-
for (const line of logOutput.split('\n')) {
|
|
32
|
-
const trimmedLine = line.trim();
|
|
33
|
-
if (trimmedLine === '') {
|
|
34
|
-
continue;
|
|
35
|
-
}
|
|
36
|
-
const [message, hash] = trimmedLine.split(FIELD_SEPARATOR);
|
|
37
|
-
if (message !== undefined && hash !== undefined && !message.startsWith(RELEASE_COMMIT_PREFIX)) {
|
|
38
|
-
commits.push({ message, hash });
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return commits;
|
|
42
|
-
}
|
|
43
|
-
export function getCommitsSinceTarget(tagPrefixes, paths) {
|
|
44
|
-
const tag = findLatestTag(tagPrefixes);
|
|
45
|
-
const range = tag === undefined ? 'HEAD' : `${tag}..HEAD`;
|
|
46
|
-
const format = `%s${FIELD_SEPARATOR}%H`;
|
|
47
|
-
const args = ['log', range, `--pretty=format:${format}`];
|
|
48
|
-
if (paths !== undefined && paths.length > 0) {
|
|
49
|
-
args.push('--', ...paths);
|
|
50
|
-
}
|
|
51
|
-
let logOutput;
|
|
52
|
-
try {
|
|
53
|
-
logOutput = execFileSync('git', args, {
|
|
54
|
-
encoding: 'utf8',
|
|
55
|
-
maxBuffer: GIT_OUTPUT_LIMIT,
|
|
56
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
57
|
-
}).trim();
|
|
58
|
-
}
|
|
59
|
-
catch (error) {
|
|
60
|
-
throw chainError(`Failed to run 'git log' for range '${range}'`, error);
|
|
61
|
-
}
|
|
62
|
-
if (logOutput === '') {
|
|
63
|
-
return { tag, commits: [] };
|
|
64
|
-
}
|
|
65
|
-
return { tag, commits: parseLogOutput(logOutput) };
|
|
66
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Resolve the git-cliff configuration file path.
|
|
3
|
-
*
|
|
4
|
-
* Checks candidates in order: explicit `cliffConfigPath` -> `.config/git-cliff.toml` ->
|
|
5
|
-
* `cliff.toml` -> bundled `cliff.toml.template`. Returns the first path that exists,
|
|
6
|
-
* or throws if even the bundled template cannot be found.
|
|
7
|
-
*
|
|
8
|
-
* When an explicit `cliffConfigPath` is provided, it is returned as-is without checking
|
|
9
|
-
* existence, preserving current behavior (git-cliff reports the error if the file is missing).
|
|
10
|
-
*/
|
|
11
|
-
export declare function resolveCliffConfigPath(cliffConfigPath: string | undefined, metaUrl: string): string;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { existsSync } from 'node:fs';
|
|
2
|
-
import { resolve } from 'node:path';
|
|
3
|
-
import { findPackageRoot } from '@williamthorsen/nmr-core';
|
|
4
|
-
export function resolveCliffConfigPath(cliffConfigPath, metaUrl) {
|
|
5
|
-
if (cliffConfigPath !== undefined) {
|
|
6
|
-
return cliffConfigPath;
|
|
7
|
-
}
|
|
8
|
-
const candidates = ['.config/git-cliff.toml', 'cliff.toml'];
|
|
9
|
-
for (const candidate of candidates) {
|
|
10
|
-
if (existsSync(candidate)) {
|
|
11
|
-
return candidate;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
const root = findPackageRoot(metaUrl);
|
|
15
|
-
const bundledPath = resolve(root, 'cliff.toml.template');
|
|
16
|
-
if (existsSync(bundledPath)) {
|
|
17
|
-
return bundledPath;
|
|
18
|
-
}
|
|
19
|
-
throw new Error(`Could not resolve a git-cliff config file. Searched: ${candidates.join(', ')}, and bundled template at ${bundledPath}`);
|
|
20
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { OutputStyle } from '@williamthorsen/nmr-core';
|
|
2
|
-
import type { ReleaseNotesConfig } from './types.js';
|
|
3
|
-
export interface ResolvedReleaseNotesConfig {
|
|
4
|
-
releaseNotes: ReleaseNotesConfig;
|
|
5
|
-
changelogJsonOutputPath: string;
|
|
6
|
-
/** Section titles in priority order, derived from the merged workTypes record. */
|
|
7
|
-
sectionOrder: string[];
|
|
8
|
-
}
|
|
9
|
-
export interface ResolveReleaseNotesConfigOptions {
|
|
10
|
-
/** Config file to read, relative to the working directory. Defaults to `CONFIG_FILE_PATH`. */
|
|
11
|
-
configPath?: string;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Loads and validates the release-kit config, resolving the release-notes settings it carries.
|
|
15
|
-
*
|
|
16
|
-
* An unusable config reports to stderr and calls `process.exit(1)`, whether the file failed to load or failed
|
|
17
|
-
* validation, and whether it was named by the caller or the default one. Both callers are CLI commands whose
|
|
18
|
-
* whole behavior depends on the resolved config, so neither could proceed on derived defaults without silently
|
|
19
|
-
* dropping a configured `releaseNotes.shouldInjectIntoReadme`, `changelogJson.outputPath`, or `workTypes`.
|
|
20
|
-
* An absent default config is a supported state and resolves to the defaults.
|
|
21
|
-
*/
|
|
22
|
-
export declare function resolveReleaseNotesConfig(stderrStyle: OutputStyle, options?: ResolveReleaseNotesConfigOptions): Promise<ResolvedReleaseNotesConfig>;
|
|
23
|
-
/** Extract section headers in declaration order from a merged workTypes record. */
|
|
24
|
-
export declare function deriveSectionOrder(workTypes: Record<string, {
|
|
25
|
-
header: string;
|
|
26
|
-
}>): string[];
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { DEFAULT_CHANGELOG_JSON_CONFIG, DEFAULT_RELEASE_NOTES_CONFIG } from "./defaults.js";
|
|
2
|
-
import { resolveWorkTypes } from "./loadConfig.js";
|
|
3
|
-
import { loadValidatedConfig, reportConfigProblem, reportConfigWarnings } from "./loadValidatedConfig.js";
|
|
4
|
-
export async function resolveReleaseNotesConfig(stderrStyle, options = {}) {
|
|
5
|
-
const result = await loadValidatedConfig(options.configPath);
|
|
6
|
-
if (result.status === 'invalid') {
|
|
7
|
-
reportConfigProblem(result.problem, stderrStyle);
|
|
8
|
-
process.exit(1);
|
|
9
|
-
}
|
|
10
|
-
if (result.status === 'missing') {
|
|
11
|
-
return {
|
|
12
|
-
releaseNotes: { ...DEFAULT_RELEASE_NOTES_CONFIG },
|
|
13
|
-
changelogJsonOutputPath: DEFAULT_CHANGELOG_JSON_CONFIG.outputPath,
|
|
14
|
-
sectionOrder: deriveSectionOrder(resolveWorkTypes()),
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
reportConfigWarnings(result.warnings, stderrStyle);
|
|
18
|
-
const { config } = result;
|
|
19
|
-
return {
|
|
20
|
-
releaseNotes: {
|
|
21
|
-
shouldInjectIntoReadme: config.releaseNotes?.shouldInjectIntoReadme ?? DEFAULT_RELEASE_NOTES_CONFIG.shouldInjectIntoReadme,
|
|
22
|
-
},
|
|
23
|
-
changelogJsonOutputPath: config.changelogJson?.outputPath ?? DEFAULT_CHANGELOG_JSON_CONFIG.outputPath,
|
|
24
|
-
sectionOrder: deriveSectionOrder(resolveWorkTypes(config.workTypes)),
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
export function deriveSectionOrder(workTypes) {
|
|
28
|
-
return Object.values(workTypes).map((entry) => entry.header);
|
|
29
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The exact `git-cliff` version every invocation resolves.
|
|
3
|
-
*
|
|
4
|
-
* npm's `git-cliff` trails the upstream release, so this pin normally sits behind the newest version cliff
|
|
5
|
-
* itself reports. Bumping it is an edit to this line, once npm publishes the version you want.
|
|
6
|
-
*/
|
|
7
|
-
export declare const GIT_CLIFF_VERSION = "2.13.1";
|
|
8
|
-
/** The npx arguments that precede the cliff args at every invocation, and that the dry-run report renders. */
|
|
9
|
-
export declare const GIT_CLIFF_NPX_ARGS: readonly string[];
|
|
10
|
-
/**
|
|
11
|
-
* Invokes `git-cliff` via `npx` and returns the output it produced.
|
|
12
|
-
*
|
|
13
|
-
* Single entry point for `git-cliff` invocations from `release-kit`. Owns three pieces of shared lifecycle
|
|
14
|
-
* that would otherwise duplicate (and silently drift) across call sites: the npx flags, the spawned-process
|
|
15
|
-
* environment, and the temp dir holding both the `.template`โ`.toml` config copy and cliff's output file.
|
|
16
|
-
*
|
|
17
|
-
* Output is routed through `--output` to a temp file and read back. `--context` emits a workspace's
|
|
18
|
-
* entire matching tag history on every run, so its size grows without bound with the repo;
|
|
19
|
-
* a file accommodates that, while a pipe is bounded by `maxBuffer`.
|
|
20
|
-
*
|
|
21
|
-
* The npx spec names an exact version, which leaves npm no staleness to check, so `--prefer-offline` skips the
|
|
22
|
-
* per-call registry revalidation round-trip (~2.5 s per invocation on a warm cache) without stranding the run
|
|
23
|
-
* on whatever the cache happens to hold.
|
|
24
|
-
*
|
|
25
|
-
* Two env entries are set for the child. `npm_config_progress=false` suppresses npx's animated stderr spinner,
|
|
26
|
-
* which otherwise renders as a transient flicker. `RUST_LOG=warn` drops cliff's INFO lines, among them the
|
|
27
|
-
* crates.io update notice it emits on every invocation while npm trails upstream, and leaves warnings and errors
|
|
28
|
-
* in place; an inherited `RUST_LOG` wins, so raising the level for debugging still works.
|
|
29
|
-
*
|
|
30
|
-
* The helper injects `--config <path>` and `--output <path>` itself โ callers must NOT include either in `cliffArgs`.
|
|
31
|
-
* `--output` is appended last so a caller that passes one anyway cannot redirect the output the helper then reads.
|
|
32
|
-
* The caller is responsible for resolving the cliff config path (via `resolveCliffConfigPath`) before calling,
|
|
33
|
-
* since the resolution depends on the caller's `import.meta.url`.
|
|
34
|
-
*
|
|
35
|
-
* Errors from `execFileSync` are not caught: callers wrap with site-specific messages.
|
|
36
|
-
* The temp-dir cleanup runs in a `finally` so it still happens on throw.
|
|
37
|
-
*/
|
|
38
|
-
export declare function runGitCliff(cliffConfigPath: string, cliffArgs: readonly string[]): string;
|
package/dist/esm/runGitCliff.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { execFileSync } from 'node:child_process';
|
|
2
|
-
import { copyFileSync, mkdtempSync, readFileSync, rmSync } from 'node:fs';
|
|
3
|
-
import { tmpdir } from 'node:os';
|
|
4
|
-
import { join } from 'node:path';
|
|
5
|
-
export const GIT_CLIFF_VERSION = '2.13.1';
|
|
6
|
-
export const GIT_CLIFF_NPX_ARGS = ['--prefer-offline', '--yes', `git-cliff@${GIT_CLIFF_VERSION}`];
|
|
7
|
-
export function runGitCliff(cliffConfigPath, cliffArgs) {
|
|
8
|
-
const tempDir = mkdtempSync(join(tmpdir(), 'cliff-'));
|
|
9
|
-
try {
|
|
10
|
-
let configPath = cliffConfigPath;
|
|
11
|
-
if (cliffConfigPath.endsWith('.template')) {
|
|
12
|
-
configPath = join(tempDir, 'cliff.toml');
|
|
13
|
-
copyFileSync(cliffConfigPath, configPath);
|
|
14
|
-
}
|
|
15
|
-
const outputPath = join(tempDir, 'output.json');
|
|
16
|
-
execFileSync('npx', [...GIT_CLIFF_NPX_ARGS, '--config', configPath, ...cliffArgs, '--output', outputPath], {
|
|
17
|
-
stdio: ['ignore', 'ignore', 'inherit'],
|
|
18
|
-
env: { ...process.env, npm_config_progress: 'false', RUST_LOG: process.env['RUST_LOG'] ?? 'warn' },
|
|
19
|
-
});
|
|
20
|
-
return readFileSync(outputPath, 'utf8');
|
|
21
|
-
}
|
|
22
|
-
finally {
|
|
23
|
-
rmSync(tempDir, { recursive: true, force: true });
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Canonical work-types data: the runtime mirror of `work-types.json`.
|
|
3
|
-
*
|
|
4
|
-
* `work-types.json` is release-kit's copy of the codeassembly canonical. This `.ts` mirror exists for
|
|
5
|
-
* runtime consumption: The compiler baseline does not enable JSON module imports, and a TS constant keeps
|
|
6
|
-
* `breakingPolicy` typed as its three-value union.
|
|
7
|
-
*
|
|
8
|
-
* `nmr work-types:sync` updates only the JSON, so copy its change here by hand. A drift test
|
|
9
|
-
* (`workTypesData.unit.test.ts`) asserts that this constant deep-equals the parsed contents of
|
|
10
|
-
* `work-types.json`.
|
|
11
|
-
*/
|
|
12
|
-
/** Schema for a single entry. */
|
|
13
|
-
export interface WorkTypeEntry {
|
|
14
|
-
tier: string;
|
|
15
|
-
key: string;
|
|
16
|
-
aliases: string[];
|
|
17
|
-
emoji: string;
|
|
18
|
-
label: string;
|
|
19
|
-
description: string;
|
|
20
|
-
breakingPolicy: 'forbidden' | 'optional' | 'required';
|
|
21
|
-
excludedFromChangelog?: boolean;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Schema for an orthogonal section marker (e.g., breaking-changes indicator).
|
|
25
|
-
*
|
|
26
|
-
* Stored as plain text โ consumers add formatting (bold, prefix punctuation) when
|
|
27
|
-
* constructing the rendered form. Keeps the SSOT format-agnostic across Markdown,
|
|
28
|
-
* HTML, terminal, and plain-text consumers.
|
|
29
|
-
*/
|
|
30
|
-
export interface MarkerEntry {
|
|
31
|
-
emoji: string;
|
|
32
|
-
label: string;
|
|
33
|
-
}
|
|
34
|
-
/** Schema for the full data. */
|
|
35
|
-
export interface WorkTypesData {
|
|
36
|
-
/** Semantic version of the data shape, as declared by the upstream canonical. */
|
|
37
|
-
version: string;
|
|
38
|
-
tiers: string[];
|
|
39
|
-
types: WorkTypeEntry[];
|
|
40
|
-
/**
|
|
41
|
-
* Cross-cutting section markers keyed by marker name. The `breaking` marker is
|
|
42
|
-
* canonical and required; additional keys are permitted for forward-compatibility.
|
|
43
|
-
*/
|
|
44
|
-
markers: {
|
|
45
|
-
[key: string]: MarkerEntry;
|
|
46
|
-
breaking: MarkerEntry;
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
/** Canonical work-types data, kept in lockstep with `work-types.json`. */
|
|
50
|
-
export declare const WORK_TYPES_DATA: WorkTypesData;
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
export const WORK_TYPES_DATA = {
|
|
2
|
-
version: '1.1.0',
|
|
3
|
-
tiers: ['public', 'internal', 'process'],
|
|
4
|
-
types: [
|
|
5
|
-
{
|
|
6
|
-
tier: 'public',
|
|
7
|
-
key: 'feat',
|
|
8
|
-
aliases: ['feature'],
|
|
9
|
-
emoji: '๐',
|
|
10
|
-
label: 'Features',
|
|
11
|
-
description: 'A change that gives consumers a new capability or extends an existing one.',
|
|
12
|
-
breakingPolicy: 'optional',
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
tier: 'public',
|
|
16
|
-
key: 'drop',
|
|
17
|
-
aliases: [],
|
|
18
|
-
emoji: '๐ชฆ',
|
|
19
|
-
label: 'Removed',
|
|
20
|
-
description: 'A change that removes a capability or surface on which consumers depend.',
|
|
21
|
-
breakingPolicy: 'required',
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
tier: 'public',
|
|
25
|
-
key: 'deprecate',
|
|
26
|
-
aliases: [],
|
|
27
|
-
emoji: '๐๏ธ',
|
|
28
|
-
label: 'Deprecated',
|
|
29
|
-
description: 'A change that marks a capability or surface for removal while the capability or surface keeps working.',
|
|
30
|
-
breakingPolicy: 'forbidden',
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
tier: 'public',
|
|
34
|
-
key: 'fix',
|
|
35
|
-
aliases: ['bugfix'],
|
|
36
|
-
emoji: '๐',
|
|
37
|
-
label: 'Bug fixes',
|
|
38
|
-
description: 'A change that corrects behavior that consumers meet and that differs from what was intended.',
|
|
39
|
-
breakingPolicy: 'optional',
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
tier: 'public',
|
|
43
|
-
key: 'sec',
|
|
44
|
-
aliases: ['security'],
|
|
45
|
-
emoji: '๐',
|
|
46
|
-
label: 'Security',
|
|
47
|
-
description: 'A change that closes a vulnerability or hardens a consumer-facing surface against attack.',
|
|
48
|
-
breakingPolicy: 'optional',
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
tier: 'public',
|
|
52
|
-
key: 'perf',
|
|
53
|
-
aliases: ['performance'],
|
|
54
|
-
emoji: 'โก',
|
|
55
|
-
label: 'Performance',
|
|
56
|
-
description: 'A change that reduces the time, memory, or other resources that consumer-facing work uses, without changing its result.',
|
|
57
|
-
breakingPolicy: 'optional',
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
tier: 'internal',
|
|
61
|
-
key: 'internal',
|
|
62
|
-
aliases: ['utility'],
|
|
63
|
-
emoji: '๐๏ธ',
|
|
64
|
-
label: 'Internal features',
|
|
65
|
-
description: 'A change that adds or extends a capability that consumers do not use directly, such as a helper or an internal module.',
|
|
66
|
-
breakingPolicy: 'forbidden',
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
tier: 'internal',
|
|
70
|
-
key: 'refactor',
|
|
71
|
-
aliases: [],
|
|
72
|
-
emoji: 'โป๏ธ',
|
|
73
|
-
label: 'Refactoring',
|
|
74
|
-
description: 'A change that restructures existing code without changing its behavior.',
|
|
75
|
-
breakingPolicy: 'forbidden',
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
tier: 'internal',
|
|
79
|
-
key: 'tests',
|
|
80
|
-
aliases: ['test'],
|
|
81
|
-
emoji: '๐งช',
|
|
82
|
-
label: 'Tests',
|
|
83
|
-
description: 'A change confined to tests, test fixtures, or test helpers, including one that unblocks a build or a type check.',
|
|
84
|
-
breakingPolicy: 'forbidden',
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
tier: 'process',
|
|
88
|
-
key: 'tooling',
|
|
89
|
-
aliases: [],
|
|
90
|
-
emoji: 'โ๏ธ',
|
|
91
|
-
label: 'Tooling',
|
|
92
|
-
description: 'A change to the tools used to develop the project: build, lint, formatting, and release configuration, and development scripts.',
|
|
93
|
-
breakingPolicy: 'forbidden',
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
tier: 'process',
|
|
97
|
-
key: 'ci',
|
|
98
|
-
aliases: [],
|
|
99
|
-
emoji: '๐ท',
|
|
100
|
-
label: 'CI',
|
|
101
|
-
description: 'A change to continuous-integration workflows and their configuration.',
|
|
102
|
-
breakingPolicy: 'forbidden',
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
tier: 'process',
|
|
106
|
-
key: 'deps',
|
|
107
|
-
aliases: ['dep'],
|
|
108
|
-
emoji: '๐ฆ',
|
|
109
|
-
label: 'Dependencies',
|
|
110
|
-
description: 'A change that adds, removes, or upgrades a dependency, including its lockfile and version-catalog entries.',
|
|
111
|
-
breakingPolicy: 'forbidden',
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
tier: 'process',
|
|
115
|
-
key: 'ai',
|
|
116
|
-
aliases: [],
|
|
117
|
-
emoji: '๐ค',
|
|
118
|
-
label: 'Agentic support',
|
|
119
|
-
description: "A change to guidance on working in the repository itself, such as its `AGENTS.md` or a repo-local skill, or to the repository's agent configuration.",
|
|
120
|
-
breakingPolicy: 'forbidden',
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
tier: 'process',
|
|
124
|
-
key: 'docs',
|
|
125
|
-
aliases: ['doc'],
|
|
126
|
-
emoji: '๐',
|
|
127
|
-
label: 'Documentation',
|
|
128
|
-
description: 'A change to documentation for human readers, such as a README, a guide, or a code comment.',
|
|
129
|
-
breakingPolicy: 'forbidden',
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
tier: 'process',
|
|
133
|
-
key: 'fmt',
|
|
134
|
-
aliases: [],
|
|
135
|
-
emoji: '๐จ',
|
|
136
|
-
label: 'Formatting',
|
|
137
|
-
description: 'A change to formatting alone, such as whitespace or line wrapping, that leaves the content unchanged.',
|
|
138
|
-
breakingPolicy: 'forbidden',
|
|
139
|
-
excludedFromChangelog: true,
|
|
140
|
-
},
|
|
141
|
-
],
|
|
142
|
-
markers: {
|
|
143
|
-
breaking: { emoji: '๐จ', label: 'Breaking' },
|
|
144
|
-
},
|
|
145
|
-
};
|
package/schemas/label-map.json
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"title": "label-map",
|
|
4
|
-
"description": "Maps commit-prefix scopes and types to GitHub label names. Consumed by agent skills, CI tooling, and any script that needs to translate commit conventions into label operations.",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"required": ["types", "scopes"],
|
|
7
|
-
"additionalProperties": false,
|
|
8
|
-
"properties": {
|
|
9
|
-
"$schema": {
|
|
10
|
-
"type": "string",
|
|
11
|
-
"description": "JSON Schema reference for editor support."
|
|
12
|
-
},
|
|
13
|
-
"types": {
|
|
14
|
-
"type": "object",
|
|
15
|
-
"description": "Maps commit-type prefix (e.g., `feat`) to GitHub label name (e.g., `feature`).",
|
|
16
|
-
"additionalProperties": { "type": "string" }
|
|
17
|
-
},
|
|
18
|
-
"scopes": {
|
|
19
|
-
"type": "object",
|
|
20
|
-
"description": "Maps commit-scope prefix (e.g., `audit`) to GitHub label name (e.g., `scope:audit`).",
|
|
21
|
-
"additionalProperties": { "type": "string" }
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|