@aneuhold/core-ts-lib 2.2.8 → 2.2.10
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/lib/index.d.ts +5 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -2
- package/lib/index.js.map +1 -1
- package/lib/index.ts +5 -2
- package/lib/services/ChangelogService/ChangelogFileService.d.ts +42 -0
- package/lib/services/ChangelogService/ChangelogFileService.d.ts.map +1 -0
- package/lib/services/ChangelogService/ChangelogFileService.js +65 -0
- package/lib/services/ChangelogService/ChangelogFileService.js.map +1 -0
- package/lib/services/ChangelogService/ChangelogFileService.ts +68 -0
- package/lib/services/ChangelogService/ChangelogGenerator.d.ts +58 -0
- package/lib/services/ChangelogService/ChangelogGenerator.d.ts.map +1 -0
- package/lib/services/ChangelogService/ChangelogGenerator.js +145 -0
- package/lib/services/ChangelogService/ChangelogGenerator.js.map +1 -0
- package/lib/services/ChangelogService/ChangelogGenerator.ts +188 -0
- package/lib/services/ChangelogService/ChangelogParser.d.ts +21 -0
- package/lib/services/ChangelogService/ChangelogParser.d.ts.map +1 -0
- package/lib/services/ChangelogService/ChangelogParser.js +59 -0
- package/lib/services/ChangelogService/ChangelogParser.js.map +1 -0
- package/lib/services/ChangelogService/ChangelogParser.ts +71 -0
- package/lib/services/ChangelogService/ChangelogService.d.ts +54 -0
- package/lib/services/ChangelogService/ChangelogService.d.ts.map +1 -0
- package/lib/services/ChangelogService/ChangelogService.js +201 -0
- package/lib/services/ChangelogService/ChangelogService.js.map +1 -0
- package/lib/services/ChangelogService/ChangelogService.ts +293 -0
- package/lib/services/ChangelogService/ChangelogValidator.d.ts +15 -0
- package/lib/services/ChangelogService/ChangelogValidator.d.ts.map +1 -0
- package/lib/services/ChangelogService/ChangelogValidator.js +44 -0
- package/lib/services/ChangelogService/ChangelogValidator.js.map +1 -0
- package/lib/services/ChangelogService/ChangelogValidator.ts +55 -0
- package/lib/services/ChangelogService/GitTagService.d.ts +29 -0
- package/lib/services/ChangelogService/GitTagService.d.ts.map +1 -0
- package/lib/services/ChangelogService/GitTagService.js +57 -0
- package/lib/services/ChangelogService/GitTagService.js.map +1 -0
- package/lib/services/ChangelogService/GitTagService.ts +60 -0
- package/lib/services/ChangelogService/RepositoryInfoService.d.ts +14 -0
- package/lib/services/ChangelogService/RepositoryInfoService.d.ts.map +1 -0
- package/lib/services/ChangelogService/RepositoryInfoService.js +55 -0
- package/lib/services/ChangelogService/RepositoryInfoService.js.map +1 -0
- package/lib/services/ChangelogService/RepositoryInfoService.ts +64 -0
- package/lib/services/ChangelogService/index.d.ts +2 -0
- package/lib/services/ChangelogService/index.d.ts.map +1 -0
- package/lib/services/ChangelogService/index.js +2 -0
- package/lib/services/ChangelogService/index.js.map +1 -0
- package/lib/services/ChangelogService/index.ts +1 -0
- package/lib/services/ChangelogService/types.d.ts +27 -0
- package/lib/services/ChangelogService/types.d.ts.map +1 -0
- package/lib/services/ChangelogService/types.js +3 -0
- package/lib/services/ChangelogService/types.js.map +1 -0
- package/lib/services/ChangelogService/types.ts +30 -0
- package/lib/services/DependencyService.d.ts +2 -9
- package/lib/services/DependencyService.d.ts.map +1 -1
- package/lib/services/DependencyService.js +2 -11
- package/lib/services/DependencyService.js.map +1 -1
- package/lib/services/DependencyService.ts +2 -11
- package/lib/services/PackageService/JsrPackageService.d.ts +81 -0
- package/lib/services/PackageService/JsrPackageService.d.ts.map +1 -0
- package/lib/services/{PackageService.js → PackageService/JsrPackageService.js} +70 -312
- package/lib/services/PackageService/JsrPackageService.js.map +1 -0
- package/lib/services/{PackageService.ts → PackageService/JsrPackageService.ts} +79 -372
- package/lib/services/PackageService/NpmPackageService.d.ts +45 -0
- package/lib/services/PackageService/NpmPackageService.d.ts.map +1 -0
- package/lib/services/PackageService/NpmPackageService.js +146 -0
- package/lib/services/PackageService/NpmPackageService.js.map +1 -0
- package/lib/services/PackageService/NpmPackageService.ts +178 -0
- package/lib/services/PackageService/PackageService.d.ts +77 -0
- package/lib/services/PackageService/PackageService.d.ts.map +1 -0
- package/lib/services/PackageService/PackageService.js +96 -0
- package/lib/services/PackageService/PackageService.js.map +1 -0
- package/lib/services/PackageService/PackageService.ts +108 -0
- package/lib/services/PackageService/PackageServiceUtils.d.ts +69 -0
- package/lib/services/PackageService/PackageServiceUtils.d.ts.map +1 -0
- package/lib/services/PackageService/PackageServiceUtils.js +185 -0
- package/lib/services/PackageService/PackageServiceUtils.js.map +1 -0
- package/lib/services/PackageService/PackageServiceUtils.ts +239 -0
- package/lib/services/StringService.d.ts +12 -0
- package/lib/services/StringService.d.ts.map +1 -1
- package/lib/services/StringService.js +56 -0
- package/lib/services/StringService.js.map +1 -1
- package/lib/services/StringService.ts +72 -0
- package/lib/types/VersionType.d.ts +9 -0
- package/lib/types/VersionType.d.ts.map +1 -0
- package/lib/types/VersionType.js +10 -0
- package/lib/types/VersionType.js.map +1 -0
- package/lib/types/VersionType.ts +8 -0
- package/package.json +8 -6
- package/lib/services/PackageService.d.ts +0 -159
- package/lib/services/PackageService.d.ts.map +0 -1
- package/lib/services/PackageService.js.map +0 -1
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import ChangelogParser from './ChangelogParser.js';
|
|
2
|
+
import GitTagService from './GitTagService.js';
|
|
3
|
+
import type { ChangelogVersionEntry, RepositoryInfo } from './types.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Service for generating changelog content and version links.
|
|
7
|
+
*/
|
|
8
|
+
export default class ChangelogGenerator {
|
|
9
|
+
/**
|
|
10
|
+
* Creates the content for a version entry.
|
|
11
|
+
*
|
|
12
|
+
* @param version The version number
|
|
13
|
+
* @param date The date in YYYY-MM-DD format
|
|
14
|
+
* @returns The version entry content
|
|
15
|
+
*/
|
|
16
|
+
static createVersionEntryContent(version: string, date: string): string {
|
|
17
|
+
return `## 🔖 [${version}] (${date})
|
|
18
|
+
|
|
19
|
+
### ✅ Added
|
|
20
|
+
|
|
21
|
+
### 🏗️ Changed
|
|
22
|
+
|
|
23
|
+
### 🩹 Fixed
|
|
24
|
+
|
|
25
|
+
### 🔥 Removed`;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Creates the initial changelog content with header and first version entry.
|
|
30
|
+
*
|
|
31
|
+
* @param version The initial version
|
|
32
|
+
* @param packageName The package name for generating version links
|
|
33
|
+
* @param repositoryInfo Optional repository information for version links
|
|
34
|
+
* @returns The complete changelog content
|
|
35
|
+
*/
|
|
36
|
+
static createInitialChangelogContent(
|
|
37
|
+
version: string,
|
|
38
|
+
packageName: string,
|
|
39
|
+
repositoryInfo?: RepositoryInfo | null
|
|
40
|
+
): string {
|
|
41
|
+
const currentDate = new Date().toISOString().split('T')[0]; // YYYY-MM-DD format
|
|
42
|
+
|
|
43
|
+
let content = `# Changelog
|
|
44
|
+
|
|
45
|
+
All notable changes to this project will be documented in this file.
|
|
46
|
+
|
|
47
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
48
|
+
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
49
|
+
|
|
50
|
+
${this.createVersionEntryContent(version, currentDate)}
|
|
51
|
+
`;
|
|
52
|
+
|
|
53
|
+
// Add version links if repository info is available
|
|
54
|
+
if (repositoryInfo) {
|
|
55
|
+
content = this.addVersionLinksToChangelog(content, repositoryInfo, packageName);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return content;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Generates a GitHub compare URL for version links in monorepo changelog
|
|
63
|
+
*
|
|
64
|
+
* @param repositoryInfo Repository information
|
|
65
|
+
* @param packageName Name of the package (used for tag prefix)
|
|
66
|
+
* @param currentVersion Current version
|
|
67
|
+
* @param previousVersion Previous version (optional)
|
|
68
|
+
* @returns The version link URL
|
|
69
|
+
*/
|
|
70
|
+
static generateVersionLink(
|
|
71
|
+
repositoryInfo: RepositoryInfo,
|
|
72
|
+
packageName: string,
|
|
73
|
+
currentVersion: string,
|
|
74
|
+
previousVersion?: string
|
|
75
|
+
): string {
|
|
76
|
+
const currentTag = GitTagService.getTagName(packageName, currentVersion);
|
|
77
|
+
|
|
78
|
+
if (!previousVersion) {
|
|
79
|
+
// For first version, link to the tag itself
|
|
80
|
+
return `${repositoryInfo.url}/releases/tag/${currentTag}`;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const previousTag = GitTagService.getTagName(packageName, previousVersion);
|
|
84
|
+
return `${repositoryInfo.url}/compare/${previousTag}...${currentTag}`;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Updates changelog content to include version links at the bottom
|
|
89
|
+
*
|
|
90
|
+
* @param content Original changelog content
|
|
91
|
+
* @param repositoryInfo Repository information
|
|
92
|
+
* @param packageName Package name for generating tags
|
|
93
|
+
* @returns Updated changelog content with version links
|
|
94
|
+
*/
|
|
95
|
+
static addVersionLinksToChangelog(
|
|
96
|
+
content: string,
|
|
97
|
+
repositoryInfo: RepositoryInfo,
|
|
98
|
+
packageName: string
|
|
99
|
+
): string {
|
|
100
|
+
const versionEntries = ChangelogParser.parseChangelog(content);
|
|
101
|
+
|
|
102
|
+
if (versionEntries.length === 0) {
|
|
103
|
+
return content;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Generate link references
|
|
107
|
+
const linkReferences: string[] = [];
|
|
108
|
+
|
|
109
|
+
for (let i = 0; i < versionEntries.length; i++) {
|
|
110
|
+
const currentEntry = versionEntries[i];
|
|
111
|
+
const previousEntry = i + 1 < versionEntries.length ? versionEntries[i + 1] : undefined;
|
|
112
|
+
|
|
113
|
+
const versionLink = this.generateVersionLink(
|
|
114
|
+
repositoryInfo,
|
|
115
|
+
packageName,
|
|
116
|
+
currentEntry.version,
|
|
117
|
+
previousEntry?.version
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
linkReferences.push(`[${currentEntry.version}]: ${versionLink}`);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Check if content already has link references section
|
|
124
|
+
const linkSectionMatch = content.match(/\n\n<!-- Link References -->\n([\s\S]*?)$/);
|
|
125
|
+
|
|
126
|
+
if (linkSectionMatch) {
|
|
127
|
+
// Replace existing link references
|
|
128
|
+
const newLinkSection = `\n\n<!-- Link References -->\n${linkReferences.join('\n')}\n`;
|
|
129
|
+
return content.replace(linkSectionMatch[0], newLinkSection);
|
|
130
|
+
} else {
|
|
131
|
+
// Add new link references section
|
|
132
|
+
const newLinkSection = `\n\n<!-- Link References -->\n${linkReferences.join('\n')}\n`;
|
|
133
|
+
return content + newLinkSection;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Regenerates changelog content from a list of version entries.
|
|
139
|
+
*
|
|
140
|
+
* @param versionEntries The version entries to include
|
|
141
|
+
* @param packageName The package name for generating version links
|
|
142
|
+
* @param repositoryInfo Optional repository information for version links
|
|
143
|
+
* @returns The regenerated changelog content
|
|
144
|
+
*/
|
|
145
|
+
static regenerateChangelogContent(
|
|
146
|
+
versionEntries: ChangelogVersionEntry[],
|
|
147
|
+
packageName: string,
|
|
148
|
+
repositoryInfo?: RepositoryInfo | null
|
|
149
|
+
): string {
|
|
150
|
+
// Start with the header
|
|
151
|
+
let content = `# Changelog
|
|
152
|
+
|
|
153
|
+
All notable changes to this project will be documented in this file.
|
|
154
|
+
|
|
155
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
156
|
+
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
157
|
+
|
|
158
|
+
`;
|
|
159
|
+
|
|
160
|
+
// Add each version entry
|
|
161
|
+
for (const entry of versionEntries) {
|
|
162
|
+
content += `## 🔖 [${entry.version}] (${entry.date})\n\n`;
|
|
163
|
+
|
|
164
|
+
for (const section of entry.sections) {
|
|
165
|
+
content += `### ${section.type}\n\n`;
|
|
166
|
+
if (section.content.trim()) {
|
|
167
|
+
content += `${section.content}\n\n`;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// Add version links if repository info is available
|
|
173
|
+
if (repositoryInfo) {
|
|
174
|
+
content = this.addVersionLinksToChangelog(content, repositoryInfo, packageName);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return content;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Gets current date in YYYY-MM-DD format.
|
|
182
|
+
*
|
|
183
|
+
* @returns Current date string
|
|
184
|
+
*/
|
|
185
|
+
static getCurrentDate(): string {
|
|
186
|
+
return new Date().toISOString().split('T')[0];
|
|
187
|
+
}
|
|
188
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ChangelogVersionEntry } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Service for parsing changelog content and extracting structured data.
|
|
4
|
+
*/
|
|
5
|
+
export default class ChangelogParser {
|
|
6
|
+
/**
|
|
7
|
+
* Parses a changelog file content and extracts version entries.
|
|
8
|
+
*
|
|
9
|
+
* @param content The changelog file content
|
|
10
|
+
* @returns Array of parsed version entries
|
|
11
|
+
*/
|
|
12
|
+
static parseChangelog(content: string): ChangelogVersionEntry[];
|
|
13
|
+
/**
|
|
14
|
+
* Parses the sections within a version entry.
|
|
15
|
+
*
|
|
16
|
+
* @param content The content of a version entry
|
|
17
|
+
* @returns Array of parsed sections
|
|
18
|
+
*/
|
|
19
|
+
private static parseVersionSections;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=ChangelogParser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChangelogParser.d.ts","sourceRoot":"","sources":["../../../src/services/ChangelogService/ChangelogParser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA0C,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAGhG;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,eAAe;IAClC;;;;;OAKG;IACH,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,qBAAqB,EAAE;IA8B/D;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,oBAAoB;CAqBpC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { REQUIRED_SECTION_TYPES } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Service for parsing changelog content and extracting structured data.
|
|
4
|
+
*/
|
|
5
|
+
export default class ChangelogParser {
|
|
6
|
+
/**
|
|
7
|
+
* Parses a changelog file content and extracts version entries.
|
|
8
|
+
*
|
|
9
|
+
* @param content The changelog file content
|
|
10
|
+
* @returns Array of parsed version entries
|
|
11
|
+
*/
|
|
12
|
+
static parseChangelog(content) {
|
|
13
|
+
const versionEntries = [];
|
|
14
|
+
// Split by ## to get version sections
|
|
15
|
+
const sections = content.split(/^## /m).filter((section) => section.trim());
|
|
16
|
+
for (const section of sections) {
|
|
17
|
+
const lines = section.split('\n');
|
|
18
|
+
const headerLine = lines[0];
|
|
19
|
+
// Extract version from header like "🔖 [1.0.0] (2025-06-19)" or "[1.0.0] (2025-06-19)"
|
|
20
|
+
const versionMatch = headerLine.match(/(?:🔖\s*)?\[([^\]]+)\]\s*\(([^)]+)\)/);
|
|
21
|
+
if (!versionMatch)
|
|
22
|
+
continue;
|
|
23
|
+
const [, version, date] = versionMatch;
|
|
24
|
+
const sectionContent = lines.slice(1).join('\n');
|
|
25
|
+
// Parse sections within the version entry
|
|
26
|
+
const parsedSections = this.parseVersionSections(sectionContent);
|
|
27
|
+
versionEntries.push({
|
|
28
|
+
version,
|
|
29
|
+
date,
|
|
30
|
+
sections: parsedSections
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return versionEntries;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Parses the sections within a version entry.
|
|
37
|
+
*
|
|
38
|
+
* @param content The content of a version entry
|
|
39
|
+
* @returns Array of parsed sections
|
|
40
|
+
*/
|
|
41
|
+
static parseVersionSections(content) {
|
|
42
|
+
const sections = [];
|
|
43
|
+
// Split by ### to get individual sections
|
|
44
|
+
const sectionParts = content.split(/^### /m).filter((part) => part.trim());
|
|
45
|
+
for (const part of sectionParts) {
|
|
46
|
+
const lines = part.split('\n');
|
|
47
|
+
const sectionType = lines[0].trim();
|
|
48
|
+
if (REQUIRED_SECTION_TYPES.includes(sectionType)) {
|
|
49
|
+
const sectionContent = lines.slice(1).join('\n').trim();
|
|
50
|
+
sections.push({
|
|
51
|
+
type: sectionType,
|
|
52
|
+
content: sectionContent
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return sections;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=ChangelogParser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChangelogParser.js","sourceRoot":"","sources":["../../../src/services/ChangelogService/ChangelogParser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEpD;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,eAAe;IAClC;;;;;OAKG;IACH,MAAM,CAAC,cAAc,CAAC,OAAe;QACnC,MAAM,cAAc,GAA4B,EAAE,CAAC;QAEnD,sCAAsC;QACtC,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QAE5E,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC/B,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAClC,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;YAE5B,uFAAuF;YACvF,MAAM,YAAY,GAAG,UAAU,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;YAC9E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 +1,71 @@
|
|
|
1
|
+
import type { ChangelogSection, ChangelogSectionType, ChangelogVersionEntry } from './types.js';
|
|
2
|
+
import { REQUIRED_SECTION_TYPES } from './types.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Service for parsing changelog content and extracting structured data.
|
|
6
|
+
*/
|
|
7
|
+
export default class ChangelogParser {
|
|
8
|
+
/**
|
|
9
|
+
* Parses a changelog file content and extracts version entries.
|
|
10
|
+
*
|
|
11
|
+
* @param content The changelog file content
|
|
12
|
+
* @returns Array of parsed version entries
|
|
13
|
+
*/
|
|
14
|
+
static parseChangelog(content: string): ChangelogVersionEntry[] {
|
|
15
|
+
const versionEntries: ChangelogVersionEntry[] = [];
|
|
16
|
+
|
|
17
|
+
// Split by ## to get version sections
|
|
18
|
+
const sections = content.split(/^## /m).filter((section) => section.trim());
|
|
19
|
+
|
|
20
|
+
for (const section of sections) {
|
|
21
|
+
const lines = section.split('\n');
|
|
22
|
+
const headerLine = lines[0];
|
|
23
|
+
|
|
24
|
+
// Extract version from header like "🔖 [1.0.0] (2025-06-19)" or "[1.0.0] (2025-06-19)"
|
|
25
|
+
const versionMatch = headerLine.match(/(?:🔖\s*)?\[([^\]]+)\]\s*\(([^)]+)\)/);
|
|
26
|
+
if (!versionMatch) continue;
|
|
27
|
+
|
|
28
|
+
const [, version, date] = versionMatch;
|
|
29
|
+
const sectionContent = lines.slice(1).join('\n');
|
|
30
|
+
|
|
31
|
+
// Parse sections within the version entry
|
|
32
|
+
const parsedSections = this.parseVersionSections(sectionContent);
|
|
33
|
+
|
|
34
|
+
versionEntries.push({
|
|
35
|
+
version,
|
|
36
|
+
date,
|
|
37
|
+
sections: parsedSections
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return versionEntries;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Parses the sections within a version entry.
|
|
46
|
+
*
|
|
47
|
+
* @param content The content of a version entry
|
|
48
|
+
* @returns Array of parsed sections
|
|
49
|
+
*/
|
|
50
|
+
private static parseVersionSections(content: string): ChangelogSection[] {
|
|
51
|
+
const sections: ChangelogSection[] = [];
|
|
52
|
+
|
|
53
|
+
// Split by ### to get individual sections
|
|
54
|
+
const sectionParts = content.split(/^### /m).filter((part) => part.trim());
|
|
55
|
+
|
|
56
|
+
for (const part of sectionParts) {
|
|
57
|
+
const lines = part.split('\n');
|
|
58
|
+
const sectionType = lines[0].trim() as ChangelogSectionType;
|
|
59
|
+
|
|
60
|
+
if (REQUIRED_SECTION_TYPES.includes(sectionType)) {
|
|
61
|
+
const sectionContent = lines.slice(1).join('\n').trim();
|
|
62
|
+
sections.push({
|
|
63
|
+
type: sectionType,
|
|
64
|
+
content: sectionContent
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return sections;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A service for managing and validating changelog files in packages.
|
|
3
|
+
*
|
|
4
|
+
* This service handles the creation, validation, and maintenance of CHANGELOG.md
|
|
5
|
+
* files following the Keep a Changelog format.
|
|
6
|
+
*/
|
|
7
|
+
export default class ChangelogService {
|
|
8
|
+
/**
|
|
9
|
+
* Validates that a changelog exists and contains a valid entry for the specified version.
|
|
10
|
+
*
|
|
11
|
+
* @param version The version to validate in the changelog
|
|
12
|
+
* @param packagePath Optional path to the package directory (defaults to current working directory)
|
|
13
|
+
* @throws Error if validation fails
|
|
14
|
+
*/
|
|
15
|
+
static validateChangelogForVersion(version: string, packagePath?: string): Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* Initializes a changelog file for the current package if one doesn't exist.
|
|
18
|
+
* If a changelog already exists, validates it against existing Git tags and
|
|
19
|
+
* updates the most recent entry if needed to match the current version.
|
|
20
|
+
*
|
|
21
|
+
* @param version The current version for the changelog
|
|
22
|
+
* @param packageName The name of the package
|
|
23
|
+
* @param packagePath Optional path to the package directory (defaults to current working directory)
|
|
24
|
+
*/
|
|
25
|
+
static initializeChangelog(version: string, packageName: string, packagePath?: string): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Validates an existing changelog against Git tags and updates if necessary.
|
|
28
|
+
*
|
|
29
|
+
* @param currentVersion The current version
|
|
30
|
+
* @param packageName The package name
|
|
31
|
+
* @param existingContent The current changelog content
|
|
32
|
+
* @param workingDir The working directory
|
|
33
|
+
*/
|
|
34
|
+
private static validateAndUpdateExistingChangelog;
|
|
35
|
+
/**
|
|
36
|
+
* Updates the most recent version entry in the changelog.
|
|
37
|
+
*
|
|
38
|
+
* @param newVersion The new version to update to
|
|
39
|
+
* @param existingContent The current changelog content
|
|
40
|
+
* @param packageName The package name
|
|
41
|
+
* @param workingDir The working directory
|
|
42
|
+
*/
|
|
43
|
+
private static updateMostRecentVersionEntry;
|
|
44
|
+
/**
|
|
45
|
+
* Adds a new version entry to an existing changelog.
|
|
46
|
+
*
|
|
47
|
+
* @param version The version to add
|
|
48
|
+
* @param existingContent The current changelog content
|
|
49
|
+
* @param packageName The package name for generating version links
|
|
50
|
+
* @param packagePath The package directory path
|
|
51
|
+
*/
|
|
52
|
+
private static addVersionEntry;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=ChangelogService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChangelogService.d.ts","sourceRoot":"","sources":["../../../src/services/ChangelogService/ChangelogService.ts"],"names":[],"mappings":"AAUA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAgB;IACnC;;;;;;OAMG;WACU,2BAA2B,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAoC9F;;;;;;;;OAQG;WACU,mBAAmB,CAC9B,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC;IA+BhB;;;;;;;OAOG;mBACkB,kCAAkC;IA0FvD;;;;;;;OAOG;mBACkB,4BAA4B;IAgCjD;;;;;;;OAOG;mBACkB,eAAe;CA0CrC"}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import ErrorUtils from '../../utils/ErrorUtils.js';
|
|
2
|
+
import { DR } from '../DependencyRegistry.js';
|
|
3
|
+
import ChangelogFileService from './ChangelogFileService.js';
|
|
4
|
+
import ChangelogGenerator from './ChangelogGenerator.js';
|
|
5
|
+
import ChangelogParser from './ChangelogParser.js';
|
|
6
|
+
import ChangelogValidator from './ChangelogValidator.js';
|
|
7
|
+
import GitTagService from './GitTagService.js';
|
|
8
|
+
import RepositoryInfoService from './RepositoryInfoService.js';
|
|
9
|
+
import { CHANGELOG_FILENAME } from './types.js';
|
|
10
|
+
/**
|
|
11
|
+
* A service for managing and validating changelog files in packages.
|
|
12
|
+
*
|
|
13
|
+
* This service handles the creation, validation, and maintenance of CHANGELOG.md
|
|
14
|
+
* files following the Keep a Changelog format.
|
|
15
|
+
*/
|
|
16
|
+
export default class ChangelogService {
|
|
17
|
+
/**
|
|
18
|
+
* Validates that a changelog exists and contains a valid entry for the specified version.
|
|
19
|
+
*
|
|
20
|
+
* @param version The version to validate in the changelog
|
|
21
|
+
* @param packagePath Optional path to the package directory (defaults to current working directory)
|
|
22
|
+
* @throws Error if validation fails
|
|
23
|
+
*/
|
|
24
|
+
static async validateChangelogForVersion(version, packagePath) {
|
|
25
|
+
const workingDir = packagePath || process.cwd();
|
|
26
|
+
DR.logger.info(`Validating changelog for version ${version}...`);
|
|
27
|
+
const changelogExists = await ChangelogFileService.changelogExists(packagePath);
|
|
28
|
+
if (!changelogExists) {
|
|
29
|
+
throw new Error(`No ${CHANGELOG_FILENAME} file found in ${workingDir}. ` +
|
|
30
|
+
`Run changelog initialization to create one.`);
|
|
31
|
+
}
|
|
32
|
+
try {
|
|
33
|
+
const changelogContent = await ChangelogFileService.readChangelog(packagePath);
|
|
34
|
+
const versionEntries = ChangelogParser.parseChangelog(changelogContent);
|
|
35
|
+
const versionEntry = versionEntries.find((entry) => entry.version === version);
|
|
36
|
+
if (!versionEntry) {
|
|
37
|
+
throw new Error(`No changelog entry found for version ${version}. ` +
|
|
38
|
+
`Please add an entry to ${CHANGELOG_FILENAME} before publishing.`);
|
|
39
|
+
}
|
|
40
|
+
ChangelogValidator.validateVersionEntry(versionEntry, version);
|
|
41
|
+
DR.logger.success(`Changelog validation passed for version ${version}`);
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
const errorString = ErrorUtils.getErrorString(error);
|
|
45
|
+
DR.logger.error(`Changelog validation failed: ${errorString}`);
|
|
46
|
+
throw error;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Initializes a changelog file for the current package if one doesn't exist.
|
|
51
|
+
* If a changelog already exists, validates it against existing Git tags and
|
|
52
|
+
* updates the most recent entry if needed to match the current version.
|
|
53
|
+
*
|
|
54
|
+
* @param version The current version for the changelog
|
|
55
|
+
* @param packageName The name of the package
|
|
56
|
+
* @param packagePath Optional path to the package directory (defaults to current working directory)
|
|
57
|
+
*/
|
|
58
|
+
static async initializeChangelog(version, packageName, packagePath) {
|
|
59
|
+
const workingDir = packagePath || process.cwd();
|
|
60
|
+
DR.logger.info(`Initializing changelog for ${packageName} version ${version}...`);
|
|
61
|
+
const changelogExists = await ChangelogFileService.changelogExists(packagePath);
|
|
62
|
+
if (changelogExists) {
|
|
63
|
+
// If it exists, validate against Git tags and update if necessary
|
|
64
|
+
const existingContent = await ChangelogFileService.readChangelog(packagePath);
|
|
65
|
+
await this.validateAndUpdateExistingChangelog(version, packageName, existingContent, workingDir);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
// Changelog doesn't exist, create a new one
|
|
69
|
+
DR.logger.info(`Creating new changelog file`);
|
|
70
|
+
const repositoryInfo = await RepositoryInfoService.getRepositoryInfo(workingDir);
|
|
71
|
+
const initialContent = ChangelogGenerator.createInitialChangelogContent(version, packageName, repositoryInfo);
|
|
72
|
+
await ChangelogFileService.createChangelog(initialContent, packagePath);
|
|
73
|
+
}
|
|
74
|
+
DR.logger.success(`Changelog initialization completed for ${packageName}`);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Validates an existing changelog against Git tags and updates if necessary.
|
|
78
|
+
*
|
|
79
|
+
* @param currentVersion The current version
|
|
80
|
+
* @param packageName The package name
|
|
81
|
+
* @param existingContent The current changelog content
|
|
82
|
+
* @param workingDir The working directory
|
|
83
|
+
*/
|
|
84
|
+
static async validateAndUpdateExistingChangelog(currentVersion, packageName, existingContent, workingDir) {
|
|
85
|
+
const versionEntries = ChangelogParser.parseChangelog(existingContent);
|
|
86
|
+
if (versionEntries.length === 0) {
|
|
87
|
+
// No version entries exist, add the current version
|
|
88
|
+
DR.logger.info(`Changelog exists but has no version entries - adding entry for ${currentVersion}`);
|
|
89
|
+
await this.addVersionEntry(currentVersion, existingContent, packageName, workingDir);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
// Get existing Git tags for this package
|
|
93
|
+
const existingTags = GitTagService.getPackageTags(packageName, workingDir);
|
|
94
|
+
// Check which entries have corresponding tags and remove ones that don't (except most recent)
|
|
95
|
+
const mostRecentEntry = versionEntries[0];
|
|
96
|
+
const olderEntries = versionEntries.slice(1);
|
|
97
|
+
const validOlderEntries = [];
|
|
98
|
+
const removedVersions = [];
|
|
99
|
+
for (const entry of olderEntries) {
|
|
100
|
+
const expectedTag = GitTagService.getTagName(packageName, entry.version);
|
|
101
|
+
if (existingTags.includes(expectedTag)) {
|
|
102
|
+
validOlderEntries.push(entry);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
removedVersions.push(entry.version);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
// If we removed any older entries, we need to regenerate the changelog
|
|
109
|
+
if (removedVersions.length > 0) {
|
|
110
|
+
DR.logger.info(`Removing changelog entries without corresponding Git tags: ${removedVersions.join(', ')}`);
|
|
111
|
+
const validEntries = [mostRecentEntry, ...validOlderEntries];
|
|
112
|
+
const repositoryInfo = await RepositoryInfoService.getRepositoryInfo(workingDir);
|
|
113
|
+
const updatedContent = ChangelogGenerator.regenerateChangelogContent(validEntries, packageName, repositoryInfo);
|
|
114
|
+
await ChangelogFileService.writeChangelog(updatedContent, workingDir);
|
|
115
|
+
}
|
|
116
|
+
// Now handle the most recent entry
|
|
117
|
+
const mostRecentTag = GitTagService.getTagName(packageName, mostRecentEntry.version);
|
|
118
|
+
const hasTagForMostRecent = existingTags.includes(mostRecentTag);
|
|
119
|
+
if (hasTagForMostRecent) {
|
|
120
|
+
// Most recent entry has a tag, so we need to add a new entry for current version
|
|
121
|
+
if (mostRecentEntry.version === currentVersion) {
|
|
122
|
+
DR.logger.info(`Changelog already contains entry for version ${currentVersion} with corresponding tag - no changes made`);
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
DR.logger.info(`Most recent changelog entry has a tag - adding new entry for version ${currentVersion}`);
|
|
126
|
+
await this.addVersionEntry(currentVersion, existingContent, packageName, workingDir);
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
// Most recent entry doesn't have a tag
|
|
130
|
+
if (mostRecentEntry.version === currentVersion) {
|
|
131
|
+
DR.logger.info(`Changelog already contains entry for version ${currentVersion} without tag - no changes made`);
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
// Update the most recent entry to match current version
|
|
135
|
+
DR.logger.info(`Updating most recent changelog entry from ${mostRecentEntry.version} to ${currentVersion}`);
|
|
136
|
+
await this.updateMostRecentVersionEntry(currentVersion, existingContent, packageName, workingDir);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Updates the most recent version entry in the changelog.
|
|
141
|
+
*
|
|
142
|
+
* @param newVersion The new version to update to
|
|
143
|
+
* @param existingContent The current changelog content
|
|
144
|
+
* @param packageName The package name
|
|
145
|
+
* @param workingDir The working directory
|
|
146
|
+
*/
|
|
147
|
+
static async updateMostRecentVersionEntry(newVersion, existingContent, packageName, workingDir) {
|
|
148
|
+
const versionEntries = ChangelogParser.parseChangelog(existingContent);
|
|
149
|
+
if (versionEntries.length === 0) {
|
|
150
|
+
throw new Error('No version entries found to update');
|
|
151
|
+
}
|
|
152
|
+
const mostRecentEntry = versionEntries[0];
|
|
153
|
+
const oldVersionPattern = `## 🔖 [${mostRecentEntry.version}]`;
|
|
154
|
+
const newVersionPattern = `## 🔖 [${newVersion}]`;
|
|
155
|
+
// Replace the version in the changelog content
|
|
156
|
+
let updatedContent = existingContent.replace(oldVersionPattern, newVersionPattern);
|
|
157
|
+
// Update version links if they exist
|
|
158
|
+
const repositoryInfo = await RepositoryInfoService.getRepositoryInfo(workingDir);
|
|
159
|
+
if (repositoryInfo) {
|
|
160
|
+
updatedContent = ChangelogGenerator.addVersionLinksToChangelog(updatedContent, repositoryInfo, packageName);
|
|
161
|
+
}
|
|
162
|
+
await ChangelogFileService.writeChangelog(updatedContent, workingDir);
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Adds a new version entry to an existing changelog.
|
|
166
|
+
*
|
|
167
|
+
* @param version The version to add
|
|
168
|
+
* @param existingContent The current changelog content
|
|
169
|
+
* @param packageName The package name for generating version links
|
|
170
|
+
* @param packagePath The package directory path
|
|
171
|
+
*/
|
|
172
|
+
static async addVersionEntry(version, existingContent, packageName, packagePath) {
|
|
173
|
+
const currentDate = ChangelogGenerator.getCurrentDate();
|
|
174
|
+
const versionEntry = ChangelogGenerator.createVersionEntryContent(version, currentDate);
|
|
175
|
+
// Find the position after the header to insert the new version
|
|
176
|
+
const lines = existingContent.split('\n');
|
|
177
|
+
const headerEndIndex = lines.findIndex((line) => line.startsWith('## ') && line.includes('['));
|
|
178
|
+
let newContent;
|
|
179
|
+
if (headerEndIndex === -1) {
|
|
180
|
+
// No existing version entries, add after the header
|
|
181
|
+
const headerLines = lines.slice(0, lines.findIndex((line) => line.trim() === '') + 1);
|
|
182
|
+
newContent = [...headerLines, '', versionEntry, '', ...lines.slice(headerLines.length)].join('\n');
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
// Insert before the first existing version
|
|
186
|
+
newContent = [
|
|
187
|
+
...lines.slice(0, headerEndIndex),
|
|
188
|
+
versionEntry,
|
|
189
|
+
'',
|
|
190
|
+
...lines.slice(headerEndIndex)
|
|
191
|
+
].join('\n');
|
|
192
|
+
}
|
|
193
|
+
// Add version links if repository info is available
|
|
194
|
+
const repositoryInfo = await RepositoryInfoService.getRepositoryInfo(packagePath);
|
|
195
|
+
if (repositoryInfo) {
|
|
196
|
+
newContent = ChangelogGenerator.addVersionLinksToChangelog(newContent, repositoryInfo, packageName);
|
|
197
|
+
}
|
|
198
|
+
await ChangelogFileService.writeChangelog(newContent, packagePath);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
//# sourceMappingURL=ChangelogService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChangelogService.js","sourceRoot":"","sources":["../../../src/services/ChangelogService/ChangelogService.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,oBAAoB,MAAM,2BAA2B,CAAC;AAC7D,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AACzD,OAAO,eAAe,MAAM,sBAAsB,CAAC;AACnD,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AACzD,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,qBAAqB,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAA8B,MAAM,YAAY,CAAC;AAE5E;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAgB;IACnC;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,CAAC,2BAA2B,CAAC,O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