generator-cg-angular icon indicating copy to clipboard operation
generator-cg-angular copied to clipboard

Put app files in an /app dir?

Open Nogbit opened this issue 10 years ago • 9 comments

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.

Nogbit avatar May 06 '14 23:05 Nogbit

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.

pjsvis avatar May 07 '14 08:05 pjsvis

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.

cgross avatar May 07 '14 13:05 cgross

@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 ;-)

Nogbit avatar May 07 '14 17:05 Nogbit

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.

cgross avatar May 07 '14 18:05 cgross

@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

Nogbit avatar May 07 '14 18:05 Nogbit

@nogbit bikeshedding fork it

pjsvis avatar May 07 '14 21:05 pjsvis

@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.

Nogbit avatar May 07 '14 22:05 Nogbit

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

tapas4java avatar Nov 13 '14 02:11 tapas4java

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

joeljeske avatar Jan 22 '15 04:01 joeljeske