BREAKING CHANGE(SmartArchive): Refactor public API: rename factory/extraction methods, introduce typed interfaces and improved compression tools

This commit is contained in:
2025-11-25 12:32:13 +00:00
parent e609c023bc
commit 2b91c1586c
17 changed files with 1554 additions and 557 deletions

View File

@@ -33,19 +33,18 @@ tap.preTask('should prepare downloads', async (tools) => {
});
tap.test('should extract existing files on disk', async () => {
const testSmartarchive = await smartarchive.SmartArchive.fromArchiveUrl(
const testSmartarchive = await smartarchive.SmartArchive.fromUrl(
'https://verdaccio.lossless.digital/@pushrocks%2fwebsetup/-/websetup-2.0.14.tgz',
);
await testSmartarchive.exportToFs(testPaths.nogitDir);
await testSmartarchive.extractToDirectory(testPaths.nogitDir);
});
tap.skip.test('should extract a b2zip', async () => {
const dataUrl =
'https://daten.offeneregister.de/de_companies_ocdata.jsonl.bz2';
const testArchive = await smartarchive.SmartArchive.fromArchiveUrl(dataUrl);
await testArchive.exportToFs(
const testArchive = await smartarchive.SmartArchive.fromUrl(dataUrl);
await testArchive.extractToDirectory(
plugins.path.join(testPaths.nogitDir, 'de_companies_ocdata.jsonl'),
'data.jsonl',
);
});