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

Fix published types #284

Merged
merged 2 commits into from
Mar 31, 2023
Merged

Fix published types #284

merged 2 commits into from
Mar 31, 2023

Conversation

jasonk
Copy link
Contributor

@jasonk jasonk commented Mar 31, 2023

When using this package with TypeScript most of the more critical types don't work (I especially noticed this with the types related to callback arguments).

This is because most of the types are in a types.d.ts file in the root of the repo, but TypeScript is configured with "baseUrl": ".", so what ends up in the dist directory has the same structure as the repo.

This means that in the the published package you end up with the main Proxy class in dist/lib/proxy.js, and it's types in dist/lib/proxy.d.ts, but those types are attempting to import from ../types, which doesn't exist because that types.d.ts is not listed in the include list in tsconfig.json (and it wouldn't be included in the build anyway, since it's an ambient declaration file).

All this PR does is to relocate that types file into the lib directory and change it from an ambient declaration to a regular .ts file so that it will get included in the build and make the types usable from the published package.

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.

2 participants