vgteam / sequenceTubeMap

displays multiple genomic sequences in the form of a tube map
MIT License
180 stars 25 forks source link

Support colons in contigs and polyglot-ify to allow shared client-server imports #290

Closed adamnovak closed 1 year ago

adamnovak commented 1 year ago

This uses cheating and hackery to allow files with the extension ".mjs" to be importable by both the client and the server code. As long as they are written using import, but never try to touch import.meta or import assertions or require or the other CommonJS things like __dirname, they will be acceptable both to Node on the server side and to Babel on the client side and to Jest during the tests.

I am using this to centralize the parsing/unparsing of region strings, so we can be using the same code throughout and thus not get into trouble with colons in the contig being supported in some places but not in others.

This will fix #284.