@kb-labs/release-manager-changelog 0.6.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/LICENSE +23 -0
- package/README.md +195 -0
- package/dist/index.d.ts +337 -0
- package/dist/index.js +1429 -0
- package/dist/index.js.map +1 -0
- package/dist/templates/builtin/compact.d.ts +17 -0
- package/dist/templates/builtin/compact.js +40 -0
- package/dist/templates/builtin/compact.js.map +1 -0
- package/dist/templates/builtin/corporate-ai.d.ts +16 -0
- package/dist/templates/builtin/corporate-ai.js +164 -0
- package/dist/templates/builtin/corporate-ai.js.map +1 -0
- package/dist/templates/builtin/corporate.d.ts +17 -0
- package/dist/templates/builtin/corporate.js +98 -0
- package/dist/templates/builtin/corporate.js.map +1 -0
- package/dist/templates/builtin/technical.d.ts +18 -0
- package/dist/templates/builtin/technical.js +88 -0
- package/dist/templates/builtin/technical.js.map +1 -0
- package/dist/types-DdtOg4s3.d.ts +213 -0
- package/package.json +61 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// src/templates/builtin/corporate.ts
|
|
2
|
+
var version = "1.0";
|
|
3
|
+
function render(data) {
|
|
4
|
+
const { package: pkg, breaking, changes, locale } = data;
|
|
5
|
+
const lines = [];
|
|
6
|
+
const date = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
7
|
+
const reasonLabel = getReasonLabel(pkg.reason, locale);
|
|
8
|
+
lines.push(`## [${pkg.next}] - ${date}`);
|
|
9
|
+
lines.push("");
|
|
10
|
+
lines.push(`> **${pkg.name}** ${pkg.prev} \u2192 ${pkg.next} (${reasonLabel})`);
|
|
11
|
+
lines.push("");
|
|
12
|
+
if (breaking.length > 0) {
|
|
13
|
+
const breakingTitle = locale === "ru" ? "\u26A0\uFE0F \u041A\u0420\u0418\u0422\u0418\u0427\u0415\u0421\u041A\u0418\u0415 \u0418\u0417\u041C\u0415\u041D\u0415\u041D\u0418\u042F" : "\u26A0\uFE0F BREAKING CHANGES";
|
|
14
|
+
lines.push(`### ${breakingTitle}`);
|
|
15
|
+
lines.push("");
|
|
16
|
+
for (const br of breaking) {
|
|
17
|
+
lines.push(`- **${br.summary}**`);
|
|
18
|
+
if (br.notes) {
|
|
19
|
+
lines.push(` ${br.notes}`);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
lines.push("");
|
|
23
|
+
}
|
|
24
|
+
if (changes.feat && changes.feat.length > 0) {
|
|
25
|
+
const featTitle = locale === "ru" ? "\u2728 \u041D\u043E\u0432\u044B\u0435 \u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E\u0441\u0442\u0438" : "\u2728 New Features";
|
|
26
|
+
lines.push(`### ${featTitle}`);
|
|
27
|
+
lines.push("");
|
|
28
|
+
for (const feat of changes.feat) {
|
|
29
|
+
lines.push(formatChangeLine(feat));
|
|
30
|
+
}
|
|
31
|
+
lines.push("");
|
|
32
|
+
}
|
|
33
|
+
if (changes.perf && changes.perf.length > 0) {
|
|
34
|
+
const perfTitle = locale === "ru" ? "\u26A1 \u041F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C" : "\u26A1 Performance Improvements";
|
|
35
|
+
lines.push(`### ${perfTitle}`);
|
|
36
|
+
lines.push("");
|
|
37
|
+
for (const perf of changes.perf) {
|
|
38
|
+
lines.push(formatChangeLine(perf));
|
|
39
|
+
}
|
|
40
|
+
lines.push("");
|
|
41
|
+
}
|
|
42
|
+
if (changes.fix && changes.fix.length > 0) {
|
|
43
|
+
const fixTitle = locale === "ru" ? "\u{1F41B} \u0418\u0441\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F" : "\u{1F41B} Bug Fixes";
|
|
44
|
+
lines.push(`### ${fixTitle}`);
|
|
45
|
+
lines.push("");
|
|
46
|
+
for (const fix of changes.fix) {
|
|
47
|
+
lines.push(formatChangeLine(fix));
|
|
48
|
+
}
|
|
49
|
+
lines.push("");
|
|
50
|
+
}
|
|
51
|
+
if (changes.revert && changes.revert.length > 0) {
|
|
52
|
+
const revertTitle = locale === "ru" ? "\u23EA \u041E\u0442\u043A\u0430\u0442\u044B" : "\u23EA Reverts";
|
|
53
|
+
lines.push(`### ${revertTitle}`);
|
|
54
|
+
lines.push("");
|
|
55
|
+
for (const revert of changes.revert) {
|
|
56
|
+
lines.push(formatChangeLine(revert));
|
|
57
|
+
}
|
|
58
|
+
lines.push("");
|
|
59
|
+
}
|
|
60
|
+
return lines.join("\n").trimEnd();
|
|
61
|
+
}
|
|
62
|
+
function formatChangeLine(change) {
|
|
63
|
+
const scope = change.scope ? `**${change.scope}**` : "";
|
|
64
|
+
const text = scope ? `${scope}: ${change.subject}` : change.subject;
|
|
65
|
+
const refs = formatRefs(change);
|
|
66
|
+
return refs ? `- ${text} (${refs})` : `- ${text}`;
|
|
67
|
+
}
|
|
68
|
+
function formatRefs(change) {
|
|
69
|
+
if (!change.refs || change.refs.length === 0) {
|
|
70
|
+
return "";
|
|
71
|
+
}
|
|
72
|
+
return change.refs.map((ref) => {
|
|
73
|
+
const issueLink = change.providerLinks?.issues?.find((l) => l.endsWith(`/${ref.id}`));
|
|
74
|
+
if (issueLink) {
|
|
75
|
+
return `[#${ref.id}](${issueLink})`;
|
|
76
|
+
}
|
|
77
|
+
const prLink = change.providerLinks?.pr?.find((l) => l.endsWith(`/${ref.id}`));
|
|
78
|
+
if (prLink) {
|
|
79
|
+
return `[#${ref.id}](${prLink})`;
|
|
80
|
+
}
|
|
81
|
+
return `#${ref.id}`;
|
|
82
|
+
}).join(", ");
|
|
83
|
+
}
|
|
84
|
+
function getReasonLabel(reason, locale) {
|
|
85
|
+
const labels = {
|
|
86
|
+
breaking: { en: "major bump from breaking changes", ru: "major \u0438\u0437-\u0437\u0430 breaking changes" },
|
|
87
|
+
feat: { en: "minor: new features", ru: "minor: \u043D\u043E\u0432\u0430\u044F \u0444\u0443\u043D\u043A\u0446\u0438\u043E\u043D\u0430\u043B\u044C\u043D\u043E\u0441\u0442\u044C" },
|
|
88
|
+
fix: { en: "patch: bug fixes", ru: "patch: \u0438\u0441\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F" },
|
|
89
|
+
perf: { en: "patch: performance", ru: "patch: \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C" },
|
|
90
|
+
ripple: { en: "patch: dependency update", ru: "patch: \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E\u0441\u0442\u0435\u0439" },
|
|
91
|
+
manual: { en: "manual", ru: "\u0440\u0443\u0447\u043D\u043E\u0435" }
|
|
92
|
+
};
|
|
93
|
+
return labels[reason]?.[locale] || reason;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export { render, version };
|
|
97
|
+
//# sourceMappingURL=corporate.js.map
|
|
98
|
+
//# sourceMappingURL=corporate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/templates/builtin/corporate.ts"],"names":[],"mappings":";AAaO,IAAM,OAAA,GAAU;AAEhB,SAAS,OAAO,IAAA,EAA4B;AACjD,EAAA,MAAM,EAAE,OAAA,EAAS,GAAA,EAAK,QAAA,EAAU,OAAA,EAAS,QAAO,GAAI,IAAA;AACpD,EAAA,MAAM,QAAkB,EAAC;AAGzB,EAAA,MAAM,IAAA,GAAA,qBAAW,IAAA,EAAK,EAAE,aAAY,CAAE,KAAA,CAAM,GAAG,CAAA,CAAE,CAAC,CAAA;AAClD,EAAA,MAAM,WAAA,GAAc,cAAA,CAAe,GAAA,CAAI,MAAA,EAAQ,MAAM,CAAA;AACrD,EAAA,KAAA,CAAM,KAAK,CAAA,IAAA,EAAO,GAAA,CAAI,IAAI,CAAA,IAAA,EAAO,IAAI,CAAA,CAAE,CAAA;AACvC,EAAA,KAAA,CAAM,KAAK,EAAE,CAAA;AACb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CAAI,EAAE,CAAA,EAAA,EAAK,SAAS,CAAA,CAAA,CAAA;AAAA,IAAK;AACtD,IAAA,MAAM,MAAA,GAAS,MAAA,CAAO,aAAA,EAAe,EAAA,EAAI,IAAA,CAAK,CAAA,CAAA,KAAK,CAAA,CAAE,QAAA,CAAS,CAAA,CAAA,EAAI,GAAA,CAAI,EAAE,CAAA,CAAE,CAAC,CAAA;AAC3E,IAAA,IAAI,MAAA,EAAQ;AAAE,MAAA,OAAO,CAAA,EAAA,EAAK,GAAA,CAAI,EAAE,CAAA,EAAA,EAAK,MAAM,CAAA,CAAA,CAAA;AAAA,IAAK;AAChD,IAAA,OAAO,CAAA,CAAA,EAAI,IAAI,EAAE,CAAA,CAAA;AAAA,EACnB,CAAC,CAAA,CACA,IAAA,CAAK,IAAI,CAAA;AACd;AAEA,SAAS,cAAA,CAAe,QAAgB,MAAA,EAA6B;AACnE,EAAA,MAAM,MAAA,GAAsD;AAAA,IAC1D,QAAA,EAAU,EAAE,EAAA,EAAI,kCAAA,EAAoC,IAAI,kDAAA,EAA+B;AAAA,IACvF,IAAA,EAAM,EAAE,EAAA,EAAI,qBAAA,EAAuB,IAAI,wIAAA,EAAgC;AAAA,IACvE,GAAA,EAAK,EAAE,EAAA,EAAI,kBAAA,EAAoB,IAAI,2EAAA,EAAqB;AAAA,IACxD,IAAA,EAAM,EAAE,EAAA,EAAI,oBAAA,EAAsB,IAAI,qHAAA,EAA4B;AAAA,IAClE,MAAA,EAAQ,EAAE,EAAA,EAAI,0BAAA,EAA4B,IAAI,8IAAA,EAAiC;AAAA,IAC/E,MAAA,EAAQ,EAAE,EAAA,EAAI,QAAA,EAAU,IAAI,sCAAA;AAAS,GACvC;AAEA,EAAA,OAAO,MAAA,CAAO,MAAM,CAAA,GAAI,MAAM,CAAA,IAAK,MAAA;AACrC","file":"corporate.js","sourcesContent":["/**\n * Corporate-style changelog template\n *\n * Professional format suitable for enterprise releases:\n * - Emoji for visual hierarchy\n * - Breaking changes prominently displayed\n * - Grouped by impact (Breaking > Features > Improvements > Fixes)\n * - Scope-based organization\n */\n\nimport type { TemplateData } from '../types';\nimport type { Change } from '../../types';\n\nexport const version = '1.0' as const;\n\nexport function render(data: TemplateData): string {\n const { package: pkg, breaking, changes, locale } = data;\n const lines: string[] = [];\n\n // Header: standard OSS format ## [version] - YYYY-MM-DD\n const date = new Date().toISOString().split('T')[0]!;\n const reasonLabel = getReasonLabel(pkg.reason, locale);\n lines.push(`## [${pkg.next}] - ${date}`);\n lines.push('');\n lines.push(`> **${pkg.name}** ${pkg.prev} → ${pkg.next} (${reasonLabel})`);\n lines.push('');\n\n // Breaking changes (critical section)\n if (breaking.length > 0) {\n const breakingTitle = locale === 'ru' ? '⚠️ КРИТИЧЕСКИЕ ИЗМЕНЕНИЯ' : '⚠️ BREAKING CHANGES';\n lines.push(`### ${breakingTitle}`);\n lines.push('');\n for (const br of breaking) {\n lines.push(`- **${br.summary}**`);\n if (br.notes) {\n lines.push(` ${br.notes}`);\n }\n }\n lines.push('');\n }\n\n // Features\n if (changes.feat && changes.feat.length > 0) {\n const featTitle = locale === 'ru' ? '✨ Новые возможности' : '✨ New Features';\n lines.push(`### ${featTitle}`);\n lines.push('');\n for (const feat of changes.feat) {\n lines.push(formatChangeLine(feat));\n }\n lines.push('');\n }\n\n // Performance improvements\n if (changes.perf && changes.perf.length > 0) {\n const perfTitle = locale === 'ru' ? '⚡ Производительность' : '⚡ Performance Improvements';\n lines.push(`### ${perfTitle}`);\n lines.push('');\n for (const perf of changes.perf) {\n lines.push(formatChangeLine(perf));\n }\n lines.push('');\n }\n\n // Bug fixes\n if (changes.fix && changes.fix.length > 0) {\n const fixTitle = locale === 'ru' ? '🐛 Исправления' : '🐛 Bug Fixes';\n lines.push(`### ${fixTitle}`);\n lines.push('');\n for (const fix of changes.fix) {\n lines.push(formatChangeLine(fix));\n }\n lines.push('');\n }\n\n // Reverts — user-visible (something was undone)\n if (changes.revert && changes.revert.length > 0) {\n const revertTitle = locale === 'ru' ? '⏪ Откаты' : '⏪ Reverts';\n lines.push(`### ${revertTitle}`);\n lines.push('');\n for (const revert of changes.revert) {\n lines.push(formatChangeLine(revert));\n }\n lines.push('');\n }\n\n // chore / build / ci / test / style / refactor intentionally omitted:\n // they are internal changes and not relevant to package consumers.\n\n return lines.join('\\n').trimEnd();\n}\n\n/**\n * Format a single change line with scope and optional issue/PR refs.\n * Output: - **scope**: subject text (#123, #456)\n */\nfunction formatChangeLine(change: Change): string {\n const scope = change.scope ? `**${change.scope}**` : '';\n const text = scope ? `${scope}: ${change.subject}` : change.subject;\n const refs = formatRefs(change);\n return refs ? `- ${text} (${refs})` : `- ${text}`;\n}\n\n/**\n * Render issue/PR refs as comma-separated links or plain numbers.\n * Uses providerLinks when available, otherwise falls back to #N notation.\n */\nfunction formatRefs(change: Change): string {\n if (!change.refs || change.refs.length === 0) { return ''; }\n\n return change.refs\n .map(ref => {\n // Try to find a matching provider link for issues\n const issueLink = change.providerLinks?.issues?.find(l => l.endsWith(`/${ref.id}`));\n if (issueLink) { return `[#${ref.id}](${issueLink})`; }\n const prLink = change.providerLinks?.pr?.find(l => l.endsWith(`/${ref.id}`));\n if (prLink) { return `[#${ref.id}](${prLink})`; }\n return `#${ref.id}`;\n })\n .join(', ');\n}\n\nfunction getReasonLabel(reason: string, locale: 'en' | 'ru'): string {\n const labels: Record<string, Record<'en' | 'ru', string>> = {\n breaking: { en: 'major bump from breaking changes', ru: 'major из-за breaking changes' },\n feat: { en: 'minor: new features', ru: 'minor: новая функциональность' },\n fix: { en: 'patch: bug fixes', ru: 'patch: исправления' },\n perf: { en: 'patch: performance', ru: 'patch: производительность' },\n ripple: { en: 'patch: dependency update', ru: 'patch: обновление зависимостей' },\n manual: { en: 'manual', ru: 'ручное' },\n };\n\n return labels[reason]?.[locale] || reason;\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { T as TemplateData } from '../../types-DdtOg4s3.js';
|
|
2
|
+
import '@kb-labs/sdk';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Technical changelog template
|
|
6
|
+
*
|
|
7
|
+
* Developer-focused format with detailed information:
|
|
8
|
+
* - Commit SHAs and PR links
|
|
9
|
+
* - Author information
|
|
10
|
+
* - File change counts
|
|
11
|
+
* - All commit types (including chore, build, ci)
|
|
12
|
+
* - Conventional commits grouping
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
declare const version: "1.0";
|
|
16
|
+
declare function render(data: TemplateData): string;
|
|
17
|
+
|
|
18
|
+
export { render, version };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// src/templates/builtin/technical.ts
|
|
2
|
+
var version = "1.0";
|
|
3
|
+
function render(data) {
|
|
4
|
+
const { package: pkg, breaking, changes, locale } = data;
|
|
5
|
+
const lines = [];
|
|
6
|
+
const date = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
7
|
+
lines.push(`## [${pkg.next}] - ${date}`);
|
|
8
|
+
lines.push("");
|
|
9
|
+
lines.push(`> **${pkg.name}** \`${pkg.prev}\` \u2192 \`${pkg.next}\` (${pkg.bump})`);
|
|
10
|
+
lines.push("");
|
|
11
|
+
if (breaking.length > 0) {
|
|
12
|
+
const title = locale === "ru" ? "BREAKING CHANGES" : "BREAKING CHANGES";
|
|
13
|
+
lines.push(`### \u26A0\uFE0F ${title}`);
|
|
14
|
+
lines.push("");
|
|
15
|
+
for (const br of breaking) {
|
|
16
|
+
lines.push(`- ${br.summary}`);
|
|
17
|
+
if (br.notes) {
|
|
18
|
+
lines.push("");
|
|
19
|
+
lines.push(" ```");
|
|
20
|
+
lines.push(` ${br.notes}`);
|
|
21
|
+
lines.push(" ```");
|
|
22
|
+
lines.push("");
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
lines.push("");
|
|
26
|
+
}
|
|
27
|
+
const commitTypes = [
|
|
28
|
+
"feat",
|
|
29
|
+
"fix",
|
|
30
|
+
"perf",
|
|
31
|
+
"refactor",
|
|
32
|
+
"docs",
|
|
33
|
+
"test",
|
|
34
|
+
"build",
|
|
35
|
+
"ci",
|
|
36
|
+
"chore",
|
|
37
|
+
"revert",
|
|
38
|
+
"style"
|
|
39
|
+
];
|
|
40
|
+
for (const type of commitTypes) {
|
|
41
|
+
const commits = changes[type];
|
|
42
|
+
if (!commits || commits.length === 0) {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
const sectionTitle = getSectionTitle(type, locale);
|
|
46
|
+
lines.push(`### ${sectionTitle}`);
|
|
47
|
+
lines.push("");
|
|
48
|
+
for (const commit of commits) {
|
|
49
|
+
lines.push(formatTechnicalCommit(commit));
|
|
50
|
+
}
|
|
51
|
+
lines.push("");
|
|
52
|
+
}
|
|
53
|
+
return lines.join("\n").trim();
|
|
54
|
+
}
|
|
55
|
+
function formatTechnicalCommit(commit) {
|
|
56
|
+
const parts = [];
|
|
57
|
+
const scopePrefix = commit.scope ? `**${commit.scope}**` : "";
|
|
58
|
+
parts.push(`- ${scopePrefix}${scopePrefix ? ": " : ""}${commit.subject}`);
|
|
59
|
+
const shortSha = commit.sha.substring(0, 7);
|
|
60
|
+
parts.push(` ([${shortSha}](${commit.providerLinks?.commit || "#"}))`);
|
|
61
|
+
if (commit.author) {
|
|
62
|
+
parts.push(` \u2014 @${commit.author.name}`);
|
|
63
|
+
}
|
|
64
|
+
if (commit.filesChanged && commit.filesChanged.length > 0) {
|
|
65
|
+
parts.push(` (${commit.filesChanged.length} files)`);
|
|
66
|
+
}
|
|
67
|
+
return parts.join("");
|
|
68
|
+
}
|
|
69
|
+
function getSectionTitle(type, locale) {
|
|
70
|
+
const titles = {
|
|
71
|
+
feat: { en: "\u2728 Features", ru: "\u2728 \u041D\u043E\u0432\u044B\u0435 \u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E\u0441\u0442\u0438" },
|
|
72
|
+
fix: { en: "\u{1F41B} Bug Fixes", ru: "\u{1F41B} \u0418\u0441\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F" },
|
|
73
|
+
perf: { en: "\u26A1 Performance", ru: "\u26A1 \u041F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C" },
|
|
74
|
+
refactor: { en: "\u267B\uFE0F Refactoring", ru: "\u267B\uFE0F \u0420\u0435\u0444\u0430\u043A\u0442\u043E\u0440\u0438\u043D\u0433" },
|
|
75
|
+
docs: { en: "\u{1F4DD} Documentation", ru: "\u{1F4DD} \u0414\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\u0446\u0438\u044F" },
|
|
76
|
+
test: { en: "\u2705 Tests", ru: "\u2705 \u0422\u0435\u0441\u0442\u044B" },
|
|
77
|
+
build: { en: "\u{1F528} Build System", ru: "\u{1F528} \u0421\u0431\u043E\u0440\u043A\u0430" },
|
|
78
|
+
ci: { en: "\u{1F477} CI/CD", ru: "\u{1F477} CI/CD" },
|
|
79
|
+
chore: { en: "\u{1F527} Chores", ru: "\u{1F527} \u041E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u043D\u0438\u0435" },
|
|
80
|
+
revert: { en: "\u23EA Reverts", ru: "\u23EA \u041E\u0442\u043A\u0430\u0442\u044B" },
|
|
81
|
+
style: { en: "\u{1F484} Styles", ru: "\u{1F484} \u0421\u0442\u0438\u043B\u0438" }
|
|
82
|
+
};
|
|
83
|
+
return titles[type]?.[locale] || type.toUpperCase();
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export { render, version };
|
|
87
|
+
//# sourceMappingURL=technical.js.map
|
|
88
|
+
//# sourceMappingURL=technical.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/templates/builtin/technical.ts"],"names":[],"mappings":";AAcO,IAAM,OAAA,GAAU;AAEhB,SAAS,OAAO,IAAA,EAA4B;AACjD,EAAA,MAAM,EAAE,OAAA,EAAS,GAAA,EAAK,QAAA,EAAU,OAAA,EAAS,QAAO,GAAI,IAAA;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IAAI,gDAAA,EAAY;AAAA,IAChD,EAAA,EAAI,EAAE,EAAA,EAAI,iBAAA,EAAY,IAAI,iBAAA,EAAW;AAAA,IACrC,KAAA,EAAO,EAAE,EAAA,EAAI,kBAAA,EAAa,IAAI,oFAAA,EAAkB;AAAA,IAChD,MAAA,EAAQ,EAAE,EAAA,EAAI,gBAAA,EAAa,IAAI,6CAAA,EAAW;AAAA,IAC1C,KAAA,EAAO,EAAE,EAAA,EAAI,kBAAA,EAAa,IAAI,0CAAA;AAAW,GAC3C;AAEA,EAAA,OAAO,OAAO,IAAI,CAAA,GAAI,MAAM,CAAA,IAAK,KAAK,WAAA,EAAY;AACpD","file":"technical.js","sourcesContent":["/**\n * Technical changelog template\n *\n * Developer-focused format with detailed information:\n * - Commit SHAs and PR links\n * - Author information\n * - File change counts\n * - All commit types (including chore, build, ci)\n * - Conventional commits grouping\n */\n\nimport type { TemplateData } from '../types';\nimport type { Change } from '../../types';\n\nexport const version = '1.0' as const;\n\nexport function render(data: TemplateData): string {\n const { package: pkg, breaking, changes, locale } = data;\n const lines: string[] = [];\n\n // Header: standard OSS format ## [version] - YYYY-MM-DD\n const date = new Date().toISOString().split('T')[0]!;\n lines.push(`## [${pkg.next}] - ${date}`);\n lines.push('');\n lines.push(`> **${pkg.name}** \\`${pkg.prev}\\` → \\`${pkg.next}\\` (${pkg.bump})`);\n lines.push('');\n\n // Breaking changes with technical details\n if (breaking.length > 0) {\n const title = locale === 'ru' ? 'BREAKING CHANGES' : 'BREAKING CHANGES';\n lines.push(`### ⚠️ ${title}`);\n lines.push('');\n for (const br of breaking) {\n lines.push(`- ${br.summary}`);\n if (br.notes) {\n lines.push('');\n lines.push(' ```');\n lines.push(` ${br.notes}`);\n lines.push(' ```');\n lines.push('');\n }\n }\n lines.push('');\n }\n\n // All commit types (including chore, build, ci)\n const commitTypes: Array<keyof typeof changes> = [\n 'feat',\n 'fix',\n 'perf',\n 'refactor',\n 'docs',\n 'test',\n 'build',\n 'ci',\n 'chore',\n 'revert',\n 'style',\n ];\n\n for (const type of commitTypes) {\n const commits = changes[type];\n if (!commits || commits.length === 0) {continue;}\n\n const sectionTitle = getSectionTitle(type, locale);\n lines.push(`### ${sectionTitle}`);\n lines.push('');\n\n for (const commit of commits) {\n lines.push(formatTechnicalCommit(commit));\n }\n\n lines.push('');\n }\n\n return lines.join('\\n').trim();\n}\n\nfunction formatTechnicalCommit(commit: Change): string {\n const parts: string[] = [];\n\n // Scope and subject\n const scopePrefix = commit.scope ? `**${commit.scope}**` : '';\n parts.push(`- ${scopePrefix}${scopePrefix ? ': ' : ''}${commit.subject}`);\n\n // Commit SHA\n const shortSha = commit.sha.substring(0, 7);\n parts.push(` ([${shortSha}](${commit.providerLinks?.commit || '#'}))`);\n\n // Author\n if (commit.author) {\n parts.push(` — @${commit.author.name}`);\n }\n\n // File changes count\n if (commit.filesChanged && commit.filesChanged.length > 0) {\n parts.push(` (${commit.filesChanged.length} files)`);\n }\n\n return parts.join('');\n}\n\nfunction getSectionTitle(type: string, locale: 'en' | 'ru'): string {\n const titles: Record<string, Record<'en' | 'ru', string>> = {\n feat: { en: '✨ Features', ru: '✨ Новые возможности' },\n fix: { en: '🐛 Bug Fixes', ru: '🐛 Исправления' },\n perf: { en: '⚡ Performance', ru: '⚡ Производительность' },\n refactor: { en: '♻️ Refactoring', ru: '♻️ Рефакторинг' },\n docs: { en: '📝 Documentation', ru: '📝 Документация' },\n test: { en: '✅ Tests', ru: '✅ Тесты' },\n build: { en: '🔨 Build System', ru: '🔨 Сборка' },\n ci: { en: '👷 CI/CD', ru: '👷 CI/CD' },\n chore: { en: '🔧 Chores', ru: '🔧 Обслуживание' },\n revert: { en: '⏪ Reverts', ru: '⏪ Откаты' },\n style: { en: '💄 Styles', ru: '💄 Стили' },\n };\n\n return titles[type]?.[locale] || type.toUpperCase();\n}\n"]}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { ILLM, ILogger, IAnalytics } from '@kb-labs/sdk';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Core types for @kb-labs/release-manager-changelog
|
|
5
|
+
*/
|
|
6
|
+
type VersionBump = 'patch' | 'minor' | 'major' | 'none';
|
|
7
|
+
type CommitType = 'feat' | 'fix' | 'perf' | 'refactor' | 'docs' | 'build' | 'ci' | 'test' | 'chore' | 'revert' | 'style';
|
|
8
|
+
interface Author {
|
|
9
|
+
name: string;
|
|
10
|
+
email: string;
|
|
11
|
+
}
|
|
12
|
+
interface BreakingChange {
|
|
13
|
+
summary: string;
|
|
14
|
+
notes?: string;
|
|
15
|
+
}
|
|
16
|
+
interface Reference {
|
|
17
|
+
type: 'pr' | 'issue' | 'commit';
|
|
18
|
+
id: string;
|
|
19
|
+
url?: string;
|
|
20
|
+
}
|
|
21
|
+
interface Change {
|
|
22
|
+
sha: string;
|
|
23
|
+
type: CommitType;
|
|
24
|
+
scope?: string;
|
|
25
|
+
subject: string;
|
|
26
|
+
body?: string;
|
|
27
|
+
breaking?: BreakingChange[];
|
|
28
|
+
refs: Reference[];
|
|
29
|
+
author: Author;
|
|
30
|
+
coAuthors: Author[];
|
|
31
|
+
packages: string[];
|
|
32
|
+
filesChanged: string[];
|
|
33
|
+
timestamp: string;
|
|
34
|
+
isMerge?: boolean;
|
|
35
|
+
isRevert?: boolean;
|
|
36
|
+
revertOf?: string;
|
|
37
|
+
cherryPickOf?: string;
|
|
38
|
+
providerLinks?: {
|
|
39
|
+
commit?: string;
|
|
40
|
+
pr?: string[];
|
|
41
|
+
issues?: string[];
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
interface PackageRelease {
|
|
45
|
+
name: string;
|
|
46
|
+
prev: string;
|
|
47
|
+
next: string;
|
|
48
|
+
bump: VersionBump;
|
|
49
|
+
reason: 'breaking' | 'feat' | 'fix' | 'perf' | 'ripple' | 'manual';
|
|
50
|
+
rippleFrom?: string[];
|
|
51
|
+
breaking: BreakingChange[];
|
|
52
|
+
changes: Change[];
|
|
53
|
+
}
|
|
54
|
+
interface ReleaseManifest {
|
|
55
|
+
schemaVersion: '1.0';
|
|
56
|
+
range: {
|
|
57
|
+
from: string;
|
|
58
|
+
to: string;
|
|
59
|
+
};
|
|
60
|
+
timestamp: string;
|
|
61
|
+
packages: PackageRelease[];
|
|
62
|
+
workspace: {
|
|
63
|
+
breakingCount: number;
|
|
64
|
+
byType: Record<string, number>;
|
|
65
|
+
};
|
|
66
|
+
integrity?: {
|
|
67
|
+
'CHANGELOG.md'?: string;
|
|
68
|
+
'release.plan.json'?: string;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
interface ChangelogResult {
|
|
72
|
+
manifest: ReleaseManifest;
|
|
73
|
+
markdown: string;
|
|
74
|
+
hasBreaking: boolean;
|
|
75
|
+
}
|
|
76
|
+
interface ParseOptions {
|
|
77
|
+
cwd: string;
|
|
78
|
+
from: string;
|
|
79
|
+
to?: string;
|
|
80
|
+
packagePath?: string;
|
|
81
|
+
ignoreAuthors?: string[];
|
|
82
|
+
includeTypes?: string[];
|
|
83
|
+
excludeTypes?: string[];
|
|
84
|
+
collapseMerges?: boolean;
|
|
85
|
+
collapseReverts?: boolean;
|
|
86
|
+
preferMergeSummary?: boolean;
|
|
87
|
+
}
|
|
88
|
+
interface ChangelogOptions {
|
|
89
|
+
cwd: string;
|
|
90
|
+
from: string;
|
|
91
|
+
to?: string;
|
|
92
|
+
plan?: any;
|
|
93
|
+
format?: 'json' | 'md' | 'both';
|
|
94
|
+
level?: 'compact' | 'standard' | 'detailed';
|
|
95
|
+
breakingOnly?: boolean;
|
|
96
|
+
includeTypes?: string[];
|
|
97
|
+
excludeTypes?: string[];
|
|
98
|
+
workspace?: boolean;
|
|
99
|
+
perPackage?: boolean;
|
|
100
|
+
config?: ChangelogConfig;
|
|
101
|
+
}
|
|
102
|
+
interface ChangelogConfig {
|
|
103
|
+
enabled?: boolean;
|
|
104
|
+
includeTypes?: string[];
|
|
105
|
+
excludeTypes?: string[];
|
|
106
|
+
ignoreAuthors?: string[];
|
|
107
|
+
scopeMap?: Record<string, string>;
|
|
108
|
+
collapseMerges?: boolean;
|
|
109
|
+
collapseReverts?: boolean;
|
|
110
|
+
preferMergeSummary?: boolean;
|
|
111
|
+
bumpStrategy?: 'independent' | 'ripple' | 'lockstep';
|
|
112
|
+
workspace?: boolean;
|
|
113
|
+
perPackage?: boolean;
|
|
114
|
+
format?: 'json' | 'md' | 'both';
|
|
115
|
+
level?: 'compact' | 'standard' | 'detailed';
|
|
116
|
+
template?: string | null;
|
|
117
|
+
metadata?: Record<string, unknown>;
|
|
118
|
+
locale?: 'en' | 'ru';
|
|
119
|
+
cache?: boolean;
|
|
120
|
+
requireAudit?: boolean;
|
|
121
|
+
requireSignedTags?: boolean;
|
|
122
|
+
redactPatterns?: string[];
|
|
123
|
+
maxBodyLength?: number;
|
|
124
|
+
stabilityGuards?: {
|
|
125
|
+
experimental?: {
|
|
126
|
+
allowMajor?: boolean;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
ignoreSubmodules?: boolean;
|
|
130
|
+
}
|
|
131
|
+
interface GitProvider {
|
|
132
|
+
type: 'github' | 'gitlab' | 'generic';
|
|
133
|
+
baseUrl: string | null;
|
|
134
|
+
}
|
|
135
|
+
interface GitRange {
|
|
136
|
+
from: string;
|
|
137
|
+
to: string;
|
|
138
|
+
}
|
|
139
|
+
interface ChangeCache {
|
|
140
|
+
meta: {
|
|
141
|
+
graphHash: string;
|
|
142
|
+
HEAD: string;
|
|
143
|
+
};
|
|
144
|
+
commits: Record<string, Change>;
|
|
145
|
+
lastTags: Record<string, {
|
|
146
|
+
tag: string;
|
|
147
|
+
sha: string;
|
|
148
|
+
}>;
|
|
149
|
+
}
|
|
150
|
+
interface PackageImpact {
|
|
151
|
+
name: string;
|
|
152
|
+
direct: boolean;
|
|
153
|
+
viaDependency?: string;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Template system types for changelog customization
|
|
158
|
+
*/
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Template data structure passed to render function
|
|
162
|
+
*/
|
|
163
|
+
interface TemplateData {
|
|
164
|
+
package: {
|
|
165
|
+
name: string;
|
|
166
|
+
prev: string;
|
|
167
|
+
next: string;
|
|
168
|
+
bump: VersionBump;
|
|
169
|
+
reason: 'breaking' | 'feat' | 'fix' | 'perf' | 'ripple' | 'manual';
|
|
170
|
+
rippleFrom?: string[];
|
|
171
|
+
};
|
|
172
|
+
breaking: BreakingChange[];
|
|
173
|
+
changes: Partial<Record<CommitType, Change[]>>;
|
|
174
|
+
locale: 'en' | 'ru';
|
|
175
|
+
metadata?: Record<string, unknown>;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Minimal platform interface for LLM access, logging, and analytics
|
|
179
|
+
*/
|
|
180
|
+
interface PlatformLike {
|
|
181
|
+
llm?: ILLM;
|
|
182
|
+
logger?: ILogger;
|
|
183
|
+
analytics?: IAnalytics;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Template contract - all templates must implement this interface
|
|
187
|
+
*
|
|
188
|
+
* Templates can be sync (fast) or async (with LLM enhancement)
|
|
189
|
+
*/
|
|
190
|
+
interface ChangelogTemplate {
|
|
191
|
+
/**
|
|
192
|
+
* Template API version (semver major)
|
|
193
|
+
* Current: '1.0'
|
|
194
|
+
*/
|
|
195
|
+
version: '1.0';
|
|
196
|
+
/**
|
|
197
|
+
* Render changelog for a package
|
|
198
|
+
* @param data Template data with package info, changes, etc
|
|
199
|
+
* @param platform Optional platform for LLM access
|
|
200
|
+
* @returns Markdown-formatted changelog string (sync or async)
|
|
201
|
+
*/
|
|
202
|
+
render(data: TemplateData, platform?: PlatformLike): string | Promise<string>;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Helper to group changes by type
|
|
206
|
+
*/
|
|
207
|
+
declare function groupChangesByType(changes: Change[]): Partial<Record<CommitType, Change[]>>;
|
|
208
|
+
/**
|
|
209
|
+
* Convert PackageRelease to TemplateData
|
|
210
|
+
*/
|
|
211
|
+
declare function packageToTemplateData(pkg: PackageRelease, locale?: 'en' | 'ru', metadata?: Record<string, unknown>): TemplateData;
|
|
212
|
+
|
|
213
|
+
export { type Author as A, type BreakingChange as B, type Change as C, type GitRange as G, type ParseOptions as P, type ReleaseManifest as R, type TemplateData as T, type VersionBump as V, type ChangeCache as a, type GitProvider as b, type PackageRelease as c, type ChangelogTemplate as d, type CommitType as e, type Reference as f, type ChangelogResult as g, type ChangelogOptions as h, type ChangelogConfig as i, type PackageImpact as j, type PlatformLike as k, groupChangesByType as l, packageToTemplateData as p };
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kb-labs/release-manager-changelog",
|
|
3
|
+
"version": "0.6.0",
|
|
4
|
+
"description": "KB Labs Release Manager - conventional commits parser and changelog generator",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"README.md",
|
|
17
|
+
"LICENSE"
|
|
18
|
+
],
|
|
19
|
+
"sideEffects": false,
|
|
20
|
+
"author": {
|
|
21
|
+
"name": "Kirill Baranov",
|
|
22
|
+
"url": "https://github.com/kirill-baranov"
|
|
23
|
+
},
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "https://github.com/kirill-baranov/kb-labs-release-manager.git",
|
|
28
|
+
"directory": "packages/release-manager-changelog"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"clean": "rimraf dist",
|
|
32
|
+
"build": "tsup",
|
|
33
|
+
"dev": "tsup --watch",
|
|
34
|
+
"type-check": "tsc --noEmit",
|
|
35
|
+
"lint": "eslint .",
|
|
36
|
+
"lint:fix": "eslint . --fix",
|
|
37
|
+
"test": "vitest run --passWithNoTests -c ../../vitest.config.ts",
|
|
38
|
+
"test:watch": "vitest -c ../../vitest.config.ts"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@kb-labs/sdk": "^1.5.0",
|
|
42
|
+
"conventional-commits-parser": "^4.0.0",
|
|
43
|
+
"semver": "^7.6.3",
|
|
44
|
+
"simple-git": "^3.25.0"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@kb-labs/devkit": "link:../../../../infra/kb-labs-devkit",
|
|
48
|
+
"@types/node": "^24.3.3",
|
|
49
|
+
"@types/semver": "^7.5.8",
|
|
50
|
+
"eslint": "^9",
|
|
51
|
+
"globby": "^11.0.0",
|
|
52
|
+
"rimraf": "^6.0.1",
|
|
53
|
+
"tsup": "^8.5.0",
|
|
54
|
+
"typescript": "^5.6.3",
|
|
55
|
+
"vitest": "^3.2.4"
|
|
56
|
+
},
|
|
57
|
+
"engines": {
|
|
58
|
+
"node": ">=20.0.0",
|
|
59
|
+
"pnpm": ">=9.0.0"
|
|
60
|
+
}
|
|
61
|
+
}
|