-
-
Notifications
You must be signed in to change notification settings - Fork 914
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
[BUG] Many duplicated type files #824
Comments
Other than increasing the package size (by ~400K), can you elaborate on what adverse impacts this has? I'm open to ways to dedupe the type files but the current setup is simple and obvious, which tends to pay dividends when it comes to maintainability. Regarding If you'd like to put up a PR that shows how you'd solve this issue, I'd be curious to see what you have in mind. |
Noting for posterity that there are a couple [very small] differences between the node vs browser types: $ diff -r esm esm-browser
Only in esm: bin
diff -r esm/md5.d.ts esm-browser/md5.d.ts
1c1
< declare function md5(bytes: Uint8Array): Buffer;
---
> declare function md5(bytes: Uint8Array): Uint8Array;
diff -r esm/native.d.ts esm-browser/native.d.ts
1d0
< import { randomUUID } from 'crypto';
3c2
< randomUUID: typeof randomUUID;
---
> randomUUID: false | (() => `${string}-${string}-${string}-${string}-${string}`);
diff -r esm/sha1.d.ts esm-browser/sha1.d.ts
1c1
< declare function sha1(bytes: Uint8Array): Buffer;
---
> declare function sha1(bytes: Uint8Array): Uint8Array; |
Closing because ...
While I'm not at all confident we'd be able to get this working without a lot of trial-and-error that basically uses this project's users as guinea pigs. |
Before you begin...
Description of the problem
After switching to building with tsc (#763), the resulting bundles contain many duplicate type files for each bundle type (CJS, ESM, etc.).
This can be resolved by generating types only once, instead of doing it for each bundle separately.
This can be achieved by building with tsup (https://github.com/egoist/tsup).
Recipe for reproducing
No response
Additional information
No response
Environment
No response
The text was updated successfully, but these errors were encountered: