From 1d55cc19dd9bb95289c821035cff772b5ff9aaf3 Mon Sep 17 00:00:00 2001 From: Xi Xu Date: Mon, 17 Aug 2026 10:48:25 +0800 Subject: [PATCH] fix(web): keep text zip creation stream-independent --- .github/dependabot.yml | 4 ++++ apps/web/src/lib/download/zip.ts | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 4bfe3b9..7b282d6 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -15,6 +15,10 @@ updates: - xixu-me commit-message: prefix: 'deps(bun)' + ignore: + - dependency-name: typescript + update-types: + - version-update:semver-major groups: web-and-tooling: update-types: diff --git a/apps/web/src/lib/download/zip.ts b/apps/web/src/lib/download/zip.ts index 89275be..ed9654d 100644 --- a/apps/web/src/lib/download/zip.ts +++ b/apps/web/src/lib/download/zip.ts @@ -2,7 +2,7 @@ * ZIP creation helpers for download-all flows and small generated archives. */ -import { TextReader, Uint8ArrayReader, Uint8ArrayWriter, ZipWriter } from '@zip.js/zip.js' +import { Uint8ArrayReader, Uint8ArrayWriter, ZipWriter } from '@zip.js/zip.js' import { sanitizePath } from '@/lib/files/paths' @@ -63,7 +63,7 @@ export async function buildZipFromStreams(entries: ZipStreamEntryInput[]) { /** buildTextZip creates a small ZIP archive containing one UTF-8 text file. */ export async function buildTextZip(path: string, content: string) { const writer = new ZipWriter(new Uint8ArrayWriter()) - await writer.add(sanitizePath(path), new TextReader(content)) + await writer.add(sanitizePath(path), new Uint8ArrayReader(new TextEncoder().encode(content))) const bytes = await writer.close() return new Blob([bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength)], { type: 'application/zip',