cljsjs / boot-cljsjs

Helper tasks to aid the packaging of JS dependencies for Clojurescript projects
66 stars 22 forks source link

Provide Extern generation task #38

Open Deraen opened 8 years ago

Deraen commented 8 years ago

npm package externs-generator provides a way to build extern file programmatically. Probably won't work for all libs, but should be useful.

It is possible to create a task which builds a temp dir with source files (library file and dependencies) and then shell out to npm. npm is already available at the CI and we can install the externs-generator globally.

(extern :files ["cljsjs/pouchdb/development/poucbdb.inc.js"
                ;; dependencies
                "cljsjs/jquery/development/jquery.inc.js"]
        :object "PouchDB"
        :output "cljsjs/pouchcb/common/pouchdb.ext.js")

Assigning to myself to keep track of this for my TODO list, but if someone want's to implement this, feel free.