-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
feature: check --verify-tree for verifying node_modules structure #2419
Conversation
…ng in sync with common.js
Needs cleanup and tests |
Thank you for building this! |
Not sure what to do with optional deps because hoisting may cause some inconsistencies, I'll probably ignore them for this round. |
Suggest a better name for the flag than commonjs |
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.
looks pretty soundy to me, I'll rename the flag as proposed (or even a better solution), may be worthy pinging @kittens for better ideas.
while (locations.length >= 0) { | ||
let possiblePath; | ||
if (locations.length > 0) { | ||
possiblePath = path.join(registry.cwd, registry.folder, |
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.
nit
possiblePath = path.join(
registry.cwd,
registry.folder,
locations.join(path.sep + registry.folder + path.sep)
);
@@ -15,6 +15,160 @@ export const noArguments = true; | |||
|
|||
export function setFlags(commander: Object) { | |||
commander.option('--integrity'); | |||
commander.option('--commonjs'); |
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.
As @davidaurelio suggested commonjs
is probably not related to node js modules resolution, let's think of a better name:
--resolve-correctly
--verify-tree
--check-tree
other suggestion is to unify check
and pass a level variable to it, so it will be something like --check lite
--check deep
--check full
or --check 0
...--check 2
or as an array (yargs supports this, not sure what commander does) --check 1 3
Could you add some documentation for this on https://yarnpkg.com/lang/en/docs/cli/check/ ? :-) |
Will do.
I am reworking check functionality now, so I'll do it in one go in the
next couple of weeks
…On Fri, 10 Mar 2017 at 20:40, Ed Morley ***@***.***> wrote:
Could you add some documentation for this on
https://yarnpkg.com/lang/en/docs/cli/check/ ? :-)
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#2419 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACBdWMSuC6NtDEIJBi39nEUu9kiXSunJks5rkbVVgaJpZM4Le81W>
.
|
Documentation still lacks information about |
Yeah, or better send a PR :)
…On Sat, Dec 30, 2017 at 11:54 AM Bartosz Kaszubowski < ***@***.***> wrote:
Documentation still lacks information about --verify-tree flag. Should I
report this as an issue to yarn/website?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#2419 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACBdWAIQpoxkx7ofSX_tqLe4zBYK_ReTks5tFpUEgaJpZM4Le81W>
.
|
Summary
Yarn needs an independend of resolving mechanism way of verifying node_modules correctness
Test plan
Manual test plan for React Native with these modifications:
node_modules/chalk
(direct and hoisted dep)node_modules/symbol-tree
(dev dep)node_modules/throat
node_modules/babel-core/node_modules/json5