@push.rocks/smartarchive 5.0.1 → 5.1.0

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.
Files changed (59) hide show
  1. package/dist_ts/00_commitinfo_data.js +2 -2
  2. package/dist_ts/classes.archiveanalyzer.d.ts +1 -1
  3. package/dist_ts/classes.archiveanalyzer.js +34 -4
  4. package/dist_ts/classes.smartarchive.d.ts +4 -4
  5. package/dist_ts/classes.smartarchive.js +46 -32
  6. package/dist_ts/classes.tartools.d.ts +9 -33
  7. package/dist_ts/classes.tartools.js +18 -153
  8. package/dist_ts/index.d.ts +2 -6
  9. package/dist_ts/index.js +7 -11
  10. package/dist_ts/paths.js +1 -1
  11. package/dist_ts/plugins.d.ts +2 -9
  12. package/dist_ts/plugins.js +6 -13
  13. package/npmextra.json +13 -7
  14. package/package.json +23 -14
  15. package/ts/00_commitinfo_data.ts +1 -1
  16. package/ts/classes.archiveanalyzer.ts +33 -5
  17. package/ts/classes.smartarchive.ts +51 -35
  18. package/ts/classes.tartools.ts +20 -177
  19. package/ts/index.ts +7 -11
  20. package/ts/plugins.ts +5 -17
  21. package/{ts → ts_shared}/bzip2/bititerator.ts +1 -1
  22. package/{ts → ts_shared}/bzip2/bzip2.ts +2 -2
  23. package/{ts → ts_shared}/bzip2/index.ts +6 -6
  24. package/ts_shared/classes.bzip2tools.ts +14 -0
  25. package/ts_shared/classes.gziptools.ts +42 -0
  26. package/ts_shared/classes.tartools.ts +89 -0
  27. package/ts_shared/classes.ziptools.ts +107 -0
  28. package/ts_shared/index.ts +17 -0
  29. package/{ts → ts_shared}/interfaces.ts +18 -7
  30. package/ts_shared/plugins.ts +22 -0
  31. package/ts_web/00_commitinfo_data.ts +8 -0
  32. package/ts_web/index.ts +4 -0
  33. package/ts_web/plugins.ts +3 -0
  34. package/dist_ts/bzip2/bititerator.d.ts +0 -6
  35. package/dist_ts/bzip2/bititerator.js +0 -50
  36. package/dist_ts/bzip2/bzip2.d.ts +0 -29
  37. package/dist_ts/bzip2/bzip2.js +0 -398
  38. package/dist_ts/bzip2/index.d.ts +0 -5
  39. package/dist_ts/bzip2/index.js +0 -92
  40. package/dist_ts/classes.bzip2tools.d.ts +0 -7
  41. package/dist_ts/classes.bzip2tools.js +0 -11
  42. package/dist_ts/classes.gziptools.d.ts +0 -53
  43. package/dist_ts/classes.gziptools.js +0 -116
  44. package/dist_ts/classes.ziptools.d.ts +0 -56
  45. package/dist_ts/classes.ziptools.js +0 -171
  46. package/dist_ts/errors.d.ts +0 -44
  47. package/dist_ts/errors.js +0 -62
  48. package/dist_ts/interfaces.d.ts +0 -119
  49. package/dist_ts/interfaces.js +0 -2
  50. package/dist_ts/smartarchive.classes.smartarchive.d.ts +0 -34
  51. package/dist_ts/smartarchive.classes.smartarchive.js +0 -116
  52. package/dist_ts/smartarchive.paths.d.ts +0 -2
  53. package/dist_ts/smartarchive.paths.js +0 -4
  54. package/dist_ts/smartarchive.plugins.d.ts +0 -14
  55. package/dist_ts/smartarchive.plugins.js +0 -19
  56. package/ts/classes.bzip2tools.ts +0 -16
  57. package/ts/classes.gziptools.ts +0 -138
  58. package/ts/classes.ziptools.ts +0 -196
  59. /package/{ts → ts_shared}/errors.ts +0 -0
