From 0fdac0d4e4508fc91ef16101c37f3e7cbfcabd94 Mon Sep 17 00:00:00 2001 From: Aaron Date: Sun, 26 Jul 2026 12:56:17 -0500 Subject: [PATCH] feat(Firefox): List files in sources zip (#2513) --- packages/wxt/src/core/zip.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/wxt/src/core/zip.ts b/packages/wxt/src/core/zip.ts index ff89493b..ce4b64b7 100644 --- a/packages/wxt/src/core/zip.ts +++ b/packages/wxt/src/core/zip.ts @@ -79,7 +79,7 @@ export async function zip(config?: InlineConfig): Promise { wxt.config.outBaseDir, sourcesZipFilename, ); - await zipDir(wxt.config.zip.sourcesRoot, sourcesZipPath, { + const files = await zipDir(wxt.config.zip.sourcesRoot, sourcesZipPath, { include: wxt.config.zip.includeSources, exclude: excludeSources, transform(absolutePath, zipPath, content) { @@ -92,6 +92,13 @@ export async function zip(config?: InlineConfig): Promise { }); zipFiles.push(sourcesZipPath); await wxt.hooks.callHook('zip:sources:done', wxt, sourcesZipPath); + + await printFileList( + wxt.logger.info, + `Sources included in \`${sourcesZipFilename}\``, + wxt.config.zip.sourcesRoot, + files, + ); } await printFileList( @@ -121,7 +128,7 @@ async function zipDir( additionalFiles?: string[]; dot?: boolean; }, -): Promise { +): Promise { const archive = new JSZip(); // includeSources patterns are used directly (defaults to ['**/*'] from config) // excludeSources patterns are passed to glob's ignore option for efficient filtering @@ -136,7 +143,7 @@ async function zipDir( ...(options?.additionalFiles ?? []).map((file) => path.relative(directory, file), ), - ]; + ].sort(); for (const file of filesToZip) { const absolutePath = path.resolve(directory, file); if (file.endsWith('.json')) { @@ -167,6 +174,8 @@ async function zipDir( .on('error', reject) .on('close', resolve), ); + + return filesToZip; } async function downloadPrivatePackages() {