@aion0/forge 0.9.5 → 0.9.7
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/RELEASE_NOTES.md +7 -3
- package/bin/forge-server.mjs +44 -22
- package/components/SkillsPanel.tsx +0 -1
- package/package.json +1 -1
package/RELEASE_NOTES.md
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
# Forge v0.9.
|
|
1
|
+
# Forge v0.9.7
|
|
2
2
|
|
|
3
3
|
Released: 2026-05-26
|
|
4
4
|
|
|
5
|
-
## Changes since v0.9.
|
|
5
|
+
## Changes since v0.9.6
|
|
6
6
|
|
|
7
|
+
### Other
|
|
8
|
+
- fix(server): rebuild stale .next on every restart after upgrade
|
|
9
|
+
- marketplace: drop 'Recipes' option from Templates filter
|
|
7
10
|
|
|
8
|
-
|
|
11
|
+
|
|
12
|
+
**Full Changelog**: https://github.com/aiwatching/forge/compare/v0.9.6...v0.9.7
|
package/bin/forge-server.mjs
CHANGED
|
@@ -33,11 +33,43 @@ function buildNext() {
|
|
|
33
33
|
// Check if devDependencies are installed (e.g. @tailwindcss/postcss)
|
|
34
34
|
if (!existsSync(join(ROOT, 'node_modules', '@tailwindcss', 'postcss'))) {
|
|
35
35
|
console.log('[forge] Installing dependencies...');
|
|
36
|
-
|
|
36
|
+
// --legacy-peer-deps: next-auth@5-beta + its nested @auth/core declare
|
|
37
|
+
// contradictory peerOptional nodemailer requirements (v7 vs v6) — both
|
|
38
|
+
// optional, but npm 10+ treats this as a hard ERESOLVE error. Same
|
|
39
|
+
// policy as the repo's .npmrc, baked in here so it works even in the
|
|
40
|
+
// installed npm-package copy (.npmrc isn't published).
|
|
41
|
+
execSync('npm install --include=dev --legacy-peer-deps', { cwd: ROOT, stdio: 'inherit' });
|
|
37
42
|
}
|
|
38
43
|
execSync('npx next build', { cwd: ROOT, stdio: 'inherit', env: { ...process.env } });
|
|
39
44
|
}
|
|
40
45
|
|
|
46
|
+
/**
|
|
47
|
+
* Build if missing OR if the installed npm package version is newer than
|
|
48
|
+
* what produced the cached .next/. Without this version check, `forge server
|
|
49
|
+
* restart` (and any code path that doesn't go through the explicit rebuild
|
|
50
|
+
* block) would happily serve a stale .next built against the previous
|
|
51
|
+
* version — HTML referencing chunk hashes that no longer exist, → CSS/JS
|
|
52
|
+
* 500s in the browser. Local devs don't hit this because they always
|
|
53
|
+
* `forge server rebuild`; downstream users hitting `npm i -g + restart` do.
|
|
54
|
+
*/
|
|
55
|
+
function ensureBuilt() {
|
|
56
|
+
const buildIdPath = join(ROOT, '.next', 'BUILD_ID');
|
|
57
|
+
const versionFile = join(ROOT, '.next', '.forge-version');
|
|
58
|
+
const pkgVersion = JSON.parse(readFileSync(join(ROOT, 'package.json'), 'utf-8')).version;
|
|
59
|
+
const lastBuilt = existsSync(versionFile) ? readFileSync(versionFile, 'utf-8').trim() : '';
|
|
60
|
+
|
|
61
|
+
if (existsSync(buildIdPath) && lastBuilt === pkgVersion) return;
|
|
62
|
+
|
|
63
|
+
if (existsSync(buildIdPath)) {
|
|
64
|
+
console.log(`[forge] Upgrade detected (${lastBuilt || '(no marker)'} → v${pkgVersion}) — rebuilding .next/`);
|
|
65
|
+
execSync('rm -rf .next', { cwd: ROOT });
|
|
66
|
+
} else {
|
|
67
|
+
console.log(`[forge] Building v${pkgVersion}...`);
|
|
68
|
+
}
|
|
69
|
+
buildNext();
|
|
70
|
+
try { writeFileSync(versionFile, pkgVersion); } catch {}
|
|
71
|
+
}
|
|
72
|
+
|
|
41
73
|
// ── Parse arguments ──
|
|
42
74
|
|
|
43
75
|
function getArg(name) {
|
|
@@ -452,10 +484,7 @@ async function stopServer() {
|
|
|
452
484
|
|
|
453
485
|
// ── Helper: start background server ──
|
|
454
486
|
function startBackground() {
|
|
455
|
-
|
|
456
|
-
console.log('[forge] Building...');
|
|
457
|
-
buildNext();
|
|
458
|
-
}
|
|
487
|
+
ensureBuilt();
|
|
459
488
|
|
|
460
489
|
const logFd = openSync(LOG_FILE, 'a');
|
|
461
490
|
const nextBin = join(ROOT, 'node_modules', '.bin', 'next');
|
|
@@ -514,20 +543,16 @@ if (isRestart) {
|
|
|
514
543
|
}
|
|
515
544
|
|
|
516
545
|
// ── Rebuild ──
|
|
517
|
-
|
|
546
|
+
// Explicit `--rebuild` always wipes + rebuilds. Otherwise ensureBuilt()
|
|
547
|
+
// (called by every start path) handles upgrade detection itself.
|
|
548
|
+
if (isRebuild) {
|
|
518
549
|
const pkgVersion = JSON.parse(readFileSync(join(ROOT, 'package.json'), 'utf-8')).version;
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
writeFileSync(versionFile, pkgVersion);
|
|
526
|
-
if (isRebuild) {
|
|
527
|
-
console.log('[forge] Rebuild complete');
|
|
528
|
-
process.exit(0);
|
|
529
|
-
}
|
|
530
|
-
}
|
|
550
|
+
console.log(`[forge] Rebuilding (v${pkgVersion})...`);
|
|
551
|
+
if (existsSync(join(ROOT, '.next'))) execSync('rm -rf .next', { cwd: ROOT });
|
|
552
|
+
buildNext();
|
|
553
|
+
try { writeFileSync(join(ROOT, '.next', '.forge-version'), pkgVersion); } catch {}
|
|
554
|
+
console.log('[forge] Rebuild complete');
|
|
555
|
+
process.exit(0);
|
|
531
556
|
}
|
|
532
557
|
|
|
533
558
|
// ── Background ──
|
|
@@ -552,10 +577,7 @@ if (isDev) {
|
|
|
552
577
|
});
|
|
553
578
|
child.on('exit', (code) => { stopServices(); process.exit(code || 0); });
|
|
554
579
|
} else {
|
|
555
|
-
|
|
556
|
-
console.log('[forge] Building...');
|
|
557
|
-
buildNext();
|
|
558
|
-
}
|
|
580
|
+
ensureBuilt();
|
|
559
581
|
console.log(`[forge] Starting server (port ${webPort}, terminal ${terminalPort}, data ${DATA_DIR})`);
|
|
560
582
|
startServices();
|
|
561
583
|
const child = spawn('npx', ['next', 'start', '-p', String(webPort)], {
|
|
@@ -435,7 +435,6 @@ export default function SkillsPanel({ projectFilter }: { projectFilter?: string
|
|
|
435
435
|
<option value="crafts">Crafts</option>
|
|
436
436
|
</optgroup>
|
|
437
437
|
<optgroup label="Templates">
|
|
438
|
-
<option value="recipes">Recipes</option>
|
|
439
438
|
<option value="pipelines">Pipelines</option>
|
|
440
439
|
</optgroup>
|
|
441
440
|
</select>
|