-
Notifications
You must be signed in to change notification settings - Fork 27
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: detect yarn.lock files in bin command #162
base: main
Are you sure you want to change the base?
Conversation
Hi @candrews, thanks for this PR! I'll be looking after this PR and helping you get it released. Firstly due to our internal systems requiring a non fork branch to run CI could you please first point this PR at this branch In the meantime I will look over the PR. Thanks again 😃 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added some pointers to help you reach what I believe the goal of the ticket is. Hope these are helpful 😃
As an aside, could you please share how you are using this binary to help maybe mold the solution.
Many thanks again for this PR 🙏
@@ -1,7 +1,7 @@ | |||
#!/usr/bin/env node | |||
const inspect = require('../dist/index') | |||
|
|||
inspect.buildDepTreeFromFiles('./', 'package.json', 'package-lock.json') | |||
inspect.buildDepTreeFromFiles('./', 'package.json', 'package-lock.json', 'yarn.lock') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I don't believe this code works as you expect.
To illustrate, here is the function signature for this function
function buildDepTreeFromFiles(
root: string,
manifestFilePath: string,
lockFilePath: string,
includeDev?: boolean,
strictOutOfSync?: boolean
): Promise<PkgTree>
This would mean we are passing yarn.lock
to the includeDev
argument.
I would suggest updating so that the 3rd argument - lockFilePath
- is conditionally passed as package-lock.json
or yarn.lock
based on some trigger. Maybe an cli flag as this is a "bin".
What this does
In the bin command, detect
yarn.lock
files in addition to the existing support forpackage.json
andpackage-lock.json
.Notes for the reviewer
node bin/index.js
from a directory containing ayarn.lock
file now display results.More information
Screenshots
Visuals that may help the reviewer