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.

Files changed (99) hide show
  1. vercel_cli/vendor/LICENSE +202 -0
  2. vercel_cli/vendor/README.md +63 -0
  3. vercel_cli/vendor/dist/VERCEL_DIR_README.txt +11 -0
  4. vercel_cli/vendor/dist/builder-worker.js +62 -0
  5. vercel_cli/vendor/dist/get-latest-worker.js +272 -0
  6. vercel_cli/vendor/dist/index.js +172693 -0
  7. vercel_cli/vendor/dist/vc.js +11 -0
  8. vercel_cli/vendor/node_modules/.package-lock.json +18 -0
  9. vercel_cli/vendor/node_modules/@vercel/build-utils/CHANGELOG.md +488 -0
  10. vercel_cli/vendor/node_modules/@vercel/build-utils/LICENSE +202 -0
  11. vercel_cli/vendor/node_modules/@vercel/build-utils/build.mjs +3 -0
  12. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/clone-env.d.ts +10 -0
  13. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/clone-env.js +43 -0
  14. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/debug.d.ts +1 -0
  15. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/debug.js +31 -0
  16. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/default-cache-path-glob.d.ts +1 -0
  17. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/default-cache-path-glob.js +28 -0
  18. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/edge-function.d.ts +41 -0
  19. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/edge-function.js +40 -0
  20. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/errors.d.ts +39 -0
  21. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/errors.js +95 -0
  22. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/file-blob.d.ts +23 -0
  23. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/file-blob.js +67 -0
  24. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/file-fs-ref.d.ts +27 -0
  25. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/file-fs-ref.js +113 -0
  26. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/file-ref.d.ts +38 -0
  27. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/file-ref.js +147 -0
  28. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/download.d.ts +9 -0
  29. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/download.js +136 -0
  30. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/get-writable-directory.d.ts +1 -0
  31. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/get-writable-directory.js +32 -0
  32. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/glob.d.ts +10 -0
  33. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/glob.js +111 -0
  34. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/node-version.d.ts +9 -0
  35. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/node-version.js +180 -0
  36. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/normalize-path.d.ts +4 -0
  37. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/normalize-path.js +31 -0
  38. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/read-config-file.d.ts +1 -0
  39. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/read-config-file.js +76 -0
  40. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/rename.d.ts +11 -0
  41. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/rename.js +30 -0
  42. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/run-user-scripts.d.ts +206 -0
  43. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/run-user-scripts.js +944 -0
  44. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/stream-to-buffer.d.ts +3 -0
  45. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/stream-to-buffer.js +87 -0
  46. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/get-ignore-filter.d.ts +1 -0
  47. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/get-ignore-filter.js +90 -0
  48. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/get-installed-package-version.d.ts +1 -0
  49. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/get-installed-package-version.js +53 -0
  50. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/get-platform-env.d.ts +5 -0
  51. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/get-platform-env.js +45 -0
  52. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/get-prefixed-env-vars.d.ts +14 -0
  53. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/get-prefixed-env-vars.js +51 -0
  54. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/hard-link-dir.d.ts +1 -0
  55. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/hard-link-dir.js +104 -0
  56. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/index.d.ts +33 -0
  57. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/index.js +24390 -0
  58. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/lambda.d.ts +81 -0
  59. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/lambda.js +231 -0
  60. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/nodejs-lambda.d.ts +16 -0
  61. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/nodejs-lambda.js +44 -0
  62. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/os.d.ts +3 -0
  63. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/os.js +62 -0
  64. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/prerender.d.ts +37 -0
  65. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/prerender.js +169 -0
  66. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/schemas.d.ts +60 -0
  67. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/schemas.js +87 -0
  68. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/should-serve.d.ts +2 -0
  69. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/should-serve.js +47 -0
  70. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/trace/constants.d.ts +2 -0
  71. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/trace/constants.js +31 -0
  72. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/trace/index.d.ts +3 -0
  73. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/trace/index.js +33 -0
  74. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/trace/trace.d.ts +37 -0
  75. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/trace/trace.js +92 -0
  76. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/types.d.ts +503 -0
  77. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/types.js +51 -0
  78. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/validate-npmrc.d.ts +12 -0
  79. vercel_cli/vendor/node_modules/@vercel/build-utils/dist/validate-npmrc.js +41 -0
  80. vercel_cli/vendor/node_modules/@vercel/build-utils/file-blob.js +1 -0
  81. vercel_cli/vendor/node_modules/@vercel/build-utils/file-fs-ref.js +1 -0
  82. vercel_cli/vendor/node_modules/@vercel/build-utils/file-ref.js +1 -0
  83. vercel_cli/vendor/node_modules/@vercel/build-utils/fs/download.js +1 -0
  84. vercel_cli/vendor/node_modules/@vercel/build-utils/fs/get-writable-directory.js +1 -0
  85. vercel_cli/vendor/node_modules/@vercel/build-utils/fs/glob.js +1 -0
  86. vercel_cli/vendor/node_modules/@vercel/build-utils/fs/rename.js +1 -0
  87. vercel_cli/vendor/node_modules/@vercel/build-utils/fs/run-user-scripts.js +1 -0
  88. vercel_cli/vendor/node_modules/@vercel/build-utils/fs/stream-to-buffer.js +1 -0
  89. vercel_cli/vendor/node_modules/@vercel/build-utils/lambda.js +1 -0
  90. vercel_cli/vendor/node_modules/@vercel/build-utils/package.json +60 -0
  91. vercel_cli/vendor/node_modules/@vercel/python/LICENSE +202 -0
  92. vercel_cli/vendor/node_modules/@vercel/python/dist/index.js +3132 -0
  93. vercel_cli/vendor/node_modules/@vercel/python/package.json +36 -0
  94. vercel_cli/vendor/node_modules/@vercel/python/vc_init.py +681 -0
  95. vercel_cli/vendor/package.json +40 -0
  96. vercel_cli-41.1.0.dist-info/METADATA +188 -0
  97. vercel_cli-41.1.0.dist-info/RECORD +99 -0
  98. vercel_cli-41.1.0.dist-info/WHEEL +4 -0
  99. vercel_cli-41.1.0.dist-info/entry_points.txt +3 -0
