Skip to content

Replace npm with pinned lint tools - #229

Merged
ryanio merged 2 commits into
mainfrom
ryan/drop-npm-main
Nov 10, 2026
Merged

ryanio merged 2 commits into
mainfrom
ryan/drop-npm-main

Conversation

@ryanio

@ryanio ryanio commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator

SeaDrop's only npm dependencies were two dev tools, Biome and lefthook. This replaces them with the same pinned tooling seaport now uses (seaport#1429), so the repo has no Node or npm dependencies at all.

  • scripts/install-tools.sh downloads Biome, taplo, lefthook, shellcheck, shfmt and actionlint from their GitHub releases into .tools/bin, and checks each file against a pinned SHA-256. It's the same script as seaport's.
  • scripts/lint.sh check runs what CI runs: forge fmt --check, forge lint --deny warnings, Biome, taplo, shellcheck, shfmt and actionlint. scripts/lint.sh fix applies the formatters.
  • CI's lint job installs the tools (cached by the install script's hash) instead of setting up Node and running npm ci.
  • package.json, package-lock.json and .nvmrc are gone. .gitignore ignores .tools/ instead of node_modules.
  • Biome is pinned at 2.6.3, the version seaport uses. 2.6.6, which package.json had, was released on November 6, which is under the two weeks we wait before pinning a release. Its output on this repo is unchanged.
  • lefthook.yml runs the binaries from .tools/bin and also formats TOML and shell scripts.
  • scripts/check_sizes.sh is reindented to four spaces for shfmt. That's whitespace only.
  • AGENTS.md and the docs replace the npm run commands with the scripts and the plain forge coverage command.

No Solidity changes. A matching PR for the v2 branch follows.

🤖 Generated with Claude Code

Biome and lefthook came from npm. scripts/install-tools.sh now downloads
them, plus taplo, shellcheck, shfmt and actionlint, from their GitHub
releases and checks each against a pinned SHA-256, matching seaport.
scripts/lint.sh runs what CI runs. Biome is pinned at 2.6.3 (2.6.6 is
under two weeks old).

Removes package.json, package-lock.json and .nvmrc, and the Node steps
from CI. check_sizes.sh is reindented for shfmt.

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

Copilot AI 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.

🟡 Changes recommended

An ignored archive-extraction failure can leave an outdated executable in place while recording the new checksum and reporting success, causing subsequent installs to skip the needed update.

1 open issue
What changed in this PR

Replaces SeaDrop’s npm-based development tooling with pinned, checksum-verified binaries, removing Node.js and npm requirements without changing Solidity code.

Changes:

  • Adds tool installation and lint scripts, with cached binaries and expanded checks in CI.
  • Updates pre-commit hooks and formatting configuration for TOML and shell scripts.
  • Removes npm files and updates contributor documentation to use scripts and Foundry directly.
File Description
scripts/​lint.sh Adds unified lint and formatting commands.
scripts/​install-tools.sh Installs pinned tools with SHA-256 verification.
scripts/​check_sizes.sh Adjusts indentation only for shfmt.
package.json Removes npm dependencies and command wrappers.
package-lock.json Removes the npm dependency lockfile.
lefthook.yml Uses local binaries and expands staged-file formatting.
foundry.toml Removes an npm reference from a coverage comment.
docs/​UpgradeableContracts.md Updates coverage command guidance.
docs/​Development.md Documents tool installation and replacement commands.
biome.json Aligns the schema with the pinned Biome version.
AGENTS.md Updates contributor tooling instructions.
.taplo.toml Configures TOML formatting.
.nvmrc Removes the Node.js version pin.
.gitignore Replaces the npm directory exclusion with .tools/.
.github/​workflows/​test.yml Caches pinned tools and adds lint checks.
.editorconfig Defines shared whitespace and indentation settings.

Review effort: Balanced

Comment thread scripts/install-tools.sh Resolved
ryanio added a commit that referenced this pull request Nov 10, 2026
SeaDrop's only npm dependencies were two dev tools, Biome and lefthook.
This replaces them with the same pinned tooling seaport now uses
([seaport#1429](ProjectOpenSea/seaport#1429)),
so the repo has no Node or npm dependencies at all.

- `scripts/install-tools.sh` downloads Biome, taplo, lefthook,
shellcheck, shfmt and actionlint from their GitHub releases into
`.tools/bin`, and checks each file against a pinned SHA-256. It's the
same script as seaport's.
- `scripts/lint.sh check` runs what CI runs: `forge fmt --check`, the
Seaport pragma patch, `forge lint --deny warnings`, Biome, taplo,
shellcheck, shfmt and actionlint. `scripts/lint.sh fix` applies the
formatters.
- CI's lint job installs the tools (cached by the install script's hash)
instead of setting up Node and running `npm ci`.
- `package.json`, `package-lock.json` and `.nvmrc` are gone.
`.gitignore` ignores `.tools/` instead of `node_modules`.
- Biome is pinned at 2.6.3, the version seaport uses. 2.6.6, which
`package.json` had, was released on November 6, which is under the two
weeks we wait before pinning a release. Its output on this repo is
unchanged.
- `lefthook.yml` runs the binaries from `.tools/bin` and also formats
TOML and shell scripts.
- The shell scripts are reindented to four spaces for shfmt, and seven
unquoted variables that shellcheck flagged in `check_deployments.sh`,
`find_optimizer_runs.sh` and `forge_script_multichain.sh` are now
quoted.
- AGENTS.md and the docs replace the `npm run` commands with the scripts
and the plain build command.

No Solidity changes. The same change for `main` is
[seadrop#229](#229).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
set -e ignores a failure on the left of &&, so a failed tar during an
update left the old binary in place, marked with the new checksum.
Run the extraction and the move as separate commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ryanio added a commit that referenced this pull request Nov 10, 2026
Fixes the issue Copilot found on
[seadrop#229](#229 (comment))
for v2, since #230 already merged.

`scripts/install-tools.sh` extracted archives with `tar ... && mv ...`.
Under `set -e`, bash ignores a failure on the left of `&&`, so if `tar`
failed while updating an installed tool, the script kept the old binary,
recorded the new checksum and reported success. Later runs then skipped
the stale binary. The extraction and the move are now separate commands,
so a failed extraction stops the install.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@ryanio
ryanio merged commit 73db9f0 into main Nov 10, 2026
7 checks passed
@ryanio
ryanio deleted the ryan/drop-npm-main branch November 10, 2026 21:37
ryanio added a commit that referenced this pull request Nov 10, 2026
The README version badge read `version` from `package.json`, which
[#229](#229) removed. It
now shows the version `package.json` had, 1.0.0, as a static badge
linking to the releases page. The only GitHub release is `seadrop-1.0`,
and a release badge would show that on v2 as well, so v2 gets its own
static badge in a separate PR.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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