@vercel/introspection 0.0.8 → 0.0.9
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/express.mjs +88 -53
- package/dist/hono.mjs +88 -53
- package/dist/index.mjs +100 -57
- package/dist/loaders/cjs.cjs +88 -53
- package/package.json +3 -3
package/dist/loaders/cjs.cjs
CHANGED
|
@@ -287,7 +287,7 @@ var require_dist$1 = /* @__PURE__ */ __commonJS$1({ "../build-utils/dist/index.j
|
|
|
287
287
|
this.head = this.tail = null;
|
|
288
288
|
this.length = 0;
|
|
289
289
|
};
|
|
290
|
-
BufferList.prototype.join = function
|
|
290
|
+
BufferList.prototype.join = function join6(s) {
|
|
291
291
|
if (this.length === 0) return "";
|
|
292
292
|
var p = this.head;
|
|
293
293
|
var ret = "" + p.data;
|
|
@@ -54392,13 +54392,14 @@ ${error.message}`;
|
|
|
54392
54392
|
getLatestNodeVersion: () => getLatestNodeVersion,
|
|
54393
54393
|
getNodeBinPath: () => getNodeBinPath,
|
|
54394
54394
|
getNodeBinPaths: () => getNodeBinPaths,
|
|
54395
|
-
getNodeVersion: () => getNodeVersion,
|
|
54396
54395
|
getOsRelease: () => getOsRelease,
|
|
54396
|
+
getPackageJson: () => getPackageJson,
|
|
54397
54397
|
getPathForPackageManager: () => getPathForPackageManager,
|
|
54398
54398
|
getPlatformEnv: () => getPlatformEnv,
|
|
54399
54399
|
getPrefixedEnvVars: () => getPrefixedEnvVars,
|
|
54400
54400
|
getPrettyError: () => getPrettyError,
|
|
54401
54401
|
getProvidedRuntime: () => getProvidedRuntime,
|
|
54402
|
+
getRuntimeNodeVersion: () => getRuntimeNodeVersion,
|
|
54402
54403
|
getScriptName: () => getScriptName,
|
|
54403
54404
|
getSpawnOptions: () => getSpawnOptions,
|
|
54404
54405
|
getSupportedBunVersion: () => getSupportedBunVersion,
|
|
@@ -54418,6 +54419,7 @@ ${error.message}`;
|
|
|
54418
54419
|
normalizePath: () => normalizePath,
|
|
54419
54420
|
readConfigFile: () => readConfigFile,
|
|
54420
54421
|
rename: () => rename,
|
|
54422
|
+
resetCustomInstallCommandSet: () => resetCustomInstallCommandSet,
|
|
54421
54423
|
runBundleInstall: () => runBundleInstall,
|
|
54422
54424
|
runCustomInstallCommand: () => runCustomInstallCommand,
|
|
54423
54425
|
runNpmInstall: () => runNpmInstall,
|
|
@@ -55163,7 +55165,7 @@ ${error.message}`;
|
|
|
55163
55165
|
}
|
|
55164
55166
|
var import_assert6 = __toESM(require("assert"));
|
|
55165
55167
|
var import_fs_extra7 = __toESM(require_lib());
|
|
55166
|
-
var
|
|
55168
|
+
var import_path6 = __toESM(require("path"));
|
|
55167
55169
|
var import_async_sema4 = __toESM(require_async_sema());
|
|
55168
55170
|
var import_cross_spawn = __toESM(require_cross_spawn());
|
|
55169
55171
|
var import_semver2 = __toESM(require_semver2());
|
|
@@ -55283,14 +55285,14 @@ ${error.message}`;
|
|
|
55283
55285
|
return (0, import_semver.intersects)(o.range, engineRange) && (availableVersions?.length ? availableVersions.includes(o.major) : true);
|
|
55284
55286
|
}))) throw new NowBuildError({
|
|
55285
55287
|
code: "BUILD_UTILS_NODE_VERSION_INVALID",
|
|
55286
|
-
link: "
|
|
55288
|
+
link: "https://vercel.link/node-version",
|
|
55287
55289
|
message: `Found invalid Node.js Version: "${engineRange}". ${getHint(isAuto, availableVersions)}`
|
|
55288
55290
|
});
|
|
55289
55291
|
}
|
|
55290
55292
|
if (!selection) selection = getLatestNodeVersion(availableVersions);
|
|
55291
55293
|
if (selection.state === "discontinued") throw new NowBuildError({
|
|
55292
55294
|
code: "BUILD_UTILS_NODE_VERSION_DISCONTINUED",
|
|
55293
|
-
link: "
|
|
55295
|
+
link: "https://vercel.link/node-version",
|
|
55294
55296
|
message: `${`Node.js Version "${selection.range}" is discontinued and must be upgraded.`} ${getHint(isAuto)}`
|
|
55295
55297
|
});
|
|
55296
55298
|
debug$2(`Selected Node.js ${selection.range}`);
|
|
@@ -55324,6 +55326,7 @@ ${error.message}`;
|
|
|
55324
55326
|
var import_toml = __toESM(require_toml());
|
|
55325
55327
|
var import_fs_extra6 = __toESM(require_lib());
|
|
55326
55328
|
var import_error_utils = __toESM(require_dist());
|
|
55329
|
+
var import_path5 = require("path");
|
|
55327
55330
|
async function readFileOrNull(file) {
|
|
55328
55331
|
try {
|
|
55329
55332
|
return await (0, import_fs_extra6.readFile)(file);
|
|
@@ -55350,6 +55353,14 @@ ${error.message}`;
|
|
|
55350
55353
|
}
|
|
55351
55354
|
return null;
|
|
55352
55355
|
}
|
|
55356
|
+
async function getPackageJson(dir) {
|
|
55357
|
+
const packagePath = (0, import_path5.join)(dir, "package.json");
|
|
55358
|
+
try {
|
|
55359
|
+
return JSON.parse(await (0, import_fs_extra6.readFile)(packagePath, "utf8"));
|
|
55360
|
+
} catch (err) {
|
|
55361
|
+
return {};
|
|
55362
|
+
}
|
|
55363
|
+
}
|
|
55353
55364
|
var { hasOwnProperty: hasOwnProperty2 } = Object.prototype;
|
|
55354
55365
|
function cloneEnv(...envs) {
|
|
55355
55366
|
return envs.reduce((obj, env) => {
|
|
@@ -55407,12 +55418,12 @@ ${error.message}`;
|
|
|
55407
55418
|
return true;
|
|
55408
55419
|
}
|
|
55409
55420
|
function* traverseUpDirectories({ start, base }) {
|
|
55410
|
-
let current =
|
|
55411
|
-
const normalizedRoot = base ?
|
|
55421
|
+
let current = import_path6.default.normalize(start);
|
|
55422
|
+
const normalizedRoot = base ? import_path6.default.normalize(base) : void 0;
|
|
55412
55423
|
while (current) {
|
|
55413
55424
|
yield current;
|
|
55414
55425
|
if (current === normalizedRoot) break;
|
|
55415
|
-
const next =
|
|
55426
|
+
const next = import_path6.default.join(current, "..");
|
|
55416
55427
|
current = next === current ? void 0 : next;
|
|
55417
55428
|
}
|
|
55418
55429
|
}
|
|
@@ -55422,24 +55433,24 @@ ${error.message}`;
|
|
|
55422
55433
|
start,
|
|
55423
55434
|
base
|
|
55424
55435
|
})) {
|
|
55425
|
-
const packageJsonPath =
|
|
55436
|
+
const packageJsonPath = import_path6.default.join(dir, "package.json");
|
|
55426
55437
|
if (await import_fs_extra7.default.pathExists(packageJsonPath)) curRootPackageJsonPath = packageJsonPath;
|
|
55427
55438
|
}
|
|
55428
55439
|
return curRootPackageJsonPath ? {
|
|
55429
55440
|
packageJson: await import_fs_extra7.default.readJson(curRootPackageJsonPath),
|
|
55430
|
-
rootDir:
|
|
55441
|
+
rootDir: import_path6.default.dirname(curRootPackageJsonPath)
|
|
55431
55442
|
} : void 0;
|
|
55432
55443
|
}
|
|
55433
55444
|
async function getNodeBinPath({ cwd }) {
|
|
55434
55445
|
const { lockfilePath } = await scanParentDirs(cwd);
|
|
55435
|
-
const dir =
|
|
55436
|
-
return
|
|
55446
|
+
const dir = import_path6.default.dirname(lockfilePath || cwd);
|
|
55447
|
+
return import_path6.default.join(dir, "node_modules", ".bin");
|
|
55437
55448
|
}
|
|
55438
55449
|
function getNodeBinPaths({ start, base }) {
|
|
55439
55450
|
return Array.from(traverseUpDirectories({
|
|
55440
55451
|
start,
|
|
55441
55452
|
base
|
|
55442
|
-
})).map((dir) =>
|
|
55453
|
+
})).map((dir) => import_path6.default.join(dir, "node_modules/.bin"));
|
|
55443
55454
|
}
|
|
55444
55455
|
async function chmodPlusX(fsPath) {
|
|
55445
55456
|
const s = await import_fs_extra7.default.stat(fsPath);
|
|
@@ -55449,10 +55460,10 @@ ${error.message}`;
|
|
|
55449
55460
|
await import_fs_extra7.default.chmod(fsPath, base8);
|
|
55450
55461
|
}
|
|
55451
55462
|
async function runShellScript(fsPath, args = [], spawnOpts) {
|
|
55452
|
-
(0, import_assert6.default)(
|
|
55453
|
-
const destPath =
|
|
55463
|
+
(0, import_assert6.default)(import_path6.default.isAbsolute(fsPath));
|
|
55464
|
+
const destPath = import_path6.default.dirname(fsPath);
|
|
55454
55465
|
await chmodPlusX(fsPath);
|
|
55455
|
-
const command = `./${
|
|
55466
|
+
const command = `./${import_path6.default.basename(fsPath)}`;
|
|
55456
55467
|
await spawnAsync(command, args, {
|
|
55457
55468
|
...spawnOpts,
|
|
55458
55469
|
cwd: destPath,
|
|
@@ -55465,7 +55476,7 @@ ${error.message}`;
|
|
|
55465
55476
|
if (isBunVersion(nodeVersion)) return opts;
|
|
55466
55477
|
if (!meta.isDev) {
|
|
55467
55478
|
let found = false;
|
|
55468
|
-
const pathSegments = (opts.env.PATH || process.env.PATH || "").split(
|
|
55479
|
+
const pathSegments = (opts.env.PATH || process.env.PATH || "").split(import_path6.default.delimiter).map((segment) => {
|
|
55469
55480
|
if (/^\/node[0-9]+\/bin/.test(segment)) {
|
|
55470
55481
|
found = true;
|
|
55471
55482
|
return `/node${nodeVersion.major}/bin`;
|
|
@@ -55473,11 +55484,11 @@ ${error.message}`;
|
|
|
55473
55484
|
return segment;
|
|
55474
55485
|
});
|
|
55475
55486
|
if (!found) pathSegments.unshift(`/node${nodeVersion.major}/bin`);
|
|
55476
|
-
opts.env.PATH = pathSegments.filter(Boolean).join(
|
|
55487
|
+
opts.env.PATH = pathSegments.filter(Boolean).join(import_path6.default.delimiter);
|
|
55477
55488
|
}
|
|
55478
55489
|
return opts;
|
|
55479
55490
|
}
|
|
55480
|
-
async function
|
|
55491
|
+
async function getRuntimeNodeVersion(destPath, fallbackVersion = process.env.VERCEL_PROJECT_SETTINGS_NODE_VERSION, config = {}, meta = {}, availableVersions = getAvailableNodeVersions()) {
|
|
55481
55492
|
if (config.bunVersion) return getSupportedBunVersion(config.bunVersion);
|
|
55482
55493
|
const latestVersion = getLatestNodeVersion(availableVersions);
|
|
55483
55494
|
if (meta.isDev) {
|
|
@@ -55490,14 +55501,14 @@ ${error.message}`;
|
|
|
55490
55501
|
const supportedNodeVersion = await getSupportedNodeVersion(packageJsonVersion || configuredVersion, !packageJsonVersion, availableVersions);
|
|
55491
55502
|
if (packageJson?.engines?.node) {
|
|
55492
55503
|
const { node } = packageJson.engines;
|
|
55493
|
-
if (configuredVersion && !(0, import_semver2.intersects)(configuredVersion, supportedNodeVersion.range)) console.warn(`Warning: Due to "engines": { "node": "${node}" } in your \`package.json\` file, the Node.js Version defined in your Project Settings ("${configuredVersion}") will not apply, Node.js Version "${supportedNodeVersion.range}" will be used instead. Learn More:
|
|
55494
|
-
if ((0, import_semver2.coerce)(node)?.raw === node) console.warn(`Warning: Detected "engines": { "node": "${node}" } in your \`package.json\` with major.minor.patch, but only major Node.js Version can be selected. Learn More:
|
|
55495
|
-
else if ((0, import_semver2.validRange)(node) && (0, import_semver2.intersects)(`${latestVersion.major + 1}.x`, node)) console.warn(`Warning: Detected "engines": { "node": "${node}" } in your \`package.json\` that will automatically upgrade when a new major Node.js Version is released. Learn More:
|
|
55504
|
+
if (configuredVersion && !(0, import_semver2.intersects)(configuredVersion, supportedNodeVersion.range)) console.warn(`Warning: Due to "engines": { "node": "${node}" } in your \`package.json\` file, the Node.js Version defined in your Project Settings ("${configuredVersion}") will not apply, Node.js Version "${supportedNodeVersion.range}" will be used instead. Learn More: https://vercel.link/node-version`);
|
|
55505
|
+
if ((0, import_semver2.coerce)(node)?.raw === node) console.warn(`Warning: Detected "engines": { "node": "${node}" } in your \`package.json\` with major.minor.patch, but only major Node.js Version can be selected. Learn More: https://vercel.link/node-version`);
|
|
55506
|
+
else if ((0, import_semver2.validRange)(node) && (0, import_semver2.intersects)(`${latestVersion.major + 1}.x`, node)) console.warn(`Warning: Detected "engines": { "node": "${node}" } in your \`package.json\` that will automatically upgrade when a new major Node.js Version is released. Learn More: https://vercel.link/node-version`);
|
|
55496
55507
|
}
|
|
55497
55508
|
return supportedNodeVersion;
|
|
55498
55509
|
}
|
|
55499
55510
|
async function scanParentDirs(destPath, readPackageJson = false, base = "/") {
|
|
55500
|
-
(0, import_assert6.default)(
|
|
55511
|
+
(0, import_assert6.default)(import_path6.default.isAbsolute(destPath));
|
|
55501
55512
|
const pkgJsonPath = await walkParentDirs({
|
|
55502
55513
|
base,
|
|
55503
55514
|
start: destPath,
|
|
@@ -55583,8 +55594,8 @@ ${error.message}`;
|
|
|
55583
55594
|
}
|
|
55584
55595
|
async function checkTurboSupportsCorepack(turboVersionRange, rootDir) {
|
|
55585
55596
|
if (turboVersionSpecifierSupportsCorepack(turboVersionRange)) return true;
|
|
55586
|
-
const turboJsonPath =
|
|
55587
|
-
const turboJsoncPath =
|
|
55597
|
+
const turboJsonPath = import_path6.default.join(rootDir, "turbo.json");
|
|
55598
|
+
const turboJsoncPath = import_path6.default.join(rootDir, "turbo.jsonc");
|
|
55588
55599
|
const [turboJsonExists, turboJsoncExists] = await Promise.all([import_fs_extra7.default.pathExists(turboJsonPath), import_fs_extra7.default.pathExists(turboJsoncPath)]);
|
|
55589
55600
|
let turboJson = null;
|
|
55590
55601
|
let turboConfigPath = null;
|
|
@@ -55593,7 +55604,7 @@ ${error.message}`;
|
|
|
55593
55604
|
if (turboConfigPath) try {
|
|
55594
55605
|
turboJson = import_json5.default.parse(await import_fs_extra7.default.readFile(turboConfigPath, "utf8"));
|
|
55595
55606
|
} catch (err) {
|
|
55596
|
-
console.warn(`WARNING: Failed to parse ${
|
|
55607
|
+
console.warn(`WARNING: Failed to parse ${import_path6.default.basename(turboConfigPath)}`);
|
|
55597
55608
|
}
|
|
55598
55609
|
return turboJson !== null && typeof turboJson === "object" && "globalPassThroughEnv" in turboJson && Array.isArray(turboJson.globalPassThroughEnv) && turboJson.globalPassThroughEnv.includes("COREPACK_HOME");
|
|
55599
55610
|
}
|
|
@@ -55627,13 +55638,13 @@ ${error.message}`;
|
|
|
55627
55638
|
return true;
|
|
55628
55639
|
}
|
|
55629
55640
|
async function walkParentDirs({ base, start, filename }) {
|
|
55630
|
-
(0, import_assert6.default)(
|
|
55631
|
-
(0, import_assert6.default)(
|
|
55641
|
+
(0, import_assert6.default)(import_path6.default.isAbsolute(base), "Expected \"base\" to be absolute path");
|
|
55642
|
+
(0, import_assert6.default)(import_path6.default.isAbsolute(start), "Expected \"start\" to be absolute path");
|
|
55632
55643
|
for (const dir of traverseUpDirectories({
|
|
55633
55644
|
start,
|
|
55634
55645
|
base
|
|
55635
55646
|
})) {
|
|
55636
|
-
const fullPath =
|
|
55647
|
+
const fullPath = import_path6.default.join(dir, filename);
|
|
55637
55648
|
if (await import_fs_extra7.default.pathExists(fullPath)) return fullPath;
|
|
55638
55649
|
}
|
|
55639
55650
|
return null;
|
|
@@ -55644,10 +55655,10 @@ ${error.message}`;
|
|
|
55644
55655
|
start,
|
|
55645
55656
|
base
|
|
55646
55657
|
})) {
|
|
55647
|
-
const fullPaths = filenames.map((f) =>
|
|
55658
|
+
const fullPaths = filenames.map((f) => import_path6.default.join(dir, f));
|
|
55648
55659
|
const existResults = await Promise.all(fullPaths.map((f) => import_fs_extra7.default.pathExists(f)));
|
|
55649
55660
|
const foundOneOrMore = existResults.some((b) => b);
|
|
55650
|
-
const packageJsonPath =
|
|
55661
|
+
const packageJsonPath = import_path6.default.join(dir, "package.json");
|
|
55651
55662
|
const packageJson = await import_fs_extra7.default.readJSON(packageJsonPath).catch(() => null);
|
|
55652
55663
|
if (packageJson?.packageManager) packageManager = packageJson.packageManager;
|
|
55653
55664
|
if (foundOneOrMore) return {
|
|
@@ -55707,12 +55718,16 @@ ${error.message}`;
|
|
|
55707
55718
|
};
|
|
55708
55719
|
}
|
|
55709
55720
|
var runNpmInstallSema = new import_async_sema4.default(1);
|
|
55721
|
+
var customInstallCommandSet;
|
|
55722
|
+
function resetCustomInstallCommandSet() {
|
|
55723
|
+
customInstallCommandSet = void 0;
|
|
55724
|
+
}
|
|
55710
55725
|
async function runNpmInstall(destPath, args = [], spawnOpts, meta, projectCreatedAt) {
|
|
55711
55726
|
if (meta?.isDev) {
|
|
55712
55727
|
debug$2("Skipping dependency installation because dev mode is enabled");
|
|
55713
55728
|
return false;
|
|
55714
55729
|
}
|
|
55715
|
-
(0, import_assert6.default)(
|
|
55730
|
+
(0, import_assert6.default)(import_path6.default.isAbsolute(destPath));
|
|
55716
55731
|
try {
|
|
55717
55732
|
await runNpmInstallSema.acquire();
|
|
55718
55733
|
const { cliType, packageJsonPath, packageJson, lockfileVersion, packageJsonPackageManager, turboSupportsCorepackHome } = await scanParentDirs(destPath, true);
|
|
@@ -55724,6 +55739,12 @@ ${error.message}`;
|
|
|
55724
55739
|
if (meta && packageJsonPath && defaultInstall) {
|
|
55725
55740
|
const { alreadyInstalled, runNpmInstallSet } = checkIfAlreadyInstalled(meta.runNpmInstallSet, packageJsonPath);
|
|
55726
55741
|
if (alreadyInstalled) return false;
|
|
55742
|
+
if (process.env.VERCEL_INSTALL_COMPLETED === "1") {
|
|
55743
|
+
debug$2(`Skipping dependency installation for ${packageJsonPath} because VERCEL_INSTALL_COMPLETED is set`);
|
|
55744
|
+
runNpmInstallSet.add(packageJsonPath);
|
|
55745
|
+
meta.runNpmInstallSet = runNpmInstallSet;
|
|
55746
|
+
return false;
|
|
55747
|
+
}
|
|
55727
55748
|
meta.runNpmInstallSet = runNpmInstallSet;
|
|
55728
55749
|
}
|
|
55729
55750
|
if (cliType === "yarn") {
|
|
@@ -55779,11 +55800,11 @@ ${error.message}`;
|
|
|
55779
55800
|
else debug$2(`Detected ${detectedPackageManager}. Added "${newPath}" to path. Based on assumed package manager "${cliType}", lockfile "${detectedLockfile}", and lockfileVersion "${lockfileVersion}"`);
|
|
55780
55801
|
const newEnv = { ...env };
|
|
55781
55802
|
const alreadyInPath = (newPath2) => {
|
|
55782
|
-
return (env.PATH ?? "").split(
|
|
55803
|
+
return (env.PATH ?? "").split(import_path6.default.delimiter).includes(newPath2);
|
|
55783
55804
|
};
|
|
55784
55805
|
if (newPath && !alreadyInPath(newPath)) {
|
|
55785
55806
|
const oldPath = env.PATH + "";
|
|
55786
|
-
newEnv.PATH = `${newPath}${
|
|
55807
|
+
newEnv.PATH = `${newPath}${import_path6.default.delimiter}${oldPath}`;
|
|
55787
55808
|
if (detectedLockfile && detectedPackageManager) {
|
|
55788
55809
|
const detectedV9PnpmLockfile = detectedLockfile === "pnpm-lock.yaml" && lockfileVersion === 9;
|
|
55789
55810
|
if (detectedPackageManager === "pnpm@10.x" && packageJsonPackageManager) {
|
|
@@ -55950,7 +55971,7 @@ To use ${otherVersion}, manually opt in using corepack (https://vercel.com/docs/
|
|
|
55950
55971
|
});
|
|
55951
55972
|
if (corepackEnabled) overrides = NO_OVERRIDE;
|
|
55952
55973
|
const alreadyInPath = (newPath) => {
|
|
55953
|
-
return (env.PATH ?? "").split(
|
|
55974
|
+
return (env.PATH ?? "").split(import_path6.default.delimiter).includes(newPath);
|
|
55954
55975
|
};
|
|
55955
55976
|
switch (true) {
|
|
55956
55977
|
case cliType === "yarn" && !env.YARN_NODE_LINKER: return {
|
|
@@ -55970,6 +55991,17 @@ To use ${otherVersion}, manually opt in using corepack (https://vercel.com/docs/
|
|
|
55970
55991
|
}
|
|
55971
55992
|
}
|
|
55972
55993
|
async function runCustomInstallCommand({ destPath, installCommand, spawnOpts, projectCreatedAt }) {
|
|
55994
|
+
const normalizedPath = import_path6.default.normalize(destPath);
|
|
55995
|
+
const { alreadyInstalled, runNpmInstallSet } = checkIfAlreadyInstalled(customInstallCommandSet, normalizedPath);
|
|
55996
|
+
customInstallCommandSet = runNpmInstallSet;
|
|
55997
|
+
if (alreadyInstalled) {
|
|
55998
|
+
debug$2(`Skipping custom install command for ${normalizedPath} because it was already run`);
|
|
55999
|
+
return false;
|
|
56000
|
+
}
|
|
56001
|
+
if (process.env.VERCEL_INSTALL_COMPLETED === "1") {
|
|
56002
|
+
debug$2(`Skipping custom install command for ${normalizedPath} because VERCEL_INSTALL_COMPLETED is set`);
|
|
56003
|
+
return false;
|
|
56004
|
+
}
|
|
55973
56005
|
console.log(`Running "install" command: \`${installCommand}\`...`);
|
|
55974
56006
|
const { cliType, lockfileVersion, packageJson, packageJsonPackageManager, turboSupportsCorepackHome } = await scanParentDirs(destPath, true);
|
|
55975
56007
|
const env = getEnvForPackageManager({
|
|
@@ -55987,9 +56019,10 @@ To use ${otherVersion}, manually opt in using corepack (https://vercel.com/docs/
|
|
|
55987
56019
|
env,
|
|
55988
56020
|
cwd: destPath
|
|
55989
56021
|
});
|
|
56022
|
+
return true;
|
|
55990
56023
|
}
|
|
55991
56024
|
async function runPackageJsonScript(destPath, scriptNames, spawnOpts, projectCreatedAt) {
|
|
55992
|
-
(0, import_assert6.default)(
|
|
56025
|
+
(0, import_assert6.default)(import_path6.default.isAbsolute(destPath));
|
|
55993
56026
|
const { packageJson, cliType, lockfileVersion, packageJsonPackageManager, turboSupportsCorepackHome } = await scanParentDirs(destPath, true);
|
|
55994
56027
|
const scriptName = getScriptName(packageJson, typeof scriptNames === "string" ? [scriptNames] : scriptNames);
|
|
55995
56028
|
if (!scriptName) return false;
|
|
@@ -56023,7 +56056,7 @@ To use ${otherVersion}, manually opt in using corepack (https://vercel.com/docs/
|
|
|
56023
56056
|
debug$2("Skipping dependency installation because dev mode is enabled");
|
|
56024
56057
|
return;
|
|
56025
56058
|
}
|
|
56026
|
-
(0, import_assert6.default)(
|
|
56059
|
+
(0, import_assert6.default)(import_path6.default.isAbsolute(destPath));
|
|
56027
56060
|
const opts = {
|
|
56028
56061
|
...spawnOpts,
|
|
56029
56062
|
cwd: destPath,
|
|
@@ -56036,7 +56069,7 @@ To use ${otherVersion}, manually opt in using corepack (https://vercel.com/docs/
|
|
|
56036
56069
|
debug$2("Skipping dependency installation because dev mode is enabled");
|
|
56037
56070
|
return;
|
|
56038
56071
|
}
|
|
56039
|
-
(0, import_assert6.default)(
|
|
56072
|
+
(0, import_assert6.default)(import_path6.default.isAbsolute(destPath));
|
|
56040
56073
|
const opts = {
|
|
56041
56074
|
...spawnOpts,
|
|
56042
56075
|
cwd: destPath,
|
|
@@ -56054,7 +56087,7 @@ To use ${otherVersion}, manually opt in using corepack (https://vercel.com/docs/
|
|
|
56054
56087
|
}
|
|
56055
56088
|
}
|
|
56056
56089
|
var installDependencies = (0, import_util2.deprecate)(runNpmInstall, "installDependencies() is deprecated. Please use runNpmInstall() instead.");
|
|
56057
|
-
var
|
|
56090
|
+
var import_path7 = __toESM(require("path"));
|
|
56058
56091
|
var import_fs_extra8 = __toESM(require_lib());
|
|
56059
56092
|
var import_ignore = __toESM(require_ignore());
|
|
56060
56093
|
function isCodedError(error) {
|
|
@@ -56072,8 +56105,8 @@ To use ${otherVersion}, manually opt in using corepack (https://vercel.com/docs/
|
|
|
56072
56105
|
throw error;
|
|
56073
56106
|
}
|
|
56074
56107
|
};
|
|
56075
|
-
const vercelIgnorePath =
|
|
56076
|
-
const nowIgnorePath =
|
|
56108
|
+
const vercelIgnorePath = import_path7.default.join(downloadPath, rootDirectory || "", ".vercelignore");
|
|
56109
|
+
const nowIgnorePath = import_path7.default.join(downloadPath, rootDirectory || "", ".nowignore");
|
|
56077
56110
|
const ignoreContents = [];
|
|
56078
56111
|
try {
|
|
56079
56112
|
ignoreContents.push(...(await Promise.all([readFile4(vercelIgnorePath), readFile4(nowIgnorePath)])).filter(Boolean));
|
|
@@ -56111,18 +56144,18 @@ To use ${otherVersion}, manually opt in using corepack (https://vercel.com/docs/
|
|
|
56111
56144
|
}
|
|
56112
56145
|
return newEnvs;
|
|
56113
56146
|
}
|
|
56114
|
-
var
|
|
56147
|
+
var import_path8 = __toESM(require("path"));
|
|
56115
56148
|
var import_fs2 = require("fs");
|
|
56116
56149
|
async function hardLinkDir(src, destDirs) {
|
|
56117
56150
|
if (destDirs.length === 0) return;
|
|
56118
|
-
destDirs = destDirs.filter((destDir) =>
|
|
56151
|
+
destDirs = destDirs.filter((destDir) => import_path8.default.relative(destDir, src) !== "");
|
|
56119
56152
|
const files = await import_fs2.promises.readdir(src);
|
|
56120
56153
|
await Promise.all(files.map(async (file) => {
|
|
56121
56154
|
if (file === "node_modules") return;
|
|
56122
|
-
const srcFile =
|
|
56155
|
+
const srcFile = import_path8.default.join(src, file);
|
|
56123
56156
|
if ((await import_fs2.promises.lstat(srcFile)).isDirectory()) {
|
|
56124
56157
|
await hardLinkDir(srcFile, await Promise.all(destDirs.map(async (destDir) => {
|
|
56125
|
-
const destSubdir =
|
|
56158
|
+
const destSubdir = import_path8.default.join(destDir, file);
|
|
56126
56159
|
try {
|
|
56127
56160
|
await import_fs2.promises.mkdir(destSubdir, { recursive: true });
|
|
56128
56161
|
} catch (err) {
|
|
@@ -56133,7 +56166,7 @@ To use ${otherVersion}, manually opt in using corepack (https://vercel.com/docs/
|
|
|
56133
56166
|
return;
|
|
56134
56167
|
}
|
|
56135
56168
|
await Promise.all(destDirs.map(async (destDir) => {
|
|
56136
|
-
const destFile =
|
|
56169
|
+
const destFile = import_path8.default.join(destDir, file);
|
|
56137
56170
|
try {
|
|
56138
56171
|
await linkOrCopyFile(srcFile, destFile);
|
|
56139
56172
|
} catch (err) {
|
|
@@ -56148,7 +56181,7 @@ To use ${otherVersion}, manually opt in using corepack (https://vercel.com/docs/
|
|
|
56148
56181
|
await linkOrCopy(srcFile, destFile);
|
|
56149
56182
|
} catch (err) {
|
|
56150
56183
|
if (err.code === "ENOENT") {
|
|
56151
|
-
await import_fs2.promises.mkdir(
|
|
56184
|
+
await import_fs2.promises.mkdir(import_path8.default.dirname(destFile), { recursive: true });
|
|
56152
56185
|
await linkOrCopy(srcFile, destFile);
|
|
56153
56186
|
return;
|
|
56154
56187
|
}
|
|
@@ -56163,10 +56196,10 @@ To use ${otherVersion}, manually opt in using corepack (https://vercel.com/docs/
|
|
|
56163
56196
|
await import_fs2.promises.copyFile(srcFile, destFile);
|
|
56164
56197
|
}
|
|
56165
56198
|
}
|
|
56166
|
-
var
|
|
56199
|
+
var import_path9 = require("path");
|
|
56167
56200
|
var import_promises = require("fs/promises");
|
|
56168
56201
|
async function validateNpmrc(cwd) {
|
|
56169
|
-
if ((await (0, import_promises.readFile)((0,
|
|
56202
|
+
if ((await (0, import_promises.readFile)((0, import_path9.join)(cwd, ".npmrc"), "utf-8").catch((err) => {
|
|
56170
56203
|
if (err.code !== "ENOENT") throw err;
|
|
56171
56204
|
}))?.match(/(?<!#.*)use-node-version/)) throw new Error("Detected unsupported \"use-node-version\" in your \".npmrc\". Please use \"engines\" in your \"package.json\" instead.");
|
|
56172
56205
|
}
|
|
@@ -56207,12 +56240,12 @@ To use ${otherVersion}, manually opt in using corepack (https://vercel.com/docs/
|
|
|
56207
56240
|
if (!os) return "provided.al2023";
|
|
56208
56241
|
return os.PRETTY_NAME === "Amazon Linux 2" ? "provided.al2" : "provided.al2023";
|
|
56209
56242
|
}
|
|
56210
|
-
var
|
|
56243
|
+
var import_path10 = require("path");
|
|
56211
56244
|
var shouldServe = ({ entrypoint, files, requestPath }) => {
|
|
56212
56245
|
requestPath = requestPath.replace(/\/$/, "");
|
|
56213
56246
|
entrypoint = entrypoint.replace(/\\/, "/");
|
|
56214
56247
|
if (entrypoint === requestPath && hasProp(files, entrypoint)) return true;
|
|
56215
|
-
const { dir, name } = (0,
|
|
56248
|
+
const { dir, name } = (0, import_path10.parse)(entrypoint);
|
|
56216
56249
|
if (name === "index" && dir === requestPath && hasProp(files, entrypoint)) return true;
|
|
56217
56250
|
return false;
|
|
56218
56251
|
};
|
|
@@ -56493,6 +56526,7 @@ ${entrypointsForMessage}`);
|
|
|
56493
56526
|
"express",
|
|
56494
56527
|
"hono",
|
|
56495
56528
|
"h3",
|
|
56529
|
+
"koa",
|
|
56496
56530
|
"nestjs",
|
|
56497
56531
|
"fastify",
|
|
56498
56532
|
"elysia"
|
|
@@ -56501,6 +56535,7 @@ ${entrypointsForMessage}`);
|
|
|
56501
56535
|
"@vercel/express",
|
|
56502
56536
|
"@vercel/hono",
|
|
56503
56537
|
"@vercel/h3",
|
|
56538
|
+
"@vercel/koa",
|
|
56504
56539
|
"@vercel/nestjs",
|
|
56505
56540
|
"@vercel/fastify",
|
|
56506
56541
|
"@vercel/elysia"
|
|
@@ -56524,12 +56559,12 @@ ${entrypointsForMessage}`);
|
|
|
56524
56559
|
return isExperimentalBackendsEnabled() && isBackendFramework(framework);
|
|
56525
56560
|
}
|
|
56526
56561
|
var import_fs3 = __toESM(require("fs"));
|
|
56527
|
-
var
|
|
56562
|
+
var import_path11 = require("path");
|
|
56528
56563
|
var import_execa = __toESM(require_execa());
|
|
56529
56564
|
var isWin2 = process.platform === "win32";
|
|
56530
56565
|
async function runStdlibPyScript(options) {
|
|
56531
56566
|
const { scriptName, pythonPath, args = [], cwd } = options;
|
|
56532
|
-
const scriptPath = (0,
|
|
56567
|
+
const scriptPath = (0, import_path11.join)(__dirname, "..", "lib", "python", `${scriptName}.py`);
|
|
56533
56568
|
if (!import_fs3.default.existsSync(scriptPath)) throw new Error(`Python script not found: ${scriptPath}`);
|
|
56534
56569
|
const pythonCmd = pythonPath ?? (isWin2 ? "python" : "python3");
|
|
56535
56570
|
debug$2(`Running stdlib Python script: ${pythonCmd} ${scriptPath} ${args.join(" ")}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/introspection",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"homepage": "https://vercel.com/docs",
|
|
6
6
|
"type": "module",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"vite": "^5.1.6",
|
|
43
43
|
"vitest": "^2.0.1",
|
|
44
44
|
"@vercel/static-config": "3.1.2",
|
|
45
|
-
"@vercel/
|
|
46
|
-
"@vercel/
|
|
45
|
+
"@vercel/cervel": "0.0.9",
|
|
46
|
+
"@vercel/build-utils": "13.2.8"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "tsdown",
|