@vercel/node 3.0.14 → 3.0.15
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/dev-server.mjs +51 -10
- package/dist/index.js +289 -7
- package/package.json +4 -4
package/dist/dev-server.mjs
CHANGED
@@ -588,7 +588,6 @@ async function serializeBody(request) {
|
|
588
588
|
|
589
589
|
// src/edge-functions/edge-handler.mts
|
590
590
|
import esbuild from "esbuild";
|
591
|
-
import exitHook from "exit-hook";
|
592
591
|
import { buildToHeaders } from "@edge-runtime/node-utils";
|
593
592
|
import { fileURLToPath } from "url";
|
594
593
|
var NODE_VERSION_MAJOR = process.version.match(/^v(\d+)\.\d+/)?.[1];
|
@@ -707,8 +706,22 @@ async function createEdgeRuntimeServer(params) {
|
|
707
706
|
}
|
708
707
|
});
|
709
708
|
const server = await runServer({ runtime });
|
710
|
-
|
711
|
-
|
709
|
+
const onExit2 = async () => {
|
710
|
+
const WAIT_UNTIL_TIMEOUT = 10 * 1e3;
|
711
|
+
const waitUntil = server.close();
|
712
|
+
return new Promise((resolve, reject) => {
|
713
|
+
const timeout = setTimeout(() => {
|
714
|
+
console.warn(
|
715
|
+
`Edge Runtime server is still running after ${WAIT_UNTIL_TIMEOUT} ms (hint: do you have a long-running waitUntil() promise?)`
|
716
|
+
);
|
717
|
+
resolve();
|
718
|
+
}, WAIT_UNTIL_TIMEOUT);
|
719
|
+
waitUntil.then(() => resolve()).catch(reject).finally(() => {
|
720
|
+
clearTimeout(timeout);
|
721
|
+
});
|
722
|
+
});
|
723
|
+
};
|
724
|
+
return { server, onExit: onExit2 };
|
712
725
|
} catch (error) {
|
713
726
|
console.error("Failed to instantiate edge runtime.");
|
714
727
|
logError(error);
|
@@ -721,8 +734,10 @@ async function createEdgeEventHandler(entrypointFullPath, entrypointRelativePath
|
|
721
734
|
entrypointRelativePath,
|
722
735
|
isMiddleware
|
723
736
|
);
|
724
|
-
const
|
725
|
-
|
737
|
+
const result = await createEdgeRuntimeServer(userCode);
|
738
|
+
const server = result?.server;
|
739
|
+
const onExit2 = result?.onExit;
|
740
|
+
const handler = async function(request) {
|
726
741
|
if (!server) {
|
727
742
|
process.exit(1);
|
728
743
|
}
|
@@ -757,6 +772,10 @@ ${fakeStackTrace}`
|
|
757
772
|
encoding: "utf8"
|
758
773
|
};
|
759
774
|
};
|
775
|
+
return {
|
776
|
+
handler,
|
777
|
+
onExit: onExit2
|
778
|
+
};
|
760
779
|
}
|
761
780
|
function entrypointToRequestPath(entrypointRelativePath, isZeroConfig) {
|
762
781
|
return "/" + entrypointToOutputPath(entrypointRelativePath, isZeroConfig);
|
@@ -972,7 +991,6 @@ async function addHelpers(_req, _res) {
|
|
972
991
|
|
973
992
|
// src/serverless-functions/serverless-handler.mts
|
974
993
|
import { createServer } from "http";
|
975
|
-
import exitHook2 from "exit-hook";
|
976
994
|
import { Headers as Headers3, request as undiciRequest2 } from "undici";
|
977
995
|
import { listen } from "async-listen";
|
978
996
|
import { isAbsolute } from "path";
|
@@ -991,8 +1009,12 @@ var HTTP_METHODS = [
|
|
991
1009
|
];
|
992
1010
|
async function createServerlessServer(userCode) {
|
993
1011
|
const server = createServer(userCode);
|
994
|
-
|
995
|
-
|
1012
|
+
return {
|
1013
|
+
url: await listen(server),
|
1014
|
+
onExit: async () => {
|
1015
|
+
server.close();
|
1016
|
+
}
|
1017
|
+
};
|
996
1018
|
}
|
997
1019
|
async function compileUserCode2(entrypointPath, options) {
|
998
1020
|
const id = isAbsolute(entrypointPath) ? pathToFileURL(entrypointPath).href : entrypointPath;
|
@@ -1020,7 +1042,7 @@ async function createServerlessEventHandler(entrypointPath, options) {
|
|
1020
1042
|
const userCode = await compileUserCode2(entrypointPath, options);
|
1021
1043
|
const server = await createServerlessServer(userCode);
|
1022
1044
|
const isStreaming = options.mode === "streaming";
|
1023
|
-
|
1045
|
+
const handler = async function(request) {
|
1024
1046
|
const url = new URL(request.url ?? "/", server.url);
|
1025
1047
|
const response = await undiciRequest2(url, {
|
1026
1048
|
body: await serializeBody(request),
|
@@ -1044,6 +1066,10 @@ async function createServerlessEventHandler(entrypointPath, options) {
|
|
1044
1066
|
encoding: "utf8"
|
1045
1067
|
};
|
1046
1068
|
};
|
1069
|
+
return {
|
1070
|
+
handler,
|
1071
|
+
onExit: server.onExit
|
1072
|
+
};
|
1047
1073
|
}
|
1048
1074
|
|
1049
1075
|
// src/dev-server.mts
|
@@ -1076,6 +1102,7 @@ async function createEventHandler(entrypoint2, config, options) {
|
|
1076
1102
|
}
|
1077
1103
|
var handleEvent;
|
1078
1104
|
var handlerEventError;
|
1105
|
+
var onExit;
|
1079
1106
|
async function main() {
|
1080
1107
|
const config = JSON.parse(process.env.VERCEL_DEV_CONFIG || "{}");
|
1081
1108
|
delete process.env.VERCEL_DEV_CONFIG;
|
@@ -1085,9 +1112,11 @@ async function main() {
|
|
1085
1112
|
const proxyServer = createServer2(onDevRequest);
|
1086
1113
|
await listen2(proxyServer, { host: "127.0.0.1", port: 0 });
|
1087
1114
|
try {
|
1088
|
-
|
1115
|
+
const result = await createEventHandler(entrypoint, config, {
|
1089
1116
|
shouldAddHelpers
|
1090
1117
|
});
|
1118
|
+
handleEvent = result.handler;
|
1119
|
+
onExit = result.onExit;
|
1091
1120
|
} catch (error) {
|
1092
1121
|
logError(error);
|
1093
1122
|
handlerEventError = error;
|
@@ -1134,6 +1163,18 @@ main().catch((err) => {
|
|
1134
1163
|
logError(err);
|
1135
1164
|
process.exit(1);
|
1136
1165
|
});
|
1166
|
+
process.on("message", async (m) => {
|
1167
|
+
switch (m) {
|
1168
|
+
case "shutdown":
|
1169
|
+
if (onExit) {
|
1170
|
+
await onExit();
|
1171
|
+
}
|
1172
|
+
process.exit(0);
|
1173
|
+
default:
|
1174
|
+
console.error(`unknown IPC message from parent:`, m);
|
1175
|
+
break;
|
1176
|
+
}
|
1177
|
+
});
|
1137
1178
|
/*! Bundled license information:
|
1138
1179
|
|
1139
1180
|
content-type/index.js:
|
package/dist/index.js
CHANGED
@@ -78,6 +78,112 @@ var require_dist = __commonJS({
|
|
78
78
|
}
|
79
79
|
});
|
80
80
|
|
81
|
+
// ../../node_modules/.pnpm/tree-kill@1.2.2/node_modules/tree-kill/index.js
|
82
|
+
var require_tree_kill = __commonJS({
|
83
|
+
"../../node_modules/.pnpm/tree-kill@1.2.2/node_modules/tree-kill/index.js"(exports, module2) {
|
84
|
+
"use strict";
|
85
|
+
var childProcess = require("child_process");
|
86
|
+
var spawn2 = childProcess.spawn;
|
87
|
+
var exec = childProcess.exec;
|
88
|
+
module2.exports = function(pid, signal, callback) {
|
89
|
+
if (typeof signal === "function" && callback === void 0) {
|
90
|
+
callback = signal;
|
91
|
+
signal = void 0;
|
92
|
+
}
|
93
|
+
pid = parseInt(pid);
|
94
|
+
if (Number.isNaN(pid)) {
|
95
|
+
if (callback) {
|
96
|
+
return callback(new Error("pid must be a number"));
|
97
|
+
} else {
|
98
|
+
throw new Error("pid must be a number");
|
99
|
+
}
|
100
|
+
}
|
101
|
+
var tree = {};
|
102
|
+
var pidsToProcess = {};
|
103
|
+
tree[pid] = [];
|
104
|
+
pidsToProcess[pid] = 1;
|
105
|
+
switch (process.platform) {
|
106
|
+
case "win32":
|
107
|
+
exec("taskkill /pid " + pid + " /T /F", callback);
|
108
|
+
break;
|
109
|
+
case "darwin":
|
110
|
+
buildProcessTree(pid, tree, pidsToProcess, function(parentPid) {
|
111
|
+
return spawn2("pgrep", ["-P", parentPid]);
|
112
|
+
}, function() {
|
113
|
+
killAll(tree, signal, callback);
|
114
|
+
});
|
115
|
+
break;
|
116
|
+
default:
|
117
|
+
buildProcessTree(pid, tree, pidsToProcess, function(parentPid) {
|
118
|
+
return spawn2("ps", ["-o", "pid", "--no-headers", "--ppid", parentPid]);
|
119
|
+
}, function() {
|
120
|
+
killAll(tree, signal, callback);
|
121
|
+
});
|
122
|
+
break;
|
123
|
+
}
|
124
|
+
};
|
125
|
+
function killAll(tree, signal, callback) {
|
126
|
+
var killed = {};
|
127
|
+
try {
|
128
|
+
Object.keys(tree).forEach(function(pid) {
|
129
|
+
tree[pid].forEach(function(pidpid) {
|
130
|
+
if (!killed[pidpid]) {
|
131
|
+
killPid(pidpid, signal);
|
132
|
+
killed[pidpid] = 1;
|
133
|
+
}
|
134
|
+
});
|
135
|
+
if (!killed[pid]) {
|
136
|
+
killPid(pid, signal);
|
137
|
+
killed[pid] = 1;
|
138
|
+
}
|
139
|
+
});
|
140
|
+
} catch (err) {
|
141
|
+
if (callback) {
|
142
|
+
return callback(err);
|
143
|
+
} else {
|
144
|
+
throw err;
|
145
|
+
}
|
146
|
+
}
|
147
|
+
if (callback) {
|
148
|
+
return callback();
|
149
|
+
}
|
150
|
+
}
|
151
|
+
function killPid(pid, signal) {
|
152
|
+
try {
|
153
|
+
process.kill(parseInt(pid, 10), signal);
|
154
|
+
} catch (err) {
|
155
|
+
if (err.code !== "ESRCH")
|
156
|
+
throw err;
|
157
|
+
}
|
158
|
+
}
|
159
|
+
function buildProcessTree(parentPid, tree, pidsToProcess, spawnChildProcessesList, cb) {
|
160
|
+
var ps = spawnChildProcessesList(parentPid);
|
161
|
+
var allData = "";
|
162
|
+
ps.stdout.on("data", function(data) {
|
163
|
+
var data = data.toString("ascii");
|
164
|
+
allData += data;
|
165
|
+
});
|
166
|
+
var onClose = function(code) {
|
167
|
+
delete pidsToProcess[parentPid];
|
168
|
+
if (code != 0) {
|
169
|
+
if (Object.keys(pidsToProcess).length == 0) {
|
170
|
+
cb();
|
171
|
+
}
|
172
|
+
return;
|
173
|
+
}
|
174
|
+
allData.match(/\d+/g).forEach(function(pid) {
|
175
|
+
pid = parseInt(pid, 10);
|
176
|
+
tree[parentPid].push(pid);
|
177
|
+
tree[pid] = [];
|
178
|
+
pidsToProcess[pid] = 1;
|
179
|
+
buildProcessTree(pid, tree, pidsToProcess, spawnChildProcessesList, cb);
|
180
|
+
});
|
181
|
+
};
|
182
|
+
ps.on("close", onClose);
|
183
|
+
}
|
184
|
+
}
|
185
|
+
});
|
186
|
+
|
81
187
|
// ../../node_modules/.pnpm/@babel+traverse@7.23.2/node_modules/@babel/traverse/lib/path/lib/virtual-types.js
|
82
188
|
var require_virtual_types = __commonJS({
|
83
189
|
"../../node_modules/.pnpm/@babel+traverse@7.23.2/node_modules/@babel/traverse/lib/path/lib/virtual-types.js"(exports) {
|
@@ -19065,9 +19171,175 @@ var require_sourcemap_codec_umd = __commonJS({
|
|
19065
19171
|
}
|
19066
19172
|
});
|
19067
19173
|
|
19068
|
-
// ../../node_modules/.pnpm/@jridgewell+
|
19174
|
+
// ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.4.14/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js
|
19175
|
+
var require_sourcemap_codec_umd2 = __commonJS({
|
19176
|
+
"../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.4.14/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js"(exports, module2) {
|
19177
|
+
(function(global2, factory) {
|
19178
|
+
typeof exports === "object" && typeof module2 !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.sourcemapCodec = {}));
|
19179
|
+
})(exports, function(exports2) {
|
19180
|
+
"use strict";
|
19181
|
+
const comma = ",".charCodeAt(0);
|
19182
|
+
const semicolon = ";".charCodeAt(0);
|
19183
|
+
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
19184
|
+
const intToChar = new Uint8Array(64);
|
19185
|
+
const charToInt = new Uint8Array(128);
|
19186
|
+
for (let i = 0; i < chars.length; i++) {
|
19187
|
+
const c = chars.charCodeAt(i);
|
19188
|
+
intToChar[i] = c;
|
19189
|
+
charToInt[c] = i;
|
19190
|
+
}
|
19191
|
+
const td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? {
|
19192
|
+
decode(buf) {
|
19193
|
+
const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
|
19194
|
+
return out.toString();
|
19195
|
+
}
|
19196
|
+
} : {
|
19197
|
+
decode(buf) {
|
19198
|
+
let out = "";
|
19199
|
+
for (let i = 0; i < buf.length; i++) {
|
19200
|
+
out += String.fromCharCode(buf[i]);
|
19201
|
+
}
|
19202
|
+
return out;
|
19203
|
+
}
|
19204
|
+
};
|
19205
|
+
function decode(mappings) {
|
19206
|
+
const state = new Int32Array(5);
|
19207
|
+
const decoded = [];
|
19208
|
+
let index = 0;
|
19209
|
+
do {
|
19210
|
+
const semi = indexOf(mappings, index);
|
19211
|
+
const line = [];
|
19212
|
+
let sorted = true;
|
19213
|
+
let lastCol = 0;
|
19214
|
+
state[0] = 0;
|
19215
|
+
for (let i = index; i < semi; i++) {
|
19216
|
+
let seg;
|
19217
|
+
i = decodeInteger(mappings, i, state, 0);
|
19218
|
+
const col = state[0];
|
19219
|
+
if (col < lastCol)
|
19220
|
+
sorted = false;
|
19221
|
+
lastCol = col;
|
19222
|
+
if (hasMoreVlq(mappings, i, semi)) {
|
19223
|
+
i = decodeInteger(mappings, i, state, 1);
|
19224
|
+
i = decodeInteger(mappings, i, state, 2);
|
19225
|
+
i = decodeInteger(mappings, i, state, 3);
|
19226
|
+
if (hasMoreVlq(mappings, i, semi)) {
|
19227
|
+
i = decodeInteger(mappings, i, state, 4);
|
19228
|
+
seg = [col, state[1], state[2], state[3], state[4]];
|
19229
|
+
} else {
|
19230
|
+
seg = [col, state[1], state[2], state[3]];
|
19231
|
+
}
|
19232
|
+
} else {
|
19233
|
+
seg = [col];
|
19234
|
+
}
|
19235
|
+
line.push(seg);
|
19236
|
+
}
|
19237
|
+
if (!sorted)
|
19238
|
+
sort(line);
|
19239
|
+
decoded.push(line);
|
19240
|
+
index = semi + 1;
|
19241
|
+
} while (index <= mappings.length);
|
19242
|
+
return decoded;
|
19243
|
+
}
|
19244
|
+
function indexOf(mappings, index) {
|
19245
|
+
const idx = mappings.indexOf(";", index);
|
19246
|
+
return idx === -1 ? mappings.length : idx;
|
19247
|
+
}
|
19248
|
+
function decodeInteger(mappings, pos, state, j) {
|
19249
|
+
let value2 = 0;
|
19250
|
+
let shift = 0;
|
19251
|
+
let integer = 0;
|
19252
|
+
do {
|
19253
|
+
const c = mappings.charCodeAt(pos++);
|
19254
|
+
integer = charToInt[c];
|
19255
|
+
value2 |= (integer & 31) << shift;
|
19256
|
+
shift += 5;
|
19257
|
+
} while (integer & 32);
|
19258
|
+
const shouldNegate = value2 & 1;
|
19259
|
+
value2 >>>= 1;
|
19260
|
+
if (shouldNegate) {
|
19261
|
+
value2 = -2147483648 | -value2;
|
19262
|
+
}
|
19263
|
+
state[j] += value2;
|
19264
|
+
return pos;
|
19265
|
+
}
|
19266
|
+
function hasMoreVlq(mappings, i, length) {
|
19267
|
+
if (i >= length)
|
19268
|
+
return false;
|
19269
|
+
return mappings.charCodeAt(i) !== comma;
|
19270
|
+
}
|
19271
|
+
function sort(line) {
|
19272
|
+
line.sort(sortComparator);
|
19273
|
+
}
|
19274
|
+
function sortComparator(a, b) {
|
19275
|
+
return a[0] - b[0];
|
19276
|
+
}
|
19277
|
+
function encode(decoded) {
|
19278
|
+
const state = new Int32Array(5);
|
19279
|
+
const bufLength = 1024 * 16;
|
19280
|
+
const subLength = bufLength - 36;
|
19281
|
+
const buf = new Uint8Array(bufLength);
|
19282
|
+
const sub = buf.subarray(0, subLength);
|
19283
|
+
let pos = 0;
|
19284
|
+
let out = "";
|
19285
|
+
for (let i = 0; i < decoded.length; i++) {
|
19286
|
+
const line = decoded[i];
|
19287
|
+
if (i > 0) {
|
19288
|
+
if (pos === bufLength) {
|
19289
|
+
out += td.decode(buf);
|
19290
|
+
pos = 0;
|
19291
|
+
}
|
19292
|
+
buf[pos++] = semicolon;
|
19293
|
+
}
|
19294
|
+
if (line.length === 0)
|
19295
|
+
continue;
|
19296
|
+
state[0] = 0;
|
19297
|
+
for (let j = 0; j < line.length; j++) {
|
19298
|
+
const segment = line[j];
|
19299
|
+
if (pos > subLength) {
|
19300
|
+
out += td.decode(sub);
|
19301
|
+
buf.copyWithin(0, subLength, pos);
|
19302
|
+
pos -= subLength;
|
19303
|
+
}
|
19304
|
+
if (j > 0)
|
19305
|
+
buf[pos++] = comma;
|
19306
|
+
pos = encodeInteger(buf, pos, state, segment, 0);
|
19307
|
+
if (segment.length === 1)
|
19308
|
+
continue;
|
19309
|
+
pos = encodeInteger(buf, pos, state, segment, 1);
|
19310
|
+
pos = encodeInteger(buf, pos, state, segment, 2);
|
19311
|
+
pos = encodeInteger(buf, pos, state, segment, 3);
|
19312
|
+
if (segment.length === 4)
|
19313
|
+
continue;
|
19314
|
+
pos = encodeInteger(buf, pos, state, segment, 4);
|
19315
|
+
}
|
19316
|
+
}
|
19317
|
+
return out + td.decode(buf.subarray(0, pos));
|
19318
|
+
}
|
19319
|
+
function encodeInteger(buf, pos, state, segment, j) {
|
19320
|
+
const next = segment[j];
|
19321
|
+
let num = next - state[j];
|
19322
|
+
state[j] = next;
|
19323
|
+
num = num < 0 ? -num << 1 | 1 : num << 1;
|
19324
|
+
do {
|
19325
|
+
let clamped = num & 31;
|
19326
|
+
num >>>= 5;
|
19327
|
+
if (num > 0)
|
19328
|
+
clamped |= 32;
|
19329
|
+
buf[pos++] = intToChar[clamped];
|
19330
|
+
} while (num > 0);
|
19331
|
+
return pos;
|
19332
|
+
}
|
19333
|
+
exports2.decode = decode;
|
19334
|
+
exports2.encode = encode;
|
19335
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
19336
|
+
});
|
19337
|
+
}
|
19338
|
+
});
|
19339
|
+
|
19340
|
+
// ../../node_modules/.pnpm/@jridgewell+resolve-uri@3.1.0/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js
|
19069
19341
|
var require_resolve_uri_umd = __commonJS({
|
19070
|
-
"../../node_modules/.pnpm/@jridgewell+resolve-uri@3.1.
|
19342
|
+
"../../node_modules/.pnpm/@jridgewell+resolve-uri@3.1.0/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js"(exports, module2) {
|
19071
19343
|
(function(global2, factory) {
|
19072
19344
|
typeof exports === "object" && typeof module2 !== "undefined" ? module2.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, global2.resolveURI = factory());
|
19073
19345
|
})(exports, function() {
|
@@ -19248,11 +19520,11 @@ var require_resolve_uri_umd = __commonJS({
|
|
19248
19520
|
}
|
19249
19521
|
});
|
19250
19522
|
|
19251
|
-
// ../../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.
|
19523
|
+
// ../../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.18/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js
|
19252
19524
|
var require_trace_mapping_umd = __commonJS({
|
19253
|
-
"../../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.
|
19525
|
+
"../../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.18/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js"(exports, module2) {
|
19254
19526
|
(function(global2, factory) {
|
19255
|
-
typeof exports === "object" && typeof module2 !== "undefined" ? factory(exports,
|
19527
|
+
typeof exports === "object" && typeof module2 !== "undefined" ? factory(exports, require_sourcemap_codec_umd2(), require_resolve_uri_umd()) : typeof define === "function" && define.amd ? define(["exports", "@jridgewell/sourcemap-codec", "@jridgewell/resolve-uri"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.traceMapping = {}, global2.sourcemapCodec, global2.resolveURI));
|
19256
19528
|
})(exports, function(exports2, sourcemapCodec, resolveUri) {
|
19257
19529
|
"use strict";
|
19258
19530
|
function _interopDefaultLegacy(e) {
|
@@ -19506,7 +19778,7 @@ var require_trace_mapping_umd = __commonJS({
|
|
19506
19778
|
const { version: version2, file, names, sourceRoot, sources, sourcesContent } = parsed;
|
19507
19779
|
this.version = version2;
|
19508
19780
|
this.file = file;
|
19509
|
-
this.names = names
|
19781
|
+
this.names = names;
|
19510
19782
|
this.sourceRoot = sourceRoot;
|
19511
19783
|
this.sources = sources;
|
19512
19784
|
this.sourcesContent = sourcesContent;
|
@@ -104838,9 +105110,12 @@ async function readMessage(child) {
|
|
104838
105110
|
}
|
104839
105111
|
|
104840
105112
|
// src/index.ts
|
105113
|
+
var import_tree_kill = __toESM(require_tree_kill());
|
105114
|
+
var import_util = require("util");
|
104841
105115
|
var require_2 = (0, import_module2.createRequire)(__filename);
|
104842
105116
|
var tscPath = (0, import_path4.resolve)((0, import_path4.dirname)(require_2.resolve("typescript")), "../bin/tsc");
|
104843
105117
|
var libPathRegEx = /^node_modules|[\/\\]node_modules[\/\\]/;
|
105118
|
+
var treeKill = (0, import_util.promisify)(import_tree_kill.default);
|
104844
105119
|
async function downloadInstallAndBundle({
|
104845
105120
|
files,
|
104846
105121
|
entrypoint,
|
@@ -105268,7 +105543,14 @@ var startDevServer = async (opts) => {
|
|
105268
105543
|
console.error("Type check for %j failed:", entrypoint, err);
|
105269
105544
|
});
|
105270
105545
|
}
|
105271
|
-
|
105546
|
+
const shutdown = async () => {
|
105547
|
+
child.send("shutdown", async (err) => {
|
105548
|
+
if (err) {
|
105549
|
+
await treeKill(pid);
|
105550
|
+
}
|
105551
|
+
});
|
105552
|
+
};
|
105553
|
+
return { port: message.value.port, pid, shutdown };
|
105272
105554
|
} else {
|
105273
105555
|
const [exitCode, signal] = message.value;
|
105274
105556
|
const reason = signal ? `"${signal}" signal` : `exit code ${exitCode}`;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vercel/node",
|
3
|
-
"version": "3.0.
|
3
|
+
"version": "3.0.15",
|
4
4
|
"license": "Apache-2.0",
|
5
5
|
"main": "./dist/index",
|
6
6
|
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/node-js",
|
@@ -19,13 +19,12 @@
|
|
19
19
|
"@types/node": "14.18.33",
|
20
20
|
"@vercel/build-utils": "7.4.1",
|
21
21
|
"@vercel/error-utils": "2.0.2",
|
22
|
-
"@vercel/nft": "0.
|
22
|
+
"@vercel/nft": "0.26.2",
|
23
23
|
"@vercel/static-config": "3.0.0",
|
24
24
|
"async-listen": "3.0.0",
|
25
25
|
"edge-runtime": "2.5.7",
|
26
26
|
"esbuild": "0.14.47",
|
27
27
|
"etag": "1.8.1",
|
28
|
-
"exit-hook": "2.2.1",
|
29
28
|
"node-fetch": "2.6.9",
|
30
29
|
"path-to-regexp": "6.2.1",
|
31
30
|
"ts-morph": "12.0.0",
|
@@ -48,7 +47,8 @@
|
|
48
47
|
"execa": "3.2.0",
|
49
48
|
"fs-extra": "11.1.0",
|
50
49
|
"jest-junit": "16.0.0",
|
51
|
-
"source-map-support": "0.5.12"
|
50
|
+
"source-map-support": "0.5.12",
|
51
|
+
"tree-kill": "1.2.2"
|
52
52
|
},
|
53
53
|
"scripts": {
|
54
54
|
"build": "node build.mjs",
|