dethcrypto / dethcrypto/TypeChain

Generated files have mixed imports from `ethers` umbrella package and `@ethersproject` sub-packages

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

Description

The moment a project imports from the [umbrella `ethers` npm package](https://github.com/ethers-io/ethers.js), it already has (almost) all dependencies that can be individually imported via the `@ethersproject` sub-packages. E.g. my `ERC20.d.ts` file contains the following imports
```ts
import {
ethers,
EventFilter,
Signer,
BigNumber,
BigNumberish,
PopulatedTransaction,
BaseContract,
ContractTransaction,
Overrides,
CallOverrides,
} from "ethers";
import { BytesLike } from "@ethersproject/bytes";
import { Listener, Provider } from "@ethersproject/providers";
import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi";
```

Note that `bytes`, `providers` and `abi` are imported as separate npm modules, even though they're contained in `ethers`. See, e.g. the [README of `bytes`](https://github.com/ethers-io/ethers.js/tree/master/packages/bytes):
> Most users will prefer to use the umbrella package, but for those with more specific needs, individual components can be imported.

So I propose that all `@ethersproject` imports are replaced by the equivalent `ethers` imports, saving some package dependencies.

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.