Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ This is the log of notable changes to EAS CLI and related packages.

- [build-tools] Upload tvOS (and other non-iOS) IPAs to the App Store Connect platform declared in the bundle's `DTPlatformName`, instead of always uploading to the iOS train. ([#4234](https://github.com/expo/eas-cli/pull/4234) by [@douglowder](https://github.com/douglowder))

- [eas-cli] Bump `minizlib` to 3.1.0 to drop its deprecated `rimraf@5` transitive dependency. ([#4281](https://github.com/expo/eas-cli/pull/4281) by [@brentvatne](https://github.com/brentvatne))

## [22.2.0](https://github.com/expo/eas-cli/releases/tag/v22.2.0) - 2026-08-20

### 🎉 New features
Expand Down
2 changes: 1 addition & 1 deletion packages/eas-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
"log-symbols": "4.1.0",
"mime": "3.0.0",
"minimatch": "5.1.2",
"minizlib": "3.0.1",
"minizlib": "3.1.0",
"nanoid": "3.3.8",
"node-fetch": "2.6.7",
"node-forge": "1.4.0",
Expand Down
70 changes: 70 additions & 0 deletions packages/eas-cli/src/worker/__tests__/assets.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import fs from 'node:fs';
import { Readable } from 'node:stream';
import { extract } from 'tar-stream';
import zlib from 'node:zlib';

import { FileEntry, packFilesIterableAsync } from '../assets';

async function extractTarEntriesAsync(tarData: Buffer): Promise<Map<string, string>> {
const entries = new Map<string, string>();
const extractor = extract();
extractor.on('entry', (header, stream, next) => {
const chunks: Buffer[] = [];
stream.on('data', chunk => chunks.push(chunk));
stream.on('end', () => {
entries.set(header.name, Buffer.concat(chunks).toString('utf8'));
next();
});
stream.resume();
});
await new Promise<void>((resolve, reject) => {
extractor.on('finish', resolve);
extractor.on('error', reject);
Readable.from(tarData).pipe(extractor);
});
return entries;
}

describe(packFilesIterableAsync, () => {
let tarPath: string | null = null;

afterEach(async () => {
if (tarPath) {
await fs.promises.rm(tarPath, { force: true });
tarPath = null;
}
});

it('packs file entries into a gzip-compressed tarball', async () => {
const files: FileEntry[] = [
['index.html', '<h1>hello</h1>'],
['assets/data.json', '{"key":"value"}'],
];
tarPath = await packFilesIterableAsync(files);

const compressed = await fs.promises.readFile(tarPath);
// gzip magic bytes
expect(compressed[0]).toBe(0x1f);
expect(compressed[1]).toBe(0x8b);
// portable mode zeroes the gzip MTIME field (bytes 4-7)
expect(compressed.subarray(4, 8)).toEqual(Buffer.from([0, 0, 0, 0]));

const entries = await extractTarEntriesAsync(zlib.gunzipSync(compressed));
expect(entries.get('index.html')).toBe('<h1>hello</h1>');
expect(entries.get('assets/data.json')).toBe('{"key":"value"}');
expect(entries.size).toBe(2);
});

it('accepts async iterables and forwards gzip options', async () => {
async function* files(): AsyncIterable<FileEntry> {
yield ['a.txt', 'aaaa'];
yield ['b.txt', Buffer.from('bbbb')];
}
tarPath = await packFilesIterableAsync(files(), { level: 9 });

const compressed = await fs.promises.readFile(tarPath);
const entries = await extractTarEntriesAsync(zlib.gunzipSync(compressed));
expect(entries.get('a.txt')).toBe('aaaa');
expect(entries.get('b.txt')).toBe('bbbb');
});
});
35 changes: 7 additions & 28 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading