@netlify/zip-it-and-ship-it 5.3.0 → 5.3.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/archive.js +13 -2
- package/dist/runtimes/node/utils/zip.js +2 -2
- package/package.json +2 -3
package/dist/archive.js
CHANGED
|
@@ -28,8 +28,19 @@ const startZip = function (destPath) {
|
|
|
28
28
|
exports.startZip = startZip;
|
|
29
29
|
// Add new file to zip
|
|
30
30
|
const addZipFile = function (archive, file, name, stat) {
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
if (stat.isSymbolicLink()) {
|
|
32
|
+
const linkContent = (0, fs_1.readlinkSync)(file);
|
|
33
|
+
archive.symlink(name, linkContent, stat.mode);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
archive.file(file, {
|
|
37
|
+
name,
|
|
38
|
+
mode: stat.mode,
|
|
39
|
+
// Ensure sha256 stability regardless of mtime
|
|
40
|
+
date: new Date(0),
|
|
41
|
+
stats: stat,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
33
44
|
};
|
|
34
45
|
exports.addZipFile = addZipFile;
|
|
35
46
|
// Add new file content to zip
|
|
@@ -37,7 +37,7 @@ const p_map_1 = __importDefault(require("p-map"));
|
|
|
37
37
|
const unixify_1 = __importDefault(require("unixify"));
|
|
38
38
|
const archive_1 = require("../../../archive");
|
|
39
39
|
const fs_2 = require("../../../utils/fs");
|
|
40
|
-
const
|
|
40
|
+
const pLstat = (0, util_1.promisify)(fs_1.default.lstat);
|
|
41
41
|
const pWriteFile = (0, util_1.promisify)(fs_1.default.writeFile);
|
|
42
42
|
// Taken from https://www.npmjs.com/package/cpy.
|
|
43
43
|
const COPY_FILE_CONCURRENCY = os_1.default.cpus().length === 0 ? 2 : os_1.default.cpus().length * 2;
|
|
@@ -127,7 +127,7 @@ const addEntryFileToZip = function (archive, { contents, filename }) {
|
|
|
127
127
|
};
|
|
128
128
|
const addStat = function (srcFile) {
|
|
129
129
|
return __awaiter(this, void 0, void 0, function* () {
|
|
130
|
-
const stat = yield
|
|
130
|
+
const stat = yield pLstat(srcFile);
|
|
131
131
|
return { srcFile, stat };
|
|
132
132
|
});
|
|
133
133
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/zip-it-and-ship-it",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.1",
|
|
4
4
|
"description": "Zip it and ship it",
|
|
5
5
|
"main": "./dist/main.js",
|
|
6
6
|
"bin": {
|
|
@@ -93,14 +93,13 @@
|
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
95
|
"@babel/types": "^7.15.6",
|
|
96
|
-
"@netlify/eslint-config-node": "^4.0.
|
|
96
|
+
"@netlify/eslint-config-node": "^4.0.2",
|
|
97
97
|
"@types/archiver": "^5.1.1",
|
|
98
98
|
"@types/end-of-stream": "^1.4.1",
|
|
99
99
|
"@types/resolve": "^1.20.1",
|
|
100
100
|
"@types/semver": "^7.3.8",
|
|
101
101
|
"@types/unixify": "^1.0.0",
|
|
102
102
|
"@types/yargs": "^17.0.4",
|
|
103
|
-
"adm-zip": "0.5.5",
|
|
104
103
|
"ava": "^3.0.0",
|
|
105
104
|
"cpy": "^8.0.0",
|
|
106
105
|
"deepmerge": "^4.2.2",
|