amxxpack 1.4.4 → 1.4.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/README.md +13 -0
- package/lib/builder/plugins-cache.js +1 -1
- package/lib/utils/create-dir-hash.d.ts +1 -1
- package/lib/utils/create-dir-hash.js +12 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -106,6 +106,19 @@ You can use multiple directories as builder inputs, just specify an array of dir
|
|
|
106
106
|
}
|
|
107
107
|
```
|
|
108
108
|
|
|
109
|
+
### Disabling output
|
|
110
|
+
Use `null` value for outputs to disable copying of specific output.
|
|
111
|
+
|
|
112
|
+
For example, in this case, include files will not be copied to the output folder:
|
|
113
|
+
|
|
114
|
+
```json
|
|
115
|
+
{
|
|
116
|
+
"output": {
|
|
117
|
+
"include": null
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
109
122
|
### Assets filtering and subdirectories
|
|
110
123
|
Using glob filters you can specify which assets should be copied.
|
|
111
124
|
|
|
@@ -157,7 +157,7 @@ var PluginsCache = /** @class */ (function () {
|
|
|
157
157
|
case 0: return [4 /*yield*/, (0, create_dir_hash_1.default)(includeDirs, function (p) { return !p.info.isFile() || path_1.default.parse(p.info.name).ext === '.inc'; })];
|
|
158
158
|
case 1:
|
|
159
159
|
includeHash = _a.sent();
|
|
160
|
-
return [2 /*return*/, includeHash];
|
|
160
|
+
return [2 /*return*/, includeHash.digest('hex')];
|
|
161
161
|
}
|
|
162
162
|
});
|
|
163
163
|
});
|
|
@@ -5,5 +5,5 @@ import crypto from 'crypto';
|
|
|
5
5
|
declare function createDirHash(dirs: string[], filterFn?: (p: {
|
|
6
6
|
dir: string;
|
|
7
7
|
info: fs.Dirent;
|
|
8
|
-
}) => boolean, initialHash?: crypto.Hash): Promise<
|
|
8
|
+
}) => boolean, initialHash?: crypto.Hash): Promise<crypto.Hash>;
|
|
9
9
|
export default createDirHash;
|
|
@@ -54,10 +54,10 @@ function createDirHash(dirs, filterFn, initialHash) {
|
|
|
54
54
|
_i = 0, dirs_1 = dirs;
|
|
55
55
|
_b.label = 1;
|
|
56
56
|
case 1:
|
|
57
|
-
if (!(_i < dirs_1.length)) return [3 /*break*/,
|
|
57
|
+
if (!(_i < dirs_1.length)) return [3 /*break*/, 9];
|
|
58
58
|
dir = dirs_1[_i];
|
|
59
59
|
if (!fs_1.default.existsSync(dir)) {
|
|
60
|
-
return [3 /*break*/,
|
|
60
|
+
return [3 /*break*/, 8];
|
|
61
61
|
}
|
|
62
62
|
return [4 /*yield*/, fs_1.default.promises.readdir(dir, { withFileTypes: true })];
|
|
63
63
|
case 2:
|
|
@@ -65,11 +65,11 @@ function createDirHash(dirs, filterFn, initialHash) {
|
|
|
65
65
|
_a = 0, items_1 = items;
|
|
66
66
|
_b.label = 3;
|
|
67
67
|
case 3:
|
|
68
|
-
if (!(_a < items_1.length)) return [3 /*break*/,
|
|
68
|
+
if (!(_a < items_1.length)) return [3 /*break*/, 8];
|
|
69
69
|
item = items_1[_a];
|
|
70
70
|
fullPath = path_1.default.join(dir, item.name);
|
|
71
71
|
if (filterFn && !filterFn({ dir: dir, info: item })) {
|
|
72
|
-
return [3 /*break*/,
|
|
72
|
+
return [3 /*break*/, 7];
|
|
73
73
|
}
|
|
74
74
|
if (!item.isFile()) return [3 /*break*/, 5];
|
|
75
75
|
return [4 /*yield*/, fs_1.default.promises.stat(fullPath)];
|
|
@@ -77,19 +77,20 @@ function createDirHash(dirs, filterFn, initialHash) {
|
|
|
77
77
|
fileStat = _b.sent();
|
|
78
78
|
data = "".concat(fullPath, ":").concat(fileStat.size, ":").concat(fileStat.mtimeMs);
|
|
79
79
|
hashSum.update(data);
|
|
80
|
-
return [3 /*break*/,
|
|
80
|
+
return [3 /*break*/, 7];
|
|
81
81
|
case 5:
|
|
82
|
-
if (item.isDirectory())
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
_b.label = 6;
|
|
82
|
+
if (!item.isDirectory()) return [3 /*break*/, 7];
|
|
83
|
+
return [4 /*yield*/, createDirHash([fullPath], filterFn, hashSum)];
|
|
86
84
|
case 6:
|
|
85
|
+
_b.sent();
|
|
86
|
+
_b.label = 7;
|
|
87
|
+
case 7:
|
|
87
88
|
_a++;
|
|
88
89
|
return [3 /*break*/, 3];
|
|
89
|
-
case
|
|
90
|
+
case 8:
|
|
90
91
|
_i++;
|
|
91
92
|
return [3 /*break*/, 1];
|
|
92
|
-
case
|
|
93
|
+
case 9: return [2 /*return*/, hashSum];
|
|
93
94
|
}
|
|
94
95
|
});
|
|
95
96
|
});
|