From d345fb0d2b6b5630fb8822128707cddeb042ee0a Mon Sep 17 00:00:00 2001 From: Mark Chapman Date: Sun, 8 Jun 2014 14:12:02 +0100 Subject: [PATCH 001/109] Add forms-angular 0.4.0 support and basic applicants schema --- .travis.yml | 2 +- CHANGELOG.md | 208 +++++++++--------- app/USAGE | 2 +- app/index.js | 182 ++++----------- app/templates/styles/main.css | 10 +- app/templates/styles/main.scss | 12 +- constant/USAGE | 2 +- controller/USAGE | 2 +- decorator/USAGE | 2 +- deploy/USAGE | 2 +- deploy/index.js | 4 +- directive/USAGE | 2 +- factory/USAGE | 2 +- filter/USAGE | 2 +- heroku/USAGE | 2 +- openshift/USAGE | 2 +- package.json | 17 +- provider/USAGE | 2 +- readme.md | 70 +++--- route/USAGE | 2 +- route/index.js | 4 +- service/USAGE | 2 +- templates/common/_bower.json | 25 ++- templates/common/_package.json | 1 + templates/common/root/app/favicon.ico | Bin 4286 -> 3730 bytes templates/express/config/env/development.js | 2 +- templates/express/config/env/production.js | 2 +- templates/express/config/env/test.js | 2 +- templates/express/config/express.js | 2 +- templates/express/server.js | 22 +- templates/javascript/app.js | 46 ++-- templates/javascript/controller.js | 5 +- templates/views/html/index.html | 8 +- templates/views/html/{ => partials}/404.html | 0 .../views/html/partials/base-analysis.html | 25 +++ templates/views/html/partials/base-edit.html | 26 +++ templates/views/html/partials/base-list.html | 28 +++ templates/views/html/partials/main.html | 14 +- templates/views/html/partials/navbar.html | 58 ++++- test/test-appname-substitution.js | 2 +- test/test-file-creation.js | 8 +- value/USAGE | 2 +- view/USAGE | 2 +- 43 files changed, 419 insertions(+), 396 deletions(-) rename templates/views/html/{ => partials}/404.html (100%) create mode 100644 templates/views/html/partials/base-analysis.html create mode 100644 templates/views/html/partials/base-edit.html create mode 100644 templates/views/html/partials/base-list.html diff --git a/.travis.yml b/.travis.yml index 59f6446a0..f2fd1d393 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,5 +4,5 @@ node_js: - '0.8' before_install: - currentfolder=${PWD##*/} - - if [ "$currentfolder" != 'generator-angular-fullstack' ]; then cd .. && eval "mv $currentfolder generator-angular-fullstack" && cd generator-angular-fullstack; fi + - if [ "$currentfolder" != 'generator-fng' ]; then cd .. && eval "mv $currentfolder generator-fng" && cd generator-fng; fi diff --git a/CHANGELOG.md b/CHANGELOG.md index ceeccf763..bb75fbbdb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ #### Bug Fixes -* **config:** fix issue where `config.ip` is undefined in non-production environments ([087f5bca](http://github.com/DaftMonk/generator-angular-fullstack/commit/087f5bca1610e8250de50ce11a16e879908e3177)) +* **config:** fix issue where `config.ip` is undefined in non-production environments ([087f5bca](http://github.com/DaftMonk/generator-fng/commit/087f5bca1610e8250de50ce11a16e879908e3177)) * **package:** update connect-mongo to correct version * **app:** add require attribute to login.html inputs so it validates on client side * **gen:** use lowercase filenames for scripts @@ -15,7 +15,7 @@ #### Bug Fixes -* **gen:** typo in heroku generator was preventing it from working on unix based systems ([9d3b5738](http://github.com/DaftMonk/generator-angular-fullstack/commit/9d3b5738528497f74d37d22c304b0d46cd5007fa)) +* **gen:** typo in heroku generator was preventing it from working on unix based systems ([9d3b5738](http://github.com/DaftMonk/generator-fng/commit/9d3b5738528497f74d37d22c304b0d46cd5007fa)) ### v1.4.1 (2014-04-15) @@ -24,8 +24,8 @@ #### Bug Fixes * **server:** - * grunt test was incorrectly using dev config, fixes #179 ([62d8492f](http://github.com/DaftMonk/generator-angular-fullstack/commit/62d8492fd9fcfde653bab0f65b46f9961b8016bc)) - * emails are no longer case sensitive ([dafd8db1](https://github.com/DaftMonk/generator-angular-fullstack/commit/dafd8db1f529b86322ef60f65897761cef92841a)) + * grunt test was incorrectly using dev config, fixes #179 ([62d8492f](http://github.com/DaftMonk/generator-fng/commit/62d8492fd9fcfde653bab0f65b46f9961b8016bc)) + * emails are no longer case sensitive ([dafd8db1](https://github.com/DaftMonk/generator-fng/commit/dafd8db1f529b86322ef60f65897761cef92841a)) ## v1.4.0 (2014-04-13) @@ -33,34 +33,34 @@ #### Features * **server:** updated Express to v4.x -* **app:** matching angular dependencies to the latest verison, now that bower excludes pre-releases ([94c0c636](http://github.com/DaftMonk/generator-angular-fullstack/commit/94c0c63691976eaf7136c33365f611b465ba7f61)) +* **app:** matching angular dependencies to the latest verison, now that bower excludes pre-releases ([94c0c636](http://github.com/DaftMonk/generator-fng/commit/94c0c63691976eaf7136c33365f611b465ba7f61)) * **gen:** - * Added `angular-fullstack:openshift` generator, for deploying your app to OpenShift - * Added `angular-fullstack:heroku` generator, which improves upon the former `:deploy` generator for deploying to Heroku + * Added `fng:openshift` generator, for deploying your app to OpenShift + * Added `fng:heroku` generator, which improves upon the former `:deploy` generator for deploying to Heroku #### Bug Fixes * **server:** fixed possible DB flushing when mochaTest is called by watch, first call 'env:test' task before 'mochaTest' -([2f0320fe](http://github.com/DaftMonk/generator-angular-fullstack/commit/2f0320feb89f3a5f1757f8adcae4b8c0d5599c95)) +([2f0320fe](http://github.com/DaftMonk/generator-fng/commit/2f0320feb89f3a5f1757f8adcae4b8c0d5599c95)) #### Breaking Changes -* The `angular-fullstack:deploy` generator is deprecated. Instead use `angular-fullstack:heroku` or `angular-fullstack:openshift`. +* The `fng:deploy` generator is deprecated. Instead use `fng:heroku` or `fng:openshift`. ### v1.3.3 (2014-03-29) #### Features -* **server:** enable response compression ([1547ac6f](http://github.com/DaftMonk/generator-angular-fullstack/commit/1547ac6f794ce06d2a9329531bec5dae73441f04)) +* **server:** enable response compression ([1547ac6f](http://github.com/DaftMonk/generator-fng/commit/1547ac6f794ce06d2a9329531bec5dae73441f04)) #### Bug Fixes -* **config:** change default port in config to 9000 ([480515f6](http://github.com/DaftMonk/generator-angular-fullstack/commit/480515f6cc8d7600003a570f9b1f0530fd178ac5)) +* **config:** change default port in config to 9000 ([480515f6](http://github.com/DaftMonk/generator-fng/commit/480515f6cc8d7600003a570f9b1f0530fd178ac5)) * **gruntfile:** - * update gruntfile to use port from config ([c8aa2d5f](http://github.com/DaftMonk/generator-angular-fullstack/commit/c8aa2d5feda90a2c1e7528165b1bd22e9eab5e77)) - * workaround imagemin bug by disabling caching ([3e435fa7](http://github.com/DaftMonk/generator-angular-fullstack/commit/3e435fa74b1574223f129867621a9a800cea2af9)) -* **package:** update required generator-karma dependency to the correct version ([0c0e8a52](http://github.com/DaftMonk/generator-angular-fullstack/commit/0c0e8a522ffa94ea0bd9c0df9994c23340a957f7)) + * update gruntfile to use port from config ([c8aa2d5f](http://github.com/DaftMonk/generator-fng/commit/c8aa2d5feda90a2c1e7528165b1bd22e9eab5e77)) + * workaround imagemin bug by disabling caching ([3e435fa7](http://github.com/DaftMonk/generator-fng/commit/3e435fa74b1574223f129867621a9a800cea2af9)) +* **package:** update required generator-karma dependency to the correct version ([0c0e8a52](http://github.com/DaftMonk/generator-fng/commit/0c0e8a522ffa94ea0bd9c0df9994c23340a957f7)) ### v1.3.2 (2014-03-01) @@ -68,7 +68,7 @@ #### Bug Fixes -* **package.json:** updated dependencies that were causing issues with npm install ([1874cdf1](http://github.com/DaftMonk/generator-angular-fullstack/commit/1874cdf16c9d1670d0492db8db1be77e43222de4)) +* **package.json:** updated dependencies that were causing issues with npm install ([1874cdf1](http://github.com/DaftMonk/generator-fng/commit/1874cdf16c9d1670d0492db8db1be77e43222de4)) ### v1.3.1 (2014-03-01) @@ -76,7 +76,7 @@ #### Bug Fixes -* **gruntfile:** configured jshint for client tests ([4ee92b9a](http://github.com/DaftMonk/generator-angular-fullstack/commit/4ee92b9a4c466982b171bc777c3ba6ba5a477633)) +* **gruntfile:** configured jshint for client tests ([4ee92b9a](http://github.com/DaftMonk/generator-fng/commit/4ee92b9a4c466982b171bc777c3ba6ba5a477633)) ## v1.3.0 (2014-02-27) @@ -85,20 +85,20 @@ #### Bug Fixes * **grunt:** - * fixed clean:dist task ([e390cac0](http://github.com/DaftMonk/generator-angular-fullstack/commit/e390cac015974f691ab51261128b4215e878b25f)) + * fixed clean:dist task ([e390cac0](http://github.com/DaftMonk/generator-fng/commit/e390cac015974f691ab51261128b4215e878b25f)) * **server:** - * config all and env specific are now correctly deep merged ([31039872](http://github.com/DaftMonk/generator-angular-fullstack/commit/31039872caec541847cb80da8edf3c7ffd83ef48)) - * fix configuration so that (express) errorHandler works ([0116cb35](http://github.com/DaftMonk/generator-angular-fullstack/commit/0116cb35524afb2ee5b8a599f6bc76dbe04febc5)) + * config all and env specific are now correctly deep merged ([31039872](http://github.com/DaftMonk/generator-fng/commit/31039872caec541847cb80da8edf3c7ffd83ef48)) + * fix configuration so that (express) errorHandler works ([0116cb35](http://github.com/DaftMonk/generator-fng/commit/0116cb35524afb2ee5b8a599f6bc76dbe04febc5)) #### Features * **app:** - * added `grunt serve:debug` task that launches the server with a node-inspector tab ([de3e7a8b](http://github.com/DaftMonk/generator-angular-fullstack/commit/de3e7a8b7e63c54090c8fbc2f51998965b2e274f)) - * update to bootstrap sass official ([3799c13c](http://github.com/DaftMonk/generator-angular-fullstack/commit/3799c13c3b65fcc2abfbacb5292b192543558d52)) + * added `grunt serve:debug` task that launches the server with a node-inspector tab ([de3e7a8b](http://github.com/DaftMonk/generator-fng/commit/de3e7a8b7e63c54090c8fbc2f51998965b2e274f)) + * update to bootstrap sass official ([3799c13c](http://github.com/DaftMonk/generator-fng/commit/3799c13c3b65fcc2abfbacb5292b192543558d52)) * **server:** - * added tests for user model ([4c894b65](http://github.com/DaftMonk/generator-angular-fullstack/commit/4c894b65ec6a6d8de2b7290521f25b134ac30f40)) - * added mocha test configuration ([458a2f6a](http://github.com/DaftMonk/generator-angular-fullstack/commit/458a2f6a28485a8791815f8795e726af3c308efe)) + * added tests for user model ([4c894b65](http://github.com/DaftMonk/generator-fng/commit/4c894b65ec6a6d8de2b7290521f25b134ac30f40)) + * added mocha test configuration ([458a2f6a](http://github.com/DaftMonk/generator-fng/commit/458a2f6a28485a8791815f8795e726af3c308efe)) ### v1.2.7 (2014-02-15) @@ -106,7 +106,7 @@ #### Features -* **server:** undefined api routes now return a 404 ([ec829fe2](http://github.com/DaftMonk/generator-angular-fullstack/commit/ec829fe2221dbe001c12983c95576c20f0e63a30)) +* **server:** undefined api routes now return a 404 ([ec829fe2](http://github.com/DaftMonk/generator-fng/commit/ec829fe2221dbe001c12983c95576c20f0e63a30)) ### v1.2.6 (2014-02-14) @@ -115,20 +115,20 @@ #### Bug Fixes * **app:** - * redirect to login only on 401s ([64b7bace](http://github.com/DaftMonk/generator-angular-fullstack/commit/64b7bacea98e59cb72a44627b57ca331d9bf051d)) - * fixed incorrect css path for usemin in gruntfile ([46fca240](http://github.com/DaftMonk/generator-angular-fullstack/commit/46fca240009d2c61aa07b5cef2275e4095033a10)) -* **grunt:** include partial sub-directories in htmlmin ([77564ba3](http://github.com/DaftMonk/generator-angular-fullstack/commit/77564ba3b59baa52546f3b1170ee9cad16b7d413)) + * redirect to login only on 401s ([64b7bace](http://github.com/DaftMonk/generator-fng/commit/64b7bacea98e59cb72a44627b57ca331d9bf051d)) + * fixed incorrect css path for usemin in gruntfile ([46fca240](http://github.com/DaftMonk/generator-fng/commit/46fca240009d2c61aa07b5cef2275e4095033a10)) +* **grunt:** include partial sub-directories in htmlmin ([77564ba3](http://github.com/DaftMonk/generator-fng/commit/77564ba3b59baa52546f3b1170ee9cad16b7d413)) * **server:** - * fixed connect-mongo error ([c12db5b3](http://github.com/DaftMonk/generator-angular-fullstack/commit/c12db5b3e9b7475ba4581f23f9c20e4ce701b855)) - * livereload now waits for server to finish restarting ([71d63f0a](http://github.com/DaftMonk/generator-angular-fullstack/commit/71d63f0a704a2773cee368b1af24c188e04d0ae3)) - * exposed configured passport from passport module ([772133de](http://github.com/DaftMonk/generator-angular-fullstack/commit/772133de1f86c8a6a8c93179673deb4359e30c94)) - * only require models if they are coffescript or js files ([ce2ee236](http://github.com/DaftMonk/generator-angular-fullstack/commit/ce2ee2369ff0c4aedc1a13d04359d918ea1b3d8d)) + * fixed connect-mongo error ([c12db5b3](http://github.com/DaftMonk/generator-fng/commit/c12db5b3e9b7475ba4581f23f9c20e4ce701b855)) + * livereload now waits for server to finish restarting ([71d63f0a](http://github.com/DaftMonk/generator-fng/commit/71d63f0a704a2773cee368b1af24c188e04d0ae3)) + * exposed configured passport from passport module ([772133de](http://github.com/DaftMonk/generator-fng/commit/772133de1f86c8a6a8c93179673deb4359e30c94)) + * only require models if they are coffescript or js files ([ce2ee236](http://github.com/DaftMonk/generator-fng/commit/ce2ee2369ff0c4aedc1a13d04359d918ea1b3d8d)) #### Features -* **deps:** upgrade angular to 1.2.11, and jquery to 1.11.0 ([cd5c3030](http://github.com/DaftMonk/generator-angular-fullstack/commit/cd5c303023f57de423ca69067b1105db17d066e3)) -* **app:** switched sass-bootstrap to offical bootstrap-sass ([024fee88](http://github.com/DaftMonk/generator-angular-fullstack/commit/024fee8831c4a32962283878b6b9dbd444874ec0)) +* **deps:** upgrade angular to 1.2.11, and jquery to 1.11.0 ([cd5c3030](http://github.com/DaftMonk/generator-fng/commit/cd5c303023f57de423ca69067b1105db17d066e3)) +* **app:** switched sass-bootstrap to offical bootstrap-sass ([024fee88](http://github.com/DaftMonk/generator-fng/commit/024fee8831c4a32962283878b6b9dbd444874ec0)) ### v1.2.5 (2014-01-27) @@ -137,12 +137,12 @@ #### Bug Fixes * **app:** - * fixed coffee service so it's min-safe ([c18c9da4](http://github.com/DaftMonk/generator-angular-fullstack/commit/c18c9da4475e8e48507746f441186edf9fde18b1)) - * fixed bootstrap css being imported rather than compass bootstrap ([f2739987](http://github.com/DaftMonk/generator-angular-fullstack/commit/f27399879e84daf7230d9cd953c19e93bcd22746)) + * fixed coffee service so it's min-safe ([c18c9da4](http://github.com/DaftMonk/generator-fng/commit/c18c9da4475e8e48507746f441186edf9fde18b1)) + * fixed bootstrap css being imported rather than compass bootstrap ([f2739987](http://github.com/DaftMonk/generator-fng/commit/f27399879e84daf7230d9cd953c19e93bcd22746)) * **server:** - * replaced deprecated bodyparser ([788fda04](http://github.com/DaftMonk/generator-angular-fullstack/commit/788fda04ebd1ed7d24190aacda44c252fd1ae002)) - * updated node version dependency ([b19a0997](http://github.com/DaftMonk/generator-angular-fullstack/commit/b19a0997c6db08a47a56069621756129e07c5915)) -* **gen:** updated generator dependencies ([115008d3](http://github.com/DaftMonk/generator-angular-fullstack/commit/115008d378a9fd9cc47561f451cd9153f4f2c566)) + * replaced deprecated bodyparser ([788fda04](http://github.com/DaftMonk/generator-fng/commit/788fda04ebd1ed7d24190aacda44c252fd1ae002)) + * updated node version dependency ([b19a0997](http://github.com/DaftMonk/generator-fng/commit/b19a0997c6db08a47a56069621756129e07c5915)) +* **gen:** updated generator dependencies ([115008d3](http://github.com/DaftMonk/generator-fng/commit/115008d378a9fd9cc47561f451cd9153f4f2c566)) ### v1.2.4 (2014-01-16) @@ -150,7 +150,7 @@ #### Bug Fixes -* **grunt:** fixed incorrect templating expression ([2a59e070](http://github.com/DaftMonk/generator-angular-fullstack/commit/2a59e070bb89abb4ea83e165f8a29b8de94621f1)) +* **grunt:** fixed incorrect templating expression ([2a59e070](http://github.com/DaftMonk/generator-fng/commit/2a59e070bb89abb4ea83e165f8a29b8de94621f1)) ### v1.2.3 (2014-01-16) @@ -158,7 +158,7 @@ #### Bug Fixes -* **app:** fixed jshint warning in user model ([f668fdc7](http://github.com/DaftMonk/generator-angular-fullstack/commit/f668fdc7f798e2656a9576f249836f7c91d27f1a)) +* **app:** fixed jshint warning in user model ([f668fdc7](http://github.com/DaftMonk/generator-fng/commit/f668fdc7f798e2656a9576f249836f7c91d27f1a)) ### v1.2.2 (2014-01-16) @@ -167,8 +167,8 @@ #### Bug Fixes * **app:** - * replaced bcrypt with crypto for windows users ([af20c3ab](http://github.com/DaftMonk/generator-angular-fullstack/commit/af20c3ab6fd63e41475175e333810d09b3e9c3ea)) - * added karma dependencies directly to package template ([13ea60e7](http://github.com/DaftMonk/generator-angular-fullstack/commit/13ea60e7ec5763fb7f96900464df1bf26ee6912c)) + * replaced bcrypt with crypto for windows users ([af20c3ab](http://github.com/DaftMonk/generator-fng/commit/af20c3ab6fd63e41475175e333810d09b3e9c3ea)) + * added karma dependencies directly to package template ([13ea60e7](http://github.com/DaftMonk/generator-fng/commit/13ea60e7ec5763fb7f96900464df1bf26ee6912c)) ### v1.2.1 (2014-01-12) @@ -179,18 +179,18 @@ #### Features * **app:** - * restructured project for easier configuration ([0a2bf2ab](http://github.com/DaftMonk/generator-angular-fullstack/commit/0a2bf2abe04de834c786402b8945d247b4f951aa)) - * grunt build now moves all files into dist folder ([e6eff5d5](http://github.com/DaftMonk/generator-angular-fullstack/commit/e6eff5d56bf2a784feb3de6218e74b5390df319f)) -* **server:** added jshint error checking before livereload occurs ([7e001d31](http://github.com/DaftMonk/generator-angular-fullstack/commit/7e001d3156d778022e7b6847cc65934432fb9200)) -* **gen:** added passport question for scaffolding out user account creation ([87841064](http://github.com/DaftMonk/generator-angular-fullstack/commit/8784106409e51cddf8fcdc6ab52b1e81137cda19)) + * restructured project for easier configuration ([0a2bf2ab](http://github.com/DaftMonk/generator-fng/commit/0a2bf2abe04de834c786402b8945d247b4f951aa)) + * grunt build now moves all files into dist folder ([e6eff5d5](http://github.com/DaftMonk/generator-fng/commit/e6eff5d56bf2a784feb3de6218e74b5390df319f)) +* **server:** added jshint error checking before livereload occurs ([7e001d31](http://github.com/DaftMonk/generator-fng/commit/7e001d3156d778022e7b6847cc65934432fb9200)) +* **gen:** added passport question for scaffolding out user account creation ([87841064](http://github.com/DaftMonk/generator-fng/commit/8784106409e51cddf8fcdc6ab52b1e81137cda19)) #### Bug Fixes -* **app:** removed async dependency ([d5636d71](http://github.com/DaftMonk/generator-angular-fullstack/commit/d5636d712a984948fb92b82794681c07d43d830d)) -* **gitignore:** fix app/views being ignored by git ([7fa82ff9](http://github.com/DaftMonk/generator-angular-fullstack/commit/7fa82ff953e9f1368b8f9d6c3dadb5fe83bec002)) +* **app:** removed async dependency ([d5636d71](http://github.com/DaftMonk/generator-fng/commit/d5636d712a984948fb92b82794681c07d43d830d)) +* **gitignore:** fix app/views being ignored by git ([7fa82ff9](http://github.com/DaftMonk/generator-fng/commit/7fa82ff953e9f1368b8f9d6c3dadb5fe83bec002)) * **server:** - * config wasn't added to default project ([79c5e027](http://github.com/DaftMonk/generator-angular-fullstack/commit/79c5e027719507a74497c2f6be77375a513316c4)) - * removed typo and cleaned up extra whitespace ([1a132c28](http://github.com/DaftMonk/generator-angular-fullstack/commit/1a132c2822fd4973068b8beae075d0c8ec3efd42)) + * config wasn't added to default project ([79c5e027](http://github.com/DaftMonk/generator-fng/commit/79c5e027719507a74497c2f6be77375a513316c4)) + * removed typo and cleaned up extra whitespace ([1a132c28](http://github.com/DaftMonk/generator-fng/commit/1a132c2822fd4973068b8beae075d0c8ec3efd42)) * fixed style issues that were tripping up jshint #### Breaking Changes @@ -217,35 +217,35 @@ #### Bug Fixes * **app:** - * only copy CSS if Compass is not installed ([7e586745](http://github.com/DaftMonk/generator-angular-fullstack/commit/7e58674585e138c0f2eb81f46ef2cc4f1b9a3bf8)) - * services use classified names ([56a71a83](http://github.com/DaftMonk/generator-angular-fullstack/commit/56a71a83cdf90f81bb37b422ba4d40e75d28e1fe), closes [#484](http://github.com/DaftMonk/generator-angular-fullstack/issues/484)) - * reload JS files in watch ([d20f5bd2](http://github.com/DaftMonk/generator-angular-fullstack/commit/d20f5bd20ba95d47447f8acceee491a0a0ba9724)) -* **build:** deselecting ngRoute does remove route stuff ([a358c1ae](http://github.com/DaftMonk/generator-angular-fullstack/commit/a358c1ae69bff6a7708ea0a77248698f931f2e4d), closes [#486](http://github.com/DaftMonk/generator-angular-fullstack/issues/486)) + * only copy CSS if Compass is not installed ([7e586745](http://github.com/DaftMonk/generator-fng/commit/7e58674585e138c0f2eb81f46ef2cc4f1b9a3bf8)) + * services use classified names ([56a71a83](http://github.com/DaftMonk/generator-fng/commit/56a71a83cdf90f81bb37b422ba4d40e75d28e1fe), closes [#484](http://github.com/DaftMonk/generator-fng/issues/484)) + * reload JS files in watch ([d20f5bd2](http://github.com/DaftMonk/generator-fng/commit/d20f5bd20ba95d47447f8acceee491a0a0ba9724)) +* **build:** deselecting ngRoute does remove route stuff ([a358c1ae](http://github.com/DaftMonk/generator-fng/commit/a358c1ae69bff6a7708ea0a77248698f931f2e4d), closes [#486](http://github.com/DaftMonk/generator-fng/issues/486)) * **gen:** - * updated all conflicts, and fixed some bugs, from merging with upstream ([d07c829d](http://github.com/DaftMonk/generator-angular-fullstack/commit/d07c829db283eaa4986774f9664243b50b3b5171)) - * fix bower install prompt during project gen ([706f1336](http://github.com/DaftMonk/generator-angular-fullstack/commit/706f1336852923e409d669ae6fc6faeda7bbb017), closes [#505](http://github.com/DaftMonk/generator-angular-fullstack/issues/505)) -* **package:** fix imagemin for windows users ([b3cec228](http://github.com/DaftMonk/generator-angular-fullstack/commit/b3cec228b4354343929ca07fd7225526cdab74d9)) + * updated all conflicts, and fixed some bugs, from merging with upstream ([d07c829d](http://github.com/DaftMonk/generator-fng/commit/d07c829db283eaa4986774f9664243b50b3b5171)) + * fix bower install prompt during project gen ([706f1336](http://github.com/DaftMonk/generator-fng/commit/706f1336852923e409d669ae6fc6faeda7bbb017), closes [#505](http://github.com/DaftMonk/generator-fng/issues/505)) +* **package:** fix imagemin for windows users ([b3cec228](http://github.com/DaftMonk/generator-fng/commit/b3cec228b4354343929ca07fd7225526cdab74d9)) * **views:** - * fix ng includes ([598c69a5](http://github.com/DaftMonk/generator-angular-fullstack/commit/598c69a594e00f598e0cbd435444bc8abaa0d4ee)) - * add compiled views to gitignore ([087ede5f](http://github.com/DaftMonk/generator-angular-fullstack/commit/087ede5f8e2cef4c49f940ef922d71a51d110d51)) - * fix incorrect build path for vendor css ([0ed2a200](http://github.com/DaftMonk/generator-angular-fullstack/commit/0ed2a20018086fa514846ad2503841f6d5b23e16)) + * fix ng includes ([598c69a5](http://github.com/DaftMonk/generator-fng/commit/598c69a594e00f598e0cbd435444bc8abaa0d4ee)) + * add compiled views to gitignore ([087ede5f](http://github.com/DaftMonk/generator-fng/commit/087ede5f8e2cef4c49f940ef922d71a51d110d51)) + * fix incorrect build path for vendor css ([0ed2a200](http://github.com/DaftMonk/generator-fng/commit/0ed2a20018086fa514846ad2503841f6d5b23e16)) #### Features * **app:** - * add jasmine browser global to test jshintrc ([11b6ed42](http://github.com/DaftMonk/generator-angular-fullstack/commit/11b6ed42b5e941f25cc305eb5c4e8ba49586cf64)) - * use lowercase file names ([23e5d772](http://github.com/DaftMonk/generator-angular-fullstack/commit/23e5d7724e7e02e4b974f4e804f35eca33a53aea), closes [#463](http://github.com/DaftMonk/generator-angular-fullstack/issues/463)) - * use htmlmin for smaller HTML files ([2b85a52a](http://github.com/DaftMonk/generator-angular-fullstack/commit/2b85a52a054ac8cf1ab86ce1cd3de7819d30ea52), closes [#469](http://github.com/DaftMonk/generator-angular-fullstack/issues/469)) - * use grunt-bower-install for dep management ([ba7b5051](http://github.com/DaftMonk/generator-angular-fullstack/commit/ba7b505117307059a6d013d838c8aeff6db0e452), closes [#497](http://github.com/DaftMonk/generator-angular-fullstack/issues/497)) - * Enable Node debug mode ([83ae4a9e](http://github.com/DaftMonk/generator-angular-fullstack/commit/83ae4a9e328a388dd61414634ca5e10c8a0c819b)) + * add jasmine browser global to test jshintrc ([11b6ed42](http://github.com/DaftMonk/generator-fng/commit/11b6ed42b5e941f25cc305eb5c4e8ba49586cf64)) + * use lowercase file names ([23e5d772](http://github.com/DaftMonk/generator-fng/commit/23e5d7724e7e02e4b974f4e804f35eca33a53aea), closes [#463](http://github.com/DaftMonk/generator-fng/issues/463)) + * use htmlmin for smaller HTML files ([2b85a52a](http://github.com/DaftMonk/generator-fng/commit/2b85a52a054ac8cf1ab86ce1cd3de7819d30ea52), closes [#469](http://github.com/DaftMonk/generator-fng/issues/469)) + * use grunt-bower-install for dep management ([ba7b5051](http://github.com/DaftMonk/generator-fng/commit/ba7b505117307059a6d013d838c8aeff6db0e452), closes [#497](http://github.com/DaftMonk/generator-fng/issues/497)) + * Enable Node debug mode ([83ae4a9e](http://github.com/DaftMonk/generator-fng/commit/83ae4a9e328a388dd61414634ca5e10c8a0c819b)) * **gen:** - * Added navbar to starting template ([b5e94749](http://github.com/DaftMonk/generator-angular-fullstack/commit/b5e94749384ab9a3305991df62d7ed9856bded83)) - * additional work for compass support ([11cb9943](http://github.com/DaftMonk/generator-angular-fullstack/commit/11cb99437271b6e8f6cdaee8fd5fc9cda7a20d1d)) - * add Compass support to the initialization process ([7fac1194](http://github.com/DaftMonk/generator-angular-fullstack/commit/7fac1194179df3181f52258b0aa7333799fec253)) - * add welcome message and dep notice for minsafe ([f0bb8da2](http://github.com/DaftMonk/generator-angular-fullstack/commit/f0bb8da2d67c3f627bf775e2d4f53340b5c980c4), closes [#452](http://github.com/DaftMonk/generator-angular-fullstack/issues/452)) + * Added navbar to starting template ([b5e94749](http://github.com/DaftMonk/generator-fng/commit/b5e94749384ab9a3305991df62d7ed9856bded83)) + * additional work for compass support ([11cb9943](http://github.com/DaftMonk/generator-fng/commit/11cb99437271b6e8f6cdaee8fd5fc9cda7a20d1d)) + * add Compass support to the initialization process ([7fac1194](http://github.com/DaftMonk/generator-fng/commit/7fac1194179df3181f52258b0aa7333799fec253)) + * add welcome message and dep notice for minsafe ([f0bb8da2](http://github.com/DaftMonk/generator-fng/commit/f0bb8da2d67c3f627bf775e2d4f53340b5c980c4), closes [#452](http://github.com/DaftMonk/generator-fng/issues/452)) * **server:** - * Added middleware for development mode that disables caching of script files ([c082c81c](http://github.com/DaftMonk/generator-angular-fullstack/commit/c082c81c21a9d8d6fd9fccd5001270759fb2a30f)) + * Added middleware for development mode that disables caching of script files ([c082c81c](http://github.com/DaftMonk/generator-fng/commit/c082c81c21a9d8d6fd9fccd5001270759fb2a30f)) * Moved express configuration code out of server.js and into config folder to make it a more high level bootstrap. @@ -253,7 +253,7 @@ * Deselecting ngRoute adds controller and ng-include to index.html - ([a358c1ae](http://github.com/DaftMonk/generator-angular-fullstack/commit/a358c1ae69bff6a7708ea0a77248698f931f2e4d)) + ([a358c1ae](http://github.com/DaftMonk/generator-fng/commit/a358c1ae69bff6a7708ea0a77248698f931f2e4d)) * `--minsafe` flag is now deprecated. * `grunt server` is now deprecated. Use `grunt serve` instead @@ -263,7 +263,7 @@ ng-include to index.html #### Bug Fixes -* **coffee:** updated coffescript templates to point to partials ([f98e84ef](http://github.com/DaftMonk/generator-angular-fullstack/commit/f98e84efdd88243cff1ea449dc3a8e9dbebb7ccc)) +* **coffee:** updated coffescript templates to point to partials ([f98e84ef](http://github.com/DaftMonk/generator-fng/commit/f98e84efdd88243cff1ea449dc3a8e9dbebb7ccc)) ## v1.0.0 (2013-11-26) @@ -272,31 +272,31 @@ ng-include to index.html #### Bug Fixes * **build:** - * use test-specifc jshintrc ([c00c091b](http://github.com/DaftMonk/generator-angular-fullstack/commit/c00c091bdca2b55685d81a2b84b002d73aacbdcc)) - * add webapp upstream features and better coffee ([c23acebb](http://github.com/DaftMonk/generator-angular-fullstack/commit/c23acebbd8fabd391bfeee0d424f26e59f756a03)) - * use grunt-newer for styles and jshint ([b1eeb68a](http://github.com/DaftMonk/generator-angular-fullstack/commit/b1eeb68a8290aee930887fc473034ee7f8e2ccc3)) - * standardize comments and comment out uglify:dist ([d5d3e458](http://github.com/DaftMonk/generator-angular-fullstack/commit/d5d3e458e70d054707c70d058454fdd3d94070fe), closes [#455](http://github.com/DaftMonk/generator-angular-fullstack/issues/455)) -* **deps:** upgrade dependencies ([3a57216f](http://github.com/DaftMonk/generator-angular-fullstack/commit/3a57216ff9e3192db3804634f360253e9fcce69d)) + * use test-specifc jshintrc ([c00c091b](http://github.com/DaftMonk/generator-fng/commit/c00c091bdca2b55685d81a2b84b002d73aacbdcc)) + * add webapp upstream features and better coffee ([c23acebb](http://github.com/DaftMonk/generator-fng/commit/c23acebbd8fabd391bfeee0d424f26e59f756a03)) + * use grunt-newer for styles and jshint ([b1eeb68a](http://github.com/DaftMonk/generator-fng/commit/b1eeb68a8290aee930887fc473034ee7f8e2ccc3)) + * standardize comments and comment out uglify:dist ([d5d3e458](http://github.com/DaftMonk/generator-fng/commit/d5d3e458e70d054707c70d058454fdd3d94070fe), closes [#455](http://github.com/DaftMonk/generator-fng/issues/455)) +* **deps:** upgrade dependencies ([3a57216f](http://github.com/DaftMonk/generator-fng/commit/3a57216ff9e3192db3804634f360253e9fcce69d)) * **gen:** - * Fixed jshint errors that were breaking grunt task ([c6ae81c8](http://github.com/DaftMonk/generator-angular-fullstack/commit/c6ae81c8110ee59c9099740ea2f90b0d08b810d3)) + * Fixed jshint errors that were breaking grunt task ([c6ae81c8](http://github.com/DaftMonk/generator-fng/commit/c6ae81c8110ee59c9099740ea2f90b0d08b810d3)) #### Features * **app:** - * Separate client and server watchers ([0ff8ffb1](http://github.com/DaftMonk/generator-angular-fullstack/commit/0ff8ffb105a2eb1cd079fabafc5a6517d62e861d)) - * imagemin handles gifs ([9341eb9b](http://github.com/DaftMonk/generator-angular-fullstack/commit/9341eb9b710b95c95407dc54ed4af6aa4a496426)) + * Separate client and server watchers ([0ff8ffb1](http://github.com/DaftMonk/generator-fng/commit/0ff8ffb105a2eb1cd079fabafc5a6517d62e861d)) + * imagemin handles gifs ([9341eb9b](http://github.com/DaftMonk/generator-fng/commit/9341eb9b710b95c95407dc54ed4af6aa4a496426)) * **gen:** - * added support for jade templates ([24a13bfe](http://github.com/DaftMonk/generator-angular-fullstack/commit/24a13bfea0e4a9633f33e37df4a4710fecdea937)) - * Support for server rendering and Angular's HTML5 mode ([5ccdeb7a](http://github.com/DaftMonk/generator-angular-fullstack/commit/5ccdeb7a5543e35c000a54dfc15289004e406866), closes [#18](http://github.com/DaftMonk/generator-angular-fullstack/issues/18), [#17](http://github.com/DaftMonk/generator-angular-fullstack/issues/17)) - * add image file as example ([b161c298](http://github.com/DaftMonk/generator-angular-fullstack/commit/b161c2982d86df1bb3de44cd9fa8aee05fc66ff3)) + * added support for jade templates ([24a13bfe](http://github.com/DaftMonk/generator-fng/commit/24a13bfea0e4a9633f33e37df4a4710fecdea937)) + * Support for server rendering and Angular's HTML5 mode ([5ccdeb7a](http://github.com/DaftMonk/generator-fng/commit/5ccdeb7a5543e35c000a54dfc15289004e406866), closes [#18](http://github.com/DaftMonk/generator-fng/issues/18), [#17](http://github.com/DaftMonk/generator-fng/issues/17)) + * add image file as example ([b161c298](http://github.com/DaftMonk/generator-fng/commit/b161c2982d86df1bb3de44cd9fa8aee05fc66ff3)) * **build:** - * compile only changed coffeescript files in watch task ([4196e379](http://github.com/DaftMonk/generator-angular-fullstack/commit/4196e37912993ae37812fa19d9378d8b8d2cc9da), closes [#425](http://github.com/DaftMonk/generator-angular-fullstack/issues/425)) - * deprecate server in favor of serve ([ef056319](http://github.com/DaftMonk/generator-angular-fullstack/commit/ef0563192a9e3fc834ae97e7ec68470bcfdf56eb)) + * compile only changed coffeescript files in watch task ([4196e379](http://github.com/DaftMonk/generator-fng/commit/4196e37912993ae37812fa19d9378d8b8d2cc9da), closes [#425](http://github.com/DaftMonk/generator-fng/issues/425)) + * deprecate server in favor of serve ([ef056319](http://github.com/DaftMonk/generator-fng/commit/ef0563192a9e3fc834ae97e7ec68470bcfdf56eb)) #### Breaking Changes -* `angular-fullstack:route` -* `angular-fullstack:view` +* `fng:route` +* `fng:view` Will now generate views and routes in the views/partials folder. @@ -308,16 +308,16 @@ They are exactly the same as the generators that you have been using. Example us **For New projects:** -Continue to use angular-fullstack route and view sub-generators. +Continue to use fng route and view sub-generators. The reason for this change in folder structure was to support server page rendering. Closes #18, #17 - ([5ccdeb7a](http://github.com/DaftMonk/generator-angular-fullstack/commit/5ccdeb7a5543e35c000a54dfc15289004e406866)) + ([5ccdeb7a](http://github.com/DaftMonk/generator-fng/commit/5ccdeb7a5543e35c000a54dfc15289004e406866)) * `grunt server` is being deprecated - ([ef056319](http://github.com/DaftMonk/generator-angular-fullstack/commit/ef0563192a9e3fc834ae97e7ec68470bcfdf56eb)) + ([ef056319](http://github.com/DaftMonk/generator-fng/commit/ef0563192a9e3fc834ae97e7ec68470bcfdf56eb)) ## v0.2.0 (2013-11-13) @@ -325,26 +325,26 @@ Closes #18, #17 #### Bug Fixes -* **bootstrap:** some plugins have ordering dependencies ([3da4a130](http://github.com/DaftMonk/generator-angular-fullstack/commit/3da4a1301e0b744c7a6054fafff26fff16b6442b)) -* **build:** only include sass if sass is selected ([597b8b5c](http://github.com/DaftMonk/generator-angular-fullstack/commit/597b8b5cfab77b78e7f6091140beda2eeee0ed54), closes [#449](http://github.com/DaftMonk/generator-angular-fullstack/issues/449)) -* **css:** remove merge conflicts ([d558af35](http://github.com/DaftMonk/generator-angular-fullstack/commit/d558af351c8a531132ce064a461bc038e0710b25)) +* **bootstrap:** some plugins have ordering dependencies ([3da4a130](http://github.com/DaftMonk/generator-fng/commit/3da4a1301e0b744c7a6054fafff26fff16b6442b)) +* **build:** only include sass if sass is selected ([597b8b5c](http://github.com/DaftMonk/generator-fng/commit/597b8b5cfab77b78e7f6091140beda2eeee0ed54), closes [#449](http://github.com/DaftMonk/generator-fng/issues/449)) +* **css:** remove merge conflicts ([d558af35](http://github.com/DaftMonk/generator-fng/commit/d558af351c8a531132ce064a461bc038e0710b25)) * **gen:** - * script paths use forward slashes ([40aa61dc](http://github.com/DaftMonk/generator-angular-fullstack/commit/40aa61dcc1bf31918bea3d2ce9a84c93554aa64a), closes [#410](http://github.com/DaftMonk/generator-angular-fullstack/issues/410)) - * remove extra "App" from service spec files ([4053f11f](http://github.com/DaftMonk/generator-angular-fullstack/commit/4053f11f800280569f5b7396ad015f0a6bcc7b49)) - * options should have descriptions ([da001832](http://github.com/DaftMonk/generator-angular-fullstack/commit/da001832dbdb268b3bf38f359c72b40c401273e4)) -* **styles:** update path to icon images ([8daad4f2](http://github.com/DaftMonk/generator-angular-fullstack/commit/8daad4f2de9dbde4fcc810527da7c9607e1db8d4)) -* **template:** remove redundant closing tag ([d1e560e0](http://github.com/DaftMonk/generator-angular-fullstack/commit/d1e560e0675ecb70e6c4b59cf4de9df461434a31), closes [#441](http://github.com/DaftMonk/generator-angular-fullstack/issues/441)) + * script paths use forward slashes ([40aa61dc](http://github.com/DaftMonk/generator-fng/commit/40aa61dcc1bf31918bea3d2ce9a84c93554aa64a), closes [#410](http://github.com/DaftMonk/generator-fng/issues/410)) + * remove extra "App" from service spec files ([4053f11f](http://github.com/DaftMonk/generator-fng/commit/4053f11f800280569f5b7396ad015f0a6bcc7b49)) + * options should have descriptions ([da001832](http://github.com/DaftMonk/generator-fng/commit/da001832dbdb268b3bf38f359c72b40c401273e4)) +* **styles:** update path to icon images ([8daad4f2](http://github.com/DaftMonk/generator-fng/commit/8daad4f2de9dbde4fcc810527da7c9607e1db8d4)) +* **template:** remove redundant closing tag ([d1e560e0](http://github.com/DaftMonk/generator-fng/commit/d1e560e0675ecb70e6c4b59cf4de9df461434a31), closes [#441](http://github.com/DaftMonk/generator-fng/issues/441)) #### Features * **app:** - * run unit tests when test scripts are changed ([94af0b51](http://github.com/DaftMonk/generator-angular-fullstack/commit/94af0b510982b05c5a1939966e96aeccce087500)) - * update to angular 1.2.0 ([77082c6b](http://github.com/DaftMonk/generator-angular-fullstack/commit/77082c6b8d1dda76579f1970a270dffc359f027f)) - * reload grunt server when gruntfile is updated ([50c6abb9](http://github.com/DaftMonk/generator-angular-fullstack/commit/50c6abb9cce09a149253ceb8496feca813a71136)) - * upgrade to Bootstrap 3.0.1 ([59f4b1ba](http://github.com/DaftMonk/generator-angular-fullstack/commit/59f4b1ba73842b758174ad44a7da60af4f4db63f)) + * run unit tests when test scripts are changed ([94af0b51](http://github.com/DaftMonk/generator-fng/commit/94af0b510982b05c5a1939966e96aeccce087500)) + * update to angular 1.2.0 ([77082c6b](http://github.com/DaftMonk/generator-fng/commit/77082c6b8d1dda76579f1970a270dffc359f027f)) + * reload grunt server when gruntfile is updated ([50c6abb9](http://github.com/DaftMonk/generator-fng/commit/50c6abb9cce09a149253ceb8496feca813a71136)) + * upgrade to Bootstrap 3.0.1 ([59f4b1ba](http://github.com/DaftMonk/generator-fng/commit/59f4b1ba73842b758174ad44a7da60af4f4db63f)) * **gen:** - * allow app names to have custom suffix ([09f0f7b3](http://github.com/DaftMonk/generator-angular-fullstack/commit/09f0f7b3a8c3264b7527bc9fed8c709becec99eb)) + * allow app names to have custom suffix ([09f0f7b3](http://github.com/DaftMonk/generator-fng/commit/09f0f7b3a8c3264b7527bc9fed8c709becec99eb)) @@ -352,4 +352,4 @@ Closes #18, #17 #### Features -* **gen:** include MongoDB as an option When selected, sets up database with Mongoose. Repl ([280cc84d](http://github.com/DaftMonk/generator-angular-fullstack/commit/280cc84d735c60b1c261540dceda34dd7f91c93c), closes [#2](http://github.com/DaftMonk/generator-angular-fullstack/issues/2)) \ No newline at end of file +* **gen:** include MongoDB as an option When selected, sets up database with Mongoose. Repl ([280cc84d](http://github.com/DaftMonk/generator-fng/commit/280cc84d735c60b1c261540dceda34dd7f91c93c), closes [#2](http://github.com/DaftMonk/generator-fng/issues/2)) \ No newline at end of file diff --git a/app/USAGE b/app/USAGE index dc0ee84f7..c51caacd1 100644 --- a/app/USAGE +++ b/app/USAGE @@ -2,7 +2,7 @@ Description: Creates a default AngularJS app Example: - yo angular-fullstack [--coffee] [--minsafe] + yo fng [--coffee] [--minsafe] This will create: Gruntfile.js diff --git a/app/index.js b/app/index.js index 6dc1f23a3..089f4434e 100644 --- a/app/index.js +++ b/app/index.js @@ -70,15 +70,15 @@ var Generator = module.exports = function Generator(args, options) { this.env.options.jade = this.options.jade; } - this.hookFor('angular-fullstack:common', { + this.hookFor('fng:common', { args: args }); - this.hookFor('angular-fullstack:main', { + this.hookFor('fng:main', { args: args }); - this.hookFor('angular-fullstack:controller', { + this.hookFor('fng:controller', { args: args }); @@ -88,24 +88,12 @@ var Generator = module.exports = function Generator(args, options) { callback: this._injectDependencies.bind(this) }); - var enabledComponents = []; + var enabledComponents = ['angular-sanitize/angular-sanitize.js','angular-route/angular-route.js']; - if (this.resourceModule) { - enabledComponents.push('angular-resource/angular-resource.js'); - } - - if (this.cookiesModule) { + if (this.mongoPassportUser) { enabledComponents.push('angular-cookies/angular-cookies.js'); } - if (this.sanitizeModule) { - enabledComponents.push('angular-sanitize/angular-sanitize.js'); - } - - if (this.routeModule) { - enabledComponents.push('angular-route/angular-route.js'); - } - this.invoke('karma:app', { options: { coffee: this.options.coffee, @@ -128,10 +116,28 @@ util.inherits(Generator, yeoman.generators.Base); Generator.prototype.welcome = function welcome() { // welcome message + this.bootstrap = true; + this.compass = false; + this.compassBootstrap = false; + this.ngRoute = true; + this.jade = false; + this.routeModule = true; + this.mongo = true; + this.mongoPassportUser = false; + + var angMods = ["'formsAngular'"]; + + if (this.routeModule) { +// angMods.push("'ngRoute'"); + this.env.options.ngRoute = true; + } + + this.env.options.angularDeps = "\n " + angMods.join(",\n ") +"\n"; + if (!this.options['skip-welcome-message']) { console.log(this.yeoman); console.log( - 'Out of the box I include Bootstrap and some AngularJS recommended modules.\n' + 'Out of the box I include Bootstrap, Mongoose and some AngularJS recommended modules.\n' ); // Deprecation notice for minsafe @@ -145,127 +151,21 @@ Generator.prototype.welcome = function welcome() { } }; -Generator.prototype.askForCompass = function askForCompass() { - var cb = this.async(); - - this.prompt([{ - type: 'confirm', - name: 'compass', - message: 'Would you like to use Sass (with Compass)?', - default: true - }], function (props) { - this.compass = props.compass; - - cb(); - }.bind(this)); -}; - -Generator.prototype.askForBootstrap = function askForBootstrap() { - var compass = this.compass; - var cb = this.async(); - - this.prompt([{ - type: 'confirm', - name: 'bootstrap', - message: 'Would you like to include Twitter Bootstrap?', - default: true - }, { - type: 'confirm', - name: 'compassBootstrap', - message: 'Would you like to use the Sass version of Twitter Bootstrap?', - default: true, - when: function (props) { - return props.bootstrap && compass; - } - }], function (props) { - this.bootstrap = props.bootstrap; - this.compassBootstrap = props.compassBootstrap; - - cb(); - }.bind(this)); -}; - -Generator.prototype.askForModules = function askForModules() { - var cb = this.async(); - - var prompts = [{ - type: 'checkbox', - name: 'modules', - message: 'Which modules would you like to include?', - choices: [{ - value: 'resourceModule', - name: 'angular-resource.js', - checked: true - }, { - value: 'cookiesModule', - name: 'angular-cookies.js', - checked: true - }, { - value: 'sanitizeModule', - name: 'angular-sanitize.js', - checked: true - }, { - value: 'routeModule', - name: 'angular-route.js', - checked: true - }] - }]; - - this.prompt(prompts, function (props) { - var hasMod = function (mod) { return props.modules.indexOf(mod) !== -1; }; - this.resourceModule = hasMod('resourceModule'); - this.cookiesModule = hasMod('cookiesModule'); - this.sanitizeModule = hasMod('sanitizeModule'); - this.routeModule = hasMod('routeModule'); - - var angMods = []; - - if (this.cookiesModule) { - angMods.push("'ngCookies'"); - } - - if (this.resourceModule) { - angMods.push("'ngResource'"); - } - if (this.sanitizeModule) { - angMods.push("'ngSanitize'"); - } - if (this.routeModule) { - angMods.push("'ngRoute'"); - this.env.options.ngRoute = true; - } - - if (angMods.length) { - this.env.options.angularDeps = "\n " + angMods.join(",\n ") +"\n"; - } - - cb(); - }.bind(this)); -}; - -Generator.prototype.askForMongo = function askForMongo() { - var cb = this.async(); - - this.prompt([{ - type: 'confirm', - name: 'mongo', - message: 'Would you like to include MongoDB with Mongoose?', - default: false - }, { - type: 'confirm', - name: 'mongoPassportUser', - message: 'Would you like to include a Passport authentication boilerplate?', - default: false, - when: function (props) { - return props.mongo; - } - }], function (props) { - this.mongo = props.mongo; - this.mongoPassportUser = props.mongoPassportUser; - - cb(); - }.bind(this)); -}; +//Generator.prototype.askForMongo = function askForMongo() { +// var cb = this.async(); +// +// this.prompt([{ +// type: 'confirm', +// name: 'mongoPassportUser', +// message: 'Would you like to include a Passport authentication boilerplate?', +// default: false +// }], function (props) { +// this.mongo = props.mongo = true; +// this.mongoPassportUser = props.mongoPassportUser; +// +// cb(); +// }.bind(this)); +//}; Generator.prototype.readIndex = function readIndex() { this.ngRoute = this.env.options.ngRoute; @@ -417,13 +317,15 @@ Generator.prototype.addJadeViews = function addHtmlJade() { Generator.prototype.addHtmlViews = function addHtmlViews() { if(!this.jade) { this.copy('../../templates/views/html/partials/main.html', 'app/views/partials/main.html'); + this.copy('../../templates/views/html/partials/base-edit.html', 'app/views/partials/base-edit.html'); + this.copy('../../templates/views/html/partials/base-list.html', 'app/views/partials/base-list.html'); this.copy('../../templates/views/html/partials/navbar.html', 'app/views/partials/navbar.html'); if(this.mongoPassportUser) { this.copy('../../templates/views/html/partials/login.html', 'app/views/partials/login.html'); this.copy('../../templates/views/html/partials/signup.html', 'app/views/partials/signup.html'); this.copy('../../templates/views/html/partials/settings.html', 'app/views/partials/settings.html'); } - this.copy('../../templates/views/html/404.html', 'app/views/404.html'); + this.copy('../../templates/views/html/partials/404.html', 'app/views/partials/404.html'); } }; diff --git a/app/templates/styles/main.css b/app/templates/styles/main.css index ae7a83f32..c50b77ee2 100644 --- a/app/templates/styles/main.css +++ b/app/templates/styles/main.css @@ -1,9 +1,15 @@ -/* Space out content a bit */ +/* Leave a gap for Navbar and space out content a bit */ body { - padding-top: 20px; + position: relative; + padding-top: 40px; padding-bottom: 20px; } +.navbar h3 { + margin-top: 12px; + padding-right: 20px; +} + /* Everything but the jumbotron gets side spacing for mobile first views */ .header, .marketing, diff --git a/app/templates/styles/main.scss b/app/templates/styles/main.scss index a95189131..2ec9eb8ca 100644 --- a/app/templates/styles/main.scss +++ b/app/templates/styles/main.scss @@ -9,10 +9,16 @@ padding: 0.2em 0; } -/* Space out content a bit */ +/* Leave gap for Navbar and space out content a bit */ body { - padding-top: 20px; - padding-bottom: 20px; + position: relative; + padding-top: 40px; + padding-bottom: 20px; +} + +.navbar h3 { + margin-top: 12px; + padding-right: 20px; } /* Everything but the jumbotron gets side spacing for mobile first views */ diff --git a/constant/USAGE b/constant/USAGE index e5b7a7be0..9682ce75d 100644 --- a/constant/USAGE +++ b/constant/USAGE @@ -3,7 +3,7 @@ Description: Docs: http://docs.angularjs.org/guide/dev_guide.services.creating_services Example: - yo angular-fullstack:constant thing [--coffee] [--minsafe] + yo fng:constant thing [--coffee] [--minsafe] This will create: app/scripts/services/thing.js diff --git a/controller/USAGE b/controller/USAGE index 75ddb67ab..1749f7976 100644 --- a/controller/USAGE +++ b/controller/USAGE @@ -2,7 +2,7 @@ Description: Creates a new Angular controller Example: - yo angular-fullstack:controller Thing [--coffee] [--minsafe] + yo fng:controller Thing [--coffee] [--minsafe] This will create: app/scripts/controllers/thing-ctrl.js diff --git a/decorator/USAGE b/decorator/USAGE index 15ba6158b..110d98597 100644 --- a/decorator/USAGE +++ b/decorator/USAGE @@ -2,7 +2,7 @@ Description: Creates a new AngularJS decorator for a specified service Example: - yo angular-fullstack:decorator serviceName [--coffee] + yo fng:decorator serviceName [--coffee] This will create: app/scripts/decorators/serviceNameDecorator.js diff --git a/deploy/USAGE b/deploy/USAGE index e391060bb..4e90ca672 100644 --- a/deploy/USAGE +++ b/deploy/USAGE @@ -2,7 +2,7 @@ Description: Initalizes a heroku app and generates a `dist` folder and pushes it to heroku. Example: - yo angular-fullstack:heroku + yo fng:heroku This will create: a dist folder and initialize a heroku app diff --git a/deploy/index.js b/deploy/index.js index 6a3d5ec9c..c3fa82cf3 100644 --- a/deploy/index.js +++ b/deploy/index.js @@ -10,6 +10,6 @@ var Generator = module.exports = function Generator() { util.inherits(Generator, yeoman.generators.NamedBase); Generator.prototype.deprecated = function deprecated() { - this.log(chalk.yellow(chalk.bold('yo angular-fullstack:deploy') + ' is deprecated, instead use: \n') + - chalk.green('yo angular-fullstack:heroku') + ' or ' + chalk.green('yo angular-fullstack:openshift')); + this.log(chalk.yellow(chalk.bold('yo fng:deploy') + ' is deprecated, instead use: \n') + + chalk.green('yo fng:heroku') + ' or ' + chalk.green('yo fng:openshift')); }; \ No newline at end of file diff --git a/directive/USAGE b/directive/USAGE index 344984ca5..daf3bcb1f 100644 --- a/directive/USAGE +++ b/directive/USAGE @@ -2,7 +2,7 @@ Description: Creates a new Angular directive Example: - yo angular-fullstack:directive thing [--coffee] [--minsafe] + yo fng:directive thing [--coffee] [--minsafe] This will create: app/scripts/directives/thing.js diff --git a/factory/USAGE b/factory/USAGE index f94cec201..4ab4d3aad 100644 --- a/factory/USAGE +++ b/factory/USAGE @@ -3,7 +3,7 @@ Description: Docs: http://docs.angularjs.org/guide/dev_guide.services.creating_services Example: - yo angular-fullstack:factory thing [--coffee] [--minsafe] + yo fng:factory thing [--coffee] [--minsafe] This will create: app/scripts/services/thing.js diff --git a/filter/USAGE b/filter/USAGE index 7087c9bc0..1ffd225e1 100644 --- a/filter/USAGE +++ b/filter/USAGE @@ -2,7 +2,7 @@ Description: Creates a new AngularJS filter Example: - yo angular-fullstack:filter thing [--coffee] [--minsafe] + yo fng:filter thing [--coffee] [--minsafe] This will create: app/scripts/filters/thing.js diff --git a/heroku/USAGE b/heroku/USAGE index 72594f4c4..d23528955 100644 --- a/heroku/USAGE +++ b/heroku/USAGE @@ -2,7 +2,7 @@ Description: Initalizes a heroku app and generates a `dist` folder which is ready to push to heroku. Example: - yo angular-fullstack:deploy heroku + yo fng:deploy heroku This will create: a dist folder and initialize a heroku app diff --git a/openshift/USAGE b/openshift/USAGE index b3dd18759..03622ffed 100644 --- a/openshift/USAGE +++ b/openshift/USAGE @@ -2,7 +2,7 @@ Description: Initalizes an openshift app and generates a `dist` folder and pushes it to openshift. Example: - yo angular-fullstack:openshift + yo fng:openshift This will create: a dist folder and initialize an openshift app \ No newline at end of file diff --git a/package.json b/package.json index fefd80720..eb0167d8d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { - "name": "generator-angular-fullstack", - "version": "1.4.3", - "description": "Yeoman generator for creating MEAN stack applications, using MongoDB, Express, AngularJS, and Node", + "name": "generator-fng", + "version": "0.0.0", + "description": "Yeoman generator for creating forms-angular applications, using MongoDB, Express, AngularJS, and Node", "keywords": [ "yeoman-generator", "mean", @@ -9,19 +9,20 @@ "angularjs", "express", "scaffold", - "fullstack", + "forms", + "forms-angular", "framework", "component", "front-end", "app" ], - "homepage": "https://github.com/DaftMonk/generator-angular-fullstack", - "bugs": "https://github.com/DaftMonk/generator-angular-fullstack/issues", - "author": "Tyler Henkel", + "homepage": "https://github.com/forms-angular/generator-fng", + "bugs": "https://github.com/forms-angular/generator-fng/issues", + "author": "Mark Chapman (after Tyler Henkel)", "main": "app/index.js", "repository": { "type": "git", - "url": "git://github.com/DaftMonk/generator-angular-fullstack.git" + "url": "git://github.com/forms-angular/generator-fng.git" }, "scripts": { "test": "mocha" diff --git a/provider/USAGE b/provider/USAGE index 082bce121..fb4008629 100644 --- a/provider/USAGE +++ b/provider/USAGE @@ -3,7 +3,7 @@ Description: Docs: http://docs.angularjs.org/guide/dev_guide.services.creating_services Example: - yo angular-fullstack:provider thing [--coffee] [--minsafe] + yo fng:provider thing [--coffee] [--minsafe] This will create: app/scripts/services/thing.js diff --git a/readme.md b/readme.md index fa5b3b196..ffac26031 100644 --- a/readme.md +++ b/readme.md @@ -1,31 +1,23 @@ -# AngularJS + Express Full Stack Generator +# forms-angular Generator -Yeoman generator for creating MEAN stack applications, using MongoDB, Express, AngularJS, and Node. +Yeoman generator for creating forms-angular applications, using the MEAN stack of MongoDB, Express, AngularJS, and Node. Featuring: * Express server integrated with grunt tasks * Livereload of client and server files - * Support for Jade and CoffeeScript * Easy deployment workflow. - * Optional MongoDB integration * Optional Passport integration for adding user accounts -## Example project - -Generated by saying yes to all questions: http://fullstack-demo.herokuapp.com/. - -Have a look at the source code: https://github.com/DaftMonk/fullstack-demo - ## Prerequisites -* MongoDB - Download and Install [MongoDB](http://www.mongodb.org/downloads) - If you plan on scaffolding your project with mongoose, you'll need mongoDB to be installed. +* See the Prepare section of http://www.forms-angular.org/#!/get-started#prepare ## Usage -Install `generator-angular-fullstack`: +Install `generator-fng`: ```bash -npm install -g generator-angular-fullstack +npm install -g generator-fng ``` Make a new directory, and `cd` into it: @@ -33,9 +25,9 @@ Make a new directory, and `cd` into it: mkdir my-new-project && cd $_ ``` -Run `yo angular-fullstack`, optionally passing an app name: +Run `yo fng`, optionally passing an app name: ```bash -yo angular-fullstack [app-name] +yo fng [app-name] ``` ## Express @@ -79,8 +71,8 @@ grunt build Deploying to OpenShift can be done in just a few steps: 1. `mkdir myapp && cd myapp` -2. `yo angular-fullstack myapp` -3. `yo angular-fullstack:openshift` +2. `yo fng myapp` +3. `yo fng:openshift` A live application URL will be available in the output. @@ -88,41 +80,41 @@ A live application URL will be available in the output. We provide an extremely simplifed deployment process for heroku. -`yo angular-fullstack:deploy heroku` generates a `dist` folder that is deployment ready for [heroku.com](http://heroku.com/). +`yo fng:deploy heroku` generates a `dist` folder that is deployment ready for [heroku.com](http://heroku.com/). **Create and Deploy an app in 4 steps** 1. `mkdir foo && cd foo` -2. `yo angular-fullstack` +2. `yo fng` -3. `yo angular-fullstack:heroku` +3. `yo fng:heroku` -5. Optional (if using mongoDB) `heroku addons:add mongohq` +4. `heroku addons:add mongohq` That's it! Your app should be live. Type `heroku open` from the dist folder to view it. ## Generators -All of the **generator-angular** client side generators are available, but aliased with `angular-fullstack` to correctly generate with the fullstack folder structure. +All of the **generator-angular** client side generators are available, but aliased with `fng` to correctly generate with the fullstack folder structure. Angular sub-generators: -* [angular-fullstack:controller](https://github.com/yeoman/generator-angular#controller) -* [angular-fullstack:directive](https://github.com/yeoman/generator-angular#directive) -* [angular-fullstack:filter](https://github.com/yeoman/generator-angular#filter) -* [angular-fullstack:route](https://github.com/yeoman/generator-angular#route) -* [angular-fullstack:service](https://github.com/yeoman/generator-angular#service) -* [angular-fullstack:provider](https://github.com/yeoman/generator-angular#service) -* [angular-fullstack:factory](https://github.com/yeoman/generator-angular#service) -* [angular-fullstack:value](https://github.com/yeoman/generator-angular#service) -* [angular-fullstack:constant](https://github.com/yeoman/generator-angular#service) -* [angular-fullstack:decorator](https://github.com/yeoman/generator-angular#decorator) -* [angular-fullstack:view](https://github.com/yeoman/generator-angular#view) +* [fng:controller](https://github.com/yeoman/generator-angular#controller) +* [fng:directive](https://github.com/yeoman/generator-angular#directive) +* [fng:filter](https://github.com/yeoman/generator-angular#filter) +* [fng:route](https://github.com/yeoman/generator-angular#route) +* [fng:service](https://github.com/yeoman/generator-angular#service) +* [fng:provider](https://github.com/yeoman/generator-angular#service) +* [fng:factory](https://github.com/yeoman/generator-angular#service) +* [fng:value](https://github.com/yeoman/generator-angular#service) +* [fng:constant](https://github.com/yeoman/generator-angular#service) +* [fng:decorator](https://github.com/yeoman/generator-angular#decorator) +* [fng:view](https://github.com/yeoman/generator-angular#view) Fullstack sub-generators: -* [angular-fullstack:deploy](#deploy) +* [fng:deploy](#deploy) **Note: Generators are to be run from the root directory of your app.** @@ -135,12 +127,12 @@ Initalizes a remote Heroku or OpenShift application, generates a `dist` folder, OpenShift Example: ```bash -yo angular-fullstack:openshift +yo fng:openshift ``` Or, for Heroku: ```bash -yo angular-fullstack:heroku +yo fng:heroku ``` To do the same manually with heroku, you'd need to: @@ -174,7 +166,7 @@ For generators that output views, the `--jade` option will output Jade instead o For example: ```bash -yo angular-fullstack --jade +yo fng --jade ``` Changes the rendering engine from EJS to Jade, and generates your views as jade files instead of HTML. @@ -186,7 +178,7 @@ For generators that output scripts, the `--coffee` option will output CoffeeScri For example: ```bash -yo angular-fullstack:controller user --coffee +yo fng:controller user --coffee ``` Produces `app/scripts/controller/user.coffee`: @@ -216,7 +208,7 @@ By default, new scripts are added to the index file. However, this may not alway To skip adding them to the index, pass in the skip-add argument: ```bash -yo angular-fullstack:service serviceName --skip-add +yo fng:service serviceName --skip-add ``` ## Bower Components diff --git a/route/USAGE b/route/USAGE index 8021266e5..cdab6723e 100644 --- a/route/USAGE +++ b/route/USAGE @@ -2,7 +2,7 @@ Description: Creates a new AngularJS route Example: - yo angular-fullstack:route thing [--coffee] [--minsafe] + yo fng:route thing [--coffee] [--minsafe] This will create: app/scripts/controllers/thing.js diff --git a/route/index.js b/route/index.js index b78cc3da2..33537a026 100644 --- a/route/index.js +++ b/route/index.js @@ -7,8 +7,8 @@ var angularUtils = require('../util.js'); var Generator = module.exports = function Generator() { ScriptBase.apply(this, arguments); - this.hookFor('angular-fullstack:controller'); - this.hookFor('angular-fullstack:view'); + this.hookFor('fng:controller'); + this.hookFor('fng:view'); }; util.inherits(Generator, ScriptBase); diff --git a/service/USAGE b/service/USAGE index 47e7e213f..56b04bfed 100644 --- a/service/USAGE +++ b/service/USAGE @@ -3,7 +3,7 @@ Description: Docs: http://docs.angularjs.org/guide/dev_guide.services.creating_services Example: - yo angular-fullstack:service thing [--coffee] [--minsafe] + yo fng:service thing [--coffee] [--minsafe] This will create: app/scripts/services/thing.js diff --git a/templates/common/_bower.json b/templates/common/_bower.json index cc5a04444..a709c133e 100644 --- a/templates/common/_bower.json +++ b/templates/common/_bower.json @@ -2,20 +2,21 @@ "name": "<%= _.slugify(_.humanize(appname)) %>", "version": "0.0.0", "dependencies": { - "angular": ">=1.2.*", + "angular": "1.3.0-beta.10", "json3": "~3.2.6", - "es5-shim": "~2.1.0"<% if (bootstrap) { %>, - "jquery": "~1.11.0"<% if (compassBootstrap) { %>, - "bootstrap-sass-official": "~3.1.1"<% } else { %>, - "bootstrap": "~3.1.1"<% } } %><% if (resourceModule) { %>, - "angular-resource": ">=1.2.*"<% } %><% if (cookiesModule) { %>, - "angular-cookies": ">=1.2.*"<% } %><% if (sanitizeModule) { %>, - "angular-sanitize": ">=1.2.*"<% } %><% if (routeModule) { %>, - "angular-route": ">=1.2.*"<% } %> + "es5-shim": "~2.1.0", + "angular-route": "1.3.0-beta.10", + "angular-ui-bootstrap-bower": "0.8.0", + "forms-angular": "^0.4.0", + "angular-sanitize": "1.3.0-beta.10", + "underscore": "1.6", + "ngInfiniteScroll": "git://github.com/forms-angular/ngInfiniteScroll", + "angular-elastic": "~2", + "bootstrap-css-only": "~3.1.1"<% if (mongoPassportUser) { %>, + "angular-cookies": ">=1.2.*"<% } %> }, "devDependencies": { - "angular-mocks": ">=1.2.*", - "angular-scenario": ">=1.2.*" + "angular-mocks": "1.3.0-beta.10" }, - "testPath": "test/client/spec" + "testPath": "test/client/spec" } diff --git a/templates/common/_package.json b/templates/common/_package.json index 9694565b2..ffd71b5e1 100644 --- a/templates/common/_package.json +++ b/templates/common/_package.json @@ -9,6 +9,7 @@ "static-favicon": "~1.0.1", "cookie-parser": "~1.0.1", "express-session": "~1.0.2", + "forms-angular": "^0.4.0", "errorhandler": "~1.0.0", "compression": "~1.0.1", "lodash": "~2.4.1"<% if (mongo) { %>, diff --git a/templates/common/root/app/favicon.ico b/templates/common/root/app/favicon.ico index 6527905307f19ba00762f9241f7eb535fa84a2f9..7a64d1a3c0f16650c54133ee8423f1f3d9f344b0 100644 GIT binary patch literal 3730 zcmeHKOKTKC5bnuA!M7mdV+kX^#mC0!PCTsWS@hyh5WM*lJmlcP*D0X5n3crL_8vqK z5%H#;a!^?m0s+lt;?B;1M2w)IB+!19-GXMAg^XdmxC0;6T~+;kHPtgcj1Z3K6aBjd ztSd?zg*YIDaNR!49Z__IxCGxJ`1*lCfbx1*uLHdfWa~gU;hl?X@uFZ`>c+4$YW( z*i!G?x^giOUF_rS4u6C8c;5AC4|k7kv2~|L zPiv;YK!dTA1S<`UfW@8kk!0s5!vc0sRO I=)dy+0U>8ydH?_b literal 4286 zcmchaPe@cz6vpqQW1y54B@{_hhFD-kWPgyXjSGVaf);_51TESOlSPOdvy}@W5Q+** zs6~RrtlR}7(V|sCkP&1f7!5{Hixw@4+x@+HXSm*Z^WGalm2d8S=brO@=iGm9MyZ7P zPo)%}YN|=8W~EfSfibDm2H3qnGq$y%h@zqVv#zn@@WvhIGJ8*ECePe@roq(*vwGys z4?Q;bI~MRIM&jXu6Yg@wqQ#8&8x#z55E}ONd3<&rw_h!5AbBx{CcZ%&z736jHxFa0 zsBLqly3+dQ%MZGH{QU}GW6bsq=@$a@sXtac^<8>8uP>*+d!Qdtv&&mnKlvE_T-+SC z*QNCVwcvq%+&DDc+T}Uf(2_FavDN{-&hCpIs?aW=A$mcrzyD+9(025i1~K&uVf&w4 zItQLK9T{7k?s@bnU*&p+<^UI*aHA1aH+Fo^PAzM|xjNK09?2V(Cme7IFB(BP?7#at z(>DB3w`AUFS~=(LUBdZ>v-SG4J~%Mrfj&05Z)oj13l5tbEq4x>8+;FC0Dvr zbJY#7PS$+yE_Cf7gxqQEC@RoZX5J^}71l+`Q~qnOF4D za`lhjUuqZa-sj)EHDleV2i|mc!Ly-@7IwzPM{?pBUt(+@IHi8HTz#Iq9)9h|hrL3) zfOT#@|5$JCxmRjsOj>&kUt(m8*57|W(FoE`CX*8edYv%j=3sR5>!hvglJ#@8K6j$g z&IuUbRC_{)p}sbyx%UD6Fki;t6nDk0gT5&6Q_at7FbVVOu?4VK{oR#!kyYbCc;<4+LITzoZ8-~O5L+9MiLHL4NyME>! z;Ky7<)UR!gN_~GXhMvPMHNB;EmmIK}eHD&~cRx89jth}IM#tU%ablw0|GxfE9IjRR zl-)b-IvC#UD!IewzPL77SI>R+?}<2ERr|R2o~zCC8rJUR8>DI5*0O$6+k~wZ)Mt;b z(Hul-OFl+F))}lK&&Yi*+S2kJmHDbdBWOQnaSA6S|#*, mongo: { - uri: 'mongodb://localhost/fullstack-dev' + uri: 'mongodb://localhost/fng-dev' }<% } %> }; \ No newline at end of file diff --git a/templates/express/config/env/production.js b/templates/express/config/env/production.js index b51d60f83..8148fc3cc 100644 --- a/templates/express/config/env/production.js +++ b/templates/express/config/env/production.js @@ -12,6 +12,6 @@ module.exports = { uri: process.env.MONGOLAB_URI || process.env.MONGOHQ_URL || process.env.OPENSHIFT_MONGODB_DB_URL+process.env.OPENSHIFT_APP_NAME || - 'mongodb://localhost/fullstack' + 'mongodb://localhost/fng' }<% } %> }; \ No newline at end of file diff --git a/templates/express/config/env/test.js b/templates/express/config/env/test.js index 2853a0944..5783ca142 100644 --- a/templates/express/config/env/test.js +++ b/templates/express/config/env/test.js @@ -3,6 +3,6 @@ module.exports = { env: 'test'<% if (mongo) { %>, mongo: { - uri: 'mongodb://localhost/fullstack-test' + uri: 'mongodb://localhost/fng-test' }<% } %> }; \ No newline at end of file diff --git a/templates/express/config/express.js b/templates/express/config/express.js index 93d3706a6..ef201189b 100644 --- a/templates/express/config/express.js +++ b/templates/express/config/express.js @@ -55,7 +55,7 @@ module.exports = function(app) { // Persist sessions with mongoStore app.use(session({ - secret: 'angular-fullstack secret', + secret: 'fng secret', store: new mongoStore({ url: config.mongo.uri, collection: 'sessions' diff --git a/templates/express/server.js b/templates/express/server.js index 02e60c329..b459c38a6 100644 --- a/templates/express/server.js +++ b/templates/express/server.js @@ -1,9 +1,10 @@ 'use strict'; -var express = require('express')<% if (mongo) { %>, +var express = require('express'), path = require('path'), fs = require('fs'), - mongoose = require('mongoose')<% } %>; + mongoose = require('mongoose'), + formsAngular = require('forms-angular'); /** * Main application file @@ -12,7 +13,7 @@ var express = require('express')<% if (mongo) { %>, // Set default node environment to development process.env.NODE_ENV = process.env.NODE_ENV || 'development'; -var config = require('./lib/config/config');<% if (mongo) { %> +var config = require('./lib/config/config'); var db = mongoose.connect(config.mongo.uri, config.mongo.options); // Bootstrap models @@ -24,7 +25,7 @@ fs.readdirSync(modelsPath).forEach(function (file) { }); // Populate empty DB with sample data -require('./lib/config/dummydata');<% } %><% if(mongoPassportUser) { %> +require('./lib/config/dummydata');<% if(mongoPassportUser) { %> // Passport Configuration var passport = require('./lib/config/passport');<% } %> @@ -32,6 +33,19 @@ var passport = require('./lib/config/passport');<% } %> // Setup Express var app = express(); require('./lib/config/express')(app); + +var Schema = mongoose.Schema; + +var ApplicantSchema = new Schema({ + surname: {type:String, required:true, index:true}, + forename: {type:String, index:true} +}); + +var Applicant = mongoose.model('Applicant', ApplicantSchema); + +var DataFormHandler = new (formsAngular)(app); +DataFormHandler.addResource('applicant', Applicant); // Create and add more schemas to taste + require('./lib/routes')(app); // Start server diff --git a/templates/javascript/app.js b/templates/javascript/app.js index 396a9c047..50e3a7579 100644 --- a/templates/javascript/app.js +++ b/templates/javascript/app.js @@ -1,31 +1,18 @@ 'use strict'; -angular.module('<%= scriptAppName %>', [<%= angularModules %>])<% if (ngRoute) { %> - .config(function ($routeProvider, $locationProvider<% if (mongoPassportUser) { %>, $httpProvider<% } %>) { - $routeProvider - .when('/', { - templateUrl: 'partials/main', - controller: 'MainCtrl' - })<% if (mongoPassportUser) { %> - .when('/login', { - templateUrl: 'partials/login', - controller: 'LoginCtrl' - }) - .when('/signup', { - templateUrl: 'partials/signup', - controller: 'SignupCtrl' - }) - .when('/settings', { - templateUrl: 'partials/settings', - controller: 'SettingsCtrl', - authenticate: true - })<% } %> - .otherwise({ - redirectTo: '/' - }); - - $locationProvider.html5Mode(true);<% if (mongoPassportUser) { %> - +angular.module('<%= scriptAppName %>', [<%= angularModules %>]) +<% if (ngRoute) { %> + .config(['formRoutesProvider' <% if (mongoPassportUser) { %>, $httpProvider<% } %>, + function (formRoutes <% if (mongoPassportUser) { %>, $httpProvider<% } %>) { + formRoutes.setRoutes([ + {route: '/index', options: {templateUrl: 'partials/main', controller: 'MainCtrl'}}, + {route: '/404', options: {templateUrl: 'partials/404.html'}}<% if (mongoPassportUser) { %>, + {route: '/login', options: {templateUrl: 'partials/login', controller: 'LoginCtrl'}}, + {route: '/signup', options: {templateUrl: 'partials/signup', controller: 'SignupCtrl'}}, + {route: '/settings', options: {templateUrl: 'partials/settings', controller: 'SettingsCtrl', authenticate: true}}<% } %> + ], '/index'); + + <% if (mongoPassportUser) { %> // Intercept 401s and redirect you to login $httpProvider.interceptors.push(['$q', '$location', function($q, $location) { return { @@ -50,4 +37,9 @@ angular.module('<%= scriptAppName %>', [<%= angularModules %>])<% if (ngRoute) { $location.path('/login'); } });<% } %> - })<% } %>; \ No newline at end of file + }])<% } %>; + +formsAngular.config(['urlServiceProvider', 'cssFrameworkServiceProvider', function (urlService, cssFrameworkService) { + urlService.setOptions({html5Mode: true}); + cssFrameworkService.setOptions({framework: 'bs3'}); +}]); diff --git a/templates/javascript/controller.js b/templates/javascript/controller.js index 69ac16be6..388d64778 100644 --- a/templates/javascript/controller.js +++ b/templates/javascript/controller.js @@ -2,7 +2,6 @@ angular.module('<%= scriptAppName %>') .controller('<%= classedName %>Ctrl', function ($scope, $http) { - $http.get('/api/awesomeThings').success(function(awesomeThings) { - $scope.awesomeThings = awesomeThings; - }); + $scope.messages = ['What Ho','Splendid','Jolly Good', 'Top Hole', 'Oh I Say']; // Just so the controller has something to do + $scope.message = $scope.messages[Math.floor(Math.random()*$scope.messages.length)]; }); diff --git a/templates/views/html/index.html b/templates/views/html/index.html index e6ecf717f..f07a60fdb 100644 --- a/templates/views/html/index.html +++ b/templates/views/html/index.html @@ -14,21 +14,23 @@ + - + +
<% if (ngRoute) { - %>
<% + %>
<% } else { - %>
<% + %>
<% } %> diff --git a/templates/views/html/404.html b/templates/views/html/partials/404.html similarity index 100% rename from templates/views/html/404.html rename to templates/views/html/partials/404.html diff --git a/templates/views/html/partials/base-analysis.html b/templates/views/html/partials/base-analysis.html new file mode 100644 index 000000000..5730c3cc8 --- /dev/null +++ b/templates/views/html/partials/base-analysis.html @@ -0,0 +1,25 @@ +
+ +
+
+
+ +

{{alertTitle}}

+
+
+
+
+
+
+
+
+ diff --git a/templates/views/html/partials/base-edit.html b/templates/views/html/partials/base-edit.html new file mode 100644 index 000000000..52aa7a53d --- /dev/null +++ b/templates/views/html/partials/base-edit.html @@ -0,0 +1,26 @@ +
+ + +
+ +
+
+ +

{{alertTitle}}

+
+
+
+ +
+
\ No newline at end of file diff --git a/templates/views/html/partials/base-list.html b/templates/views/html/partials/base-list.html new file mode 100644 index 000000000..30396cf7f --- /dev/null +++ b/templates/views/html/partials/base-list.html @@ -0,0 +1,28 @@ + +
+ +
+
+
+ +

{{alertTitle}}

+
+
+
+ + +
+
\ No newline at end of file diff --git a/templates/views/html/partials/main.html b/templates/views/html/partials/main.html index eef2a0759..d3aea7382 100644 --- a/templates/views/html/partials/main.html +++ b/templates/views/html/partials/main.html @@ -1,19 +1,11 @@ -
-

'Allo, 'Allo<% if(mongoPassportUser) { %> {{ currentUser.name }}<% } %>!

I'm Yeoman
- Always a pleasure scaffolding your apps. + Always a pleasure scaffolding your apps.
+ Speaking of apps, I have taken the liberty of creating a database of applicants for the under-butler position and adding it to the menu above.

-

Splendid!

-
- -
-
-

{{thing.name}}

-

{{thing.info}}

-
+

{{ message }}!