-
Notifications
You must be signed in to change notification settings - Fork 17
Improve TypeScript discovery on import. #342
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
Conversation
| "/x-template.js", | ||
| "/demo", | ||
| "/test", | ||
| "/etc", |
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.
This doesn’t exist anymore — just cleanup.
642ad41 to
84ea994
Compare
| "default": "./x-element.js" | ||
| }, | ||
| "./x-element.js": { | ||
| "types": "./types/x-element.d.ts", |
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.
This is the same pattern we use in x-test for the same reason.
| "/test", | ||
| "/etc", | ||
| "/ts" | ||
| "/types" |
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.
Renames this to /types — I believe it’s a more commonly-followed convention.
|
@klebba — Any opinions on this? Just trying to improve some “best practices” stuff to improve things for integrators. For context, I did this recently for x-test because I was integrating it within a TypeScript application to allow for better static test feedback when developing with AI. It was a nice (and easy) win to simply include the “types” pointer to hint TypeScript (and other tooling) to our |
Changes: - Adds “types” field to each import for improved type discovery. - Removes vestigial package contents from “files”. - Adds “.” (default) so `import '@netflix/x-element';` works. - Renames “/ts” >> “/types” (better-follows community conventions). Closes #341.
84ea994 to
89dd800
Compare
|
Going to get this merged in as I don’t suspect there will be any pushback surrounding the TypeScript stuff. |
Changes:
import '@netflix/x-element';works.Closes #341.