cuthbertLab / music21j

Javascript port of music21 -- Toolkit for Computational Musicology
Other
144 stars 41 forks source link

Fix package entry point and publish type declarations #114

Closed jacobtylerwalls closed 3 years ago

jacobtylerwalls commented 3 years ago

Thanks for your patience @mttbernardini, I've added you as a co-author here so that you're credited as a repo contributor.

Fixes #58 (I'll open an issue for the second issue you mentioned)

We were waiting to fix the entry point issue until we verified we could still consume music21j's declared types in other projects when using this slimmer import of import * as music21 from "music21j";, which is FANTASTIC. To that end, I had to adjust the entry-point based on some changes in #93 (main.js instead of debug.js)


@mscuthbert this is intended to supersede both #60 and the refactor_for_load branch. Whatever existing procedure you have to copy files from build to releases at release-time should pick up the type declarations.

jacobtylerwalls commented 3 years ago

There's also an infelicity that the typing declarations are duplicated under build/src in addition to build/, which I believe is because of the test suite transpilation. I experimented with using two different tsconfig.json files, one in src/ and one in tests/, but I didn't get very far.

mscuthbert commented 3 years ago

Very important PR. Thanks @jacobtylerwalls !