@@ -1,8 +1,4 @@
1
- export * from './interfaces.js';
2
- export * from './errors.js';
1
+ export * from '../ts_shared/index.js';
3
2
  export * from './classes.smartarchive.js';
4
- export * from './classes.tartools.js';
5
- export * from './classes.ziptools.js';
6
- export * from './classes.gziptools.js';
7
- export * from './classes.bzip2tools.js';
8
3
  export * from './classes.archiveanalyzer.js';
4
+ export { TarTools } from './classes.tartools.js';
package/dist_ts/index.js CHANGED
@@ -1,13 +1,9 @@
1
- // Core types and errors
2
- export * from './interfaces.js';
3
- export * from './errors.js';
4
- // Main archive class
1
+ // Re-export everything from ts_shared (browser-compatible)
2
+ export * from '../ts_shared/index.js';
3
+ // Node.js-specific: Main archive class with filesystem support
5
4
  export * from './classes.smartarchive.js';
6
- // Format-specific tools
7
- export * from './classes.tartools.js';
8
- export * from './classes.ziptools.js';
9
- export * from './classes.gziptools.js';
10
- export * from './classes.bzip2tools.js';
11
- // Archive analysis
5
+ // Node.js-specific: Archive analysis with SmartArchive integration
12
6
  export * from './classes.archiveanalyzer.js';
13
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSx3QkFBd0I7QUFDeEIsY0FBYyxpQkFBaUIsQ0FBQztBQUNoQyxjQUFjLGFBQWEsQ0FBQztBQUU1QixxQkFBcUI7QUFDckIsY0FBYywyQkFBMkIsQ0FBQztBQUUxQyx3QkFBd0I7QUFDeEIsY0FBYyx1QkFBdUIsQ0FBQztBQUN0QyxjQUFjLHVCQUF1QixDQUFDO0FBQ3RDLGNBQWMsd0JBQXdCLENBQUM7QUFDdkMsY0FBYyx5QkFBeUIsQ0FBQztBQUV4QyxtQkFBbUI7QUFDbkIsY0FBYyw4QkFBOEIsQ0FBQyJ9
7
+ // Node.js-specific: Extended TarTools with filesystem support (overrides shared TarTools)
8
+ export { TarTools } from './classes.tartools.js';
9
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSwyREFBMkQ7QUFDM0QsY0FBYyx1QkFBdUIsQ0FBQztBQUV0QywrREFBK0Q7QUFDL0QsY0FBYywyQkFBMkIsQ0FBQztBQUUxQyxtRUFBbUU7QUFDbkUsY0FBYyw4QkFBOEIsQ0FBQztBQUU3QywwRkFBMEY7QUFDMUYsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLHVCQUF1QixDQUFDIn0=
package/dist_ts/paths.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import * as plugins from './plugins.js';
2
2
  export const packageDir = plugins.path.join(plugins.smartpath.get.dirnameFromImportMetaUrl(import.meta.url), '../');
3
3
  export const nogitDir = plugins.path.join(packageDir, './.nogit');
4
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGF0aHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9wYXRocy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssT0FBTyxNQUFNLGNBQWMsQ0FBQztBQUV4QyxNQUFNLENBQUMsTUFBTSxVQUFVLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQ3pDLE9BQU8sQ0FBQyxTQUFTLENBQUMsR0FBRyxDQUFDLHdCQUF3QixDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLEVBQy9ELEtBQUssQ0FDTixDQUFDO0FBQ0YsTUFBTSxDQUFDLE1BQU0sUUFBUSxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLFVBQVUsRUFBRSxVQUFVLENBQUMsQ0FBQyJ9
4
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGF0aHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9wYXRocy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssT0FBTyxNQUFNLGNBQWMsQ0FBQztBQUV4QyxNQUFNLENBQUMsTUFBTSxVQUFVLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQ3pDLE9BQU8sQ0FBQyxTQUFTLENBQUMsR0FBRyxDQUFDLHdCQUF3QixDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLEVBQy9ELEtBQUssQ0FDTixDQUFDO0FBQ0YsTUFBTSxDQUFDLE1BQU0sUUFBUSxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLFVBQVUsRUFBRSxVQUFVLENBQUMsQ0FBQyJ9
@@ -7,17 +7,10 @@ export { path, stream, fs, fsPromises };
7
7
  * List files in a directory recursively, returning relative paths
