@just-every/code 0.2.155 → 0.2.156

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # JustEvery_ Code
1
+ # CODE
2
2
 
3
3
   
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@just-every/code",
3
- "version": "0.2.155",
3
+ "version": "0.2.156",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Lightweight coding agent that runs in your terminal - fork of OpenAI Codex",
6
6
  "bin": {
@@ -35,10 +35,10 @@
35
35
  "prettier": "^3.3.3"
36
36
  },
37
37
  "optionalDependencies": {
38
- "@just-every/code-darwin-arm64": "0.2.155",
39
- "@just-every/code-darwin-x64": "0.2.155",
40
- "@just-every/code-linux-x64-musl": "0.2.155",
41
- "@just-every/code-linux-arm64-musl": "0.2.155",
42
- "@just-every/code-win32-x64": "0.2.155"
38
+ "@just-every/code-darwin-arm64": "0.2.156",
39
+ "@just-every/code-darwin-x64": "0.2.156",
40
+ "@just-every/code-linux-x64-musl": "0.2.156",
41
+ "@just-every/code-linux-arm64-musl": "0.2.156",
42
+ "@just-every/code-win32-x64": "0.2.156"
43
43
  }
44
44
  }
package/postinstall.js CHANGED
@@ -104,6 +104,51 @@ async function writeCacheAtomic(srcPath, cachePath) {
104
104
  renameSync(tmp, cachePath);
105
105
  }
106
106
 
107
+ function resolveGlobalBinDir() {
108
+ const plt = platform();
109
+ const userAgent = process.env.npm_config_user_agent || '';
110
+
111
+ const fromPrefix = (prefixPath) => {
112
+ if (!prefixPath) return '';
113
+ return plt === 'win32' ? prefixPath : join(prefixPath, 'bin');
114
+ };
115
+
116
+ const prefixEnv = process.env.npm_config_prefix || process.env.PREFIX || '';
117
+ const direct = fromPrefix(prefixEnv);
118
+ if (direct) return direct;
119
+
120
+ const tryExec = (command) => {
121
+ try {
122
+ return execSync(command, {
123
+ stdio: ['ignore', 'pipe', 'ignore'],
124
+ shell: true,
125
+ }).toString().trim();
126
+ } catch {
127
+ return '';
128
+ }
129
+ };
130
+
131
+ const prefixFromNpm = fromPrefix(tryExec('npm prefix -g'));
132
+ if (prefixFromNpm) return prefixFromNpm;
133
+
134
+ const binFromNpm = tryExec('npm bin -g');
135
+ if (binFromNpm) return binFromNpm;
136
+
137
+ if (userAgent.includes('pnpm')) {
138
+ const pnpmBin = tryExec('pnpm bin --global');
139
+ if (pnpmBin) return pnpmBin;
140
+ const pnpmPrefix = fromPrefix(tryExec('pnpm env get prefix'));
141
+ if (pnpmPrefix) return pnpmPrefix;
142
+ }
143
+
144
+ if (userAgent.includes('yarn')) {
145
+ const yarnBin = tryExec('yarn global bin');
146
+ if (yarnBin) return yarnBin;
147
+ }
148
+
149
+ return '';
150
+ }
151
+
107
152
  async function downloadBinary(url, dest, maxRedirects = 5, maxRetries = 3) {
108
153
  const sleep = (ms) => new Promise(r => setTimeout(r, ms));
109
154
 
@@ -598,12 +643,8 @@ async function main() {
598
643
  }
599
644
  } else {
600
645
  // npm/pnpm/yarn path
601
- let globalBin = '';
602
- try {
603
- globalBin = execSync('npm bin -g', { stdio: ['ignore', 'pipe', 'ignore'] }).toString().trim();
604
- } catch {}
605
-
606
- const ourShim = join(globalBin || '', isWindows ? 'code.cmd' : 'code');
646
+ const globalBin = resolveGlobalBinDir();
647
+ const ourShim = globalBin ? join(globalBin, isWindows ? 'code.cmd' : 'code') : '';
607
648
  const candidates = resolveAllOnPath();
608
649
  const others = candidates.filter(p => p && (!ourShim || p !== ourShim));
609
650
  const collision = others.length > 0;