Skip to content
This repository has been archived by the owner on Mar 26, 2018. It is now read-only.

Typescript support for generator-angular #313

Closed
wants to merge 1 commit into from

Commits on Aug 11, 2013

  1. Typescript support for generator-angular

    * generate parts of Gruntfile.js, gitignore based on selected language
    * set language in package.json for subgenerators to reference
      (for subsequent runs of the subgenerators)
    * passing user choices to subgenerators (for the initial run
      of the subgenerators hooked from the main generator)
    * reformatting of lodash conditionals that reads clearer yet still
      preserves whitespace
    * overrideable configs templates (for things like backend URLs)
    * template partials preloaded for dist
    * controller and service generators
    
    FUTURE WORK
    * filter and directive generators
    * ask user for top level module name
    * revving of templates.js (with hopefully an elegant solution to the
      two pass problem)
    
    NOTES
    
    I could not find the intended way to pass user choices down to the
    subgenerators that are hooked from the main generator. The pattern for
    processing user choices seems to be setting the values on the generator
    object itself, which are then made available in the template using,
    presumably, a with block. To follow this pattern for subgenerators, I
    needed a struct with user choices to be available in the constructor of
    the subgenerator. Using the options-options during hook registration,
    with a by-reference object in it that later gets populated with user
    data, was the only way I could manage it.
    
    It is conceivable that using this.env.options is the idiomatic way, and
    it has one benefit of not differentiating where the choice comes from,
    question-answer session with the user, or cli arguments. The problem
    with it, though, is that it completely obscures data flow through the
    program, and makes it impossible to trace where values are coming from.
    I am a strong proponent of explicit data flow.
    
    Also reformatted _bower.json so that the conditional expression appears
    on the same line as what is being conditionaly included, while still
    preserving the white space properties (i.e. no empty newlines are added
    for false conditions).
    anchann committed Aug 11, 2013
    Configuration menu
    Copy the full SHA
    72635a2 View commit details
    Browse the repository at this point in the history