Skip to content

feat: implement shared utilities in @metamask/local-node-utils#9234

Open
ulissesferreira wants to merge 4 commits into
mainfrom
add-local-node-utils-package-impl
Open

feat: implement shared utilities in @metamask/local-node-utils#9234
ulissesferreira wants to merge 4 commits into
mainfrom
add-local-node-utils-package-impl

Conversation

@ulissesferreira

@ulissesferreira ulissesferreira commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR is the second of a stacked series introducing @metamask/local-node-utils.

It implements the shared installer utilities extracted from the *-up runtime packages, stacked on #9233.

What's included

  • Shared types for artifact platform configuration
  • MetaMask cache directory resolution from Yarn config
  • Artifact config merge/resolve helpers and cache keys
  • File download with redirect handling, checksum verification, and archive extraction
  • Executable wrapper installation (absolute and relative path modes)
  • Generic package.json tool config reader
  • Comprehensive unit tests

What's NOT included

No changes to java-tron-up, bitcoin-regtest-up, or solana-test-validator-up yet — those follow in stacked PRs per package.

Stacked PRs

  1. feat: scaffold @metamask/local-node-utils package #9233 — scaffold only
  2. This PR — shared utilities implementation
  3. One PR per *-up package to adopt @metamask/local-node-utils

Test plan

  • yarn workspace @metamask/local-node-utils run build
  • yarn workspace @metamask/local-node-utils run test
  • yarn workspace @metamask/local-node-utils run changelog:validate

Note

Low Risk
New library and dev tooling only; no consumer *-up packages are wired in yet, so production install behavior is unchanged until follow-up PRs.

Overview
@metamask/local-node-utils replaces the scaffold with the shared installer logic that will be adopted by java-tron-up, bitcoin-regtest-up, and similar packages: artifact config merge/resolve/cache keys, Yarn-aware MetaMask cache paths, HTTP downloads with redirects, SHA-256 verification, tar extraction, node_modules/.bin wrapper generation, platform/arch detection (including Rosetta via sysctl), and package.json tool-config lookup.

The public API is re-exported from index.ts; yaml is added as a runtime dependency. Tests cover unit and integration paths (including nock for downloads); Jest coverage thresholds are relaxed from 100% to 90%/75% branches. Monorepo knip ignores sysctl for this package; root lint:eslint heap is bumped to 7168 MB.

Reviewed by Cursor Bugbot for commit 5dca017. Bugbot is set up for automated code reviews on this repo. Configure here.

@ulissesferreira ulissesferreira requested review from a team as code owners June 23, 2026 11:45
@ulissesferreira ulissesferreira force-pushed the add-local-node-utils-package-scaffold branch from 4807442 to 2ff98d2 Compare June 23, 2026 11:57
Base automatically changed from add-local-node-utils-package-scaffold to main June 23, 2026 13:22
@ulissesferreira ulissesferreira force-pushed the add-local-node-utils-package-impl branch from 65ac099 to 97084d1 Compare June 23, 2026 13:31
Battambang
Battambang previously approved these changes Jun 23, 2026

@Battambang Battambang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ulissesferreira ulissesferreira added this pull request to the merge queue Jun 23, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 23, 2026
Extract common installer helpers used by the local node runtime packages:
cache resolution, artifact config, downloads, checksums, archives,
executable wrappers, and package.json config parsing.
Align nock version with the monorepo, add knip sysctl ignore, fix ESLint
and formatting issues in shared utility sources and tests.
The monorepo lint step exceeded the 6GB Node heap during merge queue
runs after rebasing onto main. Increase the limit to 7GB, following the
same approach as #7906.
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