@@ -0,0 +1,180 @@
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 node_version_exports = {};
30
+ __export(node_version_exports, {
31
+ NODE_VERSIONS: () => NODE_VERSIONS,
32
+ getAvailableNodeVersions: () => getAvailableNodeVersions,
33
+ getDiscontinuedNodeVersions: () => getDiscontinuedNodeVersions,
34
+ getLatestNodeVersion: () => getLatestNodeVersion,
35
+ getSupportedNodeVersion: () => getSupportedNodeVersion
36
+ });
37
+ module.exports = __toCommonJS(node_version_exports);
38
+ var import_fs = require("fs");
39
+ var import_semver = require("semver");
40
+ var import_types = require("../types");
41
+ var import_errors = require("../errors");
42
+ var import_debug = __toESM(require("../debug"));
43
+ const NODE_VERSIONS = [
44
+ new import_types.NodeVersion({
45
+ major: 22,
46
+ range: "22.x",
47
+ runtime: "nodejs22.x"
48
+ }),
49
+ new import_types.NodeVersion({
50
+ major: 20,
51
+ range: "20.x",
52
+ runtime: "nodejs20.x"
53
+ }),
54
+ new import_types.NodeVersion({
55
+ major: 18,
56
+ range: "18.x",
57
+ runtime: "nodejs18.x"
58
+ }),
59
+ new import_types.NodeVersion({
60
+ major: 16,
61
+ range: "16.x",
62
+ runtime: "nodejs16.x",
63
+ discontinueDate: /* @__PURE__ */ new Date("2025-02-03")
64
+ }),
65
+ new import_types.NodeVersion({
66
+ major: 14,
67
+ range: "14.x",
68
+ runtime: "nodejs14.x",
69
+ discontinueDate: /* @__PURE__ */ new Date("2023-08-15")
70
+ }),
71
+ new import_types.NodeVersion({
72
+ major: 12,
73
+ range: "12.x",
74
+ runtime: "nodejs12.x",
75
+ discontinueDate: /* @__PURE__ */ new Date("2022-10-03")
76
+ }),
77
+ new import_types.NodeVersion({
78
+ major: 10,
79
+ range: "10.x",
80
+ runtime: "nodejs10.x",
81
+ discontinueDate: /* @__PURE__ */ new Date("2021-04-20")
82
+ }),
83
+ new import_types.NodeVersion({
84
+ major: 8,
85
+ range: "8.10.x",
86
+ runtime: "nodejs8.10",
87
+ discontinueDate: /* @__PURE__ */ new Date("2020-01-06")
88
+ })
89
+ ];
90
+ function getOptions() {
91
+ return NODE_VERSIONS;
92
+ }
93
+ function isNodeVersionAvailable(version) {
94
+ try {
95
+ return (0, import_fs.statSync)(`/node${version.major}`).isDirectory();
96
+ } catch {
97
+ }
98
+ return false;
99
+ }
100
+ function getAvailableNodeVersions() {
101
+ return getOptions().filter(isNodeVersionAvailable).map((n) => n.major);
102
+ }
103
+ function getHint(isAuto = false, availableVersions) {
104
+ const { major, range } = getLatestNodeVersion(availableVersions);
105
+ return isAuto ? `Please set Node.js Version to ${range} in your Project Settings to use Node.js ${major}.` : `Please set "engines": { "node": "${range}" } in your \`package.json\` file to use Node.js ${major}.`;
106
+ }
107
+ function getLatestNodeVersion(availableVersions) {
108
+ const all = getOptions();
109
+ if (availableVersions) {
110
+ for (const version of all) {
111
+ for (const major of availableVersions) {
112
+ if (version.major === major) {
113
+ return version;
114
+ }
115
+ }
116
+ }
117
+ }
118
+ return all[0];
119
+ }
120
+ function getDiscontinuedNodeVersions() {
121
+ return getOptions().filter((version) => {
122
+ return version.state === "discontinued";
123
+ });
124
+ }
125
+ async function getSupportedNodeVersion(engineRange, isAuto = false, availableVersions) {
126
+ let selection;
127
+ if (engineRange) {
128
+ const found = (0, import_semver.validRange)(engineRange) && getOptions().some((o) => {
129
+ selection = o;
130
+ return (0, import_semver.intersects)(o.range, engineRange) && (availableVersions?.length ? availableVersions.includes(o.major) : true);
131
+ });
132
+ if (!found) {
133
+ throw new import_errors.NowBuildError({
134
+ code: "BUILD_UTILS_NODE_VERSION_INVALID",
135
+ link: "http://vercel.link/node-version",
136
+ message: `Found invalid Node.js Version: "${engineRange}". ${getHint(
137
+ isAuto,
138
+ availableVersions
139
+ )}`
140
+ });
141
+ }
142
+ }
143
+ if (!selection) {
144
+ selection = getLatestNodeVersion(availableVersions);
145
+ }
146
+ if (selection.state === "discontinued") {
147
+ const intro = `Node.js Version "${selection.range}" is discontinued and must be upgraded.`;
148
+ throw new import_errors.NowBuildError({
149
+ code: "BUILD_UTILS_NODE_VERSION_DISCONTINUED",
150
+ link: "http://vercel.link/node-version",
151
+ message: `${intro} ${getHint(isAuto)}`
152
+ });
153
+ }
154
+ (0, import_debug.default)(`Selected Node.js ${selection.range}`);
155
+ if (selection.state === "deprecated") {
156
+ const d = selection.formattedDate;
157
+ if (d) {
158
+ console.warn(
159
+ `Error: Node.js version ${selection.range} is deprecated. Deployments created on or after ${d} will fail to build. ${getHint(
160
+ isAuto
161
+ )}`
162
+ );
163
+ } else {
164
+ console.warn(
165
+ `Error: Node.js version ${selection.range} is deprecated. ${getHint(
166
+ isAuto
167
+ )}`
168
+ );
169
+ }
170
+ }
171
+ return selection;
172
+ }
173
+ // Annotate the CommonJS export names for ESM import in node:
174
+ 0 && (module.exports = {
175
+ NODE_VERSIONS,
176
+ getAvailableNodeVersions,
177
+ getDiscontinuedNodeVersions,
178
+ getLatestNodeVersion,
179
+ getSupportedNodeVersion
180
+ });
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Convert Windows separators to Unix separators.
3
+ */
4
+ export declare function normalizePath(p: string): string;
@@ -0,0 +1,31 @@
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 normalize_path_exports = {};
20
+ __export(normalize_path_exports, {
21
+ normalizePath: () => normalizePath
22
+ });
23
+ module.exports = __toCommonJS(normalize_path_exports);
24
+ const isWin = process.platform === "win32";
25
+ function normalizePath(p) {
26
+ return isWin ? p.replace(/\\/g, "/") : p;
27
+ }
28
+ // Annotate the CommonJS export names for ESM import in node:
29
+ 0 && (module.exports = {
30
+ normalizePath
31
+ });
@@ -0,0 +1 @@
1
+ export declare function readConfigFile<T>(files: string | string[]): Promise<T | null>;
@@ -0,0 +1,76 @@
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 read_config_file_exports = {};
30
+ __export(read_config_file_exports, {
31
+ readConfigFile: () => readConfigFile
32
+ });
33
+ module.exports = __toCommonJS(read_config_file_exports);
34
+ var import_js_yaml = __toESM(require("js-yaml"));
35
+ var import_toml = __toESM(require("@iarna/toml"));
36
+ var import_fs_extra = require("fs-extra");
37
+ var import_error_utils = require("@vercel/error-utils");
38
+ async function readFileOrNull(file) {
39
+ try {
40
+ const data = await (0, import_fs_extra.readFile)(file);
41
+ return data;
42
+ } catch (error) {
43
+ if (!(0, import_error_utils.isErrnoException)(error)) {
44
+ throw error;
45
+ }
46
+ if (error.code !== "ENOENT") {
47
+ throw error;
48
+ }
49
+ }
50
+ return null;
51
+ }
52
+ async function readConfigFile(files) {
53
+ files = Array.isArray(files) ? files : [files];
54
+ for (const name of files) {
55
+ const data = await readFileOrNull(name);
56
+ if (data) {
57
+ const str = data.toString("utf8");
58
+ try {
59
+ if (name.endsWith(".json")) {
60
+ return JSON.parse(str);
61
+ } else if (name.endsWith(".toml")) {
62
+ return import_toml.default.parse(str);
63
+ } else if (name.endsWith(".yaml") || name.endsWith(".yml")) {
64
+ return import_js_yaml.default.safeLoad(str, { filename: name });
65
+ }
66
+ } catch (error) {
67
+ console.log(`Error while parsing config file: "${name}"`);
68
+ }
69
+ }
70
+ }
71
+ return null;
72
+ }
73
+ // Annotate the CommonJS export names for ESM import in node:
74
+ 0 && (module.exports = {
75
+ readConfigFile
76
+ });
@@ -0,0 +1,11 @@
1
+ import { Files } from '../types';
2
+ type Delegate = (name: string) => string;
3
+ /**
4
+ * Renames the keys of a `Files` map.
5
+ *
6
+ * @param files A map of filenames to `File` instances
7
+ * @param delegate A function that returns the new filename
8
+ * @returns A new file map with the renamed filenames
9
+ */
10
+ export default function rename(files: Files, delegate: Delegate): Files;
11
+ export {};
@@ -0,0 +1,30 @@
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 rename_exports = {};
20
+ __export(rename_exports, {
21
+ default: () => rename
22
+ });
23
+ module.exports = __toCommonJS(rename_exports);
24
+ function rename(files, delegate) {
25
+ const result = {};
26
+ for (const [name, file] of Object.entries(files)) {
27
+ result[delegate(name)] = file;
28
+ }
29
+ return result;
30
+ }
@@ -0,0 +1,206 @@
1
+ /// <reference types="node" />
2
+ import { SpawnOptions } from 'child_process';
3
+ import { Meta, PackageJson, NodeVersion, Config } from '../types';
4
+ export type CliType = 'yarn' | 'npm' | 'pnpm' | 'bun';
5
+ export interface ScanParentDirsResult {
6
+ /**
7
+ * "yarn", "npm", or "pnpm" depending on the presence of lockfiles.
8
+ */
9
+ cliType: CliType;
10
+ /**
11
+ * The file path of found `package.json` file, or `undefined` if not found.
12
+ */
13
+ packageJsonPath?: string;
14
+ /**
15
+ * The contents of found `package.json` file, when the `readPackageJson`
16
+ * option is enabled.
17
+ */
18
+ packageJson?: PackageJson;
19
+ /**
20
+ * The file path of the lockfile (`yarn.lock`, `package-lock.json`, or `pnpm-lock.yaml`)
21
+ * or `undefined` if not found.
22
+ */
23
+ lockfilePath?: string;
24
+ /**
25
+ * The `lockfileVersion` number from lockfile (`package-lock.json` or `pnpm-lock.yaml`),
26
+ * or `undefined` if not found.
27
+ */
28
+ lockfileVersion?: number;
29
+ /**
30
+ * The contents of the `packageManager` field from `package.json` if found.
31
+ * The value may come from a different `package.json` file than the one
32
+ * specified by `packageJsonPath`, in the case of a monorepo.
33
+ */
34
+ packageJsonPackageManager?: string;
35
+ /**
36
+ * Whether Turborepo supports the `COREPACK_HOME` environment variable.
37
+ * `undefined` if not a Turborepo project.
38
+ */
39
+ turboSupportsCorepackHome?: boolean;
40
+ }
41
+ export interface TraverseUpDirectoriesProps {
42
+ /**
43
+ * The directory to start iterating from, typically the same directory of the entrypoint.
44
+ */
45
+ start: string;
46
+ /**
47
+ * The highest directory, typically the workPath root of the project.
48
+ */
49
+ base?: string;
50
+ }
51
+ export interface WalkParentDirsProps extends Required<TraverseUpDirectoriesProps> {
52
+ /**
53
+ * The name of the file to search for, typically `package.json` or `Gemfile`.
54
+ */
55
+ filename: string;
56
+ }
57
+ export interface WalkParentDirsMultiProps extends Required<TraverseUpDirectoriesProps> {
58
+ /**
59
+ * The name of the file to search for, typically `package.json` or `Gemfile`.
60
+ */
61
+ filenames: string[];
62
+ }
63
+ export interface SpawnOptionsExtended extends SpawnOptions {
64
+ /**
65
+ * Pretty formatted command that is being spawned for logging purposes.
66
+ */
67
+ prettyCommand?: string;
68
+ /**
69
+ * Returns instead of throwing an error when the process exits with a
70
+ * non-0 exit code. When relevant, the returned object will include
71
+ * the error code, stdout and stderr.
72
+ */
73
+ ignoreNon0Exit?: boolean;
74
+ }
75
+ export declare function spawnAsync(command: string, args: string[], opts?: SpawnOptionsExtended): Promise<void>;
76
+ export declare function spawnCommand(command: string, options?: SpawnOptions): import("child_process").ChildProcess;
77
+ export declare function execCommand(command: string, options?: SpawnOptions): Promise<boolean>;
78
+ export declare function traverseUpDirectories({ start, base, }: TraverseUpDirectoriesProps): Generator<string, void, unknown>;
79
+ /**
80
+ * @deprecated Use `getNodeBinPaths()` instead.
81
+ */
82
+ export declare function getNodeBinPath({ cwd, }: {
83
+ cwd: string;
84
+ }): Promise<string>;
85
+ export declare function getNodeBinPaths({ start, base, }: TraverseUpDirectoriesProps): string[];
86
+ export declare function runShellScript(fsPath: string, args?: string[], spawnOpts?: SpawnOptions): Promise<boolean>;
87
+ export declare function getSpawnOptions(meta: Meta, nodeVersion: NodeVersion): SpawnOptions;
88
+ export declare function getNodeVersion(destPath: string, fallbackVersion?: string | undefined, config?: Config, meta?: Meta, availableVersions?: number[]): Promise<NodeVersion>;
89
+ export declare function scanParentDirs(destPath: string, readPackageJson?: boolean, base?: string): Promise<ScanParentDirsResult>;
90
+ export declare function turboVersionSpecifierSupportsCorepack(turboVersionSpecifier: string): boolean;
91
+ export declare function usingCorepack(env: {
92
+ [x: string]: string | undefined;
93
+ }, packageJsonPackageManager: string | undefined, turboSupportsCorepackHome: boolean | undefined): boolean;
94
+ export declare function walkParentDirs({ base, start, filename, }: WalkParentDirsProps): Promise<string | null>;
95
+ export declare function runNpmInstall(destPath: string, args?: string[], spawnOpts?: SpawnOptions, meta?: Meta, nodeVersion?: NodeVersion): Promise<boolean>;
96
+ /**
97
+ * Prepares the input environment based on the used package manager and lockfile
98
+ * versions.
99
+ */
100
+ export declare function getEnvForPackageManager({ cliType, lockfileVersion, packageJsonPackageManager, nodeVersion, env, packageJsonEngines, turboSupportsCorepackHome, }: {
101
+ cliType: CliType;
102
+ lockfileVersion: number | undefined;
103
+ packageJsonPackageManager?: string | undefined;
104
+ nodeVersion: NodeVersion | undefined;
105
+ env: {
106
+ [x: string]: string | undefined;
107
+ };
108
+ packageJsonEngines?: PackageJson.Engines;
109
+ turboSupportsCorepackHome?: boolean | undefined;
110
+ }): {
111
+ [x: string]: string | undefined;
112
+ };
113
+ /**
114
+ * Helper to get the binary paths that link to the used package manager.
115
+ * Note: Make sure it doesn't contain any `console.log` calls.
116
+ */
117
+ export declare function getPathOverrideForPackageManager({ cliType, lockfileVersion, corepackPackageManager, corepackEnabled, packageJsonEngines, }: {
118
+ cliType: CliType;
119
+ lockfileVersion: number | undefined;
120
+ corepackPackageManager: string | undefined;
121
+ nodeVersion: NodeVersion | undefined;
122
+ corepackEnabled?: boolean;
123
+ packageJsonEngines?: PackageJson.Engines;
124
+ }): {
125
+ /**
126
+ * Which lockfile was detected.
127
+ */
128
+ detectedLockfile: string | undefined;
129
+ /**
130
+ * Detected package manager that generated the found lockfile.
131
+ */
132
+ detectedPackageManager: string | undefined;
133
+ /**
134
+ * Value of $PATH that includes the binaries for the detected package manager.
135
+ * Undefined if no $PATH are necessary.
136
+ */
137
+ path: string | undefined;
138
+ };
139
+ export declare function detectPackageManager(cliType: CliType, lockfileVersion: number | undefined): {
140
+ path: string;
141
+ detectedLockfile: string;
142
+ detectedPackageManager: string;
143
+ pnpmVersionRange: string;
144
+ } | {
145
+ path: undefined;
146
+ detectedLockfile: string;
147
+ detectedPackageManager: string;
148
+ pnpmVersionRange: string;
149
+ } | {
150
+ path: string;
151
+ detectedLockfile: string;
152
+ detectedPackageManager: string;
153
+ pnpmVersionRange?: undefined;
154
+ } | {
155
+ path: undefined;
156
+ detectedLockfile: string;
157
+ detectedPackageManager: string;
158
+ pnpmVersionRange?: undefined;
159
+ } | undefined;
160
+ /**
161
+ * Helper to get the binary paths that link to the used package manager.
162
+ * Note: Make sure it doesn't contain any `console.log` calls.
163
+ * @deprecated use `getEnvForPackageManager` instead
164
+ */
165
+ export declare function getPathForPackageManager({ cliType, lockfileVersion, nodeVersion, env, }: {
166
+ cliType: CliType;
167
+ lockfileVersion: number | undefined;
168
+ nodeVersion: NodeVersion | undefined;
169
+ env: {
170
+ [x: string]: string | undefined;
171
+ };
172
+ }): {
173
+ /**
174
+ * Which lockfile was detected.
175
+ */
176
+ detectedLockfile: string | undefined;
177
+ /**
178
+ * Detected package manager that generated the found lockfile.
179
+ */
180
+ detectedPackageManager: string | undefined;
181
+ /**
182
+ * Value of $PATH that includes the binaries for the detected package manager.
183
+ * Undefined if no $PATH are necessary.
184
+ */
185
+ path: string | undefined;
186
+ /**
187
+ * Set if yarn was identified as package manager and `YARN_NODE_LINKER`
188
+ * environment variable was not found on the input environment.
189
+ */
190
+ yarnNodeLinker: string | undefined;
191
+ };
192
+ export declare function runCustomInstallCommand({ destPath, installCommand, nodeVersion, spawnOpts, }: {
193
+ destPath: string;
194
+ installCommand: string;
195
+ nodeVersion: NodeVersion;
196
+ spawnOpts?: SpawnOptions;
197
+ }): Promise<void>;
198
+ export declare function runPackageJsonScript(destPath: string, scriptNames: string | Iterable<string>, spawnOpts?: SpawnOptions): Promise<boolean>;
199
+ export declare function runBundleInstall(destPath: string, args?: string[], spawnOpts?: SpawnOptions, meta?: Meta): Promise<void>;
200
+ export declare function runPipInstall(destPath: string, args?: string[], spawnOpts?: SpawnOptions, meta?: Meta): Promise<void>;
201
+ export declare function getScriptName(pkg: Pick<PackageJson, 'scripts'> | null | undefined, possibleNames: Iterable<string>): string | undefined;
202
+ /**
203
+ * @deprecate installDependencies() is deprecated.
204
+ * Please use runNpmInstall() instead.
205
+ */
206
+ export declare const installDependencies: typeof runNpmInstall;