8
8
  */
9
9
  export declare function listFileTree(dirPath: string, _pattern?: string): Promise<string[]>;
10
- import * as smartfile from '@push.rocks/smartfile';
11
- import * as smartdelay from '@push.rocks/smartdelay';
10
+ export * from '../ts_shared/plugins.js';
12
11
  import * as smartpath from '@push.rocks/smartpath';
13
- import * as smartpromise from '@push.rocks/smartpromise';
14
12
  import * as smartrequest from '@push.rocks/smartrequest';
15
13
  import * as smartunique from '@push.rocks/smartunique';
16
- import * as smartstream from '@push.rocks/smartstream';
17
14
  import * as smartrx from '@push.rocks/smartrx';
18
15
  import * as smarturl from '@push.rocks/smarturl';
19
- export { smartfile, smartdelay, smartpath, smartpromise, smartrequest, smartunique, smartstream, smartrx, smarturl, };
20
- import * as fileType from 'file-type';
21
- import * as fflate from 'fflate';
22
- import tarStream from 'tar-stream';
23
- export { fileType, fflate, tarStream };
16
+ export { smartpath, smartrequest, smartunique, smartrx, smarturl, };
@@ -1,4 +1,4 @@
1
- // node native scope
1
+ // Node.js native scope
2
2
  import * as path from 'node:path';
3
3
  import * as stream from 'node:stream';
4
4
  import * as fs from 'node:fs';
@@ -25,20 +25,13 @@ export async function listFileTree(dirPath, _pattern = '**/*') {
25
25
  await walkDir(dirPath);
26
26
  return results;
27
27
  }
28
- // @pushrocks scope
29
- import * as smartfile from '@push.rocks/smartfile';
30
- import * as smartdelay from '@push.rocks/smartdelay';
28
+ // Re-export browser-compatible plugins from ts_shared
29
+ export * from '../ts_shared/plugins.js';
30
+ // Additional Node.js-specific @pushrocks packages
31
31
  import * as smartpath from '@push.rocks/smartpath';
32
- import * as smartpromise from '@push.rocks/smartpromise';
33
32
  import * as smartrequest from '@push.rocks/smartrequest';
34
33
  import * as smartunique from '@push.rocks/smartunique';
35
- import * as smartstream from '@push.rocks/smartstream';
36
34
  import * as smartrx from '@push.rocks/smartrx';
37
35
  import * as smarturl from '@push.rocks/smarturl';
