Skip to content

Commit 7e2a28c

Browse files
authored
chore: cascade — socket-registry refs + @socketsecurity/lib 5.21.0 + workspace hooks + lib-stub expansion (#596)
* chore: cascade — socket-registry refs + @socketsecurity/lib 5.21.0 + workspace hooks + lib-stub expansion Squash of the full cascade sync branch: 1. socket-registry action refs bumped to @3362af95fadd1e325cb48e9ad6daff21c112bd72. Cascades the pnpm 11.0.0-rc.0 → 11.0.0-rc.2 bump from socket-registry. 2. .github/workflows/weekly-update.yml reduced to a thin 20-line delegator calling SocketDev/socket-registry/.github/workflows/weekly-update.yml. 3. @socketsecurity/lib bumped 5.18.2 → 5.21.0 (via 5.19.0, 5.19.1, 5.20.0, 5.20.1). Hook manifest .claude/hooks/check-new-deps/package.json kept in lockstep. Brings: - `schema/` module (replaces retired `validation/validate-schema`) - `json/parse` absorbs `validation/json-parser`'s `safeJsonParse` - `withResolvers()` on `promises` (TC39 Promise.withResolvers) - spec-compliant `escapeRegExp` (bound to native RegExp.escape on Node 24+) - O(1) LRU in memoization; wildcard clear() compile-once in cacache - ENOENT normalized across extractZip/Tar/TarGz - dlx pin pipeline, pacote shim fix, DlxBinaryOptions.hash, stdio/prompts restoration Test update required by #3: `test/unit/promise-queue.test.mts` — 5.21.0's bounded queue rejects the NEWEST submission when full (preserving committed-to in-flight work), not the oldest. Renamed the test and updated the scenario to match the new contract. 4. pnpm-workspace.yaml packages glob now includes .claude/hooks/* so taze bumps hook manifests automatically. 5. createLibStubPlugin in .config/esbuild.config.mts also stubs external/del.js + external/cacache.js (eagerly loaded by lib/fs + lib/cacache but unused by the SDK). 6. fix(publish): gate --provenance on GITHUB_ACTIONS so local publish runs don't break. 7. Fixes pre-existing printFooter imports in scripts/build.mts + scripts/check.mts that pulled from lib/stdio/header where printFooter never lived. 5.18.2's loose subpath exports hid the bug; 5.19.x surfaces it. Folds PR #601 (socket-registry 3362af95 bump) into this cascade. * chore(ci): bump socket-registry workflow refs to 594526f * fix(ci): allow @pnpm/exe preinstall for pnpm rc.3 bootstrap * chore(ci): bump socket-registry refs to main (6e347cee) Picks up pinned sfw download fix (checksum vs version drift). * chore(ci): bump socket-registry refs to main (46132ceb) Picks up SFW_CUSTOM_REGISTRIES bypass list export. * chore(ci): bump socket-registry refs to main (a5923566) and swap secret ref * chore(provenance): drop publish-without-sfw + bump socket-registry to d638c11f Upstream socket-registry removed the publish-without-sfw escape hatch (the shim disable/restore dance is no longer needed post-bypass).
1 parent ebb9c49 commit 7e2a28c

13 files changed

Lines changed: 142 additions & 418 deletions

File tree

.claude/hooks/check-new-deps/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"dependencies": {
1313
"@socketregistry/packageurl-js": "1.4.2",
14-
"@socketsecurity/lib": "5.18.2",
14+
"@socketsecurity/lib": "5.21.0",
1515
"@socketsecurity/sdk": "4.0.1"
1616
},
1717
"devDependencies": {

.config/esbuild.config.mts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,21 @@ function createNodeProtocolPlugin() {
241241
* minimal lookup covering just those types.
242242
*/
243243
function createLibStubPlugin() {
244+
// Heavy lib modules that are eagerly required but never exercised
245+
// by the SDK's actual code paths.
246+
//
247+
// Never-reached by SDK gateway modules:
248+
// - globs.js / sorts.js → only used by fs helpers the SDK skips
249+
// - external/npm-pack.js / pico-pack.js → Arborist/pacote/fast-glob,
250+
// SDK only needs validateFiles() from fs
251+
//
252+
// Never-reached transitive external shims:
253+
// - external/cacache.js → destructures from npm-pack (already stubbed),
254+
// SDK's cache-with-ttl path degrades gracefully
255+
// - external/del.js → pulled in by fs's lazy getDel() for safeDelete,
256+
// SDK never calls safeDelete/safeDeleteSync
244257
const libStubPattern =
245-
/@socketsecurity\/lib\/dist\/(globs|sorts|external\/(npm-pack|pico-pack))\.js$/
258+
/@socketsecurity\/lib\/dist\/(globs|sorts|external\/(npm-pack|pico-pack|cacache|del))\.js$/
246259

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

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ concurrency:
2121
jobs:
2222
ci:
2323
name: Run CI Pipeline
24-
uses: SocketDev/socket-registry/.github/workflows/ci.yml@bbe46386c0a2bc6baefd02916234956a38e622d5 # main
24+
uses: SocketDev/socket-registry/.github/workflows/ci.yml@d638c11f4bc7ac637e0f61f05729a54d68af40e0 # main
2525
with:
2626
test-script: 'pnpm run test --all --skip-build'

.github/workflows/generate.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ jobs:
4646
echo "Sleeping for $delay seconds..."
4747
sleep $delay
4848
49-
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@bbe46386c0a2bc6baefd02916234956a38e622d5 # main
49+
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@d638c11f4bc7ac637e0f61f05729a54d68af40e0 # main
5050

5151
- name: Configure push credentials
5252
env:
5353
GH_TOKEN: ${{ github.token }}
5454
run: git remote set-url origin "https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git"
5555

56-
- uses: SocketDev/socket-registry/.github/actions/setup-git-signing@bbe46386c0a2bc6baefd02916234956a38e622d5 # main
56+
- uses: SocketDev/socket-registry/.github/actions/setup-git-signing@d638c11f4bc7ac637e0f61f05729a54d68af40e0 # main
5757
with:
5858
gpg-private-key: ${{ secrets.BOT_GPG_PRIVATE_KEY }}
5959

@@ -145,5 +145,5 @@ jobs:
145145
> \`\`\`
146146
EOF
147147
148-
- uses: SocketDev/socket-registry/.github/actions/cleanup-git-signing@bbe46386c0a2bc6baefd02916234956a38e622d5 # main
148+
- uses: SocketDev/socket-registry/.github/actions/cleanup-git-signing@d638c11f4bc7ac637e0f61f05729a54d68af40e0 # main
149149
if: always()

.github/workflows/provenance.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ on:
1616
options:
1717
- '0'
1818
- '1'
19-
publish-without-sfw:
20-
description: 'Publish directly to npm, bypassing Socket firewall shims'
21-
required: false
22-
default: false
23-
type: boolean
2419

2520
permissions: {}
2621

@@ -30,14 +25,13 @@ jobs:
3025
permissions:
3126
contents: write # To create GitHub releases
3227
id-token: write # For npm trusted publishing via OIDC
33-
uses: SocketDev/socket-registry/.github/workflows/provenance.yml@bbe46386c0a2bc6baefd02916234956a38e622d5 # main
28+
uses: SocketDev/socket-registry/.github/workflows/provenance.yml@d638c11f4bc7ac637e0f61f05729a54d68af40e0 # main
3429
with:
3530
debug: ${{ inputs.debug }}
3631
dist-tag: ${{ inputs.dist-tag }}
3732
package-name: '@socketsecurity/sdk'
3833
publish-script: 'publish:ci'
39-
publish-without-sfw: ${{ inputs.publish-without-sfw }}
4034
setup-script: 'ci:validate'
4135
use-trusted-publishing: true
4236
secrets:
43-
SOCKET_API_KEY: ${{ secrets.SOCKET_API_KEY }}
37+
SOCKET_API_KEY: ${{ secrets.SOCKET_API_TOKEN }}

0 commit comments

Comments
 (0)