From beab6886f45bf42906d0bd01aefe5dfe9e66a867 Mon Sep 17 00:00:00 2001 From: "t3-code[bot]" <269035359+t3-code[bot]@users.noreply.github.com> Date: Thu, 20 Aug 2026 03:11:20 -0400 Subject: [PATCH] fix(web): import dependency-heavy Open VSX themes (#7642) Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com> Co-authored-by: maria <254055478+maria-rcks@users.noreply.github.com> --- apps/web/src/openVsxThemes.test.ts | 5 +++++ apps/web/src/openVsxThemes.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/web/src/openVsxThemes.test.ts b/apps/web/src/openVsxThemes.test.ts index 4775a0188a08425b2df3b985672970fed32f0d9f..b4794f61986ad02f42ef3a1ae55e9ef475e60803 100644 --- a/apps/web/src/openVsxThemes.test.ts +++ b/apps/web/src/openVsxThemes.test.ts @@ -293,6 +293,11 @@ describe("Open VSX themes", () => { it("downloads a verified VSIX, reads JSONC includes, and pairs contributed variants", async () => { const zip = new JSZip(); zip.file("extension/.gitkeep", ""); + // Theme extensions sometimes publish their development dependencies too. + // Those unused files should not prevent importing the small theme payload. + for (let index = 0; index < 3_000; index += 1) { + zip.file(`extension/node_modules/package-${index}.js`, ""); + } zip.file( "extension/themes/base.jsonc", `{ diff --git a/apps/web/src/openVsxThemes.ts b/apps/web/src/openVsxThemes.ts index 90d0d62ceadeaabbc85a708947efa0190b548eb2..8b03d84869b5789509bd5ca105ca01508df216b0 100644 --- a/apps/web/src/openVsxThemes.ts +++ b/apps/web/src/openVsxThemes.ts @@ -17,8 +17,8 @@ const MAX_DETAIL_BYTES = 256 * 1024; const MAX_MANIFEST_BYTES = 256 * 1024; const SEARCH_REQUEST_TIMEOUT_MS = 10_000; const MAX_THEME_BYTES = 256 * 1024; -const MAX_ZIP_ENTRIES = 2_000; -const MAX_UNCOMPRESSED_BYTES = 50 * 1024 * 1024; +const MAX_ZIP_ENTRIES = 5_000; +const MAX_UNCOMPRESSED_BYTES = 100 * 1024 * 1024; const MAX_COMPRESSION_RATIO = 200; const MAX_THEMES_PER_EXTENSION = 40; const MAX_INCLUDE_DEPTH = 8; -- 2.54.0