Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Types incorrectly marked as @internal #352

Merged
merged 2 commits into from
Feb 20, 2025
Merged

Conversation

corymhall
Copy link
Contributor

Types only need to be marked as @internal if they would be exported
from the top level index.ts file, but you don't want them to. Marking
something as @internal means they are stripped from the compiled type
files and this causes type errors because some files will try to
reference types that do not exist anymore.

Example error when running tsc in a project where @pulumi/cdk is
installed.

node_modules/@pulumi/cdk/lib/converters/app-converter.d.ts:6:10 - error TS2305: Module '"../interop"' has no exported member 'CdkConstruct'.

6 import { CdkConstruct } from '../interop';
           ~~~~~~~~~~~~

I've unmarked things as @internal that are not exported and moved some
things to a new interna/interop.ts file that were in an exported file.
Now that they are not in an exported file we don't have to mark them as
@internal

Types only need to be marked as `@internal` if they would be exported
from the top level `index.ts` file, but you don't want them to. Marking
something as `@internal` means they are stripped from the compiled type
files and this causes type errors because some files will try to
reference types that do not exist anymore.

Example error when running `tsc` in a project where `@pulumi/cdk` is
installed.

```
node_modules/@pulumi/cdk/lib/converters/app-converter.d.ts:6:10 - error TS2305: Module '"../interop"' has no exported member 'CdkConstruct'.

6 import { CdkConstruct } from '../interop';
           ~~~~~~~~~~~~
```

I've unmarked things as `@internal` that are not exported and moved some
things to a new `interna/interop.ts` file that were in an exported file.
Now that they are not in an exported file we don't have to mark them as
`@internal`
@corymhall corymhall requested review from flostadler, t0yv0 and a team February 20, 2025 13:45
@t0yv0
Copy link
Member

t0yv0 commented Feb 20, 2025

Sounds like we misunderstood @internal due to our TypeScript skill issues, thanks!

@corymhall corymhall merged commit ff43bfc into main Feb 20, 2025
13 checks passed
@corymhall corymhall deleted the corymhall/export-types branch February 20, 2025 20:09
@pulumi-bot
Copy link
Contributor

This PR has been shipped in release v1.8.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants