@vercel/build-utils 5.9.0 → 6.0.1
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/fs/rename.d.ts +7 -0
- package/dist/fs/rename.js +12 -4
- package/dist/fs/run-user-scripts.d.ts +0 -5
- package/dist/fs/run-user-scripts.js +1 -36
- package/dist/index.d.ts +2 -2
- package/dist/index.js +50 -74
- package/package.json +2 -2
package/dist/fs/rename.d.ts
CHANGED
@@ -1,4 +1,11 @@
|
|
1
1
|
import { Files } from '../types';
|
2
2
|
declare 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
|
+
*/
|
3
10
|
export default function rename(files: Files, delegate: Delegate): Files;
|
4
11
|
export {};
|
package/dist/fs/rename.js
CHANGED
@@ -1,9 +1,17 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
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
|
+
*/
|
3
10
|
function rename(files, delegate) {
|
4
|
-
|
5
|
-
|
6
|
-
[delegate(name)]
|
7
|
-
}
|
11
|
+
const result = {};
|
12
|
+
for (const [name, file] of Object.entries(files)) {
|
13
|
+
result[delegate(name)] = file;
|
14
|
+
}
|
15
|
+
return result;
|
8
16
|
}
|
9
17
|
exports.default = rename;
|
@@ -56,11 +56,6 @@ export interface SpawnOptionsExtended extends SpawnOptions {
|
|
56
56
|
ignoreNon0Exit?: boolean;
|
57
57
|
}
|
58
58
|
export declare function spawnAsync(command: string, args: string[], opts?: SpawnOptionsExtended): Promise<void>;
|
59
|
-
export declare function execAsync(command: string, args: string[], opts?: SpawnOptionsExtended): Promise<{
|
60
|
-
stdout: string;
|
61
|
-
stderr: string;
|
62
|
-
code: number;
|
63
|
-
}>;
|
64
59
|
export declare function spawnCommand(command: string, options?: SpawnOptions): import("child_process").ChildProcess;
|
65
60
|
export declare function execCommand(command: string, options?: SpawnOptions): Promise<boolean>;
|
66
61
|
export declare function getNodeBinPath({ cwd, }: {
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.installDependencies = exports.getScriptName = exports.runPipInstall = exports.runBundleInstall = exports.runPackageJsonScript = exports.runCustomInstallCommand = exports.getEnvForPackageManager = exports.runNpmInstall = exports.walkParentDirs = exports.scanParentDirs = exports.getNodeVersion = exports.getSpawnOptions = exports.runShellScript = exports.getNodeBinPath = exports.execCommand = exports.spawnCommand = exports.
|
6
|
+
exports.installDependencies = exports.getScriptName = exports.runPipInstall = exports.runBundleInstall = exports.runPackageJsonScript = exports.runCustomInstallCommand = exports.getEnvForPackageManager = exports.runNpmInstall = exports.walkParentDirs = exports.scanParentDirs = exports.getNodeVersion = exports.getSpawnOptions = exports.runShellScript = exports.getNodeBinPath = exports.execCommand = exports.spawnCommand = exports.spawnAsync = void 0;
|
7
7
|
const assert_1 = __importDefault(require("assert"));
|
8
8
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
9
9
|
const path_1 = __importDefault(require("path"));
|
@@ -44,41 +44,6 @@ function spawnAsync(command, args, opts = {}) {
|
|
44
44
|
});
|
45
45
|
}
|
46
46
|
exports.spawnAsync = spawnAsync;
|
47
|
-
function execAsync(command, args, opts = {}) {
|
48
|
-
return new Promise((resolve, reject) => {
|
49
|
-
opts.stdio = 'pipe';
|
50
|
-
const stdoutList = [];
|
51
|
-
const stderrList = [];
|
52
|
-
const child = cross_spawn_1.default(command, args, opts);
|
53
|
-
child.stderr.on('data', data => {
|
54
|
-
stderrList.push(data);
|
55
|
-
});
|
56
|
-
child.stdout.on('data', data => {
|
57
|
-
stdoutList.push(data);
|
58
|
-
});
|
59
|
-
child.on('error', reject);
|
60
|
-
child.on('close', (code, signal) => {
|
61
|
-
if (code === 0 || opts.ignoreNon0Exit) {
|
62
|
-
return resolve({
|
63
|
-
// ignoring the next line due to do some Node.js type issue when we removed hoisting of dependencies in https://github.com/vercel/vercel/pull/9198
|
64
|
-
// should eventually be fixed when this method is remove by https://github.com/vercel/vercel/pull/9200 or we update to Node 16
|
65
|
-
// @ts-ignore
|
66
|
-
code,
|
67
|
-
stdout: Buffer.concat(stdoutList).toString(),
|
68
|
-
stderr: Buffer.concat(stderrList).toString(),
|
69
|
-
});
|
70
|
-
}
|
71
|
-
const cmd = opts.prettyCommand
|
72
|
-
? `Command "${opts.prettyCommand}"`
|
73
|
-
: 'Command';
|
74
|
-
return reject(new errors_1.NowBuildError({
|
75
|
-
code: `BUILD_UTILS_EXEC_${code || signal}`,
|
76
|
-
message: `${cmd} exited with ${code || signal}`,
|
77
|
-
}));
|
78
|
-
});
|
79
|
-
});
|
80
|
-
}
|
81
|
-
exports.execAsync = execAsync;
|
82
47
|
function spawnCommand(command, options = {}) {
|
83
48
|
const opts = { ...options, prettyCommand: command };
|
84
49
|
if (process.platform === 'win32') {
|
package/dist/index.d.ts
CHANGED
@@ -8,7 +8,7 @@ import download, { downloadFile, DownloadedFiles, isSymbolicLink, isDirectory }
|
|
8
8
|
import getWriteableDirectory from './fs/get-writable-directory';
|
9
9
|
import glob, { GlobOptions } from './fs/glob';
|
10
10
|
import rename from './fs/rename';
|
11
|
-
import {
|
11
|
+
import { spawnAsync, execCommand, spawnCommand, walkParentDirs, getScriptName, installDependencies, runPackageJsonScript, runNpmInstall, runBundleInstall, runPipInstall, runShellScript, runCustomInstallCommand, getEnvForPackageManager, getNodeVersion, getSpawnOptions, getNodeBinPath, scanParentDirs } from './fs/run-user-scripts';
|
12
12
|
import { getLatestNodeVersion, getDiscontinuedNodeVersions } from './fs/node-version';
|
13
13
|
import streamToBuffer from './fs/stream-to-buffer';
|
14
14
|
import debug from './debug';
|
@@ -16,7 +16,7 @@ import getIgnoreFilter from './get-ignore-filter';
|
|
16
16
|
import { getPlatformEnv } from './get-platform-env';
|
17
17
|
import { getPrefixedEnvVars } from './get-prefixed-env-vars';
|
18
18
|
import { cloneEnv } from './clone-env';
|
19
|
-
export { FileBlob, FileFsRef, FileRef, Lambda, NodejsLambda, createLambda, Prerender, download, downloadFile, DownloadedFiles, getWriteableDirectory, glob, GlobOptions, rename,
|
19
|
+
export { FileBlob, FileFsRef, FileRef, Lambda, NodejsLambda, createLambda, Prerender, download, downloadFile, DownloadedFiles, getWriteableDirectory, glob, GlobOptions, rename, spawnAsync, getScriptName, installDependencies, runPackageJsonScript, execCommand, spawnCommand, walkParentDirs, getNodeBinPath, runNpmInstall, runBundleInstall, runPipInstall, runShellScript, runCustomInstallCommand, getEnvForPackageManager, getNodeVersion, getLatestNodeVersion, getDiscontinuedNodeVersions, getSpawnOptions, getPlatformEnv, getPrefixedEnvVars, streamToBuffer, debug, isSymbolicLink, isDirectory, getLambdaOptionsFromFunction, scanParentDirs, getIgnoreFilter, cloneEnv, };
|
20
20
|
export { EdgeFunction } from './edge-function';
|
21
21
|
export { readConfigFile } from './fs/read-config-file';
|
22
22
|
export { normalizePath } from './fs/normalize-path';
|
package/dist/index.js
CHANGED
@@ -2323,7 +2323,7 @@ module.exports = Sema
|
|
2323
2323
|
|
2324
2324
|
/***/ }),
|
2325
2325
|
|
2326
|
-
/***/
|
2326
|
+
/***/ 2309:
|
2327
2327
|
/***/ ((module) => {
|
2328
2328
|
|
2329
2329
|
"use strict";
|
@@ -2357,6 +2357,9 @@ function range(a, b, str) {
|
|
2357
2357
|
var i = ai;
|
2358
2358
|
|
2359
2359
|
if (ai >= 0 && bi > 0) {
|
2360
|
+
if(a===b) {
|
2361
|
+
return [ai, bi];
|
2362
|
+
}
|
2360
2363
|
begs = [];
|
2361
2364
|
left = str.length;
|
2362
2365
|
|
@@ -2394,7 +2397,7 @@ function range(a, b, str) {
|
|
2394
2397
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
2395
2398
|
|
2396
2399
|
var concatMap = __webpack_require__(464);
|
2397
|
-
var balanced = __webpack_require__(
|
2400
|
+
var balanced = __webpack_require__(2309);
|
2398
2401
|
|
2399
2402
|
module.exports = expandTop;
|
2400
2403
|
|
@@ -2601,7 +2604,7 @@ function expand(str, isTop) {
|
|
2601
2604
|
/***/ 1602:
|
2602
2605
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
2603
2606
|
|
2604
|
-
var balanced = __webpack_require__(
|
2607
|
+
var balanced = __webpack_require__(2309);
|
2605
2608
|
|
2606
2609
|
module.exports = expandTop;
|
2607
2610
|
|
@@ -2946,8 +2949,8 @@ var isArray = Array.isArray || function (xs) {
|
|
2946
2949
|
|
2947
2950
|
/***/ }),
|
2948
2951
|
|
2949
|
-
/***/
|
2950
|
-
/***/ ((__unused_webpack_module, exports) => {
|
2952
|
+
/***/ 6488:
|
2953
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
2951
2954
|
|
2952
2955
|
// Copyright Joyent, Inc. and other Node contributors.
|
2953
2956
|
//
|
@@ -3051,7 +3054,7 @@ function isPrimitive(arg) {
|
|
3051
3054
|
}
|
3052
3055
|
exports.isPrimitive = isPrimitive;
|
3053
3056
|
|
3054
|
-
exports.isBuffer = Buffer.isBuffer;
|
3057
|
+
exports.isBuffer = __webpack_require__(4293).Buffer.isBuffer;
|
3055
3058
|
|
3056
3059
|
function objectToString(o) {
|
3057
3060
|
return Object.prototype.toString.call(o);
|
@@ -6433,7 +6436,7 @@ function ownProp (obj, field) {
|
|
6433
6436
|
|
6434
6437
|
var fs = __webpack_require__(5747)
|
6435
6438
|
var path = __webpack_require__(5622)
|
6436
|
-
var minimatch = __webpack_require__(
|
6439
|
+
var minimatch = __webpack_require__(8423)
|
6437
6440
|
var isAbsolute = __webpack_require__(5622).isAbsolute
|
6438
6441
|
var Minimatch = minimatch.Minimatch
|
6439
6442
|
|
@@ -6709,7 +6712,7 @@ function childrenIgnored (self, path) {
|
|
6709
6712
|
module.exports = glob
|
6710
6713
|
|
6711
6714
|
var rp = __webpack_require__(1915)
|
6712
|
-
var minimatch = __webpack_require__(
|
6715
|
+
var minimatch = __webpack_require__(8423)
|
6713
6716
|
var Minimatch = minimatch.Minimatch
|
6714
6717
|
var inherits = __webpack_require__(834)
|
6715
6718
|
var EE = __webpack_require__(8614).EventEmitter
|
@@ -7467,7 +7470,7 @@ module.exports = globSync
|
|
7467
7470
|
globSync.GlobSync = GlobSync
|
7468
7471
|
|
7469
7472
|
var rp = __webpack_require__(1915)
|
7470
|
-
var minimatch = __webpack_require__(
|
7473
|
+
var minimatch = __webpack_require__(8423)
|
7471
7474
|
var Minimatch = minimatch.Minimatch
|
7472
7475
|
var Glob = __webpack_require__(2054).Glob
|
7473
7476
|
var util = __webpack_require__(1669)
|
@@ -17921,7 +17924,7 @@ function regExpEscape (s) {
|
|
17921
17924
|
|
17922
17925
|
/***/ }),
|
17923
17926
|
|
17924
|
-
/***/
|
17927
|
+
/***/ 5314:
|
17925
17928
|
/***/ ((module) => {
|
17926
17929
|
|
17927
17930
|
const isWindows = typeof process === 'object' &&
|
@@ -17932,7 +17935,7 @@ module.exports = isWindows ? { sep: '\\' } : { sep: '/' }
|
|
17932
17935
|
|
17933
17936
|
/***/ }),
|
17934
17937
|
|
17935
|
-
/***/
|
17938
|
+
/***/ 8423:
|
17936
17939
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
17937
17940
|
|
17938
17941
|
const minimatch = module.exports = (p, pattern, options = {}) => {
|
@@ -17948,7 +17951,7 @@ const minimatch = module.exports = (p, pattern, options = {}) => {
|
|
17948
17951
|
|
17949
17952
|
module.exports = minimatch
|
17950
17953
|
|
17951
|
-
const path = __webpack_require__(
|
17954
|
+
const path = __webpack_require__(5314)
|
17952
17955
|
minimatch.sep = path.sep
|
17953
17956
|
|
17954
17957
|
const GLOBSTAR = Symbol('globstar **')
|
@@ -18094,7 +18097,9 @@ minimatch.match = (list, pattern, options = {}) => {
|
|
18094
18097
|
|
18095
18098
|
// replace stuff like \* with *
|
18096
18099
|
const globUnescape = s => s.replace(/\\(.)/g, '$1')
|
18100
|
+
const charUnescape = s => s.replace(/\\([^-\]])/g, '$1')
|
18097
18101
|
const regExpEscape = s => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')
|
18102
|
+
const braExpEscape = s => s.replace(/[[\]\\]/g, '\\$&')
|
18098
18103
|
|
18099
18104
|
class Minimatch {
|
18100
18105
|
constructor (pattern, options) {
|
@@ -18180,7 +18185,7 @@ class Minimatch {
|
|
18180
18185
|
negateOffset++
|
18181
18186
|
}
|
18182
18187
|
|
18183
|
-
if (negateOffset) this.pattern = pattern.
|
18188
|
+
if (negateOffset) this.pattern = pattern.slice(negateOffset)
|
18184
18189
|
this.negate = negate
|
18185
18190
|
}
|
18186
18191
|
|
@@ -18429,6 +18434,11 @@ class Minimatch {
|
|
18429
18434
|
}
|
18430
18435
|
|
18431
18436
|
case '\\':
|
18437
|
+
if (inClass && pattern.charAt(i + 1) === '-') {
|
18438
|
+
re += c
|
18439
|
+
continue
|
18440
|
+
}
|
18441
|
+
|
18432
18442
|
clearStateChar()
|
18433
18443
|
escaping = true
|
18434
18444
|
continue
|
@@ -18541,8 +18551,6 @@ class Minimatch {
|
|
18541
18551
|
continue
|
18542
18552
|
}
|
18543
18553
|
|
18544
|
-
// handle the case where we left a class open.
|
18545
|
-
// "[z-a]" is valid, equivalent to "\[z-a\]"
|
18546
18554
|
// split where the last [ was, make sure we don't have
|
18547
18555
|
// an invalid re. if so, re-walk the contents of the
|
18548
18556
|
// would-be class to re-translate any characters that
|
@@ -18552,20 +18560,16 @@ class Minimatch {
|
|
18552
18560
|
// to do safely. For now, this is safe and works.
|
18553
18561
|
cs = pattern.substring(classStart + 1, i)
|
18554
18562
|
try {
|
18555
|
-
RegExp('[' + cs + ']')
|
18563
|
+
RegExp('[' + braExpEscape(charUnescape(cs)) + ']')
|
18564
|
+
// looks good, finish up the class.
|
18565
|
+
re += c
|
18556
18566
|
} catch (er) {
|
18557
|
-
//
|
18558
|
-
|
18559
|
-
re = re.
|
18560
|
-
hasMagic = hasMagic || sp[1]
|
18561
|
-
inClass = false
|
18562
|
-
continue
|
18567
|
+
// out of order ranges in JS are errors, but in glob syntax,
|
18568
|
+
// they're just a range that matches nothing.
|
18569
|
+
re = re.substring(0, reClassStart) + '(?:$.)' // match nothing ever
|
18563
18570
|
}
|
18564
|
-
|
18565
|
-
// finish up the class.
|
18566
18571
|
hasMagic = true
|
18567
18572
|
inClass = false
|
18568
|
-
re += c
|
18569
18573
|
continue
|
18570
18574
|
|
18571
18575
|
default:
|
@@ -18589,9 +18593,9 @@ class Minimatch {
|
|
18589
18593
|
// this is a huge pita. We now have to re-walk
|
18590
18594
|
// the contents of the would-be class to re-translate
|
18591
18595
|
// any characters that were passed through as-is
|
18592
|
-
cs = pattern.
|
18596
|
+
cs = pattern.slice(classStart + 1)
|
18593
18597
|
sp = this.parse(cs, SUBPARSE)
|
18594
|
-
re = re.
|
18598
|
+
re = re.substring(0, reClassStart) + '\\[' + sp[0]
|
18595
18599
|
hasMagic = hasMagic || sp[1]
|
18596
18600
|
}
|
18597
18601
|
|
@@ -20923,7 +20927,7 @@ var objectKeys = Object.keys || function (obj) {
|
|
20923
20927
|
module.exports = Duplex;
|
20924
20928
|
|
20925
20929
|
/*<replacement>*/
|
20926
|
-
var util = Object.create(__webpack_require__(
|
20930
|
+
var util = Object.create(__webpack_require__(6488));
|
20927
20931
|
util.inherits = __webpack_require__(834);
|
20928
20932
|
/*</replacement>*/
|
20929
20933
|
|
@@ -21048,7 +21052,7 @@ module.exports = PassThrough;
|
|
21048
21052
|
var Transform = __webpack_require__(2255);
|
21049
21053
|
|
21050
21054
|
/*<replacement>*/
|
21051
|
-
var util = Object.create(__webpack_require__(
|
21055
|
+
var util = Object.create(__webpack_require__(6488));
|
21052
21056
|
util.inherits = __webpack_require__(834);
|
21053
21057
|
/*</replacement>*/
|
21054
21058
|
|
@@ -21136,7 +21140,7 @@ function _isUint8Array(obj) {
|
|
21136
21140
|
/*</replacement>*/
|
21137
21141
|
|
21138
21142
|
/*<replacement>*/
|
21139
|
-
var util = Object.create(__webpack_require__(
|
21143
|
+
var util = Object.create(__webpack_require__(6488));
|
21140
21144
|
util.inherits = __webpack_require__(834);
|
21141
21145
|
/*</replacement>*/
|
21142
21146
|
|
@@ -22166,7 +22170,7 @@ module.exports = Transform;
|
|
22166
22170
|
var Duplex = __webpack_require__(4501);
|
22167
22171
|
|
22168
22172
|
/*<replacement>*/
|
22169
|
-
var util = Object.create(__webpack_require__(
|
22173
|
+
var util = Object.create(__webpack_require__(6488));
|
22170
22174
|
util.inherits = __webpack_require__(834);
|
22171
22175
|
/*</replacement>*/
|
22172
22176
|
|
@@ -22383,7 +22387,7 @@ var Duplex;
|
|
22383
22387
|
Writable.WritableState = WritableState;
|
22384
22388
|
|
22385
22389
|
/*<replacement>*/
|
22386
|
-
var util = Object.create(__webpack_require__(
|
22390
|
+
var util = Object.create(__webpack_require__(6488));
|
22387
22391
|
util.inherits = __webpack_require__(834);
|
22388
22392
|
/*</replacement>*/
|
22389
22393
|
|
@@ -30951,11 +30955,19 @@ exports.readConfigFile = readConfigFile;
|
|
30951
30955
|
"use strict";
|
30952
30956
|
|
30953
30957
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
30958
|
+
/**
|
30959
|
+
* Renames the keys of a `Files` map.
|
30960
|
+
*
|
30961
|
+
* @param files A map of filenames to `File` instances
|
30962
|
+
* @param delegate A function that returns the new filename
|
30963
|
+
* @returns A new file map with the renamed filenames
|
30964
|
+
*/
|
30954
30965
|
function rename(files, delegate) {
|
30955
|
-
|
30956
|
-
|
30957
|
-
[delegate(name)]
|
30958
|
-
}
|
30966
|
+
const result = {};
|
30967
|
+
for (const [name, file] of Object.entries(files)) {
|
30968
|
+
result[delegate(name)] = file;
|
30969
|
+
}
|
30970
|
+
return result;
|
30959
30971
|
}
|
30960
30972
|
exports.default = rename;
|
30961
30973
|
|
@@ -30971,7 +30983,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
30971
30983
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
30972
30984
|
};
|
30973
30985
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
30974
|
-
exports.installDependencies = exports.getScriptName = exports.runPipInstall = exports.runBundleInstall = exports.runPackageJsonScript = exports.runCustomInstallCommand = exports.getEnvForPackageManager = exports.runNpmInstall = exports.walkParentDirs = exports.scanParentDirs = exports.getNodeVersion = exports.getSpawnOptions = exports.runShellScript = exports.getNodeBinPath = exports.execCommand = exports.spawnCommand = exports.
|
30986
|
+
exports.installDependencies = exports.getScriptName = exports.runPipInstall = exports.runBundleInstall = exports.runPackageJsonScript = exports.runCustomInstallCommand = exports.getEnvForPackageManager = exports.runNpmInstall = exports.walkParentDirs = exports.scanParentDirs = exports.getNodeVersion = exports.getSpawnOptions = exports.runShellScript = exports.getNodeBinPath = exports.execCommand = exports.spawnCommand = exports.spawnAsync = void 0;
|
30975
30987
|
const assert_1 = __importDefault(__webpack_require__(2357));
|
30976
30988
|
const fs_extra_1 = __importDefault(__webpack_require__(6365));
|
30977
30989
|
const path_1 = __importDefault(__webpack_require__(5622));
|
@@ -31012,41 +31024,6 @@ function spawnAsync(command, args, opts = {}) {
|
|
31012
31024
|
});
|
31013
31025
|
}
|
31014
31026
|
exports.spawnAsync = spawnAsync;
|
31015
|
-
function execAsync(command, args, opts = {}) {
|
31016
|
-
return new Promise((resolve, reject) => {
|
31017
|
-
opts.stdio = 'pipe';
|
31018
|
-
const stdoutList = [];
|
31019
|
-
const stderrList = [];
|
31020
|
-
const child = cross_spawn_1.default(command, args, opts);
|
31021
|
-
child.stderr.on('data', data => {
|
31022
|
-
stderrList.push(data);
|
31023
|
-
});
|
31024
|
-
child.stdout.on('data', data => {
|
31025
|
-
stdoutList.push(data);
|
31026
|
-
});
|
31027
|
-
child.on('error', reject);
|
31028
|
-
child.on('close', (code, signal) => {
|
31029
|
-
if (code === 0 || opts.ignoreNon0Exit) {
|
31030
|
-
return resolve({
|
31031
|
-
// ignoring the next line due to do some Node.js type issue when we removed hoisting of dependencies in https://github.com/vercel/vercel/pull/9198
|
31032
|
-
// should eventually be fixed when this method is remove by https://github.com/vercel/vercel/pull/9200 or we update to Node 16
|
31033
|
-
// @ts-ignore
|
31034
|
-
code,
|
31035
|
-
stdout: Buffer.concat(stdoutList).toString(),
|
31036
|
-
stderr: Buffer.concat(stderrList).toString(),
|
31037
|
-
});
|
31038
|
-
}
|
31039
|
-
const cmd = opts.prettyCommand
|
31040
|
-
? `Command "${opts.prettyCommand}"`
|
31041
|
-
: 'Command';
|
31042
|
-
return reject(new errors_1.NowBuildError({
|
31043
|
-
code: `BUILD_UTILS_EXEC_${code || signal}`,
|
31044
|
-
message: `${cmd} exited with ${code || signal}`,
|
31045
|
-
}));
|
31046
|
-
});
|
31047
|
-
});
|
31048
|
-
}
|
31049
|
-
exports.execAsync = execAsync;
|
31050
31027
|
function spawnCommand(command, options = {}) {
|
31051
31028
|
const opts = { ...options, prettyCommand: command };
|
31052
31029
|
if (process.platform === 'win32') {
|
@@ -31661,7 +31638,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
31661
31638
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
31662
31639
|
};
|
31663
31640
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
31664
|
-
exports.normalizePath = exports.readConfigFile = exports.EdgeFunction = exports.cloneEnv = exports.getIgnoreFilter = exports.scanParentDirs = exports.getLambdaOptionsFromFunction = exports.isDirectory = exports.isSymbolicLink = exports.debug = exports.streamToBuffer = exports.getPrefixedEnvVars = exports.getPlatformEnv = exports.getSpawnOptions = exports.getDiscontinuedNodeVersions = exports.getLatestNodeVersion = exports.getNodeVersion = exports.getEnvForPackageManager = exports.runCustomInstallCommand = exports.runShellScript = exports.runPipInstall = exports.runBundleInstall = exports.runNpmInstall = exports.getNodeBinPath = exports.walkParentDirs = exports.spawnCommand = exports.execCommand = exports.runPackageJsonScript = exports.installDependencies = exports.getScriptName = exports.spawnAsync = exports.
|
31641
|
+
exports.normalizePath = exports.readConfigFile = exports.EdgeFunction = exports.cloneEnv = exports.getIgnoreFilter = exports.scanParentDirs = exports.getLambdaOptionsFromFunction = exports.isDirectory = exports.isSymbolicLink = exports.debug = exports.streamToBuffer = exports.getPrefixedEnvVars = exports.getPlatformEnv = exports.getSpawnOptions = exports.getDiscontinuedNodeVersions = exports.getLatestNodeVersion = exports.getNodeVersion = exports.getEnvForPackageManager = exports.runCustomInstallCommand = exports.runShellScript = exports.runPipInstall = exports.runBundleInstall = exports.runNpmInstall = exports.getNodeBinPath = exports.walkParentDirs = exports.spawnCommand = exports.execCommand = exports.runPackageJsonScript = exports.installDependencies = exports.getScriptName = exports.spawnAsync = exports.rename = exports.glob = exports.getWriteableDirectory = exports.downloadFile = exports.download = exports.Prerender = exports.createLambda = exports.NodejsLambda = exports.Lambda = exports.FileRef = exports.FileFsRef = exports.FileBlob = void 0;
|
31665
31642
|
const file_blob_1 = __importDefault(__webpack_require__(8361));
|
31666
31643
|
exports.FileBlob = file_blob_1.default;
|
31667
31644
|
const file_fs_ref_1 = __importDefault(__webpack_require__(6274));
|
@@ -31688,7 +31665,6 @@ exports.glob = glob_1.default;
|
|
31688
31665
|
const rename_1 = __importDefault(__webpack_require__(8430));
|
31689
31666
|
exports.rename = rename_1.default;
|
31690
31667
|
const run_user_scripts_1 = __webpack_require__(5357);
|
31691
|
-
Object.defineProperty(exports, "execAsync", ({ enumerable: true, get: function () { return run_user_scripts_1.execAsync; } }));
|
31692
31668
|
Object.defineProperty(exports, "spawnAsync", ({ enumerable: true, get: function () { return run_user_scripts_1.spawnAsync; } }));
|
31693
31669
|
Object.defineProperty(exports, "execCommand", ({ enumerable: true, get: function () { return run_user_scripts_1.execCommand; } }));
|
31694
31670
|
Object.defineProperty(exports, "spawnCommand", ({ enumerable: true, get: function () { return run_user_scripts_1.spawnCommand; } }));
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vercel/build-utils",
|
3
|
-
"version": "
|
3
|
+
"version": "6.0.1",
|
4
4
|
"license": "MIT",
|
5
5
|
"main": "./dist/index.js",
|
6
6
|
"types": "./dist/index.d.js",
|
@@ -51,5 +51,5 @@
|
|
51
51
|
"typescript": "4.3.4",
|
52
52
|
"yazl": "2.5.1"
|
53
53
|
},
|
54
|
-
"gitHead": "
|
54
|
+
"gitHead": "ada9a48d57be8f4375494a369aaa98cee1f5eae2"
|
55
55
|
}
|