@vercel/backends 0.0.20 → 0.0.21
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 +18 -22
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -54377,7 +54377,7 @@ ${error.message}`;
|
|
|
54377
54377
|
getProvidedRuntime: () => getProvidedRuntime,
|
|
54378
54378
|
getRuntimeNodeVersion: () => getRuntimeNodeVersion$1,
|
|
54379
54379
|
getScriptName: () => getScriptName$1,
|
|
54380
|
-
getSpawnOptions: () => getSpawnOptions
|
|
54380
|
+
getSpawnOptions: () => getSpawnOptions,
|
|
54381
54381
|
getSupportedBunVersion: () => getSupportedBunVersion,
|
|
54382
54382
|
getSupportedNodeVersion: () => getSupportedNodeVersion,
|
|
54383
54383
|
getWriteableDirectory: () => getWritableDirectory,
|
|
@@ -55447,7 +55447,7 @@ ${error.message}`;
|
|
|
55447
55447
|
});
|
|
55448
55448
|
return true;
|
|
55449
55449
|
}
|
|
55450
|
-
function getSpawnOptions
|
|
55450
|
+
function getSpawnOptions(meta, nodeVersion) {
|
|
55451
55451
|
const opts = { env: cloneEnv(process.env) };
|
|
55452
55452
|
if (isBunVersion$1(nodeVersion)) return opts;
|
|
55453
55453
|
if (!meta.isDev) {
|
|
@@ -56584,14 +56584,12 @@ async function downloadInstallAndBundle(args) {
|
|
|
56584
56584
|
const { entrypoint, files, workPath, meta, config, repoRootPath } = args;
|
|
56585
56585
|
await (0, import_dist$3.download)(files, workPath, meta);
|
|
56586
56586
|
const entrypointFsDirname = join(workPath, dirname(entrypoint));
|
|
56587
|
-
const nodeVersion = await (0, import_dist$3.getRuntimeNodeVersion)(entrypointFsDirname, void 0, config, meta);
|
|
56588
|
-
const spawnOpts = (0, import_dist$3.getSpawnOptions)(meta || {}, nodeVersion);
|
|
56589
56587
|
const { cliType, lockfileVersion, packageJsonPackageManager, turboSupportsCorepackHome } = await (0, import_dist$3.scanParentDirs)(entrypointFsDirname, true, repoRootPath);
|
|
56590
|
-
|
|
56588
|
+
const spawnEnv = (0, import_dist$3.getEnvForPackageManager)({
|
|
56591
56589
|
cliType,
|
|
56592
56590
|
lockfileVersion,
|
|
56593
56591
|
packageJsonPackageManager,
|
|
56594
|
-
env:
|
|
56592
|
+
env: process.env,
|
|
56595
56593
|
turboSupportsCorepackHome,
|
|
56596
56594
|
projectCreatedAt: config.projectSettings?.createdAt
|
|
56597
56595
|
});
|
|
@@ -56599,45 +56597,42 @@ async function downloadInstallAndBundle(args) {
|
|
|
56599
56597
|
if (typeof installCommand === "string") if (installCommand.trim()) {
|
|
56600
56598
|
console.log(`Running "install" command: \`${installCommand}\`...`);
|
|
56601
56599
|
await (0, import_dist$3.execCommand)(installCommand, {
|
|
56602
|
-
|
|
56600
|
+
env: spawnEnv,
|
|
56603
56601
|
cwd: entrypointFsDirname
|
|
56604
56602
|
});
|
|
56605
56603
|
} else console.log(`Skipping "install" command...`);
|
|
56606
|
-
else await (0, import_dist$3.runNpmInstall)(entrypointFsDirname, [],
|
|
56604
|
+
else await (0, import_dist$3.runNpmInstall)(entrypointFsDirname, [], { env: spawnEnv }, meta, config.projectSettings?.createdAt);
|
|
56607
56605
|
return {
|
|
56608
56606
|
entrypointFsDirname,
|
|
56609
|
-
|
|
56610
|
-
spawnOpts
|
|
56607
|
+
spawnEnv
|
|
56611
56608
|
};
|
|
56612
56609
|
}
|
|
56613
|
-
async function maybeExecBuildCommand(args,
|
|
56610
|
+
async function maybeExecBuildCommand(args, { spawnEnv, entrypointFsDirname }) {
|
|
56614
56611
|
const projectBuildCommand = args.config.projectSettings?.buildCommand;
|
|
56615
56612
|
if (projectBuildCommand) {
|
|
56616
56613
|
const nodeBinPath = (0, import_dist$3.getNodeBinPaths)({
|
|
56617
56614
|
base: args.repoRootPath || args.workPath,
|
|
56618
56615
|
start: args.workPath
|
|
56619
56616
|
}).join(delimiter);
|
|
56620
|
-
const env = {
|
|
56621
|
-
...options.spawnOpts.env,
|
|
56622
|
-
PATH: `${nodeBinPath}${delimiter}${options.spawnOpts.env?.PATH || process.env.PATH}`
|
|
56623
|
-
};
|
|
56624
56617
|
return (0, import_dist$3.execCommand)(projectBuildCommand, {
|
|
56625
|
-
|
|
56626
|
-
|
|
56618
|
+
env: {
|
|
56619
|
+
...spawnEnv,
|
|
56620
|
+
PATH: `${nodeBinPath}${delimiter}${spawnEnv?.PATH || process.env.PATH}`
|
|
56621
|
+
},
|
|
56627
56622
|
cwd: args.workPath
|
|
56628
56623
|
});
|
|
56629
56624
|
}
|
|
56630
|
-
return (0, import_dist$3.runPackageJsonScript)(
|
|
56625
|
+
return (0, import_dist$3.runPackageJsonScript)(entrypointFsDirname, ["build"], { env: spawnEnv }, args.config.projectSettings?.createdAt);
|
|
56631
56626
|
}
|
|
56632
56627
|
|
|
56633
56628
|
//#endregion
|
|
56634
56629
|
//#region src/node-file-trace.ts
|
|
56635
56630
|
var import_dist$2 = require_dist$1();
|
|
56636
|
-
const nodeFileTrace$1 = async (args,
|
|
56631
|
+
const nodeFileTrace$1 = async (args, nodeVersion, output) => {
|
|
56637
56632
|
const { dir: outputDir, handler } = output;
|
|
56638
56633
|
const entry = join(outputDir, handler);
|
|
56639
56634
|
const files = {};
|
|
56640
|
-
const conditions = (0, import_dist$2.isBunVersion)(
|
|
56635
|
+
const conditions = (0, import_dist$2.isBunVersion)(nodeVersion) ? ["bun"] : void 0;
|
|
56641
56636
|
const nftResult = await nodeFileTrace([entry], {
|
|
56642
56637
|
base: args.repoRootPath,
|
|
56643
56638
|
ignore: args.config.excludeFiles,
|
|
@@ -56768,8 +56763,9 @@ var import_dist = require_dist$1();
|
|
|
56768
56763
|
const version = 2;
|
|
56769
56764
|
const build = async (args) => {
|
|
56770
56765
|
const downloadResult = await downloadInstallAndBundle(args);
|
|
56766
|
+
const nodeVersion = await (0, import_dist.getRuntimeNodeVersion)(args.workPath);
|
|
56771
56767
|
const outputConfig = await doBuild(args, downloadResult);
|
|
56772
|
-
const { files } = await nodeFileTrace$1(args,
|
|
56768
|
+
const { files } = await nodeFileTrace$1(args, nodeVersion, outputConfig);
|
|
56773
56769
|
(0, import_dist.debug)("Building route mapping..");
|
|
56774
56770
|
const { routes, framework } = await introspectApp({
|
|
56775
56771
|
...outputConfig,
|
|
@@ -56783,7 +56779,7 @@ const build = async (args) => {
|
|
|
56783
56779
|
else (0, import_dist.debug)(`Route mapping failed to detect routes`);
|
|
56784
56780
|
const handler = relative$1(args.repoRootPath, join$1(outputConfig.dir, outputConfig.handler));
|
|
56785
56781
|
const lambda = new import_dist.NodejsLambda({
|
|
56786
|
-
runtime:
|
|
56782
|
+
runtime: nodeVersion.runtime,
|
|
56787
56783
|
handler,
|
|
56788
56784
|
files,
|
|
56789
56785
|
shouldAddHelpers: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/backends",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.21",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "./dist/index.mjs",
|
|
6
6
|
"homepage": "https://vercel.com/docs",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"@vercel/nft": "1.1.1",
|
|
25
25
|
"fs-extra": "11.1.0",
|
|
26
26
|
"@vercel/cervel": "0.0.9",
|
|
27
|
-
"@vercel/
|
|
28
|
-
"@vercel/
|
|
27
|
+
"@vercel/introspection": "0.0.8",
|
|
28
|
+
"@vercel/static-config": "3.1.2"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/express": "5.0.3",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"tsdown": "0.16.3",
|
|
39
39
|
"vite": "^5.1.6",
|
|
40
40
|
"vitest": "^2.0.1",
|
|
41
|
-
"@vercel/build-utils": "13.2.
|
|
41
|
+
"@vercel/build-utils": "13.2.8"
|
|
42
42
|
},
|
|
43
43
|
"module": "./dist/index.mjs",
|
|
44
44
|
"types": "./dist/index.d.mts",
|