js_bindings 0.1.2%2B2
SDKdartflutter
Platformweb
Complete JS bindings interop with autocomplete and documentation.
Generating the files
Requisites
- Your system must have
yarninstalled - Access to the internet as files are downloaded on the fly
There are basically two steps
- Info step: Execute
crawler/run.shto gather IDL and MDN information into JSON files - Generating step: Execute
package_js/run.shto generate the dart files from the generated JSON files
Steps detailed
Information gathering:
The main function calls 6 methods and most of them can be commented after running the first time:
cloneMDN: will download the whole MDN website compressed from MDN github and unzip locally attool/crawler/mdn.cloneIDLs: will recursively check the w3c repo for IDL files and download them attool/webIDL/.mergeIDLs: will open, read and merge the IDLs files downloaded into one attool/webIDL/merged.startMdn: willcdinto the MDN dir and start their web server throughyarn installandyarn startparseMDN: will fetch the index page of the MDN web site and then crawl all objects they expose while saving into the json attool/webIDL/mdn.jsonaddInfo: will read both themdn.jsonand the merged IDL dir and then generate the dirtool/webIDL/infowhich is basically a parsed IDL with MDN info attached in the objects
Generating the dart files
The main function basically reads the contents of the last dir generated (tool/webIDL/info) in the first step and generates all bindings into the lib/bindings folder