gm-thebird 2.0.1072 → 2.0.1073
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/bin/bootstrap.js +9 -9
- package/gm.json +1 -1
- package/package.json +1 -1
- package/plugin.json +1 -1
package/bin/bootstrap.js
CHANGED
|
@@ -224,17 +224,17 @@ function sha256OfFile(filePath) {
|
|
|
224
224
|
});
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
-
async function extractNpmPackageWasm(destPath) {
|
|
227
|
+
async function extractNpmPackageWasm(destPath, version) {
|
|
228
228
|
const tempDir = path.join(path.dirname(destPath), '.npm-extract-' + Date.now());
|
|
229
229
|
try {
|
|
230
230
|
ensureDir(tempDir);
|
|
231
231
|
const startMs = Date.now();
|
|
232
|
-
log(`extracting npm package ${NPM_PACKAGE}
|
|
233
|
-
obsEvent('bootstrap', 'npm.extract.start', { package: NPM_PACKAGE, version
|
|
232
|
+
log(`extracting npm package ${NPM_PACKAGE}@${version} to ${tempDir}`);
|
|
233
|
+
obsEvent('bootstrap', 'npm.extract.start', { package: NPM_PACKAGE, version });
|
|
234
234
|
|
|
235
235
|
const result = spawnSync(
|
|
236
236
|
process.platform === 'win32' ? 'npx.cmd' : 'npx',
|
|
237
|
-
[NPM_PACKAGE + '@
|
|
237
|
+
[NPM_PACKAGE + '@' + version, '--prefix', tempDir],
|
|
238
238
|
{
|
|
239
239
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
240
240
|
timeout: ATTEMPT_TIMEOUT_MS,
|
|
@@ -245,7 +245,7 @@ async function extractNpmPackageWasm(destPath) {
|
|
|
245
245
|
|
|
246
246
|
if (result.error) throw result.error;
|
|
247
247
|
if (result.status !== 0) {
|
|
248
|
-
throw new Error(`
|
|
248
|
+
throw new Error(`npx extraction failed: ${result.stderr || result.stdout || 'unknown error'}`);
|
|
249
249
|
}
|
|
250
250
|
|
|
251
251
|
const nodeModulesPath = path.join(tempDir, 'node_modules', NPM_PACKAGE, 'plugkit.wasm');
|
|
@@ -261,12 +261,12 @@ async function extractNpmPackageWasm(destPath) {
|
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
-
async function extractNpmPackageWithRetry(destPath) {
|
|
264
|
+
async function extractNpmPackageWithRetry(destPath, version) {
|
|
265
265
|
let lastErr;
|
|
266
266
|
for (let attempt = 1; attempt <= MAX_ATTEMPTS; attempt++) {
|
|
267
267
|
try {
|
|
268
|
-
log(`npm extract attempt ${attempt}/${MAX_ATTEMPTS}: ${NPM_PACKAGE}
|
|
269
|
-
await extractNpmPackageWasm(destPath);
|
|
268
|
+
log(`npm extract attempt ${attempt}/${MAX_ATTEMPTS}: ${NPM_PACKAGE}@${version}`);
|
|
269
|
+
await extractNpmPackageWasm(destPath, version);
|
|
270
270
|
return;
|
|
271
271
|
} catch (err) {
|
|
272
272
|
lastErr = err;
|
|
@@ -393,7 +393,7 @@ async function bootstrap(opts) {
|
|
|
393
393
|
} catch (_) {}
|
|
394
394
|
}
|
|
395
395
|
try {
|
|
396
|
-
await extractNpmPackageWithRetry(wasmPartialPath);
|
|
396
|
+
await extractNpmPackageWithRetry(wasmPartialPath, version);
|
|
397
397
|
} catch (extractErr) {
|
|
398
398
|
writeBootstrapError({
|
|
399
399
|
expected_version: version,
|
package/gm.json
CHANGED
package/package.json
CHANGED