Skip to content

Commit

Permalink
Merge #892
Browse files Browse the repository at this point in the history
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 #891 (comment)


Co-authored-by: Philippe Schommers <philippe@schommers.be>
  • Loading branch information
status-bors-ng[bot] and filoozom committed Aug 19, 2022
2 parents 25869b8 + 5137f28 commit d7181da
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit d7181da

Please sign in to comment.