feat: bootstrap @socketsecurity/lib + @socketregistry/packageurl-js + @sinclair/typebox via firewall-checked registry fetch#627
Merged
John-David Dalton (jdalton) merged 4 commits intomainfrom Apr 27, 2026
Conversation
…tall Adds scripts/bootstrap-from-registry.mts that downloads zero-dep Socket packages (currently @socketsecurity/lib) from the npm registry tarball directly into node_modules/<scope>/<name>/ BEFORE pnpm install runs. Wired via package.json preinstall lifecycle hook. Why: setup.mts and other root-script importers of @socketsecurity/lib fail on a fresh clone because pnpm install hasn't run yet. Pre- seeding from the registry tarball solves the chicken-and-egg. Reads pinned version from pnpm-workspace.yaml `catalog:` OR root package.json deps/devDeps — single source of truth, no hardcoded version. A fresh clone now goes `git clone → pnpm install → working repo`, no special setup ordering required. Self-landable split from #620.
f62ee15 to
dbd5d0a
Compare
Contributor
Author
|
bugbot run |
…l-deps The script does more than fetch from the npm registry: it also runs each pinned tarball through Socket Firewall and refuses to install if the firewall returns any alert. The new name reflects both halves of the contract — the firewall verification is the security-critical part that "from registry" obscured. - scripts/bootstrap-from-registry.mts → scripts/bootstrap-firewall-deps.mts - Update package.json preinstall hook to point at the new path - Update User-Agent string and fileoverview to match
Bill Li (billxinli)
approved these changes
Apr 27, 2026
…p list socket-sdk-js only uses @socketsecurity/lib; the typebox and packageurl-js entries were copied from socket-cli's bootstrap (where xport-schema.mts uses TypeBox) and broke CI here because neither has a pinned version in this repo's package.json or pnpm-workspace.yaml catalog. Restoring to a single-package bootstrap.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Self-landable split from #620.
Adds
scripts/bootstrap-firewall-deps.mtsthat downloads zero-dep Socket-fleet packages from the npm registry tarball directly intonode_modules/<scope>/<name>/BEFOREpnpm installruns. Wired viapreinstalllifecycle hook.Why
setup.mtsand other root-script importers fail on a fresh clone becausepnpm installhasn't run yet. Pre-seeding from the registry tarball solves the chicken-and-egg.Bootstrapped packages
In sorted order:
@sinclair/typebox— schema runtime used byxport-schema.mts+ thesetup-security-toolshook@socketregistry/packageurl-js— used by setup tooling@socketsecurity/lib— needed bysetup.mts, postinstall hooks, etc.Firewall verification
Each package version is checked against
firewall-api.socket.dev/purl/<encoded-purl>BEFORE the tarball is downloaded. Any alert in the response means malware (the API does not return informational alerts), so we block unconditionally on a populatedalertsarray. Network failures are non-fatal — a network blip should not break a fresh clone.This mirrors the
check-firewall.mtshelper insocket-registry/.github/actions/lib/.Behavior
pnpm-workspace.yamlcatalog:OR rootpackage.jsondeps/devDeps — single source of truth.curl+tar(POSIX, no extra tooling).Test plan