0.2.0 • Published 10 years ago
harmonika v0.2.0
Harmonika

Harmonika parse your Closure code to ES6. Extended from existing project xto6, with additional on-going features to support Closure.
Install
$ npm install harmonikaRun Example
$ harmonika -s input_files/ins/sample0.jsDeveloping
Clone from github
$ npm install
$ grunt
$ node bin/index.js --helpDirectory Structure
* bin /
| - index.js (main entry)
* input_files /(sample)
* src /
| - syntax /
| - AST representation (reference Mozilla Parser AST)
| - transformation / (list of parser function)
| - utils / (string->ast && ast -> string library)
* test /Previous project existing features
- Function/Prototypes to Classes
- Callback to Arrow functions
- String concatenation to Template Strings
- Using
letandconstinstead ofvar - Default arguments instead of
a = a || 2 - Function properties in objects to Object methods
Added features
- Remove Namespace
- Convert Google Closure code (
goog.require,goog.provide,goog.inherits,goog.isDefinedAndNotNull) to compatible ES6 features - Convert Closure annotation to Flow type (Currently support :
@param,@type,@typedef,@return) and Import/Export type - Detect Inheritance (
supercall,extend) - Improve constructor to support arguments
importsupportexportsupport- Implicit import (import all undefined identifier)
staticmethodstaticproperties- Base class method call using
super - Improve let/const to understand object assignment
Singleton export