Skip to content
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

fix(loadNpmTasks): load tasks relative to package location #1762

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

redonkulus
Copy link

@redonkulus redonkulus commented Mar 24, 2023

@vladikoff

Fixes #1732

Implements @tehhowch suggested to fix to support symlinked npm packages within a mono-repo setting. Existing tests pass and I was able to test this within a local mono-repo myself. I'm not sure how to add a new test with a symlink so I'm making an assumption that if existing tests pass, then this is ok.

I also had to fix a special case where if an npm package's tasks are not loaded at the package root (e.g. not node_modules/foo/tasks instead at node_modules/foo/dist/tasks), then parse the directory name and include that when loading the tasks.

For example:

  • grunt.loadNpmTasks('grunt-contrib-clean') -> Would check for tasks directory at package root.
  • grunt.loadNpmTasks('@foo/grunt-bar') -> Would also check for tasks directory at package root.
  • grunt.loadNpmTasks('@foo/grunt-bar/dist') -> Would add the dist directory to check for the tasks

Please let me know of another way if possible.

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.

loadNpmTasks fails to find task plugins when working with monorepo symlinks
1 participant