@williamthorsen/release-kit 5.0.0 → 5.2.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/CHANGELOG.md +149 -49
- package/README.md +275 -78
- package/cliff.toml.template +26 -17
- package/dist/esm/.cache +1 -1
- package/dist/esm/assertCleanWorkingTree.js +1 -1
- package/dist/esm/bin/release-kit.js +97 -4
- package/dist/esm/buildChangelogEntries.d.ts +4 -0
- package/dist/esm/buildChangelogEntries.js +173 -0
- package/dist/esm/buildDependencyGraph.d.ts +1 -0
- package/dist/esm/buildDependencyGraph.js +8 -1
- package/dist/esm/buildReleaseSummary.js +9 -1
- package/dist/esm/buildSyntheticChangelogEntry.d.ts +5 -0
- package/dist/esm/buildSyntheticChangelogEntry.js +13 -0
- package/dist/esm/changelogJsonFile.d.ts +4 -0
- package/dist/esm/changelogJsonFile.js +68 -0
- package/dist/esm/checkWorkTypesDrift.d.ts +11 -0
- package/dist/esm/checkWorkTypesDrift.js +110 -0
- package/dist/esm/collectPolicyViolations.d.ts +6 -0
- package/dist/esm/collectPolicyViolations.js +15 -0
- package/dist/esm/createGithubRelease.d.ts +12 -2
- package/dist/esm/createGithubRelease.js +12 -8
- package/dist/esm/createGithubReleaseCommand.js +10 -6
- package/dist/esm/decideRelease.d.ts +28 -0
- package/dist/esm/decideRelease.js +44 -0
- package/dist/esm/defaults.d.ts +8 -0
- package/dist/esm/defaults.js +43 -20
- package/dist/esm/deriveWorkspaceConfig.js +3 -0
- package/dist/esm/determineBumpFromCommits.d.ts +6 -1
- package/dist/esm/determineBumpFromCommits.js +9 -3
- package/dist/esm/generateChangelogs.js +14 -29
- package/dist/esm/index.d.ts +2 -43
- package/dist/esm/index.js +0 -82
- package/dist/esm/init/templates.js +2 -2
- package/dist/esm/loadConfig.d.ts +10 -1
- package/dist/esm/loadConfig.js +110 -24
- package/dist/esm/parseCommitMessage.d.ts +8 -2
- package/dist/esm/parseCommitMessage.js +32 -3
- package/dist/esm/prepareCommand.js +51 -9
- package/dist/esm/publish.d.ts +0 -1
- package/dist/esm/publish.js +3 -3
- package/dist/esm/publishCommand.js +31 -3
- package/dist/esm/releasePrepare.js +109 -41
- package/dist/esm/releasePrepareMono.js +156 -87
- package/dist/esm/releasePrepareProject.d.ts +9 -0
- package/dist/esm/releasePrepareProject.js +121 -0
- package/dist/esm/renderReleaseNotes.js +2 -1
- package/dist/esm/reportPrepare.js +88 -24
- package/dist/esm/resolveCommandTags.js +16 -6
- package/dist/esm/resolveReleaseTags.d.ts +8 -1
- package/dist/esm/resolveReleaseTags.js +11 -7
- package/dist/esm/runGitCliff.d.ts +2 -0
- package/dist/esm/runGitCliff.js +27 -0
- package/dist/esm/stripEmojiPrefix.d.ts +1 -0
- package/dist/esm/stripEmojiPrefix.js +7 -0
- package/dist/esm/syncWorkTypes.d.ts +10 -0
- package/dist/esm/syncWorkTypes.js +90 -0
- package/dist/esm/types.d.ts +72 -14
- package/dist/esm/validateConfig.js +26 -0
- package/dist/esm/validateOnlyExcludesStrandedDependents.d.ts +14 -0
- package/dist/esm/validateOnlyExcludesStrandedDependents.js +109 -0
- package/dist/esm/work-types.json +127 -0
- package/dist/esm/work-types.schema.json +73 -0
- package/dist/esm/workTypesData.d.ts +14 -0
- package/dist/esm/workTypesData.js +59 -0
- package/dist/esm/workTypesUtils.d.ts +5 -0
- package/dist/esm/workTypesUtils.js +16 -0
- package/package.json +9 -3
- package/presets/labels/common.yaml +9 -6
- package/schemas/label-map.json +24 -0
- package/dist/esm/generateChangelogJson.d.ts +0 -7
- package/dist/esm/generateChangelogJson.js +0 -232
- package/dist/esm/version.d.ts +0 -1
- package/dist/esm/version.js +0 -4
|
@@ -7,21 +7,21 @@ function createGithubRelease(options) {
|
|
|
7
7
|
const { tag, changelogJsonPath, dryRun, sectionOrder } = options;
|
|
8
8
|
if (!existsSync(changelogJsonPath)) {
|
|
9
9
|
console.warn(`Warning: ${changelogJsonPath} not found; skipping GitHub Release creation`);
|
|
10
|
-
return
|
|
10
|
+
return { status: "skipped", reason: "no-entry" };
|
|
11
11
|
}
|
|
12
12
|
const version = extractVersion(tag);
|
|
13
13
|
const entries = readChangelogEntries(changelogJsonPath);
|
|
14
14
|
if (entries === void 0) {
|
|
15
15
|
console.warn(`Warning: could not parse ${changelogJsonPath}; skipping GitHub Release creation`);
|
|
16
|
-
return
|
|
16
|
+
return { status: "skipped", reason: "no-entry" };
|
|
17
17
|
}
|
|
18
18
|
const entry = entries.find((e) => e.version === version);
|
|
19
19
|
if (entry === void 0) {
|
|
20
20
|
console.warn(`Warning: no changelog entry for version ${version}; skipping GitHub Release creation`);
|
|
21
|
-
return
|
|
21
|
+
return { status: "skipped", reason: "no-entry" };
|
|
22
22
|
}
|
|
23
23
|
if (!entry.sections.some(matchesAudience("all"))) {
|
|
24
|
-
return
|
|
24
|
+
return { status: "skipped", reason: "no-audience-content" };
|
|
25
25
|
}
|
|
26
26
|
const body = renderReleaseNotesSingle(entry, {
|
|
27
27
|
filter: matchesAudience("all"),
|
|
@@ -29,15 +29,15 @@ function createGithubRelease(options) {
|
|
|
29
29
|
...sectionOrder === void 0 ? {} : { sectionOrder }
|
|
30
30
|
});
|
|
31
31
|
if (body.trim() === "") {
|
|
32
|
-
return
|
|
32
|
+
return { status: "skipped", reason: "empty-body" };
|
|
33
33
|
}
|
|
34
34
|
const args = ["release", "create", tag, "--title", tag, "--notes", body];
|
|
35
35
|
if (dryRun) {
|
|
36
36
|
console.info(`[dry-run] Would run: gh ${args.join(" ")}`);
|
|
37
|
-
return
|
|
37
|
+
return { status: "created" };
|
|
38
38
|
}
|
|
39
39
|
execFileSync("gh", args, { stdio: "inherit" });
|
|
40
|
-
return
|
|
40
|
+
return { status: "created" };
|
|
41
41
|
}
|
|
42
42
|
function createGithubReleases(tags, changelogJsonOutputPath, dryRun, sectionOrder) {
|
|
43
43
|
const created = [];
|
|
@@ -50,7 +50,11 @@ function createGithubReleases(tags, changelogJsonOutputPath, dryRun, sectionOrde
|
|
|
50
50
|
dryRun,
|
|
51
51
|
...sectionOrder === void 0 ? {} : { sectionOrder }
|
|
52
52
|
});
|
|
53
|
-
(result
|
|
53
|
+
if (result.status === "created") {
|
|
54
|
+
created.push(tag);
|
|
55
|
+
} else {
|
|
56
|
+
skipped.push({ tag, reason: result.reason });
|
|
57
|
+
}
|
|
54
58
|
}
|
|
55
59
|
return { created, skipped };
|
|
56
60
|
}
|
|
@@ -26,14 +26,18 @@ async function createGithubReleaseCommand(argv) {
|
|
|
26
26
|
console.error(`Error creating GitHub Releases: ${error instanceof Error ? error.message : String(error)}`);
|
|
27
27
|
process.exit(1);
|
|
28
28
|
}
|
|
29
|
-
if (requestedTags !== void 0
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
if (requestedTags !== void 0) {
|
|
30
|
+
const noEntryTags = outcome.skipped.filter((s) => s.reason === "no-entry").map((s) => s.tag);
|
|
31
|
+
if (noEntryTags.length > 0) {
|
|
32
|
+
console.error(
|
|
33
|
+
`Error: requested tags have no changelog entry: ${noEntryTags.join(", ")}. Verify the tag names match a published changelog version.`
|
|
34
|
+
);
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
34
37
|
}
|
|
35
38
|
if (outcome.skipped.length > 0) {
|
|
36
|
-
|
|
39
|
+
const formatted = outcome.skipped.map((s) => `${s.tag} (${s.reason})`).join(", ");
|
|
40
|
+
console.info(`Skipped ${outcome.skipped.length} tag(s) with no releasable content: ${formatted}.`);
|
|
37
41
|
}
|
|
38
42
|
}
|
|
39
43
|
export {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type PolicyViolationHandler } from './parseCommitMessage.ts';
|
|
2
|
+
import type { Commit, ReleaseType, VersionPatterns, WorkTypeConfig } from './types.ts';
|
|
3
|
+
export interface DecideReleaseArgs {
|
|
4
|
+
commits: readonly Commit[];
|
|
5
|
+
force?: boolean | undefined;
|
|
6
|
+
bumpOverride: ReleaseType | undefined;
|
|
7
|
+
workTypes: Record<string, WorkTypeConfig>;
|
|
8
|
+
versionPatterns: VersionPatterns;
|
|
9
|
+
scopeAliases: Record<string, string> | undefined;
|
|
10
|
+
breakingPolicies?: Record<string, 'forbidden' | 'optional' | 'required'>;
|
|
11
|
+
onPolicyViolation?: PolicyViolationHandler;
|
|
12
|
+
skipReasons: {
|
|
13
|
+
noCommits: string;
|
|
14
|
+
noBumpWorthy: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export type DecideReleaseResult = {
|
|
18
|
+
outcome: 'release';
|
|
19
|
+
releaseType: ReleaseType;
|
|
20
|
+
parsedCommitCount: number;
|
|
21
|
+
unparseableCommits: Commit[] | undefined;
|
|
22
|
+
} | {
|
|
23
|
+
outcome: 'skip';
|
|
24
|
+
skipReason: string;
|
|
25
|
+
parsedCommitCount: number;
|
|
26
|
+
unparseableCommits: Commit[] | undefined;
|
|
27
|
+
};
|
|
28
|
+
export declare function decideRelease(args: DecideReleaseArgs): DecideReleaseResult;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { determineBumpType } from "./determineBumpType.js";
|
|
2
|
+
import {
|
|
3
|
+
parseCommitMessage
|
|
4
|
+
} from "./parseCommitMessage.js";
|
|
5
|
+
function decideRelease(args) {
|
|
6
|
+
const {
|
|
7
|
+
commits,
|
|
8
|
+
force = false,
|
|
9
|
+
bumpOverride,
|
|
10
|
+
workTypes,
|
|
11
|
+
versionPatterns,
|
|
12
|
+
scopeAliases,
|
|
13
|
+
breakingPolicies,
|
|
14
|
+
onPolicyViolation,
|
|
15
|
+
skipReasons
|
|
16
|
+
} = args;
|
|
17
|
+
const parseOptions = {
|
|
18
|
+
...breakingPolicies !== void 0 && { breakingPolicies },
|
|
19
|
+
...onPolicyViolation !== void 0 && { onPolicyViolation }
|
|
20
|
+
};
|
|
21
|
+
const parsedCommits = [];
|
|
22
|
+
const unparseable = [];
|
|
23
|
+
for (const commit of commits) {
|
|
24
|
+
const parsed = parseCommitMessage(commit.message, commit.hash, workTypes, scopeAliases, parseOptions);
|
|
25
|
+
if (parsed === void 0) {
|
|
26
|
+
unparseable.push(commit);
|
|
27
|
+
} else {
|
|
28
|
+
parsedCommits.push(parsed);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const parsedCommitCount = parsedCommits.length;
|
|
32
|
+
const unparseableCommits = unparseable.length > 0 ? unparseable : void 0;
|
|
33
|
+
const naturalBump = determineBumpType(parsedCommits, workTypes, versionPatterns);
|
|
34
|
+
const shouldRelease = naturalBump !== void 0 || force;
|
|
35
|
+
if (!shouldRelease) {
|
|
36
|
+
const skipReason = commits.length === 0 ? skipReasons.noCommits : skipReasons.noBumpWorthy;
|
|
37
|
+
return { outcome: "skip", skipReason, parsedCommitCount, unparseableCommits };
|
|
38
|
+
}
|
|
39
|
+
const releaseType = bumpOverride ?? naturalBump ?? "patch";
|
|
40
|
+
return { outcome: "release", releaseType, parsedCommitCount, unparseableCommits };
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
decideRelease
|
|
44
|
+
};
|
package/dist/esm/defaults.d.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import type { ChangelogJsonConfig, ReleaseNotesConfig, VersionPatterns, WorkTypeConfig } from './types.ts';
|
|
2
|
+
export type { WorkTypesData } from './workTypesData.ts';
|
|
3
|
+
export { WORK_TYPES_DATA } from './workTypesData.ts';
|
|
4
|
+
export declare function composeHeader(entry: {
|
|
5
|
+
emoji: string;
|
|
6
|
+
label: string;
|
|
7
|
+
}): string;
|
|
2
8
|
export declare const DEFAULT_WORK_TYPES: Record<string, WorkTypeConfig>;
|
|
9
|
+
export declare const DEFAULT_BREAKING_POLICIES: Record<string, 'forbidden' | 'optional' | 'required'>;
|
|
3
10
|
export declare const DEFAULT_VERSION_PATTERNS: VersionPatterns;
|
|
4
11
|
export declare const DEFAULT_CHANGELOG_JSON_CONFIG: ChangelogJsonConfig;
|
|
5
12
|
export declare const DEFAULT_RELEASE_NOTES_CONFIG: ReleaseNotesConfig;
|
|
13
|
+
export declare const DEFAULT_PROJECT_TAG_PREFIX = "v";
|
package/dist/esm/defaults.js
CHANGED
|
@@ -1,21 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { WORK_TYPES_DATA } from "./workTypesData.js";
|
|
2
|
+
import { WORK_TYPES_DATA as WORK_TYPES_DATA2 } from "./workTypesData.js";
|
|
3
|
+
function composeHeader(entry) {
|
|
4
|
+
return `${entry.emoji} ${entry.label}`;
|
|
5
|
+
}
|
|
6
|
+
const DEV_ONLY_TIERS = /* @__PURE__ */ new Set(["Internal", "Process"]);
|
|
7
|
+
function deriveDefaultWorkTypes() {
|
|
8
|
+
const result = {};
|
|
9
|
+
for (const entry of WORK_TYPES_DATA.types) {
|
|
10
|
+
const config = {
|
|
11
|
+
header: composeHeader(entry)
|
|
12
|
+
};
|
|
13
|
+
if (entry.aliases.length > 0) {
|
|
14
|
+
config.aliases = [...entry.aliases];
|
|
15
|
+
}
|
|
16
|
+
result[entry.key] = config;
|
|
17
|
+
}
|
|
18
|
+
return result;
|
|
19
|
+
}
|
|
20
|
+
function deriveDevOnlySections() {
|
|
21
|
+
const sections = [];
|
|
22
|
+
for (const entry of WORK_TYPES_DATA.types) {
|
|
23
|
+
if (!DEV_ONLY_TIERS.has(entry.tier)) {
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
if (entry.excludedFromChangelog === true) {
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
sections.push(composeHeader(entry));
|
|
30
|
+
}
|
|
31
|
+
return sections;
|
|
32
|
+
}
|
|
33
|
+
const DEFAULT_WORK_TYPES = deriveDefaultWorkTypes();
|
|
34
|
+
const DEFAULT_BREAKING_POLICIES = Object.fromEntries(
|
|
35
|
+
WORK_TYPES_DATA.types.map((entry) => [entry.key, entry.breakingPolicy])
|
|
36
|
+
);
|
|
19
37
|
const DEFAULT_VERSION_PATTERNS = {
|
|
20
38
|
major: ["!"],
|
|
21
39
|
minor: ["feat"]
|
|
@@ -23,14 +41,19 @@ const DEFAULT_VERSION_PATTERNS = {
|
|
|
23
41
|
const DEFAULT_CHANGELOG_JSON_CONFIG = {
|
|
24
42
|
enabled: true,
|
|
25
43
|
outputPath: ".meta/changelog.json",
|
|
26
|
-
devOnlySections:
|
|
44
|
+
devOnlySections: deriveDevOnlySections()
|
|
27
45
|
};
|
|
28
46
|
const DEFAULT_RELEASE_NOTES_CONFIG = {
|
|
29
47
|
shouldInjectIntoReadme: false
|
|
30
48
|
};
|
|
49
|
+
const DEFAULT_PROJECT_TAG_PREFIX = "v";
|
|
31
50
|
export {
|
|
51
|
+
DEFAULT_BREAKING_POLICIES,
|
|
32
52
|
DEFAULT_CHANGELOG_JSON_CONFIG,
|
|
53
|
+
DEFAULT_PROJECT_TAG_PREFIX,
|
|
33
54
|
DEFAULT_RELEASE_NOTES_CONFIG,
|
|
34
55
|
DEFAULT_VERSION_PATTERNS,
|
|
35
|
-
DEFAULT_WORK_TYPES
|
|
56
|
+
DEFAULT_WORK_TYPES,
|
|
57
|
+
WORK_TYPES_DATA2 as WORK_TYPES_DATA,
|
|
58
|
+
composeHeader
|
|
36
59
|
};
|
|
@@ -16,11 +16,14 @@ function deriveWorkspaceConfig(workspacePath) {
|
|
|
16
16
|
throw new Error(`${packageJsonPath} is missing a 'name' field (required for tag derivation).`);
|
|
17
17
|
}
|
|
18
18
|
const unscopedName = stripNpmScope(name);
|
|
19
|
+
const privateField = isRecord(parsed) ? parsed.private : void 0;
|
|
20
|
+
const isPublishable = privateField === void 0 || privateField === false;
|
|
19
21
|
return {
|
|
20
22
|
dir,
|
|
21
23
|
name,
|
|
22
24
|
tagPrefix: `${unscopedName}-v`,
|
|
23
25
|
workspacePath,
|
|
26
|
+
isPublishable,
|
|
24
27
|
packageFiles: [packageJsonPath],
|
|
25
28
|
changelogPaths: [workspacePath],
|
|
26
29
|
paths: [`${workspacePath}/**`]
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
import { type PolicyViolationHandler } from './parseCommitMessage.ts';
|
|
1
2
|
import type { Commit, ReleaseType, VersionPatterns, WorkTypeConfig } from './types.ts';
|
|
2
3
|
export interface BumpDetermination {
|
|
3
4
|
releaseType: ReleaseType | undefined;
|
|
4
5
|
parsedCommitCount: number;
|
|
5
6
|
unparseableCommits: Commit[] | undefined;
|
|
6
7
|
}
|
|
7
|
-
export
|
|
8
|
+
export interface DetermineBumpOptions {
|
|
9
|
+
breakingPolicies?: Record<string, 'forbidden' | 'optional' | 'required'>;
|
|
10
|
+
onPolicyViolation?: PolicyViolationHandler;
|
|
11
|
+
}
|
|
12
|
+
export declare function determineBumpFromCommits(commits: Commit[], workTypes: Record<string, WorkTypeConfig>, versionPatterns: VersionPatterns, scopeAliases: Record<string, string> | undefined, options?: DetermineBumpOptions): BumpDetermination;
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { determineBumpType } from "./determineBumpType.js";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
parseCommitMessage
|
|
4
|
+
} from "./parseCommitMessage.js";
|
|
5
|
+
function determineBumpFromCommits(commits, workTypes, versionPatterns, scopeAliases, options) {
|
|
6
|
+
const parseOptions = {
|
|
7
|
+
...options?.breakingPolicies !== void 0 && { breakingPolicies: options.breakingPolicies },
|
|
8
|
+
...options?.onPolicyViolation !== void 0 && { onPolicyViolation: options.onPolicyViolation }
|
|
9
|
+
};
|
|
4
10
|
const parsedCommits = [];
|
|
5
11
|
const unparseable = [];
|
|
6
12
|
for (const commit of commits) {
|
|
7
|
-
const parsed = parseCommitMessage(commit.message, commit.hash, workTypes, scopeAliases);
|
|
13
|
+
const parsed = parseCommitMessage(commit.message, commit.hash, workTypes, scopeAliases, parseOptions);
|
|
8
14
|
if (parsed === void 0) {
|
|
9
15
|
unparseable.push(commit);
|
|
10
16
|
} else {
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { execFileSync } from "node:child_process";
|
|
2
|
-
import { copyFileSync, mkdtempSync, rmSync } from "node:fs";
|
|
3
|
-
import { tmpdir } from "node:os";
|
|
4
|
-
import { join } from "node:path";
|
|
5
1
|
import { resolveCliffConfigPath } from "./resolveCliffConfigPath.js";
|
|
2
|
+
import { runGitCliff } from "./runGitCliff.js";
|
|
6
3
|
function buildTagPattern(tagPrefixes) {
|
|
7
4
|
if (tagPrefixes.length === 0) {
|
|
8
5
|
throw new Error("buildTagPattern: tagPrefixes must contain at least one entry");
|
|
@@ -18,38 +15,26 @@ function escapeRegex(value) {
|
|
|
18
15
|
return value.replace(/[.*+?^${}()|[\]\\]/g, String.raw`\$&`);
|
|
19
16
|
}
|
|
20
17
|
function generateChangelog(config, changelogPath, tag, dryRun, options) {
|
|
21
|
-
const resolvedConfigPath = resolveCliffConfigPath(config.cliffConfigPath, import.meta.url);
|
|
22
|
-
let cliffConfigPath = resolvedConfigPath;
|
|
23
|
-
let tempDir;
|
|
24
|
-
if (resolvedConfigPath.endsWith(".template")) {
|
|
25
|
-
tempDir = mkdtempSync(join(tmpdir(), "cliff-"));
|
|
26
|
-
cliffConfigPath = join(tempDir, "cliff.toml");
|
|
27
|
-
copyFileSync(resolvedConfigPath, cliffConfigPath);
|
|
28
|
-
}
|
|
29
18
|
const outputFile = `${changelogPath}/CHANGELOG.md`;
|
|
30
|
-
|
|
19
|
+
if (dryRun) {
|
|
20
|
+
return [outputFile];
|
|
21
|
+
}
|
|
22
|
+
const resolvedConfigPath = resolveCliffConfigPath(config.cliffConfigPath, import.meta.url);
|
|
23
|
+
const cliffArgs = ["--output", outputFile, "--tag", tag];
|
|
31
24
|
if (options?.tagPattern !== void 0) {
|
|
32
|
-
|
|
25
|
+
cliffArgs.push("--tag-pattern", options.tagPattern);
|
|
33
26
|
}
|
|
34
27
|
for (const includePath of options?.includePaths ?? []) {
|
|
35
|
-
|
|
28
|
+
cliffArgs.push("--include-path", includePath);
|
|
36
29
|
}
|
|
37
30
|
try {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
`Failed to generate changelog for ${outputFile}: ${error instanceof Error ? error.message : String(error)}`
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return [outputFile];
|
|
48
|
-
} finally {
|
|
49
|
-
if (tempDir !== void 0) {
|
|
50
|
-
rmSync(tempDir, { recursive: true, force: true });
|
|
51
|
-
}
|
|
31
|
+
runGitCliff(resolvedConfigPath, cliffArgs, "inherit");
|
|
32
|
+
} catch (error) {
|
|
33
|
+
throw new Error(
|
|
34
|
+
`Failed to generate changelog for ${outputFile}: ${error instanceof Error ? error.message : String(error)}`
|
|
35
|
+
);
|
|
52
36
|
}
|
|
37
|
+
return [outputFile];
|
|
53
38
|
}
|
|
54
39
|
function generateChangelogs(config, tag, dryRun) {
|
|
55
40
|
const tagPattern = buildTagPattern([config.tagPrefix]);
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,43 +1,2 @@
|
|
|
1
|
-
export type {
|
|
2
|
-
export type {
|
|
3
|
-
export type { GenerateChangelogOptions } from './generateChangelogs.ts';
|
|
4
|
-
export type { RetiredPackagePreviewEntry } from './previewTagPrefixes.ts';
|
|
5
|
-
export type { PublishOptions } from './publish.ts';
|
|
6
|
-
export type { ReleasePrepareOptions } from './releasePrepare.ts';
|
|
7
|
-
export type { ResolvedTag } from './resolveReleaseTags.ts';
|
|
8
|
-
export type { LabelDefinition, SyncLabelsConfig } from './sync-labels/types.ts';
|
|
9
|
-
export type { BumpResult, ChangelogAudience, ChangelogEntry, ChangelogItem, ChangelogJsonConfig, ChangelogSection, Commit, LegacyIdentity, MonorepoReleaseConfig, ParsedCommit, PrepareResult, ReleaseConfig, ReleaseKitConfig, ReleaseNotesConfig, ReleaseType, RetiredPackage, VersionPatterns, WorkspaceConfig, WorkspaceOverride, WorkspacePrepareResult, WorkTypeConfig, } from './types.ts';
|
|
10
|
-
export { DEFAULT_CHANGELOG_JSON_CONFIG, DEFAULT_RELEASE_NOTES_CONFIG, DEFAULT_VERSION_PATTERNS, DEFAULT_WORK_TYPES, } from './defaults.ts';
|
|
11
|
-
export { buildReleaseSummary } from './buildReleaseSummary.ts';
|
|
12
|
-
export { bumpAllVersions } from './bumpAllVersions.ts';
|
|
13
|
-
export { bumpVersion } from './bumpVersion.ts';
|
|
14
|
-
export { commitCommand } from './commitCommand.ts';
|
|
15
|
-
export type { CreateGithubReleaseOptions } from './createGithubRelease.ts';
|
|
16
|
-
export { createGithubRelease, createGithubReleases } from './createGithubRelease.ts';
|
|
17
|
-
export { createTags } from './createTags.ts';
|
|
18
|
-
export { deleteFileIfExists } from './deleteFileIfExists.ts';
|
|
19
|
-
export { deriveWorkspaceConfig } from './deriveWorkspaceConfig.ts';
|
|
20
|
-
export { detectPackageManager } from './detectPackageManager.ts';
|
|
21
|
-
export { determineBumpType } from './determineBumpType.ts';
|
|
22
|
-
export { discoverWorkspaces } from './discoverWorkspaces.ts';
|
|
23
|
-
export { generateChangelogJson, generateSyntheticChangelogJson } from './generateChangelogJson.ts';
|
|
24
|
-
export { generateChangelog, generateChangelogs } from './generateChangelogs.ts';
|
|
25
|
-
export { getCommitsSinceTarget } from './getCommitsSinceTarget.ts';
|
|
26
|
-
export type { RenderedInjectedReadme } from './injectReleaseNotesIntoReadme.ts';
|
|
27
|
-
export { injectReleaseNotesIntoReadme, renderInjectedReadme, resolveReadmePath, } from './injectReleaseNotesIntoReadme.ts';
|
|
28
|
-
export { injectSection } from './injectSection.ts';
|
|
29
|
-
export { COMMIT_PREPROCESSOR_PATTERNS, parseCommitMessage } from './parseCommitMessage.ts';
|
|
30
|
-
export { RELEASE_SUMMARY_FILE, RELEASE_TAGS_FILE, writeReleaseTags } from './prepareCommand.ts';
|
|
31
|
-
export { publishPackage } from './publish.ts';
|
|
32
|
-
export type { PushReleaseOptions } from './pushRelease.ts';
|
|
33
|
-
export { pushRelease } from './pushRelease.ts';
|
|
34
|
-
export { releasePrepare } from './releasePrepare.ts';
|
|
35
|
-
export { releasePrepareMono } from './releasePrepareMono.ts';
|
|
36
|
-
export type { RenderOptions } from './renderReleaseNotes.ts';
|
|
37
|
-
export { matchesAudience, renderReleaseNotesMulti, renderReleaseNotesSingle } from './renderReleaseNotes.ts';
|
|
38
|
-
export { reportPrepare } from './reportPrepare.ts';
|
|
39
|
-
export { resolveCommandTags } from './resolveCommandTags.ts';
|
|
40
|
-
export { resolveReleaseTags } from './resolveReleaseTags.ts';
|
|
41
|
-
export { stripScope } from './stripScope.ts';
|
|
42
|
-
export type { PreviewFileResult, WriteReleaseNotesPreviewsOptions, WriteReleaseNotesPreviewsResult, } from './writeReleaseNotesPreviews.ts';
|
|
43
|
-
export { writeReleaseNotesPreviews } from './writeReleaseNotesPreviews.ts';
|
|
1
|
+
export type { SyncLabelsConfig } from './sync-labels/types.ts';
|
|
2
|
+
export type { ReleaseKitConfig } from './types.ts';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DEFAULT_CHANGELOG_JSON_CONFIG,
|
|
3
|
-
DEFAULT_RELEASE_NOTES_CONFIG,
|
|
4
|
-
DEFAULT_VERSION_PATTERNS,
|
|
5
|
-
DEFAULT_WORK_TYPES
|
|
6
|
-
} from "./defaults.js";
|
|
7
|
-
import { buildReleaseSummary } from "./buildReleaseSummary.js";
|
|
8
|
-
import { bumpAllVersions } from "./bumpAllVersions.js";
|
|
9
|
-
import { bumpVersion } from "./bumpVersion.js";
|
|
10
|
-
import { commitCommand } from "./commitCommand.js";
|
|
11
|
-
import { createGithubRelease, createGithubReleases } from "./createGithubRelease.js";
|
|
12
|
-
import { createTags } from "./createTags.js";
|
|
13
|
-
import { deleteFileIfExists } from "./deleteFileIfExists.js";
|
|
14
|
-
import { deriveWorkspaceConfig } from "./deriveWorkspaceConfig.js";
|
|
15
|
-
import { detectPackageManager } from "./detectPackageManager.js";
|
|
16
|
-
import { determineBumpType } from "./determineBumpType.js";
|
|
17
|
-
import { discoverWorkspaces } from "./discoverWorkspaces.js";
|
|
18
|
-
import { generateChangelogJson, generateSyntheticChangelogJson } from "./generateChangelogJson.js";
|
|
19
|
-
import { generateChangelog, generateChangelogs } from "./generateChangelogs.js";
|
|
20
|
-
import { getCommitsSinceTarget } from "./getCommitsSinceTarget.js";
|
|
21
|
-
import {
|
|
22
|
-
injectReleaseNotesIntoReadme,
|
|
23
|
-
renderInjectedReadme,
|
|
24
|
-
resolveReadmePath
|
|
25
|
-
} from "./injectReleaseNotesIntoReadme.js";
|
|
26
|
-
import { injectSection } from "./injectSection.js";
|
|
27
|
-
import { COMMIT_PREPROCESSOR_PATTERNS, parseCommitMessage } from "./parseCommitMessage.js";
|
|
28
|
-
import { RELEASE_SUMMARY_FILE, RELEASE_TAGS_FILE, writeReleaseTags } from "./prepareCommand.js";
|
|
29
|
-
import { publishPackage } from "./publish.js";
|
|
30
|
-
import { pushRelease } from "./pushRelease.js";
|
|
31
|
-
import { releasePrepare } from "./releasePrepare.js";
|
|
32
|
-
import { releasePrepareMono } from "./releasePrepareMono.js";
|
|
33
|
-
import { matchesAudience, renderReleaseNotesMulti, renderReleaseNotesSingle } from "./renderReleaseNotes.js";
|
|
34
|
-
import { reportPrepare } from "./reportPrepare.js";
|
|
35
|
-
import { resolveCommandTags } from "./resolveCommandTags.js";
|
|
36
|
-
import { resolveReleaseTags } from "./resolveReleaseTags.js";
|
|
37
|
-
import { stripScope } from "./stripScope.js";
|
|
38
|
-
import { writeReleaseNotesPreviews } from "./writeReleaseNotesPreviews.js";
|
|
39
|
-
export {
|
|
40
|
-
COMMIT_PREPROCESSOR_PATTERNS,
|
|
41
|
-
DEFAULT_CHANGELOG_JSON_CONFIG,
|
|
42
|
-
DEFAULT_RELEASE_NOTES_CONFIG,
|
|
43
|
-
DEFAULT_VERSION_PATTERNS,
|
|
44
|
-
DEFAULT_WORK_TYPES,
|
|
45
|
-
RELEASE_SUMMARY_FILE,
|
|
46
|
-
RELEASE_TAGS_FILE,
|
|
47
|
-
buildReleaseSummary,
|
|
48
|
-
bumpAllVersions,
|
|
49
|
-
bumpVersion,
|
|
50
|
-
commitCommand,
|
|
51
|
-
createGithubRelease,
|
|
52
|
-
createGithubReleases,
|
|
53
|
-
createTags,
|
|
54
|
-
deleteFileIfExists,
|
|
55
|
-
deriveWorkspaceConfig,
|
|
56
|
-
detectPackageManager,
|
|
57
|
-
determineBumpType,
|
|
58
|
-
discoverWorkspaces,
|
|
59
|
-
generateChangelog,
|
|
60
|
-
generateChangelogJson,
|
|
61
|
-
generateChangelogs,
|
|
62
|
-
generateSyntheticChangelogJson,
|
|
63
|
-
getCommitsSinceTarget,
|
|
64
|
-
injectReleaseNotesIntoReadme,
|
|
65
|
-
injectSection,
|
|
66
|
-
matchesAudience,
|
|
67
|
-
parseCommitMessage,
|
|
68
|
-
publishPackage,
|
|
69
|
-
pushRelease,
|
|
70
|
-
releasePrepare,
|
|
71
|
-
releasePrepareMono,
|
|
72
|
-
renderInjectedReadme,
|
|
73
|
-
renderReleaseNotesMulti,
|
|
74
|
-
renderReleaseNotesSingle,
|
|
75
|
-
reportPrepare,
|
|
76
|
-
resolveCommandTags,
|
|
77
|
-
resolveReadmePath,
|
|
78
|
-
resolveReleaseTags,
|
|
79
|
-
stripScope,
|
|
80
|
-
writeReleaseNotesPreviews,
|
|
81
|
-
writeReleaseTags
|
|
82
|
-
};
|
|
@@ -107,7 +107,7 @@ on:
|
|
|
107
107
|
- minor
|
|
108
108
|
- major
|
|
109
109
|
force:
|
|
110
|
-
description: 'Force a release even when
|
|
110
|
+
description: 'Force a release even when no commits or no bump-worthy commits exist (defaults to patch; combine with --bump for a different level)'
|
|
111
111
|
required: false
|
|
112
112
|
type: boolean
|
|
113
113
|
default: false
|
|
@@ -141,7 +141,7 @@ on:
|
|
|
141
141
|
- minor
|
|
142
142
|
- major
|
|
143
143
|
force:
|
|
144
|
-
description: 'Force a release even when
|
|
144
|
+
description: 'Force a release even when no commits or no bump-worthy commits exist (defaults to patch; combine with --bump for a different level)'
|
|
145
145
|
required: false
|
|
146
146
|
type: boolean
|
|
147
147
|
default: false
|
package/dist/esm/loadConfig.d.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import type { MonorepoReleaseConfig, ReleaseConfig, ReleaseKitConfig, WorkTypeConfig } from './types.ts';
|
|
2
|
+
export declare const ROOT_PACKAGE_JSON_PATH = "package.json";
|
|
3
|
+
export declare function readRootPackageVersion(): {
|
|
4
|
+
exists: boolean;
|
|
5
|
+
version: string | undefined;
|
|
6
|
+
};
|
|
2
7
|
export declare const CONFIG_FILE_PATH = ".config/release-kit.config.ts";
|
|
3
8
|
export declare function loadConfig(): Promise<unknown>;
|
|
4
|
-
export
|
|
9
|
+
export interface RootPackageInfo {
|
|
10
|
+
exists: boolean;
|
|
11
|
+
version: string | undefined;
|
|
12
|
+
}
|
|
13
|
+
export declare function mergeMonorepoConfig(discoveredPaths: string[], userConfig: ReleaseKitConfig | undefined, rootPackage?: RootPackageInfo): MonorepoReleaseConfig;
|
|
5
14
|
export declare function mergeSinglePackageConfig(userConfig: ReleaseKitConfig | undefined): ReleaseConfig;
|
|
6
15
|
export declare function resolveWorkTypes(userWorkTypes?: Record<string, WorkTypeConfig>): Record<string, WorkTypeConfig>;
|