doNotFollow in API works unexpectedly
See original GitHub issueMaybe this isn’t actually a bug and I just misunderstand the purpose of this option? If that’s the case feel free to correct my expectations 🙂
Expected Behavior
Including doNotFollow: 'node_modules'
in the API options adds the list of dependencies my modules have on npm packages but doesn’t include those npm packages in dependency traversal.
Current Behavior
Including doNotFollow: 'node_modules'
adds the list of npm package dependencies but also traverses all of node_modules
.
Steps to Reproduce
- Compare
cruise(['./'], {doNotFollow: 'node_modules'}).output
withcruise(['./']).output
: there appears to be no difference.
Context
Wishing to get a list of dependencies (including npm package dependencies) but without traversing node_modules
because that folder gets huge and I don’t care about the dependencies in there 🙂
Your Environment
- Version used:
8.2.0
- Node version:
12.16.0
- Link to your project: https://github.com/electrovir/test-dependency-cruiser-do-not-follow/blob/master/test.ts
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Evolving "nofollow" – new ways to identify the nature of links
Today, we're announcing two new link attributes that provide webmasters with additional ways to identify to Google Search the nature of particular links....
Read more >Nofollow link and rel=nofollow explained - ContentKing
Despite "sponsored" and "ugc", the nofollow link attribute remains an important factor to consider when creating and building links!
Read more >The Hidden Power of Nofollow Links - Moz
Here's why nofollow links are more powerful than you might think. ... post I read is really relevant to this blog post I'm...
Read more >[0.63.1][Android] Dimensions API stops working randomly after ...
stops working/firing events randomly after a while. I can't figure out exactly what triggers the issue, but after the event listener stops ...
Read more >Error-Oops, you've found a dead link. - JIRA
Solved: I am trying to hit the API ... Atlassian Jira <a class="seo-link" rel="nofollow" ... Can you work with /rest/api/2/issue ?
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Second that - it should’ve worked that way from the outset (so thanks for realising this, raising it as an issue and being tenacious!). I doubt it is going to affect a lot of current users - or even whether it would classify as a breaking change. But even if it is, dependency-cruiser will get a major-bump - which will have to happen soon anyway because node 8 support is becoming untenable and needs to be dropped.
Hi @electrovir - this is similar to the mono-repo I’ve worked with over the last years. We’ve been using something like
packages/*/{src,lib}
as a pattern because that’s where the sources typically resided. For also including all casesmaybe-not-named-src
some glob magic will be required indeed.As a first try I’ve used the pattern
"packages/*/!(node_modules)"
- and that works as expected, in the sense that scans everything in packages/*/, except node_modules. You might want to include some extra inclusion patterns there for good measure -dist
(or wherever generated javascript goes),coverage
might be good candidates, but maybe also config files…=> Just interested: what’s the reason to use the API instead of the cli?