crate / cratedb-sqlparse

Parsing utilities to validate and split SQL statements for CrateDB.
Apache License 2.0
5 stars 1 forks source link

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

Closed alexdametto closed 2 months ago

alexdametto commented 2 months ago

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

surister commented 2 months ago

Thanks a stack, I only tested it with Vue3.

surister commented 2 months ago

Will publish to npm asap