@vercel/backends 0.0.23 → 0.0.24
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 +85 -87
- package/package.json +4 -6
package/dist/index.mjs
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
|
-
import { delimiter, dirname, join
|
|
3
|
-
import { existsSync, lstatSync, readFileSync } from "fs";
|
|
2
|
+
import { delimiter, dirname, join } from "path";
|
|
4
3
|
import { introspectApp } from "@vercel/introspection";
|
|
5
|
-
import {
|
|
6
|
-
import { join as join$1, relative as relative$1 } from "node:path";
|
|
7
|
-
import { existsSync as existsSync$1 } from "node:fs";
|
|
4
|
+
import { existsSync } from "node:fs";
|
|
8
5
|
import { writeFile } from "node:fs/promises";
|
|
9
|
-
import {
|
|
6
|
+
import { join as join$1 } from "node:path";
|
|
7
|
+
import { build as build$1, findEntrypoint, getBuildSummary, nodeFileTrace } from "@vercel/cervel";
|
|
10
8
|
|
|
11
9
|
//#region rolldown:runtime
|
|
12
10
|
var __getOwnPropNames$1 = Object.getOwnPropertyNames;
|
|
@@ -3714,10 +3712,10 @@ var require_dist$1 = /* @__PURE__ */ __commonJS$1({ "../build-utils/dist/index.j
|
|
|
3714
3712
|
});
|
|
3715
3713
|
}
|
|
3716
3714
|
function _createSymlink(srcpath, dstpath, type, callback) {
|
|
3717
|
-
symlinkPaths(srcpath, dstpath, (err, relative
|
|
3715
|
+
symlinkPaths(srcpath, dstpath, (err, relative) => {
|
|
3718
3716
|
if (err) return callback(err);
|
|
3719
|
-
srcpath = relative
|
|
3720
|
-
symlinkType(relative
|
|
3717
|
+
srcpath = relative.toDst;
|
|
3718
|
+
symlinkType(relative.toCwd, type, (err2, type2) => {
|
|
3721
3719
|
if (err2) return callback(err2);
|
|
3722
3720
|
const dir = path7.dirname(dstpath);
|
|
3723
3721
|
pathExists(dir, (err3, dirExists) => {
|
|
@@ -3739,9 +3737,9 @@ var require_dist$1 = /* @__PURE__ */ __commonJS$1({ "../build-utils/dist/index.j
|
|
|
3739
3737
|
if (stats && stats.isSymbolicLink()) {
|
|
3740
3738
|
if (areIdentical(fs7.statSync(srcpath), fs7.statSync(dstpath))) return;
|
|
3741
3739
|
}
|
|
3742
|
-
const relative
|
|
3743
|
-
srcpath = relative
|
|
3744
|
-
type = symlinkTypeSync(relative
|
|
3740
|
+
const relative = symlinkPathsSync(srcpath, dstpath);
|
|
3741
|
+
srcpath = relative.toDst;
|
|
3742
|
+
type = symlinkTypeSync(relative.toCwd, type);
|
|
3745
3743
|
const dir = path7.dirname(dstpath);
|
|
3746
3744
|
if (fs7.existsSync(dir)) return fs7.symlinkSync(srcpath, dstpath, type);
|
|
3747
3745
|
mkdirsSync(dir);
|
|
@@ -3812,7 +3810,7 @@ var require_dist$1 = /* @__PURE__ */ __commonJS$1({ "../build-utils/dist/index.j
|
|
|
3812
3810
|
return obj;
|
|
3813
3811
|
}
|
|
3814
3812
|
var readFile4 = universalify.fromPromise(_readFile);
|
|
3815
|
-
function readFileSync
|
|
3813
|
+
function readFileSync(file, options = {}) {
|
|
3816
3814
|
if (typeof options === "string") options = { encoding: options };
|
|
3817
3815
|
const fs7 = options.fs || _fs;
|
|
3818
3816
|
const shouldThrow = "throws" in options ? options.throws : true;
|
|
@@ -3840,7 +3838,7 @@ var require_dist$1 = /* @__PURE__ */ __commonJS$1({ "../build-utils/dist/index.j
|
|
|
3840
3838
|
}
|
|
3841
3839
|
module2.exports = {
|
|
3842
3840
|
readFile: readFile4,
|
|
3843
|
-
readFileSync
|
|
3841
|
+
readFileSync,
|
|
3844
3842
|
writeFile: writeFile$1,
|
|
3845
3843
|
writeFileSync
|
|
3846
3844
|
};
|
|
@@ -54338,7 +54336,7 @@ ${error.message}`;
|
|
|
54338
54336
|
BUILDER_INSTALLER_STEP: () => BUILDER_INSTALLER_STEP,
|
|
54339
54337
|
BunVersion: () => BunVersion,
|
|
54340
54338
|
EdgeFunction: () => EdgeFunction,
|
|
54341
|
-
FileBlob: () => FileBlob
|
|
54339
|
+
FileBlob: () => FileBlob,
|
|
54342
54340
|
FileFsRef: () => file_fs_ref_default,
|
|
54343
54341
|
FileRef: () => FileRef,
|
|
54344
54342
|
Lambda: () => Lambda,
|
|
@@ -54388,7 +54386,7 @@ ${error.message}`;
|
|
|
54388
54386
|
installDependencies: () => installDependencies,
|
|
54389
54387
|
isBackendBuilder: () => isBackendBuilder,
|
|
54390
54388
|
isBackendFramework: () => isBackendFramework,
|
|
54391
|
-
isBunVersion: () => isBunVersion
|
|
54389
|
+
isBunVersion: () => isBunVersion,
|
|
54392
54390
|
isDirectory: () => isDirectory,
|
|
54393
54391
|
isExperimentalBackendsEnabled: () => isExperimentalBackendsEnabled,
|
|
54394
54392
|
isExperimentalBackendsWithoutIntrospectionEnabled: () => isExperimentalBackendsWithoutIntrospectionEnabled,
|
|
@@ -54420,7 +54418,7 @@ ${error.message}`;
|
|
|
54420
54418
|
module.exports = __toCommonJS(src_exports);
|
|
54421
54419
|
var import_assert = __toESM(__require("assert"));
|
|
54422
54420
|
var import_into_stream = __toESM(require_into_stream());
|
|
54423
|
-
var FileBlob
|
|
54421
|
+
var FileBlob = class _FileBlob {
|
|
54424
54422
|
constructor({ mode = 33188, contentType, data }) {
|
|
54425
54423
|
(0, import_assert.default)(typeof mode === "number");
|
|
54426
54424
|
(0, import_assert.default)(typeof data === "string" || Buffer.isBuffer(data));
|
|
@@ -54457,7 +54455,7 @@ ${error.message}`;
|
|
|
54457
54455
|
var import_path = __toESM(__require("path"));
|
|
54458
54456
|
var import_async_sema = __toESM(require_async_sema());
|
|
54459
54457
|
var semaToPreventEMFILE = new import_async_sema.default(20);
|
|
54460
|
-
var FileFsRef
|
|
54458
|
+
var FileFsRef = class _FileFsRef {
|
|
54461
54459
|
constructor({ mode = 33188, contentType, fsPath, size }) {
|
|
54462
54460
|
(0, import_assert2.default)(typeof mode === "number");
|
|
54463
54461
|
(0, import_assert2.default)(typeof fsPath === "string");
|
|
@@ -54521,7 +54519,7 @@ ${error.message}`;
|
|
|
54521
54519
|
});
|
|
54522
54520
|
}
|
|
54523
54521
|
};
|
|
54524
|
-
var file_fs_ref_default = FileFsRef
|
|
54522
|
+
var file_fs_ref_default = FileFsRef;
|
|
54525
54523
|
var import_assert3 = __toESM(__require("assert"));
|
|
54526
54524
|
var import_node_fetch = __toESM(require_lib3());
|
|
54527
54525
|
var import_multistream2 = __toESM(require_multistream());
|
|
@@ -54901,6 +54899,10 @@ ${error.message}`;
|
|
|
54901
54899
|
(0, import_assert4.default)(typeof trigger.initialDelaySeconds === "number", `${prefix}.initialDelaySeconds must be a number`);
|
|
54902
54900
|
(0, import_assert4.default)(trigger.initialDelaySeconds >= 0, `${prefix}.initialDelaySeconds must be a non-negative number`);
|
|
54903
54901
|
}
|
|
54902
|
+
if (trigger.maxConcurrency !== void 0) {
|
|
54903
|
+
(0, import_assert4.default)(typeof trigger.maxConcurrency === "number", `${prefix}.maxConcurrency must be a number`);
|
|
54904
|
+
(0, import_assert4.default)(Number.isInteger(trigger.maxConcurrency) && trigger.maxConcurrency >= 1, `${prefix}.maxConcurrency must be at least 1`);
|
|
54905
|
+
}
|
|
54904
54906
|
}
|
|
54905
54907
|
}
|
|
54906
54908
|
if (supportsCancellation !== void 0) (0, import_assert4.default)(typeof supportsCancellation === "boolean", "\"supportsCancellation\" is not a boolean");
|
|
@@ -55232,13 +55234,10 @@ ${error.message}`;
|
|
|
55232
55234
|
return NODE_VERSIONS;
|
|
55233
55235
|
}
|
|
55234
55236
|
function isNodeVersionAvailable(version$1) {
|
|
55235
|
-
|
|
55236
|
-
return (0, import_fs.statSync)(`/node${version$1.major}`).isDirectory();
|
|
55237
|
-
} catch {}
|
|
55238
|
-
return false;
|
|
55237
|
+
return (0, import_fs.statSync)(`/node${version$1.major}`, { throwIfNoEntry: false })?.isDirectory() ?? false;
|
|
55239
55238
|
}
|
|
55240
55239
|
function getAvailableNodeVersions() {
|
|
55241
|
-
return getOptions().filter(isNodeVersionAvailable).map((n) => n.major);
|
|
55240
|
+
return getOptions().filter((v) => v.major >= 18).filter(isNodeVersionAvailable).map((n) => n.major);
|
|
55242
55241
|
}
|
|
55243
55242
|
function getHint(isAuto = false, availableVersions) {
|
|
55244
55243
|
const { major, range } = getLatestNodeVersion(availableVersions);
|
|
@@ -55265,7 +55264,7 @@ ${error.message}`;
|
|
|
55265
55264
|
}))) throw new NowBuildError({
|
|
55266
55265
|
code: "BUILD_UTILS_NODE_VERSION_INVALID",
|
|
55267
55266
|
link: "https://vercel.link/node-version",
|
|
55268
|
-
message: `Found invalid Node.js Version: "${engineRange}". ${getHint(isAuto, availableVersions)}`
|
|
55267
|
+
message: `Found invalid or discontinued Node.js Version: "${engineRange}". ${getHint(isAuto, availableVersions)}`
|
|
55269
55268
|
});
|
|
55270
55269
|
}
|
|
55271
55270
|
if (!selection) selection = getLatestNodeVersion(availableVersions);
|
|
@@ -55298,7 +55297,7 @@ ${error.message}`;
|
|
|
55298
55297
|
code: "BUILD_UTILS_BUN_VERSION_INVALID"
|
|
55299
55298
|
});
|
|
55300
55299
|
}
|
|
55301
|
-
function isBunVersion
|
|
55300
|
+
function isBunVersion(version$1) {
|
|
55302
55301
|
return version$1.runtime.startsWith("bun");
|
|
55303
55302
|
}
|
|
55304
55303
|
var import_js_yaml = __toESM(require_js_yaml2());
|
|
@@ -55452,7 +55451,7 @@ ${error.message}`;
|
|
|
55452
55451
|
}
|
|
55453
55452
|
function getSpawnOptions(meta, nodeVersion) {
|
|
55454
55453
|
const opts = { env: cloneEnv(process.env) };
|
|
55455
|
-
if (isBunVersion
|
|
55454
|
+
if (isBunVersion(nodeVersion)) return opts;
|
|
55456
55455
|
if (!meta.isDev) {
|
|
55457
55456
|
let found = false;
|
|
55458
55457
|
const pathSegments = (opts.env.PATH || process.env.PATH || "").split(import_path6.default.delimiter).map((segment) => {
|
|
@@ -56272,6 +56271,10 @@ To use ${otherVersion}, manually opt in using corepack (https://vercel.com/docs/
|
|
|
56272
56271
|
initialDelaySeconds: {
|
|
56273
56272
|
type: "number",
|
|
56274
56273
|
minimum: 0
|
|
56274
|
+
},
|
|
56275
|
+
maxConcurrency: {
|
|
56276
|
+
type: "number",
|
|
56277
|
+
minimum: 1
|
|
56275
56278
|
}
|
|
56276
56279
|
},
|
|
56277
56280
|
required: [
|
|
@@ -56606,13 +56609,13 @@ ${entrypointsForMessage}`);
|
|
|
56606
56609
|
|
|
56607
56610
|
//#endregion
|
|
56608
56611
|
//#region src/utils.ts
|
|
56609
|
-
var import_dist$
|
|
56612
|
+
var import_dist$2 = require_dist$1();
|
|
56610
56613
|
async function downloadInstallAndBundle(args) {
|
|
56611
56614
|
const { entrypoint, files, workPath, meta, config, repoRootPath } = args;
|
|
56612
|
-
await (0, import_dist$
|
|
56615
|
+
await (0, import_dist$2.download)(files, workPath, meta);
|
|
56613
56616
|
const entrypointFsDirname = join(workPath, dirname(entrypoint));
|
|
56614
|
-
const { cliType, lockfileVersion, packageJsonPackageManager, turboSupportsCorepackHome } = await (0, import_dist$
|
|
56615
|
-
const spawnEnv = (0, import_dist$
|
|
56617
|
+
const { cliType, lockfileVersion, packageJsonPackageManager, turboSupportsCorepackHome } = await (0, import_dist$2.scanParentDirs)(entrypointFsDirname, true, repoRootPath);
|
|
56618
|
+
const spawnEnv = (0, import_dist$2.getEnvForPackageManager)({
|
|
56616
56619
|
cliType,
|
|
56617
56620
|
lockfileVersion,
|
|
56618
56621
|
packageJsonPackageManager,
|
|
@@ -56623,12 +56626,12 @@ async function downloadInstallAndBundle(args) {
|
|
|
56623
56626
|
const installCommand = config.projectSettings?.installCommand;
|
|
56624
56627
|
if (typeof installCommand === "string") if (installCommand.trim()) {
|
|
56625
56628
|
console.log(`Running "install" command: \`${installCommand}\`...`);
|
|
56626
|
-
await (0, import_dist$
|
|
56629
|
+
await (0, import_dist$2.execCommand)(installCommand, {
|
|
56627
56630
|
env: spawnEnv,
|
|
56628
56631
|
cwd: entrypointFsDirname
|
|
56629
56632
|
});
|
|
56630
56633
|
} else console.log(`Skipping "install" command...`);
|
|
56631
|
-
else await (0, import_dist$
|
|
56634
|
+
else await (0, import_dist$2.runNpmInstall)(entrypointFsDirname, [], { env: spawnEnv }, meta, config.projectSettings?.createdAt);
|
|
56632
56635
|
return {
|
|
56633
56636
|
entrypointFsDirname,
|
|
56634
56637
|
spawnEnv
|
|
@@ -56637,11 +56640,11 @@ async function downloadInstallAndBundle(args) {
|
|
|
56637
56640
|
async function maybeExecBuildCommand(args, { spawnEnv, entrypointFsDirname }) {
|
|
56638
56641
|
const projectBuildCommand = args.config.projectSettings?.buildCommand;
|
|
56639
56642
|
if (projectBuildCommand) {
|
|
56640
|
-
const nodeBinPath = (0, import_dist$
|
|
56643
|
+
const nodeBinPath = (0, import_dist$2.getNodeBinPaths)({
|
|
56641
56644
|
base: args.repoRootPath || args.workPath,
|
|
56642
56645
|
start: args.workPath
|
|
56643
56646
|
}).join(delimiter);
|
|
56644
|
-
return (0, import_dist$
|
|
56647
|
+
return (0, import_dist$2.execCommand)(projectBuildCommand, {
|
|
56645
56648
|
env: {
|
|
56646
56649
|
...spawnEnv,
|
|
56647
56650
|
PATH: `${nodeBinPath}${delimiter}${spawnEnv?.PATH || process.env.PATH}`
|
|
@@ -56649,43 +56652,9 @@ async function maybeExecBuildCommand(args, { spawnEnv, entrypointFsDirname }) {
|
|
|
56649
56652
|
cwd: args.workPath
|
|
56650
56653
|
});
|
|
56651
56654
|
}
|
|
56652
|
-
return (0, import_dist$
|
|
56655
|
+
return (0, import_dist$2.runPackageJsonScript)(entrypointFsDirname, ["build"], { env: spawnEnv }, args.config.projectSettings?.createdAt);
|
|
56653
56656
|
}
|
|
56654
56657
|
|
|
56655
|
-
//#endregion
|
|
56656
|
-
//#region src/node-file-trace.ts
|
|
56657
|
-
var import_dist$2 = require_dist$1();
|
|
56658
|
-
const nodeFileTrace$1 = async (args, nodeVersion, output) => {
|
|
56659
|
-
const { dir: outputDir, handler } = output;
|
|
56660
|
-
const entry = join(outputDir, handler);
|
|
56661
|
-
const files = {};
|
|
56662
|
-
const conditions = (0, import_dist$2.isBunVersion)(nodeVersion) ? ["bun"] : void 0;
|
|
56663
|
-
const nftResult = await nodeFileTrace([entry], {
|
|
56664
|
-
base: args.repoRootPath,
|
|
56665
|
-
ignore: args.config.excludeFiles,
|
|
56666
|
-
conditions,
|
|
56667
|
-
mixedModules: true
|
|
56668
|
-
});
|
|
56669
|
-
const packageJsonPath = join(args.workPath, "package.json");
|
|
56670
|
-
if (existsSync(packageJsonPath)) {
|
|
56671
|
-
const { mode } = lstatSync(packageJsonPath);
|
|
56672
|
-
const source = readFileSync(packageJsonPath);
|
|
56673
|
-
const relPath = relative(args.repoRootPath, packageJsonPath);
|
|
56674
|
-
files[relPath] = new import_dist$2.FileBlob({
|
|
56675
|
-
data: source,
|
|
56676
|
-
mode
|
|
56677
|
-
});
|
|
56678
|
-
}
|
|
56679
|
-
for (const file of nftResult.fileList) {
|
|
56680
|
-
const fullPath = join(args.repoRootPath, file);
|
|
56681
|
-
files[file] = new import_dist$2.FileFsRef({
|
|
56682
|
-
fsPath: fullPath,
|
|
56683
|
-
mode: lstatSync(fullPath, {}).mode
|
|
56684
|
-
});
|
|
56685
|
-
}
|
|
56686
|
-
return { files };
|
|
56687
|
-
};
|
|
56688
|
-
|
|
56689
56658
|
//#endregion
|
|
56690
56659
|
//#region src/build.ts
|
|
56691
56660
|
var import_dist$1 = require_dist$1();
|
|
@@ -56701,7 +56670,7 @@ const doBuild = async (args, downloadResult) => {
|
|
|
56701
56670
|
if (isCervelCommand) {
|
|
56702
56671
|
(0, import_dist$1.debug)("Cervel command ran, using its default output location");
|
|
56703
56672
|
const cervelOutputDir = join$1(args.workPath, "dist");
|
|
56704
|
-
if (existsSync
|
|
56673
|
+
if (existsSync(join$1(cervelOutputDir, ".cervel.json"))) {
|
|
56705
56674
|
(0, import_dist$1.debug)("Cervel JSON file found, using its handler");
|
|
56706
56675
|
const { handler: handler$2 } = await getBuildSummary(cervelOutputDir);
|
|
56707
56676
|
return {
|
|
@@ -56713,10 +56682,10 @@ const doBuild = async (args, downloadResult) => {
|
|
|
56713
56682
|
throw new Error(`Build command "${buildCommand}" completed, but no output was found at ${cervelOutputDir}. Make sure your cervel command is configured correctly.`);
|
|
56714
56683
|
}
|
|
56715
56684
|
const distDir = join$1(args.workPath, "dist");
|
|
56716
|
-
if (existsSync
|
|
56685
|
+
if (existsSync(distDir)) {
|
|
56717
56686
|
(0, import_dist$1.debug)("Dist directory found, checking for .cervel.json");
|
|
56718
56687
|
const cervelJsonPath$1 = join$1(distDir, ".cervel.json");
|
|
56719
|
-
if (existsSync
|
|
56688
|
+
if (existsSync(cervelJsonPath$1)) {
|
|
56720
56689
|
const { handler: handler$3 } = await getBuildSummary(distDir);
|
|
56721
56690
|
return {
|
|
56722
56691
|
dir: distDir,
|
|
@@ -56729,19 +56698,47 @@ const doBuild = async (args, downloadResult) => {
|
|
|
56729
56698
|
(0, import_dist$1.debug)("Finding entrypoint in dist directory");
|
|
56730
56699
|
handler$2 = await findEntrypoint(distDir);
|
|
56731
56700
|
} catch (error) {
|
|
56732
|
-
|
|
56733
|
-
|
|
56701
|
+
try {
|
|
56702
|
+
(0, import_dist$1.debug)("Finding entrypoint in dist directory with ignoreRegex");
|
|
56703
|
+
handler$2 = await findEntrypoint(distDir, { ignoreRegex: true });
|
|
56704
|
+
(0, import_dist$1.debug)("Found entrypoint in dist directory with ignoreRegex", handler$2);
|
|
56705
|
+
} catch (error$1) {
|
|
56706
|
+
(0, import_dist$1.debug)("Unable to detect entrypoint, building ourselves");
|
|
56707
|
+
const buildResult$1 = await build$1({
|
|
56708
|
+
workPath: args.workPath,
|
|
56709
|
+
repoRootPath: args.repoRootPath,
|
|
56710
|
+
out: defaultOutputDirectory
|
|
56711
|
+
});
|
|
56712
|
+
tsPromise = buildResult$1.tsPromise ?? void 0;
|
|
56713
|
+
const { handler: handler$3 } = await getBuildSummary(buildResult$1.rolldownResult.outputDir);
|
|
56714
|
+
return {
|
|
56715
|
+
dir: buildResult$1.rolldownResult.outputDir,
|
|
56716
|
+
handler: handler$3,
|
|
56717
|
+
tsPromise,
|
|
56718
|
+
files: buildResult$1.rolldownResult.outputFiles
|
|
56719
|
+
};
|
|
56720
|
+
}
|
|
56734
56721
|
}
|
|
56735
56722
|
await writeFile(cervelJsonPath$1, JSON.stringify({ handler: handler$2 }, null, 2));
|
|
56723
|
+
const files = await nodeFileTrace({
|
|
56724
|
+
keepTracedPaths: true,
|
|
56725
|
+
tracedPaths: [join$1(distDir, handler$2)],
|
|
56726
|
+
repoRootPath: args.repoRootPath,
|
|
56727
|
+
workPath: args.workPath,
|
|
56728
|
+
context: { files: {} },
|
|
56729
|
+
outDir: distDir
|
|
56730
|
+
});
|
|
56736
56731
|
return {
|
|
56737
56732
|
dir: distDir,
|
|
56738
56733
|
handler: handler$2,
|
|
56739
|
-
tsPromise
|
|
56734
|
+
tsPromise,
|
|
56735
|
+
files
|
|
56740
56736
|
};
|
|
56741
56737
|
}
|
|
56742
|
-
(0, import_dist$1.debug)("No dist directory found, building ourselves");
|
|
56738
|
+
(0, import_dist$1.debug)("No dist directory found, or unable to detect entrypoint, building ourselves");
|
|
56743
56739
|
const buildResult = await build$1({
|
|
56744
|
-
|
|
56740
|
+
workPath: args.workPath,
|
|
56741
|
+
repoRootPath: args.repoRootPath,
|
|
56745
56742
|
out: defaultOutputDirectory
|
|
56746
56743
|
});
|
|
56747
56744
|
tsPromise = buildResult.tsPromise ?? void 0;
|
|
@@ -56749,7 +56746,8 @@ const doBuild = async (args, downloadResult) => {
|
|
|
56749
56746
|
return {
|
|
56750
56747
|
dir: buildResult.rolldownResult.outputDir,
|
|
56751
56748
|
handler: handler$1,
|
|
56752
|
-
tsPromise
|
|
56749
|
+
tsPromise,
|
|
56750
|
+
files: buildResult.rolldownResult.outputFiles
|
|
56753
56751
|
};
|
|
56754
56752
|
}
|
|
56755
56753
|
const outputDir = join$1(args.workPath, outputSetting);
|
|
@@ -56757,7 +56755,8 @@ const doBuild = async (args, downloadResult) => {
|
|
|
56757
56755
|
const monorepoWithoutBuildScript = args.config.projectSettings?.monorepoManager && !(0, import_dist$1.getScriptName)(packageJson, ["build"]);
|
|
56758
56756
|
if (!buildCommandResult || monorepoWithoutBuildScript) {
|
|
56759
56757
|
const buildResult = await build$1({
|
|
56760
|
-
|
|
56758
|
+
workPath: args.workPath,
|
|
56759
|
+
repoRootPath: args.repoRootPath,
|
|
56761
56760
|
out: outputDir
|
|
56762
56761
|
});
|
|
56763
56762
|
tsPromise = buildResult.tsPromise ?? void 0;
|
|
@@ -56765,11 +56764,12 @@ const doBuild = async (args, downloadResult) => {
|
|
|
56765
56764
|
return {
|
|
56766
56765
|
dir: buildResult.rolldownResult.outputDir,
|
|
56767
56766
|
handler: handler$1,
|
|
56768
|
-
tsPromise
|
|
56767
|
+
tsPromise,
|
|
56768
|
+
files: buildResult.rolldownResult.outputFiles
|
|
56769
56769
|
};
|
|
56770
56770
|
}
|
|
56771
56771
|
const cervelJsonPath = join$1(outputDir, ".cervel.json");
|
|
56772
|
-
if (existsSync
|
|
56772
|
+
if (existsSync(cervelJsonPath)) {
|
|
56773
56773
|
const { handler: handler$1 } = await getBuildSummary(outputDir);
|
|
56774
56774
|
return {
|
|
56775
56775
|
dir: outputDir,
|
|
@@ -56809,8 +56809,7 @@ const build = async (args) => {
|
|
|
56809
56809
|
});
|
|
56810
56810
|
return result;
|
|
56811
56811
|
});
|
|
56812
|
-
|
|
56813
|
-
const nftPromise = span.child("vc.builder.backends.nodeFileTrace").trace(() => nodeFileTrace$1(args, nodeVersion, outputConfig));
|
|
56812
|
+
const files = outputConfig.files;
|
|
56814
56813
|
(0, import_dist.debug)("Introspection starting..");
|
|
56815
56814
|
const { routes, framework } = await span.child("vc.builder.backends.introspectApp").trace(async (span$1) => {
|
|
56816
56815
|
const result = await introspectApp({
|
|
@@ -56826,9 +56825,8 @@ const build = async (args) => {
|
|
|
56826
56825
|
});
|
|
56827
56826
|
if (routes.length > 2) (0, import_dist.debug)(`Introspection completed successfully with ${routes.length} routes`);
|
|
56828
56827
|
else (0, import_dist.debug)(`Introspection failed to detect routes`);
|
|
56829
|
-
const handler =
|
|
56830
|
-
|
|
56831
|
-
(0, import_dist.debug)("Node file trace complete");
|
|
56828
|
+
const handler = outputConfig.handler;
|
|
56829
|
+
if (!files) throw new Error("Unable to trace files for build");
|
|
56832
56830
|
const lambda = new import_dist.NodejsLambda({
|
|
56833
56831
|
runtime: nodeVersion.runtime,
|
|
56834
56832
|
handler,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/backends",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.24",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "./dist/index.mjs",
|
|
6
6
|
"homepage": "https://vercel.com/docs",
|
|
@@ -21,10 +21,8 @@
|
|
|
21
21
|
"dist"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@vercel/nft": "1.1.1",
|
|
25
24
|
"fs-extra": "11.1.0",
|
|
26
|
-
"@vercel/
|
|
27
|
-
"@vercel/cervel": "0.0.10",
|
|
25
|
+
"@vercel/cervel": "0.0.11",
|
|
28
26
|
"@vercel/introspection": "0.0.10"
|
|
29
27
|
},
|
|
30
28
|
"devDependencies": {
|
|
@@ -38,14 +36,14 @@
|
|
|
38
36
|
"tsdown": "0.16.3",
|
|
39
37
|
"vite": "^5.1.6",
|
|
40
38
|
"vitest": "^2.0.1",
|
|
41
|
-
"@vercel/build-utils": "13.2.
|
|
39
|
+
"@vercel/build-utils": "13.2.16"
|
|
42
40
|
},
|
|
43
41
|
"module": "./dist/index.mjs",
|
|
44
42
|
"types": "./dist/index.d.mts",
|
|
45
43
|
"scripts": {
|
|
46
44
|
"build": "tsdown",
|
|
47
45
|
"vitest-run": "vitest -c ../../vitest.config.mts",
|
|
48
|
-
"vitest-unit": "glob --absolute 'test/unit
|
|
46
|
+
"vitest-unit": "glob --absolute 'test/unit.*test.ts'",
|
|
49
47
|
"type-check": "tsc --noEmit"
|
|
50
48
|
}
|
|
51
49
|
}
|