amxxpack 1.4.3 → 1.4.4

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.
@@ -175,7 +175,9 @@ var Controller = /** @class */ (function () {
175
175
  return [4 /*yield*/, (0, thirdparty_1.default)({
176
176
  name: dependency.name,
177
177
  url: dependency.url,
178
- dir: projectConfig.thirdparty.dir
178
+ dir: projectConfig.thirdparty.dir,
179
+ strip: dependency.strip,
180
+ filter: dependency.filter
179
181
  })];
180
182
  case 4:
181
183
  _b.sent();
@@ -42,6 +42,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
42
42
  var path_1 = __importDefault(require("path"));
43
43
  var mkdirp_1 = __importDefault(require("mkdirp"));
44
44
  var decompress_1 = __importDefault(require("decompress"));
45
+ var globule_1 = __importDefault(require("globule"));
45
46
  var download_1 = __importDefault(require("../../utils/download"));
46
47
  var config_1 = __importDefault(require("../../config"));
47
48
  function downloadThirdparty(options) {
@@ -58,7 +59,14 @@ function downloadThirdparty(options) {
58
59
  return [4 /*yield*/, (0, mkdirp_1.default)(outDir)];
59
60
  case 2:
60
61
  _a.sent();
61
- return [4 /*yield*/, (0, decompress_1.default)(filePath, outDir)];
62
+ return [4 /*yield*/, (0, decompress_1.default)(filePath, outDir, {
63
+ strip: options.strip,
64
+ filter: options.filter && (function (file) { return globule_1.default.isMatch(options.filter, file.path, {
65
+ dot: true,
66
+ nocase: true,
67
+ matchBase: true
68
+ }); })
69
+ })];
62
70
  case 3:
63
71
  _a.sent();
64
72
  return [2 /*return*/];
@@ -2,4 +2,6 @@ export interface IDownloadThirdpartyOptions {
2
2
  name: string;
3
3
  url: string;
4
4
  dir: string;
5
+ strip: number;
6
+ filter?: string | string[];
5
7
  }
@@ -42,7 +42,8 @@ function resolve(overrides, projectDir) {
42
42
  dir: resolvePath(config.compiler.dir),
43
43
  },
44
44
  thirdparty: {
45
- dir: resolvePath(config.thirdparty.dir)
45
+ dir: resolvePath(config.thirdparty.dir),
46
+ dependencies: (0, lodash_1.map)(config.thirdparty.dependencies, function (dependency) { return (__assign(__assign({}, dependency), { strip: dependency.strip || 0 })); })
46
47
  }
47
48
  });
48
49
  return resolvedConfig;
@@ -3,6 +3,12 @@ export interface IAssetInput {
3
3
  dest?: string;
4
4
  filter?: string | string[];
5
5
  }
6
+ export interface IDependency {
7
+ name: string;
8
+ url: string;
9
+ strip?: number;
10
+ filter?: string | string[];
11
+ }
6
12
  export interface IProjectConfig {
7
13
  input: {
8
14
  scripts: null | string | string[];
@@ -25,10 +31,7 @@ export interface IProjectConfig {
25
31
  };
26
32
  thirdparty: {
27
33
  dir: string | null;
28
- dependencies: {
29
- name: string;
30
- url: string;
31
- }[];
34
+ dependencies: IDependency[];
32
35
  };
33
36
  include: null | string[];
34
37
  rules: {
@@ -67,5 +70,8 @@ export interface IResolvedProjectConfig extends IProjectConfig {
67
70
  };
68
71
  thirdparty: IProjectConfig['thirdparty'] & {
69
72
  dir: string;
73
+ dependencies: (IDependency & {
74
+ strip: number;
75
+ })[];
70
76
  };
71
77
  }
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.3",
5
+ "version": "1.4.4",
6
6
  "license": "MIT",
7
7
  "main": "lib/builder/index.js",
8
8
  "types": "lib/builder/index.d.ts",