From 336e876dfe6c9ae24d736e63686ab99700cf4803 Mon Sep 17 00:00:00 2001 From: Charles Lowell Date: Tue, 21 Apr 2026 08:58:52 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Skip=20non-documentable=20export?= =?UTF-8?q?s=20like=20.wasm=20in=20doc=20generation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The @effectionx/inline package exports a ./swc entry pointing to a WASM binary build artifact. This file doesn't exist in git clones and isn't parseable as TypeScript, causing the website build to crash with a readTextFile ENOENT error. --- www/lib/package/node.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/www/lib/package/node.ts b/www/lib/package/node.ts index 0861adf0b..8704867e4 100644 --- a/www/lib/package/node.ts +++ b/www/lib/package/node.ts @@ -91,7 +91,7 @@ function normalizeExports( let result: Record = {}; for (let [key, value] of Object.entries(exports)) { let resolved = resolveExportValue(value); - if (resolved) { + if (resolved && isDocumentable(resolved)) { result[key] = resolved; } } @@ -99,6 +99,14 @@ function normalizeExports( return Object.keys(result).length > 0 ? result : { ".": "./src/index.ts" }; } +/** + * Check if an export path points to a documentable source file. + * Filters out binary artifacts like .wasm files that can't be parsed as TypeScript/JavaScript. + */ +function isDocumentable(path: string): boolean { + return !path.endsWith(".wasm"); +} + /** * Sanitize a semver version range for use in npm: specifiers. * Handles cases like "^3 || ^4" by taking the first valid part.