Skip to content

Generate .d.ts (declaration files) instead of using regular .ts files#104

Open
tahminator wants to merge 2 commits intodigitalocean:mainfrom
tahminator:main
Open

Generate .d.ts (declaration files) instead of using regular .ts files#104
tahminator wants to merge 2 commits intodigitalocean:mainfrom
tahminator:main

Conversation

@tahminator
Copy link

@tahminator tahminator commented Jan 20, 2026

Hello!

This PR updates the SDK to output .d.ts files in place of .ts as is usually the norm for TypeScript library files.

I made this PR because in my current project, I'm working on migrating our Bash scripts to Bun shell (& TS SDKs) and part of that includes moving our DigitalOcean infrastructure definitions to dots

However, I'm currently running into an issue where the .ts files are explicitly being checked by tsc even when being included in the exclude array. From my research online, it seems like the fix is to use skipLibCheck but that only works if your libraries are using declaration files instead of traditional TS source files.

I manually ran a test where I generated .d.ts files from dots instead (and trash'd all the .ts files) and it did seem to work:

Before:
image

After:
image

I excluded .ts source files from ending up in the final package by adding a .npmignore file into the root dir, which should be enough

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.

1 participant