@programinglive/commiter 1.2.5 → 1.2.8
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 +31 -0
- package/PRD.md +2 -2
- package/README.md +7 -7
- package/docs/release-notes/RELEASE_NOTES.md +26 -0
- package/index.js +7 -0
- package/netlify.toml +2 -0
- package/package.json +2 -4
- package/scripts/release.cjs +0 -33
- package/scripts/update-web-releases.js +0 -232
- package/scripts/update-web-version.js +0 -37
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,37 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.2.8](https://github.com/programinglive/commiter/compare/v1.2.6...v1.2.8) (2025-12-02)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### ♻️ Refactors
|
|
9
|
+
|
|
10
|
+
* remove website auto updates ([c6f2498](https://github.com/programinglive/commiter/commit/c6f24986dd657d7eae91ac84e821a6dbbb492e37))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### 🧹 Chores
|
|
14
|
+
|
|
15
|
+
* **release:** 1.2.7 🚀 ([cb97edc](https://github.com/programinglive/commiter/commit/cb97edca4bccbccaf2e2b1228e0b0b6eef71dbb6))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### 🏗️ Build System
|
|
19
|
+
|
|
20
|
+
* add netlify.toml for static site deployment ([2f70ec7](https://github.com/programinglive/commiter/commit/2f70ec7be08970d7a51b6fe186ef3fac9a9cef9e))
|
|
21
|
+
|
|
22
|
+
### [1.2.7](https://github.com/programinglive/commiter/compare/v1.2.6...v1.2.7) (2025-12-02)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### ♻️ Refactors
|
|
26
|
+
|
|
27
|
+
* remove website auto updates ([c6f2498](https://github.com/programinglive/commiter/commit/c6f24986dd657d7eae91ac84e821a6dbbb492e37))
|
|
28
|
+
|
|
29
|
+
### [1.2.6](https://github.com/programinglive/commiter/compare/v1.2.5...v1.2.6) (2025-11-30)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### 🐛 Bug Fixes
|
|
33
|
+
|
|
34
|
+
* tests only run during release, not on commit ([15600a0](https://github.com/programinglive/commiter/commit/15600a0a558ea9fd38a77afd2c11f5e954d87c51))
|
|
35
|
+
|
|
5
36
|
### [1.2.5](https://github.com/programinglive/commiter/compare/v1.2.4...v1.2.5) (2025-11-29)
|
|
6
37
|
|
|
7
38
|
|
package/PRD.md
CHANGED
|
@@ -27,8 +27,8 @@ Growing teams often struggle to keep release processes consistent: commit messag
|
|
|
27
27
|
- **Release Helper (`scripts/release.js`)**
|
|
28
28
|
- Detects release type from CLI args or npm context.
|
|
29
29
|
- Runs project tests via detected package manager before releasing.
|
|
30
|
-
- Invokes `standard-version
|
|
31
|
-
-
|
|
30
|
+
- Invokes `standard-version`, passing the preload script via `NODE_OPTIONS`.
|
|
31
|
+
- Stays focused on repository assets only (website updates are intentionally manual to avoid cross-project impacts).
|
|
32
32
|
- **Preload Patching (`scripts/preload/fs-f-ok.cjs`)**
|
|
33
33
|
- Hooks Node’s module loader to transparently replace deprecated `fs.F_OK` usages in `standard-version` without altering `node_modules`.
|
|
34
34
|
- **Website & Documentation**
|
package/README.md
CHANGED
|
@@ -126,12 +126,12 @@ npm run release
|
|
|
126
126
|
|
|
127
127
|
## What Happens During Release?
|
|
128
128
|
|
|
129
|
-
1. 🧪 Detects your package manager and runs the `test` script automatically
|
|
130
|
-
2. 📊 Analyzes commits since last release
|
|
131
|
-
3. 🔢 Bumps version in `package.json`
|
|
132
|
-
4. 📝 Updates `CHANGELOG.md` with icons
|
|
133
|
-
5. 🏷️ Creates a git tag
|
|
134
|
-
6. 💾 Commits changes with format: `chore(release): v1.2.3 🚀`
|
|
129
|
+
1. 🧪 **Runs tests** - Detects your package manager and runs the `test` script automatically (tests only run during release, not on commit)
|
|
130
|
+
2. 📊 **Analyzes commits** - Examines commits since last release
|
|
131
|
+
3. 🔢 **Bumps version** - Updates version in `package.json`
|
|
132
|
+
4. 📝 **Updates changelog** - Generates `CHANGELOG.md` with icons
|
|
133
|
+
5. 🏷️ **Creates tag** - Creates a git tag for the release
|
|
134
|
+
6. 💾 **Commits release** - Commits changes with format: `chore(release): v1.2.3 🚀`
|
|
135
135
|
|
|
136
136
|
## Push Your Release
|
|
137
137
|
|
|
@@ -146,7 +146,7 @@ git push --follow-tags origin main
|
|
|
146
146
|
The following hooks are automatically enforced:
|
|
147
147
|
|
|
148
148
|
- **commit-msg**: Validates commit message format using commitlint
|
|
149
|
-
- **pre-commit**:
|
|
149
|
+
- **pre-commit**: Empty hook (tests are run only during release, not on commit)
|
|
150
150
|
|
|
151
151
|
## Configuration Files
|
|
152
152
|
|
|
@@ -4,6 +4,9 @@ This document summarizes every published version of `@programinglive/commiter`.
|
|
|
4
4
|
|
|
5
5
|
| Version | Date | Highlights |
|
|
6
6
|
|---------|------|------------|
|
|
7
|
+
| 1.2.8 | 2025-12-02 | remove website auto updates (c6f2498) |
|
|
8
|
+
| 1.2.7 | 2025-12-02 | remove website auto updates (c6f2498) |
|
|
9
|
+
| 1.2.6 | 2025-11-30 | tests only run during release, not on commit (15600a0) |
|
|
7
10
|
| 1.2.5 | 2025-11-29 | **release:** v1.2.4 🚀 (23e546a) |
|
|
8
11
|
| 1.2.4 | 2025-11-27 | **release:** 1.2.3 (9d12f7e) |
|
|
9
12
|
| 1.2.3 | 2025-11-27 | automate website releases timeline updates from release notes (5abf788) |
|
|
@@ -52,6 +55,29 @@ This document summarizes every published version of `@programinglive/commiter`.
|
|
|
52
55
|
|
|
53
56
|
|
|
54
57
|
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
## 1.2.8 – ♻️ Refactors
|
|
62
|
+
|
|
63
|
+
Released on **2025-12-02**.
|
|
64
|
+
|
|
65
|
+
- remove website auto updates (c6f2498)
|
|
66
|
+
- **release:** 1.2.7 🚀 (cb97edc)
|
|
67
|
+
- add netlify.toml for static site deployment (2f70ec7)
|
|
68
|
+
|
|
69
|
+
## 1.2.7 – ♻️ Refactors
|
|
70
|
+
|
|
71
|
+
Released on **2025-12-02**.
|
|
72
|
+
|
|
73
|
+
- remove website auto updates (c6f2498)
|
|
74
|
+
|
|
75
|
+
## 1.2.6 – 🐛 Bug Fixes
|
|
76
|
+
|
|
77
|
+
Released on **2025-11-30**.
|
|
78
|
+
|
|
79
|
+
- tests only run during release, not on commit (15600a0)
|
|
80
|
+
|
|
55
81
|
## 1.2.5 – 🧹 Chores
|
|
56
82
|
|
|
57
83
|
Released on **2025-11-29**.
|
package/index.js
CHANGED
|
@@ -153,6 +153,13 @@ npx --no -- commitlint --edit "$1"
|
|
|
153
153
|
fs.writeFileSync(path.join(huskyDir, 'commit-msg'), commitMsgHook);
|
|
154
154
|
fs.chmodSync(path.join(huskyDir, 'commit-msg'), 0o755);
|
|
155
155
|
|
|
156
|
+
// Create pre-commit hook (tests run only during release)
|
|
157
|
+
const preCommitHook = `#!/usr/bin/env sh
|
|
158
|
+
# Pre-commit hook - tests are run only during release
|
|
159
|
+
`;
|
|
160
|
+
fs.writeFileSync(path.join(huskyDir, 'pre-commit'), preCommitHook);
|
|
161
|
+
fs.chmodSync(path.join(huskyDir, 'pre-commit'), 0o755);
|
|
162
|
+
|
|
156
163
|
// Update .gitignore
|
|
157
164
|
const gitignorePath = path.join(process.cwd(), '.gitignore');
|
|
158
165
|
let gitignoreContent = '';
|
package/netlify.toml
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@programinglive/commiter",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.8",
|
|
4
4
|
"description": "Commiter keeps repositories release-ready by enforcing conventional commits, generating icon-rich changelog entries, and orchestrating semantic version bumps without manual toil. It bootstraps Husky hooks, commitlint rules, and release scripts that inspect history, detect framework-specific test commands, run them automatically, tag git releases, coordinate npm publishing, surface release metrics, enforce project-specific checks, and give maintainers observability across distributed teams. Plus!",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -13,9 +13,7 @@
|
|
|
13
13
|
"release:major": "node scripts/release.cjs major",
|
|
14
14
|
"release:minor": "node scripts/release.cjs minor",
|
|
15
15
|
"release:patch": "node scripts/release.cjs patch",
|
|
16
|
-
"web": "npx serve web"
|
|
17
|
-
"update:web": "node scripts/update-web-version.js",
|
|
18
|
-
"update:web:releases": "node scripts/update-web-releases.js"
|
|
16
|
+
"web": "npx serve web"
|
|
19
17
|
},
|
|
20
18
|
"keywords": [
|
|
21
19
|
"commit",
|
package/scripts/release.cjs
CHANGED
|
@@ -188,39 +188,6 @@ function runRelease({
|
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
-
let websiteVersionUpdated = false;
|
|
192
|
-
let websiteTimelineUpdated = false;
|
|
193
|
-
|
|
194
|
-
// Update website version
|
|
195
|
-
try {
|
|
196
|
-
console.log('🌐 Updating website version...');
|
|
197
|
-
const updateWebResult = spawnSync(process.execPath, ['scripts/update-web-version.js'], { stdio: 'inherit', cwd });
|
|
198
|
-
if (updateWebResult.status === 0) {
|
|
199
|
-
websiteVersionUpdated = true;
|
|
200
|
-
} else {
|
|
201
|
-
console.warn('⚠️ Failed to update website version');
|
|
202
|
-
}
|
|
203
|
-
} catch (error) {
|
|
204
|
-
console.warn(`⚠️ Skipping website version update: ${error.message}`);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
// Update website releases timeline
|
|
208
|
-
try {
|
|
209
|
-
console.log('🌐 Updating website releases timeline...');
|
|
210
|
-
const updateTimelineResult = spawnSync(process.execPath, ['scripts/update-web-releases.js'], { stdio: 'inherit', cwd });
|
|
211
|
-
if (updateTimelineResult.status === 0) {
|
|
212
|
-
websiteTimelineUpdated = true;
|
|
213
|
-
} else {
|
|
214
|
-
console.warn('⚠️ Failed to update website releases timeline');
|
|
215
|
-
}
|
|
216
|
-
} catch (error) {
|
|
217
|
-
console.warn(`⚠️ Skipping website releases timeline update: ${error.message}`);
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
if (websiteVersionUpdated || websiteTimelineUpdated) {
|
|
221
|
-
spawnSync('git', ['add', 'web/index.html'], { stdio: 'inherit', cwd });
|
|
222
|
-
}
|
|
223
|
-
|
|
224
191
|
return releaseResult;
|
|
225
192
|
}
|
|
226
193
|
if (require.main === module) {
|
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
|
|
4
|
-
const DEFAULT_MAX_RELEASES = 5;
|
|
5
|
-
const RELEASE_NOTES_PATH = path.join(__dirname, '..', 'docs', 'release-notes', 'RELEASE_NOTES.md');
|
|
6
|
-
const INDEX_PATH = path.join(__dirname, '..', 'web', 'index.html');
|
|
7
|
-
const MARKER_START = '<!-- RELEASES_TIMELINE:START -->';
|
|
8
|
-
const MARKER_END = '<!-- RELEASES_TIMELINE:END -->';
|
|
9
|
-
|
|
10
|
-
function readFileOrThrow(filePath, label) {
|
|
11
|
-
if (!fs.existsSync(filePath)) {
|
|
12
|
-
throw new Error(`${label} not found at ${filePath}`);
|
|
13
|
-
}
|
|
14
|
-
return fs.readFileSync(filePath, 'utf8');
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function sanitizeText(text = '') {
|
|
18
|
-
return text
|
|
19
|
-
.replace(/\*\*/g, '')
|
|
20
|
-
.replace(/`/g, '')
|
|
21
|
-
.replace(/\[([^\]]+)\]\([^\)]+\)/g, '$1')
|
|
22
|
-
.replace(/\s+/g, ' ')
|
|
23
|
-
.trim();
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function escapeHtml(text = '') {
|
|
27
|
-
return text
|
|
28
|
-
.replace(/&/g, '&')
|
|
29
|
-
.replace(/</g, '<')
|
|
30
|
-
.replace(/>/g, '>')
|
|
31
|
-
.replace(/"/g, '"')
|
|
32
|
-
.replace(/'/g, ''');
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function formatDate(dateString) {
|
|
36
|
-
if (!dateString) {
|
|
37
|
-
return 'Date pending';
|
|
38
|
-
}
|
|
39
|
-
const date = new Date(dateString);
|
|
40
|
-
if (Number.isNaN(date.valueOf())) {
|
|
41
|
-
return dateString;
|
|
42
|
-
}
|
|
43
|
-
return date.toLocaleDateString('en-US', {
|
|
44
|
-
year: 'numeric',
|
|
45
|
-
month: 'long',
|
|
46
|
-
day: 'numeric'
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function extractReleaseSections(content) {
|
|
51
|
-
const normalizedContent = content.replace(/\r\n/g, '\n');
|
|
52
|
-
const tableEntries = extractReleaseTableEntries(normalizedContent);
|
|
53
|
-
const detailMap = extractReleaseDetailsMap(normalizedContent);
|
|
54
|
-
|
|
55
|
-
if (tableEntries.length === 0) {
|
|
56
|
-
return extractSectionEntries(normalizedContent);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return tableEntries.map((entry) => {
|
|
60
|
-
const details = detailMap.get(entry.version) || {};
|
|
61
|
-
return {
|
|
62
|
-
version: entry.version,
|
|
63
|
-
releaseType: details.releaseType || '',
|
|
64
|
-
date: entry.date,
|
|
65
|
-
description: details.description || entry.highlight || 'See CHANGELOG for details.'
|
|
66
|
-
};
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function extractReleaseTableEntries(content) {
|
|
71
|
-
const lines = content.split('\n');
|
|
72
|
-
const headerIndex = lines.findIndex((line) => /^\|\s*Version\s*\|/i.test(line));
|
|
73
|
-
if (headerIndex === -1) {
|
|
74
|
-
return [];
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const entries = [];
|
|
78
|
-
for (let i = headerIndex + 2; i < lines.length; i++) {
|
|
79
|
-
const line = lines[i];
|
|
80
|
-
if (!line.trim().startsWith('|')) {
|
|
81
|
-
break;
|
|
82
|
-
}
|
|
83
|
-
const cells = line.split('|').slice(1, -1).map((cell) => sanitizeText(cell));
|
|
84
|
-
if (cells.length < 3) {
|
|
85
|
-
continue;
|
|
86
|
-
}
|
|
87
|
-
const [version, date, highlight] = cells;
|
|
88
|
-
if (!version) {
|
|
89
|
-
continue;
|
|
90
|
-
}
|
|
91
|
-
entries.push({ version, date, highlight });
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return entries;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
function extractReleaseDetailsMap(content) {
|
|
98
|
-
const map = new Map();
|
|
99
|
-
const sectionRegex = /^##\s+(.+?)\s*$([\s\S]*?)(?=^##\s+|$)/gm;
|
|
100
|
-
let match;
|
|
101
|
-
|
|
102
|
-
while ((match = sectionRegex.exec(content)) !== null) {
|
|
103
|
-
const heading = match[1].trim();
|
|
104
|
-
const body = match[2].trim().replace(/\r/g, '');
|
|
105
|
-
const headingMatch = heading.match(/^(\d+\.\d+\.\d+)(?:\s+[–-]\s+(.+))?/);
|
|
106
|
-
if (!headingMatch) {
|
|
107
|
-
continue;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
const version = headingMatch[1];
|
|
111
|
-
const releaseType = headingMatch[2] ? headingMatch[2].trim() : '';
|
|
112
|
-
const descriptionMatch = body.match(/^\s*\-\s+(.+)$/m);
|
|
113
|
-
const description = descriptionMatch ? sanitizeText(descriptionMatch[1]) : undefined;
|
|
114
|
-
|
|
115
|
-
map.set(version, {
|
|
116
|
-
releaseType,
|
|
117
|
-
description
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
return map;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
function extractSectionEntries(content) {
|
|
125
|
-
const sections = [];
|
|
126
|
-
const sectionRegex = /^##\s+(.+?)\s*$([\s\S]*?)(?=^##\s+|$)/gm;
|
|
127
|
-
let match;
|
|
128
|
-
|
|
129
|
-
while ((match = sectionRegex.exec(content)) !== null) {
|
|
130
|
-
const heading = match[1].trim();
|
|
131
|
-
const body = match[2].trim().replace(/\r/g, '');
|
|
132
|
-
const headingMatch = heading.match(/^(\d+\.\d+\.\d+)(?:\s+[–-]\s+(.+))?/);
|
|
133
|
-
if (!headingMatch) {
|
|
134
|
-
continue;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
const version = headingMatch[1];
|
|
138
|
-
const releaseType = headingMatch[2] ? headingMatch[2].trim() : '';
|
|
139
|
-
const dateMatch = body.match(/Released on \*\*(\d{4}-\d{2}-\d{2})\*\*\.?/);
|
|
140
|
-
const descriptionMatch = body.match(/^\s*\-\s+(.+)$/m);
|
|
141
|
-
|
|
142
|
-
sections.push({
|
|
143
|
-
version,
|
|
144
|
-
releaseType,
|
|
145
|
-
date: dateMatch ? dateMatch[1] : undefined,
|
|
146
|
-
description: descriptionMatch ? sanitizeText(descriptionMatch[1]) : 'See CHANGELOG for details.'
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
return sections;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
function renderReleaseItem(release, { latest = false, indent = '' } = {}) {
|
|
154
|
-
const badge = latest ? `\n${indent} <div class="release-badge">Latest</div>` : '';
|
|
155
|
-
const typeLine = release.releaseType
|
|
156
|
-
? `\n${indent} <div class="release-type">${escapeHtml(release.releaseType)}</div>`
|
|
157
|
-
: '';
|
|
158
|
-
|
|
159
|
-
return `${indent}<div class="release-item">${badge}
|
|
160
|
-
${indent} <div class="release-version">v${escapeHtml(release.version)}</div>
|
|
161
|
-
${indent} <div class="release-date">${escapeHtml(formatDate(release.date))}</div>${typeLine}
|
|
162
|
-
${indent} <p class="release-description">${escapeHtml(release.description)}</p>
|
|
163
|
-
${indent}</div>`;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
function updateIndexHtml({
|
|
167
|
-
htmlContent,
|
|
168
|
-
releases,
|
|
169
|
-
markerStart = MARKER_START,
|
|
170
|
-
markerEnd = MARKER_END,
|
|
171
|
-
indent = ' '
|
|
172
|
-
}) {
|
|
173
|
-
const startIndex = htmlContent.indexOf(markerStart);
|
|
174
|
-
const endIndex = htmlContent.indexOf(markerEnd);
|
|
175
|
-
|
|
176
|
-
if (startIndex === -1 || endIndex === -1 || endIndex <= startIndex) {
|
|
177
|
-
throw new Error('Release timeline markers not found in web/index.html');
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
const before = htmlContent.slice(0, startIndex + markerStart.length);
|
|
181
|
-
const after = htmlContent.slice(endIndex);
|
|
182
|
-
const timeline = releases
|
|
183
|
-
.map((release, idx) => renderReleaseItem(release, { latest: idx === 0, indent }))
|
|
184
|
-
.join('\n');
|
|
185
|
-
|
|
186
|
-
return `${before}\n${timeline}\n${indent}${after.trimStart()}`;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
function updateWebReleases({
|
|
190
|
-
releaseNotesPath = RELEASE_NOTES_PATH,
|
|
191
|
-
indexPath = INDEX_PATH,
|
|
192
|
-
maxReleases = DEFAULT_MAX_RELEASES
|
|
193
|
-
} = {}) {
|
|
194
|
-
const notesContent = readFileOrThrow(releaseNotesPath, 'Release notes');
|
|
195
|
-
const releases = extractReleaseSections(notesContent).slice(0, maxReleases);
|
|
196
|
-
|
|
197
|
-
if (releases.length === 0) {
|
|
198
|
-
console.warn('⚠️ No release sections found; skipping website update.');
|
|
199
|
-
return false;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
const htmlContent = readFileOrThrow(indexPath, 'Landing page');
|
|
203
|
-
const nextContent = updateIndexHtml({ htmlContent, releases });
|
|
204
|
-
fs.writeFileSync(indexPath, nextContent);
|
|
205
|
-
console.log(`✅ Updated website releases timeline with ${releases.length} entries.`);
|
|
206
|
-
return true;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
function main() {
|
|
210
|
-
try {
|
|
211
|
-
updateWebReleases();
|
|
212
|
-
} catch (error) {
|
|
213
|
-
console.error(`❌ Failed to update website releases timeline: ${error.message}`);
|
|
214
|
-
process.exit(1);
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
module.exports = {
|
|
219
|
-
escapeHtml,
|
|
220
|
-
sanitizeText,
|
|
221
|
-
formatDate,
|
|
222
|
-
extractReleaseSections,
|
|
223
|
-
renderReleaseItem,
|
|
224
|
-
updateIndexHtml,
|
|
225
|
-
updateWebReleases,
|
|
226
|
-
MARKER_START,
|
|
227
|
-
MARKER_END
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
if (require.main === module) {
|
|
231
|
-
main();
|
|
232
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
const { execSync } = require('child_process');
|
|
4
|
-
|
|
5
|
-
// Get current version from latest git tag
|
|
6
|
-
let version;
|
|
7
|
-
try {
|
|
8
|
-
// Get the latest tag
|
|
9
|
-
const tag = execSync('git describe --tags --abbrev=0', { encoding: 'utf8' }).trim();
|
|
10
|
-
// Remove 'v' prefix if present
|
|
11
|
-
version = tag.startsWith('v') ? tag.substring(1) : tag;
|
|
12
|
-
} catch (error) {
|
|
13
|
-
// Fallback to package.json if no tags exist
|
|
14
|
-
console.warn('⚠️ No git tags found, falling back to package.json version');
|
|
15
|
-
const packageJson = require('../package.json');
|
|
16
|
-
version = packageJson.version;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const indexPath = path.join(__dirname, '../web/index.html');
|
|
20
|
-
let content = fs.readFileSync(indexPath, 'utf8');
|
|
21
|
-
|
|
22
|
-
// Update version in the badge
|
|
23
|
-
// Matches: <span>v1.1.9 - Latest Release</span>
|
|
24
|
-
content = content.replace(
|
|
25
|
-
/<span>v\d+\.\d+\.\d+ - Latest Release<\/span>/,
|
|
26
|
-
`<span>v${version} - Latest Release</span>`
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
// Update version in the stats
|
|
30
|
-
// Matches: <div class="stat-value">1.1.9</div>
|
|
31
|
-
content = content.replace(
|
|
32
|
-
/<div class="stat-value">\d+\.\d+\.\d+<\/div>(\s*<div class="stat-label">Latest Version<\/div>)/,
|
|
33
|
-
`<div class="stat-value">${version}</div>$1`
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
fs.writeFileSync(indexPath, content);
|
|
37
|
-
console.log(`✅ Updated website to version ${version} (from git tag)`);
|