generator-angular
generator-angular copied to clipboard
Use AST for splicing generated code in.
I was looking into how to add support for the 3rd party ui-router
lib... so I started reading the code. It seems we are using regular expressions and doing things on the cheap side. E.g. in utils.rewrite
, if the needle
isn't found, then the code is spliced at the beginning of the file, rather than adding the necessary constructs.
If I am adding a route, then if the .config
section is missing, it should create one, maybe add a default route, and splice the new route in. This may be flaky with regexes, and maybe using AST (esprima?) would help in that situation.
it would but how should we deal with {coffee/type}script support?