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

Javascript: Fixing type declaration on export in package.json #53

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

alexdametto
Copy link
Contributor

@alexdametto alexdametto commented Jul 8, 2024

Summary of the changes / Why this is an improvement

I got this error while integrating this library in crate-gc-admin:

Could not find a declaration file for module '@cratedb/cratedb-sqlparse'.
'crate-gc-admin/node_modules/@cratedb/cratedb-sqlparse/dist/sqlparse.js' implicitly has an 'any' type.
There are types at 'crate-gc-admin/node_modules/@cratedb/cratedb-sqlparse/dist/index.d.ts', 
but this result could not be resolved when respecting package.json "exports". 
The '@cratedb/cratedb-sqlparse' library may need to update its package.json or typings.

Basically, for react with typescript projects, the export in the package.json is "explicit", so even if types are declared here, it is necessary to declare them a second time inside the export. I have also noticed that this has been done also for crate-gc-admin.

Checklist

@alexdametto alexdametto requested a review from surister July 8, 2024 12:49
@alexdametto alexdametto marked this pull request as ready for review July 8, 2024 12:53
@surister
Copy link
Collaborator

surister commented Jul 8, 2024

Thanks a stack, I only tested it with Vue3.

@surister surister merged commit d0212a4 into main Jul 8, 2024
8 checks passed
@surister surister deleted the ad/fix-typings branch July 8, 2024 13:04
@surister
Copy link
Collaborator

surister commented Jul 8, 2024

Will publish to npm asap

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.

2 participants