cgross / generator-cg-angular

Yeoman generator for Enterprise Angular projects.
MIT License
592 stars 198 forks source link

Put app files in an /app dir? #28

Open Nogbit opened 10 years ago

Nogbit commented 10 years ago

It would be great if everything non configuration could be put in an app directory. I've seen other generators do this and it keeps the top level directory cleaner. So for example..... /app/search/... and /app/img. Also, an option to not have to use less for css would be nice.

pjsvis commented 10 years ago

Doesn't this issue cover that?

3/03/2014 - v3.0.0 - All subgenerators now ask the user for a directory enabling any user-defined project structure. Gruntfile has been altered to allow scripts, partials, and LESS files to be located anywhere in the project directory structure.

cgross commented 10 years ago

As @pjstarifa said, you can create whatever directory structure you desire.

Re less/css, I'm curious, do you use a different preprocessor like sass? I want to add support for sass in the future.

Nogbit commented 10 years ago

@pjstarifa the subgenerators yes, but, app.js, index.html etc are still in the root instead of an /app dir. Maybe I'm just not seeing where in the gruntfile I can set the root location of these files?

@cgross no preprocessors as an option....just plain old css ;-)

cgross commented 10 years ago

Re app folder, I'm committed to the Google guidelines for Angular app structure and those match how the generator currently works: https://docs.google.com/a/texeltek.com/document/d/1XXMvReO8-Awi1EZXAXS4PzDzdNvV6pGcuaF4Q9821Es/pub

Re css, I can't say that I'm eager to add support for css w/o any preprocessor. Any project of significant effort usually uses one preprocessor or another. And Less just extends css. So you can write plan css in your Less files and thats ok.

Nogbit commented 10 years ago

@cgross in that link you provided, under "A Very Simple App Example" they have the following structure...and that is what I was suggesting, some way to set the directory where app.js and everything else is located instead of the root of your generator.

sampleapp/ 
  app.js
  ...etc etc
e2e-tests/
sampleapp-backend/

Also, too many assume that any app which requires significant effort is synonymous with needing or having a css preprocessor. It's just another layer that is not always needed. This generator linked below does both things that I'm asking, gives the option of using a preprocessor or not and puts everything in an /app directory. But, it does not permit the more flexible feature based structure within /app that I really enjoy about your generator, among other things. https://github.com/rayokota/generator-angular-sinatra

pjsvis commented 10 years ago

@nogbit bikeshedding fork it

Nogbit commented 10 years ago

@pjstarifa already did that and extended it to be specific to include numerous other things that are specific to our institution. Just providing feedback for how this can be improved is all. Good luck.

tapas4java commented 10 years ago

You can check ng-appgen for this which is based on top of cg-angular.

joeljeske commented 9 years ago

94 solves part of this issue (configurable 'app.js' and app.less names and directories)