Skip to content

feat(sdk): move a pinned dependency in one command with make sync-pinned - #144

Merged
0xalexbel merged 5 commits into
release/0.13.xfrom
devex/alexb/v13/sync-pinned
Oct 8, 2026
Merged

0xalexbel merged 5 commits into
release/0.13.xfrom
devex/alexb/v13/sync-pinned

Conversation

@0xalexbel

Copy link
Copy Markdown
Contributor

Summary

Moving a pinned dependency (npm-manifest.json#dependencies.pinned) meant hand-editing every
package.json that declares it, then regenerating six lockfiles in three different ways until
check pinned-dependencies passed. This PR turns that into: edit the pin, run make sync-pinned.

Changes

  • fhevm-npm sync pinned copies the manifest's pins into every package.json declaration. It
    walks exactly what check pinned-dependencies walks, so that check's package.json half passes by
    construction. Specs are replaced as text inside their dependency block and the result proven by
    reparsing, so formatting and every other entry stay byte for byte. --check compares without writing.
  • make sync-pinned runs sync pinned, then sync hh-v2-constants (Hardhat 2 only, tagged for
    removal), then npm install --package-lock-only in each install root, then the consumer-lock
    regeneration, then check pinned-dependencies, then install-ci to install exactly what the new
    lockfiles say, as CI will.
  • Fix: consumer-lock regeneration no longer starts from an empty lockfile. It deleted each fixture's
    lock before running npm, so every regeneration moved every dependency to the newest in-range version.
    npm now starts from the committed lock and only re-resolves what changed. --fresh keeps the old
    behaviour for a deliberate refresh.
  • .gitignore covers the scratch fhevm-npm can leave in the tree after an interrupted run: the
    consumer-lock staging folders, their pending lockfiles, and the test workspaces under fhevm-npm/.

Verified

Starting from the release branch with only the pins moved (@fhevm/sdk ^0.13.4 → ^0.13.7,
@fhevm/solidity ^0.13.3 → ^0.13.4), the steps of make sync-pinned up to the pin check:

  • reproduce the 11 hand-edited package.json files byte for byte;
  • move only the two pinned packages in every lockfile. Before the regeneration fix, the Hardhat 3
    plugin fixture moved 25 versions and each host-contracts fixture moved @types/node, tsx and
    typescript, though none of them uses either pin;
  • leave check pinned-dependencies passing.

fhevm-npm suite: 369 tests pass. The pin bump itself is not part of this PR; it follows in its own.

🤖 Generated with Claude Code

0xalexbel and others added 5 commits October 8, 2026 21:00
…to every package.json

Moving a pinned dependency meant hand-editing every package.json that declares it until
`check pinned-dependencies` passed. `sync pinned` copies npm-manifest.json#dependencies.pinned into every
declaration instead, walking exactly the packages and dependency fields the check walks, so the
package.json half of the check passes by construction. `--check` compares without writing.

Each spec is replaced as text inside its dependency block and the result proven by reparsing, so
formatting and every other entry stay byte for byte. Lockfiles are left to npm: the command says to run
`make install` and the consumer-lock regeneration next.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mmand

Runs `fhevm-npm sync pinned`, rewrites each install root's lockfile with `npm install
--package-lock-only` (no node_modules, no install scripts, already-locked versions kept), regenerates
the consumer fixtures' lockfiles, proves the result with `check pinned-dependencies`, then installs
from the new lockfiles with `install-ci`, as CI will.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…interrupted run

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… instead of from scratch

test-consumer-regenerate-package-lock deleted the fixture's lockfile before running npm, so every
regeneration moved every dependency to the newest version its range allowed. A pin bump through
`make sync-pinned` dragged unrelated updates into fixtures that do not even use the pinned package
(@types/node, tsx and typescript in all four host-contracts fixtures).

npm now starts from the committed lockfile, as `npm install` does in an installation root, so only
what changed is re-resolved. `--fresh` keeps the old behaviour for a deliberate refresh. A local
payload whose locked version went stale still fails the existing validation instead of being written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A @fhevm/solidity pin bump left `make check-pre` failing until `sync hh-v2-constants` was run by hand.
`make sync-pinned` now runs it right after `sync pinned`; it writes only when the constants are stale, so
any other pin bump leaves them untouched. Tagged hh-v2-constants for removal with hardhat/v2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@0xalexbel
0xalexbel requested a review from a team October 8, 2026 21:10
@cla-bot cla-bot Bot added the cla-signed label Oct 8, 2026
@0xalexbel
0xalexbel merged commit c149194 into release/0.13.x Oct 8, 2026
6 checks passed
@0xalexbel
0xalexbel deleted the devex/alexb/v13/sync-pinned branch October 8, 2026 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants