@williamthorsen/release-kit 6.0.0 → 8.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.
Files changed (134) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +5 -3
  3. package/dist/esm/assertCleanWorkingTree.js +9 -14
  4. package/dist/esm/bin/release-kit.js +200 -199
  5. package/dist/esm/buildChangelogEntries.d.ts +2 -2
  6. package/dist/esm/buildChangelogEntries.js +142 -149
  7. package/dist/esm/buildDependencyGraph.d.ts +1 -1
  8. package/dist/esm/buildDependencyGraph.js +60 -59
  9. package/dist/esm/buildEmptyReleaseEntry.d.ts +1 -1
  10. package/dist/esm/buildEmptyReleaseEntry.js +12 -15
  11. package/dist/esm/buildReleaseSummary.d.ts +1 -1
  12. package/dist/esm/buildReleaseSummary.js +23 -26
  13. package/dist/esm/buildSyntheticChangelogEntry.d.ts +1 -1
  14. package/dist/esm/buildSyntheticChangelogEntry.js +9 -12
  15. package/dist/esm/bumpAllVersions.d.ts +1 -1
  16. package/dist/esm/bumpAllVersions.js +51 -52
  17. package/dist/esm/bumpVersion.d.ts +1 -1
  18. package/dist/esm/bumpVersion.js +25 -28
  19. package/dist/esm/changelogJsonFile.d.ts +1 -1
  20. package/dist/esm/changelogJsonFile.js +59 -62
  21. package/dist/esm/changelogJsonUtils.d.ts +1 -1
  22. package/dist/esm/changelogJsonUtils.js +35 -32
  23. package/dist/esm/changelogOverrides.d.ts +1 -1
  24. package/dist/esm/changelogOverrides.js +374 -377
  25. package/dist/esm/checkWorkTypesDrift.js +104 -102
  26. package/dist/esm/collectPolicyViolations.d.ts +2 -2
  27. package/dist/esm/collectPolicyViolations.js +11 -14
  28. package/dist/esm/commitCommand.js +48 -46
  29. package/dist/esm/compareVersions.js +20 -23
  30. package/dist/esm/createGithubRelease.js +56 -59
  31. package/dist/esm/createGithubReleaseCommand.js +21 -23
  32. package/dist/esm/createTags.js +57 -56
  33. package/dist/esm/decideRelease.d.ts +2 -2
  34. package/dist/esm/decideRelease.js +27 -41
  35. package/dist/esm/defaults.d.ts +3 -3
  36. package/dist/esm/defaults.js +36 -48
  37. package/dist/esm/deleteFileIfExists.js +10 -12
  38. package/dist/esm/deriveWorkspaceConfig.d.ts +1 -1
  39. package/dist/esm/deriveWorkspaceConfig.js +34 -36
  40. package/dist/esm/detectPackageManager.js +35 -37
  41. package/dist/esm/detectUndeclaredTagPrefixes.js +41 -40
  42. package/dist/esm/determineBumpFromCommits.d.ts +2 -2
  43. package/dist/esm/determineBumpFromCommits.js +25 -29
  44. package/dist/esm/determineBumpType.d.ts +1 -1
  45. package/dist/esm/determineBumpType.js +31 -32
  46. package/dist/esm/discoverWorkspaces.js +38 -40
  47. package/dist/esm/format.js +6 -11
  48. package/dist/esm/generateChangelogs.d.ts +1 -1
  49. package/dist/esm/generateChangelogs.js +13 -17
  50. package/dist/esm/getCommitsSinceTarget.d.ts +1 -1
  51. package/dist/esm/getCommitsSinceTarget.js +54 -55
  52. package/dist/esm/hasPrettierConfig.js +33 -35
  53. package/dist/esm/help/prepareHelp.js +4 -8
  54. package/dist/esm/index.d.ts +4 -4
  55. package/dist/esm/index.js +2 -8
  56. package/dist/esm/init/checks.js +28 -32
  57. package/dist/esm/init/detectRepoType.js +12 -15
  58. package/dist/esm/init/initCommand.js +60 -54
  59. package/dist/esm/init/parseJsonRecord.js +9 -11
  60. package/dist/esm/init/scaffold.d.ts +1 -1
  61. package/dist/esm/init/scaffold.js +32 -38
  62. package/dist/esm/init/templates.d.ts +1 -1
  63. package/dist/esm/init/templates.js +16 -22
  64. package/dist/esm/injectReleaseNotesIntoReadme.js +42 -49
  65. package/dist/esm/injectSection.js +17 -27
  66. package/dist/esm/loadConfig.d.ts +1 -1
  67. package/dist/esm/loadConfig.js +206 -225
  68. package/dist/esm/parseCommitMessage.d.ts +1 -1
  69. package/dist/esm/parseCommitMessage.js +72 -76
  70. package/dist/esm/parseRequestedTags.js +6 -9
  71. package/dist/esm/prepareCommand.d.ts +1 -1
  72. package/dist/esm/prepareCommand.js +225 -235
  73. package/dist/esm/previewTagPrefixes.d.ts +1 -1
  74. package/dist/esm/previewTagPrefixes.js +101 -96
  75. package/dist/esm/propagateBumps.d.ts +2 -2
  76. package/dist/esm/propagateBumps.js +48 -50
  77. package/dist/esm/publish.d.ts +2 -2
  78. package/dist/esm/publish.js +22 -28
  79. package/dist/esm/publishCommand.js +75 -80
  80. package/dist/esm/pushCommand.js +33 -34
  81. package/dist/esm/pushRelease.d.ts +1 -1
  82. package/dist/esm/pushRelease.js +21 -24
  83. package/dist/esm/readCurrentVersion.js +13 -17
  84. package/dist/esm/releasePrepare.d.ts +1 -1
  85. package/dist/esm/releasePrepare.js +213 -231
  86. package/dist/esm/releasePrepareMono.d.ts +2 -2
  87. package/dist/esm/releasePrepareMono.js +434 -494
  88. package/dist/esm/releasePrepareProject.d.ts +2 -2
  89. package/dist/esm/releasePrepareProject.js +143 -153
  90. package/dist/esm/renderChangelogMarkdown.d.ts +1 -1
  91. package/dist/esm/renderChangelogMarkdown.js +20 -24
  92. package/dist/esm/renderReleaseNotes.d.ts +1 -1
  93. package/dist/esm/renderReleaseNotes.js +50 -55
  94. package/dist/esm/reportPrepare.d.ts +1 -1
  95. package/dist/esm/reportPrepare.js +230 -231
  96. package/dist/esm/resolveCliffConfigPath.js +18 -23
  97. package/dist/esm/resolveCommandTags.d.ts +1 -1
  98. package/dist/esm/resolveCommandTags.js +47 -45
  99. package/dist/esm/resolveReleaseNotesConfig.d.ts +1 -1
  100. package/dist/esm/resolveReleaseNotesConfig.js +39 -43
  101. package/dist/esm/resolveReleaseTags.d.ts +1 -1
  102. package/dist/esm/resolveReleaseTags.js +39 -40
  103. package/dist/esm/runGitCliff.js +27 -30
  104. package/dist/esm/showTagPrefixesCommand.js +48 -70
  105. package/dist/esm/stripEmojiPrefix.js +2 -5
  106. package/dist/esm/stripScope.js +18 -21
  107. package/dist/esm/sync-labels/generateCommand.d.ts +1 -1
  108. package/dist/esm/sync-labels/generateCommand.js +51 -53
  109. package/dist/esm/sync-labels/initCommand.js +46 -48
  110. package/dist/esm/sync-labels/loadSyncLabelsConfig.d.ts +1 -1
  111. package/dist/esm/sync-labels/loadSyncLabelsConfig.js +46 -52
  112. package/dist/esm/sync-labels/presets.d.ts +1 -1
  113. package/dist/esm/sync-labels/presets.js +40 -43
  114. package/dist/esm/sync-labels/resolveLabels.d.ts +1 -1
  115. package/dist/esm/sync-labels/resolveLabels.js +28 -35
  116. package/dist/esm/sync-labels/syncCommand.js +30 -31
  117. package/dist/esm/sync-labels/templates.d.ts +1 -1
  118. package/dist/esm/sync-labels/templates.js +23 -26
  119. package/dist/esm/sync-labels/types.js +1 -0
  120. package/dist/esm/syncWorkTypes.js +83 -84
  121. package/dist/esm/tagCommand.js +12 -14
  122. package/dist/esm/typeGuards.js +4 -8
  123. package/dist/esm/types.js +66 -60
  124. package/dist/esm/validateConfig.d.ts +1 -1
  125. package/dist/esm/validateConfig.js +109 -115
  126. package/dist/esm/validateOnlyExcludesStrandedDependents.d.ts +2 -2
  127. package/dist/esm/validateOnlyExcludesStrandedDependents.js +97 -91
  128. package/dist/esm/validateOverridesCommand.d.ts +2 -2
  129. package/dist/esm/validateOverridesCommand.js +110 -111
  130. package/dist/esm/workTypesData.js +57 -60
  131. package/dist/esm/workTypesUtils.js +16 -21
  132. package/dist/esm/writeReleaseNotesPreviews.js +55 -57
  133. package/package.json +3 -2
  134. package/dist/esm/.cache +0 -1
