@vercel/build-utils 7.2.5 → 7.3.0
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/CHANGELOG.md +6 -0
- package/dist/fs/node-version.d.ts +3 -68
- package/dist/fs/node-version.js +37 -35
- package/dist/fs/run-user-scripts.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +37 -35
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,74 +1,9 @@
|
|
1
1
|
import { NodeVersion } from '../types';
|
2
2
|
export type NodeVersionMajor = ReturnType<typeof getOptions>[number]['major'];
|
3
|
-
declare
|
4
|
-
|
5
|
-
readonly range: "20.x";
|
6
|
-
readonly runtime: "nodejs20.x";
|
7
|
-
}, {
|
8
|
-
readonly major: 18;
|
9
|
-
readonly range: "18.x";
|
10
|
-
readonly runtime: "nodejs18.x";
|
11
|
-
}, {
|
12
|
-
readonly major: 16;
|
13
|
-
readonly range: "16.x";
|
14
|
-
readonly runtime: "nodejs16.x";
|
15
|
-
readonly discontinueDate: Date;
|
16
|
-
}, {
|
17
|
-
readonly major: 14;
|
18
|
-
readonly range: "14.x";
|
19
|
-
readonly runtime: "nodejs14.x";
|
20
|
-
readonly discontinueDate: Date;
|
21
|
-
}, {
|
22
|
-
readonly major: 12;
|
23
|
-
readonly range: "12.x";
|
24
|
-
readonly runtime: "nodejs12.x";
|
25
|
-
readonly discontinueDate: Date;
|
26
|
-
}, {
|
27
|
-
readonly major: 10;
|
28
|
-
readonly range: "10.x";
|
29
|
-
readonly runtime: "nodejs10.x";
|
30
|
-
readonly discontinueDate: Date;
|
31
|
-
}, {
|
32
|
-
readonly major: 8;
|
33
|
-
readonly range: "8.10.x";
|
34
|
-
readonly runtime: "nodejs8.10";
|
35
|
-
readonly discontinueDate: Date;
|
36
|
-
}];
|
3
|
+
export declare const NODE_VERSIONS: NodeVersion[];
|
4
|
+
declare function getOptions(): NodeVersion[];
|
37
5
|
export declare function getAvailableNodeVersions(): NodeVersionMajor[];
|
38
|
-
export declare function getLatestNodeVersion(availableVersions?: NodeVersionMajor[]):
|
39
|
-
readonly major: 20;
|
40
|
-
readonly range: "20.x";
|
41
|
-
readonly runtime: "nodejs20.x";
|
42
|
-
} | {
|
43
|
-
readonly major: 18;
|
44
|
-
readonly range: "18.x";
|
45
|
-
readonly runtime: "nodejs18.x";
|
46
|
-
} | {
|
47
|
-
readonly major: 16;
|
48
|
-
readonly range: "16.x";
|
49
|
-
readonly runtime: "nodejs16.x";
|
50
|
-
readonly discontinueDate: Date;
|
51
|
-
} | {
|
52
|
-
readonly major: 14;
|
53
|
-
readonly range: "14.x";
|
54
|
-
readonly runtime: "nodejs14.x";
|
55
|
-
readonly discontinueDate: Date;
|
56
|
-
} | {
|
57
|
-
readonly major: 12;
|
58
|
-
readonly range: "12.x";
|
59
|
-
readonly runtime: "nodejs12.x";
|
60
|
-
readonly discontinueDate: Date;
|
61
|
-
} | {
|
62
|
-
readonly major: 10;
|
63
|
-
readonly range: "10.x";
|
64
|
-
readonly runtime: "nodejs10.x";
|
65
|
-
readonly discontinueDate: Date;
|
66
|
-
} | {
|
67
|
-
readonly major: 8;
|
68
|
-
readonly range: "8.10.x";
|
69
|
-
readonly runtime: "nodejs8.10";
|
70
|
-
readonly discontinueDate: Date;
|
71
|
-
};
|
6
|
+
export declare function getLatestNodeVersion(availableVersions?: NodeVersionMajor[]): NodeVersion;
|
72
7
|
export declare function getDiscontinuedNodeVersions(): NodeVersion[];
|
73
8
|
export declare function getSupportedNodeVersion(engineRange: string | undefined, isAuto?: boolean, availableVersions?: NodeVersionMajor[]): Promise<NodeVersion>;
|
74
9
|
export {};
|
package/dist/fs/node-version.js
CHANGED
@@ -28,6 +28,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
29
|
var node_version_exports = {};
|
30
30
|
__export(node_version_exports, {
|
31
|
+
NODE_VERSIONS: () => NODE_VERSIONS,
|
31
32
|
getAvailableNodeVersions: () => getAvailableNodeVersions,
|
32
33
|
getDiscontinuedNodeVersions: () => getDiscontinuedNodeVersions,
|
33
34
|
getLatestNodeVersion: () => getLatestNodeVersion,
|
@@ -38,42 +39,42 @@ var import_fs = require("fs");
|
|
38
39
|
var import_semver = require("semver");
|
39
40
|
var import_errors = require("../errors");
|
40
41
|
var import_debug = __toESM(require("../debug"));
|
42
|
+
const NODE_VERSIONS = [
|
43
|
+
{ major: 20, range: "20.x", runtime: "nodejs20.x" },
|
44
|
+
{ major: 18, range: "18.x", runtime: "nodejs18.x" },
|
45
|
+
{
|
46
|
+
major: 16,
|
47
|
+
range: "16.x",
|
48
|
+
runtime: "nodejs16.x",
|
49
|
+
discontinueDate: /* @__PURE__ */ new Date("2024-02-06")
|
50
|
+
},
|
51
|
+
{
|
52
|
+
major: 14,
|
53
|
+
range: "14.x",
|
54
|
+
runtime: "nodejs14.x",
|
55
|
+
discontinueDate: /* @__PURE__ */ new Date("2023-08-15")
|
56
|
+
},
|
57
|
+
{
|
58
|
+
major: 12,
|
59
|
+
range: "12.x",
|
60
|
+
runtime: "nodejs12.x",
|
61
|
+
discontinueDate: /* @__PURE__ */ new Date("2022-10-03")
|
62
|
+
},
|
63
|
+
{
|
64
|
+
major: 10,
|
65
|
+
range: "10.x",
|
66
|
+
runtime: "nodejs10.x",
|
67
|
+
discontinueDate: /* @__PURE__ */ new Date("2021-04-20")
|
68
|
+
},
|
69
|
+
{
|
70
|
+
major: 8,
|
71
|
+
range: "8.10.x",
|
72
|
+
runtime: "nodejs8.10",
|
73
|
+
discontinueDate: /* @__PURE__ */ new Date("2020-01-06")
|
74
|
+
}
|
75
|
+
];
|
41
76
|
function getOptions() {
|
42
|
-
|
43
|
-
{ major: 20, range: "20.x", runtime: "nodejs20.x" },
|
44
|
-
{ major: 18, range: "18.x", runtime: "nodejs18.x" },
|
45
|
-
{
|
46
|
-
major: 16,
|
47
|
-
range: "16.x",
|
48
|
-
runtime: "nodejs16.x",
|
49
|
-
discontinueDate: /* @__PURE__ */ new Date("2024-02-06")
|
50
|
-
},
|
51
|
-
{
|
52
|
-
major: 14,
|
53
|
-
range: "14.x",
|
54
|
-
runtime: "nodejs14.x",
|
55
|
-
discontinueDate: /* @__PURE__ */ new Date("2023-08-15")
|
56
|
-
},
|
57
|
-
{
|
58
|
-
major: 12,
|
59
|
-
range: "12.x",
|
60
|
-
runtime: "nodejs12.x",
|
61
|
-
discontinueDate: /* @__PURE__ */ new Date("2022-10-03")
|
62
|
-
},
|
63
|
-
{
|
64
|
-
major: 10,
|
65
|
-
range: "10.x",
|
66
|
-
runtime: "nodejs10.x",
|
67
|
-
discontinueDate: /* @__PURE__ */ new Date("2021-04-20")
|
68
|
-
},
|
69
|
-
{
|
70
|
-
major: 8,
|
71
|
-
range: "8.10.x",
|
72
|
-
runtime: "nodejs8.10",
|
73
|
-
discontinueDate: /* @__PURE__ */ new Date("2020-01-06")
|
74
|
-
}
|
75
|
-
];
|
76
|
-
return options;
|
77
|
+
return NODE_VERSIONS;
|
77
78
|
}
|
78
79
|
function isNodeVersionAvailable(version) {
|
79
80
|
try {
|
@@ -151,6 +152,7 @@ function isDiscontinued({ discontinueDate }) {
|
|
151
152
|
}
|
152
153
|
// Annotate the CommonJS export names for ESM import in node:
|
153
154
|
0 && (module.exports = {
|
155
|
+
NODE_VERSIONS,
|
154
156
|
getAvailableNodeVersions,
|
155
157
|
getDiscontinuedNodeVersions,
|
156
158
|
getLatestNodeVersion,
|
@@ -74,7 +74,7 @@ export declare function getNodeBinPath({ cwd, }: {
|
|
74
74
|
export declare function getNodeBinPaths({ start, base, }: TraverseUpDirectoriesProps): string[];
|
75
75
|
export declare function runShellScript(fsPath: string, args?: string[], spawnOpts?: SpawnOptions): Promise<boolean>;
|
76
76
|
export declare function getSpawnOptions(meta: Meta, nodeVersion: NodeVersion): SpawnOptions;
|
77
|
-
export declare function getNodeVersion(destPath: string, nodeVersionFallback?: string | undefined, config?: Config, meta?: Meta, availableVersions?:
|
77
|
+
export declare function getNodeVersion(destPath: string, nodeVersionFallback?: string | undefined, config?: Config, meta?: Meta, availableVersions?: number[]): Promise<NodeVersion>;
|
78
78
|
export declare function scanParentDirs(destPath: string, readPackageJson?: boolean): Promise<ScanParentDirsResult>;
|
79
79
|
export declare function walkParentDirs({ base, start, filename, }: WalkParentDirsProps): Promise<string | null>;
|
80
80
|
export declare function runNpmInstall(destPath: string, args?: string[], spawnOpts?: SpawnOptions, meta?: Meta, nodeVersion?: NodeVersion): Promise<boolean>;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
@@ -20714,6 +20714,7 @@ __export(src_exports, {
|
|
20714
20714
|
FileFsRef: () => file_fs_ref_default,
|
20715
20715
|
FileRef: () => FileRef,
|
20716
20716
|
Lambda: () => Lambda,
|
20717
|
+
NODE_VERSIONS: () => NODE_VERSIONS,
|
20717
20718
|
NodejsLambda: () => NodejsLambda,
|
20718
20719
|
NowBuildError: () => NowBuildError,
|
20719
20720
|
Prerender: () => Prerender,
|
@@ -21591,42 +21592,42 @@ var import_util2 = require("util");
|
|
21591
21592
|
// src/fs/node-version.ts
|
21592
21593
|
var import_fs = require("fs");
|
21593
21594
|
var import_semver = __toESM(require_semver2());
|
21595
|
+
var NODE_VERSIONS = [
|
21596
|
+
{ major: 20, range: "20.x", runtime: "nodejs20.x" },
|
21597
|
+
{ major: 18, range: "18.x", runtime: "nodejs18.x" },
|
21598
|
+
{
|
21599
|
+
major: 16,
|
21600
|
+
range: "16.x",
|
21601
|
+
runtime: "nodejs16.x",
|
21602
|
+
discontinueDate: /* @__PURE__ */ new Date("2024-02-06")
|
21603
|
+
},
|
21604
|
+
{
|
21605
|
+
major: 14,
|
21606
|
+
range: "14.x",
|
21607
|
+
runtime: "nodejs14.x",
|
21608
|
+
discontinueDate: /* @__PURE__ */ new Date("2023-08-15")
|
21609
|
+
},
|
21610
|
+
{
|
21611
|
+
major: 12,
|
21612
|
+
range: "12.x",
|
21613
|
+
runtime: "nodejs12.x",
|
21614
|
+
discontinueDate: /* @__PURE__ */ new Date("2022-10-03")
|
21615
|
+
},
|
21616
|
+
{
|
21617
|
+
major: 10,
|
21618
|
+
range: "10.x",
|
21619
|
+
runtime: "nodejs10.x",
|
21620
|
+
discontinueDate: /* @__PURE__ */ new Date("2021-04-20")
|
21621
|
+
},
|
21622
|
+
{
|
21623
|
+
major: 8,
|
21624
|
+
range: "8.10.x",
|
21625
|
+
runtime: "nodejs8.10",
|
21626
|
+
discontinueDate: /* @__PURE__ */ new Date("2020-01-06")
|
21627
|
+
}
|
21628
|
+
];
|
21594
21629
|
function getOptions() {
|
21595
|
-
|
21596
|
-
{ major: 20, range: "20.x", runtime: "nodejs20.x" },
|
21597
|
-
{ major: 18, range: "18.x", runtime: "nodejs18.x" },
|
21598
|
-
{
|
21599
|
-
major: 16,
|
21600
|
-
range: "16.x",
|
21601
|
-
runtime: "nodejs16.x",
|
21602
|
-
discontinueDate: /* @__PURE__ */ new Date("2024-02-06")
|
21603
|
-
},
|
21604
|
-
{
|
21605
|
-
major: 14,
|
21606
|
-
range: "14.x",
|
21607
|
-
runtime: "nodejs14.x",
|
21608
|
-
discontinueDate: /* @__PURE__ */ new Date("2023-08-15")
|
21609
|
-
},
|
21610
|
-
{
|
21611
|
-
major: 12,
|
21612
|
-
range: "12.x",
|
21613
|
-
runtime: "nodejs12.x",
|
21614
|
-
discontinueDate: /* @__PURE__ */ new Date("2022-10-03")
|
21615
|
-
},
|
21616
|
-
{
|
21617
|
-
major: 10,
|
21618
|
-
range: "10.x",
|
21619
|
-
runtime: "nodejs10.x",
|
21620
|
-
discontinueDate: /* @__PURE__ */ new Date("2021-04-20")
|
21621
|
-
},
|
21622
|
-
{
|
21623
|
-
major: 8,
|
21624
|
-
range: "8.10.x",
|
21625
|
-
runtime: "nodejs8.10",
|
21626
|
-
discontinueDate: /* @__PURE__ */ new Date("2020-01-06")
|
21627
|
-
}
|
21628
|
-
];
|
21629
|
-
return options;
|
21630
|
+
return NODE_VERSIONS;
|
21630
21631
|
}
|
21631
21632
|
function isNodeVersionAvailable(version) {
|
21632
21633
|
try {
|
@@ -22484,6 +22485,7 @@ var buildsSchema = {
|
|
22484
22485
|
FileFsRef,
|
22485
22486
|
FileRef,
|
22486
22487
|
Lambda,
|
22488
|
+
NODE_VERSIONS,
|
22487
22489
|
NodejsLambda,
|
22488
22490
|
NowBuildError,
|
22489
22491
|
Prerender,
|