• Robert Knight's avatar
    Add a utility script to assist with CoffeeScript -> JS conversion · c0a2709b
    Robert Knight authored
    It accepts a list of CoffeeScript file paths on stdin
    and for each <path>.coffee file in the input, it writes
    a <path>.js output file containing the converted,
    reformatted source.
    
    The result is ES2015 source so will require some
    fixups as long as we're using ES5 in the main app
    codebase.
    
    The current transformation process involves:
    
     1. Performing an initial CoffeeScript -> JS
        conversion with 'decaffeinate'
    
     2. Applying some fixups for common issues, currently
        done with dumb string modifications.
    
        In future I might look at writing a Babel transformer.
    
     3. Parsing the source with Babylon to check that it is valid ES2015
        If not, the user is prompted to go and simplify the CoffeeScript
        so that decaffeinate can process it correctly.
    
     4. Reformatting the source with typescript-formatter, which
        takes care of indentation and high-level formatting.
    
     5. Running the source through JSCS' fix mode which deals
        with smaller details.
    c0a2709b
Analyzing file…
package.json 392 Bytes