Skip to content

coverage: distinguish partial dynamic shims - #130

Open
dismonjames wants to merge 2 commits into
vercel-labs:mainfrom
dismonjames:coverage/partial-dynamic-shims
Open

coverage: distinguish partial dynamic shims#130
dismonjames wants to merge 2 commits into
vercel-labs:mainfrom
dismonjames:coverage/partial-dynamic-shims

Conversation

@dismonjames

Copy link
Copy Markdown

Fixes the coverage reporting part of #36.

coverage --dynamic previously reported partial builtin shims as fully shimmed. This distinguishes known partial shims from complete ones while leaving runtime behavior unchanged.

The island ships shims for node:crypto, node:zlib, and node:fs (+ node:fs/promises), but each covers only a slice of Node's surface; the remaining members are honest throwing stubs. The --dynamic builtins table now reports these as partial with an explanatory note, instead of shimmed. Fully implemented shims keep reporting shimmed.

Runtime and static compilation behavior are unchanged. A partial shim still loads and runs programs that stay within its implemented slice, so it is not a build blocker and the coverage exit status is unaffected.

Tests cover partial and fully supported shim reporting.

- Mark node:crypto, node:zlib, and node:fs(+fs/promises) as partial: their island shims cover only a slice of Node's surface and the rest throw at the call.
- Report partial shims as 'partial' in the --dynamic builtins table, with a note, so they are not indistinguishable from fully implemented shims.
- Add a coverage snapshot for the crypto-shims fixture; full shims stay 'shimmed' (the esbuild-require snapshot pins that side).
@vercel

vercel Bot commented Aug 11, 2026

Copy link
Copy Markdown

@dismonjames is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

@vercel vercel Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestion:

Coverage docs example shows node:child_process, node:fs, and node:process as shimmed, but this PR reclassifies them as partial, making the documented --dynamic output inaccurate.

Fix on Vercel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants