Skip to content

Migrate to npm#949

Open
tagliala wants to merge 1 commit intomainfrom
security/supply-chain-mitigation
Open

Migrate to npm#949
tagliala wants to merge 1 commit intomainfrom
security/supply-chain-mitigation

Conversation

@tagliala
Copy link
Copy Markdown
Contributor

@tagliala tagliala commented Apr 1, 2026

Additionally, add cooldown to dependabot configuration

@tagliala tagliala force-pushed the security/supply-chain-mitigation branch from ac3d6ae to 7bf9e8e Compare April 1, 2026 15:15
@javierjulio
Copy link
Copy Markdown
Member

@tagliala thank you. I prefer to use npm all where possible. Not pnpm. Let's stick with the defaults. That should work better with cssbundling-rails as well. I had to use yarn in ActiveAdmin for a feature for local development. That may or may not be needed but we can review that there.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (d6e7a20) to head (47d4cb4).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #949   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           14        14           
  Lines          106       106           
=========================================
  Hits           106       106           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@javierjulio
Copy link
Copy Markdown
Member

I think the one reason I went with yarn at least for the Procfile was that it had built in file watching, npm does not.

@tagliala tagliala force-pushed the security/supply-chain-mitigation branch from 7bf9e8e to 5da2bf0 Compare April 1, 2026 15:22
@tagliala tagliala changed the title Migrate to pnpm Migrate to npm Apr 1, 2026
@tagliala tagliala force-pushed the security/supply-chain-mitigation branch 2 times, most recently from f55de24 to 83c0900 Compare April 1, 2026 15:30
@tagliala tagliala requested a review from Copilot April 1, 2026 15:31
@tagliala tagliala force-pushed the security/supply-chain-mitigation branch from 83c0900 to 28ed200 Compare April 1, 2026 15:32
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates the app’s frontend dependency management from Yarn to npm, updating development/CI workflows and Dependabot settings accordingly.

Changes:

  • Replace Yarn usage with npm (yarn.lock removed, package-lock.json added, docs and Procfile updated).
  • Update GitHub Actions workflow to set up Node from .node-version with npm caching.
  • Adjust Dependabot configuration (adds cooldown and updates npm ecosystem settings).

Reviewed changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
yarn.lock Removed Yarn lockfile as part of migration to npm.
package-lock.json Added npm lockfile to pin JS dependencies under npm.
package.json Removes Yarn packageManager metadata; retains build script(s).
README.md Updates setup instructions to use npm install instead of yarn install.
Procfile.dev Switches CSS watcher process to npm run build:css.
.npmrc Adds npm configuration (notably install-script behavior).
.node-version Pins Node version for local dev/CI (used by workflow).
.github/workflows/tests.yml Adds Node setup step using .node-version and npm cache.
.github/dependabot.yml Adds cooldown settings and aligns ecosystems (bundler/npm/github-actions).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Additionally:
- Add cooldown to dependabot configuration
- Remove tailwind ignore
- Add `.node-version` for parity with `.ruby-version`
- Add reference to mise tool version manager
@tagliala tagliala force-pushed the security/supply-chain-mitigation branch from 37fc7ca to 47d4cb4 Compare April 1, 2026 15:43
@tagliala
Copy link
Copy Markdown
Contributor Author

tagliala commented Apr 1, 2026

@javierjulio migrated to npm, plus other small additions

@tagliala tagliala requested a review from javierjulio April 1, 2026 16:19
@@ -0,0 +1 @@
lts/krypton
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.

I prefer we are explicit with the version number so we should use 24.14.1. Follows the same approach as Ruby with an explicit version.

Suggested change
lts/krypton
24.14.1

@@ -0,0 +1 @@
ignore-scripts=true
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.

Is it necessary to include this? I don't want to break to watch commands for local development for this app. I understand the concern with security but I don't think it's worth it for a demo app. Is there an alternative without breaking the watch commands?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The solution would be pnpm with explicit post-install allowance, but then I guess that the supply chain attacks will be directed to such packages

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

How can I test that watch does not work without post-install?

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.

3 participants