@williamthorsen/release-kit 5.4.0 → 7.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/CHANGELOG.md +32 -0
- package/README.md +12 -12
- package/dist/esm/.cache +1 -1
- package/dist/esm/assertCleanWorkingTree.js +9 -14
- package/dist/esm/bin/release-kit.js +202 -229
- package/dist/esm/buildChangelogEntries.d.ts +2 -2
- package/dist/esm/buildChangelogEntries.js +142 -149
- package/dist/esm/buildDependencyGraph.d.ts +1 -1
- package/dist/esm/buildDependencyGraph.js +60 -59
- package/dist/esm/buildEmptyReleaseEntry.d.ts +1 -1
- package/dist/esm/buildEmptyReleaseEntry.js +12 -15
- package/dist/esm/buildReleaseSummary.d.ts +1 -1
- package/dist/esm/buildReleaseSummary.js +23 -26
- package/dist/esm/buildSyntheticChangelogEntry.d.ts +1 -1
- package/dist/esm/buildSyntheticChangelogEntry.js +9 -12
- package/dist/esm/bumpAllVersions.d.ts +1 -1
- package/dist/esm/bumpAllVersions.js +51 -52
- package/dist/esm/bumpVersion.d.ts +1 -1
- package/dist/esm/bumpVersion.js +25 -28
- package/dist/esm/changelogJsonFile.d.ts +1 -1
- package/dist/esm/changelogJsonFile.js +59 -62
- package/dist/esm/changelogJsonUtils.d.ts +1 -1
- package/dist/esm/changelogJsonUtils.js +35 -32
- package/dist/esm/changelogOverrides.d.ts +1 -1
- package/dist/esm/changelogOverrides.js +374 -377
- package/dist/esm/checkWorkTypesDrift.js +104 -99
- package/dist/esm/collectPolicyViolations.d.ts +2 -2
- package/dist/esm/collectPolicyViolations.js +11 -14
- package/dist/esm/commitCommand.js +48 -53
- package/dist/esm/compareVersions.js +20 -23
- package/dist/esm/createGithubRelease.js +56 -59
- package/dist/esm/createGithubReleaseCommand.js +21 -29
- package/dist/esm/createTags.js +57 -56
- package/dist/esm/decideRelease.d.ts +2 -2
- package/dist/esm/decideRelease.js +27 -41
- package/dist/esm/defaults.d.ts +3 -3
- package/dist/esm/defaults.js +36 -48
- package/dist/esm/deleteFileIfExists.js +10 -12
- package/dist/esm/deriveWorkspaceConfig.d.ts +1 -1
- package/dist/esm/deriveWorkspaceConfig.js +34 -36
- package/dist/esm/detectPackageManager.js +35 -37
- package/dist/esm/detectUndeclaredTagPrefixes.js +41 -40
- package/dist/esm/determineBumpFromCommits.d.ts +2 -2
- package/dist/esm/determineBumpFromCommits.js +25 -29
- package/dist/esm/determineBumpType.d.ts +1 -1
- package/dist/esm/determineBumpType.js +31 -32
- package/dist/esm/discoverWorkspaces.js +38 -40
- package/dist/esm/format.js +6 -11
- package/dist/esm/generateChangelogs.d.ts +1 -1
- package/dist/esm/generateChangelogs.js +13 -17
- package/dist/esm/getCommitsSinceTarget.d.ts +1 -1
- package/dist/esm/getCommitsSinceTarget.js +54 -55
- package/dist/esm/hasPrettierConfig.js +33 -35
- package/dist/esm/help/prepareHelp.d.ts +2 -0
- package/dist/esm/help/prepareHelp.js +26 -0
- package/dist/esm/index.d.ts +4 -4
- package/dist/esm/index.js +2 -8
- package/dist/esm/init/checks.js +28 -32
- package/dist/esm/init/detectRepoType.js +12 -15
- package/dist/esm/init/initCommand.js +60 -54
- package/dist/esm/init/parseJsonRecord.js +9 -11
- package/dist/esm/init/scaffold.d.ts +1 -1
- package/dist/esm/init/scaffold.js +32 -38
- package/dist/esm/init/templates.d.ts +1 -1
- package/dist/esm/init/templates.js +16 -22
- package/dist/esm/injectReleaseNotesIntoReadme.js +42 -49
- package/dist/esm/injectSection.js +17 -27
- package/dist/esm/loadConfig.d.ts +1 -1
- package/dist/esm/loadConfig.js +206 -225
- package/dist/esm/parseCommitMessage.d.ts +1 -1
- package/dist/esm/parseCommitMessage.js +72 -76
- package/dist/esm/parseRequestedTags.js +6 -9
- package/dist/esm/prepareCommand.d.ts +32 -1
- package/dist/esm/prepareCommand.js +225 -271
- package/dist/esm/previewTagPrefixes.d.ts +1 -1
- package/dist/esm/previewTagPrefixes.js +101 -96
- package/dist/esm/propagateBumps.d.ts +2 -2
- package/dist/esm/propagateBumps.js +48 -50
- package/dist/esm/publish.d.ts +2 -2
- package/dist/esm/publish.js +22 -28
- package/dist/esm/publishCommand.js +75 -86
- package/dist/esm/pushCommand.js +33 -40
- package/dist/esm/pushRelease.d.ts +1 -1
- package/dist/esm/pushRelease.js +21 -24
- package/dist/esm/readCurrentVersion.js +13 -17
- package/dist/esm/releasePrepare.d.ts +1 -1
- package/dist/esm/releasePrepare.js +213 -231
- package/dist/esm/releasePrepareMono.d.ts +2 -2
- package/dist/esm/releasePrepareMono.js +434 -493
- package/dist/esm/releasePrepareProject.d.ts +2 -2
- package/dist/esm/releasePrepareProject.js +143 -153
- package/dist/esm/renderChangelogMarkdown.d.ts +1 -1
- package/dist/esm/renderChangelogMarkdown.js +20 -24
- package/dist/esm/renderReleaseNotes.d.ts +1 -1
- package/dist/esm/renderReleaseNotes.js +50 -55
- package/dist/esm/reportPrepare.d.ts +1 -1
- package/dist/esm/reportPrepare.js +230 -231
- package/dist/esm/resolveCliffConfigPath.js +18 -23
- package/dist/esm/resolveCommandTags.d.ts +1 -1
- package/dist/esm/resolveCommandTags.js +47 -44
- package/dist/esm/resolveReleaseNotesConfig.d.ts +1 -1
- package/dist/esm/resolveReleaseNotesConfig.js +39 -41
- package/dist/esm/resolveReleaseTags.d.ts +1 -1
- package/dist/esm/resolveReleaseTags.js +39 -40
- package/dist/esm/runGitCliff.js +27 -30
- package/dist/esm/showTagPrefixesCommand.js +48 -70
- package/dist/esm/stripEmojiPrefix.js +2 -5
- package/dist/esm/stripScope.js +18 -21
- package/dist/esm/sync-labels/generateCommand.d.ts +1 -1
- package/dist/esm/sync-labels/generateCommand.js +51 -52
- package/dist/esm/sync-labels/initCommand.js +46 -47
- package/dist/esm/sync-labels/loadSyncLabelsConfig.d.ts +1 -1
- package/dist/esm/sync-labels/loadSyncLabelsConfig.js +46 -52
- package/dist/esm/sync-labels/presets.d.ts +1 -1
- package/dist/esm/sync-labels/presets.js +40 -43
- package/dist/esm/sync-labels/resolveLabels.d.ts +1 -1
- package/dist/esm/sync-labels/resolveLabels.js +28 -35
- package/dist/esm/sync-labels/syncCommand.js +30 -30
- package/dist/esm/sync-labels/templates.d.ts +1 -1
- package/dist/esm/sync-labels/templates.js +23 -26
- package/dist/esm/sync-labels/types.js +1 -0
- package/dist/esm/syncWorkTypes.js +83 -81
- package/dist/esm/tagCommand.js +12 -21
- package/dist/esm/typeGuards.js +4 -8
- package/dist/esm/types.js +66 -60
- package/dist/esm/validateConfig.d.ts +1 -1
- package/dist/esm/validateConfig.js +109 -115
- package/dist/esm/validateOnlyExcludesStrandedDependents.d.ts +2 -2
- package/dist/esm/validateOnlyExcludesStrandedDependents.js +97 -91
- package/dist/esm/validateOverridesCommand.d.ts +2 -2
- package/dist/esm/validateOverridesCommand.js +111 -111
- package/dist/esm/workTypesData.js +57 -60
- package/dist/esm/workTypesUtils.js +16 -21
- package/dist/esm/writeReleaseNotesPreviews.js +55 -57
- package/package.json +2 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { basename } from
|
|
2
|
-
function syncLabelsWorkflow() {
|
|
3
|
-
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
29
|
+
return value.replace(/\\/g, '\\\\').replace(/'/g, String.raw `\'`);
|
|
30
30
|
}
|
|
31
|
-
function syncLabelsConfigScript(scopeLabels) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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,91 +1,93 @@
|
|
|
1
|
-
import { readFileSync, writeFileSync } from
|
|
2
|
-
import { dirname, resolve } from
|
|
3
|
-
import { fileURLToPath } from
|
|
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';
|
|
4
5
|
import { UPSTREAM_WORK_TYPES_URL } from "./checkWorkTypesDrift.js";
|
|
5
6
|
import { isRecord } from "./typeGuards.js";
|
|
6
7
|
import { buildFetchInit, errorMessage, hasExpectedTopLevelShape } from "./workTypesUtils.js";
|
|
7
8
|
function resolveDefaultLocalPath() {
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
const moduleDir = dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
return resolve(moduleDir, 'work-types.json');
|
|
10
11
|
}
|
|
11
12
|
function extractLocalSchemaUrl(content) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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;
|
|
23
25
|
}
|
|
24
|
-
async function syncWorkTypes(dependencies = {}) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
+
}
|
|
33
89
|
return {
|
|
34
|
-
|
|
35
|
-
|
|
90
|
+
exitCode: 0,
|
|
91
|
+
message: `Synced work-types.json from ${url} → ${localPath}.`,
|
|
36
92
|
};
|
|
37
|
-
}
|
|
38
|
-
if (!response.ok) {
|
|
39
|
-
return {
|
|
40
|
-
exitCode: 2,
|
|
41
|
-
message: `Failed to fetch upstream work-types.json: HTTP ${response.status} ${response.statusText}`
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
const upstreamText = await response.text();
|
|
45
|
-
let upstreamJson;
|
|
46
|
-
try {
|
|
47
|
-
upstreamJson = JSON.parse(upstreamText);
|
|
48
|
-
} catch (error) {
|
|
49
|
-
return {
|
|
50
|
-
exitCode: 3,
|
|
51
|
-
message: `Upstream work-types.json is not valid JSON: ${errorMessage(error)}`
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
if (!hasExpectedTopLevelShape(upstreamJson)) {
|
|
55
|
-
return {
|
|
56
|
-
exitCode: 3,
|
|
57
|
-
message: "Upstream work-types.json does not match the expected schema shape (missing `tiers` or `types`)."
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
let priorContent;
|
|
61
|
-
try {
|
|
62
|
-
priorContent = readFileSync(localPath, "utf8");
|
|
63
|
-
} catch {
|
|
64
|
-
priorContent = void 0;
|
|
65
|
-
}
|
|
66
|
-
const localSchemaUrl = priorContent !== void 0 ? extractLocalSchemaUrl(priorContent) : void 0;
|
|
67
|
-
const outputJson = localSchemaUrl !== void 0 ? { $schema: localSchemaUrl, ...upstreamJson } : upstreamJson;
|
|
68
|
-
const formatted = `${JSON.stringify(outputJson, null, 2)}
|
|
69
|
-
`;
|
|
70
|
-
if (priorContent === formatted) {
|
|
71
|
-
return {
|
|
72
|
-
exitCode: 0,
|
|
73
|
-
message: `Local work-types.json already matches upstream (${localPath}).`
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
try {
|
|
77
|
-
writeFileSync(localPath, formatted, "utf8");
|
|
78
|
-
} catch (error) {
|
|
79
|
-
return {
|
|
80
|
-
exitCode: 2,
|
|
81
|
-
message: `Failed to write ${localPath}: ${errorMessage(error)}`
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
return {
|
|
85
|
-
exitCode: 0,
|
|
86
|
-
message: `Synced work-types.json from ${url} \u2192 ${localPath}.`
|
|
87
|
-
};
|
|
88
93
|
}
|
|
89
|
-
export {
|
|
90
|
-
syncWorkTypes
|
|
91
|
-
};
|
package/dist/esm/tagCommand.js
CHANGED
|
@@ -1,25 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { parseArgsOrExit, reportError } from '@williamthorsen/nmr-core';
|
|
2
2
|
import { createTags } from "./createTags.js";
|
|
3
3
|
const tagFlagSchema = {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
dryRun: { long: '--dry-run', type: 'boolean' },
|
|
5
|
+
noGitChecks: { long: '--no-git-checks', type: 'boolean' },
|
|
6
6
|
};
|
|
7
|
-
function tagCommand(argv) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
try {
|
|
17
|
-
createTags({ dryRun, noGitChecks });
|
|
18
|
-
} catch (error) {
|
|
19
|
-
console.error(error instanceof Error ? error.message : String(error));
|
|
20
|
-
process.exit(1);
|
|
21
|
-
}
|
|
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
|
+
}
|
|
22
16
|
}
|
|
23
|
-
export {
|
|
24
|
-
tagCommand
|
|
25
|
-
};
|
package/dist/esm/typeGuards.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
function isRecord(value) {
|
|
2
|
-
|
|
1
|
+
export function isRecord(value) {
|
|
2
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
3
3
|
}
|
|
4
|
-
function isUnknownArray(value) {
|
|
5
|
-
|
|
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
|
|
2
|
-
const legacyIdentitySchema = z
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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();
|