@forge/cli-shared 3.14.1-next.1 → 3.15.0-next.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @forge/cli-shared
2
2
 
3
+ ## 3.15.0-next.3
4
+
5
+ ### Minor Changes
6
+
7
+ - 8467b94a: CLI Lint error handling
8
+
9
+ ## 3.14.1-next.2
10
+
11
+ ### Patch Changes
12
+
13
+ - 4205b0d9: Replace unzipper with adm-zip
14
+ - Updated dependencies [7ce9fef2]
15
+ - @forge/manifest@4.15.1-next.2
16
+
3
17
  ## 3.14.1-next.1
4
18
 
5
19
  ### Patch Changes
@@ -1,9 +1,7 @@
1
1
  export interface ZipAccessor {
2
- extractStringFile(zipFilePath: string, fileToExtract: string): Promise<string | undefined>;
3
2
  extract(zipFilePath: string, extractedDirectory: string): Promise<void>;
4
3
  }
5
- export declare class UnzipperZipAccessor implements ZipAccessor {
6
- extractStringFile(zipFilePath: string, fileToExtract: string): Promise<string | undefined>;
4
+ export declare class AdmZipAccessor implements ZipAccessor {
7
5
  extract(zipFile: string, extractDirectory: string): Promise<void>;
8
6
  }
9
7
  //# sourceMappingURL=zip-accessor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"zip-accessor.d.ts","sourceRoot":"","sources":["../../src/file-system/zip-accessor.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,WAAW;IAC1B,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC3F,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACzE;AAED,qBAAa,mBAAoB,YAAW,WAAW;IACxC,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAQhG,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAYzE"}
1
+ {"version":3,"file":"zip-accessor.d.ts","sourceRoot":"","sources":["../../src/file-system/zip-accessor.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACzE;AAED,qBAAa,cAAe,YAAW,WAAW;IACnC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAM/E"}
@@ -1,26 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UnzipperZipAccessor = void 0;
3
+ exports.AdmZipAccessor = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const fs_1 = tslib_1.__importDefault(require("fs"));
6
- const unzipper_1 = require("unzipper");
7
- class UnzipperZipAccessor {
8
- async extractStringFile(zipFilePath, fileToExtract) {
9
- const archiveListing = await unzipper_1.Open.file(zipFilePath);
10
- const targetFile = archiveListing.files.find(({ path }) => path === fileToExtract);
11
- if (targetFile) {
12
- return (await targetFile.buffer()).toString();
13
- }
14
- }
15
- extract(zipFile, extractDirectory) {
16
- const zipStream = fs_1.default.createReadStream(zipFile);
17
- const extractStream = (0, unzipper_1.Extract)({ path: extractDirectory });
18
- return new Promise((resolve, reject) => {
19
- zipStream.pipe(extractStream);
20
- zipStream.on('error', reject);
21
- extractStream.on('error', reject);
22
- extractStream.on('close', resolve);
23
- });
5
+ const adm_zip_1 = tslib_1.__importDefault(require("adm-zip"));
6
+ class AdmZipAccessor {
7
+ async extract(zipFile, extractDirectory) {
8
+ const zip = new adm_zip_1.default(zipFile);
9
+ await new Promise((resolve, reject) => zip.extractAllToAsync(extractDirectory, true, false, (err) => (err ? reject(err) : resolve())));
24
10
  }
25
11
  }
26
- exports.UnzipperZipAccessor = UnzipperZipAccessor;
12
+ exports.AdmZipAccessor = AdmZipAccessor;