recoder-code 2.0.3 ā 2.1.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.
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"OPENROUTER_SITE_URL": "https://recoder.xyz",
|
|
83
83
|
"RECODER_DEBUG": "true",
|
|
84
84
|
"RECODER_LITE_MODE": "false",
|
|
85
|
-
"PATH": "/usr/local/
|
|
85
|
+
"PATH": "/usr/local/share/npm-global/bin:/usr/local/bin:${containerEnv:PATH}",
|
|
86
86
|
"SHELL": "/bin/zsh"
|
|
87
87
|
},
|
|
88
88
|
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=delegated",
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "recoder-code",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "Complete AI-powered development platform with ML model training, plugin registry, real-time collaboration, monitoring, infrastructure automation, and enterprise deployment capabilities",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"start": "node cli/run.js",
|
|
8
8
|
"cli": "node cli/run.js",
|
|
9
9
|
"setup": "node setup.js",
|
|
10
|
+
"setup:global": "node setup-global-npm.js",
|
|
10
11
|
"setup:enterprise": "node setup.js --enterprise",
|
|
11
12
|
"validate": "node validate.js",
|
|
12
13
|
"build": "tsc",
|
|
@@ -27,7 +28,7 @@
|
|
|
27
28
|
"security:audit": "npm audit --audit-level moderate",
|
|
28
29
|
"optimize": "node scripts/optimize-package.js",
|
|
29
30
|
"health-check": "node scripts/health-check.js",
|
|
30
|
-
"postinstall": "node -e \"console.log('\\nš Recoder-Code installed successfully!\\n\\nā
Quick Start:\\n recoder-code
|
|
31
|
+
"postinstall": "node -e \"console.log('\\nš Recoder-Code installed successfully!\\n\\nā
Quick Start:\\n recoder-code\\n\\nš” If command not found, run setup:\\n npx recoder-code setup:global\\n\\nOr add npm global bin to PATH manually:\\n echo \\\"export PATH=\\\\\\\"$(npm config get prefix)/bin:$PATH\\\\\\\"\\\" >> ~/.zshrc\\n source ~/.zshrc\\n\\nš Then try: recoder-code --help\\n')\"",
|
|
31
32
|
"prepare": "echo 'Package prepared for distribution'",
|
|
32
33
|
"prepublishOnly": "npm run prepare && npm run security:audit"
|
|
33
34
|
},
|
|
@@ -148,6 +149,7 @@
|
|
|
148
149
|
"config.js",
|
|
149
150
|
"index.js",
|
|
150
151
|
"setup.js",
|
|
152
|
+
"setup-global-npm.js",
|
|
151
153
|
"validate.js",
|
|
152
154
|
"README.md",
|
|
153
155
|
"LICENSE.md",
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { execSync } = require('child_process');
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
const os = require('os');
|
|
7
|
+
|
|
8
|
+
console.log('š§ Setting up recoder-code for global usage...\n');
|
|
9
|
+
|
|
10
|
+
try {
|
|
11
|
+
// Check if running on macOS with Homebrew
|
|
12
|
+
if (process.platform === 'darwin') {
|
|
13
|
+
try {
|
|
14
|
+
execSync('which brew', { stdio: 'ignore' });
|
|
15
|
+
console.log('ā
Homebrew detected on macOS');
|
|
16
|
+
|
|
17
|
+
// Set npm prefix to homebrew
|
|
18
|
+
const homebrewPrefix = execSync('brew --prefix', { encoding: 'utf8' }).trim();
|
|
19
|
+
console.log(`š Setting npm prefix to: ${homebrewPrefix}`);
|
|
20
|
+
|
|
21
|
+
execSync(`npm config set prefix ${homebrewPrefix}`);
|
|
22
|
+
console.log('ā
npm prefix configured');
|
|
23
|
+
|
|
24
|
+
// Verify the bin directory is in PATH
|
|
25
|
+
const globalBinPath = path.join(homebrewPrefix, 'bin');
|
|
26
|
+
const currentPath = process.env.PATH || '';
|
|
27
|
+
|
|
28
|
+
if (currentPath.includes(globalBinPath)) {
|
|
29
|
+
console.log('ā
Homebrew bin directory already in PATH');
|
|
30
|
+
} else {
|
|
31
|
+
console.log('ā ļø Adding Homebrew bin to PATH...');
|
|
32
|
+
|
|
33
|
+
// Determine shell config file
|
|
34
|
+
const shell = process.env.SHELL || '';
|
|
35
|
+
let configFile = '.bashrc';
|
|
36
|
+
|
|
37
|
+
if (shell.includes('zsh')) {
|
|
38
|
+
configFile = '.zshrc';
|
|
39
|
+
} else if (shell.includes('fish')) {
|
|
40
|
+
configFile = '.config/fish/config.fish';
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const configPath = path.join(os.homedir(), configFile);
|
|
44
|
+
const exportLine = `export PATH="${globalBinPath}:$PATH"`;
|
|
45
|
+
|
|
46
|
+
// Check if line already exists
|
|
47
|
+
if (fs.existsSync(configPath)) {
|
|
48
|
+
const content = fs.readFileSync(configPath, 'utf8');
|
|
49
|
+
if (!content.includes(exportLine) && !content.includes(globalBinPath)) {
|
|
50
|
+
fs.appendFileSync(configPath, `\n# Added by recoder-code setup\n${exportLine}\n`);
|
|
51
|
+
console.log(`ā
Added PATH export to ${configFile}`);
|
|
52
|
+
}
|
|
53
|
+
} else {
|
|
54
|
+
fs.writeFileSync(configPath, `# Added by recoder-code setup\n${exportLine}\n`);
|
|
55
|
+
console.log(`ā
Created ${configFile} with PATH export`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
} catch (error) {
|
|
60
|
+
console.log('ā ļø Homebrew not found, using default npm configuration');
|
|
61
|
+
setupDefault();
|
|
62
|
+
}
|
|
63
|
+
} else {
|
|
64
|
+
setupDefault();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
console.log('\nš Installing recoder-code globally...');
|
|
68
|
+
execSync('npm install -g recoder-code@latest', { stdio: 'inherit' });
|
|
69
|
+
|
|
70
|
+
console.log('\nā
Setup complete!');
|
|
71
|
+
console.log('\nš Test it now:');
|
|
72
|
+
console.log(' recoder-code --help');
|
|
73
|
+
console.log(' recoder-code "Hello world"');
|
|
74
|
+
console.log('\nš” If command not found, restart your terminal or run:');
|
|
75
|
+
console.log(' source ~/.zshrc # or your shell config file');
|
|
76
|
+
|
|
77
|
+
} catch (error) {
|
|
78
|
+
console.error('ā Setup failed:', error.message);
|
|
79
|
+
console.log('\nš” Manual setup:');
|
|
80
|
+
console.log('1. npm config set prefix $(brew --prefix) # macOS with Homebrew');
|
|
81
|
+
console.log('2. npm install -g recoder-code');
|
|
82
|
+
console.log('3. Restart terminal');
|
|
83
|
+
process.exit(1);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function setupDefault() {
|
|
87
|
+
console.log('š Using default npm configuration');
|
|
88
|
+
const npmPrefix = execSync('npm config get prefix', { encoding: 'utf8' }).trim();
|
|
89
|
+
const globalBinPath = path.join(npmPrefix, 'bin');
|
|
90
|
+
|
|
91
|
+
console.log(`š Global bin directory: ${globalBinPath}`);
|
|
92
|
+
|
|
93
|
+
// Check if in PATH
|
|
94
|
+
const currentPath = process.env.PATH || '';
|
|
95
|
+
if (!currentPath.includes(globalBinPath)) {
|
|
96
|
+
console.log('ā ļø Global bin directory not in PATH');
|
|
97
|
+
console.log(`š” Add this to your shell config: export PATH="${globalBinPath}:$PATH"`);
|
|
98
|
+
}
|
|
99
|
+
}
|