@@ -1,6 +1,6 @@
1
- import { basename } from "node:path";
2
- function syncLabelsWorkflow() {
3
- return `# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
1
+ import { basename } from 'node:path';
2
+ export function syncLabelsWorkflow() {
3
+ return `# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
4
4
  name: Sync labels
5
5
 
6
6
  on:
@@ -15,27 +15,29 @@ jobs:
15
15
  uses: williamthorsen/node-monorepo-tools/.github/workflows/sync-labels.reusable.yaml@workflow/sync-labels-v1
16
16
  `;
17
17
  }
18
- function buildScopeLabels(workspacePaths) {
19
- const labels = [
20
- { name: "scope:root", color: "00ff96", description: "Monorepo root configuration" }
21
- ];
22
- for (const workspacePath of workspacePaths) {
23
- const name = basename(workspacePath);
24
- labels.push({ name: `scope:${name}`, color: "00ff96", description: `${name} package` });
25
- }
26
- return labels;
18
+ export function buildScopeLabels(workspacePaths) {
19
+ const labels = [
20
+ { name: 'scope:root', color: '00ff96', description: 'Monorepo root configuration' },
21
+ ];
22
+ for (const workspacePath of workspacePaths) {
23
+ const name = basename(workspacePath);
24
+ labels.push({ name: `scope:${name}`, color: '00ff96', description: `${name} package` });
25
+ }
26
+ return labels;
27
27
  }
28
28
  function escapeForSingleQuotedString(value) {
29
- return value.replace(/\\/g, "\\\\").replace(/'/g, String.raw`\'`);
29
+ return value.replace(/\\/g, '\\\\').replace(/'/g, String.raw `\'`);
30
30
  }
31
- function syncLabelsConfigScript(scopeLabels) {
32
- const labelsArray = scopeLabels.map((label) => {
33
- const name = escapeForSingleQuotedString(label.name);
34
- const color = escapeForSingleQuotedString(label.color);
35
- const description = escapeForSingleQuotedString(label.description);
36
- return ` { name: '${name}', color: '${color}', description: '${description}' },`;
37
- }).join("\n");
38
- return `import type { SyncLabelsConfig } from '@williamthorsen/release-kit';
31
+ export function syncLabelsConfigScript(scopeLabels) {
32
+ const labelsArray = scopeLabels
33
+ .map((label) => {
34
+ const name = escapeForSingleQuotedString(label.name);
35
+ const color = escapeForSingleQuotedString(label.color);
36
+ const description = escapeForSingleQuotedString(label.description);
37
+ return ` { name: '${name}', color: '${color}', description: '${description}' },`;
38
+ })
39
+ .join('\n');
40
+ return `import type { SyncLabelsConfig } from '@williamthorsen/release-kit';
39
41
 
40
42
  const config: SyncLabelsConfig = {
41
43
  presets: ['common'],
@@ -47,8 +49,3 @@ ${labelsArray}
47
49
  export default config;
48
50
  `;
49
51
  }
50
- export {
51
- buildScopeLabels,
52
- syncLabelsConfigScript,
53
- syncLabelsWorkflow
54
- };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,94 +1,93 @@
1
- import { readFileSync, writeFileSync } from "node:fs";
2
- import { dirname, resolve } from "node:path";
3
- import { fileURLToPath } from "node:url";
4
- import { formatErrorLine } from "@williamthorsen/nmr-core";
1
+ import { readFileSync, writeFileSync } from 'node:fs';
2
+ import { dirname, resolve } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ import { formatErrorLine } from '@williamthorsen/nmr-core';
5
5
  import { UPSTREAM_WORK_TYPES_URL } from "./checkWorkTypesDrift.js";
6
6
  import { isRecord } from "./typeGuards.js";
7
7
  import { buildFetchInit, errorMessage, hasExpectedTopLevelShape } from "./workTypesUtils.js";
8
8
  function resolveDefaultLocalPath() {
9
- const moduleDir = dirname(fileURLToPath(import.meta.url));
10
- return resolve(moduleDir, "work-types.json");
9
+ const moduleDir = dirname(fileURLToPath(import.meta.url));
10
+ return resolve(moduleDir, 'work-types.json');
11
11
  }
12
12
  function extractLocalSchemaUrl(content) {
13
- let parsed;
14
- try {
15
- parsed = JSON.parse(content);
16
- } catch {
17
- return void 0;
18
- }
19
- if (!isRecord(parsed)) {
20
- return void 0;
21
- }
22
- const schema = parsed.$schema;
23
- return typeof schema === "string" ? schema : void 0;
13
+ let parsed;
14
+ try {
15
+ parsed = JSON.parse(content);
16
+ }
17
+ catch {
18
+ return undefined;
19
+ }
20
+ if (!isRecord(parsed)) {
21
+ return undefined;
22
+ }
23
+ const schema = parsed.$schema;
24
+ return typeof schema === 'string' ? schema : undefined;
24
25
  }
25
- async function syncWorkTypes(dependencies = {}) {
26
- const localPath = dependencies.localPath ?? resolveDefaultLocalPath();
27
- const fetcher = dependencies.fetch ?? globalThis.fetch;
28
- const url = dependencies.upstreamUrl ?? UPSTREAM_WORK_TYPES_URL;
29
- const fetchInit = buildFetchInit();
30
- let response;
31
- try {
32
- response = fetchInit === void 0 ? await fetcher(url) : await fetcher(url, fetchInit);
33
- } catch (error) {
26
+ export async function syncWorkTypes(dependencies = {}) {
27
+ const localPath = dependencies.localPath ?? resolveDefaultLocalPath();
28
+ const fetcher = dependencies.fetch ?? globalThis.fetch;
29
+ const url = dependencies.upstreamUrl ?? UPSTREAM_WORK_TYPES_URL;
30
+ const fetchInit = buildFetchInit();
31
+ let response;
32
+ try {
33
+ response = fetchInit === undefined ? await fetcher(url) : await fetcher(url, fetchInit);
34
+ }
35
+ catch (error) {
36
+ return {
37
+ exitCode: 2,
38
+ message: formatErrorLine(`Failed to fetch upstream work-types.json: ${errorMessage(error)}`),
39
+ };
40
+ }
41
+ if (!response.ok) {
42
+ return {
43
+ exitCode: 2,
44
+ message: formatErrorLine(`Failed to fetch upstream work-types.json: HTTP ${response.status} ${response.statusText}`),
45
+ };
46
+ }
47
+ const upstreamText = await response.text();
48
+ let upstreamJson;
49
+ try {
50
+ upstreamJson = JSON.parse(upstreamText);
51
+ }
52
+ catch (error) {
53
+ return {
54
+ exitCode: 3,
55
+ message: `Upstream work-types.json is not valid JSON: ${errorMessage(error)}`,
56
+ };
57
+ }
58
+ if (!hasExpectedTopLevelShape(upstreamJson)) {
59
+ return {
60
+ exitCode: 3,
61
+ message: 'Upstream work-types.json does not match the expected schema shape (missing `tiers` or `types`).',
62
+ };
63
+ }
64
+ let priorContent;
65
+ try {
66
+ priorContent = readFileSync(localPath, 'utf8');
67
+ }
68
+ catch {
69
+ priorContent = undefined;
70
+ }
71
+ const localSchemaUrl = priorContent !== undefined ? extractLocalSchemaUrl(priorContent) : undefined;
72
+ const outputJson = localSchemaUrl !== undefined ? { $schema: localSchemaUrl, ...upstreamJson } : upstreamJson;
73
+ const formatted = `${JSON.stringify(outputJson, null, 2)}\n`;
74
+ if (priorContent === formatted) {
75
+ return {
76
+ exitCode: 0,
77
+ message: `Local work-types.json already matches upstream (${localPath}).`,
78
+ };
79
+ }
80
+ try {
81
+ writeFileSync(localPath, formatted, 'utf8');
82
+ }
83
+ catch (error) {
84
+ return {
85
+ exitCode: 2,
86
+ message: formatErrorLine(`Failed to write ${localPath}: ${errorMessage(error)}`),
87
+ };
88
+ }
34
89
  return {
35
- exitCode: 2,
36
- message: formatErrorLine(`Failed to fetch upstream work-types.json: ${errorMessage(error)}`)
90
+ exitCode: 0,
91
+ message: `Synced work-types.json from ${url} → ${localPath}.`,
37
92
  };
38
- }
39
- if (!response.ok) {
40
- return {
41
- exitCode: 2,
42
- message: formatErrorLine(
43
- `Failed to fetch upstream work-types.json: HTTP ${response.status} ${response.statusText}`
44
- )
45
- };
46
- }
47
- const upstreamText = await response.text();
48
- let upstreamJson;
49
- try {
50
- upstreamJson = JSON.parse(upstreamText);
51
- } catch (error) {
52
- return {
53
- exitCode: 3,
54
- message: `Upstream work-types.json is not valid JSON: ${errorMessage(error)}`
55
- };
56
- }
57
- if (!hasExpectedTopLevelShape(upstreamJson)) {
58
- return {
59
- exitCode: 3,
60
- message: "Upstream work-types.json does not match the expected schema shape (missing `tiers` or `types`)."
61
- };
62
- }
63
- let priorContent;
64
- try {
65
- priorContent = readFileSync(localPath, "utf8");
66
- } catch {
67
- priorContent = void 0;
68
- }
69
- const localSchemaUrl = priorContent !== void 0 ? extractLocalSchemaUrl(priorContent) : void 0;
70
- const outputJson = localSchemaUrl !== void 0 ? { $schema: localSchemaUrl, ...upstreamJson } : upstreamJson;
71
- const formatted = `${JSON.stringify(outputJson, null, 2)}
72
- `;
73
- if (priorContent === formatted) {
74
- return {
75
- exitCode: 0,
76
- message: `Local work-types.json already matches upstream (${localPath}).`
77
- };
78
- }
79
- try {
80
- writeFileSync(localPath, formatted, "utf8");
81
- } catch (error) {
82
- return {
83
- exitCode: 2,
84
- message: formatErrorLine(`Failed to write ${localPath}: ${errorMessage(error)}`)
85
- };
86
- }
87
- return {
88
- exitCode: 0,
89
- message: `Synced work-types.json from ${url} \u2192 ${localPath}.`
90
- };
91
93
  }
92
- export {
93
- syncWorkTypes
94
- };
@@ -1,18 +1,16 @@
1
- import { parseArgsOrExit, reportError } from "@williamthorsen/nmr-core";
1
+ import { parseArgsOrExit, reportError } from '@williamthorsen/nmr-core';
2
2
  import { createTags } from "./createTags.js";
3
3
  const tagFlagSchema = {
4
- dryRun: { long: "--dry-run", type: "boolean" },
5
- noGitChecks: { long: "--no-git-checks", type: "boolean" }
4
+ dryRun: { long: '--dry-run', type: 'boolean' },
5
+ noGitChecks: { long: '--no-git-checks', type: 'boolean' },
6
6
  };
7
- function tagCommand(argv) {
8
- const { dryRun, noGitChecks } = parseArgsOrExit(argv, tagFlagSchema).flags;
9
- try {
10
- createTags({ dryRun, noGitChecks });
11
- } catch (error) {
12
- reportError(error instanceof Error ? error.message : String(error));
13
- process.exit(1);
14
- }
7
+ export function tagCommand(argv) {
8
+ const { dryRun, noGitChecks } = parseArgsOrExit(argv, tagFlagSchema).flags;
9
+ try {
10
+ createTags({ dryRun, noGitChecks });
11
+ }
12
+ catch (error) {
13
+ reportError(error instanceof Error ? error.message : String(error));
14
+ process.exit(1);
15
+ }
15
16
  }
16
- export {
17
- tagCommand
18
- };
@@ -1,10 +1,6 @@
1
- function isRecord(value) {
2
- return typeof value === "object" && value !== null && !Array.isArray(value);
1
+ export function isRecord(value) {
2
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
3
3
  }
4
- function isUnknownArray(value) {
5
- return Array.isArray(value);
4
+ export function isUnknownArray(value) {
5
+ return Array.isArray(value);
6
6
  }
7
- export {
8
- isRecord,
9
- isUnknownArray
10
- };
package/dist/esm/types.js CHANGED
@@ -1,60 +1,66 @@
1
- import { z } from "zod";
2
- const legacyIdentitySchema = z.object({
3
- name: z.string().min(1),
4
- tagPrefix: z.string().min(1)
5
- }).strict();
6
- const retiredPackageSchema = z.object({
7
- name: z.string().min(1),
8
- tagPrefix: z.string().min(1),
9
- successor: z.string().min(1).optional()
10
- }).strict();
11
- const workspaceOverrideSchema = z.object({
12
- dir: z.string().min(1),
13
- shouldExclude: z.boolean().optional(),
14
- legacyIdentities: z.array(legacyIdentitySchema).optional()
15
- }).strict();
16
- const projectConfigSchema = z.object({
17
- tagPrefix: z.string().min(1).optional()
18
- }).strict();
19
- const changelogJsonInputSchema = z.object({
20
- enabled: z.boolean().optional(),
21
- outputPath: z.string().optional(),
22
- devOnlySections: z.array(z.string()).optional()
23
- }).strict();
24
- const releaseNotesInputSchema = z.object({
25
- shouldInjectIntoReadme: z.boolean().optional()
26
- }).strict();
27
- const workTypeConfigSchema = z.object({
28
- header: z.string(),
29
- aliases: z.array(z.string()).optional()
30
- }).strict();
31
- const versionPatternsSchema = z.object({
32
- major: z.array(z.string()),
33
- minor: z.array(z.string())
34
- }).strict();
35
- const breakingPolicyValueSchema = z.enum(["forbidden", "optional", "required"]);
36
- const releaseKitConfigSchema = z.object({
37
- breakingPolicies: z.record(z.string(), breakingPolicyValueSchema).optional(),
38
- changelogJson: changelogJsonInputSchema.optional(),
39
- cliffConfigPath: z.string().min(1).optional(),
40
- formatCommand: z.string().min(1).optional(),
41
- project: projectConfigSchema.optional(),
42
- releaseNotes: releaseNotesInputSchema.optional(),
43
- retiredPackages: z.array(retiredPackageSchema).optional(),
44
- scopeAliases: z.record(z.string(), z.string()).optional(),
45
- versionPatterns: versionPatternsSchema.optional(),
46
- workspaces: z.array(workspaceOverrideSchema).optional(),
47
- workTypes: z.record(z.string(), workTypeConfigSchema).optional()
48
- }).strict();
49
- export {
50
- breakingPolicyValueSchema,
51
- changelogJsonInputSchema,
52
- legacyIdentitySchema,
53
- projectConfigSchema,
54
- releaseKitConfigSchema,
55
- releaseNotesInputSchema,
56
- retiredPackageSchema,
57
- versionPatternsSchema,
58
- workTypeConfigSchema,
59
- workspaceOverrideSchema
60
- };
1
+ import { z } from 'zod';
2
+ export const legacyIdentitySchema = z
3
+ .object({
4
+ name: z.string().min(1),
5
+ tagPrefix: z.string().min(1),
6
+ })
7
+ .strict();
8
+ export const retiredPackageSchema = z
9
+ .object({
10
+ name: z.string().min(1),
11
+ tagPrefix: z.string().min(1),
12
+ successor: z.string().min(1).optional(),
13
+ })
14
+ .strict();
15
+ export const workspaceOverrideSchema = z
16
+ .object({
17
+ dir: z.string().min(1),
18
+ shouldExclude: z.boolean().optional(),
19
+ legacyIdentities: z.array(legacyIdentitySchema).optional(),
20
+ })
21
+ .strict();
22
+ export const projectConfigSchema = z
23
+ .object({
24
+ tagPrefix: z.string().min(1).optional(),
25
+ })
26
+ .strict();
27
+ export const changelogJsonInputSchema = z
28
+ .object({
29
+ enabled: z.boolean().optional(),
30
+ outputPath: z.string().optional(),
31
+ devOnlySections: z.array(z.string()).optional(),
32
+ })
33
+ .strict();
34
+ export const releaseNotesInputSchema = z
35
+ .object({
36
+ shouldInjectIntoReadme: z.boolean().optional(),
37
+ })
38
+ .strict();
39
+ export const workTypeConfigSchema = z
40
+ .object({
41
+ header: z.string(),
42
+ aliases: z.array(z.string()).optional(),
43
+ })
44
+ .strict();
45
+ export const versionPatternsSchema = z
46
+ .object({
47
+ major: z.array(z.string()),
48
+ minor: z.array(z.string()),
49
+ })
50
+ .strict();
51
+ export const breakingPolicyValueSchema = z.enum(['forbidden', 'optional', 'required']);
52
+ export const releaseKitConfigSchema = z
53
+ .object({
54
+ breakingPolicies: z.record(z.string(), breakingPolicyValueSchema).optional(),
55
+ changelogJson: changelogJsonInputSchema.optional(),
56
+ cliffConfigPath: z.string().min(1).optional(),
57
+ formatCommand: z.string().min(1).optional(),
58
+ project: projectConfigSchema.optional(),
59
+ releaseNotes: releaseNotesInputSchema.optional(),
60
+ retiredPackages: z.array(retiredPackageSchema).optional(),
61
+ scopeAliases: z.record(z.string(), z.string()).optional(),
62
+ versionPatterns: versionPatternsSchema.optional(),
63
+ workspaces: z.array(workspaceOverrideSchema).optional(),
64
+ workTypes: z.record(z.string(), workTypeConfigSchema).optional(),
65
+ })
66
+ .strict();
@@ -1,4 +1,4 @@
1
- import type { ReleaseKitConfig } from './types.ts';
1
+ import type { ReleaseKitConfig } from './types.js';
2
2
  export declare function validateConfig(raw: unknown): {
3
3
  config: ReleaseKitConfig;
4
4
  errors: string[];