-
Notifications
You must be signed in to change notification settings - Fork 299
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
chore: output declaration files for neuroglancer packages #576
Conversation
Add --declaration flag to build-package.ts to optionally output typescript declaration files Enable flag for npm prepare script
build_tools/build-package.ts
Outdated
outbase: srcDir, | ||
bundle: false, | ||
outdir: libDir, | ||
}); | ||
|
||
if (declaration) { | ||
buildDeclarationFiles(entryPoints, { | ||
allowJs: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to remove these superfluous arguments
7570bfc
to
6724087
Compare
I improved the quality of the declarations by using the tsconfig file. The bulk of the change comes from It does lose a little bit of type information for some reason but it adds a lot more than it removes
|
Thanks --- we could probably just emit the declarations all the time --- I don't think there is a time when we don't want the declarations. |
Having the type aliases resolved in some cases is fine, I think, and I agree that some annotations are better than none. When I tried to generate declarations previously I ran into some errors due to some exported things having types depending on non-exported types, I think. But I guess it works now for some reason. |
Removed the flag making it optional. Added that in case the performance benefit of leaving it off was useful. I agree imperfect types are far better than none. I was fortunate that this solution https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#getting-the-dts-from-a-javascript-file was very easy to drop in, and worked |
I just realized Checking to make sure that isn't a problem. |
79741775 seems to be the smallest high that causes this test to fail with base 29. It is also the first high value that causes low to be less than trueBase, as a result of highRemainder being very small. |
esbuild does not support generating declaration files evanw/esbuild#95