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

[expanded-types]: Types from dependencies in node_modules #101

Open
r3dDoX opened this issue Mar 9, 2024 · 3 comments
Open

[expanded-types]: Types from dependencies in node_modules #101

r3dDoX opened this issue Mar 9, 2024 · 3 comments

Comments

@r3dDoX
Copy link

r3dDoX commented Mar 9, 2024

I noticed that one union type in my project is not getting expanded as I would've expected. It is a union type from a 3rd party dependency that is installed as a node module. I am importing this type like this:
import { Placement } from '@floating-ui/dom';

Then in my lit component I have a property like this:
@property() public placement?: Placement;

What ends up in my custom-elements-manifest.json looks like this:

{
  "text": "Placement | undefined"
}

I would have expected this type to be expanded like local union types.

@break-stuff
Copy link
Owner

This plugin is not currently configured to resolve types outside of the project.

@r3dDoX
Copy link
Author

r3dDoX commented Mar 10, 2024

Alright, thanks for the response!

I quickly checked out the code and saw, that getResolvedImportPath is currently using path.resolve which is not able to resolve node_module imports. Other than that, it should probably be possible IMO. Do you know if there is any other issue I didn't see, preventing this? Maybe if I can find time in the coming days I could have a look at it.

@break-stuff
Copy link
Owner

I believe it was initially added but removed due to performance issues. That was early on and the plugin has changed significantly since then, so it may no longer be an issue.

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

No branches or pull requests

2 participants