spotify / confidence-sdk-js

Other
9 stars 1 forks source link

Faulty bundled d.ts file generated from API Explorer #160

Open andreas-karlsson opened 5 months ago

andreas-karlsson commented 5 months ago

tsc includes a export {} statement in namespaces in built d.ts files. When api-extractor bundles these files it translates the export statement to simply {}; which is invalid and gives the error TS1036: Statements are not allowed in ambient contexts. when consumers are using the library whith skipLibCheck:false.

Expected Behavior

Our build process should generate valid d.ts files.

Possible Solution

The real solution is to get this fixed in api-extractor, in the meantime though, we could hack around it by adding a process to remove the faulty statements. It's doable as a simple text transform. In any case we should add a step to verify that our bundled d.ts files are valid.