mirror of https://github.com/waku-org/js-waku.git
Merge #892
892: fix: type export via `typesVersions` r=fryorcraken a=filoozom ## Problem Importing anything from TypeScript in `js-waku/lib/` (`v0.25.0-rc.0`) does not work. It can't find the types despite the `exports.*.types` in `package.json`. ## Solution This solution was inspired by `libp2p` ([example in ``@libp2p/interfaces`](https://github.com/libp2p/js-libp2p-interfaces/blob/master/packages/interfaces/package.json#L24-L39)),` and just adds `typesVersions` to `package.json`. Documentation: https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html#folder-redirects-using- ## Notes - See https://github.com/status-im/js-waku/issues/891#issuecomment-1217388556 Co-authored-by: Philippe Schommers <philippe@schommers.be>
This commit is contained in:
commit
d7181da98b
|
@ -22,6 +22,13 @@
|
|||
"import": "./dist/lib/peer_discovery_static_list.js"
|
||||
}
|
||||
},
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
"lib/*": [
|
||||
"dist/lib/*"
|
||||
]
|
||||
}
|
||||
},
|
||||
"type": "module",
|
||||
"repository": "https://github.com/status-im/js-waku",
|
||||
"license": "MIT OR Apache-2.0",
|
||||
|
|
Loading…
Reference in New Issue