Skip to content

chore: add npmrc file with ignore-scripts. yes, and offline configuration#29882

Merged
tommasini merged 1 commit into
mainfrom
chore/npmrc-file
May 8, 2026
Merged

chore: add npmrc file with ignore-scripts. yes, and offline configuration#29882
tommasini merged 1 commit into
mainfrom
chore/npmrc-file

Conversation

@tommasini

@tommasini tommasini commented May 7, 2026

Copy link
Copy Markdown
Contributor

Description

The .npmrc file configures npm's behavior for this project. Here's what each line does:

ignore-scripts = true Prevents npm from automatically running lifecycle scripts (like preinstall, postinstall, prepare, etc.) defined in package.json of installed dependencies. This is a security measure — it stops potentially malicious packages from executing arbitrary code during installation. The tradeoff is that some packages that rely on build scripts (like native modules) won't set themselves up automatically, which is why this project uses yarn setup instead of a plain install.

yes = false Disables automatic "yes" responses to prompts. This ensures npm will actually pause and ask for confirmation on interactive prompts rather than silently accepting defaults — useful to avoid unintended actions during scripted environments.

offline = true Forces npm to only use the local cache and never hit the network. If a package isn't already cached, the install fails rather than fetching it. This is a reproducibility and security measure — it ensures installs are deterministic and prevents supply-chain attacks from packages being silently swapped on the registry.

Changelog

CHANGELOG entry:

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Medium Risk
Adds a repo-wide .npmrc that changes dependency-install behavior (disables lifecycle scripts and forces offline/cache-only installs), which can break installs in CI/dev environments if assumptions differ.

Overview
Adds a committed .npmrc configuring npm to ignore-scripts, disable auto-yes, and run in offline mode.

Updates .gitignore to stop excluding .npmrc, so these npm defaults are versioned and applied consistently across the project.

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

@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbotv2 metamaskbotv2 Bot added the team-mobile-platform Mobile Platform team label May 7, 2026
@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: None (no tests recommended)
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 97%
click to see 🤖 AI reasoning details

E2E Test Selection:
The two changed files are purely npm/git configuration:

  1. .gitignore: Removed the entry that excluded .npmrc from version control. This is a meta-change allowing .npmrc to be tracked in git.

  2. .npmrc: A new committed npm configuration file with three settings:

    • ignore-scripts = true: Prevents lifecycle scripts during npm install (security hardening)
    • yes = false: Disables auto-confirmation
    • offline = true: Forces use of cached packages

These changes affect only the npm package management behavior and have zero impact on:

  • Application source code or business logic
  • UI components, screens, or user flows
  • Controllers, Engine, or state management
  • E2E test infrastructure or test code
  • Performance-sensitive code paths

No E2E tests need to run for these changes. They are purely developer tooling/configuration changes with no user-facing or test-facing impact.

Performance Test Selection:
The changes are limited to npm and git configuration files (.npmrc and .gitignore). These have no impact on app rendering, data loading, state management, or any performance-sensitive code paths. No performance tests are warranted.

View GitHub Actions results

@sonarqubecloud

sonarqubecloud Bot commented May 7, 2026

Copy link
Copy Markdown

@tommasini tommasini added no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed and removed team-mobile-platform Mobile Platform team size-XS labels May 7, 2026

@Gudahtt Gudahtt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@tommasini tommasini added this pull request to the merge queue May 8, 2026
Merged via the queue into main with commit f244684 May 8, 2026
86 of 93 checks passed
@tommasini tommasini deleted the chore/npmrc-file branch May 8, 2026 17:59
@github-actions github-actions Bot locked and limited conversation to collaborators May 8, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.78.0 Issue or pull request that will be included in release 7.78.0 label May 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.78.0 Issue or pull request that will be included in release 7.78.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants