Skip to content

Conversation

@theengineear
Copy link
Collaborator

@theengineear theengineear commented Dec 6, 2025

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.

Closes #341.

"/x-template.js",
"/demo",
"/test",
"/etc",
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 doesn’t exist anymore — just cleanup.

@theengineear theengineear force-pushed the improve-typescript-discovery branch from 642ad41 to 84ea994 Compare December 6, 2025 20:33
"default": "./x-element.js"
},
"./x-element.js": {
"types": "./types/x-element.d.ts",
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 is the same pattern we use in x-test for the same reason.

"/test",
"/etc",
"/ts"
"/types"
Copy link
Collaborator Author

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.

@theengineear
Copy link
Collaborator Author

theengineear commented Dec 6, 2025

@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 .d.ts files.

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.
@theengineear theengineear force-pushed the improve-typescript-discovery branch from 84ea994 to 89dd800 Compare December 7, 2025 18:59
@theengineear
Copy link
Collaborator Author

Going to get this merged in as I don’t suspect there will be any pushback surrounding the TypeScript stuff.

@theengineear theengineear merged commit 1c6b440 into main Dec 7, 2025
1 check passed
@theengineear theengineear deleted the improve-typescript-discovery branch December 7, 2025 19:02
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.

Declare type files via exports for TypeScript auto-discovery.

2 participants