-
-
Notifications
You must be signed in to change notification settings - Fork 91
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
[test] Verify root exports #1431
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
// Ensure the utils are also exported | ||
expect(BaseUI.utils).not.to.equal(undefined); | ||
}); |
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.
In our releases/npm package I see all the utils are published. Should any utils even be exported to the consumer? I thought they were intended for private/internal usage
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.
We need a subset of utils published as they are required to build applications: useForkRef
, useId
, maybe useControlled
.
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.
Maybe we can have a list of utils we expect to be exported here and fail if there are more or less exported, that way when we add a new util, we will need to make decision of whether it should be public as the test would automatically fail.
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.
It might be easier to manage if we had internal utils in a separate directory. This way we'll be able to treat all contents of ./utils as public (which will make us more careful about introducing breaking changes).
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.
Anyway, this is outside the scope of this PR. We can discuss it separately.
@@ -26,3 +26,4 @@ export * from './tabs'; | |||
export * from './toggle'; | |||
export * from './toggle-group'; | |||
export * from './tooltip'; | |||
export * as utils from './utils'; |
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.
Why did we export all utils? Was it intentional?
Added a test that verifies if everything with a named export is also exported from the root to prevent problems like #1428.