I’m trying to package someone else’s library, but it seems like their export structure is bad. How can I apply some namespacing to https://github.com/andrewrk/node-tmx-parser/blob/master/index.js? I’m new to writing externs, and the structure of this is somewhat different from all the examples.
https://github.com/cljsjs/packages/pull/683/files - maybe what I did recently would be helpful to you: I had to write a custom webpack config file - the
libraryTarget: "var",
library: "ReactDateRange"
namespace the exports in https://github.com/Adphorus/react-date-range/blob/master/lib/index.js
to be ReactDateRange.DateRange... etcNot sure if that'll directly translate, but I know webpack by default pulled in all the requires necessary to make it work and built a file that exported those vars.
Oh, though for this project it looks like you'll definitely need to build with browserify, so my thing is probably not a good example at all.
react-google-maps seems to be a relevant example here.
(^ @porglezomp )
Looks like that one used: http://jmmk.github.io/javascript-externs-generator, and used the browserify "-s ReactGoogleMaps" flag to set up the library on a global var ReactGoogleMaps so that the extern generator could find it