@vercel/build-utils 5.7.3 → 5.7.5
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/clone-env.js +3 -1
- package/dist/fs/download.d.ts +1 -0
- package/dist/fs/download.js +7 -2
- package/dist/index.js +13 -3
- package/dist/lambda.js +3 -0
- package/package.json +2 -2
package/dist/clone-env.js
CHANGED
@@ -23,7 +23,9 @@ function cloneEnv(...envs) {
|
|
23
23
|
// however we lose this proxied value when we destructure and
|
24
24
|
// thus we must explicitly copy it, but we must also remove the
|
25
25
|
// `Path` property since we can't have both a `PATH` and `Path`
|
26
|
-
obj.
|
26
|
+
if (obj.Path !== undefined) {
|
27
|
+
obj.PATH = obj.Path;
|
28
|
+
}
|
27
29
|
delete obj.Path;
|
28
30
|
}
|
29
31
|
return obj;
|
package/dist/fs/download.d.ts
CHANGED
@@ -3,6 +3,7 @@ import { File, Files, Meta } from '../types';
|
|
3
3
|
export interface DownloadedFiles {
|
4
4
|
[filePath: string]: FileFsRef;
|
5
5
|
}
|
6
|
+
export declare function isDirectory(mode: number): boolean;
|
6
7
|
export declare function isSymbolicLink(mode: number): boolean;
|
7
8
|
export declare function downloadFile(file: File, fsPath: string): Promise<FileFsRef>;
|
8
9
|
export default function download(files: Files, basePath: string, meta?: Meta): Promise<DownloadedFiles>;
|
package/dist/fs/download.js
CHANGED
@@ -3,14 +3,19 @@ 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.downloadFile = exports.isSymbolicLink = void 0;
|
6
|
+
exports.downloadFile = exports.isSymbolicLink = exports.isDirectory = void 0;
|
7
7
|
const path_1 = __importDefault(require("path"));
|
8
8
|
const debug_1 = __importDefault(require("../debug"));
|
9
9
|
const file_fs_ref_1 = __importDefault(require("../file-fs-ref"));
|
10
10
|
const fs_extra_1 = require("fs-extra");
|
11
11
|
const stream_to_buffer_1 = __importDefault(require("./stream-to-buffer"));
|
12
|
-
const
|
12
|
+
const S_IFDIR = 16384; /* 0040000 directory */
|
13
13
|
const S_IFLNK = 40960; /* 0120000 symbolic link */
|
14
|
+
const S_IFMT = 61440; /* 0170000 type of file */
|
15
|
+
function isDirectory(mode) {
|
16
|
+
return (mode & S_IFMT) === S_IFDIR;
|
17
|
+
}
|
18
|
+
exports.isDirectory = isDirectory;
|
14
19
|
function isSymbolicLink(mode) {
|
15
20
|
return (mode & S_IFMT) === S_IFLNK;
|
16
21
|
}
|
package/dist/index.js
CHANGED
@@ -30139,7 +30139,9 @@ function cloneEnv(...envs) {
|
|
30139
30139
|
// however we lose this proxied value when we destructure and
|
30140
30140
|
// thus we must explicitly copy it, but we must also remove the
|
30141
30141
|
// `Path` property since we can't have both a `PATH` and `Path`
|
30142
|
-
obj.
|
30142
|
+
if (obj.Path !== undefined) {
|
30143
|
+
obj.PATH = obj.Path;
|
30144
|
+
}
|
30143
30145
|
delete obj.Path;
|
30144
30146
|
}
|
30145
30147
|
return obj;
|
@@ -30517,14 +30519,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
30517
30519
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
30518
30520
|
};
|
30519
30521
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
30520
|
-
exports.downloadFile = exports.isSymbolicLink = void 0;
|
30522
|
+
exports.downloadFile = exports.isSymbolicLink = exports.isDirectory = void 0;
|
30521
30523
|
const path_1 = __importDefault(__webpack_require__(5622));
|
30522
30524
|
const debug_1 = __importDefault(__webpack_require__(1868));
|
30523
30525
|
const file_fs_ref_1 = __importDefault(__webpack_require__(9331));
|
30524
30526
|
const fs_extra_1 = __webpack_require__(5392);
|
30525
30527
|
const stream_to_buffer_1 = __importDefault(__webpack_require__(2560));
|
30526
|
-
const
|
30528
|
+
const S_IFDIR = 16384; /* 0040000 directory */
|
30527
30529
|
const S_IFLNK = 40960; /* 0120000 symbolic link */
|
30530
|
+
const S_IFMT = 61440; /* 0170000 type of file */
|
30531
|
+
function isDirectory(mode) {
|
30532
|
+
return (mode & S_IFMT) === S_IFDIR;
|
30533
|
+
}
|
30534
|
+
exports.isDirectory = isDirectory;
|
30528
30535
|
function isSymbolicLink(mode) {
|
30529
30536
|
return (mode & S_IFMT) === S_IFLNK;
|
30530
30537
|
}
|
@@ -31755,6 +31762,9 @@ async function createZip(files) {
|
|
31755
31762
|
if (typeof symlinkTarget === 'string') {
|
31756
31763
|
zipFile.addBuffer(Buffer.from(symlinkTarget, 'utf8'), name, opts);
|
31757
31764
|
}
|
31765
|
+
else if (file.mode && download_1.isDirectory(file.mode)) {
|
31766
|
+
zipFile.addEmptyDirectory(name, opts);
|
31767
|
+
}
|
31758
31768
|
else {
|
31759
31769
|
const stream = file.toStream();
|
31760
31770
|
stream.on('error', reject);
|
package/dist/lambda.js
CHANGED
@@ -107,6 +107,9 @@ async function createZip(files) {
|
|
107
107
|
if (typeof symlinkTarget === 'string') {
|
108
108
|
zipFile.addBuffer(Buffer.from(symlinkTarget, 'utf8'), name, opts);
|
109
109
|
}
|
110
|
+
else if (file.mode && download_1.isDirectory(file.mode)) {
|
111
|
+
zipFile.addEmptyDirectory(name, opts);
|
112
|
+
}
|
110
113
|
else {
|
111
114
|
const stream = file.toStream();
|
112
115
|
stream.on('error', reject);
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vercel/build-utils",
|
3
|
-
"version": "5.7.
|
3
|
+
"version": "5.7.5",
|
4
4
|
"license": "MIT",
|
5
5
|
"main": "./dist/index.js",
|
6
6
|
"types": "./dist/index.d.js",
|
@@ -47,5 +47,5 @@
|
|
47
47
|
"typescript": "4.3.4",
|
48
48
|
"yazl": "2.5.1"
|
49
49
|
},
|
50
|
-
"gitHead": "
|
50
|
+
"gitHead": "4c3bc0532216f21f354623ada76b2315ef8ba519"
|
51
51
|
}
|