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

[BUG] types are not exported #6041

Closed
borisyordanov opened this issue Jun 12, 2024 · 6 comments · Fixed by #6070 or #6105
Closed

[BUG] types are not exported #6041

borisyordanov opened this issue Jun 12, 2024 · 6 comments · Fixed by #6070 or #6105
Assignees
Labels
bug Something isn't working

Comments

@borisyordanov
Copy link

borisyordanov commented Jun 12, 2024

Describe the bug

It's not possible to import { ValidationErrors } from '@refinedev/core';

There are many unexported types, i'm using ValidationErrors as an example.

Steps To Reproduce

import { ValidationErrors } from '@refinedev/core'

Expected behavior

All types defined by @refinedev/core are exported in the library's index.

Packages

@refinedev/core@4.49.1

Additional Context

A temporary workaround
import type { ValidationErrors } from '@refinedev/core/dist/contexts/data/types';

@borisyordanov borisyordanov added the bug Something isn't working label Jun 12, 2024
@borisyordanov borisyordanov changed the title [BUG] ValidationErrors is not exported [BUG] types are not exported Jun 12, 2024
@aliemir
Copy link
Member

aliemir commented Jun 12, 2024

Hey @borisyordanov, sorry for the issue! It seems that we forgot to export this type. If you wish, you can send a PR for this. We would be happy to see your contribution. Check out our Contributing Guide to get started! 🚀

As a workaround, I think you can use HttpError type and access the errors property with something like below:

import type { HttpError } from "@refinedev/core";

type ValidationErrors = NonNullable<HttpError["errors"]>;

@aliemir
Copy link
Member

aliemir commented Jun 12, 2024

To make the issue clear for everyone willing to contribute, can you give us a list of types that are missing from the exports? 🙏

@borisyordanov
Copy link
Author

@aliemir I can make a list, but don't think it'd be practical in the long term to keep the list up-to-date. My advice is to export everything by default. This is what other popular libraries are doing.

If this is OK with you I'll submit my PR for review

@borisyordanov borisyordanov mentioned this issue Jun 12, 2024
5 tasks
@aliemir
Copy link
Member

aliemir commented Jun 12, 2024

@borisyordanov, especially in @refinedev/core we have many internal stuff which we don't want to expose to users to avoid confusion. We're planning using subpath exports and tidy-up our exports, then we can use asterisk re-exports at index.ts safely. For now, we're not planning to use * re-exports 🙏

@FatimaSaleem21
Copy link
Contributor

Hi @aliemir, I'd like to fix this and add any other types that are missing from the exports too.

@BatuhanW
Copy link
Member

Hey @FatimaSaleem21 assigning issue to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
4 participants