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(npm): resolve node_modules dir relative to package.json instead of cwd #17885

Merged
merged 8 commits into from
Feb 23, 2023

Conversation

dsherret
Copy link
Member

No description provided.

@dsherret dsherret requested a review from bartlomieju February 22, 2023 23:17
@@ -524,6 +535,14 @@ impl ConfigFile {
/// Filenames that Deno will recognize when discovering config.
const CONFIG_FILE_NAMES: [&str; 2] = ["deno.json", "deno.jsonc"];

// todo(dsherret): in the future, we should enforce all callers
// to provide a resolved path
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I've done in other projects is introduced a ResolvedPath struct, then force resolving that once and passing it around.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a very good idea, we should do the same

}

Ok(())
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was taken from elsewhere in the CLI.

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, great improvement. Thanks for looking into this!

@dsherret dsherret merged commit ddc3507 into denoland:main Feb 23, 2023
@dsherret dsherret deleted the fix_package_json_resolution branch February 23, 2023 01:16
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.

2 participants