feat: actual working declaration files#380
Open
earthernsence wants to merge 2 commits into
Open
Conversation
see PR description for full details
main thing here is adding the note for how to import community notations when using `npm`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'll be closing PR #379 once I open this, and this PR would still be replacing PR #204. This closes issue #150.
okay, here's the quick gist:
bili.config.*.tsto tell Bili to use ourtsconfig.jsondeclaration directory, which is...tsconfig.jsonthat includes the enabling of emitting declaration files for both base and community notations -- this has a number of weird tsconfig things that I happened upon when trying to fix some issues I hadpackage.jsonto point to where our types are, as well as where to tell TS to look for our built notation filesPLEASE -- let the record show -- I have tested these changes in the ADAnswersBot codebase and it has worked completely, for both base and community notations. The only thing that might be worrisome as far as breaking changes go is the
"exports"part ofpackage.json: if anybody had previously been doing weird import magic likeimport ... from "@antimatter-dimensions/notations/dist/...", the change would break a couple things for them. BUT -- if they are using the library CORRECTLY -- this should not be an issue for anybody (& might encourage whoever is using it wrong to wisen up). I also tested the docs to make sure they still work, but there's really no reason they shouldn't since I didn't change anything related to the notations themselves.This change maintains our previous build workflow -- doesn't even introduce a
tsccall -- and would be a major help for anybody trying to use these things in TypeScript (which very well could just be me). I really don't want to have to publish a package myself to be able to get ADAB to work properly, but if it comes to that I suppose I'd do it.Other thing to mention -- when TS7 comes out,
"target": "es5"and"moduleResolution": "node"will stop working -- they are deprecated. But this shouldn't really be an issue since I don't see there being updates to this library once TS7 is out.