JiLiZART / BBob

⚡️Blazing fast js bbcode parser, that transforms and parses bbcode to AST and transform it to HTML, React, Vue with plugin support in pure javascript, no dependencies
https://codepen.io/JiLiZART/full/vzMvpd
MIT License
166 stars 19 forks source link

Invalid path to TypeScript types in package.json (4.0.1) #237

Closed SimpleCreations closed 4 months ago

SimpleCreations commented 5 months ago

It seems that TypeScript types added in the recent release are not exported correctly. This line

https://github.com/JiLiZART/BBob/blob/9d3859b31e881b26e190867e10316692a98de360/packages/bbob-core/package.json#L35

references types directory, but no such directory is present in the npm distribution, so TypeScript cannot find any types. Changing this line to

 "types": "./src/index.ts", 

fixes the issue — the TS compiler sees the library types.

JiLiZART commented 4 months ago

Thanks for reportig! I will check, maybe some bug in npm publishing process

rda-wimi commented 4 months ago

Hello @JiLiZART and @SimpleCreations. I have the same issue. Seems to me that it's linked to the "files" property of the sub-packages "package.json" file.

I was able to get the correct typings in my project by adding "types" to the "files" array in bbob-core package.json. I used npm pack to test it locally and I have the "types" folder in my generated archive after the change (it was missing before).

If it's ok for you I can submit a PR for that.

JiLiZART commented 4 months ago

Fixed in 4.0.2