Skip to content

Conversation

m-shaka
Copy link
Contributor

@m-shaka m-shaka commented Aug 15, 2023

Hi. thank you for the release of treatSelfReferenceAs!
However, I found that it doesn't work well when given package name is scoped (like @vanilla-extract/css).

Copy link
Owner

@uhyo uhyo left a comment

Choose a reason for hiding this comment

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

Thank you! What an easy mistake 🥲
I left a comment.

}
const lookupResult = lookupPackageJson(importerFilename);
if (lookupResult !== null) {
if (moduleSpecifier.startsWith(lookupResult.packageJson.name)) {
Copy link
Owner

Choose a reason for hiding this comment

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

👀 This might lead to a false negative, e.g. when lookupResult.packageJson.name === "@uhyo/project" and moduleSpecifier === "@uhyo/project2".

Also I would like to keep lookupPackageJson guarded with the RegExp check in order to reduce file system access.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Apologies for ignoring the original intention of regex! I've made the corrections

Copy link
Owner

@uhyo uhyo left a comment

Choose a reason for hiding this comment

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

Thanks! 🙇

@uhyo uhyo merged commit 7c21823 into uhyo:master Aug 15, 2023
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