Skip to content

Dynamic NPM Package Runner #145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

imliam
Copy link

@imliam imliam commented Aug 16, 2025

This PR adds a helper that determines which NPM package manager should be used to run any given script out of npm, pnpm, yarn and bun. This should help AI use the correct CLI tools to use when running npm commands based on the project's existing dependencies.

@Copilot Copilot AI review requested due to automatic review settings August 16, 2025 12:03
Copy link

@Copilot 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 adds functionality to dynamically detect which NPM package manager (npm, pnpm, yarn, or bun) should be used in a Laravel project by checking for the presence of their respective lock files. The implementation includes a new method in the GuidelineAssist class and updates AI guidance templates to use the detected package manager instead of hardcoded "npm" commands.

  • Added nodePackageManager() method to detect package manager from lock files
  • Created comprehensive test coverage for all supported package managers
  • Updated AI guidance templates to dynamically reference the correct package manager

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/Install/GuidelineAssist.php Added nodePackageManager() method with file-based detection logic
tests/Feature/Install/GuidelineAssistTest.php Added test suite covering all package managers and edge cases
.ai/laravel/core.blade.php Updated Vite error guidance to use dynamic package manager
.ai/foundation.blade.php Updated frontend bundling guidance to use dynamic package manager

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

@ashleyhindle
Copy link
Collaborator

Great thinking @imliam 💪 Think it'd be best to compute it only once rather than on each call 👌

@imliam
Copy link
Author

imliam commented Aug 16, 2025

Great thinking @imliam 💪 Think it'd be best to compute it only once rather than on each call 👌

Consider it done @ashleyhindle!

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