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

[test] Verify root exports #1431

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

michaldudak
Copy link
Member

Added a test that verifies if everything with a named export is also exported from the root to prevent problems like #1428.

Copy link

netlify bot commented Feb 7, 2025

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 1111ccf
🔍 Latest deploy log https://app.netlify.com/sites/base-ui/deploys/67af271f3319490008b090d5
😎 Deploy Preview https://deploy-preview-1431--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Comment on lines +41 to +43
// Ensure the utils are also exported
expect(BaseUI.utils).not.to.equal(undefined);
});
Copy link
Contributor

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

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

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).

Copy link
Member Author

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';
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants