Skip to content

Bring Typescript branch up to date #1

Open
wants to merge 100 commits into from
@ghost
ghost commented Nov 16, 2013

This is a very rough first cut at bringing the Typescript branch up to date with upstream generator-angular.

It doesn't work: a definition for "typescript" is missing at template time, probably due to a naïve merge of app/index.js, particularly with respect to Generator.prototype overrides. Add to that that I'm a JavaScript neophyte, to say nothing of Yeoman, Grunt, and Bower, and you have a recipe for disaster. :-)

However, I want to learn Typescript and AngularJS, so this seems like the best approach: trying to contribute. So sorry it's broken right now, but I'm hoping, with a little help, we can get it across the finish line.

Thanks!

eddiemonge and others added some commits Aug 7, 2013
@eddiemonge eddiemonge fix(docs): add contributing info to contributing file 2461aad
@anchann 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).
72635a2
@passy passy fix(templates): removed grunt-karma from deps
It's installed by generator-karma
19a796f
@passy passy feat(build): show elapsed time for grunt tasks cacdd0f
@btford btford Merge pull request #307 from eddiemonge/patch-1
fix(docs): add contributing info to contributing file
fef13c5
@pborrazas pborrazas fix(cli): fix typo in angular:view generator usage d62c2e3
@kevva kevva Merge pull request #315 from pborrazas/patch-1
fix(cli): Fix typo in angular:view generator usage
2d915d6
@sindresorhus sindresorhus feat(build): switch to use load-grunt-tasks 4e030c7
@kevva kevva chore(deps): Update dependencies bf17e34
@passy passy feat(build): add autoprefixer support
Add support for SASS and vanilla CSS to get automatic vendor prefixes base on
the browsers selected in the Gruntfile.

Closes #317
c4dfd61
@passy passy feat(build): generate karma 0.10 config
Upgraded to generator-karma 0.5.
e1cb206
@claydiffrient claydiffrient feat(gen): Change ga.js to analytics.js
Updates the script to the new Google recommended script.
17ae9e6
@manojlds manojlds fix(app) remove chromeframe
Chrome frame is being retired
http://blog.chromium.org/2013/06/retiring-chrome-frame.html

Remove message to use Chrome Frame
Remove appropriate metadata from index.html and .htaccess
6e4c49d
@addyosmani addyosmani Merge pull request #322 from manojlds/chromeframeremoval
fix(app) remove chromeframe
c5625ef
@passy passy chore(gen): revert modular project structure
Reverted until more fleshed out.

Revert "feat(gen): generate a more modular project stucture"

This reverts commit 84d2e4e8e60d297d60882fa84b6542c7279b5a39.

Conflicts:
	view/index.js
17a31ef
@passy passy chore(test): fix tests after module revert ebaba2c
@passy passy v0.4.0 1a176e1
@passy passy fix(views): correct path for sub views
There was a residue from the modularization that caused views with slashes to
appear in the wrong directory.

Fixes #359
0568e74
@passy passy fix(build): update to grunt-contrib-connect 0.4.0 368ad7f
@passy passy fix(build): update to grunt-contrib-connect 0.5.0
This allows the removal of grunt-open and inlining of the livereload port.
67c0ebf
@passy passy fix(build): remove references to global yeomanConfig a0f16e2
@passy passy fix(app): conditional include of jquery
Fixes #362
bc1e68e
@eddiemonge eddiemonge fix(test): update tests to match service files
Change service name in test to use classify instead of camelize

Closes #338
Closes #354
c30464c
@eddiemonge eddiemonge fix(app): allow normal javascript to be created
Allow --coffee=false to generate JavaScript files

Fixes #329
Fixes #316
c8190b5
@rahim rahim fix(templates): value generator should use value template 67d0c5a
@passy passy Merge pull request #370 from rahim/master
fix(templates): value generator should use value template
c76c702
@eddiemonge eddiemonge fix(app): include bootstrap images for css/scss
Include the bootstrap images any time the bootstrap image is selected at
the prompt

Fixes #196
e88dba4
@eddiemonge eddiemonge fix(app): serve files from correct place
Connect middleware accepts a function. Base accepts an array of files
fe2bad0
@passy passy style(generators): unify export syntax 9254cfb
@passy passy chore(build): update gruntfile to use load-grunt-tasks c514aeb
@eddiemonge eddiemonge fix(generator): add app modules dependency to app
Add AngularJS app dependencies to the list based on prompt answers

Fixes #230
a45b71c
@dhageman dhageman fix(templates): correct coffee provider template
Close #374
86aefe5
@passy passy Merge pull request #373 from eddiemonge/patch-test
fix(app): serve files from correct place
1da2800
@passy passy Merge pull request #371 from eddiemonge/issue_196
fix(app): include bootstrap images for css/scss
e525007
@passy passy docs(readme): add missing anchors
Fixes #336
0dbe896
@paulsheldrake paulsheldrake Issue #375 Port collision
Update the template file to have the test port be different from the server port so you can run tests with the server running
f2a455c
@passy passy Merge pull request #387 from paulsheldrake/master
fix(grunt): sets port for test server
944d731
@pensierinmusica pensierinmusica fix(docs): fixed typo in readme a967907
@nwinkler nwinkler refactor(app): Simplify subgenerator code
Add a common function in the base script to simplify the common tasks
for many of the generators (services, filter, directive, controller).
Also remove some unused modules from the sub-generators (path and angularUtils).
118b352
@kevva kevva Merge pull request #380 from nwinkler/simplify_generators
refactor(app): Simplify subgenerator code
f51f178
@jjt jjt fix(templates): take out semicolons in coffeescript e38124e
@passy passy Merge pull request #391 from jjt/master
fix(templates): take out semicolons in coffeescript
750a583
@passy passy Merge pull request #367 from eddiemonge/issue_329
fix(app): allow normal javascript to be created
fee0358
@passy passy chore(deps): bump development dependencies adfeaee
@passy passy fix(templates): Gruntfile indentation 6f7d17e
@passy passy v0.5.0 b9eb501
@passy passy fix(app): test setup in default configuration
Since modules selected during the scaffolding process are now automatically
added to app dependencies, test would fail because karma didn't have an option
to load additional modules. With generator-karma 0.6 I added an option to load
additional bower components which this generator now makes use of when calling
`hookFor`.
2bebccb
@eddiemonge eddiemonge fix(docs): Add coffeescript=false to readme
The README now shows the --coffee=false option
abd7dc3
@passy passy v0.5.1 bb2fe60
@eddiemonge eddiemonge feat(gen): add option to not add to index
Allow skipping of adding script to index file with default being to add
486ee14
@eddiemonge eddiemonge refactor(route): dry up and refactor code
DRY up the code a bit and remove a trailing CS comma
698bfa0
@passy passy Merge pull request #401 from eddiemonge/patch-1
fix(docs): Add coffeescript=false to readme
fde8652
@passy passy Merge pull request #406 from eddiemonge/patch-2
feat(gen): add option to not add to index
94e3eda
@passy passy Merge pull request #408 from eddiemonge/refac
refactor(route): dry up and refactor code
889befb
@eddiemonge eddiemonge fix(gen): options should have descriptions
Add --help info for the options coffee and minsafe
da00183
@eddiemonge eddiemonge feat(gen): allow app names to have custom suffix
Allow app names to have a custom suffix with app-suffix option. By
default, it uses 'App'

Breaks existing app names that began with a capital letter
09f0f7b
@sindresorhus sindresorhus Add jshint-stylish for some stylish jshinting 73f8019
@eddiemonge eddiemonge fix(styles): update path to icon images
Icon image paths in css were referencing wrong location
8daad4f
@passy passy Merge pull request #419 from eddiemonge/patch-1
fix(styles): update path to icon images
526f424
@passy passy feat(app): upgrade to Bootstrap 3.0.1 59f4b1b
@passy passy Merge pull request #413 from eddiemonge/appsuffix
feat(gen): allow app names to have custom suffix
4a80967
@addyosmani addyosmani Merge pull request #429 from passy/bootstrap-3
feat(app): upgrade to Bootstrap 3.0.1
4340d6c
@sindresorhus sindresorhus Merge pull request #409 from eddiemonge/options
fix(gen): options should have descriptions
24fb398
@eddiemonge eddiemonge docs(readme): remove outdated testing instructions
The testing instructions were really out of date and didn't apply anymore
dcb875e
@eddiemonge eddiemonge fix(css): remove merge conflicts
Remove the merge conflicts from the file
d558af3
@eddiemonge eddiemonge fix(bootstrap): some plugins have ordering dependencies
Re-arrange ordering dependencies and trailing comma
3da4a13
@eddiemonge eddiemonge feat(app): reload grunt server when gruntfile is updated
When a change occurs on gruntfile, reload the server
50c6abb
@eddiemonge eddiemonge feat(app): update to angular 1.2.0
Update Angular and its deps to 1.2.0. Also updates other deps.

Breaking changes: The gruntfile has changed slightly. Specifically ngmin
has been moved in the build order and its config targets have been
updated from dist to tmp
77082c6
@santialbo santialbo fix(gen): remove extra "App" from service spec files
Pull request #413 changed the way the names are handled. Forgot to
update these 4 files.
4053f11
@passy passy Merge pull request #439 from eddiemonge/ngupdate
feat(app): update to angular 1.2.0
773bdf4
@passy passy doc(changelog): add preliminary changelog for 0.6 70dd36b
@passy passy v0.6.0-rc.1 f997b49
@passy passy fix(template): remove redundant closing tag
Reported by @andriytyurnikov
Fixes #441
d1e560e
@passy passy Merge pull request #438 from eddiemonge/gfile
feat(app): reload grunt server when gruntfile is updated
d4d80c4
@eddiemonge eddiemonge chore(deps): update dependency time-grunt
Patch release of time-grunt
cd264e4
@eddiemonge eddiemonge feat(app): run unit tests when test scripts are changed
When files in the test folder are updated, run karma
94af0b5
@passy passy Merge pull request #437 from eddiemonge/jstest
feat(app): run unit tests when test scripts are changed
e4db7c0
@eddiemonge eddiemonge fix(gen): script paths use forward slashes
Using path.join creates backslashes. Script src uses forward slashes

Fixes #410
40aa61d
@passy passy Merge pull request #445 from eddiemonge/webpath
Fix Windows broken paths
6cd4b13
@eddiemonge eddiemonge docs(contributing): add git commit message guidelines
Update with brief message about what goes in the commit message
3cced99
@eddiemonge eddiemonge fix(build): only include sass if sass is selected
Sass-bootstrap should only be included if the user selects sass

Fixes #449
597b8b5
@eddiemonge eddiemonge style(whitespace): make html files follow indentation
Update HTML files to have consistent indentation and spaces vs tabs
7d0d96d
@eddiemonge eddiemonge feat(build): deprecate server in favor of serve
Use `grunt serve` instead of server per webapps upstream change

References #35
BREAKING CHANGE: `grunt server` is being deprecated
ef05631
@jjt jjt feat(build): compile only changed coffeescript files in watch task
Use grunt-newer in both watch:coffee watch:coffeeTest

Closes #425
4196e37
@eddiemonge eddiemonge fix(build): standardize comments and comment out uglify:dist
Standard the comment styles and add uglify to the css min commented
block as it is not used anymore

Fixes #455
d5d3e45
@eddiemonge eddiemonge feat(app): imagemin handles gifs
Update Gruntfile to let imagemin handle gifs
9341eb9
@eddiemonge eddiemonge chore(deps): update bootstrap fonts and css
Update the Bootstrap main css and font files

Fixes #448
feb30e4
@gonzaloruizdevilla gonzaloruizdevilla chore(travis): ensure building dir is 'generator-angular' 5f2c21b
@eddiemonge eddiemonge docs(readme): specify that optional components are installed by default
The optional components are installed by default and now the readme specifies that
77cc1d0
Gilad Peleg feature(index.html): add support for bower installed css files during…
… minifaction

solve missing .css files during grunt:build minification due to files being installed via bower (and not copied with grunt:copy:styles)
3021515
@sindresorhus sindresorhus Merge pull request #456 from eddiemonge/bsfiles
chore(deps): update bootstrap fonts and css
98ae76b
@sindresorhus sindresorhus Merge pull request #450 from eddiemonge/serve
feat(build): deprecate server in favor of serve
8088e5f
@eddiemonge eddiemonge feat(gen): add image file as example
Add an image file and use it in main view as an example. Also
demonstrates imagemin working
b161c29
@eddiemonge eddiemonge Merge pull request #458 from gonzaloruizdevilla/travisci
chore(travis): ensure building dir is 'generator-angular'
7aa5e2c
@passy passy Merge pull request #468 from pgilad/patch-2
feature(index.html): support for bower installed css files during minification
e2f1c05
@eddiemonge eddiemonge Merge pull request #453 from jjt/gruntnewer
feat(build): compile only changed coffeescript files in watch task
b39a31d
@eddiemonge eddiemonge docs(comments): comment config blocks in gruntfile
Help let newer people know what each config section is for
3eac6c6
@passy passy fix(build): use grunt-newer for styles and jshint
Applied @tschaub's changes to generator-webapp using grunt-newer for jshint and
style copying.

See yeoman/generator-webapp#193
b1eeb68
Paul Snively Merged upstream. 0a5781e
Paul Snively Merged upstream again. 3ef29cb
@anchann
Owner
anchann commented Nov 19, 2013

Hey @psnively,

Sorry, I don't have cycles to look at the PR right now.

The more I think about the problem on a high level, the more I'm convinced that having a separate generator for typescript angular is a good idea. So if I find time to work on this, that is the direction I'll likely take. In the meantime, if you manage to get this working and get folks at generator-angular to agree to help land it, feel free to submit your own PR to that repo.

With that said, if your goal is really "to learn Typescript and AngularJS" as you state, I recommend you dive into learning Typescript and AngularJS, and not waste your time on the depths of the generator implementation. The knowledge you'll gain from this generator work will likely be far too domain specific to have much to do with either Typescript or Angular. You can get started by cloning https://github.com/anchann/angularjs-typescript-e2e which is a project where I distilled most of the good (hopefully) ideas that came up in the eight months of using this stack.

-a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.