Giter Club home page Giter Club logo

generator-angular-webapp's People

Contributors

gitter-badger avatar kosz avatar waffle-iron avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

roudox

generator-angular-webapp's Issues

Decide on gulp 'public' tasks

Obviously things need to change.

  • ngDocs does not work well under the same server as the main application.
  • Tests should not be run by gulp, as it takes a lot longer to see the test result after a save
  • The default gulp task should not start the server
  • The gulp serve task should start the default gulp watchers ? ? ? ( this is where it gets weird )

So what will the user commands be ?

gulp serve
gulp
npm test ( or karma start karma.conf.js )
gulp serve-docs

But then how would the development/production environments factor into this ?

gulp serve-prod
gulp serve-dev ( same as gulp serve )


Then what would the commands that get run at the same time be ?

gulp serve
npm test
gulp serve-docs

setup optional jade

Usage only.

No generators for .jade files, just generators to setup the environment to handle jade templates

Create naming strategy configuration

how to prefix suffix a controller/directive/etc
how to build the file name based on the controller/directive/etc name

how to suffix .js file name with type of object

Clean tabs from files and use spaces everywhere

Some files use tabs instead of spaces.

This is a mistake and will be fixed really soon.

This project will use spaces not tabs, to stay consistent with 99% of the javaScript projects out there.

gulp (inject probably) wipes everything in index.html at times

This has happened twice in the last month.

Both times, I was running gulp watchers and ran another task independently which modified things and triggered gulp inject watchers in the other gulp process ...

This seems to be a recipe for disaster.

Currently I do this a lot by running gulp ngdocs, since that can't be watched. If you're running gulp ngdocs while running gulp watchers, make sure you have a backup of your index.html

Allow setting up naming conventions

Object names

Directives

Directives will always be expected to be camelCased, and their html representations to be dash-cased

Controllers

Controllers can have flexible names. These settings wouldn't be needed for the webapp-angular:controller generator, as the exact name can be passed in there, however, webapp-angular:route is supposed to be able to automatically build controller names.

Suffix

Suffix your controllers with a string ( examples: Controller, Ctrl )

Prefix

Prefix your controllers with :

  • a java style namespace ( examples com.myCompany.ExampleController , some.dots.exampeController )

Capitalization

  • java style : capitalize your controller name ( example : ExampleController )
  • standard : ( example : exampleController )

Services and Factories

Name can be passed directly when created.

File Names

Naming Conventions

Java Style

MyAngularDirective.js
MyAngularController.js
MyAngularControllerTest.js

Angular-Webapp

my-angular.directive.js
my-angular.directive.spec.js
my-angular.resource.js
my-angular.model.spec.js

Google Best Practice Example

userlogin-directive.js
userlogin-directive_test.js
userlogin-service.js
userlogin-service_test.js

Object to File Name translation

!

Including a partial that doesn't exist will break your page badly

Something like

<div ng-include="'some/path/to/file.html'"></div>

If some/path/to/file.html does not exist the page containing this tab, will break badly, and possibly crash your browser.

This is I think, because of the live reload server, being configured to only serve one route /. If the page doesn't exist, the live reload server serves the / route again, which causes an infinite loop since the / route is served to itself / .

If this happens, make sure your includes are ok on that page, for now.

.gitignore template gets renamed to .npmignore when published on npm

Error: Unable to read "/usr/local/lib/node_modules/generator-angular-webapp/generators/app/templates/.gitignore" file (Error code: ENOENT).

This error to be fixed in 0.1.4.

The generator cannot be used after installing with npm install. It can only be used with npm link at the moment.

The fix for this will be changing the .gitignore filename to gitignore

Co-worker wish list

After reviewing this with a co-worker, got some interesting suggestions :

  • the generator should not be opinionated, and allow for very customizable setups, such as allowing to define naming conventions
  • the generator should allow defaults to be set, so that less questions are asked when a generator is ran
  • the generator should assist as best as possible in producing very loosely coupled modules, that can then be pieced together in another angular-webapp

when karma specs fail under the gulp task, other gulp tasks stop working as expected

what i'm seeing is, i have a spec failure, and when running gulp, the serve task never runs because of the error in the specs.

this is a really annoying feature of gulp, exiting on any sort of error, and it's a complete show stopper for any one shop stop gulp task with watchers.

we'll have a work around in angular-webapp, and then wait for gulp to fix their issue in 4.0 as discussed here : gulpjs/gulp#71

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.