codev-code 1.18.4-10 → 1.18.4-12
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/package.json +13 -13
- package/postinstall.mjs +25 -2
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"scripts": {
|
|
8
8
|
"postinstall": "node ./postinstall.mjs"
|
|
9
9
|
},
|
|
10
|
-
"version": "1.18.4-
|
|
10
|
+
"version": "1.18.4-12",
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"os": [
|
|
13
13
|
"darwin",
|
|
@@ -19,17 +19,17 @@
|
|
|
19
19
|
"x64"
|
|
20
20
|
],
|
|
21
21
|
"optionalDependencies": {
|
|
22
|
-
"codev-code-darwin-arm64": "1.18.4-
|
|
23
|
-
"codev-code-darwin-x64-baseline": "1.18.4-
|
|
24
|
-
"codev-code-windows-x64": "1.18.4-
|
|
25
|
-
"codev-code-linux-arm64": "1.18.4-
|
|
26
|
-
"codev-code-windows-x64-baseline": "1.18.4-
|
|
27
|
-
"codev-code-linux-x64-musl": "1.18.4-
|
|
28
|
-
"codev-code-linux-x64-baseline": "1.18.4-
|
|
29
|
-
"codev-code-linux-x64": "1.18.4-
|
|
30
|
-
"codev-code-darwin-x64": "1.18.4-
|
|
31
|
-
"codev-code-windows-arm64": "1.18.4-
|
|
32
|
-
"codev-code-linux-x64-baseline-musl": "1.18.4-
|
|
33
|
-
"codev-code-linux-arm64-musl": "1.18.4-
|
|
22
|
+
"codev-code-darwin-arm64": "1.18.4-12",
|
|
23
|
+
"codev-code-darwin-x64-baseline": "1.18.4-12",
|
|
24
|
+
"codev-code-windows-x64": "1.18.4-12",
|
|
25
|
+
"codev-code-linux-arm64": "1.18.4-12",
|
|
26
|
+
"codev-code-windows-x64-baseline": "1.18.4-12",
|
|
27
|
+
"codev-code-linux-x64-musl": "1.18.4-12",
|
|
28
|
+
"codev-code-linux-x64-baseline": "1.18.4-12",
|
|
29
|
+
"codev-code-linux-x64": "1.18.4-12",
|
|
30
|
+
"codev-code-darwin-x64": "1.18.4-12",
|
|
31
|
+
"codev-code-windows-arm64": "1.18.4-12",
|
|
32
|
+
"codev-code-linux-x64-baseline-musl": "1.18.4-12",
|
|
33
|
+
"codev-code-linux-arm64-musl": "1.18.4-12"
|
|
34
34
|
}
|
|
35
35
|
}
|
package/postinstall.mjs
CHANGED
|
@@ -139,12 +139,31 @@ function installPackage(name) {
|
|
|
139
139
|
if (result.status !== 0) return
|
|
140
140
|
const packageDir = path.join(temp, "node_modules", name)
|
|
141
141
|
copyBinary(path.join(packageDir, "bin", sourceBinary), targetBinary)
|
|
142
|
+
// Before the finally deletes temp — the bundled rg lives in the same package.
|
|
143
|
+
copyRipgrep(packageDir)
|
|
142
144
|
return true
|
|
143
145
|
} finally {
|
|
144
146
|
fs.rmSync(temp, { recursive: true, force: true })
|
|
145
147
|
}
|
|
146
148
|
}
|
|
147
149
|
|
|
150
|
+
// Fork: the Windows platform packages bundle ripgrep (staged by
|
|
151
|
+
// script/build.ts) — fff is disabled on win32, so file search and `@`
|
|
152
|
+
// mentions there depend on rg, and the agent's own GitHub download fallback
|
|
153
|
+
// is what corporate networks block. Best-effort: a missing or uncopyable
|
|
154
|
+
// rg.exe must never fail the install — the agent still resolves rg via PATH,
|
|
155
|
+
// its cache, or download at runtime.
|
|
156
|
+
function copyRipgrep(packageDir) {
|
|
157
|
+
if (platform !== "windows") return
|
|
158
|
+
const source = path.join(packageDir, "bin", "rg.exe")
|
|
159
|
+
if (!fs.existsSync(source)) return
|
|
160
|
+
try {
|
|
161
|
+
copyBinary(source, path.join(__dirname, "bin", "rg.exe"))
|
|
162
|
+
} catch {
|
|
163
|
+
// Ignore — best-effort only.
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
148
167
|
function copyBinary(source, target) {
|
|
149
168
|
if (!fs.existsSync(source)) throw new Error(`Binary not found at ${source}`)
|
|
150
169
|
fs.mkdirSync(path.dirname(target), { recursive: true })
|
|
@@ -169,8 +188,12 @@ function verifyBinary() {
|
|
|
169
188
|
function main() {
|
|
170
189
|
for (const name of packageNames()) {
|
|
171
190
|
try {
|
|
172
|
-
|
|
173
|
-
|
|
191
|
+
const binary = resolveBinary(name)
|
|
192
|
+
copyBinary(binary, targetBinary)
|
|
193
|
+
if (verifyBinary()) {
|
|
194
|
+
copyRipgrep(path.dirname(path.dirname(binary)))
|
|
195
|
+
return
|
|
196
|
+
}
|
|
174
197
|
} catch {
|
|
175
198
|
if (installPackage(name) && verifyBinary()) return
|
|
176
199
|
}
|