@aion0/forge 0.3.7 → 0.4.1

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.
@@ -0,0 +1,11 @@
1
+ # Forge v0.4.1
2
+
3
+ Released: 2026-03-21
4
+
5
+ ## Changes since v0.4.0
6
+
7
+ ### Bug Fixes
8
+ - fix: prevent double console.log wrapping in production mode
9
+
10
+
11
+ **Full Changelog**: https://github.com/aiwatching/forge/compare/v0.4.0...v0.4.1
@@ -72,14 +72,22 @@ const LOG_FILE = join(DATA_DIR, 'forge.log');
72
72
 
73
73
  process.chdir(ROOT);
74
74
 
75
- // ── Add timestamps to all console output ──
76
- const origLog = console.log;
77
- const origError = console.error;
78
- const origWarn = console.warn;
79
- const ts = () => new Date().toISOString().replace('T', ' ').slice(0, 19);
80
- console.log = (...args) => origLog(`[${ts()}]`, ...args);
81
- console.error = (...args) => origError(`[${ts()}]`, ...args);
82
- console.warn = (...args) => origWarn(`[${ts()}]`, ...args);
75
+ // ── Init logger (timestamps + file output) ──
76
+ try {
77
+ const { initLogger } = await import('../lib/logger.ts');
78
+ initLogger();
79
+ } catch {
80
+ // logger.ts is TypeScript, may not load directly in .mjs — fallback inline
81
+ const _key = Symbol.for('forge-logger-init');
82
+ if (!globalThis[_key]) {
83
+ globalThis[_key] = true;
84
+ const _origLog = console.log, _origErr = console.error, _origWarn = console.warn;
85
+ const _ts = () => new Date().toISOString().replace('T', ' ').slice(0, 19);
86
+ console.log = (...a) => _origLog(`[${_ts()}]`, ...a);
87
+ console.error = (...a) => _origErr(`[${_ts()}]`, ...a);
88
+ console.warn = (...a) => _origWarn(`[${_ts()}]`, ...a);
89
+ }
90
+ }
83
91
 
84
92
  // ── Migrate old layout (~/.forge/*) to new (~/.forge/data/*) ──
