@vercel/backends 0.0.59 → 0.0.60
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/dist/index.mjs +20 -8
- package/dist/rolldown/index.mjs +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -576,7 +576,7 @@ const build$1 = async (args) => {
|
|
|
576
576
|
span
|
|
577
577
|
})]);
|
|
578
578
|
await writeFile(join$1(args.workPath, args.out, ".cervel.json"), JSON.stringify({ handler: rolldownResult.result.handler }, null, 2));
|
|
579
|
-
console.log(Colors.gray(`${Colors.bold(Colors.cyan("✓"))} Build complete
|
|
579
|
+
console.log(Colors.gray(`${Colors.bold(Colors.cyan("✓"))} Build complete — Using ${Colors.bold(entrypoint)} as the root entrypoint.`));
|
|
580
580
|
return { rolldownResult: rolldownResult.result };
|
|
581
581
|
};
|
|
582
582
|
const serve = async (args) => {
|
|
@@ -1077,7 +1077,7 @@ module.exports = requireFromContext('${pkgName}');
|
|
|
1077
1077
|
ignore: args.config.excludeFiles
|
|
1078
1078
|
});
|
|
1079
1079
|
if (!handler) throw new Error(`Unable to resolve build handler for entrypoint: ${args.entrypoint}`);
|
|
1080
|
-
console.log(Colors.gray(`${Colors.bold(Colors.cyan("✓"))} Build complete
|
|
1080
|
+
console.log(Colors.gray(`${Colors.bold(Colors.cyan("✓"))} Build complete — Using ${Colors.bold(args.entrypoint)} as the root entrypoint.`));
|
|
1081
1081
|
return {
|
|
1082
1082
|
files,
|
|
1083
1083
|
handler,
|
|
@@ -1124,6 +1124,7 @@ const introspection = async (args) => {
|
|
|
1124
1124
|
writeFileSync(filePath, value.data);
|
|
1125
1125
|
}
|
|
1126
1126
|
let introspectionData;
|
|
1127
|
+
let introspectionError;
|
|
1127
1128
|
await new Promise((resolvePromise) => {
|
|
1128
1129
|
try {
|
|
1129
1130
|
debug("Spawning introspection process");
|
|
@@ -1166,11 +1167,11 @@ const introspection = async (args) => {
|
|
|
1166
1167
|
const timeout = setTimeout(() => {
|
|
1167
1168
|
debug("Introspection timeout, killing process with SIGTERM");
|
|
1168
1169
|
child.kill("SIGTERM");
|
|
1169
|
-
},
|
|
1170
|
+
}, 5e3);
|
|
1170
1171
|
const timeout2 = setTimeout(() => {
|
|
1171
1172
|
debug("Introspection timeout, killing process with SIGKILL");
|
|
1172
1173
|
child.kill("SIGKILL");
|
|
1173
|
-
},
|
|
1174
|
+
}, 6e3);
|
|
1174
1175
|
const cleanup = () => {
|
|
1175
1176
|
clearTimeout(timeout);
|
|
1176
1177
|
clearTimeout(timeout2);
|
|
@@ -1185,7 +1186,8 @@ const introspection = async (args) => {
|
|
|
1185
1186
|
};
|
|
1186
1187
|
child.on("error", (err) => {
|
|
1187
1188
|
cleanup();
|
|
1188
|
-
|
|
1189
|
+
introspectionError = `Loader error: ${err.message}`;
|
|
1190
|
+
debug(introspectionError);
|
|
1189
1191
|
if (!streamClosed) writeStream.end(() => {
|
|
1190
1192
|
streamClosed = true;
|
|
1191
1193
|
try {
|
|
@@ -1216,8 +1218,12 @@ const introspection = async (args) => {
|
|
|
1216
1218
|
introspectionData = introspectionSchema.parse(JSON.parse(introspectionString));
|
|
1217
1219
|
debug("Introspection data parsed successfully");
|
|
1218
1220
|
}
|
|
1219
|
-
} else
|
|
1221
|
+
} else {
|
|
1222
|
+
introspectionError = `Introspection markers not found. stderr: ${stderrBuffer}`;
|
|
1223
|
+
debug(`Introspection markers not found.\nstdout:\n${stdoutBuffer}\nstderr:\n${stderrBuffer}`);
|
|
1224
|
+
}
|
|
1220
1225
|
} catch (error) {
|
|
1226
|
+
introspectionError = `Error parsing introspection data: ${error}. stderr: ${stderrBuffer}`;
|
|
1221
1227
|
debug(`Error parsing introspection data: ${error}\nstdout:\n${stdoutBuffer}\nstderr:\n${stderrBuffer}`);
|
|
1222
1228
|
} finally {
|
|
1223
1229
|
try {
|
|
@@ -1234,6 +1240,7 @@ const introspection = async (args) => {
|
|
|
1234
1240
|
else resolvePromise();
|
|
1235
1241
|
});
|
|
1236
1242
|
} catch (error) {
|
|
1243
|
+
introspectionError = `Introspection error: ${error}`;
|
|
1237
1244
|
debug("Introspection error", error);
|
|
1238
1245
|
resolvePromise();
|
|
1239
1246
|
}
|
|
@@ -1241,7 +1248,8 @@ const introspection = async (args) => {
|
|
|
1241
1248
|
if (!introspectionData) {
|
|
1242
1249
|
introspectionSpan.setAttributes({
|
|
1243
1250
|
"introspection.success": "false",
|
|
1244
|
-
"introspection.routes": "0"
|
|
1251
|
+
"introspection.routes": "0",
|
|
1252
|
+
...introspectionError && { "introspection.error": introspectionError.slice(0, 1024) }
|
|
1245
1253
|
});
|
|
1246
1254
|
return defaultResult$1;
|
|
1247
1255
|
}
|
|
@@ -1603,11 +1611,15 @@ const build = async (args) => {
|
|
|
1603
1611
|
...args,
|
|
1604
1612
|
span: buildSpan
|
|
1605
1613
|
});
|
|
1606
|
-
const introspectionPromise = introspection({
|
|
1614
|
+
const introspectionPromise = rolldownResult.framework.slug === "hono" ? introspection({
|
|
1607
1615
|
...args,
|
|
1608
1616
|
span: buildSpan,
|
|
1609
1617
|
files: rolldownResult.files,
|
|
1610
1618
|
handler: rolldownResult.handler
|
|
1619
|
+
}) : Promise.resolve({
|
|
1620
|
+
routes: [],
|
|
1621
|
+
additionalFolders: [],
|
|
1622
|
+
additionalDeps: []
|
|
1611
1623
|
});
|
|
1612
1624
|
const typescriptPromise = typescript({
|
|
1613
1625
|
entrypoint,
|
package/dist/rolldown/index.mjs
CHANGED
|
@@ -331,7 +331,7 @@ module.exports = requireFromContext('${pkgName}');
|
|
|
331
331
|
ignore: args.config.excludeFiles
|
|
332
332
|
});
|
|
333
333
|
if (!handler) throw new Error(`Unable to resolve build handler for entrypoint: ${args.entrypoint}`);
|
|
334
|
-
console.log(Colors.gray(`${Colors.bold(Colors.cyan("✓"))} Build complete
|
|
334
|
+
console.log(Colors.gray(`${Colors.bold(Colors.cyan("✓"))} Build complete — Using ${Colors.bold(args.entrypoint)} as the root entrypoint.`));
|
|
335
335
|
return {
|
|
336
336
|
files,
|
|
337
337
|
handler,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/backends",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.60",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "./dist/index.mjs",
|
|
6
6
|
"homepage": "https://vercel.com/docs",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"srvx": "0.8.9",
|
|
35
35
|
"tsx": "4.21.0",
|
|
36
36
|
"zod": "3.22.4",
|
|
37
|
-
"@vercel/build-utils": "13.
|
|
37
|
+
"@vercel/build-utils": "13.15.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"typescript": "^4.0.0 || ^5.0.0"
|