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 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<string>;
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*/, 8];
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*/, 7];
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*/, 7];
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*/, 6];
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*/, 6];
80
+ return [3 /*break*/, 7];
81
81
  case 5:
82
- if (item.isDirectory()) {
83
- createDirHash([fullPath], filterFn, hashSum);
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 7:
90
+ case 8:
90
91
  _i++;
91
92
  return [3 /*break*/, 1];
92
- case 8: return [2 /*return*/, hashSum.digest('hex')];
93
+ case 9: return [2 /*return*/, hashSum];
93
94
  }
94
95
  });
95
96
  });
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "amxxpack",
3
3
  "description": "AMXXPack",
4
4
  "author": "Hedgehog Fog",
5
- "version": "1.4.4",
5
+ "version": "1.4.5",
6
6
  "license": "MIT",
7
7
  "main": "lib/builder/index.js",
8
8
  "types": "lib/builder/index.d.ts",