@vercel/node 5.7.16 → 5.8.0
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.js +94 -62
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -98998,8 +98998,9 @@ var src_exports = {};
|
|
|
98998
98998
|
__export(src_exports, {
|
|
98999
98999
|
_resetBundlingRoutesEmitted: () => _resetBundlingRoutesEmitted,
|
|
99000
99000
|
build: () => build,
|
|
99001
|
+
diagnostics: () => diagnostics,
|
|
99001
99002
|
prepareCache: () => prepareCache,
|
|
99002
|
-
shouldServe: () =>
|
|
99003
|
+
shouldServe: () => import_build_utils10.shouldServe,
|
|
99003
99004
|
startDevServer: () => startDevServer,
|
|
99004
99005
|
version: () => version
|
|
99005
99006
|
});
|
|
@@ -99013,7 +99014,7 @@ var import_path3 = require("path");
|
|
|
99013
99014
|
var import_ts_morph = require("ts-morph");
|
|
99014
99015
|
var import_nft = require("@vercel/nft");
|
|
99015
99016
|
var import_resolve_dependency = __toESM(require("@vercel/nft/out/resolve-dependency"));
|
|
99016
|
-
var
|
|
99017
|
+
var import_build_utils5 = require("@vercel/build-utils");
|
|
99017
99018
|
var import_static_config = require("@vercel/static-config");
|
|
99018
99019
|
|
|
99019
99020
|
// src/typescript.ts
|
|
@@ -99106,11 +99107,11 @@ function register(opts = {}) {
|
|
|
99106
99107
|
getCurrentDirectory: () => cwd,
|
|
99107
99108
|
getCanonicalFileName: (path) => path
|
|
99108
99109
|
};
|
|
99109
|
-
function reportTSError(
|
|
99110
|
-
if (!
|
|
99110
|
+
function reportTSError(diagnostics2, shouldExit) {
|
|
99111
|
+
if (!diagnostics2 || diagnostics2.length === 0) {
|
|
99111
99112
|
return;
|
|
99112
99113
|
}
|
|
99113
|
-
const message = formatDiagnostics(
|
|
99114
|
+
const message = formatDiagnostics(diagnostics2, diagnosticHost);
|
|
99114
99115
|
if (shouldExit) {
|
|
99115
99116
|
throw new import_build_utils.NowBuildError({ code: "NODE_TYPESCRIPT_ERROR", message });
|
|
99116
99117
|
} else {
|
|
@@ -99213,8 +99214,8 @@ function register(opts = {}) {
|
|
|
99213
99214
|
}
|
|
99214
99215
|
updateMemoryCache(code, fileName);
|
|
99215
99216
|
const output = service.getEmitOutput(fileName);
|
|
99216
|
-
const
|
|
99217
|
-
const diagnosticList = filterDiagnostics(
|
|
99217
|
+
const diagnostics2 = service.getSemanticDiagnostics(fileName).concat(service.getSyntacticDiagnostics(fileName));
|
|
99218
|
+
const diagnosticList = filterDiagnostics(diagnostics2, ignoreDiagnostics);
|
|
99218
99219
|
if (process.env.EXPERIMENTAL_NODE_TYPESCRIPT_ERRORS) {
|
|
99219
99220
|
reportTSError(diagnosticList, true);
|
|
99220
99221
|
} else {
|
|
@@ -99342,12 +99343,17 @@ function fixConfig(config, nodeVersionMajor = 12) {
|
|
|
99342
99343
|
}
|
|
99343
99344
|
return config;
|
|
99344
99345
|
}
|
|
99345
|
-
function filterDiagnostics(
|
|
99346
|
-
return
|
|
99346
|
+
function filterDiagnostics(diagnostics2, ignore) {
|
|
99347
|
+
return diagnostics2.filter((x) => ignore.indexOf(x.code) === -1);
|
|
99347
99348
|
}
|
|
99348
99349
|
|
|
99349
|
-
// src/
|
|
99350
|
+
// src/diagnostics.ts
|
|
99350
99351
|
var import_build_utils2 = require("@vercel/build-utils");
|
|
99352
|
+
var import_build_utils3 = require("@vercel/build-utils");
|
|
99353
|
+
var diagnostics = (0, import_build_utils2.createDiagnostics)("node");
|
|
99354
|
+
|
|
99355
|
+
// src/utils.ts
|
|
99356
|
+
var import_build_utils4 = require("@vercel/build-utils");
|
|
99351
99357
|
var import_path2 = require("path");
|
|
99352
99358
|
var import_path_to_regexp = require("path-to-regexp");
|
|
99353
99359
|
var import_path_to_regexp_updated = require("path-to-regexp-updated");
|
|
@@ -99462,9 +99468,9 @@ async function downloadInstallAndBundle({
|
|
|
99462
99468
|
meta,
|
|
99463
99469
|
considerBuildCommand
|
|
99464
99470
|
}) {
|
|
99465
|
-
const downloadedFiles = await (0,
|
|
99471
|
+
const downloadedFiles = await (0, import_build_utils5.download)(files, workPath, meta);
|
|
99466
99472
|
const entrypointFsDirname = (0, import_path3.join)(workPath, (0, import_path3.dirname)(entrypoint));
|
|
99467
|
-
const nodeVersion = await (0,
|
|
99473
|
+
const nodeVersion = await (0, import_build_utils5.getNodeVersion)(
|
|
99468
99474
|
entrypointFsDirname,
|
|
99469
99475
|
void 0,
|
|
99470
99476
|
config,
|
|
@@ -99472,11 +99478,12 @@ async function downloadInstallAndBundle({
|
|
|
99472
99478
|
);
|
|
99473
99479
|
const {
|
|
99474
99480
|
cliType,
|
|
99481
|
+
lockfilePath,
|
|
99475
99482
|
lockfileVersion,
|
|
99476
99483
|
packageJsonPackageManager,
|
|
99477
99484
|
turboSupportsCorepackHome
|
|
99478
|
-
} = await (0,
|
|
99479
|
-
const spawnEnv = (0,
|
|
99485
|
+
} = await (0, import_build_utils5.scanParentDirs)(entrypointFsDirname, true);
|
|
99486
|
+
const spawnEnv = (0, import_build_utils5.getEnvForPackageManager)({
|
|
99480
99487
|
cliType,
|
|
99481
99488
|
lockfileVersion,
|
|
99482
99489
|
packageJsonPackageManager,
|
|
@@ -99488,7 +99495,7 @@ async function downloadInstallAndBundle({
|
|
|
99488
99495
|
if (typeof installCommand === "string" && considerBuildCommand) {
|
|
99489
99496
|
if (installCommand.trim()) {
|
|
99490
99497
|
console.log(`Running "install" command: \`${installCommand}\`...`);
|
|
99491
|
-
await (0,
|
|
99498
|
+
await (0, import_build_utils5.execCommand)(installCommand, {
|
|
99492
99499
|
env: spawnEnv,
|
|
99493
99500
|
cwd: entrypointFsDirname
|
|
99494
99501
|
});
|
|
@@ -99496,7 +99503,7 @@ async function downloadInstallAndBundle({
|
|
|
99496
99503
|
console.log(`Skipping "install" command...`);
|
|
99497
99504
|
}
|
|
99498
99505
|
} else {
|
|
99499
|
-
await (0,
|
|
99506
|
+
await (0, import_build_utils5.runNpmInstall)(
|
|
99500
99507
|
entrypointFsDirname,
|
|
99501
99508
|
[],
|
|
99502
99509
|
{ env: spawnEnv },
|
|
@@ -99505,7 +99512,15 @@ async function downloadInstallAndBundle({
|
|
|
99505
99512
|
);
|
|
99506
99513
|
}
|
|
99507
99514
|
const entrypointPath = downloadedFiles[entrypoint].fsPath;
|
|
99508
|
-
return {
|
|
99515
|
+
return {
|
|
99516
|
+
entrypointPath,
|
|
99517
|
+
entrypointFsDirname,
|
|
99518
|
+
nodeVersion,
|
|
99519
|
+
spawnEnv,
|
|
99520
|
+
cliType,
|
|
99521
|
+
lockfilePath,
|
|
99522
|
+
lockfileVersion
|
|
99523
|
+
};
|
|
99509
99524
|
}
|
|
99510
99525
|
function renameTStoJS(path) {
|
|
99511
99526
|
if (path.endsWith(".ts")) {
|
|
@@ -99533,7 +99548,7 @@ async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVer
|
|
|
99533
99548
|
if (config.includeFiles) {
|
|
99534
99549
|
const includeFiles = typeof config.includeFiles === "string" ? [config.includeFiles] : config.includeFiles;
|
|
99535
99550
|
for (const pattern of includeFiles) {
|
|
99536
|
-
const files = await (0,
|
|
99551
|
+
const files = await (0, import_build_utils5.glob)(pattern, workPath);
|
|
99537
99552
|
await Promise.all(
|
|
99538
99553
|
Object.values(files).map(async (entry) => {
|
|
99539
99554
|
const { fsPath } = entry;
|
|
@@ -99560,14 +99575,14 @@ async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVer
|
|
|
99560
99575
|
}
|
|
99561
99576
|
const { code, map } = tsCompile(source, path);
|
|
99562
99577
|
tsCompiled.add(relPath);
|
|
99563
|
-
preparedFiles[renameTStoJS(relPath) + ".map"] = new
|
|
99578
|
+
preparedFiles[renameTStoJS(relPath) + ".map"] = new import_build_utils5.FileBlob({
|
|
99564
99579
|
data: JSON.stringify(map)
|
|
99565
99580
|
});
|
|
99566
99581
|
source = code;
|
|
99567
99582
|
shouldAddSourcemapSupport = true;
|
|
99568
99583
|
return source;
|
|
99569
99584
|
}
|
|
99570
|
-
const isBun = (0,
|
|
99585
|
+
const isBun = (0, import_build_utils5.isBunVersion)(nodeVersion);
|
|
99571
99586
|
const conditions = isEdgeFunction ? ["edge-light", "browser", "module", "import", "require"] : isBun ? ["bun"] : void 0;
|
|
99572
99587
|
const { fileList, esmFileList, warnings } = await (0, import_nft.nodeFileTrace)(
|
|
99573
99588
|
[...inputFiles],
|
|
@@ -99596,18 +99611,18 @@ async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVer
|
|
|
99596
99611
|
let entry;
|
|
99597
99612
|
let source = (0, import_fs.readFileSync)(fsPath);
|
|
99598
99613
|
const { mode } = (0, import_fs.lstatSync)(fsPath);
|
|
99599
|
-
if ((0,
|
|
99600
|
-
entry = new
|
|
99614
|
+
if ((0, import_build_utils5.isSymbolicLink)(mode)) {
|
|
99615
|
+
entry = new import_build_utils5.FileFsRef({ fsPath, mode });
|
|
99601
99616
|
}
|
|
99602
99617
|
if (isEdgeFunction && (0, import_path3.basename)(fsPath) === "package.json") {
|
|
99603
99618
|
const pkgJson = JSON.parse(source.toString());
|
|
99604
99619
|
for (const prop of ["browser", "module"]) {
|
|
99605
99620
|
const val = pkgJson[prop];
|
|
99606
99621
|
if (typeof val === "string") {
|
|
99607
|
-
(0,
|
|
99622
|
+
(0, import_build_utils5.debug)(`Using "${prop}" field in ${fsPath}`);
|
|
99608
99623
|
pkgJson.main = val;
|
|
99609
99624
|
if (!entry) {
|
|
99610
|
-
entry = new
|
|
99625
|
+
entry = new import_build_utils5.FileBlob({ data: source, mode });
|
|
99611
99626
|
}
|
|
99612
99627
|
source = JSON.stringify(pkgJson);
|
|
99613
99628
|
break;
|
|
@@ -99618,7 +99633,7 @@ async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVer
|
|
|
99618
99633
|
source = compileTypeScript(fsPath, source.toString());
|
|
99619
99634
|
}
|
|
99620
99635
|
if (!entry) {
|
|
99621
|
-
entry = new
|
|
99636
|
+
entry = new import_build_utils5.FileBlob({ data: source, mode });
|
|
99622
99637
|
}
|
|
99623
99638
|
fsCache.set(relPath, entry);
|
|
99624
99639
|
sourceCache.set(relPath, source);
|
|
@@ -99634,21 +99649,21 @@ async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVer
|
|
|
99634
99649
|
}
|
|
99635
99650
|
);
|
|
99636
99651
|
for (const warning of warnings) {
|
|
99637
|
-
(0,
|
|
99652
|
+
(0, import_build_utils5.debug)(`Warning from trace: ${warning.message}`);
|
|
99638
99653
|
}
|
|
99639
99654
|
for (const path of fileList) {
|
|
99640
99655
|
let entry = fsCache.get(path);
|
|
99641
99656
|
if (!entry) {
|
|
99642
99657
|
const fsPath = (0, import_path3.resolve)(baseDir, path);
|
|
99643
99658
|
const { mode } = (0, import_fs.lstatSync)(fsPath);
|
|
99644
|
-
if ((0,
|
|
99645
|
-
entry = new
|
|
99659
|
+
if ((0, import_build_utils5.isSymbolicLink)(mode)) {
|
|
99660
|
+
entry = new import_build_utils5.FileFsRef({ fsPath, mode });
|
|
99646
99661
|
} else {
|
|
99647
99662
|
const source = (0, import_fs.readFileSync)(fsPath);
|
|
99648
|
-
entry = new
|
|
99663
|
+
entry = new import_build_utils5.FileBlob({ data: source, mode });
|
|
99649
99664
|
}
|
|
99650
99665
|
}
|
|
99651
|
-
if ((0,
|
|
99666
|
+
if ((0, import_build_utils5.isSymbolicLink)(entry.mode) && entry.type === "FileFsRef") {
|
|
99652
99667
|
const symlinkTarget = (0, import_path3.relative)(
|
|
99653
99668
|
baseDir,
|
|
99654
99669
|
(0, import_path3.resolve)((0, import_path3.dirname)(entry.fsPath), (0, import_fs.readlinkSync)(entry.fsPath))
|
|
@@ -99675,7 +99690,7 @@ async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVer
|
|
|
99675
99690
|
for (const path of esmPaths) {
|
|
99676
99691
|
const pathDir = (0, import_path3.join)(workPath, (0, import_path3.dirname)(path));
|
|
99677
99692
|
if (!pkgCache.has(pathDir)) {
|
|
99678
|
-
const pathToPkg = await (0,
|
|
99693
|
+
const pathToPkg = await (0, import_build_utils5.walkParentDirs)({
|
|
99679
99694
|
base: workPath,
|
|
99680
99695
|
start: pathDir,
|
|
99681
99696
|
filename: "package.json"
|
|
@@ -99688,7 +99703,7 @@ async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVer
|
|
|
99688
99703
|
continue;
|
|
99689
99704
|
}
|
|
99690
99705
|
const filename = (0, import_path3.basename)(path);
|
|
99691
|
-
const { data: source } = await
|
|
99706
|
+
const { data: source } = await import_build_utils5.FileBlob.fromStream({
|
|
99692
99707
|
stream: preparedFiles[path].toStream()
|
|
99693
99708
|
});
|
|
99694
99709
|
if (!meta.compiledToCommonJS) {
|
|
@@ -99700,12 +99715,12 @@ async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVer
|
|
|
99700
99715
|
console.log(`Compiling "${filename}" from ESM to CommonJS...`);
|
|
99701
99716
|
const { code, map } = babelCompile(filename, String(source));
|
|
99702
99717
|
shouldAddSourcemapSupport = true;
|
|
99703
|
-
preparedFiles[path] = new
|
|
99718
|
+
preparedFiles[path] = new import_build_utils5.FileBlob({
|
|
99704
99719
|
data: `${code}
|
|
99705
99720
|
//# sourceMappingURL=${filename}.map`
|
|
99706
99721
|
});
|
|
99707
99722
|
delete map.sourcesContent;
|
|
99708
|
-
preparedFiles[path + ".map"] = new
|
|
99723
|
+
preparedFiles[path + ".map"] = new import_build_utils5.FileBlob({
|
|
99709
99724
|
data: JSON.stringify(map)
|
|
99710
99725
|
});
|
|
99711
99726
|
}
|
|
@@ -99749,7 +99764,10 @@ var build = async ({
|
|
|
99749
99764
|
entrypointPath: _entrypointPath,
|
|
99750
99765
|
entrypointFsDirname,
|
|
99751
99766
|
nodeVersion,
|
|
99752
|
-
spawnEnv
|
|
99767
|
+
spawnEnv,
|
|
99768
|
+
cliType,
|
|
99769
|
+
lockfilePath,
|
|
99770
|
+
lockfileVersion
|
|
99753
99771
|
} = await downloadInstallAndBundle({
|
|
99754
99772
|
files,
|
|
99755
99773
|
entrypoint,
|
|
@@ -99761,7 +99779,7 @@ var build = async ({
|
|
|
99761
99779
|
let entrypointPath = _entrypointPath;
|
|
99762
99780
|
const projectBuildCommand = config.projectSettings?.buildCommand;
|
|
99763
99781
|
if (projectBuildCommand && considerBuildCommand) {
|
|
99764
|
-
await (0,
|
|
99782
|
+
await (0, import_build_utils5.execCommand)(projectBuildCommand, {
|
|
99765
99783
|
// Yarn v2 PnP mode may be activated, so force
|
|
99766
99784
|
// "node-modules" linker style
|
|
99767
99785
|
env: {
|
|
@@ -99772,7 +99790,7 @@ var build = async ({
|
|
|
99772
99790
|
});
|
|
99773
99791
|
} else {
|
|
99774
99792
|
const possibleScripts = considerBuildCommand ? ["vercel-build", "now-build", "build"] : ["vercel-build", "now-build"];
|
|
99775
|
-
await (0,
|
|
99793
|
+
await (0, import_build_utils5.runPackageJsonScript)(
|
|
99776
99794
|
entrypointFsDirname,
|
|
99777
99795
|
possibleScripts,
|
|
99778
99796
|
{ env: spawnEnv },
|
|
@@ -99806,9 +99824,9 @@ var build = async ({
|
|
|
99806
99824
|
}
|
|
99807
99825
|
checks({
|
|
99808
99826
|
config,
|
|
99809
|
-
isBun: (0,
|
|
99827
|
+
isBun: (0, import_build_utils5.isBunVersion)(nodeVersion)
|
|
99810
99828
|
});
|
|
99811
|
-
(0,
|
|
99829
|
+
(0, import_build_utils5.debug)("Tracing input files...");
|
|
99812
99830
|
const traceTime = Date.now();
|
|
99813
99831
|
const { preparedFiles, shouldAddSourcemapSupport } = await compile2(
|
|
99814
99832
|
workPath,
|
|
@@ -99819,7 +99837,7 @@ var build = async ({
|
|
|
99819
99837
|
nodeVersion,
|
|
99820
99838
|
isEdgeFunction
|
|
99821
99839
|
);
|
|
99822
|
-
(0,
|
|
99840
|
+
(0, import_build_utils5.debug)(`Trace complete [${Date.now() - traceTime}ms]`);
|
|
99823
99841
|
let routes;
|
|
99824
99842
|
let output;
|
|
99825
99843
|
let handler = renameTStoJS((0, import_path3.relative)(baseDir, entrypointPath));
|
|
@@ -99861,13 +99879,13 @@ var build = async ({
|
|
|
99861
99879
|
}
|
|
99862
99880
|
const filename = `shim${ext}`;
|
|
99863
99881
|
const shimHandler = handlerDir === "." ? filename : (0, import_path3.join)(handlerDir, filename);
|
|
99864
|
-
preparedFiles[shimHandler] = new
|
|
99882
|
+
preparedFiles[shimHandler] = new import_build_utils5.FileBlob({
|
|
99865
99883
|
data: shim(handlerFilename)
|
|
99866
99884
|
});
|
|
99867
99885
|
handler = shimHandler;
|
|
99868
99886
|
}
|
|
99869
99887
|
if (isEdgeFunction) {
|
|
99870
|
-
output = new
|
|
99888
|
+
output = new import_build_utils5.EdgeFunction({
|
|
99871
99889
|
entrypoint: handler,
|
|
99872
99890
|
files: preparedFiles,
|
|
99873
99891
|
regions: staticConfig?.regions,
|
|
@@ -99885,7 +99903,7 @@ var build = async ({
|
|
|
99885
99903
|
if (enableBundling) {
|
|
99886
99904
|
const bundledHandlerName = "___vc_bundled_api_handler.js";
|
|
99887
99905
|
const entrypointPrefix = (0, import_path3.relative)(baseDir, workPath).split(import_path3.sep).join("/");
|
|
99888
|
-
preparedFiles[bundledHandlerName] = new
|
|
99906
|
+
preparedFiles[bundledHandlerName] = new import_build_utils5.FileBlob({
|
|
99889
99907
|
data: (0, import_fs.readFileSync)(
|
|
99890
99908
|
(0, import_path3.join)((0, import_path3.dirname)(__filename), "bundling-handler.js"),
|
|
99891
99909
|
"utf8"
|
|
@@ -99928,7 +99946,7 @@ var build = async ({
|
|
|
99928
99946
|
];
|
|
99929
99947
|
}
|
|
99930
99948
|
}
|
|
99931
|
-
output = new
|
|
99949
|
+
output = new import_build_utils5.NodejsLambda({
|
|
99932
99950
|
files: preparedFiles,
|
|
99933
99951
|
handler,
|
|
99934
99952
|
experimentalAllowBundling: enableBundling || void 0,
|
|
@@ -99946,6 +99964,19 @@ var build = async ({
|
|
|
99946
99964
|
shouldDisableAutomaticFetchInstrumentation: process.env.VERCEL_TRACING_DISABLE_AUTOMATIC_FETCH_INSTRUMENTATION === "1"
|
|
99947
99965
|
});
|
|
99948
99966
|
}
|
|
99967
|
+
try {
|
|
99968
|
+
await (0, import_build_utils3.generateProjectManifest)({
|
|
99969
|
+
workPath,
|
|
99970
|
+
nodeVersion,
|
|
99971
|
+
cliType,
|
|
99972
|
+
lockfilePath,
|
|
99973
|
+
lockfileVersion
|
|
99974
|
+
});
|
|
99975
|
+
} catch (err) {
|
|
99976
|
+
(0, import_build_utils5.debug)(
|
|
99977
|
+
`Failed to write node manifest: ${err instanceof Error ? err.message : String(err)}`
|
|
99978
|
+
);
|
|
99979
|
+
}
|
|
99949
99980
|
return { routes, output };
|
|
99950
99981
|
};
|
|
99951
99982
|
function normalizeRequestedRegions(regions) {
|
|
@@ -99961,9 +99992,9 @@ function normalizeRequestedRegions(regions) {
|
|
|
99961
99992
|
}
|
|
99962
99993
|
|
|
99963
99994
|
// src/prepare-cache.ts
|
|
99964
|
-
var
|
|
99995
|
+
var import_build_utils6 = require("@vercel/build-utils");
|
|
99965
99996
|
var prepareCache = ({ repoRootPath, workPath }) => {
|
|
99966
|
-
return (0,
|
|
99997
|
+
return (0, import_build_utils6.glob)(import_build_utils6.defaultCachePathGlob, repoRootPath || workPath);
|
|
99967
99998
|
};
|
|
99968
99999
|
|
|
99969
100000
|
// src/start-dev-server.ts
|
|
@@ -99973,20 +100004,20 @@ var import_path6 = require("path");
|
|
|
99973
100004
|
var import_tree_kill = __toESM(require_tree_kill());
|
|
99974
100005
|
var import_util = require("util");
|
|
99975
100006
|
var import_stream = require("stream");
|
|
99976
|
-
var
|
|
100007
|
+
var import_build_utils9 = require("@vercel/build-utils");
|
|
99977
100008
|
var import_error_utils2 = require("@vercel/error-utils");
|
|
99978
100009
|
var import_static_config2 = require("@vercel/static-config");
|
|
99979
100010
|
var import_ts_morph2 = require("ts-morph");
|
|
99980
100011
|
|
|
99981
100012
|
// src/fork-dev-server.ts
|
|
99982
100013
|
var import_once2 = __toESM(require_dist());
|
|
99983
|
-
var
|
|
100014
|
+
var import_build_utils8 = require("@vercel/build-utils");
|
|
99984
100015
|
var import_child_process2 = require("child_process");
|
|
99985
100016
|
var import_url = require("url");
|
|
99986
100017
|
var import_path5 = require("path");
|
|
99987
100018
|
|
|
99988
100019
|
// src/bun-helpers.ts
|
|
99989
|
-
var
|
|
100020
|
+
var import_build_utils7 = require("@vercel/build-utils");
|
|
99990
100021
|
var import_child_process = require("child_process");
|
|
99991
100022
|
var import_once = __toESM(require_dist());
|
|
99992
100023
|
var import_os = require("os");
|
|
@@ -100005,22 +100036,22 @@ async function getOrCreateBunBinary() {
|
|
|
100005
100036
|
stdio: "ignore"
|
|
100006
100037
|
});
|
|
100007
100038
|
if (exitCode === 0) {
|
|
100008
|
-
(0,
|
|
100039
|
+
(0, import_build_utils7.debug)("Bun already installed and available in PATH");
|
|
100009
100040
|
return bunCommand;
|
|
100010
100041
|
}
|
|
100011
100042
|
} catch {
|
|
100012
|
-
(0,
|
|
100043
|
+
(0, import_build_utils7.debug)("Bun not found in PATH");
|
|
100013
100044
|
}
|
|
100014
100045
|
try {
|
|
100015
100046
|
const exitCode = await spawnAsync(installPath, ["--version"], {
|
|
100016
100047
|
stdio: "ignore"
|
|
100017
100048
|
});
|
|
100018
100049
|
if (exitCode === 0) {
|
|
100019
|
-
(0,
|
|
100050
|
+
(0, import_build_utils7.debug)("Bun already installed in default location");
|
|
100020
100051
|
return installPath;
|
|
100021
100052
|
}
|
|
100022
100053
|
} catch {
|
|
100023
|
-
(0,
|
|
100054
|
+
(0, import_build_utils7.debug)("Bun not found in default location");
|
|
100024
100055
|
}
|
|
100025
100056
|
console.log("Installing Bun...");
|
|
100026
100057
|
try {
|
|
@@ -100049,7 +100080,7 @@ async function getOrCreateBunBinary() {
|
|
|
100049
100080
|
stdio: "ignore"
|
|
100050
100081
|
});
|
|
100051
100082
|
if (exitCode === 0) {
|
|
100052
|
-
(0,
|
|
100083
|
+
(0, import_build_utils7.debug)("Bun was installed successfully");
|
|
100053
100084
|
return installPath;
|
|
100054
100085
|
}
|
|
100055
100086
|
} catch {
|
|
@@ -100067,7 +100098,7 @@ async function forkDevServer(options) {
|
|
|
100067
100098
|
const bun = await getOrCreateBunBinary();
|
|
100068
100099
|
const spawnOptions = {
|
|
100069
100100
|
cwd: options.workPath,
|
|
100070
|
-
env: (0,
|
|
100101
|
+
env: (0, import_build_utils8.cloneEnv)(process.env, options.meta.env, {
|
|
100071
100102
|
VERCEL_DEV_ENTRYPOINT: options.entrypoint,
|
|
100072
100103
|
VERCEL_DEV_CONFIG: JSON.stringify(options.config),
|
|
100073
100104
|
VERCEL_DEV_BUILD_ENV: JSON.stringify(options.meta.buildEnv || {}),
|
|
@@ -100106,7 +100137,7 @@ async function forkDevServer(options) {
|
|
|
100106
100137
|
const forkOptions = {
|
|
100107
100138
|
cwd: options.workPath,
|
|
100108
100139
|
execArgv: [],
|
|
100109
|
-
env: (0,
|
|
100140
|
+
env: (0, import_build_utils8.cloneEnv)(process.env, options.meta.env, {
|
|
100110
100141
|
VERCEL_DEV_ENTRYPOINT: options.entrypoint,
|
|
100111
100142
|
VERCEL_DEV_CONFIG: JSON.stringify(options.config),
|
|
100112
100143
|
VERCEL_DEV_BUILD_ENV: JSON.stringify(options.meta.buildEnv || {}),
|
|
@@ -100187,7 +100218,7 @@ async function syncDependencies(workPath, onStdout, onStderr) {
|
|
|
100187
100218
|
}
|
|
100188
100219
|
});
|
|
100189
100220
|
try {
|
|
100190
|
-
await (0,
|
|
100221
|
+
await (0, import_build_utils9.runNpmInstall)(workPath, [], void 0, void 0, void 0, {
|
|
100191
100222
|
stdout: bufStdout,
|
|
100192
100223
|
stderr: bufStderr
|
|
100193
100224
|
});
|
|
@@ -100195,7 +100226,7 @@ async function syncDependencies(workPath, onStdout, onStderr) {
|
|
|
100195
100226
|
for (const [channel, chunk] of captured) {
|
|
100196
100227
|
(channel === "stdout" ? writeOut : writeErr)(chunk.toString());
|
|
100197
100228
|
}
|
|
100198
|
-
throw new
|
|
100229
|
+
throw new import_build_utils9.NowBuildError({
|
|
100199
100230
|
code: "NODE_DEPENDENCY_SYNC_FAILED",
|
|
100200
100231
|
message: `Failed to install Node.JS dependencies: ${err instanceof Error ? err.message : String(err)}`
|
|
100201
100232
|
});
|
|
@@ -100230,7 +100261,7 @@ var startDevServer = async (opts) => {
|
|
|
100230
100261
|
try {
|
|
100231
100262
|
const vercelConfig = JSON.parse(vercelConfigContents);
|
|
100232
100263
|
if (vercelConfig.bunVersion) {
|
|
100233
|
-
bunVersion = (0,
|
|
100264
|
+
bunVersion = (0, import_build_utils9.getSupportedBunVersion)(vercelConfig.bunVersion);
|
|
100234
100265
|
}
|
|
100235
100266
|
} catch {
|
|
100236
100267
|
}
|
|
@@ -100248,12 +100279,12 @@ var startDevServer = async (opts) => {
|
|
|
100248
100279
|
}
|
|
100249
100280
|
const entryDir = (0, import_path6.dirname)(entrypointPath);
|
|
100250
100281
|
const ext = (0, import_path6.extname)(entrypoint);
|
|
100251
|
-
const pathToTsConfig = await (0,
|
|
100282
|
+
const pathToTsConfig = await (0, import_build_utils9.walkParentDirs)({
|
|
100252
100283
|
base: workPath,
|
|
100253
100284
|
start: entryDir,
|
|
100254
100285
|
filename: "tsconfig.json"
|
|
100255
100286
|
});
|
|
100256
|
-
const pathToPkg = await (0,
|
|
100287
|
+
const pathToPkg = await (0, import_build_utils9.walkParentDirs)({
|
|
100257
100288
|
base: workPath,
|
|
100258
100289
|
start: entryDir,
|
|
100259
100290
|
filename: "package.json"
|
|
@@ -100358,12 +100389,13 @@ var startDevServer = async (opts) => {
|
|
|
100358
100389
|
};
|
|
100359
100390
|
|
|
100360
100391
|
// src/index.ts
|
|
100361
|
-
var
|
|
100392
|
+
var import_build_utils10 = require("@vercel/build-utils");
|
|
100362
100393
|
var version = 3;
|
|
100363
100394
|
// Annotate the CommonJS export names for ESM import in node:
|
|
100364
100395
|
0 && (module.exports = {
|
|
100365
100396
|
_resetBundlingRoutesEmitted,
|
|
100366
100397
|
build,
|
|
100398
|
+
diagnostics,
|
|
100367
100399
|
prepareCache,
|
|
100368
100400
|
shouldServe,
|
|
100369
100401
|
startDevServer,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/node",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.8.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "./dist/index",
|
|
6
6
|
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/node-js",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"tsx": "4.21.0",
|
|
33
33
|
"typescript": "npm:typescript@5.9.3",
|
|
34
34
|
"undici": "5.28.4",
|
|
35
|
-
"@vercel/build-utils": "13.
|
|
36
|
-
"@vercel/
|
|
37
|
-
"@vercel/
|
|
35
|
+
"@vercel/build-utils": "13.23.0",
|
|
36
|
+
"@vercel/static-config": "3.3.0",
|
|
37
|
+
"@vercel/error-utils": "2.1.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@babel/core": "7.24.4",
|