cljsjs

porglezomp 2016-08-09T16:57:28.000313Z

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.

2016-08-09T19:59:28.000315Z

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... etc

2016-08-09T20:01:44.000319Z

Not 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.

2016-08-09T20:04:21.000320Z

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.

2016-08-09T20:09:52.000321Z

react-google-maps seems to be a relevant example here.

2016-08-09T20:11:13.000322Z

(^ @porglezomp )

2016-08-09T20:15:07.000323Z

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