Skip to content

feat: actual working declaration files#380

Open
earthernsence wants to merge 2 commits into
antimatter-dimensions:masterfrom
earthernsence:earth/new-declaration-files
Open

feat: actual working declaration files#380
earthernsence wants to merge 2 commits into
antimatter-dimensions:masterfrom
earthernsence:earth/new-declaration-files

Conversation

@earthernsence

@earthernsence earthernsence commented May 25, 2026

Copy link
Copy Markdown
Member

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:

  • I wanted to give this another shot because I think it's high time we got these. I know it's been three and a half years since this library got an update, but I'm really trying to use these and want to get them made.
  • Updates bili.config.*.ts to tell Bili to use our tsconfig.json declaration directory, which is...
  • part of a series of edits made to tsconfig.json that 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 had
  • This does update rollup to a newer version to let us do all of this, by the way
  • and a few changes to package.json to point to where our types are, as well as where to tell TS to look for our built notation files

PLEASE -- 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 of package.json: if anybody had previously been doing weird import magic like import ... 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 tsc call -- 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.

see PR description for full details
main thing here is adding the note for how to import community notations when using `npm`
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