coder-config 0.46.0-beta.13 → 0.46.0-beta.14
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/lib/constants.js +1 -1
- package/package.json +2 -1
- package/scripts/preuninstall.js +57 -0
package/lib/constants.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coder-config",
|
|
3
|
-
"version": "0.46.0-beta.
|
|
3
|
+
"version": "0.46.0-beta.14",
|
|
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",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"build:ci": "cd ui && npm install && npm run build",
|
|
22
22
|
"prepublishOnly": "npm run build",
|
|
23
23
|
"postinstall": "node scripts/postinstall.js",
|
|
24
|
+
"preuninstall": "node scripts/preuninstall.js",
|
|
24
25
|
"test": "node --test test/*.test.js",
|
|
25
26
|
"release": "./scripts/release.sh"
|
|
26
27
|
},
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Preuninstall script - cleans up system files on npm uninstall
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const fs = require('fs');
|
|
7
|
+
const path = require('path');
|
|
8
|
+
const os = require('os');
|
|
9
|
+
const { execSync } = require('child_process');
|
|
10
|
+
|
|
11
|
+
const home = os.homedir();
|
|
12
|
+
|
|
13
|
+
// 1. Stop and remove LaunchAgent
|
|
14
|
+
const launchAgentPath = path.join(home, 'Library', 'LaunchAgents', 'io.regression.coder-config.plist');
|
|
15
|
+
if (fs.existsSync(launchAgentPath)) {
|
|
16
|
+
try {
|
|
17
|
+
execSync(`launchctl unload "${launchAgentPath}" 2>/dev/null || true`);
|
|
18
|
+
fs.unlinkSync(launchAgentPath);
|
|
19
|
+
console.log('Removed LaunchAgent');
|
|
20
|
+
} catch (e) {
|
|
21
|
+
// Ignore errors
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// 2. Remove shell hooks from .zshrc and .bashrc
|
|
26
|
+
const shellFiles = [
|
|
27
|
+
path.join(home, '.zshrc'),
|
|
28
|
+
path.join(home, '.bashrc'),
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
const hookStart = '# coder-config workstream hooks';
|
|
32
|
+
const hookEnd = '# end coder-config workstream hooks';
|
|
33
|
+
|
|
34
|
+
for (const rcFile of shellFiles) {
|
|
35
|
+
if (fs.existsSync(rcFile)) {
|
|
36
|
+
try {
|
|
37
|
+
let content = fs.readFileSync(rcFile, 'utf8');
|
|
38
|
+
const startIdx = content.indexOf(hookStart);
|
|
39
|
+
const endIdx = content.indexOf(hookEnd);
|
|
40
|
+
|
|
41
|
+
if (startIdx !== -1 && endIdx !== -1) {
|
|
42
|
+
// Remove the block including trailing newline
|
|
43
|
+
let removeStart = startIdx;
|
|
44
|
+
if (startIdx > 0 && content[startIdx - 1] === '\n') {
|
|
45
|
+
removeStart = startIdx - 1;
|
|
46
|
+
}
|
|
47
|
+
content = content.slice(0, removeStart) + content.slice(endIdx + hookEnd.length);
|
|
48
|
+
fs.writeFileSync(rcFile, content);
|
|
49
|
+
console.log(`Removed hooks from ${path.basename(rcFile)}`);
|
|
50
|
+
}
|
|
51
|
+
} catch (e) {
|
|
52
|
+
// Ignore errors
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
console.log('Cleanup complete');
|