corifeus-builder 2026.4.138 → 2026.4.140

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/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
  ---
8
- # 🏗️ Corifeus Builder v2026.4.138
8
+ # 🏗️ Corifeus Builder v2026.4.140
9
9
 
10
10
 
11
11
 
@@ -155,7 +155,7 @@ All my domains, including [patrikx3.com](https://patrikx3.com), [corifeus.eu](ht
155
155
  ---
156
156
 
157
157
 
158
- [**CORIFEUS-BUILDER**](https://corifeus.com/corifeus-builder) Build v2026.4.138
158
+ [**CORIFEUS-BUILDER**](https://corifeus.com/corifeus-builder) Build v2026.4.140
159
159
 
160
160
  [![NPM](https://img.shields.io/npm/v/corifeus-builder.svg)](https://www.npmjs.com/package/corifeus-builder) [![Donate for PatrikX3 / P3X](https://img.shields.io/badge/Donate-PatrikX3-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software)
161
161
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "corifeus-builder",
3
- "version": "2026.4.138",
3
+ "version": "2026.4.140",
4
4
  "corifeus": {
5
5
  "icon": "fas fa-gavel",
6
6
  "code": "Make",
@@ -38,9 +38,9 @@
38
38
  "extract-zip": "^2.0.1",
39
39
  "fs-extra": "^11.3.4",
40
40
  "github-api": "^3.4.0",
41
- "glob": "^8.0.3",
41
+ "glob": "^13.0.6",
42
42
  "glob-promise": "^6.0.7",
43
- "grunt": "^1.6.1",
43
+ "grunt": "^1.6.2",
44
44
  "grunt-contrib-clean": "^2.0.1",
45
45
  "grunt-contrib-copy": "^1.0.0",
46
46
  "grunt-contrib-htmlmin": "^3.1.0",
@@ -51,7 +51,7 @@
51
51
  "mocha": "^11.7.5",
52
52
  "mz": "^2.7.0",
53
53
  "npm": "^11.12.1",
54
- "npm-check-updates": "^20.0.0",
54
+ "npm-check-updates": "^21.0.2",
55
55
  "should": "^13.2.3",
56
56
  "time-grunt": "^2.0.0",
57
57
  "yaml": "^2.8.3"
@@ -66,10 +66,6 @@ const getCommitForVersion = (repoDir, version) => {
66
66
 
67
67
  /**
68
68
  * Collect git logs from multiple repos.
69
- *
70
- * @param {Object} options
71
- * @param {string} options.cwd - project root
72
- * @param {Array<{dir: string, npmName?: string}>} [options.repos] - workspace repos (defaults to single repo)
73
69
  */
74
70
  const collectLogs = async (options) => {
75
71
  const { cwd, repos } = options
@@ -129,6 +125,92 @@ const collectLogs = async (options) => {
129
125
  return logs
130
126
  }
131
127
 
128
+ /**
129
+ * Archive previous year entries from change-log.md into change-log.YYYY.md
130
+ * Only runs when the current year differs from the year of existing entries.
131
+ */
132
+ const archivePreviousYear = async (changelogPath, cwd) => {
133
+ const currentYear = new Date().getFullYear()
134
+
135
+ let changelog
136
+ try {
137
+ changelog = await fs.readFile(changelogPath, 'utf-8')
138
+ } catch (e) {
139
+ return
140
+ }
141
+
142
+ // Find all version entries with their years (format: ### vYYYY.M.P)
143
+ const entryRegex = /### v(\d{4})\.\d+\.\d+/g
144
+ const years = new Set()
145
+ let match
146
+ while ((match = entryRegex.exec(changelog)) !== null) {
147
+ years.add(parseInt(match[1]))
148
+ }
149
+
150
+ // Find years that are not the current year and need archiving
151
+ for (const year of years) {
152
+ if (year >= currentYear) continue
153
+
154
+ const archivePath = path.resolve(cwd, `change-log.${year}.md`)
155
+ try {
156
+ await fs.access(archivePath)
157
+ // Archive already exists, skip
158
+ continue
159
+ } catch (e) {}
160
+
161
+ // Extract entries for this year
162
+ const yearEntries = []
163
+ const allEntriesRegex = /### v(\d{4}\.\d+\.\d+)\n([\s\S]*?)(?=\n### v|\n\[\/\/\]|$)/g
164
+ let entryMatch
165
+ while ((entryMatch = allEntriesRegex.exec(changelog)) !== null) {
166
+ const entryYear = parseInt(entryMatch[1].split('.')[0])
167
+ if (entryYear === year) {
168
+ yearEntries.push(`### v${entryMatch[1]}\n${entryMatch[2].trimEnd()}`)
169
+ }
170
+ }
171
+
172
+ if (yearEntries.length === 0) continue
173
+
174
+ // Write archive file
175
+ const archiveContent = yearEntries.join('\n\n') + '\n'
176
+ await fs.writeFile(archivePath, archiveContent)
177
+ console.log(`Archived ${yearEntries.length} entries from ${year} to change-log.${year}.md`)
178
+
179
+ // Remove archived entries from main changelog
180
+ for (const entry of yearEntries) {
181
+ const escapedHeader = entry.split('\n')[0].replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
182
+ const removeRegex = new RegExp(`\\n?${escapedHeader}\\n[\\s\\S]*?(?=\\n### v|\\n\\[\/\/\\]|$)`)
183
+ changelog = changelog.replace(removeRegex, '')
184
+ }
185
+
186
+ await fs.writeFile(changelogPath, changelog)
187
+
188
+ // Git add the archive
189
+ try {
190
+ execSync(`git add change-log.${year}.md`, { cwd, stdio: 'inherit' })
191
+ } catch (e) {}
192
+ }
193
+ }
194
+
195
+ /**
196
+ * Auto-create change-log.md if it doesn't exist.
197
+ */
198
+ const ensureChangelog = async (changelogPath, projectName) => {
199
+ try {
200
+ await fs.access(changelogPath)
201
+ } catch (e) {
202
+ const content = `[//]: #@corifeus-header
203
+
204
+ # ${projectName}
205
+
206
+
207
+ [//]: #@corifeus-header:end
208
+ `
209
+ await fs.writeFile(changelogPath, content)
210
+ console.log(`Created change-log.md for ${projectName}`)
211
+ }
212
+ }
213
+
132
214
  /**
133
215
  * Generate changelog entry using Claude AI and update change-log.md
134
216
  *
@@ -136,14 +218,21 @@ const collectLogs = async (options) => {
136
218
  * @param {string} options.cwd - project root
137
219
  * @param {string} options.projectName - e.g. "P3X Network MCP" or "P3X Redis UI"
138
220
  * @param {Array<{dir: string, npmName?: string}>} [options.repos] - workspace repos
221
+ * @param {boolean} [options.skipCommit] - skip git commit (useful when called from grunt)
139
222
  */
140
223
  const generateChangelog = async (options) => {
141
- const { cwd, projectName, repos } = options
224
+ const { cwd, projectName, repos, skipCommit } = options
142
225
  const pkg = JSON.parse(await fs.readFile(path.resolve(cwd, 'package.json'), 'utf-8'))
143
226
  const version = pkg.version
144
227
  const today = new Date().toLocaleDateString('en-US', { month: '2-digit', day: '2-digit', year: 'numeric' })
145
228
  const changelogPath = path.resolve(cwd, 'change-log.md')
146
229
 
230
+ // Auto-create change-log.md if missing
231
+ await ensureChangelog(changelogPath, projectName || pkg.description || pkg.name)
232
+
233
+ // Archive previous year entries
234
+ await archivePreviousYear(changelogPath, cwd)
235
+
147
236
  const logs = await collectLogs({ cwd, repos })
148
237
  const allLogs = logs.join('\n\n')
149
238
  if (!allLogs) {
@@ -231,10 +320,12 @@ ${repoNote}
231
320
  console.error('Could not find header end marker in change-log.md')
232
321
  }
233
322
 
234
- execSync(`git add change-log.md && git commit -m "chore: update changelog for v${version}"`, {
235
- cwd,
236
- stdio: 'inherit',
237
- })
323
+ if (!skipCommit) {
324
+ execSync(`git add change-log.md change-log.*.md 2>/dev/null; git commit -m "chore: update changelog for v${version}" || true`, {
325
+ cwd,
326
+ stdio: 'inherit',
327
+ })
328
+ }
238
329
 
239
330
  return changelogEntry
240
331
  }
@@ -260,4 +351,6 @@ module.exports = {
260
351
  getChangelogEntry,
261
352
  collectLogs,
262
353
  getCommitsSinceLastBump,
354
+ archivePreviousYear,
355
+ ensureChangelog,
263
356
  }
@@ -1,4 +1,5 @@
1
1
  const fs = require('fs').promises;
2
+ const path = require('path');
2
3
  const git = require('../../git');
3
4
 
4
5
  module.exports = async (pkgFile) => {
@@ -86,8 +87,8 @@ module.exports = async (pkgFile) => {
86
87
  await fs.writeFile(pkgFile, newPkgFile)
87
88
 
88
89
  // Auto-ensure .npmignore protects sensitive directories
89
- const cwd = require('path').dirname(pkgFile)
90
- const npmignorePath = require('path').join(cwd, '.npmignore')
90
+ const cwd = path.dirname(pkgFile)
91
+ const npmignorePath = path.join(cwd, '.npmignore')
91
92
  const protectedDirs = ['secure/', 'agents/', '.claude/', '.vscode/', '.codex/']
92
93
  const existingDirs = []
93
94
  for (const dir of protectedDirs) {
package/.ncurc.json DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "reject": [
3
- "glob"
4
- ]
5
- }