hyperweb-io / hyperweb-io/cosmos-kit

Non-index sources does not have proper typings (e.g. `@cosmos-kit/react/main/...`)

Open
#107 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
201
Forks
159
PR merge metrics
No merged PRs in 30d

Description

Seems that most cosmos-kit published packages is using the convention to split CommonJS and ESM sources to separate directories (https://unpkg.com/browse/@cosmos-kit/react@0.26.0/). This results in poor source typings since the path for those typings are in a different directory.

Example edge case related to #106, while `import { SimpleConnectModal } from "@cosmos-kit/react/main/modal/components"` does exist, TypeScript does not detect types because `@cosmos-kit/react/main/modal/components` types are on a different directory at `@cosmos-kit/react/types/modal/components`. The hacky solution is to override module declaration like below:

image

Proposed solution for this issue is to use `.mjs` extension for ESM sources and merge into single directory, similar to what graz does: https://unpkg.com/browse/graz@0.0.30/dist/

![image](https://user-images.githubusercontent.com/8220954/205194894-19ac294b-5a57-469a-b1f1-bfb6bb88b31f.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.