coder-config 0.44.50 → 0.44.52
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/config-loader.js +49 -5
- package/lib/constants.js +1 -1
- package/package.json +1 -1
- package/ui/dist/assets/{index-Cp5LNu-P.js → index-BbJbCc7n.js} +150 -150
- package/ui/dist/index.html +1 -1
package/config-loader.js
CHANGED
|
@@ -40,15 +40,16 @@ class ClaudeConfigManager {
|
|
|
40
40
|
const newDir = path.join(home, '.coder-config');
|
|
41
41
|
const legacyDir = path.join(home, '.claude-config');
|
|
42
42
|
|
|
43
|
-
// Use
|
|
43
|
+
// Use configured location or default to new
|
|
44
44
|
if (process.env.CLAUDE_CONFIG_HOME) {
|
|
45
45
|
this.installDir = process.env.CLAUDE_CONFIG_HOME;
|
|
46
|
-
} else if (fs.existsSync(path.join(legacyDir, 'projects.json')) &&
|
|
47
|
-
!fs.existsSync(path.join(newDir, 'projects.json'))) {
|
|
48
|
-
// Legacy has data, new doesn't - use legacy for backwards compatibility
|
|
49
|
-
this.installDir = legacyDir;
|
|
50
46
|
} else {
|
|
51
47
|
this.installDir = newDir;
|
|
48
|
+
|
|
49
|
+
// Auto-migrate from legacy directory if it exists
|
|
50
|
+
if (fs.existsSync(legacyDir)) {
|
|
51
|
+
this._autoMigrate(legacyDir, newDir);
|
|
52
|
+
}
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
// Look for registry in multiple places
|
|
@@ -60,6 +61,49 @@ class ClaudeConfigManager {
|
|
|
60
61
|
this.registryPath = possiblePaths.find(p => fs.existsSync(p)) || possiblePaths[0];
|
|
61
62
|
}
|
|
62
63
|
|
|
64
|
+
// Auto-migrate from legacy directory (called from constructor)
|
|
65
|
+
_autoMigrate(legacyDir, newDir) {
|
|
66
|
+
try {
|
|
67
|
+
const migrated = this._migrateDir(legacyDir, newDir);
|
|
68
|
+
if (migrated > 0) {
|
|
69
|
+
console.log(`\n✓ Auto-migrated ${migrated} item(s) from ~/.claude-config to ~/.coder-config`);
|
|
70
|
+
console.log(' To complete migration: rm -rf ~/.claude-config\n');
|
|
71
|
+
}
|
|
72
|
+
} catch (e) {
|
|
73
|
+
// Silently ignore migration errors - don't break startup
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Recursively migrate directory contents (merges with existing)
|
|
78
|
+
_migrateDir(srcDir, destDir) {
|
|
79
|
+
if (!fs.existsSync(srcDir)) return 0;
|
|
80
|
+
|
|
81
|
+
const items = fs.readdirSync(srcDir);
|
|
82
|
+
if (items.length === 0) return 0;
|
|
83
|
+
|
|
84
|
+
// Ensure destination exists
|
|
85
|
+
if (!fs.existsSync(destDir)) {
|
|
86
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
let migrated = 0;
|
|
90
|
+
for (const item of items) {
|
|
91
|
+
const src = path.join(srcDir, item);
|
|
92
|
+
const dest = path.join(destDir, item);
|
|
93
|
+
const srcStat = fs.statSync(src);
|
|
94
|
+
|
|
95
|
+
if (srcStat.isDirectory()) {
|
|
96
|
+
// Recursively migrate directory contents
|
|
97
|
+
migrated += this._migrateDir(src, dest);
|
|
98
|
+
} else if (!fs.existsSync(dest)) {
|
|
99
|
+
// Copy file if it doesn't exist in destination
|
|
100
|
+
fs.copyFileSync(src, dest);
|
|
101
|
+
migrated++;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return migrated;
|
|
105
|
+
}
|
|
106
|
+
|
|
63
107
|
// Utils
|
|
64
108
|
loadJson(filePath) { return loadJson(filePath); }
|
|
65
109
|
saveJson(filePath, data) { return saveJson(filePath, data); }
|
package/lib/constants.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coder-config",
|
|
3
|
-
"version": "0.44.
|
|
3
|
+
"version": "0.44.52",
|
|
4
4
|
"description": "Configuration manager for AI coding tools - Claude Code, Gemini CLI, Codex CLI, Antigravity. Manage MCPs, rules, permissions, memory, and workstreams.",
|
|
5
5
|
"author": "regression.io",
|
|
6
6
|
"main": "config-loader.js",
|