vercel-cli 41.1.0__py3-none-any.whl
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.
Potentially problematic release.
This version of vercel-cli might be problematic. Click here for more details.
- vercel_cli/vendor/LICENSE +202 -0
- vercel_cli/vendor/README.md +63 -0
- vercel_cli/vendor/dist/VERCEL_DIR_README.txt +11 -0
- vercel_cli/vendor/dist/builder-worker.js +62 -0
- vercel_cli/vendor/dist/get-latest-worker.js +272 -0
- vercel_cli/vendor/dist/index.js +172693 -0
- vercel_cli/vendor/dist/vc.js +11 -0
- vercel_cli/vendor/node_modules/.package-lock.json +18 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/CHANGELOG.md +488 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/LICENSE +202 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/build.mjs +3 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/clone-env.d.ts +10 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/clone-env.js +43 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/debug.d.ts +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/debug.js +31 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/default-cache-path-glob.d.ts +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/default-cache-path-glob.js +28 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/edge-function.d.ts +41 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/edge-function.js +40 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/errors.d.ts +39 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/errors.js +95 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/file-blob.d.ts +23 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/file-blob.js +67 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/file-fs-ref.d.ts +27 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/file-fs-ref.js +113 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/file-ref.d.ts +38 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/file-ref.js +147 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/download.d.ts +9 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/download.js +136 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/get-writable-directory.d.ts +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/get-writable-directory.js +32 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/glob.d.ts +10 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/glob.js +111 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/node-version.d.ts +9 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/node-version.js +180 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/normalize-path.d.ts +4 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/normalize-path.js +31 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/read-config-file.d.ts +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/read-config-file.js +76 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/rename.d.ts +11 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/rename.js +30 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/run-user-scripts.d.ts +206 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/run-user-scripts.js +944 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/stream-to-buffer.d.ts +3 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/stream-to-buffer.js +87 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/get-ignore-filter.d.ts +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/get-ignore-filter.js +90 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/get-installed-package-version.d.ts +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/get-installed-package-version.js +53 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/get-platform-env.d.ts +5 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/get-platform-env.js +45 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/get-prefixed-env-vars.d.ts +14 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/get-prefixed-env-vars.js +51 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/hard-link-dir.d.ts +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/hard-link-dir.js +104 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/index.d.ts +33 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/index.js +24390 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/lambda.d.ts +81 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/lambda.js +231 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/nodejs-lambda.d.ts +16 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/nodejs-lambda.js +44 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/os.d.ts +3 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/os.js +62 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/prerender.d.ts +37 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/prerender.js +169 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/schemas.d.ts +60 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/schemas.js +87 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/should-serve.d.ts +2 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/should-serve.js +47 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/trace/constants.d.ts +2 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/trace/constants.js +31 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/trace/index.d.ts +3 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/trace/index.js +33 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/trace/trace.d.ts +37 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/trace/trace.js +92 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/types.d.ts +503 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/types.js +51 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/validate-npmrc.d.ts +12 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/validate-npmrc.js +41 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/file-blob.js +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/file-fs-ref.js +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/file-ref.js +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/fs/download.js +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/fs/get-writable-directory.js +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/fs/glob.js +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/fs/rename.js +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/fs/run-user-scripts.js +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/fs/stream-to-buffer.js +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/lambda.js +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/package.json +60 -0
- vercel_cli/vendor/node_modules/@vercel/python/LICENSE +202 -0
- vercel_cli/vendor/node_modules/@vercel/python/dist/index.js +3132 -0
- vercel_cli/vendor/node_modules/@vercel/python/package.json +36 -0
- vercel_cli/vendor/node_modules/@vercel/python/vc_init.py +681 -0
- vercel_cli/vendor/package.json +40 -0
- vercel_cli-41.1.0.dist-info/METADATA +188 -0
- vercel_cli-41.1.0.dist-info/RECORD +99 -0
- vercel_cli-41.1.0.dist-info/WHEEL +4 -0
- vercel_cli-41.1.0.dist-info/entry_points.txt +3 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var stream_to_buffer_exports = {};
|
|
30
|
+
__export(stream_to_buffer_exports, {
|
|
31
|
+
default: () => streamToBuffer,
|
|
32
|
+
streamToBufferChunks: () => streamToBufferChunks
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(stream_to_buffer_exports);
|
|
35
|
+
var import_end_of_stream = __toESM(require("end-of-stream"));
|
|
36
|
+
function streamToBuffer(stream) {
|
|
37
|
+
return new Promise((resolve, reject) => {
|
|
38
|
+
const buffers = [];
|
|
39
|
+
stream.on("data", buffers.push.bind(buffers));
|
|
40
|
+
(0, import_end_of_stream.default)(stream, (err) => {
|
|
41
|
+
if (err) {
|
|
42
|
+
reject(err);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
switch (buffers.length) {
|
|
46
|
+
case 0:
|
|
47
|
+
resolve(Buffer.allocUnsafe(0));
|
|
48
|
+
break;
|
|
49
|
+
case 1:
|
|
50
|
+
resolve(buffers[0]);
|
|
51
|
+
break;
|
|
52
|
+
default:
|
|
53
|
+
resolve(Buffer.concat(buffers));
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
const MB = 1024 * 1024;
|
|
59
|
+
async function streamToBufferChunks(stream, chunkSize = 100 * MB) {
|
|
60
|
+
const chunks = [];
|
|
61
|
+
let currentChunk = [];
|
|
62
|
+
let currentSize = 0;
|
|
63
|
+
for await (const chunk of stream) {
|
|
64
|
+
const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
65
|
+
let offset = 0;
|
|
66
|
+
while (offset < buffer.length) {
|
|
67
|
+
const remainingSpace = chunkSize - currentSize;
|
|
68
|
+
const sliceSize = Math.min(remainingSpace, buffer.length - offset);
|
|
69
|
+
currentChunk.push(buffer.slice(offset, offset + sliceSize));
|
|
70
|
+
currentSize += sliceSize;
|
|
71
|
+
offset += sliceSize;
|
|
72
|
+
if (currentSize >= chunkSize) {
|
|
73
|
+
chunks.push(Buffer.concat(currentChunk));
|
|
74
|
+
currentChunk = [];
|
|
75
|
+
currentSize = 0;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (currentChunk.length > 0) {
|
|
80
|
+
chunks.push(Buffer.concat(currentChunk));
|
|
81
|
+
}
|
|
82
|
+
return chunks;
|
|
83
|
+
}
|
|
84
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
85
|
+
0 && (module.exports = {
|
|
86
|
+
streamToBufferChunks
|
|
87
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function (downloadPath: string, rootDirectory?: string | undefined): Promise<(p: string) => any>;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var get_ignore_filter_exports = {};
|
|
30
|
+
__export(get_ignore_filter_exports, {
|
|
31
|
+
default: () => get_ignore_filter_default
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(get_ignore_filter_exports);
|
|
34
|
+
var import_path = __toESM(require("path"));
|
|
35
|
+
var import_fs_extra = __toESM(require("fs-extra"));
|
|
36
|
+
var import_ignore = __toESM(require("ignore"));
|
|
37
|
+
function isCodedError(error) {
|
|
38
|
+
return error !== null && error !== void 0 && error.code !== void 0;
|
|
39
|
+
}
|
|
40
|
+
function clearRelative(s) {
|
|
41
|
+
return s.replace(/(\n|^)\.\//g, "$1");
|
|
42
|
+
}
|
|
43
|
+
async function get_ignore_filter_default(downloadPath, rootDirectory) {
|
|
44
|
+
const readFile = async (p) => {
|
|
45
|
+
try {
|
|
46
|
+
return await import_fs_extra.default.readFile(p, "utf8");
|
|
47
|
+
} catch (error) {
|
|
48
|
+
if (error.code === "ENOENT" || error instanceof Error && error.message.includes("ENOENT")) {
|
|
49
|
+
return void 0;
|
|
50
|
+
}
|
|
51
|
+
throw error;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
const vercelIgnorePath = import_path.default.join(
|
|
55
|
+
downloadPath,
|
|
56
|
+
rootDirectory || "",
|
|
57
|
+
".vercelignore"
|
|
58
|
+
);
|
|
59
|
+
const nowIgnorePath = import_path.default.join(
|
|
60
|
+
downloadPath,
|
|
61
|
+
rootDirectory || "",
|
|
62
|
+
".nowignore"
|
|
63
|
+
);
|
|
64
|
+
const ignoreContents = [];
|
|
65
|
+
try {
|
|
66
|
+
ignoreContents.push(
|
|
67
|
+
...(await Promise.all([readFile(vercelIgnorePath), readFile(nowIgnorePath)])).filter(Boolean)
|
|
68
|
+
);
|
|
69
|
+
} catch (error) {
|
|
70
|
+
if (isCodedError(error) && error.code === "ENOTDIR") {
|
|
71
|
+
console.log(`Warning: Cannot read ignore file from ${vercelIgnorePath}`);
|
|
72
|
+
} else {
|
|
73
|
+
throw error;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (ignoreContents.length === 2) {
|
|
77
|
+
throw new Error(
|
|
78
|
+
"Cannot use both a `.vercelignore` and `.nowignore` file. Please delete the `.nowignore` file."
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
if (ignoreContents.length === 0) {
|
|
82
|
+
return () => false;
|
|
83
|
+
}
|
|
84
|
+
const ignoreFilter = (0, import_ignore.default)().add(clearRelative(ignoreContents[0]));
|
|
85
|
+
return function(p) {
|
|
86
|
+
if (p === "now.json" || p === "vercel.json")
|
|
87
|
+
return false;
|
|
88
|
+
return ignoreFilter.test(p).ignored;
|
|
89
|
+
};
|
|
90
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getInstalledPackageVersion(packageName: string, path?: string | string[]): Promise<string | undefined>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var get_installed_package_version_exports = {};
|
|
30
|
+
__export(get_installed_package_version_exports, {
|
|
31
|
+
getInstalledPackageVersion: () => getInstalledPackageVersion
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(get_installed_package_version_exports);
|
|
34
|
+
var import_debug = __toESM(require("./debug"));
|
|
35
|
+
async function getInstalledPackageVersion(packageName, path) {
|
|
36
|
+
try {
|
|
37
|
+
const resolved = require.resolve(`${packageName}/package.json`, {
|
|
38
|
+
paths: path ? Array.isArray(path) ? path : [path] : [process.cwd()]
|
|
39
|
+
});
|
|
40
|
+
const version = require(resolved).version;
|
|
41
|
+
return version;
|
|
42
|
+
} catch (err) {
|
|
43
|
+
(0, import_debug.default)(
|
|
44
|
+
`Could not resolve package "${packageName}". Package is not installed.`,
|
|
45
|
+
err
|
|
46
|
+
);
|
|
47
|
+
return void 0;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
51
|
+
0 && (module.exports = {
|
|
52
|
+
getInstalledPackageVersion
|
|
53
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var get_platform_env_exports = {};
|
|
20
|
+
__export(get_platform_env_exports, {
|
|
21
|
+
getPlatformEnv: () => getPlatformEnv
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(get_platform_env_exports);
|
|
24
|
+
var import_errors = require("./errors");
|
|
25
|
+
const getPlatformEnv = (name) => {
|
|
26
|
+
const vName = `VERCEL_${name}`;
|
|
27
|
+
const nName = `NOW_${name}`;
|
|
28
|
+
const v = process.env[vName];
|
|
29
|
+
const n = process.env[nName];
|
|
30
|
+
if (typeof v === "string") {
|
|
31
|
+
if (typeof n === "string") {
|
|
32
|
+
throw new import_errors.NowBuildError({
|
|
33
|
+
code: "CONFLICTING_ENV_VAR_NAMES",
|
|
34
|
+
message: `Both "${vName}" and "${nName}" env vars are defined. Please only define the "${vName}" env var.`,
|
|
35
|
+
link: "https://vercel.link/combining-old-and-new-config"
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return v;
|
|
39
|
+
}
|
|
40
|
+
return n;
|
|
41
|
+
};
|
|
42
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
43
|
+
0 && (module.exports = {
|
|
44
|
+
getPlatformEnv
|
|
45
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type Envs = {
|
|
2
|
+
[key: string]: string | undefined;
|
|
3
|
+
};
|
|
4
|
+
/**
|
|
5
|
+
* Get the framework-specific prefixed System Environment Variables.
|
|
6
|
+
* See https://vercel.com/docs/concepts/projects/environment-variables#system-environment-variables
|
|
7
|
+
* @param envPrefix - Prefix, typically from `@vercel/frameworks`
|
|
8
|
+
* @param envs - Environment Variables, typically from `process.env`
|
|
9
|
+
*/
|
|
10
|
+
export declare function getPrefixedEnvVars({ envPrefix, envs, }: {
|
|
11
|
+
envPrefix: string | undefined;
|
|
12
|
+
envs: Envs;
|
|
13
|
+
}): Envs;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var get_prefixed_env_vars_exports = {};
|
|
20
|
+
__export(get_prefixed_env_vars_exports, {
|
|
21
|
+
getPrefixedEnvVars: () => getPrefixedEnvVars
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(get_prefixed_env_vars_exports);
|
|
24
|
+
function getPrefixedEnvVars({
|
|
25
|
+
envPrefix,
|
|
26
|
+
envs
|
|
27
|
+
}) {
|
|
28
|
+
const vercelSystemEnvPrefix = "VERCEL_";
|
|
29
|
+
const allowed = [
|
|
30
|
+
"VERCEL_URL",
|
|
31
|
+
"VERCEL_ENV",
|
|
32
|
+
"VERCEL_REGION",
|
|
33
|
+
"VERCEL_BRANCH_URL",
|
|
34
|
+
"VERCEL_PROJECT_PRODUCTION_URL"
|
|
35
|
+
];
|
|
36
|
+
const newEnvs = {};
|
|
37
|
+
if (envPrefix && envs.VERCEL_URL) {
|
|
38
|
+
Object.keys(envs).filter((key) => allowed.includes(key) || key.startsWith("VERCEL_GIT_")).forEach((key) => {
|
|
39
|
+
const newKey = `${envPrefix}${key}`;
|
|
40
|
+
if (!(newKey in envs)) {
|
|
41
|
+
newEnvs[newKey] = envs[key];
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
newEnvs.TURBO_CI_VENDOR_ENV_KEY = `${envPrefix}${vercelSystemEnvPrefix}`;
|
|
45
|
+
}
|
|
46
|
+
return newEnvs;
|
|
47
|
+
}
|
|
48
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
49
|
+
0 && (module.exports = {
|
|
50
|
+
getPrefixedEnvVars
|
|
51
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function hardLinkDir(src: string, destDirs: string[]): Promise<void>;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var hard_link_dir_exports = {};
|
|
30
|
+
__export(hard_link_dir_exports, {
|
|
31
|
+
hardLinkDir: () => hardLinkDir
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(hard_link_dir_exports);
|
|
34
|
+
var import_path = __toESM(require("path"));
|
|
35
|
+
var import_fs = require("fs");
|
|
36
|
+
async function hardLinkDir(src, destDirs) {
|
|
37
|
+
if (destDirs.length === 0)
|
|
38
|
+
return;
|
|
39
|
+
destDirs = destDirs.filter((destDir) => import_path.default.relative(destDir, src) !== "");
|
|
40
|
+
const files = await import_fs.promises.readdir(src);
|
|
41
|
+
await Promise.all(
|
|
42
|
+
files.map(async (file) => {
|
|
43
|
+
if (file === "node_modules")
|
|
44
|
+
return;
|
|
45
|
+
const srcFile = import_path.default.join(src, file);
|
|
46
|
+
if ((await import_fs.promises.lstat(srcFile)).isDirectory()) {
|
|
47
|
+
const destSubdirs = await Promise.all(
|
|
48
|
+
destDirs.map(async (destDir) => {
|
|
49
|
+
const destSubdir = import_path.default.join(destDir, file);
|
|
50
|
+
try {
|
|
51
|
+
await import_fs.promises.mkdir(destSubdir, { recursive: true });
|
|
52
|
+
} catch (err) {
|
|
53
|
+
if (err.code !== "EEXIST")
|
|
54
|
+
throw err;
|
|
55
|
+
}
|
|
56
|
+
return destSubdir;
|
|
57
|
+
})
|
|
58
|
+
);
|
|
59
|
+
await hardLinkDir(srcFile, destSubdirs);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
await Promise.all(
|
|
63
|
+
destDirs.map(async (destDir) => {
|
|
64
|
+
const destFile = import_path.default.join(destDir, file);
|
|
65
|
+
try {
|
|
66
|
+
await linkOrCopyFile(srcFile, destFile);
|
|
67
|
+
} catch (err) {
|
|
68
|
+
if (err.code === "ENOENT") {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
throw err;
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
);
|
|
75
|
+
})
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
async function linkOrCopyFile(srcFile, destFile) {
|
|
79
|
+
try {
|
|
80
|
+
await linkOrCopy(srcFile, destFile);
|
|
81
|
+
} catch (err) {
|
|
82
|
+
if (err.code === "ENOENT") {
|
|
83
|
+
await import_fs.promises.mkdir(import_path.default.dirname(destFile), { recursive: true });
|
|
84
|
+
await linkOrCopy(srcFile, destFile);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
if (err.code !== "EEXIST") {
|
|
88
|
+
throw err;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
async function linkOrCopy(srcFile, destFile) {
|
|
93
|
+
try {
|
|
94
|
+
await import_fs.promises.link(srcFile, destFile);
|
|
95
|
+
} catch (err) {
|
|
96
|
+
if (err.code !== "EXDEV")
|
|
97
|
+
throw err;
|
|
98
|
+
await import_fs.promises.copyFile(srcFile, destFile);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
102
|
+
0 && (module.exports = {
|
|
103
|
+
hardLinkDir
|
|
104
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import FileBlob from './file-blob';
|
|
2
|
+
import FileFsRef from './file-fs-ref';
|
|
3
|
+
import FileRef from './file-ref';
|
|
4
|
+
import { Lambda, createLambda, getLambdaOptionsFromFunction } from './lambda';
|
|
5
|
+
import { NodejsLambda } from './nodejs-lambda';
|
|
6
|
+
import { Prerender } from './prerender';
|
|
7
|
+
import download, { downloadFile, DownloadedFiles, isSymbolicLink, isDirectory } from './fs/download';
|
|
8
|
+
import getWriteableDirectory from './fs/get-writable-directory';
|
|
9
|
+
import glob, { GlobOptions } from './fs/glob';
|
|
10
|
+
import rename from './fs/rename';
|
|
11
|
+
import { spawnAsync, execCommand, spawnCommand, walkParentDirs, getScriptName, installDependencies, runPackageJsonScript, runNpmInstall, runBundleInstall, runPipInstall, runShellScript, runCustomInstallCommand, getEnvForPackageManager, getNodeVersion, getPathForPackageManager, detectPackageManager, getSpawnOptions, getNodeBinPath, getNodeBinPaths, scanParentDirs, traverseUpDirectories } from './fs/run-user-scripts';
|
|
12
|
+
import { getLatestNodeVersion, getDiscontinuedNodeVersions, getSupportedNodeVersion } from './fs/node-version';
|
|
13
|
+
import streamToBuffer, { streamToBufferChunks } from './fs/stream-to-buffer';
|
|
14
|
+
import debug from './debug';
|
|
15
|
+
import getIgnoreFilter from './get-ignore-filter';
|
|
16
|
+
import { getPlatformEnv } from './get-platform-env';
|
|
17
|
+
import { getPrefixedEnvVars } from './get-prefixed-env-vars';
|
|
18
|
+
import { cloneEnv } from './clone-env';
|
|
19
|
+
import { hardLinkDir } from './hard-link-dir';
|
|
20
|
+
import { validateNpmrc } from './validate-npmrc';
|
|
21
|
+
export { FileBlob, FileFsRef, FileRef, Lambda, NodejsLambda, createLambda, Prerender, download, downloadFile, DownloadedFiles, getWriteableDirectory, glob, GlobOptions, rename, spawnAsync, getScriptName, installDependencies, runPackageJsonScript, execCommand, spawnCommand, walkParentDirs, getNodeBinPath, getNodeBinPaths, getSupportedNodeVersion, detectPackageManager, runNpmInstall, runBundleInstall, runPipInstall, runShellScript, runCustomInstallCommand, getEnvForPackageManager, getNodeVersion, getPathForPackageManager, getLatestNodeVersion, getDiscontinuedNodeVersions, getSpawnOptions, getPlatformEnv, getPrefixedEnvVars, streamToBuffer, streamToBufferChunks, debug, isSymbolicLink, isDirectory, getLambdaOptionsFromFunction, scanParentDirs, getIgnoreFilter, cloneEnv, hardLinkDir, traverseUpDirectories, validateNpmrc, };
|
|
22
|
+
export { EdgeFunction } from './edge-function';
|
|
23
|
+
export { readConfigFile } from './fs/read-config-file';
|
|
24
|
+
export { normalizePath } from './fs/normalize-path';
|
|
25
|
+
export { getOsRelease, getProvidedRuntime } from './os';
|
|
26
|
+
export * from './should-serve';
|
|
27
|
+
export * from './schemas';
|
|
28
|
+
export * from './types';
|
|
29
|
+
export * from './errors';
|
|
30
|
+
export * from './trace';
|
|
31
|
+
export { NODE_VERSIONS } from './fs/node-version';
|
|
32
|
+
export { getInstalledPackageVersion } from './get-installed-package-version';
|
|
33
|
+
export { defaultCachePathGlob } from './default-cache-path-glob';
|