38
- export { smartfile, smartdelay, smartpath, smartpromise, smartrequest, smartunique, smartstream, smartrx, smarturl, };
39
- // third party scope
40
- import * as fileType from 'file-type';
41
- import * as fflate from 'fflate';
42
- import tarStream from 'tar-stream';
43
- export { fileType, fflate, tarStream };
44
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGx1Z2lucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3BsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsb0JBQW9CO0FBQ3BCLE9BQU8sS0FBSyxJQUFJLE1BQU0sV0FBVyxDQUFDO0FBQ2xDLE9BQU8sS0FBSyxNQUFNLE1BQU0sYUFBYSxDQUFDO0FBQ3RDLE9BQU8sS0FBSyxFQUFFLE1BQU0sU0FBUyxDQUFDO0FBQzlCLE9BQU8sS0FBSyxVQUFVLE1BQU0sa0JBQWtCLENBQUM7QUFFL0MsT0FBTyxFQUFFLElBQUksRUFBRSxNQUFNLEVBQUUsRUFBRSxFQUFFLFVBQVUsRUFBRSxDQUFDO0FBRXhDOztHQUVHO0FBQ0gsTUFBTSxDQUFDLEtBQUssVUFBVSxZQUFZLENBQUMsT0FBZSxFQUFFLFdBQW1CLE1BQU07SUFDM0UsTUFBTSxPQUFPLEdBQWEsRUFBRSxDQUFDO0lBRTdCLEtBQUssVUFBVSxPQUFPLENBQUMsV0FBbUIsRUFBRSxlQUF1QixFQUFFO1FBQ25FLE1BQU0sT0FBTyxHQUFHLE1BQU0sVUFBVSxDQUFDLE9BQU8sQ0FBQyxXQUFXLEVBQUUsRUFBRSxhQUFhLEVBQUUsSUFBSSxFQUF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4QyxrREFBa0Q7QUFDbEQsT0FBTyxLQUFLLFNBQVMsTUFBTSx1QkFBdUIsQ0FBQztBQUNuRCxPQUFPLEtBQUssWUFBWSxNQUFNLDBCQUEwQixDQUFDO0FBQ3pELE9BQU8sS0FBSyxXQUFXLE1BQU0seUJBQXlCLENBQUM7QUFDdkQsT0FBTyxLQUFLLE9BQU8sTUFBTSxxQkFBcUIsQ0FBQztBQUMvQyxPQUFPLEtBQUssUUFBUSxNQUFNLHNCQUFzQixDQUFDO0FBRWpELE9BQU8sRUFDTCxTQUFTLEVBQ1QsWUFBWSxFQUNaLFdBQVcsRUFDWCxPQUFPLEVBQ1AsUUFBUSxHQUNULENBQUMifQ==
package/npmextra.json CHANGED
@@ -1,9 +1,5 @@
1
1
  {
2
- "npmci": {
3
- "npmGlobalTools": [],
4
- "npmAccessLevel": "public"
5
- },
6
- "gitzone": {
2
+ "@git.zone/cli": {
7
3
  "projectType": "npm",
8
4
  "module": {
9
5
  "githost": "code.foss.global",
@@ -25,9 +21,19 @@
25
21
  "data analysis",
26
22
  "file stream"
27
23
  ]
24
+ },
25
+ "release": {
26
+ "registries": [
27
+ "https://verdaccio.lossless.digital",
28
+ "https://registry.npmjs.org"
29
+ ],
30
+ "accessLevel": "public"
28
31
  }
29
32
  },
30
- "tsdoc": {
33
+ "@git.zone/tsdoc": {
31
34
  "legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
35
+ },
36
+ "@ship.zone/szci": {
37
+ "npmGlobalTools": []
32
38
  }
33
- }
39
+ }
package/package.json CHANGED
@@ -1,10 +1,19 @@
1
1
  {
2
2
  "name": "@push.rocks/smartarchive",
3
- "version": "5.0.1",
3
+ "version": "5.1.0",
4
4
  "description": "A library for working with archive files, providing utilities for compressing and decompressing data.",
5
5
  "main": "dist_ts/index.js",
6
6
  "typings": "dist_ts/index.d.ts",
7
7
  "type": "module",
8
+ "exports": {
9
+ ".": "./dist_ts/index.js",
10
+ "./web": "./dist_ts_web/index.js"
11
+ },
12
+ "scripts": {
13
+ "test": "(tstest test/ --verbose)",
14
+ "build": "tsbuild --web --allowimplicitany",
15
+ "buildDocs": "tsdoc"
16
+ },
8
17
  "repository": {
9
18
  "type": "git",
10
19
  "url": "https://code.foss.global/push.rocks/smartarchive.git"
@@ -17,31 +26,32 @@
17
26
  "homepage": "https://code.foss.global/push.rocks/smartarchive#readme",
18
27
  "dependencies": {
19
28
  "@push.rocks/smartdelay": "^3.0.5",
20
- "@push.rocks/smartfile": "^13.0.0",
29
+ "@push.rocks/smartfile": "^13.1.2",
21
30
  "@push.rocks/smartpath": "^6.0.0",
22
31
  "@push.rocks/smartpromise": "^4.2.3",
23
- "@push.rocks/smartrequest": "^4.2.2",
32
+ "@push.rocks/smartrequest": "^5.0.1",
24
33
  "@push.rocks/smartrx": "^3.0.10",
25
34
  "@push.rocks/smartstream": "^3.2.5",
26
35
  "@push.rocks/smartunique": "^3.0.9",
27
36
  "@push.rocks/smarturl": "^3.1.0",
28
- "@types/tar-stream": "^3.1.4",
29
37
  "fflate": "^0.8.2",
30
- "file-type": "^21.0.0",
31
- "tar-stream": "^3.1.7"
38
+ "file-type": "^21.2.0",
39
+ "modern-tar": "^0.7.3"
32
40
  },
33
41
  "devDependencies": {
34
- "@git.zone/tsbuild": "^3.1.0",
35
- "@git.zone/tsrun": "^2.0.0",
36
- "@git.zone/tstest": "^3.1.3"
42
+ "@git.zone/tsbuild": "^4.0.2",
43
+ "@git.zone/tsrun": "^2.0.1",
44
+ "@git.zone/tstest": "^3.1.4"
37
45
  },
38
46
  "private": false,
39
47
  "files": [
40
48
  "ts/**/*",
49
+ "ts_shared/**/*",
41
50
  "ts_web/**/*",
42
51
  "dist/**/*",
43
52
  "dist_*/**/*",
44
53
  "dist_ts/**/*",
54
+ "dist_ts_shared/**/*",
45
55
  "dist_ts_web/**/*",
46
56
  "assets/**/*",
47
57
  "cli.js",
@@ -64,9 +74,8 @@
64
74
  "data analysis",
65
75
  "file stream"
66
76
  ],
67
- "scripts": {
68
- "test": "(tstest test/ --verbose)",
69
- "build": "tsbuild --web --allowimplicitany",
70
- "buildDocs": "tsdoc"
77
+ "packageManager": "pnpm@10.14.0+sha512.ad27a79641b49c3e481a16a805baa71817a04bbe06a38d17e60e2eaee83f6a146c6a688125f5792e48dd5ba30e7da52a5cda4c3992b9ccf333f9ce223af84748",
78
+ "pnpm": {
79
+ "overrides": {}
71
80
  }
72
- }
81
+ }
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@push.rocks/smartarchive',
6
- version: '5.0.1',
6
+ version: '5.1.0',
7
7
  description: 'A library for working with archive files, providing utilities for compressing and decompressing data.'
8
8
  }
