-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: add dir into deps #2
Conversation
|
||
if (info.conflictDependency) { | ||
for (const dep of info.conflictDependency) { | ||
const source = platformPackager.info.appDir + path.sep + "node_modules" + path.sep + info.name + path.sep + "node_modules" + path.sep + dep.name |
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.
Curious, how do we know that it's a double-nested node_modules
? I'm worried about the hard-coded approach here, but wanted to understand the context here.
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.
All dependencies are placed directly into a map. If it's found that there's already a dependency with the same name but a different version in the map, it indicates a conflict. Currently, I'm placing the conflicting version directly into the node_modules of the current package,so we know that it's a double-nested node_modules.
The name conflictDependency might be somewhat misleading; we could consider renaming it.
@@ -3,7 +3,7 @@ import { executeAppBuilderAsJson } from "./appBuilder" | |||
|
|||
export function createLazyProductionDeps(projectDir: string, excludedDependencies: Array<string> | null) { | |||
return new Lazy(async () => { | |||
const args = ["node-dep-tree", "--dir", projectDir] | |||
const args = ["node-dep-tree", "--flatten", "--dir", projectDir] |
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.
Is this a new arg --flatten
you've implemented in app-builder or something that already exists? Curious as to what changes you made to app-builder for this to work? 🙂
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 didn't want to disrupt the original architecture, so I added this new parameter. Only with this parameter will the content be output in the new format; without it, the content will remain in the old format.
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.
Great idea! Love it
No description provided.