Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .config/esbuild.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,21 @@ function createNodeProtocolPlugin() {
* minimal lookup covering just those types.
*/
function createLibStubPlugin() {
// Heavy lib modules that are eagerly required but never exercised
// by the SDK's actual code paths.
//
// Never-reached by SDK gateway modules:
// - globs.js / sorts.js → only used by fs helpers the SDK skips
// - external/npm-pack.js / pico-pack.js → Arborist/pacote/fast-glob,
// SDK only needs validateFiles() from fs
//
// Never-reached transitive external shims:
// - external/cacache.js → destructures from npm-pack (already stubbed),
// SDK's cache-with-ttl path degrades gracefully
// - external/del.js → pulled in by fs's lazy getDel() for safeDelete,
// SDK never calls safeDelete/safeDeleteSync
const libStubPattern =
/@socketsecurity\/lib\/dist\/(globs|sorts|external\/(npm-pack|pico-pack))\.js$/
/@socketsecurity\/lib\/dist\/(globs|sorts|external\/(npm-pack|pico-pack|cacache|del))\.js$/

const mimeDbPattern = /mime-db\/db\.json$/

Expand Down