dethcrypto / dethcrypto/TypeChain

CLI Doesn't work with vite-dts, export syntax too new

Open
#900 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2.8k
Forks
376
PR merge metrics
No merged PRs in 30d

Description

The rolled up exports uses `export * as ____` syntax and there's no way to turn it off. My type compiler `vite:dts` cannot understand the `index.ts` file that is produced because of this.

See: https://github.com/dethcrypto/TypeChain?tab=readme-ov-file#cli

```
error during build:
Error: [vite:dts] The "export * as ___" syntax is not supported yet; as a workaround, use "import * as ___" with a separate "export { ___ }" declaration
/Users/johnshankman/Documents/manifoldxyz/burn-redeem-contracts/dist/contracts/ethers/index.d.ts:10:8
```

There's no way to control how this is generated using the typechain command
![Screenshot 2024-04-18 at 12 29 35 PM](https://github.com/dethcrypto/TypeChain/assets/6632701/1a149821-950d-421b-b707-5da1f79c65f4)
![Screenshot 2024-04-18 at 12 33 47 PM](https://github.com/dethcrypto/TypeChain/assets/6632701/dfb99d7a-5091-4903-9785-b391ce3d117f)

## Solution

Use older `import * as ` syntax with `export` at the end of the file. That way there's 0 chance of ever having compatibility issues with outside packages like vite-dts etc. No need to use new school syntax on such a simple file being autogenerated.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.