grant / ts2gas

A function that transpiles TypeScript to Google Apps Script.
http://npmjs.com/ts2gas
MIT License
88 stars 11 forks source link

TS transformers #11

Closed PopGoesTheWza closed 5 years ago

PopGoesTheWza commented 5 years ago

I rewrote the various touch-ups using TypeScript transformers 'before' and 'after'. Since it now works from the complier AST, it should provide better/safer handling then raw string/regex (i.e. multiline statements, multiple statements on a single line)

One issue with current implementation: comment "attached" to removed statement are also removed. It in not yet clear how it can be worked around.

grant commented 5 years ago

Thanks! Looks good from a high level. Close #5 if this PR fixes that. Let me know if you want me to publish.

PopGoesTheWza commented 5 years ago

I added first line comment with the gas and ts version. You may remove it if you prefer

grant commented 5 years ago

That's fine. Maybe update the README to show an example of what the function actually outputs now?

PopGoesTheWza commented 5 years ago

Publishing ts2gas might require clasp to also be updated/bump in order to benefit from latest TS version

PopGoesTheWza commented 5 years ago

working on the transformers was interesting. Too bad documentation is lacking

grant commented 5 years ago

Published with ts2gas@1.5.