Skip to content

Do not detect proxy directories inside vendor directories as entrypoints #245

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

Merged
merged 2 commits into from
May 9, 2025

Conversation

andrewbranch
Copy link
Collaborator

No description provided.

Copy link

changeset-bot bot commented May 9, 2025

🦋 Changeset detected

Latest commit: a4dc8a6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@arethetypeswrong/core Patch
@arethetypeswrong/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

} catch {
return false;
const packageJson = JSON.parse(fs.readFile(file));
if (packageJson.name && !packageJson.name.startsWith(fs.packageName)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is already here in the old code, but I didn't realize that the name mattered at all for these marker-style package.jsons; I figured it didn't really matter much

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This whole thing is just heuristics, but the idea is that your own subpackages are likely to be named "my-root-package/subdir" or not have a name at all. If the name is something else entirely, you’ve probably just vendored another package.

Copy link
Contributor

Choose a reason for hiding this comment

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

In this case, I feel like ignoring nested node_modules would probablty also have worked (since that itself is a no-no that shouldn't have been able to happen)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That would work for this case, but it wouldn't work for packages that vendor other packages in a folder not called node_modules, which next does. (It just happens not to have any vendored packages that contain subfolders with nameless package.json files.)

@andrewbranch andrewbranch merged commit ca08a50 into main May 9, 2025
2 checks passed
@andrewbranch andrewbranch deleted the bug/no-proxy-dirs-in-vendor branch May 9, 2025 19:22
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