egoist / egoist/tsup

dts resolve types from peer/dependencies

Open
#907 0 comments 9 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
11.3k
Forks
275
PR merge metrics
No merged PRs in 30d

Description

Is there a way to resolve types from packages on peer and dependencies? Importing a chain of packages causes "The inferred type of X cannot be named without a reference to Y" https://github.com/microsoft/TypeScript/issues/47663 when using with pnpm.

For example, if I have a package named [@ttoss/cloud-roles](https://github.com/ttoss/ttoss/tree/main/packages/cloud-roles) that, after build, generates ([@ttoss/cloudformation](https://github.com/ttoss/ttoss/tree/main/packages/cloudformation) is a [dependency](https://github.com/ttoss/ttoss/blob/main/packages/cloud-roles/package.json)).

```
import { IAMRoleResource, CloudFormationTemplate } from '@ttoss/cloudformation';
export { CloudFormationTemplate, IAMRoleResource, Outputs } from '@ttoss/cloudformation';
```

When I import @ttoss/cloud-roles, I get the error:

![image](https://github.com/egoist/tsup/assets/16626980/a2629b75-1a0d-4bd3-b511-27747a3568f6)

I've tried using the experimental `--dts-resolve` flag, but it didn't work.

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.