@@ -1,5 +1,5 @@
1
1
  import type { SmartArchive } from './classes.smartarchive.js';
2
- import type { TSupportedMime } from './interfaces.js';
2
+ import type { TSupportedMime } from '../ts_shared/interfaces.js';
3
3
  import * as plugins from './plugins.js';
4
4
 
5
5
  /**
@@ -8,7 +8,7 @@ import * as plugins from './plugins.js';
8
8
  export type TDecompressionStream =
9
9
  | plugins.stream.Transform
10
10
  | plugins.stream.Duplex
11
- | plugins.tarStream.Extract;
11
+ | plugins.smartstream.SmartDuplex<any, any>;
12
12
 
13
13
  /**
14
14
  * Result of archive analysis
@@ -53,14 +53,42 @@ export class ArchiveAnalyzer {
53
53
  */
54
54
  private async getDecompressionStream(mimeTypeArg: TSupportedMime): Promise<TDecompressionStream> {
55
55
  switch (mimeTypeArg) {
56
- case 'application/gzip':
57
- return this.smartArchiveRef.gzipTools.getDecompressionStream();
56
+ case 'application/gzip': {
57
+ // Use fflate streaming Gunzip - instance must be created once and reused
58
+ let gunzip: plugins.fflate.Gunzip;
59
+ return new plugins.stream.Transform({
60
+ construct(callback) {
61
+ gunzip = new plugins.fflate.Gunzip((data, final) => {
62
+ this.push(Buffer.from(data));
63
+ });
64
+ callback();
65
+ },
66
+ transform(chunk, encoding, callback) {
67
+ try {
68
+ gunzip.push(chunk, false);
69
+ callback();
70
+ } catch (err) {
71
+ callback(err as Error);
72
+ }
73
+ },
74
+ flush(callback) {
75
+ try {
76
+ // Signal end of stream with empty final chunk
77
+ gunzip.push(new Uint8Array(0), true);
78
+ callback();
79
+ } catch (err) {
80
+ callback(err as Error);
81
+ }
82
+ }
83
+ });
84
+ }
58
85
  case 'application/zip':
59
86
  return this.smartArchiveRef.zipTools.getDecompressionStream();
60
87
  case 'application/x-bzip2':
61
88
  return this.smartArchiveRef.bzip2Tools.getDecompressionStream();
62
89
  case 'application/x-tar':
63
- return this.smartArchiveRef.tarTools.getDecompressionStream();
90
+ // TAR doesn't need decompression, just pass through
91
+ return plugins.smartstream.createPassThrough();
64
92
  default:
65
93
  // Handle unsupported formats or no decompression needed
66
94
  return plugins.smartstream.createPassThrough();
@@ -6,12 +6,15 @@ import type {
6
6
  TArchiveFormat,
7
7
  TCompressionLevel,
8
8
  TEntryFilter,
9
- } from './interfaces.js';
9
+ } from '../ts_shared/interfaces.js';
10
10
 
11
- import { Bzip2Tools } from './classes.bzip2tools.js';
12
- import { GzipTools } from './classes.gziptools.js';
11
+ // Import browser-compatible tools from ts_shared
12
+ import { Bzip2Tools } from '../ts_shared/classes.bzip2tools.js';
13
+ import { GzipTools } from '../ts_shared/classes.gziptools.js';
14
+ import { ZipTools } from '../ts_shared/classes.ziptools.js';
15
+
16
+ // Import Node.js-extended TarTools
13
17
  import { TarTools } from './classes.tartools.js';
14
- import { ZipTools } from './classes.ziptools.js';
15
18
  import { ArchiveAnalyzer, type IAnalyzedResult } from './classes.archiveanalyzer.js';
16
19
 
17
20
  /**
@@ -62,7 +65,7 @@ export class SmartArchive {
62
65
  public tarTools = new TarTools();
63
66
  public zipTools = new ZipTools();
64
67
  public gzipTools = new GzipTools();
65
- public bzip2Tools = new Bzip2Tools(this);
68
+ public bzip2Tools = new Bzip2Tools();
66
69
  public archiveAnalyzer = new ArchiveAnalyzer(this);
67
70
 
68
71
  // ============================================
@@ -173,7 +176,7 @@ export class SmartArchive {
173
176
  public entry(archivePath: string, content: string | Buffer): this {
174
177
  this.ensureNotInExtractMode('entry');
175
178
  if (!this._mode) this._mode = 'create';
176
- this.pendingEntries.push({ archivePath, content });
179
+ this.pendingEntries.push({ archivePath, content: content instanceof Buffer ? new Uint8Array(content) : content });
177
180
  return this;
178
181
  }
179
182
 
@@ -184,7 +187,10 @@ export class SmartArchive {
184
187
  this.ensureNotInExtractMode('entries');
185
188
  if (!this._mode) this._mode = 'create';
186
189
  for (const e of entriesArg) {
187
- this.pendingEntries.push({ archivePath: e.archivePath, content: e.content });
190
+ this.pendingEntries.push({
191
+ archivePath: e.archivePath,
192
+ content: e.content instanceof Buffer ? new Uint8Array(e.content) : e.content
193
+ });
188
194
  }
189
195
  return this;
190
196
  }
@@ -374,30 +380,36 @@ export class SmartArchive {
374
380
  plugins.smartstream.createTransformFunction<IAnalyzedResult, void>(
375
381
  async (analyzedResultChunk) => {
376
382
  if (analyzedResultChunk.fileType?.mime === 'application/x-tar') {
377
- const tarStream = analyzedResultChunk.decompressionStream as plugins.tarStream.Extract;
378
-
379
- tarStream.on('entry', async (header, stream, next) => {
380
- if (header.type === 'directory') {
381
- stream.resume();
382
- stream.on('end', () => next());
383
- return;
384
- }
383
+ // Use modern-tar for TAR extraction
384
+ const chunks: Buffer[] = [];
385
385
 
386
- const passThrough = new plugins.stream.PassThrough();
387
- const streamfile = plugins.smartfile.StreamFile.fromStream(passThrough, header.name);
388
- streamFileIntake.push(streamfile);
389
- stream.pipe(passThrough);
390
- stream.on('end', () => {
391
- passThrough.end();
392
- next();
393
- });
386
+ analyzedResultChunk.resultStream.on('data', (chunk: Buffer) => {
387
+ chunks.push(chunk);
394
388
  });
395
389
 
396
- tarStream.on('finish', () => {
397
- safeSignalEnd();
390
+ analyzedResultChunk.resultStream.on('end', async () => {
391
+ try {
392
+ const tarBuffer = Buffer.concat(chunks);
393
+ const entries = await this.tarTools.extractTar(new Uint8Array(tarBuffer));
394
+
395
+ for (const entry of entries) {
396
+ if (entry.isDirectory) continue;
397
+
398
+ const streamFile = plugins.smartfile.StreamFile.fromBuffer(
399
+ Buffer.from(entry.content)
400
+ );
401
+ streamFile.relativeFilePath = entry.path;
402
+ streamFileIntake.push(streamFile);
403
+ }
404
+ safeSignalEnd();
405
+ } catch (err) {
406
+ streamFileIntake.emit('error', err);
407
+ }
398
408
  });
399
409
 
400
- analyzedResultChunk.resultStream.pipe(analyzedResultChunk.decompressionStream);
410
+ analyzedResultChunk.resultStream.on('error', (err: Error) => {
411
+ streamFileIntake.emit('error', err);
412
+ });
401
413
  } else if (analyzedResultChunk.fileType?.mime === 'application/zip') {
402
414
  analyzedResultChunk.resultStream
403
415
  .pipe(analyzedResultChunk.decompressionStream)
@@ -544,25 +556,29 @@ export class SmartArchive {
544
556
 
545
557
  if (this.creationFormat === 'tar' || this.creationFormat === 'tar.gz' || this.creationFormat === 'tgz') {
546
558
  if (this.creationFormat === 'tar') {
547
- this.archiveBuffer = await this.tarTools.packFiles(entries);
559
+ const result = await this.tarTools.packFiles(entries);
560
+ this.archiveBuffer = Buffer.from(result);
548
561
  } else {
549
- this.archiveBuffer = await this.tarTools.packFilesToTarGz(entries, this._compressionLevel);
562
+ const result = await this.tarTools.packFilesToTarGz(entries, this._compressionLevel);
563
+ this.archiveBuffer = Buffer.from(result);
550
564
  }
551
565
  } else if (this.creationFormat === 'zip') {
552
- this.archiveBuffer = await this.zipTools.createZip(entries, this._compressionLevel);
566
+ const result = await this.zipTools.createZip(entries, this._compressionLevel);
567
+ this.archiveBuffer = Buffer.from(result);
553
568
  } else if (this.creationFormat === 'gz') {
554
569
  if (entries.length !== 1) {
555
570
  throw new Error('GZIP format only supports a single file');
556
571
  }
557
- let content: Buffer;
572
+ let content: Uint8Array;
558
573
  if (typeof entries[0].content === 'string') {
559
- content = Buffer.from(entries[0].content);
560
- } else if (Buffer.isBuffer(entries[0].content)) {
574
+ content = new TextEncoder().encode(entries[0].content);
575
+ } else if (entries[0].content instanceof Uint8Array) {
561
576
  content = entries[0].content;
562
577
  } else {
563
- throw new Error('GZIP format requires string or Buffer content');
578
+ throw new Error('GZIP format requires string or Uint8Array content');
564
579
  }
565
- this.archiveBuffer = await this.gzipTools.compress(content, this._compressionLevel);
580
+ const result = await this.gzipTools.compress(content, this._compressionLevel);
581
+ this.archiveBuffer = Buffer.from(result);
566
582
  } else {
567
583
  throw new Error(`Unsupported format: ${this.creationFormat}`);
568
584
  }
@@ -808,7 +824,7 @@ export class SmartArchive {
808
824
  const content = await plugins.fsPromises.readFile(absolutePath);
809
825
  this.pendingEntries.push({
810
826
  archivePath,
811
- content,
827
+ content: new Uint8Array(content),
812
828
  });
813
829
  }
814
830
  }