85
93
  if (!getArg('--dir')) {
package/lib/logger.ts CHANGED
@@ -7,11 +7,12 @@
7
7
  import { appendFileSync, mkdirSync, existsSync } from 'node:fs';
8
8
  import { join } from 'node:path';
9
9
 
10
- let initialized = false;
10
+ // Use globalThis to prevent double-init across forge-server.mjs and init.ts
11
+ const loggerKey = Symbol.for('forge-logger-init');
11
12
 
12
13
  export function initLogger() {
13
- if (initialized) return;
14
- initialized = true;
14
+ if ((globalThis as any)[loggerKey]) return;
15
+ (globalThis as any)[loggerKey] = true;
15
16
 
16
17
  // Determine log file path
17
18
  let logFile: string | null = null;
package/next-env.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="next" />
2
2
  /// <reference types="next/image-types/global" />
3
- import "./.next/dev/types/routes.d.ts";
3
+ import "./.next/types/routes.d.ts";
4
4
 
5
5
  // NOTE: This file should not be edited
6
6
  // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aion0/forge",
3
- "version": "0.3.7",
3
+ "version": "0.4.1",
4
4
  "description": "Unified AI workflow platform — multi-model task orchestration, persistent sessions, web terminal, remote access",
5
5
  "type": "module",
6
6
  "scripts": {
package/publish.sh CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/bin/bash
2
- # publish.sh — Bump version, commit, and publish to npm
2
+ # publish.sh — Bump version, generate release notes, commit, tag, push, create GitHub release
3
3
  #
4
4
  # Usage:
5
5
  # ./publish.sh # patch bump (0.2.3 → 0.2.4)
@@ -35,11 +35,99 @@ echo ""
35
35
  # Update package.json
36
36
  sed -i '' "s/\"version\": \"$CURRENT\"/\"version\": \"$NEW_VERSION\"/" package.json
37
37
 
38
- # Commit
38
+ # Generate release notes from git log since last tag
39
+ LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
40
+ RELEASE_NOTES_FILE="RELEASE_NOTES.md"
41
+
42
+ echo "# Forge v$NEW_VERSION" > "$RELEASE_NOTES_FILE"
43
+ echo "" >> "$RELEASE_NOTES_FILE"
44
+ echo "Released: $(date +%Y-%m-%d)" >> "$RELEASE_NOTES_FILE"
45
+ echo "" >> "$RELEASE_NOTES_FILE"
46
+
47
+ if [ -n "$LAST_TAG" ]; then
48
+ echo "## Changes since $LAST_TAG" >> "$RELEASE_NOTES_FILE"
49
+ echo "" >> "$RELEASE_NOTES_FILE"
50
+
51
+ # Features
52
+ FEATURES=$(git log --oneline "$LAST_TAG"..HEAD --no-merges --grep="feat:" --format="- %s" 2>/dev/null)
53
+ if [ -n "$FEATURES" ]; then
54
+ echo "### Features" >> "$RELEASE_NOTES_FILE"
55
+ echo "$FEATURES" >> "$RELEASE_NOTES_FILE"
56
+ echo "" >> "$RELEASE_NOTES_FILE"
57
+ fi
58
+
59
+ # Fixes
60
+ FIXES=$(git log --oneline "$LAST_TAG"..HEAD --no-merges --grep="fix:" --format="- %s" 2>/dev/null)
61
+ if [ -n "$FIXES" ]; then
62
+ echo "### Bug Fixes" >> "$RELEASE_NOTES_FILE"
63
+ echo "$FIXES" >> "$RELEASE_NOTES_FILE"
64
+ echo "" >> "$RELEASE_NOTES_FILE"
65
+ fi
66
+
67
+ # Performance
68
+ PERF=$(git log --oneline "$LAST_TAG"..HEAD --no-merges --grep="perf:" --format="- %s" 2>/dev/null)
69
+ if [ -n "$PERF" ]; then
70
+ echo "### Performance" >> "$RELEASE_NOTES_FILE"
71
+ echo "$PERF" >> "$RELEASE_NOTES_FILE"
72
+ echo "" >> "$RELEASE_NOTES_FILE"
73
+ fi
74
+
75
+ # Refactors
76
+ REFACTOR=$(git log --oneline "$LAST_TAG"..HEAD --no-merges --grep="refactor:" --format="- %s" 2>/dev/null)
77
+ if [ -n "$REFACTOR" ]; then
78
+ echo "### Refactoring" >> "$RELEASE_NOTES_FILE"
79
+ echo "$REFACTOR" >> "$RELEASE_NOTES_FILE"
80
+ echo "" >> "$RELEASE_NOTES_FILE"
81
+ fi
82
+
83
+ # Docs
84
+ DOCS=$(git log --oneline "$LAST_TAG"..HEAD --no-merges --grep="docs:" --format="- %s" 2>/dev/null)
85
+ if [ -n "$DOCS" ]; then
86
+ echo "### Documentation" >> "$RELEASE_NOTES_FILE"
87
+ echo "$DOCS" >> "$RELEASE_NOTES_FILE"
88
+ echo "" >> "$RELEASE_NOTES_FILE"
89
+ fi
90
+
91
+ # Other (commits without conventional prefix)
92
+ OTHER=$(git log --oneline "$LAST_TAG"..HEAD --no-merges --format="%s" 2>/dev/null | grep -v -E "^(feat|fix|perf|refactor|docs|chore|test|ci):" | sed 's/^/- /')
93
+ if [ -n "$OTHER" ]; then
94
+ echo "### Other" >> "$RELEASE_NOTES_FILE"
95
+ echo "$OTHER" >> "$RELEASE_NOTES_FILE"
96
+ echo "" >> "$RELEASE_NOTES_FILE"
97
+ fi
98
+ else
99
+ echo "Initial release" >> "$RELEASE_NOTES_FILE"
100
+ fi
101
+
102
+ echo "" >> "$RELEASE_NOTES_FILE"
103
+ echo "**Full Changelog**: https://github.com/aiwatching/forge/compare/${LAST_TAG}...v${NEW_VERSION}" >> "$RELEASE_NOTES_FILE"
104
+
105
+ echo "Release notes written to $RELEASE_NOTES_FILE"
106
+ cat "$RELEASE_NOTES_FILE"
107
+ echo ""
108
+
109
+ # Commit + tag
39
110
  git add -A
40
111
  git commit -m "v$NEW_VERSION"
41
112
  git tag "v$NEW_VERSION"
42
113
 
114
+ # Push
115
+ echo "Pushing to origin..."
116
+ git push origin main
117
+ git push origin "v$NEW_VERSION"
118
+
119
+ # Create GitHub Release (if gh CLI available)
120
+ if command -v gh &> /dev/null; then
121
+ echo ""
122
+ echo "Creating GitHub Release..."
123
+ gh release create "v$NEW_VERSION" --title "v$NEW_VERSION" --notes-file "$RELEASE_NOTES_FILE"
124
+ echo "✓ GitHub Release created: https://github.com/aiwatching/forge/releases/tag/v$NEW_VERSION"
125
+ else
126
+ echo ""
127
+ echo "gh CLI not found. Create release manually:"
128
+ echo " https://github.com/aiwatching/forge/releases/new?tag=v$NEW_VERSION"
129
+ fi
130
+
43
131
  echo ""
44
132
  echo "Ready to publish @aion0/forge@$NEW_VERSION"
45
133
  echo "Run: npm login && npm publish --access public --otp=<code>"