codeplane-ai 27.4.6 → 27.4.8
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 +49 -16
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"scripts": {
|
|
7
7
|
"postinstall": "bun ./postinstall.mjs || node ./postinstall.mjs"
|
|
8
8
|
},
|
|
9
|
-
"version": "27.4.
|
|
9
|
+
"version": "27.4.8",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
|
@@ -17,17 +17,17 @@
|
|
|
17
17
|
},
|
|
18
18
|
"homepage": "https://github.com/devinoldenburg/codeplane",
|
|
19
19
|
"optionalDependencies": {
|
|
20
|
-
"codeplane-linux-arm64-musl": "27.4.
|
|
21
|
-
"codeplane-linux-x64": "27.4.
|
|
22
|
-
"codeplane-linux-x64-baseline-musl": "27.4.
|
|
23
|
-
"codeplane-darwin-x64-baseline": "27.4.
|
|
24
|
-
"codeplane-darwin-arm64": "27.4.
|
|
25
|
-
"codeplane-linux-x64-baseline": "27.4.
|
|
26
|
-
"codeplane-windows-arm64": "27.4.
|
|
27
|
-
"codeplane-windows-x64-baseline": "27.4.
|
|
28
|
-
"codeplane-linux-x64-musl": "27.4.
|
|
29
|
-
"codeplane-linux-arm64": "27.4.
|
|
30
|
-
"codeplane-windows-x64": "27.4.
|
|
31
|
-
"codeplane-darwin-x64": "27.4.
|
|
20
|
+
"codeplane-linux-arm64-musl": "27.4.8",
|
|
21
|
+
"codeplane-linux-x64": "27.4.8",
|
|
22
|
+
"codeplane-linux-x64-baseline-musl": "27.4.8",
|
|
23
|
+
"codeplane-darwin-x64-baseline": "27.4.8",
|
|
24
|
+
"codeplane-darwin-arm64": "27.4.8",
|
|
25
|
+
"codeplane-linux-x64-baseline": "27.4.8",
|
|
26
|
+
"codeplane-windows-arm64": "27.4.8",
|
|
27
|
+
"codeplane-windows-x64-baseline": "27.4.8",
|
|
28
|
+
"codeplane-linux-x64-musl": "27.4.8",
|
|
29
|
+
"codeplane-linux-arm64": "27.4.8",
|
|
30
|
+
"codeplane-windows-x64": "27.4.8",
|
|
31
|
+
"codeplane-darwin-x64": "27.4.8"
|
|
32
32
|
}
|
|
33
33
|
}
|
package/postinstall.mjs
CHANGED
|
@@ -155,18 +155,48 @@ function findBinary() {
|
|
|
155
155
|
)
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
+
function sleep(ms) {
|
|
159
|
+
return new Promise((resolve) => setTimeout(resolve, ms))
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
async function tryFindBinaryWithRetry(attempts = 5, delayMs = 200) {
|
|
163
|
+
let lastError
|
|
164
|
+
for (let i = 0; i < attempts; i++) {
|
|
165
|
+
try {
|
|
166
|
+
return findBinary()
|
|
167
|
+
} catch (error) {
|
|
168
|
+
lastError = error
|
|
169
|
+
if (i < attempts - 1) await sleep(delayMs)
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
throw lastError
|
|
173
|
+
}
|
|
174
|
+
|
|
158
175
|
async function main() {
|
|
176
|
+
if (os.platform() === "win32") {
|
|
177
|
+
// On Windows, the .exe is already included in the package and bin field points to it.
|
|
178
|
+
// No postinstall setup needed.
|
|
179
|
+
console.log("Windows detected: binary setup not needed (using packaged .exe)")
|
|
180
|
+
return
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
let binaryPath
|
|
159
184
|
try {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
185
|
+
binaryPath = (await tryFindBinaryWithRetry()).binaryPath
|
|
186
|
+
} catch (error) {
|
|
187
|
+
// The wrapper script (bin/codeplane) does its own findBinary at runtime,
|
|
188
|
+
// so a missing optional-dependency here only loses the .codeplane fast-
|
|
189
|
+
// start cache — it does NOT prevent codeplane from running. Warn but
|
|
190
|
+
// do not fail the install.
|
|
191
|
+
console.warn(
|
|
192
|
+
"[codeplane postinstall] Skipping fast-start cache: " +
|
|
193
|
+
(error && error.message ? error.message : String(error)) +
|
|
194
|
+
". The CLI will still work; startup may be slightly slower on first run.",
|
|
195
|
+
)
|
|
196
|
+
return
|
|
197
|
+
}
|
|
166
198
|
|
|
167
|
-
|
|
168
|
-
// Don't replace the wrapper script - it handles binary execution
|
|
169
|
-
const { binaryPath } = findBinary()
|
|
199
|
+
try {
|
|
170
200
|
const target = path.join(__dirname, "bin", ".codeplane")
|
|
171
201
|
if (fs.existsSync(target)) fs.unlinkSync(target)
|
|
172
202
|
try {
|
|
@@ -176,14 +206,17 @@ async function main() {
|
|
|
176
206
|
}
|
|
177
207
|
fs.chmodSync(target, 0o755)
|
|
178
208
|
} catch (error) {
|
|
179
|
-
console.
|
|
180
|
-
|
|
209
|
+
console.warn(
|
|
210
|
+
"[codeplane postinstall] Could not write fast-start cache: " +
|
|
211
|
+
(error && error.message ? error.message : String(error)) +
|
|
212
|
+
". The CLI will still work via the wrapper.",
|
|
213
|
+
)
|
|
181
214
|
}
|
|
182
215
|
}
|
|
183
216
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
217
|
+
main().catch((error) => {
|
|
218
|
+
console.warn(
|
|
219
|
+
"[codeplane postinstall] Unexpected error: " + (error && error.message ? error.message : String(error)),
|
|
220
|
+
)
|
|
188
221
|
process.exit(0)
|
|
189
|
-
}
|
|
222
|
+
})
|