diff --git a/.babelrc b/.babelrc
index bde6914ee..287b76b83 100644
--- a/.babelrc
+++ b/.babelrc
@@ -1,4 +1,10 @@
{
- "presets": ["es2015"],
- "plugins": ["transform-class-properties"]
-}
\ No newline at end of file
+ "plugins": ["@babel/plugin-proposal-class-properties"],
+ "presets": [
+ ["@babel/preset-env", {
+ "targets": {
+ "node": "12"
+ }
+ }]
+ ]
+}
diff --git a/.gitbook/assets/angular-fullstack-logo.svg b/.gitbook/assets/angular-fullstack-logo.svg
new file mode 100644
index 000000000..bf40810ac
--- /dev/null
+++ b/.gitbook/assets/angular-fullstack-logo.svg
@@ -0,0 +1,9045 @@
+
+
+
+
diff --git a/.gitbook/assets/image (1).png b/.gitbook/assets/image (1).png
new file mode 100644
index 000000000..8079c8294
Binary files /dev/null and b/.gitbook/assets/image (1).png differ
diff --git a/.gitbook/assets/image (2).png b/.gitbook/assets/image (2).png
new file mode 100644
index 000000000..467d4479a
Binary files /dev/null and b/.gitbook/assets/image (2).png differ
diff --git a/.gitbook/assets/image (3).png b/.gitbook/assets/image (3).png
new file mode 100644
index 000000000..feed1d2cc
Binary files /dev/null and b/.gitbook/assets/image (3).png differ
diff --git a/.gitbook/assets/image (4).png b/.gitbook/assets/image (4).png
new file mode 100644
index 000000000..faab366dc
Binary files /dev/null and b/.gitbook/assets/image (4).png differ
diff --git a/.gitbook/assets/image (5).png b/.gitbook/assets/image (5).png
new file mode 100644
index 000000000..20a98b6b2
Binary files /dev/null and b/.gitbook/assets/image (5).png differ
diff --git a/.gitbook/assets/image (6).png b/.gitbook/assets/image (6).png
new file mode 100644
index 000000000..dfc1ea68c
Binary files /dev/null and b/.gitbook/assets/image (6).png differ
diff --git a/.gitbook/assets/image (7).png b/.gitbook/assets/image (7).png
new file mode 100644
index 000000000..a3f223f39
Binary files /dev/null and b/.gitbook/assets/image (7).png differ
diff --git a/.gitbook/assets/image.png b/.gitbook/assets/image.png
new file mode 100644
index 000000000..a3f223f39
Binary files /dev/null and b/.gitbook/assets/image.png differ
diff --git a/.gitignore b/.gitignore
index 78a6835b7..88c5c584e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,9 +1,9 @@
node_modules
bower_components
-test/temp
+/generators/*
+/test/*
demo
.idea
.DS_Store
release.txt
-test/fixtures/bower.json
-test/fixtures/package.json
\ No newline at end of file
+static
diff --git a/.npmignore b/.npmignore
index c823223d9..5106adfe8 100644
--- a/.npmignore
+++ b/.npmignore
@@ -1,3 +1,18 @@
angular-fullstack-deps
test
.idea
+src
+scripts
+ISSUE_TEMPLATE.md
+PULL_REQUEST_TEMPLATE.md
+/.travis.yml
+gulpfile.js
+Gruntfile.js
+.jshintrc
+/mocha.conf.js
+/media
+/docs
+/task-utils
+/.git*
+/circle.yml
+/.editorconfig
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 4e2b9e3f8..000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,32 +0,0 @@
-sudo: false
-language: node_js
-node_js:
- - 4.2.3
-env:
- global:
- - SAUCE_USERNAME=fullstack_ci
- - SAUCE_ACCESS_KEY=1a527ca6-4aa5-4618-86ce-0278bf158cbf
-matrix:
- fast_finish: true
- allow_failures:
- - node_js: 5.1.1
-before_install:
- - ./scripts/sauce_connect_setup.sh
- - gem update --system
- - gem install sass --version "=3.3.7"
- - npm install -g bower grunt-cli
-services: mongodb
-cache:
- directories:
- - node_modules
- - test/fixtures/node_modules
- - test/fixtures/bower_components
-notifications:
- webhooks:
- urls:
- - secure: "DhPNqHXuUIeIGE9Ek3+63qhco+4MozXqMZL6dAKoq1MHQ2RAPO6SYIkUYZqDnuWYlwWao2EnTYcDREivIV/m/RnkP9bKlpX/n/RNJe+X4bwFaCU55fVKgkAFn3takSBC5SVoeTWHdWu3WhhqSdioWjT7mlE1wtt/RanSMb5Id8M="
- on_success: change # options: [always|never|change] default: always
- on_failure: always # options: [always|never|change] default: always
- on_start: false # default: false
-git:
- submodules: false
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 065f2f68a..80fb3e1ae 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,620 @@
+
+# [5.0.0-rc.4](https://github.com/angular-fullstack/generator-angular-fullstack/compare/5.0.0-rc.1...v5.0.0-rc.4) (2018-08-11)
+
+
+### Bug Fixes
+
+* **auth:** fix change password form ([4b147a4](https://github.com/angular-fullstack/generator-angular-fullstack/commit/4b147a4)), closes [#2747](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2747)
+* **client:** hotfix for Babel bug ([73d1e29](https://github.com/angular-fullstack/generator-angular-fullstack/commit/73d1e29))
+* **css:** refactor CSS handling ([68c6e39](https://github.com/angular-fullstack/generator-angular-fullstack/commit/68c6e39))
+* **express:** use cors in dev ([cf3c5e5](https://github.com/angular-fullstack/generator-angular-fullstack/commit/cf3c5e5))
+* **gen:test:** refactor gen to fix tests w/ pug ([2080421](https://github.com/angular-fullstack/generator-angular-fullstack/commit/2080421))
+* **package:** pin uws ([ed3b775](https://github.com/angular-fullstack/generator-angular-fullstack/commit/ed3b775))
+* **server:**
+ * fix CSRF for Angular ([9c816ca](https://github.com/angular-fullstack/generator-angular-fullstack/commit/9c816ca))
+ * SequelizeStore requires object with db ([e3cae48](https://github.com/angular-fullstack/generator-angular-fullstack/commit/e3cae48)), closes [#2732](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2732)
+ * wsInitPromise should be passed into then in a function ([ce46519](https://github.com/angular-fullstack/generator-angular-fullstack/commit/ce46519)), closes [#2751](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2751)
+* **webpack:** remove old plugins ([f1d3a7c](https://github.com/angular-fullstack/generator-angular-fullstack/commit/f1d3a7c))
+
+
+### Features
+
+* **app:**
+ * generate and serve pre-gzipped client files ([8f22699](https://github.com/angular-fullstack/generator-angular-fullstack/commit/8f22699))
+ * use mini-css plugin ([3ac870a](https://github.com/angular-fullstack/generator-angular-fullstack/commit/3ac870a))
+* **gen:** add new route subgenerator ([91a13ff](https://github.com/angular-fullstack/generator-angular-fullstack/commit/91a13ff))
+* **package:**
+ * add 'gulp build' as build script ([f572635](https://github.com/angular-fullstack/generator-angular-fullstack/commit/f572635))
+ * add build:server script ([b98d8a8](https://github.com/angular-fullstack/generator-angular-fullstack/commit/b98d8a8))
+ * reload server on changes ([6166123](https://github.com/angular-fullstack/generator-angular-fullstack/commit/6166123))
+* **server:** allow mongo uri env var in dev ([a46a002](https://github.com/angular-fullstack/generator-angular-fullstack/commit/a46a002))
+
+
+### Performance Improvements
+
+* **client:** comment out core-js imports\n\nas most people won't need them ([11decfe](https://github.com/angular-fullstack/generator-angular-fullstack/commit/11decfe))
+
+
+
+
+# [5.0.0-rc.2](https://github.com/angular-fullstack/generator-angular-fullstack/compare/5.0.0-rc.1...v5.0.0-rc.2) (2018-06-02)
+
+
+### Bug Fixes
+
+* **css:** refactor CSS handling ([68c6e39](https://github.com/angular-fullstack/generator-angular-fullstack/commit/68c6e39))
+* **gen:test:** refactor gen to fix tests w/ pug ([2080421](https://github.com/angular-fullstack/generator-angular-fullstack/commit/2080421))
+
+
+### Features
+
+* **gen:** add new route subgenerator ([91a13ff](https://github.com/angular-fullstack/generator-angular-fullstack/commit/91a13ff))
+
+
+
+
+# [5.0.0-rc.1](https://github.com/angular-fullstack/generator-angular-fullstack/compare/5.0.0-beta.1...v5.0.0-rc.1) (2018-03-15)
+
+
+### Bug Fixes
+
+* **gen:** fix .npmignore ([c3bf61f](https://github.com/angular-fullstack/generator-angular-fullstack/commit/c3bf61f))
+
+
+
+
+# [5.0.0-rc.0](https://github.com/angular-fullstack/generator-angular-fullstack/compare/5.0.0-beta.1...v5.0.0-rc.0) (2018-03-08)
+
+
+### Bug Fixes
+
+* **client:** fix some outstanding client bugs ([f4c5471](https://github.com/angular-fullstack/generator-angular-fullstack/commit/f4c5471))
+* **client:auth:guard:** declare `authService` on class ([afc725f](https://github.com/angular-fullstack/generator-angular-fullstack/commit/afc725f))
+* **gen:**
+ * canary cleanup ([96364a7](https://github.com/angular-fullstack/generator-angular-fullstack/commit/96364a7))
+ * don't convert main html file ([8d37569](https://github.com/angular-fullstack/generator-angular-fullstack/commit/8d37569))
+* **package:** add missing comma ([b2a745b](https://github.com/angular-fullstack/generator-angular-fullstack/commit/b2a745b))
+* **seed:** rename index.html to app.html to fix CRSF and token issues ([2e784bf](https://github.com/angular-fullstack/generator-angular-fullstack/commit/2e784bf))
+* **server:** fix express router usage ([542337e](https://github.com/angular-fullstack/generator-angular-fullstack/commit/542337e))
+* **server:auth:** specify digest for pbkdf2 ([689c3fc](https://github.com/angular-fullstack/generator-angular-fullstack/commit/689c3fc)), closes [#2628](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2628)
+* **server:test:** resolve primus in non-dev ([7bed185](https://github.com/angular-fullstack/generator-angular-fullstack/commit/7bed185))
+* **test:**
+ * only save new primus.js in dev ([483dda0](https://github.com/angular-fullstack/generator-angular-fullstack/commit/483dda0))
+ * use babel in `protractor.conf.js` ([ffb16cb](https://github.com/angular-fullstack/generator-angular-fullstack/commit/ffb16cb))
+* misc cleanup ([a1619e6](https://github.com/angular-fullstack/generator-angular-fullstack/commit/a1619e6))
+
+
+### Features
+
+* **client:** add auth-guard service ([a5cbada](https://github.com/angular-fullstack/generator-angular-fullstack/commit/a5cbada))
+* **package:**
+ * add separate client lint script for TS ([d426be7](https://github.com/angular-fullstack/generator-angular-fullstack/commit/d426be7))
+ * add test:server script ([24b6144](https://github.com/angular-fullstack/generator-angular-fullstack/commit/24b6144))
+
+
+# [5.0.0-beta.3](https://github.com/angular-fullstack/generator-angular-fullstack/compare/5.0.0-beta.1...v5.0.0-beta.3) (2017-11-30)
+
+
+### Bug Fixes
+
+* **client:auth:guard:** declare `authService` on class ([afc725f](https://github.com/angular-fullstack/generator-angular-fullstack/commit/afc725f))
+
+
+
+
+# [5.0.0-beta.2](https://github.com/angular-fullstack/generator-angular-fullstack/compare/5.0.0-beta.1...v5.0.0-beta.2) (2017-11-12)
+
+
+### Bug Fixes
+
+* **package:** add missing comma ([b2a745b](https://github.com/angular-fullstack/generator-angular-fullstack/commit/b2a745b))
+* **server:test:** resolve primus in non-dev ([7bed185](https://github.com/angular-fullstack/generator-angular-fullstack/commit/7bed185))
+* **test:**
+ * only save new primus.js in dev ([483dda0](https://github.com/angular-fullstack/generator-angular-fullstack/commit/483dda0))
+ * use babel in `protractor.conf.js` ([ffb16cb](https://github.com/angular-fullstack/generator-angular-fullstack/commit/ffb16cb))
+
+
+### Features
+
+* Upgraded to Angular 5.0.1
+* **client:** add auth-guard service ([a5cbada](https://github.com/angular-fullstack/generator-angular-fullstack/commit/a5cbada))
+
+
+
+
+# [5.0.0-beta.1](https://github.com/angular-fullstack/generator-angular-fullstack/compare/5.0.0-beta.0...v5.0.0-beta.1) (2017-10-17)
+
+
+### Bug Fixes
+
+* **client:** fix thing redirect ([6e1b254](https://github.com/angular-fullstack/generator-angular-fullstack/commit/6e1b254))
+* **client:auth:** fix session re-establish ([31a6ecf](https://github.com/angular-fullstack/generator-angular-fullstack/commit/31a6ecf)), closes [#2625](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2625)
+* **client:test:** fixes for TS ([47b9d3e](https://github.com/angular-fullstack/generator-angular-fullstack/commit/47b9d3e))
+* **gen:**
+ * fix gen issue with flow on ([4f9618a](https://github.com/angular-fullstack/generator-angular-fullstack/commit/4f9618a))
+ * remedy test failure ([f226df9](https://github.com/angular-fullstack/generator-angular-fullstack/commit/f226df9))
+* **server:** swap shrink-ray back out for compression ([e225a67](https://github.com/angular-fullstack/generator-angular-fullstack/commit/e225a67))
+* **test:** disable `main.component.spec.js` ([c5e6db9](https://github.com/angular-fullstack/generator-angular-fullstack/commit/c5e6db9))
+* **ts:** exclude typescript specs files from generating error on transpilling ([46f762e](https://github.com/angular-fullstack/generator-angular-fullstack/commit/46f762e))
+* **webpack:** use a mock for primus in test ([689d0b2](https://github.com/angular-fullstack/generator-angular-fullstack/commit/689d0b2))
+
+
+### Features
+
+* **client:auth:** don't submit forms if invalid ([d967554](https://github.com/angular-fullstack/generator-angular-fullstack/commit/d967554))
+* **gen:** default Flow on ([804a917](https://github.com/angular-fullstack/generator-angular-fullstack/commit/804a917))
+* **package:**
+ * add `start:mongo` convenience script ([101f567](https://github.com/angular-fullstack/generator-angular-fullstack/commit/101f567))
+ * add linting scripts ([8cfe32e](https://github.com/angular-fullstack/generator-angular-fullstack/commit/8cfe32e))
+ * add start scripts ([e2bfff8](https://github.com/angular-fullstack/generator-angular-fullstack/commit/e2bfff8))
+ * add test:client script ([9be904d](https://github.com/angular-fullstack/generator-angular-fullstack/commit/9be904d))
+
+
+
+
+# [5.0.0-alpha.5](https://github.com/angular-fullstack/generator-angular-fullstack/compare/4.1.0...v5.0.0-alpha.5) (2017-05-14)
+
+
+### Bug Fixes
+
+* **client:**
+ * fix a few client code errors ([5535fe3](https://github.com/angular-fullstack/generator-angular-fullstack/commit/5535fe3))
+ * fix loading css ([5d780fe](https://github.com/angular-fullstack/generator-angular-fullstack/commit/5d780fe))
+ * fix upgrade stuff ([01e1054](https://github.com/angular-fullstack/generator-angular-fullstack/commit/01e1054))
+* **client:footer:** fix hardcoded template & style extentions ([c638fb6](https://github.com/angular-fullstack/generator-angular-fullstack/commit/c638fb6)), closes [#2421](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2421)
+* **client:main:** fix add/delete things ([91b920b](https://github.com/angular-fullstack/generator-angular-fullstack/commit/91b920b))
+* **client:navbar:** fix hardcoded template ext ([5e999b2](https://github.com/angular-fullstack/generator-angular-fullstack/commit/5e999b2)), closes [#2469](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2469)
+* **client:userService:** use `id` or `_id` property ([4be3191](https://github.com/angular-fullstack/generator-angular-fullstack/commit/4be3191))
+* **events:** mongoose event registration ([79bdeed](https://github.com/angular-fullstack/generator-angular-fullstack/commit/79bdeed)), closes [#2479](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2479)
+* **gen:**
+ * comment out ngCompnent stuff ([ab1bf13](https://github.com/angular-fullstack/generator-angular-fullstack/commit/ab1bf13)), closes [#2403](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2403)
+ * fix another type stripping; also TS doesn't like default exports ([a55691a](https://github.com/angular-fullstack/generator-angular-fullstack/commit/a55691a))
+* **gen:factory:** fix factory subgen location ([b09cfe5](https://github.com/angular-fullstack/generator-angular-fullstack/commit/b09cfe5)), closes [#2381](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2381)
+* **mocha:** fix server not closing ([2ba3dd8](https://github.com/angular-fullstack/generator-angular-fullstack/commit/2ba3dd8))
+* **package:** move syntax plugins to deps ([c016979](https://github.com/angular-fullstack/generator-angular-fullstack/commit/c016979)), closes [#2405](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2405)
+* **server:**
+ * fix new shared default export ([d4e4a7a](https://github.com/angular-fullstack/generator-angular-fullstack/commit/d4e4a7a))
+ * fix some bluebird warnings ([a84ff90](https://github.com/angular-fullstack/generator-angular-fullstack/commit/a84ff90)), closes [#2412](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2412) [#2363](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2363)
+* **webpack:** fix CSS loader options ([3f7e2b4](https://github.com/angular-fullstack/generator-angular-fullstack/commit/3f7e2b4))
+
+
+### Features
+
+* **app:** convert to Angular 2 ([6c3b307](https://github.com/angular-fullstack/generator-angular-fullstack/commit/6c3b307))
+* **gen:**
+ * add functions for adding TS public/private keywords ([17fea6c](https://github.com/angular-fullstack/generator-angular-fullstack/commit/17fea6c))
+ * consolidate templates, convert html to pug during write ([f6deb25](https://github.com/angular-fullstack/generator-angular-fullstack/commit/f6deb25))
+ * generate js with jscodeshift instead of babel ([bf8f9fc](https://github.com/angular-fullstack/generator-angular-fullstack/commit/bf8f9fc))
+ * replace socket.io w/ primus + uws ([ccea1f3](https://github.com/angular-fullstack/generator-angular-fullstack/commit/ccea1f3))
+ * use new base classes ([3debe1c](https://github.com/angular-fullstack/generator-angular-fullstack/commit/3debe1c))
+
+
+
+
+## [4.2.3](https://github.com/angular-fullstack/generator-angular-fullstack/compare/4.2.2...v4.2.3) (2017-11-29)
+
+This version reverts using shrink-ray by default (for Brotli compression) b/c so many users have has issues installing it.
+
+
+### Bug Fixes
+
+* **seed:** rename index.html to app.html to fix CRSF and token issues ([2e784bf](https://github.com/angular-fullstack/generator-angular-fullstack/commit/2e784bf))
+* **server:auth:** specify digest for pbkdf2 ([689c3fc](https://github.com/angular-fullstack/generator-angular-fullstack/commit/689c3fc)), closes [#2628](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2628)
+
+
+
+
+## [4.2.2](https://github.com/angular-fullstack/generator-angular-fullstack/compare/4.2.0...v4.2.2) (2017-05-25)
+
+
+### Bug Fixes
+
+* **seed:** fix unexpected token ([65a2438](https://github.com/angular-fullstack/generator-angular-fullstack/commit/65a2438)), closes [#2580](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2580)
+
+
+
+
+## [4.2.1](https://github.com/angular-fullstack/generator-angular-fullstack/compare/4.2.0...v4.2.1) (2017-05-22)
+
+
+### Bug Fixes
+
+* **client:auth:** fix isAdmin call ([8ac8821](https://github.com/angular-fullstack/generator-angular-fullstack/commit/8ac8821)), closes [#2561](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2561)
+* **client:auth.service:** fix lodash import ([2dde95d](https://github.com/angular-fullstack/generator-angular-fullstack/commit/2dde95d)), closes [#2549](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2549)
+* **gen:** fix yarn check command ([9ea681c](https://github.com/angular-fullstack/generator-angular-fullstack/commit/9ea681c))
+
+
+
+
+# [4.2.0](https://github.com/angular-fullstack/generator-angular-fullstack/compare/4.1.4...v4.2.0) (2017-04-19)
+
+## Notable Changes
+
+* `node-inspector` has been taken out in favor of Node's integrated `--inspect` flag.
+* @benmarten has taken care of a lot of the lint issues we've seen polluting the console
+* @benmarten also enabled the use of [Yarn](https://yarnpkg.com) if you have it installed. Thanks Ben!
+* Various other fixes. See the [comparison](https://github.com/angular-fullstack/generator-angular-fullstack/compare/4.1.4...4.2.0) for the full list.
+
+### Bug Fixes
+
+* **angular-validation-match:** Integration with Babel & Typescript ([#2517](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2517)) ([9db9918](https://github.com/angular-fullstack/generator-angular-fullstack/commit/9db9918))
+
+
+
+
+## [4.1.4](https://github.com/angular-fullstack/generator-angular-fullstack/compare/4.1.2...v4.1.4) (2017-03-01)
+
+
+### Bug Fixes
+
+* **client:footer:**
+ * fix docs link (html) ([8d69c7a](https://github.com/angular-fullstack/generator-angular-fullstack/commit/8d69c7a)), closes [#2501](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2501)
+ * fix docs link (pug) ([190a121](https://github.com/angular-fullstack/generator-angular-fullstack/commit/190a121))
+* **events:** mongoose event registration ([e3ed67f](https://github.com/angular-fullstack/generator-angular-fullstack/commit/e3ed67f)), closes [#2479](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2479)
+* **webpack:**
+ * don't use html-plugin in test ([959c31c](https://github.com/angular-fullstack/generator-angular-fullstack/commit/959c31c)), closes [#2374](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2374)
+ * use raw-loader for pug files ([a212236](https://github.com/angular-fullstack/generator-angular-fullstack/commit/a212236))
+
+
+### Performance Improvements
+
+* **test:endpoint:**
+ * reduce number of eslint commands run ([6faa7f0](https://github.com/angular-fullstack/generator-angular-fullstack/commit/6faa7f0))
+ * remove unused imports ([95a5aab](https://github.com/angular-fullstack/generator-angular-fullstack/commit/95a5aab))
+* **test:main:** reduce number of app generations ([d42d0b6](https://github.com/angular-fullstack/generator-angular-fullstack/commit/d42d0b6))
+
+
+
+
+## [4.1.3](https://github.com/angular-fullstack/generator-angular-fullstack/compare/4.1.2...v4.1.3) (2017-02-11)
+
+
+### Bug Fixes
+
+* **events:** mongoose event registration ([e3ed67f](https://github.com/angular-fullstack/generator-angular-fullstack/commit/e3ed67f)), closes [#2479](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2479)
+* **webpack:** don't use html-plugin in test ([959c31c](https://github.com/angular-fullstack/generator-angular-fullstack/commit/959c31c)), closes [#2374](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2374)
+
+
+### Performance Improvements
+
+* **test:endpoint:**
+ * reduce number of eslint commands run ([6faa7f0](https://github.com/angular-fullstack/generator-angular-fullstack/commit/6faa7f0))
+ * remove unused imports ([95a5aab](https://github.com/angular-fullstack/generator-angular-fullstack/commit/95a5aab))
+* **test:main:** reduce number of app generations ([d42d0b6](https://github.com/angular-fullstack/generator-angular-fullstack/commit/d42d0b6))
+
+
+
+
+## [4.1.2](https://github.com/angular-fullstack/generator-angular-fullstack/compare/4.1.1...v4.1.2) (2017-01-09)
+
+
+### Bug Fixes
+
+* **css:** fix stylus-loader options ([641646c](https://github.com/angular-fullstack/generator-angular-fullstack/commit/641646c))
+* **eslint:** hides global variable warnings ([#2448](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2448)) ([6aae4f5](https://github.com/angular-fullstack/generator-angular-fullstack/commit/6aae4f5))
+* **sql:** Fix form field not displaying sequalize error ([d2cc15a](https://github.com/angular-fullstack/generator-angular-fullstack/commit/d2cc15a)), closes [#2400](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2400)
+* **webpack:css:** disable css-loader sourceMap option ([d48f0b0](https://github.com/angular-fullstack/generator-angular-fullstack/commit/d48f0b0)), closes [#2188](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2188)
+
+
+
+
+## [4.1.1](https://github.com/angular-fullstack/generator-angular-fullstack/compare/4.1.0...v4.1.1) (2016-12-08)
+
+
+## Notable Changes
+
+* Upgraded to Angular 1.6
+
+
+### Bug Fixes
+
+* **gen:factory:** fix factory subgen location ([b09cfe5](https://github.com/angular-fullstack/generator-angular-fullstack/commit/b09cfe5)), closes [#2381](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2381)
+
+
+
+
+# [4.1.0](https://github.com/angular-fullstack/generator-angular-fullstack/compare/4.0.5...v4.1.0) (2016-09-30)
+
+
+## Notable Changes
+
+* We've bumped some of the Babel deps to `^6.16.0`. This should fix the issues everyone's been seeing with class properties being stripped when using the default settings of Babel without Flow types.
+
+
+### Bug Fixes
+
+* **client:modal:** Fix unknown provider error ([68b7b69](https://github.com/angular-fullstack/generator-angular-fullstack/commit/68b7b69)), closes [#2247](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2247)
+
+
+### Features
+
+* **client:footer:**
+ * add documentation link ([ad44ee2](https://github.com/angular-fullstack/generator-angular-fullstack/commit/ad44ee2))
+ * modify footer ([3ca3cd5](https://github.com/angular-fullstack/generator-angular-fullstack/commit/3ca3cd5))
+* **gen:gulp:** port changelog code to gulp ([045abfb](https://github.com/angular-fullstack/generator-angular-fullstack/commit/045abfb))
+
+
+
+
+## [4.0.5](https://github.com/angular-fullstack/generator-angular-fullstack/compare/4.0.4...v4.0.5) (2016-09-15)
+
+
+### Bug Fixes
+
+* **client:auth:** fix hasOwnProperty instances, fix User usage ([#2232](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2232)) ([f41e420](https://github.com/angular-fullstack/generator-angular-fullstack/commit/f41e420)), closes [#2232](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2232) [#2212](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2212)
+* **client:oauthButtons:** add ngInject ([#2209](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2209)) ([9ce58e8](https://github.com/angular-fullstack/generator-angular-fullstack/commit/9ce58e8)), closes [#2206](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2206)
+* **endpoint:controller:** fix findOneAndUpdate syntax ([1c2a219](https://github.com/angular-fullstack/generator-angular-fullstack/commit/1c2a219)), closes [#2221](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2221)
+* **heroku:** Changed port variable to capital letters so heroku recognize it ([44dccba](https://github.com/angular-fullstack/generator-angular-fullstack/commit/44dccba)), closes [#2185](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2185)
+* **karma:** remove extra `require` ([c188229](https://github.com/angular-fullstack/generator-angular-fullstack/commit/c188229)), closes [#2219](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2219)
+* **server:twitter:** make sure IDs are strings ([5991a72](https://github.com/angular-fullstack/generator-angular-fullstack/commit/5991a72)), closes [#1997](https://github.com/angular-fullstack/generator-angular-fullstack/issues/1997)
+* **socket:** add ngInject ([#2208](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2208)) ([b530695](https://github.com/angular-fullstack/generator-angular-fullstack/commit/b530695)), closes [#2203](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2203)
+
+
+
+
+## [4.0.4](https://github.com/angular-fullstack/generator-angular-fullstack/compare/4.0.3...v4.0.4) (2016-09-01)
+
+
+### Bug Fixes
+
+* **webpack:**
+ * conditionally exclude ui-bootstrap ([dd131d9](https://github.com/angular-fullstack/generator-angular-fullstack/commit/dd131d9))
+ * fix webpack vendor import ([#2177](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2177)) ([aa32054](https://github.com/angular-fullstack/generator-angular-fullstack/commit/aa32054)), closes [#2177](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2177)
+
+
+
+
+## [4.0.3](https://github.com/angular-fullstack/generator-angular-fullstack/compare/4.0.2...v4.0.3) (2016-09-01)
+
+
+### Bug Fixes
+
+* **gen:** fix doc img generation\n\nAdd gulp task to copy images to gh-pages ([5bb43be](https://github.com/angular-fullstack/generator-angular-fullstack/commit/5bb43be))
+* **gen:heroku:** fix module export, gen base ([8e50326](https://github.com/angular-fullstack/generator-angular-fullstack/commit/8e50326)), closes [#2148](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2148)
+* **webpack:** fix bootstrap-sass import path ([bae1c86](https://github.com/angular-fullstack/generator-angular-fullstack/commit/bae1c86))
+
+
+
+
+## [4.0.2](https://github.com/angular-fullstack/generator-angular-fullstack/compare/4.0.1...v4.0.2) (2016-09-01)
+
+
+### Bug Fixes
+
+* **client:socket.service:** import lodash named exports ([231e500](https://github.com/angular-fullstack/generator-angular-fullstack/commit/231e500))
+* **gulp:build:** remove protractor typings ([#2144](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2144)) ([b9abc58](https://github.com/angular-fullstack/generator-angular-fullstack/commit/b9abc58))
+
+
+### Features
+
+* **docs:** add daux.io docs ([f1e7a87](https://github.com/angular-fullstack/generator-angular-fullstack/commit/f1e7a87))
+* **gen:app:**
+ * add eslint to the yo write stream ([85921be](https://github.com/angular-fullstack/generator-angular-fullstack/commit/85921be)), closes [#2157](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2157)
+ * run eslint w/ fix on both client & server ([c5ab431](https://github.com/angular-fullstack/generator-angular-fullstack/commit/c5ab431))
+* **gen:gulp:** add TODO tasks in gulpfile. rm 2 old grunt tasks ([1e25de7](https://github.com/angular-fullstack/generator-angular-fullstack/commit/1e25de7))
+
+
+
+
+## [4.0.0](https://github.com/angular-fullstack/generator-angular-fullstack/compare/3.7.6...v4.0.0) (2016-08-08)
+
+
+## Notable Changes
+
+### [Webpack](http://webpack.github.io/)
+* No more Bower
+* Webpack is a Module Bundler for the front-end.
+* Everything starts in `client/app.js`. It imports (using CommonJS / ES2015 imports) everything else needed from there.
+* Whenever we create a new Angular 1 module, we export its name, and import that name in another module up the tree, all the way to `client/app.js`. This design pattern allows for easy lazy-loading.
+
+### Gulp v Grunt
+Grunt has been removed.
+* Gulp is significantly faster to run
+* Gulp focuses on programmatic configuration, which makes it a breeze to configure compared to Grunt's JSON-config-focused configuration.
+* Gulp development is much more active, with Gulp 4.0.0 hopefully being released soon.
+
+### ESLint
+JSHint + JSCS have been replaced with ESLint. ESLint provides a gigantic amount of rules, and is easily pluggable with many plugins. It uses Espree. Also, JSCS has merged with ESLint.
+
+### Types
+Flow support has been added. TypeScript type errors have been fixed.
+
+### Async/Sync Auth methods
+The following methods from the client Auth service have been split into two: `getCurrentUser`, `isLoggedIn`, `hasRole`, `isAdmin`. The reason that these methods could be both synchronous and asynchronous depending on how many arguments were passed is because they were called from Angular templates. Now, the Angular templates call the sync form of these methods (e.x. `getCurrentUserSync`), and the original functions are now only async.
+
+### Constants
+The task runner no longer takes care of creating an Angular module for config constants. It is taken care of by webpack now (the `shared.js` files is now just `require`d)
+
+### Endpoint PUT/PATCH
+PUT now defaults to an upsert. PATCH now actually does an HTTP PATCH.
+
+### -Livereload +Browsersync
+Livereload has been removed in favor of [Browsersync](https://www.browsersync.io/)
+
+
+
+
+# [3.8.0](https://github.com/angular-fullstack/generator-angular-fullstack/compare/3.7.6...v3.8.0) (2016-09-15)
+
+
+### Bug Fixes
+
+* **authorization:** header workaround for IE11 ([2362103](https://github.com/angular-fullstack/generator-angular-fullstack/commit/2362103)), closes [#2051](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2051)
+* **endpoint:controller:** wrap saveUpdates in an if(entity) statement ([31c0a79](https://github.com/angular-fullstack/generator-angular-fullstack/commit/31c0a79)), closes [#2052](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2052) [#2059](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2059)
+* **grunt:**
+ * add comma ([485c44b](https://github.com/angular-fullstack/generator-angular-fullstack/commit/485c44b))
+ * run express:prod on production port ([aac61b2](https://github.com/angular-fullstack/generator-angular-fullstack/commit/aac61b2)), closes [#1814](https://github.com/angular-fullstack/generator-angular-fullstack/issues/1814)
+* **gulp:** fix plain css generation ([#2013](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2013)) ([54479fc](https://github.com/angular-fullstack/generator-angular-fullstack/commit/54479fc)), closes [#2013](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2013)
+* **gulpfile:** gulp-filter[@4](https://github.com/4).0.0 need "dot:true" option ([1fbf24b](https://github.com/angular-fullstack/generator-angular-fullstack/commit/1fbf24b)), closes [#2146](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2146) [#2151](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2151)
+* **server:** return express stuff ([81ea8fa](https://github.com/angular-fullstack/generator-angular-fullstack/commit/81ea8fa))
+
+
+### Features
+
+* **gen:** add configurable ports ([#2005](https://github.com/angular-fullstack/generator-angular-fullstack/issues/2005)) ([50e6d0c](https://github.com/angular-fullstack/generator-angular-fullstack/commit/50e6d0c))
+
+
+
+
+## [3.7.6](https://github.com/angular-fullstack/generator-angular-fullstack/compare/3.7.5...v3.7.6) (2016-06-21)
+
+
+### Notable Changes
+
+* Add deprecation warning about Grunt
+* Bumped a few generator dependencies
+
+
+
+## [3.7.5](https://github.com/angular-fullstack/generator-angular-fullstack/compare/3.7.4...v3.7.5) (2016-06-02)
+
+
+### Bug Fixes
+
+* **build:** fix templateCache generation on gulpfile ([#1936](https://github.com/angular-fullstack/generator-angular-fullstack/issues/1936)) ([#1942](https://github.com/angular-fullstack/generator-angular-fullstack/issues/1942)) ([0286817](https://github.com/angular-fullstack/generator-angular-fullstack/commit/0286817)), closes [#1936](https://github.com/angular-fullstack/generator-angular-fullstack/issues/1936) [#1942](https://github.com/angular-fullstack/generator-angular-fullstack/issues/1942) [#1936](https://github.com/angular-fullstack/generator-angular-fullstack/issues/1936)
+
+
+### Features
+
+* **genBase:** show raw stdout for yo check ([#1944](https://github.com/angular-fullstack/generator-angular-fullstack/issues/1944)) ([7ae3829](https://github.com/angular-fullstack/generator-angular-fullstack/commit/7ae3829))
+
+
+
+
+## [3.7.4](https://github.com/angular-fullstack/generator-angular-fullstack/compare/3.7.3...v3.7.4) (2016-05-25)
+
+
+### Bug Fixes
+
+* **build:** fix up PR 1896 ([3113a3e](https://github.com/angular-fullstack/generator-angular-fullstack/commit/3113a3e))
+* **ie:** IE11 log in works for ports 80 and 443 ([414b80a](https://github.com/angular-fullstack/generator-angular-fullstack/commit/414b80a)), closes [#1880](https://github.com/angular-fullstack/generator-angular-fullstack/issues/1880) [#1896](https://github.com/angular-fullstack/generator-angular-fullstack/issues/1896)
+
+
+
+
+## [3.7.2](https://github.com/angular-fullstack/generator-angular-fullstack/compare/3.7.1...v3.7.2) (2016-05-15)
+
+
+### Bug Fixes
+
+* **gen:app:** fix insight askPermission ([f6f1fb6](https://github.com/angular-fullstack/generator-angular-fullstack/commit/f6f1fb6)), closes [#1889](https://github.com/angular-fullstack/generator-angular-fullstack/issues/1889)
+
+
+
+
+## [3.7.1](https://github.com/angular-fullstack/generator-angular-fullstack/compare/3.7.0...v3.7.1) (2016-05-15)
+
+
+### Bug Fixes
+
+* **gen:** move bluebird to dependencies ([7d87697](https://github.com/angular-fullstack/generator-angular-fullstack/commit/7d87697)), closes [#1888](https://github.com/angular-fullstack/generator-angular-fullstack/issues/1888)
+
+
+
+
+# [3.7.0](https://github.com/angular-fullstack/generator-angular-fullstack/compare/3.6.1...v3.7.0) (2016-05-15)
+
+
+### Notable Changes
+* The Angular component sub-generator from generator-ng-component was added
+* The generator no longer uses the babel require hook at runtime
+* The generator's template files are now passed through Babel at scaffold time. This allows for things like removing type annotations if the user so chooses.
+* TypeScript uses typings instead of tsd
+
+
+### Bug Fixes
+
+* **client:** remove no-empty from tslint.json ([eafc4e0](https://github.com/angular-fullstack/generator-angular-fullstack/commit/eafc4e0))
+* **client:navbar.controller:** refactor EJS, exclude constructor if empty ([a75b1d4](https://github.com/angular-fullstack/generator-angular-fullstack/commit/a75b1d4))
+* **e2e:main:** fix yeoman.png regex ([4b4db99](https://github.com/angular-fullstack/generator-angular-fullstack/commit/4b4db99))
+* **express:** import `connect-mongo/es5` if node < 4 ([63fb77f](https://github.com/angular-fullstack/generator-angular-fullstack/commit/63fb77f)), closes [#1844](https://github.com/angular-fullstack/generator-angular-fullstack/issues/1844)
+* **gen:app:** only include `typings.json` with TS ([6f82220](https://github.com/angular-fullstack/generator-angular-fullstack/commit/6f82220))
+* **gen:endpoint:**
+ * return promise ([6b30ef7](https://github.com/angular-fullstack/generator-angular-fullstack/commit/6b30ef7))
+ * typo ([0787039](https://github.com/angular-fullstack/generator-angular-fullstack/commit/0787039))
+* **gen:grunt:** update paths ([104efc6](https://github.com/angular-fullstack/generator-angular-fullstack/commit/104efc6))
+* **gen:gulp:babel:** return the two merged streams ([3748953](https://github.com/angular-fullstack/generator-angular-fullstack/commit/3748953))
+* **gen:gulp:clean:** also clean test dir ([aedb37e](https://github.com/angular-fullstack/generator-angular-fullstack/commit/aedb37e))
+* **gen:gulp:updateFixtures:** fix saving as private/public ([a2cecab](https://github.com/angular-fullstack/generator-angular-fullstack/commit/a2cecab))
+* **gen:test:endpoint:** `jshint` function also checks that the file exists ([17d9985](https://github.com/angular-fullstack/generator-angular-fullstack/commit/17d9985))
+* **gen:test:main:** fix sql e2e ([a9d238c](https://github.com/angular-fullstack/generator-angular-fullstack/commit/a9d238c))
+* **grunt:** exclude jshint config if using TypeScript ([54d4ebd](https://github.com/angular-fullstack/generator-angular-fullstack/commit/54d4ebd))
+* **gulp:** fix racing condition for copy:constant ([f07b451](https://github.com/angular-fullstack/generator-angular-fullstack/commit/f07b451)), closes [#1830](https://github.com/angular-fullstack/generator-angular-fullstack/issues/1830)
+* **package:**
+ * always make html2js a dependency ([bdf1e4a](https://github.com/angular-fullstack/generator-angular-fullstack/commit/bdf1e4a)), closes [#1722](https://github.com/angular-fullstack/generator-angular-fullstack/issues/1722)
+ * grunt-injector 1.0.0 is broken ([3391299](https://github.com/angular-fullstack/generator-angular-fullstack/commit/3391299))
+ * include gulp devDependency ([c857b27](https://github.com/angular-fullstack/generator-angular-fullstack/commit/c857b27))
+* **server:**
+ * MONGOLAB_URI -> MONGODB_URI ([ae313df](https://github.com/angular-fullstack/generator-angular-fullstack/commit/ae313df)), closes [#1838](https://github.com/angular-fullstack/generator-angular-fullstack/issues/1838)
+* **server:oauth:**
+ * fix mongoose validation when re-login using twitter oauth ([5f8805d](https://github.com/angular-fullstack/generator-angular-fullstack/commit/5f8805d))
+
+
+### Features
+
+* **client:auth:** add first type definition (`callback: Function`) ([7ed2585](https://github.com/angular-fullstack/generator-angular-fullstack/commit/7ed2585))
+* **gen:**
+ * add component generator ([bf649ab](https://github.com/angular-fullstack/generator-angular-fullstack/commit/bf649ab)), closes [#1711](https://github.com/angular-fullstack/generator-angular-fullstack/issues/1711)
+ * also build test dir (just like generators dir) ([e09fb76](https://github.com/angular-fullstack/generator-angular-fullstack/commit/e09fb76))
+ * default to gulp, mocha ([4cc2da6](https://github.com/angular-fullstack/generator-angular-fullstack/commit/4cc2da6))
+* **gen:app:** run all client files through Babel & JS Beautifier ([1d4ce11](https://github.com/angular-fullstack/generator-angular-fullstack/commit/1d4ce11))
+* **gen:gulp:**
+ * add installFixtures task ([04a7878](https://github.com/angular-fullstack/generator-angular-fullstack/commit/04a7878))
+ * add mocha ([ead201a](https://github.com/angular-fullstack/generator-angular-fullstack/commit/ead201a))
+ * port updateFixtures to Gulp (hot damn is it faster :fire:) ([94d69da](https://github.com/angular-fullstack/generator-angular-fullstack/commit/94d69da))
+* **gen:test:**
+ * add endpoint path name test ([0b36375](https://github.com/angular-fullstack/generator-angular-fullstack/commit/0b36375))
+ * add endpoint-specific tests ([887476f](https://github.com/angular-fullstack/generator-angular-fullstack/commit/887476f))
+* **grunt:less:** add sourcemap options ([#1868](https://github.com/angular-fullstack/generator-angular-fullstack/issues/1868)) ([55c9a18](https://github.com/angular-fullstack/generator-angular-fullstack/commit/55c9a18)), closes [#1765](https://github.com/angular-fullstack/generator-angular-fullstack/issues/1765)
+* **gulp:ts:** inject client .ts test files automatically into config file. ([17cb4e4](https://github.com/angular-fullstack/generator-angular-fullstack/commit/17cb4e4)), closes [#1828](https://github.com/angular-fullstack/generator-angular-fullstack/issues/1828)
+
+
+
+
+# [3.6.1](https://github.com/angular-fullstack/generator-angular-fullstack/compare/3.6.0...v3.6.1) (2016-04-23)
+
+
+### Bug Fixes
+
+* **package:** revert to Grunt 0.4.5 if user chooses Grunt ([1cc91a3](https://github.com/angular-fullstack/generator-angular-fullstack/commit/1cc91a3)), closes [#1815](https://github.com/angular-fullstack/generator-angular-fullstack/issues/1815)
+
+
+
+
+# [3.6.0](https://github.com/angular-fullstack/generator-angular-fullstack/compare/3.5.0...v3.6.0) (2016-04-21)
+
+
+### Bug Fixes
+
+* **gen:heroku:** allow for grunt or gulp ([954baa4](https://github.com/angular-fullstack/generator-angular-fullstack/commit/954baa4))
+* **gen:openshift:** allow for grunt or gulp ([2f1a229](https://github.com/angular-fullstack/generator-angular-fullstack/commit/2f1a229))
+* **gulp:** build images before rev-replace ([4139694](https://github.com/angular-fullstack/generator-angular-fullstack/commit/4139694))
+* **gulp:copy:constant:** fix output dir ([a5e31cf](https://github.com/angular-fullstack/generator-angular-fullstack/commit/a5e31cf)), closes [#1748](https://github.com/angular-fullstack/generator-angular-fullstack/issues/1748)
+* **gulp:inject:** prevent `'inject:css'` from showing up twice ([09b4f01](https://github.com/angular-fullstack/generator-angular-fullstack/commit/09b4f01))
+* **gulp:inject:css:** remove leading `/` ([6de6272](https://github.com/angular-fullstack/generator-angular-fullstack/commit/6de6272))
+* **gulp:jshint:** include jshint alongside gulp-jshint ([978f6ba](https://github.com/angular-fullstack/generator-angular-fullstack/commit/978f6ba))
+* **gulp:serve:**
+ * add `env:all` ([27531fb](https://github.com/angular-fullstack/generator-angular-fullstack/commit/27531fb)), closes [#1779](https://github.com/angular-fullstack/generator-angular-fullstack/issues/1779)
+ * remove extra comma ([d9d9f62](https://github.com/angular-fullstack/generator-angular-fullstack/commit/d9d9f62))
+* **gulp:styles:** fix styles task for plain CSS ([dc72c33](https://github.com/angular-fullstack/generator-angular-fullstack/commit/dc72c33)), closes [#1747](https://github.com/angular-fullstack/generator-angular-fullstack/issues/1747)
+* **gulp:test:client:** move around some `'tsd'` tasks ([86c7510](https://github.com/angular-fullstack/generator-angular-fullstack/commit/86c7510))
+* **gulp:wiredep:** copy `exclude` array code from Grunt ([2997e34](https://github.com/angular-fullstack/generator-angular-fullstack/commit/2997e34)), closes [#1739](https://github.com/angular-fullstack/generator-angular-fullstack/issues/1739)
+* **livereload:** ignore api routes and specific non-html files ([c6a396b](https://github.com/angular-fullstack/generator-angular-fullstack/commit/c6a396b)), closes [#1636](https://github.com/angular-fullstack/generator-angular-fullstack/issues/1636) [#1764](https://github.com/angular-fullstack/generator-angular-fullstack/issues/1764)
+* **server:user:spec:** replace `context` with `describe` ([5716660](https://github.com/angular-fullstack/generator-angular-fullstack/commit/5716660))
+* **ts:**
+ * exclude ui-router.mock.ts from tsconfig.client.test.json if using ngroute ([3e40776](https://github.com/angular-fullstack/generator-angular-fullstack/commit/3e40776))
+ * fix typo of gulp's typescript test configuration file ([023b261](https://github.com/angular-fullstack/generator-angular-fullstack/commit/023b261))
+* **user:** fix email and password validation ([474a3a1](https://github.com/angular-fullstack/generator-angular-fullstack/commit/474a3a1))
+
+### Features
+
+* **GitHub:** add issue and PR templates ([79b1db7](https://github.com/angular-fullstack/generator-angular-fullstack/commit/79b1db7))
+* **gulp:**
+ * add serve:debug, add gulp-node-inspector ([f6eb26d](https://github.com/angular-fullstack/generator-angular-fullstack/commit/f6eb26d))
+ * port `grunt buildcontrol` tasks over to gulp ([3221678](https://github.com/angular-fullstack/generator-angular-fullstack/commit/3221678))
+
+
+
## [3.5.0](https://github.com/angular-fullstack/generator-angular-fullstack/compare/3.4.2...v3.5.0) (2016-03-20)
diff --git a/Gruntfile.js b/Gruntfile.js
index ca5178fc7..2dfe12118 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -1,5 +1,3 @@
-'use strict';
-
var shell = require('shelljs');
var child_process = require('child_process');
var Q = require('q');
@@ -12,32 +10,11 @@ module.exports = function (grunt) {
var gitCmd = gruntUtils.gitCmd;
var gitCmdAsync = gruntUtils.gitCmdAsync;
- // Load grunt tasks automatically, when needed
- require('jit-grunt')(grunt, {
- buildcontrol: 'grunt-build-control'
- });
-
grunt.initConfig({
config: {
demo: 'demo'
},
pkg: grunt.file.readJSON('package.json'),
- conventionalChangelog: {
- options: {
- changelogOpts: {
- // conventional-changelog options go here
- preset: 'angular'
- },
- writerOpts: {
- // conventional-changelog-writer options go here
- finalizeContext: gruntUtils.conventionalChangelog.finalizeContext,
- commitPartial: gruntUtils.conventionalChangelog.commitPartial
- }
- },
- release: {
- src: 'CHANGELOG.md'
- }
- },
release: {
options: {
commitMessage: '<%= version %>',
@@ -51,17 +28,6 @@ module.exports = function (grunt) {
npm: false
}
},
- updateSubmodules: {
- options: {
- modules: ['angular-fullstack-deps']
- }
- },
- commitNgFullstackDeps: {
- options: {
- cwd: 'angular-fullstack-deps',
- files: ['package.json', 'bower.json']
- }
- },
stage: {
options: {
files: ['CHANGELOG.md', 'angular-fullstack-deps']
@@ -82,43 +48,6 @@ module.exports = function (grunt) {
}
}
},
- jshint: {
- options: {
- curly: false,
- node: true
- },
- all: ['Gruntfile.js', '*/index.js']
- },
- env: {
- fast: {
- SKIP_E2E: true
- }
- },
- mochaTest: {
- test: {
- src: [
- 'test/*.js'
- ],
- options: {
- reporter: 'spec',
- timeout: 120000
- }
- }
- },
- clean: {
- demo: {
- files: [{
- dot: true,
- src: [
- '<%= config.demo %>/*',
- '!<%= config.demo %>/readme.md',
- '!<%= config.demo %>/node_modules',
- '!<%= config.demo %>/.git',
- '!<%= config.demo %>/dist'
- ]
- }]
- }
- },
david: {
gen: {
options: {}
@@ -136,26 +65,6 @@ module.exports = function (grunt) {
gitCmd(['add'].concat(files), {}, this.async());
});
- grunt.registerTask('updateSubmodules', function() {
- grunt.config.requires('updateSubmodules.options.modules');
- var modules = grunt.config.get('updateSubmodules').options.modules;
-
- Q()
- .then(gitCmdAsync(['submodule', 'update', '--init', '--recursive']))
- .then(function() {
- var thens = [];
- for (var i = 0, modulesLength = modules.length; i < modulesLength; i++) {
- var opts = {cwd: modules[i]};
- thens.push(gitCmdAsync(['checkout', 'master'], opts));
- thens.push(gitCmdAsync(['fetch'], opts));
- thens.push(gitCmdAsync(['pull'], opts));
- }
- return thens.reduce(Q.when, Q());
- })
- .catch(grunt.fail.fatal.bind(grunt.fail))
- .finally(this.async());
- });
-
grunt.registerTask('commitNgFullstackDeps', function() {
grunt.config.requires(
'commitNgFullstackDeps.options.files',
@@ -201,7 +110,7 @@ module.exports = function (grunt) {
testing: 'jasmine',
auth: true,
oauth: ['googleAuth', 'twitterAuth'],
- socketio: true
+ ws: true
};
var deps = [
@@ -261,63 +170,6 @@ module.exports = function (grunt) {
}
});
- grunt.registerTask('updateFixtures', 'updates package and bower fixtures', function(target) {
- var genVer = require('./package.json').version;
- var dest = __dirname + ((target === 'deps') ? '/angular-fullstack-deps/' : '/test/fixtures/');
- var appName = (target === 'deps') ? 'angular-fullstack-deps' : 'tempApp';
-
- var processJson = function(s, d) {
- // read file, strip all ejs conditionals, and parse as json
- var json = JSON.parse(fs.readFileSync(path.resolve(s), 'utf8').replace(/<%(.*)%>/g, ''));
- // set properties
- json.name = appName, json.version = genVer;
- if (target === 'deps') { json.private = false; }
- // stringify json and write it to the destination
- fs.writeFileSync(path.resolve(d), JSON.stringify(json, null, 2));
- };
-
- processJson('app/templates/_package.json', dest + 'package.json');
- processJson('app/templates/_bower.json', dest + 'bower.json');
- });
-
- grunt.registerTask('installFixtures', 'install package and bower fixtures', function() {
- var done = this.async();
-
- shell.cd('test/fixtures');
- grunt.log.ok('installing npm dependencies for generated app');
- child_process.exec('npm install --quiet', {cwd: '../fixtures'}, function (error, stdout, stderr) {
-
- grunt.log.ok('installing bower dependencies for generated app');
- child_process.exec('bower install', {cwd: '../fixtures'}, function (error, stdout, stderr) {
-
- if(!process.env.SAUCE_USERNAME) {
- grunt.log.ok('running npm run-script update-webdriver');
- child_process.exec('npm run-script update-webdriver', function() {
- shell.cd('../../');
- done();
- });
- } else {
- shell.cd('../../');
- done();
- }
- })
- });
- });
-
- grunt.registerTask('test', function(target, option) {
- if (target === 'fast') {
- grunt.task.run([
- 'env:fast'
- ]);
- }
-
- return grunt.task.run([
- 'updateFixtures',
- 'installFixtures',
- 'mochaTest'
- ])
- });
-
grunt.registerTask('deps', function(target) {
if (!target || target === 'app') grunt.task.run(['updateFixtures']);
grunt.task.run(['david:' + (target || '')]);
diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md
index a024d2708..cf31e70c0 100644
--- a/ISSUE_TEMPLATE.md
+++ b/ISSUE_TEMPLATE.md
@@ -1,3 +1,5 @@
+ - [ ] I understand that GitHub issues are not for tech support, but for questions specific to this generator, bug reports, and feature requests.
+
Item | Version
----- | -----
generator-angular-fullstack | x.x.x
@@ -9,10 +11,9 @@ etc | etc
Item | Answer
----- | -----
Transpiler | Babel / TypeScript
-Markup | HTML / Jade
+Markup | HTML / Pug
CSS | CSS / LESS / SCSS / Stylus
Router | ngRoute / ui-router
-Build Tool | Grunt / Gulp
Client Tests | Jasmine / Mocha
DB | MongoDB / SQL
Auth | Y / N
diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md
index 519809893..c6b7b868e 100644
--- a/PULL_REQUEST_TEMPLATE.md
+++ b/PULL_REQUEST_TEMPLATE.md
@@ -1,2 +1,3 @@
- [ ] I have read the [Contributing Documents](https://github.com/DaftMonk/generator-angular-fullstack/blob/master/contributing.md)
-- [ ] My commit(s) follow the [AngularJS commit message guidelines](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/)
\ No newline at end of file
+- [ ] My commit(s) follow the [AngularJS commit message guidelines](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/)
+- [ ] The generator's tests pass (`generator-angular-fullstack$ npm test`)
diff --git a/README.md b/README.md
new file mode 100644
index 000000000..3d77289bc
--- /dev/null
+++ b/README.md
@@ -0,0 +1,120 @@
+# The Angular Full-Stack Generator
+
+
+
+ [](https://www.npmjs.com/package/generator-angular-fullstack) [](https://david-dm.org/angular-fullstack/generator-angular-fullstack) [](https://david-dm.org/angular-fullstack/generator-angular-fullstack#type=dev) [](https://gitter.im/angular-fullstack/generator-angular-fullstack)
+
+> Yeoman generator for creating MEAN/SEAN stack applications, using ES2017, MongoDB/SQL, Express, Angular, and Node - lets you quickly set up a project following best practices.
+
+### Generated project:
+
+[](https://david-dm.org/angular-fullstack/angular-fullstack-deps) [](https://david-dm.org/angular-fullstack/angular-fullstack-deps?type=dev) [](https://snyk.io/package/npm/angular-fullstack-deps)
+
+## Usage
+
+Install `yo`, `gulp-cli`, and `generator-angular-fullstack`:
+
+```text
+npm install -g yo gulp-cli generator-angular-fullstack
+```
+
+**Please note**: If you run into trouble compiling native add-ons during the installation, follow [`node-gyp`](https://github.com/nodejs/node-gyp)'s short guide on [required compilation tools](https://github.com/nodejs/node-gyp#installation).
+
+Then, to run your app \(make sure the MongoDB daemon is running if you selected Mongo\), run the following to start your server:
+
+```bash
+npm run start:server
+```
+
+and the following to start the Webpack dev server for the front-end:
+
+```bash
+npm run start:client
+```
+
+The Webpack server will tell you which port to access the app at \(usually [http://localhost:8080/](http://localhost:8080/)\).
+
+Run `yo angular-fullstack`
+
+```text
+yo angular-fullstack
+```
+
+**See the** [**Getting Started**](https://angular-fullstack.github.io/get-started/) **guide for more information.**
+
+## Prerequisites
+
+* MongoDB - Download and Install [MongoDB](https://www.mongodb.com/download-center#community) - If you plan on scaffolding your project with mongoose, you'll need mongoDB to be installed and have the `mongod` process running.
+ * If you have [Docker](https://www.docker.com/) installed, you can easily run a test database with `docker run -p 27017:27017 --name afs-mongo -d mongo`
+* The project's JavaScript is written in ECMAScript 2015. If you're unfamiliar with the latest changes to the specification for JavaScript, check out [http://es6-features.org/](http://es6-features.org/)
+
+## Supported Configurations
+
+**General**
+
+* Build Systems: `Gulp`
+* Testing:
+ * `Jasmine`
+ * `Mocha + Chai + Sinon`
+ * Chai assertions:
+ * `Expect`
+ * `Should`
+
+**Client**
+
+* Scripts: `JavaScript (Babel)`, `TypeScript`
+* Module Systems: `Webpack`
+* Markup: `HTML`, `Pug`
+* Stylesheets: `CSS`, `Stylus`, `Sass`, `Less`
+* CSS Frameworks: `Bootstrap`
+ * Option to include `UI Bootstrap`
+
+**Server**
+
+* Scripts: `JavaScript (Babel)`, `TypeScript` \(planned\)
+* Database:
+ * `None`,
+ * `MongoDB`, `SQL`
+ * Authentication boilerplate: `Yes`, `No`
+ * oAuth integrations: `Facebook`, `Twitter`, `Google`
+ * Socket.io integration: `Yes`, `No`
+
+## Generators
+
+Available generators:
+
+* App
+ * [angular-fullstack](https://angular-fullstack.github.io/generators/app/) \(aka [angular-fullstack:app](https://angular-fullstack.github.io/generators/app/)\)
+* Server Side
+ * [angular-fullstack:endpoint](https://angular-fullstack.github.io/generators/endpoint)
+* Client Side \(via [generator-angular-fullstack-component](https://github.com/angular-fullstack/generator-angular-fullstack-component)\)
+ * [angular-fullstack:route](https://angular-fullstack.github.io/generators/route)
+* To be re-updated:
+ * [angular-fullstack:component](https://angular-fullstack.github.io/generators/component)
+ * [angular-fullstack:controller](https://angular-fullstack.github.io/generators/controller)
+ * [angular-fullstack:filter](https://angular-fullstack.github.io/generators/filter)
+ * [angular-fullstack:directive](https://angular-fullstack.github.io/generators/directive)
+ * [angular-fullstack:service](https://angular-fullstack.github.io/generators/service)
+ * [angular-fullstack:provider](https://angular-fullstack.github.io/generators/service)
+ * [angular-fullstack:factory](https://angular-fullstack.github.io/generators/service)
+ * [angular-fullstack:decorator](https://angular-fullstack.github.io/generators/decorator)
+* Deployment
+ * [angular-fullstack:openshift](https://angular-fullstack.github.io/generators/openshift)
+ * [angular-fullstack:heroku](https://angular-fullstack.github.io/generators/heroku)
+
+## Documentation
+
+Check out our [documentation home page](https://awk34.gitbook.io/generator-angular-fullstack).
+
+## Contribute
+
+See the [contributing docs](https://github.com/angular-fullstack/generator-angular-fullstack/blob/master/contributing.md)
+
+When submitting an issue, please follow the [Yeoman issue guidelines](https://github.com/yeoman/yeoman/blob/master/contributing.md#issue-submission). Especially important is to make sure Yeoman is up-to-date, and providing the command or commands that cause the issue, as well as any stack traces.
+
+## License
+
+[BSD license](http://opensource.org/licenses/bsd-license.php)
+
+[](https://awk34.gitbook.io/generator-angular-fullstack)
+
diff --git a/SUMMARY.md b/SUMMARY.md
new file mode 100644
index 000000000..f7897f126
--- /dev/null
+++ b/SUMMARY.md
@@ -0,0 +1,32 @@
+# Table of contents
+
+* [The Angular Full-Stack Generator](README.md)
+
+## Getting Started
+
+* [Pre-Requisites](getting-started/pre-requisites.md)
+* [Installation](getting-started/installation.md)
+* [Running](getting-started/running.md)
+* [Project Overview](getting-started/project-overview.md)
+
+## Developing
+
+* [Overview](developing/overview.md)
+* [Adding a Route](developing/adding-a-route.md)
+
+## Deployment
+
+* [Manual Deployment](deployment/manual-deployment.md)
+* [Google Cloud Deployment](deployment/untitled-1.md)
+* [index](deployment/untitled.md)
+
+## Generators
+
+* [App](generators/app.md)
+* [Endpoint](generators/endpoint.md)
+
+## Contributing
+
+* [Releasing a New Version](contributing/releasing-a-new-version.md)
+* [Commit Style](contributing/untitled-1.md)
+
diff --git a/angular-fullstack-deps b/angular-fullstack-deps
index 030eb1f86..d0b7c8633 160000
--- a/angular-fullstack-deps
+++ b/angular-fullstack-deps
@@ -1 +1 @@
-Subproject commit 030eb1f864101f121015147c1f1ba7ec86ebaf11
+Subproject commit d0b7c86332f3ea3091332f307b10141ff90e4ad7
diff --git a/app/generator.js b/app/generator.js
deleted file mode 100644
index c74d42b2f..000000000
--- a/app/generator.js
+++ /dev/null
@@ -1,469 +0,0 @@
-'use strict';
-
-import fs from 'fs';
-import path from 'path';
-import chalk from 'chalk';
-import {Base} from 'yeoman-generator';
-import {genBase} from '../generator-base';
-import insight from '../insight-init';
-import {exec} from 'child_process';
-
-export default class Generator extends Base {
- constructor(...args) {
- super(...args);
-
- this.argument('name', { type: String, required: false });
-
- this.option('skip-install', {
- desc: 'Do not install dependencies',
- type: Boolean,
- defaults: false
- });
-
- this.option('app-suffix', {
- desc: 'Allow a custom suffix to be added to the module name',
- type: String,
- defaults: 'App'
- });
- }
-
- get initializing() {
- return {
- init: function () {
- var cb = this.async();
-
- this.config.set('generatorVersion', this.rootGeneratorVersion());
- this.filters = {};
-
- // init shared generator properies and methods
- genBase(this);
-
- if(process.env.CI) {
- insight.optOut = true;
- return cb();
- } else if(insight.optOut === undefined) {
- insight.askPermission(null, cb);
- } else {
- return cb();
- }
- },
- info: function () {
- insight.track('generator', this.rootGeneratorVersion());
- insight.track('node', process.version);
- exec('npm --version', (err, stdin, stderr) => {
- if(err || stderr.length > 0) return insight.track('npm', 'error');
- else return insight.track('npm', stdin.toString().trim());
- });
- insight.track('platform', process.platform);
-
- this.log(this.yoWelcome);
- this.log('Out of the box I create an AngularJS app with an Express server.\n');
- },
- checkForConfig: function() {
- var cb = this.async();
- var existingFilters = this.config.get('filters');
-
- if(existingFilters) {
- this.prompt([{
- type: 'confirm',
- name: 'skipConfig',
- message: 'Existing .yo-rc configuration found, would you like to use it?',
- default: true,
- }], answers => {
- this.skipConfig = answers.skipConfig;
-
- if(this.skipConfig) {
- insight.track('skipConfig', 'true');
- this.filters = existingFilters;
-
- this.scriptExt = this.filters.ts ? 'ts' : 'js';
- this.templateExt = this.filters.jade ? 'jade' : 'html';
- this.styleExt = this.filters.sass ? 'scss' :
- this.filters.less ? 'less' :
- this.filters.stylus ? 'styl' :
- 'css';
- } else {
- insight.track('skipConfig', 'false');
- this.filters = {};
- this.forceConfig = true;
- this.config.set('filters', this.filters);
- this.config.forceSave();
- }
-
- cb();
- });
- } else {
- cb();
- }
- }
- };
- }
-
- get prompting() {
- return {
- clientPrompts: function() {
- if(this.skipConfig) return;
- var cb = this.async();
-
- this.log('# Client\n');
-
- this.prompt([{
- type: 'list',
- name: 'transpiler',
- message: 'What would you like to write scripts with?',
- choices: ['Babel', 'TypeScript'],
- filter: val => {
- return {
- 'Babel': 'babel',
- 'TypeScript': 'ts'
- }[val];
- }
- }, {
- type: 'list',
- name: 'markup',
- message: 'What would you like to write markup with?',
- choices: ['HTML', 'Jade'],
- filter: val => val.toLowerCase()
- }, {
- type: 'list',
- name: 'stylesheet',
- default: 1,
- message: 'What would you like to write stylesheets with?',
- choices: ['CSS', 'Sass', 'Stylus', 'Less'],
- filter: val => val.toLowerCase()
- }, {
- type: 'list',
- name: 'router',
- default: 1,
- message: 'What Angular router would you like to use?',
- choices: ['ngRoute', 'uiRouter'],
- filter: val => val.toLowerCase()
- }, {
- type: 'confirm',
- name: 'bootstrap',
- message: 'Would you like to include Bootstrap?'
- }, {
- type: 'confirm',
- name: 'uibootstrap',
- message: 'Would you like to include UI Bootstrap?',
- when: answers => answers.bootstrap
- }], answers => {
- this.filters.js = true;
- this.filters[answers.transpiler] = true;
- insight.track('transpiler', answers.transpiler);
-
- this.filters[answers.markup] = true;
- insight.track('markup', answers.markup);
-
- this.filters[answers.stylesheet] = true;
- insight.track('stylesheet', answers.stylesheet);
-
- this.filters[answers.router] = true;
- insight.track('router', answers.router);
-
- this.filters.bootstrap = !!answers.bootstrap;
- insight.track('bootstrap', !!answers.bootstrap);
-
- this.filters.uibootstrap = !!answers.uibootstrap;
- insight.track('uibootstrap', !!answers.uibootstrap);
-
- this.scriptExt = answers.transpiler === 'ts' ? 'ts' : 'js';
- this.templateExt = answers.markup;
-
- var styleExt = {sass: 'scss', stylus: 'styl'}[answers.stylesheet];
- this.styleExt = styleExt ? styleExt : answers.stylesheet;
-
- cb();
- });
- },
- serverPrompts: function() {
- if(this.skipConfig) return;
- var cb = this.async();
- var self = this;
-
- this.log('\n# Server\n');
-
- this.prompt([{
- type: 'checkbox',
- name: 'odms',
- message: 'What would you like to use for data modeling?',
- choices: [{
- value: 'mongoose',
- name: 'Mongoose (MongoDB)',
- checked: true
- }, {
- value: 'sequelize',
- name: 'Sequelize (MySQL, SQLite, MariaDB, PostgreSQL)',
- checked: false
- }]
- }, {
- type: 'list',
- name: 'models',
- message: 'What would you like to use for the default models?',
- choices: [ 'Mongoose', 'Sequelize' ],
- filter: val => val.toLowerCase(),
- when: answers => answers.odms && answers.odms.length > 1
- }, {
- type: 'confirm',
- name: 'auth',
- message: 'Would you scaffold out an authentication boilerplate?',
- when: answers => answers.odms && answers.odms.length !== 0
- }, {
- type: 'checkbox',
- name: 'oauth',
- message: 'Would you like to include additional oAuth strategies?',
- when: answers => answers.auth,
- choices: [{
- value: 'googleAuth',
- name: 'Google',
- checked: false
- }, {
- value: 'facebookAuth',
- name: 'Facebook',
- checked: false
- }, {
- value: 'twitterAuth',
- name: 'Twitter',
- checked: false
- }]
- }, {
- type: 'confirm',
- name: 'socketio',
- message: 'Would you like to use socket.io?',
- // to-do: should not be dependent on ODMs
- when: answers => answers.odms && answers.odms.length !== 0,
- default: true
- }], answers => {
- if(answers.socketio) this.filters.socketio = true;
- insight.track('socketio', !!answers.socketio);
-
- if(answers.auth) this.filters.auth = true;
- insight.track('auth', !!answers.auth);
-
- if(answers.odms && answers.odms.length > 0) {
- var models;
- if(!answers.models) {
- models = answers.odms[0];
- } else {
- models = answers.models;
- }
- this.filters.models = true;
- this.filters[models + 'Models'] = true;
- answers.odms.forEach(odm => {
- this.filters[odm] = true;
- });
- insight.track('oauth', !!answers.oauth);
- } else {
- this.filters.noModels = true;
- }
- insight.track('odms', answers.odms && answers.odms.length > 0);
- insight.track('mongoose', !!this.filters.mongoose);
- insight.track('mongooseModels', !!this.filters.mongooseModels);
- insight.track('sequelize', !!this.filters.sequelize);
- insight.track('sequelizeModels', !!this.filters.sequelizeModels);
-
- if(answers.oauth) {
- if(answers.oauth.length) this.filters.oauth = true;
- answers.oauth.forEach(oauthStrategy => {
- this.filters[oauthStrategy] = true;
- });
- }
- insight.track('oauth', !!this.filters.oauth);
- insight.track('google-oauth', !!this.filters['googleAuth']);
- insight.track('facebook-oauth', !!this.filters['facebookAuth']);
- insight.track('twitter-oauth', !!this.filters['twitterAuth']);
-
- cb();
- });
- },
- projectPrompts: function() {
- if(this.skipConfig) return;
- var cb = this.async();
- var self = this;
-
- this.log('\n# Project\n');
-
- this.prompt([{
- type: 'list',
- name: 'buildtool',
- message: 'Would you like to use Gulp or Grunt?',
- choices: ['Grunt', 'Gulp'],
- default: 0,
- filter: val => val.toLowerCase()
- }, {
- type: 'list',
- name: 'testing',
- message: 'What would you like to write tests with?',
- choices: [ 'Jasmine', 'Mocha + Chai + Sinon'],
- filter: function(val) {
- return {
- 'Jasmine': 'jasmine',
- 'Mocha + Chai + Sinon': 'mocha'
- }[val];
- }
- }, {
- type: 'list',
- name: 'chai',
- message: 'What would you like to write Chai assertions with?',
- choices: ['Expect', 'Should'],
- filter: val => val.toLowerCase(),
- when: answers => answers.testing === 'mocha'
- }], answers => {
- this.filters[answers.buildtool] = true;
- insight.track('buildtool', answers.buildtool);
-
- this.filters[answers.testing] = true;
- insight.track('testing', answers.testing);
- if(answers.testing === 'mocha') {
- this.filters.jasmine = false;
- this.filters.should = false;
- this.filters.expect = false;
- this.filters[answers.chai] = true;
- insight.track('chai-assertions', answers.chai);
- }
- if(answers.testing === 'jasmine') {
- this.filters.mocha = false;
- this.filters.should = false;
- this.filters.expect = false;
- }
-
- cb();
- });
- }
- };
- }
-
- get configuring() {
- return {
- saveSettings: function() {
- if(this.skipConfig) return;
- this.config.set('endpointDirectory', 'server/api/');
- this.config.set('insertRoutes', true);
- this.config.set('registerRoutesFile', 'server/routes.js');
- this.config.set('routesNeedle', '// Insert routes below');
-
- this.config.set('routesBase', '/api/');
- this.config.set('pluralizeRoutes', true);
-
- this.config.set('insertSockets', true);
- this.config.set('registerSocketsFile', 'server/config/socketio.js');
- this.config.set('socketsNeedle', '// Insert sockets below');
-
- this.config.set('insertModels', true);
- this.config.set('registerModelsFile', 'server/sqldb/index.js');
- this.config.set('modelsNeedle', '// Insert models below');
-
- this.config.set('filters', this.filters);
- this.config.forceSave();
- },
- ngComponent: function() {
- if(this.skipConfig) return;
- var appPath = 'client/app/';
- var extensions = [];
- var filters = [
- 'ngroute',
- 'uirouter',
- 'jasmine',
- 'mocha',
- 'expect',
- 'should'
- ].filter(v => this.filters[v]);
-
- if(this.filters.ngroute) filters.push('ngroute');
- if(this.filters.uirouter) filters.push('uirouter');
- if(this.filters.babel) extensions.push('babel');
- if(this.filters.ts) extensions.push('ts');
- if(this.filters.js) extensions.push('js');
- if(this.filters.html) extensions.push('html');
- if(this.filters.jade) extensions.push('jade');
- if(this.filters.css) extensions.push('css');
- if(this.filters.stylus) extensions.push('styl');
- if(this.filters.sass) extensions.push('scss');
- if(this.filters.less) extensions.push('less');
-
- filters.push('es6'); // Generate ES6 syntax code
-
- this.composeWith('ng-component', {
- options: {
- 'routeDirectory': appPath,
- 'directiveDirectory': appPath,
- 'filterDirectory': appPath,
- 'serviceDirectory': appPath,
- 'filters': filters,
- 'extensions': extensions,
- 'basePath': 'client',
- 'forceConfig': this.forceConfig
- }
- }, { local: require.resolve('generator-ng-component/app/index.js') });
- },
- ngModules: function() {
- var angModules = [
- `'${this.scriptAppName}.constants'`,
- "'ngCookies'",
- "'ngResource'",
- "'ngSanitize'"
- ];
- if(this.filters.ngroute) angModules.push("'ngRoute'");
- if(this.filters.socketio) angModules.push("'btford.socket-io'");
- if(this.filters.uirouter) angModules.push("'ui.router'");
- if(this.filters.uibootstrap) angModules.push("'ui.bootstrap'");
- if(this.filters.auth) {
- angModules.unshift(`'${this.scriptAppName}.admin'`);
- angModules.unshift(`'${this.scriptAppName}.auth'`);
- angModules.push("'validation.match'");
- }
-
- this.angularModules = '\n ' + angModules.join(',\n ') +'\n';
- }
- };
- }
-
- get default() {
- return {};
- }
-
- get writing() {
- return {
- generateProject: function() {
- let self = this;
- this.sourceRoot(path.join(__dirname, './templates'));
- this.processDirectory('.', '.', function(dest) {
- if(self.filters.ts && dest.indexOf('client') > -1 && dest.indexOf('.json') === -1) {
- dest = dest.replace('.js', '.ts');
- }
-
- return dest;
- });
- },
- generateEndpoint: function() {
- var models;
- if(this.filters.mongooseModels) {
- models = 'mongoose';
- } else if(this.filters.sequelizeModels) {
- models = 'sequelize';
- }
- this.composeWith('angular-fullstack:endpoint', {
- options: {
- route: '/api/things',
- models: models
- },
- args: ['thing']
- });
- }
- };
- }
-
- get install() {
- return {
- installDeps: function() {
- this.installDependencies({
- skipInstall: this.options['skip-install']
- });
- }
- };
- }
-
- get end() {
- return {};
- }
-}
diff --git a/app/index.js b/app/index.js
deleted file mode 100644
index e4df68f08..000000000
--- a/app/index.js
+++ /dev/null
@@ -1,9 +0,0 @@
-'use strict';
-
-// Register the Babel require hook
-require('babel-register')({
- only: /generator-angular-fullstack\/(?!node_modules)/
-});
-
-// Export the generator
-module.exports = require('./generator').default;
diff --git a/app/templates/.bowerrc b/app/templates/.bowerrc
deleted file mode 100644
index 666f34745..000000000
--- a/app/templates/.bowerrc
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "directory": "client/bower_components"
-}
diff --git a/app/templates/.jscsrc b/app/templates/.jscsrc
deleted file mode 100644
index 8923ad53e..000000000
--- a/app/templates/.jscsrc
+++ /dev/null
@@ -1,48 +0,0 @@
-{
- "excludeFiles": [
- "client/app/app.constant.js"
- ],
- "esnext": true,
- "maximumLineLength": {
- "value": 100,
- "allowComments": true,
- "allowRegex": true
- },
- "disallowMixedSpacesAndTabs": true,
- "disallowMultipleLineStrings": true,
- "disallowNewlineBeforeBlockStatements": true,
- "disallowSpaceAfterObjectKeys": true,
- "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
- "disallowSpaceBeforeBinaryOperators": [","],
- "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
- "disallowSpacesInAnonymousFunctionExpression": {
- "beforeOpeningRoundBrace": true
- },
- "disallowSpacesInFunctionDeclaration": {
- "beforeOpeningRoundBrace": true
- },
- "disallowSpacesInNamedFunctionExpression": {
- "beforeOpeningRoundBrace": true
- },
- "disallowSpacesInsideArrayBrackets": true,
- "disallowSpacesInsideParentheses": true,
- "disallowTrailingComma": true,
- "disallowTrailingWhitespace": true,
- "requireCommaBeforeLineBreak": true,
- "requireLineFeedAtFileEnd": true,
- "requireSpaceAfterBinaryOperators": ["?", ":", "+", "-", "/", "*", "%", "==", "===", "!=", "!==", ">", ">=", "<", "<=", "&&", "||"],
- "requireSpaceBeforeBinaryOperators": ["?", ":", "+", "-", "/", "*", "%", "==", "===", "!=", "!==", ">", ">=", "<", "<=", "&&", "||"],
- "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"],
- "requireSpaceBeforeBlockStatements": true,
- "requireSpacesInConditionalExpression": {
- "afterTest": true,
- "beforeConsequent": true,
- "afterConsequent": true,
- "beforeAlternate": true
- },
- "requireSpacesInFunction": {
- "beforeOpeningCurlyBrace": true
- },
- "validateLineBreaks": "LF",
- "validateParameterSeparator": ", "
-}
diff --git a/app/templates/.travis.yml b/app/templates/.travis.yml
deleted file mode 100644
index dba453567..000000000
--- a/app/templates/.travis.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-language: node_js
-node_js:
- - 4.2.3
-matrix:
- fast_finish: true
- allow_failures:
- - node_js: 5.1.1
-before_script:
- - npm install -g bower grunt-cli<% if (filters.sass) { %>
- - gem install sass<% } %>
- - bower install
-services: mongodb
diff --git a/app/templates/Gruntfile(grunt).js b/app/templates/Gruntfile(grunt).js
deleted file mode 100644
index a39fd5d18..000000000
--- a/app/templates/Gruntfile(grunt).js
+++ /dev/null
@@ -1,1010 +0,0 @@
-// Generated on <%= (new Date).toISOString().split('T')[0] %> using <%= rootGeneratorName() %> <%= rootGeneratorVersion() %>
-'use strict';
-
-module.exports = function (grunt) {
- var localConfig;
- try {
- localConfig = require('./server/config/local.env');
- } catch(e) {
- localConfig = {};
- }
-
- // Load grunt tasks automatically, when needed
- require('jit-grunt')(grunt, {
- express: 'grunt-express-server',
- useminPrepare: 'grunt-usemin',
- ngtemplates: 'grunt-angular-templates',
- cdnify: 'grunt-google-cdn',
- protractor: 'grunt-protractor-runner',
- buildcontrol: 'grunt-build-control',
- istanbul_check_coverage: 'grunt-mocha-istanbul',
- ngconstant: 'grunt-ng-constant'
- });
-
- // Time how long tasks take. Can help when optimizing build times
- require('time-grunt')(grunt);
-
- // Define the configuration for all the tasks
- grunt.initConfig({
-
- // Project settings
- pkg: grunt.file.readJSON('package.json'),
- yeoman: {
- // configurable paths
- client: require('./bower.json').appPath || 'client',
- server: 'server',
- dist: 'dist'
- },
- express: {
- options: {
- port: process.env.PORT || 9000
- },
- dev: {
- options: {
- script: '<%%= yeoman.server %>',
- debug: true
- }
- },
- prod: {
- options: {
- script: '<%%= yeoman.dist %>/<%%= yeoman.server %>'
- }
- }
- },
- open: {
- server: {
- url: 'http://localhost:<%%= express.options.port %>'
- }
- },
- watch: {<% if(filters.babel) { %>
- babel: {
- files: ['<%%= yeoman.client %>/{app,components}/**/!(*.spec|*.mock).js'],
- tasks: ['newer:babel:client']
- },<% } %><% if(filters.ts) { %>
- ts: {
- files: ['<%%= yeoman.client %>/{app,components}/**/!(*.spec|*.mock).ts'],
- tasks: ['ts:client']
- },<% } %>
- ngconstant: {
- files: ['<%%= yeoman.server %>/config/environment/shared.js'],
- tasks: ['ngconstant']
- },
- injectJS: {
- files: [
- '<%%= yeoman.client %>/{app,components}/**/!(*.spec|*.mock).<%= scriptExt %>',
- '!<%%= yeoman.client %>/app/app.js'
- ],
- tasks: ['injector:scripts']
- },
- injectCss: {
- files: ['<%%= yeoman.client %>/{app,components}/**/*.css'],
- tasks: ['injector:css']
- },
- mochaTest: {
- files: ['<%%= yeoman.server %>/**/*.{spec,integration}.<%= scriptExt %>'],
- tasks: ['env:test', 'mochaTest']
- },
- jsTest: {
- files: ['<%%= yeoman.client %>/{app,components}/**/*.{spec,mock}.<%= scriptExt %>'],
- tasks: [<% if(filters.babel) { %>'newer:jshint:all'<% } if(filters.ts) { %>'newer:tslint:all', 'newer:ts:client_test',<% } %>, 'wiredep:test', 'karma']
- },<% if (filters.stylus) { %>
- injectStylus: {
- files: ['<%%= yeoman.client %>/{app,components}/**/*.styl'],
- tasks: ['injector:stylus']
- },
- stylus: {
- files: ['<%%= yeoman.client %>/{app,components}/**/*.styl'],
- tasks: ['stylus', 'postcss']
- },<% } if (filters.sass) { %>
- injectSass: {
- files: ['<%%= yeoman.client %>/{app,components}/**/*.{scss,sass}'],
- tasks: ['injector:sass']
- },
- sass: {
- files: ['<%%= yeoman.client %>/{app,components}/**/*.{scss,sass}'],
- tasks: ['sass', 'postcss']
- },<% } if (filters.less) { %>
- injectLess: {
- files: ['<%%= yeoman.client %>/{app,components}/**/*.less'],
- tasks: ['injector:less']
- },
- less: {
- files: ['<%%= yeoman.client %>/{app,components}/**/*.less'],
- tasks: ['less', 'postcss']
- },<% } if (filters.jade) { %>
- jade: {
- files: ['<%%= yeoman.client %>/{app,components}/**/*.jade'],
- tasks: ['jade']
- },<% } %>
- gruntfile: {
- files: ['Gruntfile.js']
- },
- livereload: {
- files: [
- '{.tmp,<%%= yeoman.client %>}/{app,components}/**/*.{css,html}',
- '{.tmp,<%%= yeoman.client %>}/{app,components}/**/!(*.spec|*.mock).<%= scriptExt %>',
- '<%%= yeoman.client %>/assets/images/{,*//*}*.{png,jpg,jpeg,gif,webp,svg}'
- ],
- options: {
- livereload: true
- }
- },
- express: {
- files: ['<%%= yeoman.server %>/**/*.{js,json}'],
- tasks: ['express:dev', 'wait'],
- options: {
- livereload: true,
- spawn: false //Without this option specified express won't be reloaded
- }
- },
- bower: {
- files: ['bower.json'],
- tasks: ['wiredep']
- },
- },
-
- // Make sure code styles are up to par and there are no obvious mistakes
- jshint: {
- options: {
- jshintrc: '<%%= yeoman.client %>/.jshintrc',
- reporter: require('jshint-stylish')
- },
- server: {
- options: {
- jshintrc: '<%%= yeoman.server %>/.jshintrc'
- },
- src: ['<%%= yeoman.server %>/**/!(*.spec|*.integration).js']
- },
- serverTest: {
- options: {
- jshintrc: '<%%= yeoman.server %>/.jshintrc-spec'
- },
- src: ['<%%= yeoman.server %>/**/*.{spec,integration}.js']
- },
- all: ['<%%= yeoman.client %>/{app,components}/**/!(*.spec|*.mock|app.constant).js'],
- test: {
- src: ['<%%= yeoman.client %>/{app,components}/**/*.{spec,mock}.js']
- }
- },<% if(filters.ts) { %>
-
- tslint: {
- options: {
- configuration: '<%%= yeoman.client %>/tslint.json'
- },
- all: {
- src: ['<%%= yeoman.client %>/{app,components}/**/!(*.spec|*.mock).ts']
- }
- },<% } %>
-
- jscs: {
- options: {
- config: ".jscsrc"
- },
- main: {
- files: {
- src: [
- '<%%= yeoman.client %>/app/**/*.js',
- '<%%= yeoman.server %>/**/*.js'
- ]
- }
- }
- },
-
- // Empties folders to start fresh
- clean: {
- dist: {
- files: [{
- dot: true,
- src: [
- '.tmp',
- '<%%= yeoman.dist %>/!(.git*|.openshift|Procfile)**'
- ]
- }]
- },
- server: '.tmp'
- },
-
- // Add vendor prefixed styles
- postcss: {
- options: {
- map: true,
- processors: [
- require('autoprefixer')({browsers: ['last 2 version']})
- ]
- },
- dist: {
- files: [{
- expand: true,
- cwd: '.tmp/',
- src: '{,*/}*.css',
- dest: '.tmp/'
- }]
- }
- },
-
- // Debugging with node inspector
- 'node-inspector': {
- custom: {
- options: {
- 'web-host': 'localhost'
- }
- }
- },
-
- // Use nodemon to run server in debug mode with an initial breakpoint
- nodemon: {
- debug: {
- script: '<%%= yeoman.server %>',
- options: {
- nodeArgs: ['--debug-brk'],
- env: {
- PORT: process.env.PORT || 9000
- },
- callback: function (nodemon) {
- nodemon.on('log', function (event) {
- console.log(event.colour);
- });
-
- // opens browser on initial server start
- nodemon.on('config:update', function () {
- setTimeout(function () {
- require('open')('http://localhost:8080/debug?port=5858');
- }, 500);
- });
- }
- }
- }
- },
-
- // Automatically inject Bower components into the app and karma.conf.js
- wiredep: {
- options: {
- exclude: [<% if(filters.uibootstrap) { %>
- /bootstrap.js/,<% } %>
- '/json3/',
- '/es5-shim/'<% if(!filters.css) { %>,
- /font-awesome\.css/<% if(filters.bootstrap) { %>,
- /bootstrap\.css/<% if(filters.sass) { %>,
- /bootstrap-sass-official/<% } if(filters.oauth) { %>,
- /bootstrap-social\.css/<% }}} %>
- ]
- },
- client: {
- src: '<%%= yeoman.client %>/index.html',
- ignorePath: '<%%= yeoman.client %>/',
- },
- test: {
- src: './karma.conf.js',
- devDependencies: true
- }
- },
-
- // Renames files for browser caching purposes
- filerev: {
- dist: {
- src: [
- '<%%= yeoman.dist %>/<%%= yeoman.client %>/!(bower_components){,*/}*.{js,css}',
- '<%%= yeoman.dist %>/<%%= yeoman.client %>/assets/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
- ]
- }
- },
-
- // Reads HTML for usemin blocks to enable smart builds that automatically
- // concat, minify and revision files. Creates configurations in memory so
- // additional tasks can operate on them
- useminPrepare: {
- html: ['<%%= yeoman.client %>/index.html'],
- options: {
- dest: '<%%= yeoman.dist %>/<%%= yeoman.client %>'
- }
- },
-
- // Performs rewrites based on rev and the useminPrepare configuration
- usemin: {
- html: ['<%%= yeoman.dist %>/<%%= yeoman.client %>/{,!(bower_components)/**/}*.html'],
- css: ['<%%= yeoman.dist %>/<%%= yeoman.client %>/!(bower_components){,*/}*.css'],
- js: ['<%%= yeoman.dist %>/<%%= yeoman.client %>/!(bower_components){,*/}*.js'],
- options: {
- assetsDirs: [
- '<%%= yeoman.dist %>/<%%= yeoman.client %>',
- '<%%= yeoman.dist %>/<%%= yeoman.client %>/assets/images'
- ],
- // This is so we update image references in our ng-templates
- patterns: {
- css: [
- [/(assets\/images\/.*?\.(?:gif|jpeg|jpg|png|webp|svg))/gm, 'Update the CSS to reference our revved images']
- ],
- js: [
- [/(assets\/images\/.*?\.(?:gif|jpeg|jpg|png|webp|svg))/gm, 'Update the JS to reference our revved images']
- ]
- }
- }
- },
-
- // The following *-min tasks produce minified files in the dist folder
- imagemin: {
- dist: {
- files: [{
- expand: true,
- cwd: '<%%= yeoman.client %>/assets/images',
- src: '{,*/}*.{png,jpg,jpeg,gif,svg}',
- dest: '<%%= yeoman.dist %>/<%%= yeoman.client %>/assets/images'
- }]
- }
- },
-
- // Allow the use of non-minsafe AngularJS files. Automatically makes it
- // minsafe compatible so Uglify does not destroy the ng references
- ngAnnotate: {
- dist: {
- files: [{
- expand: true,
- cwd: '.tmp/concat',
- src: '**/*.js',
- dest: '.tmp/concat'
- }]
- }
- },
-
- // Dynamically generate angular constant `appConfig` from
- // `server/config/environment/shared.js`
- ngconstant: {
- options: {
- name: '<%= scriptAppName %>.constants',
- dest: '<%%= yeoman.client %>/app/app.constant.js',
- deps: [],
- wrap: true,
- configPath: '<%%= yeoman.server %>/config/environment/shared'
- },
- app: {
- constants: function() {
- return {
- appConfig: require('./' + grunt.config.get('ngconstant.options.configPath'))
- };
- }
- }
- },
-
- // Package all the html partials into a single javascript payload
- ngtemplates: {
- options: {
- // This should be the name of your apps angular module
- module: '<%= scriptAppName %>',
- htmlmin: {
- collapseBooleanAttributes: true,
- collapseWhitespace: true,
- removeAttributeQuotes: true,
- removeEmptyAttributes: true,
- removeRedundantAttributes: true,
- removeScriptTypeAttributes: true,
- removeStyleLinkTypeAttributes: true
- },
- usemin: 'app/app.js'
- },
- main: {
- cwd: '<%%= yeoman.client %>',
- src: ['{app,components}/**/*.html'],
- dest: '.tmp/templates.js'
- },
- tmp: {
- cwd: '.tmp',
- src: ['{app,components}/**/*.html'],
- dest: '.tmp/tmp-templates.js'
- }
- },
-
- // Replace Google CDN references
- cdnify: {
- dist: {
- html: ['<%%= yeoman.dist %>/<%%= yeoman.client %>/*.html']
- }
- },
-
- // Copies remaining files to places other tasks can use
- copy: {
- dist: {
- files: [{
- expand: true,
- dot: true,
- cwd: '<%%= yeoman.client %>',
- dest: '<%%= yeoman.dist %>/<%%= yeoman.client %>',
- src: [
- '*.{ico,png,txt}',
- '.htaccess',
- 'bower_components/**/*',
- 'assets/images/{,*/}*.{webp}',
- 'assets/fonts/**/*',
- 'index.html'
- ]
- }, {
- expand: true,
- cwd: '.tmp/images',
- dest: '<%%= yeoman.dist %>/<%%= yeoman.client %>/assets/images',
- src: ['generated/*']
- }, {
- expand: true,
- dest: '<%%= yeoman.dist %>',
- src: [
- 'package.json',
- '<%%= yeoman.server %>/**/*',
- '!<%%= yeoman.server %>/config/local.env.sample.js'
- ]
- }]
- },
- styles: {
- expand: true,
- cwd: '<%%= yeoman.client %>',
- dest: '.tmp/',
- src: ['{app,components}/**/*.css']
- }<% if(filters.ts) { %>,
- constant: {
- expand: true,
- cwd: '<%%= yeoman.client %>',
- dest: '.tmp/',
- src: ['app/app.constant.js']
- }<% } %>
- },
-
- buildcontrol: {
- options: {
- dir: '<%%= yeoman.dist %>',
- commit: true,
- push: true,
- connectCommits: false,
- message: 'Built %sourceName% from commit %sourceCommit% on branch %sourceBranch%'
- },
- heroku: {
- options: {
- remote: 'heroku',
- branch: 'master'
- }
- },
- openshift: {
- options: {
- remote: 'openshift',
- branch: 'master'
- }
- }
- },
-
- // Run some tasks in parallel to speed up the build process
- concurrent: {
- pre: [<% if (filters.stylus) { %>
- 'injector:stylus',<% } if (filters.less) { %>
- 'injector:less',<% } if (filters.sass) { %>
- 'injector:sass',<% } %>
- 'ngconstant'<% if(filters.ts) { %>,
- 'copy:constant'<% } %>
- ],
- server: [<% if(filters.babel) { %>
- 'newer:babel:client',<% } if(filters.ts) { %>
- 'ts:client',
- 'copy:constant',<% } if(filters.jade) { %>
- 'jade',<% } if(filters.stylus) { %>
- 'stylus',<% } if(filters.sass) { %>
- 'sass',<% } if(filters.less) { %>
- 'less',<% } %>
- ],
- test: [<% if(filters.babel) { %>
- 'newer:babel:client',<% } if(filters.ts) { %>
- 'ts:client',
- 'copy:constant',<% } if(filters.ts) { %>
- 'ts:client_test',<% } if(filters.jade) { %>
- 'jade',<% } if(filters.stylus) { %>
- 'stylus',<% } if(filters.sass) { %>
- 'sass',<% } if(filters.less) { %>
- 'less',<% } %>
- ],
- debug: {
- tasks: [
- 'nodemon',
- 'node-inspector'
- ],
- options: {
- logConcurrentOutput: true
- }
- },
- dist: [<% if(filters.babel) { %>
- 'newer:babel:client',<% } if(filters.ts) { %>
- 'ts:client',
- 'copy:constant',<% } if(filters.jade) { %>
- 'jade',<% } if(filters.stylus) { %>
- 'stylus',<% } if(filters.sass) { %>
- 'sass',<% } if(filters.less) { %>
- 'less',<% } %>
- 'imagemin'
- ]
- },
-
- // Test settings
- karma: {
- unit: {
- configFile: 'karma.conf.js',
- singleRun: true
- }
- },
-
- mochaTest: {
- options: {
- reporter: 'spec',
- require: 'mocha.conf.js',
- timeout: 5000 // set default mocha spec timeout
- },
- unit: {
- src: ['<%%= yeoman.server %>/**/*.spec.js']
- },
- integration: {
- src: ['<%%= yeoman.server %>/**/*.integration.js']
- }
- },
-
- mocha_istanbul: {
- unit: {
- options: {
- excludes: ['**/*.{spec,mock,integration}.js'],
- reporter: 'spec',
- require: ['mocha.conf.js'],
- mask: '**/*.spec.js',
- coverageFolder: 'coverage/server/unit'
- },
- src: '<%%= yeoman.server %>'
- },
- integration: {
- options: {
- excludes: ['**/*.{spec,mock,integration}.js'],
- reporter: 'spec',
- require: ['mocha.conf.js'],
- mask: '**/*.integration.js',
- coverageFolder: 'coverage/server/integration'
- },
- src: '<%%= yeoman.server %>'
- }
- },
-
- istanbul_check_coverage: {
- default: {
- options: {
- coverageFolder: 'coverage/**',
- check: {
- lines: 80,
- statements: 80,
- branches: 80,
- functions: 80
- }
- }
- }
- },
-
- protractor: {
- options: {
- configFile: 'protractor.conf.js'
- },
- chrome: {
- options: {
- args: {
- browser: 'chrome'
- }
- }
- }
- },
-
- env: {
- test: {
- NODE_ENV: 'test'
- },
- prod: {
- NODE_ENV: 'production'
- },
- all: localConfig
- },<% if (filters.jade) { %>
-
- // Compiles Jade to html
- jade: {
- compile: {
- options: {
- data: {
- debug: false
- }
- },
- files: [{
- expand: true,
- cwd: '<%%= yeoman.client %>',
- src: ['{app,components}/**/*.jade'],
- dest: '.tmp',
- ext: '.html'
- }]
- }
- },<% } %>
-
- // Compiles ES6 to JavaScript using Babel
- babel: {
- options: {
- sourceMap: true
- },<% if(filters.babel) { %>
- client: {
- files: [{
- expand: true,
- cwd: '<%%= yeoman.client %>',
- src: ['{app,components}/**/!(*.spec).js'],
- dest: '.tmp'
- }]
- },<% } %>
- server: {
- options: {
- plugins: [
- 'transform-class-properties',
- 'transform-runtime'
- ]
- },
- files: [{
- expand: true,
- cwd: '<%%= yeoman.server %>',
- src: [
- '**/*.js',
- '!config/local.env.sample.js'
- ],
- dest: '<%%= yeoman.dist %>/<%%= yeoman.server %>'
- }]
- }
- },<% if(filters.ts) { %>
-
- ts: {
- options: {
- sourceMap: true,
- failOnTypeErrors: false
- },
- client: {
- tsconfig: './tsconfig.client.json',
- outDir: '.tmp'
- },
- client_test: {
- tsconfig: './tsconfig.client.test.json',
- outDir: '.tmp/test'
- }
- },
-
- tsd: {
- install: {
- options: {
- command: 'reinstall',
- config: './tsd.json'
- }
- },
- install_test: {
- options: {
- command: 'reinstall',
- config: './tsd_test.json'
- }
- }
- },<% } %><% if(filters.stylus) { %>
-
- // Compiles Stylus to CSS
- stylus: {
- server: {
- options: {
- "include css": true
- },
- files: {
- '.tmp/app/app.css' : '<%%= yeoman.client %>/app/app.styl'
- }
- }
- },<% } if (filters.sass) { %>
-
- // Compiles Sass to CSS
- sass: {
- server: {
- options: {
- compass: false
- },
- files: {
- '.tmp/app/app.css' : '<%%= yeoman.client %>/app/app.scss'
- }
- }
- },<% } if (filters.less) { %>
-
- // Compiles Less to CSS
- less: {
- server: {
- files: {
- '.tmp/app/app.css' : '<%%= yeoman.client %>/app/app.less'
- }
- }
- },<% } %>
-
- injector: {
- options: {},
- // Inject application script files into index.html (doesn't include bower)
- scripts: {
- options: {
- transform: function(filePath) {
- var yoClient = grunt.config.get('yeoman.client');
- filePath = filePath.replace('/' + yoClient + '/', '');
- filePath = filePath.replace('/.tmp/', '');<% if(filters.ts) { %>
- filePath = filePath.replace('.ts', '.js');<% } %>
- return '';
- },
- sort: function(a, b) {
- var module = /\.module\.(js|ts)$/;
- var aMod = module.test(a);
- var bMod = module.test(b);
- // inject *.module.js first
- return (aMod === bMod) ? 0 : (aMod ? -1 : 1);
- },
- starttag: '',
- endtag: ''
- },
- files: {
- '<%%= yeoman.client %>/index.html': [
- [
- '<%%= yeoman.client %>/{app,components}/**/!(*.spec|*.mock).<%= scriptExt %>',<% if(filters.ts) { %>
- '<%%= yeoman.client %>/app/app.constant.js',<% } %>
- '!{.tmp,<%%= yeoman.client %>}/app/app.{js,ts}'
- ]
- ]
- }
- },<% if (filters.stylus) { %>
-
- // Inject component styl into app.styl
- stylus: {
- options: {
- transform: function(filePath) {
- var yoClient = grunt.config.get('yeoman.client');
- filePath = filePath.replace('/' + yoClient + '/app/', '');
- filePath = filePath.replace('/' + yoClient + '/components/', '../components/');
- return '@import \'' + filePath + '\';';
- },
- starttag: '/* inject:styl */',
- endtag: '/* endinject */'
- },
- files: {
- '<%%= yeoman.client %>/app/app.styl': [
- '<%%= yeoman.client %>/{app,components}/**/*.styl',
- '!<%%= yeoman.client %>/app/app.styl'
- ]
- }
- },<% } if (filters.sass) { %>
-
- // Inject component scss into app.scss
- sass: {
- options: {
- transform: function(filePath) {
- var yoClient = grunt.config.get('yeoman.client');
- filePath = filePath.replace('/' + yoClient + '/app/', '');
- filePath = filePath.replace('/' + yoClient + '/components/', '../components/');
- return '@import \'' + filePath + '\';';
- },
- starttag: '/* inject:scss */',
- endtag: '/* endinject */'
- },
- files: {
- '<%%= yeoman.client %>/app/app.scss': [
- '<%%= yeoman.client %>/{app,components}/**/*.{scss,sass}',
- '!<%%= yeoman.client %>/app/app.{scss,sass}'
- ]
- }
- },<% } if (filters.less) { %>
-
- // Inject component less into app.less
- less: {
- options: {
- transform: function(filePath) {
- var yoClient = grunt.config.get('yeoman.client');
- filePath = filePath.replace('/' + yoClient + '/app/', '');
- filePath = filePath.replace('/' + yoClient + '/components/', '../components/');
- return '@import \'' + filePath + '\';';
- },
- starttag: '/* inject:less */',
- endtag: '/* endinject */'
- },
- files: {
- '<%%= yeoman.client %>/app/app.less': [
- '<%%= yeoman.client %>/{app,components}/**/*.less',
- '!<%%= yeoman.client %>/app/app.less'
- ]
- }
- },<% } %>
-
- // Inject component css into index.html
- css: {
- options: {
- transform: function(filePath) {
- var yoClient = grunt.config.get('yeoman.client');
- filePath = filePath.replace('/' + yoClient + '/', '');
- filePath = filePath.replace('/.tmp/', '');
- return '';
- },
- starttag: '',
- endtag: ''
- },
- files: {
- '<%%= yeoman.client %>/index.html': [
- '<%%= yeoman.client %>/{app,components}/**/*.css'
- ]
- }
- }
- },
- });
-
- // Used for delaying livereload until after server has restarted
- grunt.registerTask('wait', function () {
- grunt.log.ok('Waiting for server reload...');
-
- var done = this.async();
-
- setTimeout(function () {
- grunt.log.writeln('Done waiting!');
- done();
- }, 1500);
- });
-
- grunt.registerTask('express-keepalive', 'Keep grunt running', function() {
- this.async();
- });
-
- grunt.registerTask('serve', function (target) {
- if (target === 'dist') {
- return grunt.task.run(['build', 'env:all', 'env:prod', 'express:prod', 'wait', 'open', 'express-keepalive']);
- }
-
- if (target === 'debug') {
- return grunt.task.run([
- 'clean:server',
- 'env:all',
- 'concurrent:pre',<% if(filters.ts) { %>
- 'tsd',<% } %>
- 'concurrent:server',
- 'injector',
- 'wiredep:client',
- 'postcss',
- 'concurrent:debug'
- ]);
- }
-
- grunt.task.run([
- 'clean:server',
- 'env:all',
- 'concurrent:pre',<% if(filters.ts) { %>
- 'tsd',<% } %>
- 'concurrent:server',
- 'injector',
- 'wiredep:client',
- 'postcss',
- 'express:dev',
- 'wait',
- 'open',
- 'watch'
- ]);
- });
-
- grunt.registerTask('server', function () {
- grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.');
- grunt.task.run(['serve']);
- });
-
- grunt.registerTask('test', function(target, option) {
- if (target === 'server') {
- return grunt.task.run([
- 'env:all',
- 'env:test',
- 'mochaTest:unit',
- 'mochaTest:integration'
- ]);
- }
-
- else if (target === 'client') {
- return grunt.task.run([
- 'clean:server',
- 'env:all',
- 'concurrent:pre',<% if(filters.ts) { %>
- 'ts:client',
- 'ts:client_test',
- 'tsd',<% } %>
- 'concurrent:test',
- 'injector',
- 'postcss',
- 'wiredep:test',
- 'karma'
- ]);
- }
-
- else if (target === 'e2e') {
-
- if (option === 'prod') {
- return grunt.task.run([
- 'build',
- 'env:all',
- 'env:prod',
- 'express:prod',
- 'protractor'
- ]);
- }
-
- else {
- return grunt.task.run([
- 'clean:server',
- 'env:all',
- 'env:test',
- 'concurrent:pre',<% if(filters.ts) { %>
- 'tsd:install',
- 'tsd:install_test',
- 'ts:client',
- 'ts:client_test',<% } %>
- 'concurrent:test',
- 'injector',
- 'wiredep:client',
- 'postcss',
- 'express:dev',
- 'protractor'
- ]);
- }
- }
-
- else if (target === 'coverage') {
-
- if (option === 'unit') {
- return grunt.task.run([
- 'env:all',
- 'env:test',
- 'mocha_istanbul:unit'
- ]);
- }
-
- else if (option === 'integration') {
- return grunt.task.run([
- 'env:all',
- 'env:test',
- 'mocha_istanbul:integration'
- ]);
- }
-
- else if (option === 'check') {
- return grunt.task.run([
- 'istanbul_check_coverage'
- ]);
- }
-
- else {
- return grunt.task.run([
- 'env:all',
- 'env:test',
- 'mocha_istanbul',
- 'istanbul_check_coverage'
- ]);
- }
-
- }
-
- else grunt.task.run([
- 'test:server',
- 'test:client'
- ]);
- });
-
- grunt.registerTask('build', [
- 'clean:dist',
- 'concurrent:pre',<% if(filters.ts) { %>
- 'tsd',<% } %>
- 'concurrent:dist',
- 'injector',
- 'wiredep:client',
- 'useminPrepare',
- 'postcss',
- 'ngtemplates',
- 'concat',
- 'ngAnnotate',
- 'copy:dist',
- 'babel:server',
- 'cdnify',
- 'cssmin',
- 'uglify',
- 'filerev',
- 'usemin'
- ]);
-
- grunt.registerTask('default', [<% if(filters.ts) { %>
- 'newer:tslint',<% } %><% if(filters.babel) { %>
- 'newer:jshint',<% } %>
- 'test',
- 'build'
- ]);
-};
diff --git a/app/templates/README.md b/app/templates/README.md
deleted file mode 100644
index 02fbb93a6..000000000
--- a/app/templates/README.md
+++ /dev/null
@@ -1,34 +0,0 @@
-# <%= lodash.slugify(lodash.humanize(appname)) %>
-
-This project was generated with the [Angular Full-Stack Generator](https://github.com/DaftMonk/generator-angular-fullstack) version <%= rootGeneratorVersion() %>.
-
-## Getting Started
-
-### Prerequisites
-
-- [Git](https://git-scm.com/)
-- [Node.js and npm](nodejs.org) Node ^4.2.3, npm ^2.14.7
-- [Bower](bower.io) (`npm install --global bower`)<% if(filters.sass) { %>
-- [Ruby](https://www.ruby-lang.org) and then `gem install sass`<% } if(filters.grunt) { %>
-- [Grunt](http://gruntjs.com/) (`npm install --global grunt-cli`)<% } if(filters.gulp) { %>
-- [Gulp](http://gulpjs.com/) (`npm install --global gulp`)<% } if(filters.mongoose) { %>
-- [MongoDB](https://www.mongodb.org/) - Keep a running daemon with `mongod`<% } if(filters.sequelize) { %>
-- [SQLite](https://www.sqlite.org/quickstart.html)<% } %>
-
-### Developing<% var i = 1; %>
-
-<%= i++ %>. Run `npm install` to install server dependencies.
-
-<%= i++ %>. Run `bower install` to install front-end dependencies.<% if(filters.mongoose) { %>
-
-<%= i++ %>. Run `mongod` in a separate shell to keep an instance of the MongoDB Daemon running<% } %>
-
-<%= i++ %>. Run <% if(filters.grunt) { %>`grunt serve`<% } if(filters.grunt && filters.gulp) { %> or <% } if(filters.gulp) { %>`gulp serve`<% } %> to start the development server. It should automatically open the client in your browser when ready.
-
-## Build & development
-
-Run `grunt build` for building and `grunt serve` for preview.
-
-## Testing
-
-Running `npm test` will run the unit tests with karma.
diff --git a/app/templates/_.babelrc b/app/templates/_.babelrc
deleted file mode 100644
index bde6914ee..000000000
--- a/app/templates/_.babelrc
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "presets": ["es2015"],
- "plugins": ["transform-class-properties"]
-}
\ No newline at end of file
diff --git a/app/templates/_bower.json b/app/templates/_bower.json
deleted file mode 100644
index b2bcd90bd..000000000
--- a/app/templates/_bower.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "name": "<%= lodash.slugify(lodash.humanize(appname)) %>",
- "version": "0.0.0",
- "dependencies": {
- "angular": "~1.5.0",
- "json3": "~3.3.1",
- "es5-shim": "~3.0.1",<% if(filters.bootstrap) { if (filters.sass) { %>
- "bootstrap-sass-official": "~3.1.1",<% } %>
- "bootstrap": "~3.1.1",<% if(filters.oauth) { %>
- "bootstrap-social": "~4.9.1",<% }} %>
- "angular-resource": "~1.5.0",
- "angular-cookies": "~1.5.0",
- "angular-sanitize": "~1.5.0",<% if (filters.ngroute) { %>
- "angular-route": "~1.5.0",<% } if (filters.uibootstrap) { %>
- "angular-bootstrap": "~1.1.2",<% } %>
- "font-awesome": ">=4.1.0",
- "lodash": "~2.4.1"<% if(filters.socketio) { %>,
- "angular-socket-io": "~0.7.0"<% } if (filters.uirouter) { %>,
- "angular-ui-router": "~0.2.15"<% } if (filters.auth) { %>,
- "angular-validation-match": "~1.5.2"<% } %>
- },
- "devDependencies": {
- "angular-mocks": "~1.5.0"
- }
-}
diff --git a/app/templates/_package.json b/app/templates/_package.json
deleted file mode 100644
index f86162e15..000000000
--- a/app/templates/_package.json
+++ /dev/null
@@ -1,183 +0,0 @@
-{
- "name": "<%= lodash.slugify(lodash.humanize(appname)) %>",
- "version": "0.0.0",
- "main": "server/app.js",
- "dependencies": {
- "express": "^4.13.3",
- "morgan": "~1.7.0",
- "body-parser": "^1.13.3",
- "method-override": "^2.3.5",
- "cookie-parser": "^1.3.5",
- "express-session": "^1.11.3",
- "errorhandler": "^1.4.2",
- "compression": "^1.5.2",
- "composable-middleware": "^0.3.0",
- "lodash": "^4.6.1",
- "lusca": "^1.3.0",
- "babel-runtime": "^6.6.1",
- "babel-polyfill": "^6.7.2",<% if (filters.jade) { %>
- "jade": "^1.11.0",<% } %><% if (filters.html) { %>
- "ejs": "^2.3.3",<% } %><% if (filters.mongoose) { %>
- "mongoose": "^4.1.2",
- "bluebird": "^3.3.3",
- "connect-mongo": "^0.8.1",<% } %><% if (filters.sequelize) { %>
- "sequelize": "^3.5.1",
- "sqlite3": "~3.1.1",
- "express-sequelize-session": "0.4.0",<% } %><% if (filters.auth) { %>
- "jsonwebtoken": "^5.0.0",
- "express-jwt": "^3.0.0",
- "passport": "~0.3.0",
- "passport-local": "^1.0.0",<% } %><% if (filters.facebookAuth) { %>
- "passport-facebook": "^2.0.0",<% } %><% if (filters.twitterAuth) { %>
- "passport-twitter": "^1.0.3",<% } %><% if (filters.googleAuth) { %>
- "passport-google-oauth20": "^1.0.0",<% } %><% if (filters.socketio) { %>
- "socket.io": "^1.3.5",
- "socket.io-client": "^1.3.5",
- "socketio-jwt": "^4.2.0",<% } %>
- "serve-favicon": "^2.3.0"
- },
- "devDependencies": {
- "autoprefixer": "^6.0.0",
- "babel-core": "^6.6.5",
- "babel-register": "^6.6.5",
- "babel-plugin-transform-class-properties": "^6.6.0",
- "babel-plugin-transform-runtime": "^6.6.0",
- "babel-preset-es2015": "^6.6.0",<% if(filters.gulp) { %>
- "del": "^2.0.2",
- "gulp": "^3.9.1",
- "gulp-add-src": "^0.2.0",
- "gulp-angular-templatecache": "^1.7.0",
- "gulp-autoprefixer": "3.0.0",
- "gulp-babel": "^6.1.2",<% if(filters.ts) { %>
- "gulp-typescript": "~2.12.1",
- "gulp-tsd": "~0.1.0",
- "gulp-tslint": "^4.3.0",<% } %>
- "gulp-cache": "^0.4.2",
- "gulp-concat": "^2.6.0",
- "gulp-env": "^0.4.0",
- "gulp-filter": "^4.0.0",
- "gulp-imagemin": "^2.2.1",
- "gulp-inject": "^3.0.0",
- "gulp-istanbul": "~0.10.3",
- "gulp-istanbul-enforcer": "^1.0.3",
- "gulp-jscs": "^3.0.2",
- "gulp-jshint": "^2.0.0",
- "gulp-livereload": "^3.8.0",
- "gulp-load-plugins": "^1.0.0-rc.1",
- "gulp-minify-css": "^1.1.6",
- "gulp-mocha": "^2.1.3",
- "gulp-ng-annotate": "^2.0.0",
- "gulp-ng-constant": "^1.1.0",
- "gulp-plumber": "^1.0.1",
- "gulp-protractor": "^2.1.0",
- "gulp-rename": "^1.2.2",
- "gulp-rev": "^5.0.0",
- "gulp-rev-replace": "^0.4.2",
- "gulp-sort": "^2.0.0",
- "gulp-sourcemaps": "^1.5.2",
- "gulp-svgmin": "^1.1.2",
- "gulp-uglify": "^1.2.0",
- "gulp-useref": "^3.0.3",
- "gulp-util": "^3.0.5",
- "gulp-watch": "^4.3.5",<% if(filters.jade) { %>
- "gulp-jade": "^1.0.1",<% } if(filters.stylus) { %>
- "gulp-stylus": "^2.0.4",
- "gulp-stylint": "^3.0.0",
- "nib": "^1.1.0",<% } if(filters.sass) { %>
- "gulp-sass": "^2.0.1",
- "gulp-scss-lint": "^0.3.9",<% } if(filters.less) { %>
- "gulp-less": "^3.0.3",
- "gulp-recess": "^1.1.2",<% } %>
- "isparta": "^4.0.0",
- "utile": "~0.3.0",
- "nodemon": "^1.3.7",
- "run-sequence": "^1.1.0",
- "lazypipe": "^0.2.4",
- "wiredep": "^2.2.2",<% } /*end gulp*/ if(filters.grunt) { %>
- "grunt": "~0.4.5",
- "grunt-wiredep": "^2.0.0",
- "grunt-concurrent": "^2.0.1",
- "grunt-contrib-clean": "^1.0.0",
- "grunt-contrib-concat": "^1.0.0",
- "grunt-contrib-copy": "^1.0.0",
- "grunt-contrib-cssmin": "^1.0.0",
- "grunt-contrib-imagemin": "^1.0.0",
- "grunt-contrib-jshint": "^1.0.0",
- "grunt-contrib-uglify": "^1.0.0",
- "grunt-contrib-watch": "~0.6.1",<% if (filters.jade) { %>
- "grunt-contrib-jade": "^1.0.0",<% } %><% if (filters.less) { %>
- "grunt-contrib-less": "^1.2.0",<% } %>
- "grunt-babel": "~6.0.0",<% if(filters.ts) { %>
- "grunt-ts": "^5.3.2",
- "grunt-tsd": "~0.1.0",
- "grunt-tslint": "~3.0.1",<% } %>
- "grunt-google-cdn": "~0.4.0",
- "grunt-jscs": "^2.1.0",
- "grunt-newer": "^1.1.1",
- "grunt-ng-annotate": "^2.0.1",
- "grunt-ng-constant": "^2.0.1",
- "grunt-filerev": "^2.3.1",
- "grunt-usemin": "^3.0.0",
- "grunt-env": "~0.4.1",
- "grunt-node-inspector": "^0.4.1",
- "grunt-nodemon": "^0.4.0",
- "grunt-angular-templates": "^1.0.3",
- "grunt-dom-munger": "^3.4.0",
- "grunt-protractor-runner": "^2.0.0",
- "grunt-injector": "^0.6.0",
- "grunt-karma": "~0.12.0",
- "grunt-build-control": "^0.6.0",<% if(filters.sass) { %>
- "grunt-contrib-sass": "^1.0.0",<% } %><% if(filters.stylus) { %>
- "grunt-contrib-stylus": "^1.2.0",<% } %>
- "jit-grunt": "~0.10.0",
- "grunt-express-server": "^0.5.1",
- "grunt-postcss": "~0.8.0",
- "grunt-open": "~0.2.3",
- "time-grunt": "^1.2.1",
- "grunt-mocha-test": "~0.12.7",
- "grunt-mocha-istanbul": "^3.0.1",<% } /*end grunt*/ %>
- "open": "~0.0.4",
- "jshint-stylish": "~2.1.0",
- "connect-livereload": "^0.5.3",
- "istanbul": "~0.4.1",
- "chai": "^3.2.0",
- "sinon": "^1.16.1",
- "chai-as-promised": "^5.1.0",
- "chai-things": "^0.2.0",
- "karma": "~0.13.3",
- "karma-ng-scenario": "~0.1.0",
- "karma-firefox-launcher": "~0.1.6",
- "karma-script-launcher": "~0.1.0",
- "karma-chrome-launcher": "~0.2.0",
- "karma-requirejs": "~0.2.2",
- "karma-jade-preprocessor": "0.0.11",
- "karma-phantomjs-launcher": "~1.0.0",<% if (filters.jade) { %>
- "karma-ng-jade2js-preprocessor": "^0.2.0",<% } else { %>
- "karma-ng-html2js-preprocessor": "~0.2.0",<% } %>
- "karma-spec-reporter": "~0.0.20",
- "sinon-chai": "^2.8.0",
- "mocha": "^2.2.5",<% if (filters.mocha) { %>
- "karma-mocha": "^0.2.0",
- "karma-chai-plugins": "~0.7.0",<% } if (filters.jasmine) { %>
- "jasmine-core": "^2.3.4",
- "karma-jasmine": "~0.3.0",
- "jasmine-spec-reporter": "^2.4.0",<% } if(filters.babel) { %>
- "karma-babel-preprocessor": "^6.0.1",<% } %>
- "requirejs": "~2.1.11",
- "phantomjs-prebuilt": "^2.1.4",
- "proxyquire": "^1.0.1",
- "supertest": "^1.1.0"<% if(filters.ts) { %>,
- "tslint": "^3.5.0"<% } %>
- },
- "engines": {
- "node": "^4.4.0",
- "npm": "^2.14.20"
- },
- "scripts": {
- "start": "node server",<% if(filters.gulp) { %>
- "test": "gulp test",<% } else { %>
- "test": "grunt test",<% } %>
- "update-webdriver": "node node_modules/grunt-protractor-runner/node_modules/protractor/bin/webdriver-manager update"
- },
- "private": true
-}
diff --git a/app/templates/client/.htaccess b/app/templates/client/.htaccess
deleted file mode 100644
index cb84cb918..000000000
--- a/app/templates/client/.htaccess
+++ /dev/null
@@ -1,543 +0,0 @@
-# Apache Configuration File
-
-# (!) Using `.htaccess` files slows down Apache, therefore, if you have access
-# to the main server config file (usually called `httpd.conf`), you should add
-# this logic there: http://httpd.apache.org/docs/current/howto/htaccess.html.
-
-# ##############################################################################
-# # CROSS-ORIGIN RESOURCE SHARING (CORS) #
-# ##############################################################################
-
-# ------------------------------------------------------------------------------
-# | Cross-domain AJAX requests |
-# ------------------------------------------------------------------------------
-
-# Enable cross-origin AJAX requests.
-# http://code.google.com/p/html5security/wiki/CrossOriginRequestSecurity
-# http://enable-cors.org/
-
-#
-# Header set Access-Control-Allow-Origin "*"
-#
-
-# ------------------------------------------------------------------------------
-# | CORS-enabled images |
-# ------------------------------------------------------------------------------
-
-# Send the CORS header for images when browsers request it.
-# https://developer.mozilla.org/en/CORS_Enabled_Image
-# http://blog.chromium.org/2011/07/using-cross-domain-images-in-webgl-and.html
-# http://hacks.mozilla.org/2011/11/using-cors-to-load-webgl-textures-from-cross-domain-images/
-
-
-
-
- SetEnvIf Origin ":" IS_CORS
- Header set Access-Control-Allow-Origin "*" env=IS_CORS
-
-
-
-
-# ------------------------------------------------------------------------------
-# | Web fonts access |
-# ------------------------------------------------------------------------------
-
-# Allow access from all domains for web fonts
-
-
-
- Header set Access-Control-Allow-Origin "*"
-
-
-
-
-# ##############################################################################
-# # ERRORS #
-# ##############################################################################
-
-# ------------------------------------------------------------------------------
-# | 404 error prevention for non-existing redirected folders |
-# ------------------------------------------------------------------------------
-
-# Prevent Apache from returning a 404 error for a rewrite if a directory
-# with the same name does not exist.
-# http://httpd.apache.org/docs/current/content-negotiation.html#multiviews
-# http://www.webmasterworld.com/apache/3808792.htm
-
-Options -MultiViews
-
-# ------------------------------------------------------------------------------
-# | Custom error messages / pages |
-# ------------------------------------------------------------------------------
-
-# You can customize what Apache returns to the client in case of an error (see
-# http://httpd.apache.org/docs/current/mod/core.html#errordocument), e.g.:
-
-ErrorDocument 404 /404.html
-
-
-# ##############################################################################
-# # INTERNET EXPLORER #
-# ##############################################################################
-
-# ------------------------------------------------------------------------------
-# | Better website experience |
-# ------------------------------------------------------------------------------
-
-# Force IE to render pages in the highest available mode in the various
-# cases when it may not: http://hsivonen.iki.fi/doctype/ie-mode.pdf.
-
-
- Header set X-UA-Compatible "IE=edge"
- # `mod_headers` can't match based on the content-type, however, we only
- # want to send this header for HTML pages and not for the other resources
-
- Header unset X-UA-Compatible
-
-
-
-# ------------------------------------------------------------------------------
-# | Cookie setting from iframes |
-# ------------------------------------------------------------------------------
-
-# Allow cookies to be set from iframes in IE.
-
-#
-# Header set P3P "policyref=\"/w3c/p3p.xml\", CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\""
-#
-
-# ------------------------------------------------------------------------------
-# | Screen flicker |
-# ------------------------------------------------------------------------------
-
-# Stop screen flicker in IE on CSS rollovers (this only works in
-# combination with the `ExpiresByType` directives for images from below).
-
-# BrowserMatch "MSIE" brokenvary=1
-# BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1
-# BrowserMatch "Opera" !brokenvary
-# SetEnvIf brokenvary 1 force-no-vary
-
-
-# ##############################################################################
-# # MIME TYPES AND ENCODING #
-# ##############################################################################
-
-# ------------------------------------------------------------------------------
-# | Proper MIME types for all files |
-# ------------------------------------------------------------------------------
-
-
-
- # Audio
- AddType audio/mp4 m4a f4a f4b
- AddType audio/ogg oga ogg
-
- # JavaScript
- # Normalize to standard type (it's sniffed in IE anyways):
- # http://tools.ietf.org/html/rfc4329#section-7.2
- AddType application/javascript js jsonp
- AddType application/json json
-
- # Video
- AddType video/mp4 mp4 m4v f4v f4p
- AddType video/ogg ogv
- AddType video/webm webm
- AddType video/x-flv flv
-
- # Web fonts
- AddType application/font-woff woff
- AddType application/vnd.ms-fontobject eot
-
- # Browsers usually ignore the font MIME types and sniff the content,
- # however, Chrome shows a warning if other MIME types are used for the
- # following fonts.
- AddType application/x-font-ttf ttc ttf
- AddType font/opentype otf
-
- # Make SVGZ fonts work on iPad:
- # https://twitter.com/FontSquirrel/status/14855840545
- AddType image/svg+xml svg svgz
- AddEncoding gzip svgz
-
- # Other
- AddType application/octet-stream safariextz
- AddType application/x-chrome-extension crx
- AddType application/x-opera-extension oex
- AddType application/x-shockwave-flash swf
- AddType application/x-web-app-manifest+json webapp
- AddType application/x-xpinstall xpi
- AddType application/xml atom rdf rss xml
- AddType image/webp webp
- AddType image/x-icon ico
- AddType text/cache-manifest appcache manifest
- AddType text/vtt vtt
- AddType text/x-component htc
- AddType text/x-vcard vcf
-
-
-
-# ------------------------------------------------------------------------------
-# | UTF-8 encoding |
-# ------------------------------------------------------------------------------
-
-# Use UTF-8 encoding for anything served as `text/html` or `text/plain`.
-AddDefaultCharset utf-8
-
-# Force UTF-8 for certain file formats.
-
- AddCharset utf-8 .atom .css .js .json .rss .vtt .webapp .xml
-
-
-
-# ##############################################################################
-# # URL REWRITES #
-# ##############################################################################
-
-# ------------------------------------------------------------------------------
-# | Rewrite engine |
-# ------------------------------------------------------------------------------
-
-# Turning on the rewrite engine and enabling the `FollowSymLinks` option is
-# necessary for the following directives to work.
-
-# If your web host doesn't allow the `FollowSymlinks` option, you may need to
-# comment it out and use `Options +SymLinksIfOwnerMatch` but, be aware of the
-# performance impact: http://httpd.apache.org/docs/current/misc/perf-tuning.html#symlinks
-
-# Also, some cloud hosting services require `RewriteBase` to be set:
-# http://www.rackspace.com/knowledge_center/frequently-asked-question/why-is-mod-rewrite-not-working-on-my-site
-
-
- Options +FollowSymlinks
- # Options +SymLinksIfOwnerMatch
- RewriteEngine On
- # RewriteBase /
-
-
-# ------------------------------------------------------------------------------
-# | Suppressing / Forcing the "www." at the beginning of URLs |
-# ------------------------------------------------------------------------------
-
-# The same content should never be available under two different URLs especially
-# not with and without "www." at the beginning. This can cause SEO problems
-# (duplicate content), therefore, you should choose one of the alternatives and
-# redirect the other one.
-
-# By default option 1 (no "www.") is activated:
-# http://no-www.org/faq.php?q=class_b
-
-# If you'd prefer to use option 2, just comment out all the lines from option 1
-# and uncomment the ones from option 2.
-
-# IMPORTANT: NEVER USE BOTH RULES AT THE SAME TIME!
-
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-# Option 1: rewrite www.example.com → example.com
-
-
- RewriteCond %{HTTPS} !=on
- RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
- RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
-
-
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-# Option 2: rewrite example.com → www.example.com
-
-# Be aware that the following might not be a good idea if you use "real"
-# subdomains for certain parts of your website.
-
-#
-# RewriteCond %{HTTPS} !=on
-# RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
-# RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
-#
-
-
-# ##############################################################################
-# # SECURITY #
-# ##############################################################################
-
-# ------------------------------------------------------------------------------
-# | Content Security Policy (CSP) |
-# ------------------------------------------------------------------------------
-
-# You can mitigate the risk of cross-site scripting and other content-injection
-# attacks by setting a Content Security Policy which whitelists trusted sources
-# of content for your site.
-
-# The example header below allows ONLY scripts that are loaded from the current
-# site's origin (no inline scripts, no CDN, etc). This almost certainly won't
-# work as-is for your site!
-
-# To get all the details you'll need to craft a reasonable policy for your site,
-# read: http://html5rocks.com/en/tutorials/security/content-security-policy (or
-# see the specification: http://w3.org/TR/CSP).
-
-#
-# Header set Content-Security-Policy "script-src 'self'; object-src 'self'"
-#
-# Header unset Content-Security-Policy
-#
-#
-
-# ------------------------------------------------------------------------------
-# | File access |
-# ------------------------------------------------------------------------------
-
-# Block access to directories without a default document.
-# Usually you should leave this uncommented because you shouldn't allow anyone
-# to surf through every directory on your server (which may includes rather
-# private places like the CMS's directories).
-
-
- Options -Indexes
-
-
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-# Block access to hidden files and directories.
-# This includes directories used by version control systems such as Git and SVN.
-
-
- RewriteCond %{SCRIPT_FILENAME} -d [OR]
- RewriteCond %{SCRIPT_FILENAME} -f
- RewriteRule "(^|/)\." - [F]
-
-
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-# Block access to backup and source files.
-# These files may be left by some text editors and can pose a great security
-# danger when anyone has access to them.
-
-
- Order allow,deny
- Deny from all
- Satisfy All
-
-
-# ------------------------------------------------------------------------------
-# | Secure Sockets Layer (SSL) |
-# ------------------------------------------------------------------------------
-
-# Rewrite secure requests properly to prevent SSL certificate warnings, e.g.:
-# prevent `https://www.example.com` when your certificate only allows
-# `https://secure.example.com`.
-
-#
-# RewriteCond %{SERVER_PORT} !^443
-# RewriteRule ^ https://example-domain-please-change-me.com%{REQUEST_URI} [R=301,L]
-#
-
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-# Force client-side SSL redirection.
-
-# If a user types "example.com" in his browser, the above rule will redirect him
-# to the secure version of the site. That still leaves a window of opportunity
-# (the initial HTTP connection) for an attacker to downgrade or redirect the
-# request. The following header ensures that browser will ONLY connect to your
-# server via HTTPS, regardless of what the users type in the address bar.
-# http://www.html5rocks.com/en/tutorials/security/transport-layer-security/
-
-#
-# Header set Strict-Transport-Security max-age=16070400;
-#
-
-# ------------------------------------------------------------------------------
-# | Server software information |
-# ------------------------------------------------------------------------------
-
-# Avoid displaying the exact Apache version number, the description of the
-# generic OS-type and the information about Apache's compiled-in modules.
-
-# ADD THIS DIRECTIVE IN THE `httpd.conf` AS IT WILL NOT WORK IN THE `.htaccess`!
-
-# ServerTokens Prod
-
-
-# ##############################################################################
-# # WEB PERFORMANCE #
-# ##############################################################################
-
-# ------------------------------------------------------------------------------
-# | Compression |
-# ------------------------------------------------------------------------------
-
-
-
- # Force compression for mangled headers.
- # http://developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping
-
-
- SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
- RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
-
-
-
- # Compress all output labeled with one of the following MIME-types
- # (for Apache versions below 2.3.7, you don't need to enable `mod_filter`
- # and can remove the `` and `` lines
- # as `AddOutputFilterByType` is still in the core directives).
-
- AddOutputFilterByType DEFLATE application/atom+xml \
- application/javascript \
- application/json \
- application/rss+xml \
- application/vnd.ms-fontobject \
- application/x-font-ttf \
- application/x-web-app-manifest+json \
- application/xhtml+xml \
- application/xml \
- font/opentype \
- image/svg+xml \
- image/x-icon \
- text/css \
- text/html \
- text/plain \
- text/x-component \
- text/xml
-
-
-
-
-# ------------------------------------------------------------------------------
-# | Content transformations |
-# ------------------------------------------------------------------------------
-
-# Prevent some of the mobile network providers from modifying the content of
-# your site: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.5.
-
-#
-# Header set Cache-Control "no-transform"
-#
-
-# ------------------------------------------------------------------------------
-# | ETag removal |
-# ------------------------------------------------------------------------------
-
-# Since we're sending far-future expires headers (see below), ETags can
-# be removed: http://developer.yahoo.com/performance/rules.html#etags.
-
-# `FileETag None` is not enough for every server.
-
- Header unset ETag
-
-
-FileETag None
-
-# ------------------------------------------------------------------------------
-# | Expires headers (for better cache control) |
-# ------------------------------------------------------------------------------
-
-# The following expires headers are set pretty far in the future. If you don't
-# control versioning with filename-based cache busting, consider lowering the
-# cache time for resources like CSS and JS to something like 1 week.
-
-
-
- ExpiresActive on
- ExpiresDefault "access plus 1 month"
-
- # CSS
- ExpiresByType text/css "access plus 1 year"
-
- # Data interchange
- ExpiresByType application/json "access plus 0 seconds"
- ExpiresByType application/xml "access plus 0 seconds"
- ExpiresByType text/xml "access plus 0 seconds"
-
- # Favicon (cannot be renamed!)
- ExpiresByType image/x-icon "access plus 1 week"
-
- # HTML components (HTCs)
- ExpiresByType text/x-component "access plus 1 month"
-
- # HTML
- ExpiresByType text/html "access plus 0 seconds"
-
- # JavaScript
- ExpiresByType application/javascript "access plus 1 year"
-
- # Manifest files
- ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds"
- ExpiresByType text/cache-manifest "access plus 0 seconds"
-
- # Media
- ExpiresByType audio/ogg "access plus 1 month"
- ExpiresByType image/gif "access plus 1 month"
- ExpiresByType image/jpeg "access plus 1 month"
- ExpiresByType image/png "access plus 1 month"
- ExpiresByType video/mp4 "access plus 1 month"
- ExpiresByType video/ogg "access plus 1 month"
- ExpiresByType video/webm "access plus 1 month"
-
- # Web feeds
- ExpiresByType application/atom+xml "access plus 1 hour"
- ExpiresByType application/rss+xml "access plus 1 hour"
-
- # Web fonts
- ExpiresByType application/font-woff "access plus 1 month"
- ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
- ExpiresByType application/x-font-ttf "access plus 1 month"
- ExpiresByType font/opentype "access plus 1 month"
- ExpiresByType image/svg+xml "access plus 1 month"
-
-
-
-# ------------------------------------------------------------------------------
-# | Filename-based cache busting |
-# ------------------------------------------------------------------------------
-
-# If you're not using a build process to manage your filename version revving,
-# you might want to consider enabling the following directives to route all
-# requests such as `/css/style.12345.css` to `/css/style.css`.
-
-# To understand why this is important and a better idea than `*.css?v231`, read:
-# http://stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring
-
-#
-# RewriteCond %{REQUEST_FILENAME} !-f
-# RewriteCond %{REQUEST_FILENAME} !-d
-# RewriteRule ^(.+)\.(\d+)\.(js|css|png|jpg|gif)$ $1.$3 [L]
-#
-
-# ------------------------------------------------------------------------------
-# | File concatenation |
-# ------------------------------------------------------------------------------
-
-# Allow concatenation from within specific CSS and JS files, e.g.:
-# Inside of `script.combined.js` you could have
-#
-#
-# and they would be included into this single file.
-
-#
-#
-# Options +Includes
-# AddOutputFilterByType INCLUDES application/javascript application/json
-# SetOutputFilter INCLUDES
-#
-#
-# Options +Includes
-# AddOutputFilterByType INCLUDES text/css
-# SetOutputFilter INCLUDES
-#
-#
-
-# ------------------------------------------------------------------------------
-# | Persistent connections |
-# ------------------------------------------------------------------------------
-
-# Allow multiple requests to be sent over the same TCP connection:
-# http://httpd.apache.org/docs/current/en/mod/core.html#keepalive.
-
-# Enable if you serve a lot of static content but, be aware of the
-# possible disadvantages!
-
-#
-# Header set Connection Keep-Alive
-#
diff --git a/app/templates/client/.jshintrc(babel) b/app/templates/client/.jshintrc(babel)
deleted file mode 100644
index 9d0d57476..000000000
--- a/app/templates/client/.jshintrc(babel)
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "node": true,
- "browser": true,
- "esnext": true,
- "bitwise": true,
- "camelcase": true,
- "curly": true,
- "eqeqeq": true,
- "immed": true,
- "latedef": true,
- "newcap": true,
- "noarg": true,
- "quotmark": "single",
- "undef": true,
- "unused": true,
- "strict": true,
- "trailing": true,
- "smarttabs": true,
- "ignoreDelimiters": [
- { "start": "start-non-standard", "end": "end-non-standard" }
- ],
- "globals": {
- "jQuery": true,
- "angular": true,
- "console": true,
- "$": true,
- "_": true,
- "moment": true,<% if (filters.jasmine) { %>
- "jasmine": true,<% } %>
- "describe": true,
- "beforeEach": true,
- "module": true,
- "inject": true,
- "it": true,
- "expect": true,
- "browser": true,
- "element": true,
- "by": true
- }
-}
diff --git a/app/templates/client/app/account(auth)/account.js b/app/templates/client/app/account(auth)/account.js
deleted file mode 100644
index 4266116fa..000000000
--- a/app/templates/client/app/account(auth)/account.js
+++ /dev/null
@@ -1,81 +0,0 @@
-'use strict';
-
-angular.module('<%= scriptAppName %>')
- <% if (filters.ngroute) { %>.config(function($routeProvider) {
- $routeProvider
- .when('/login', {
- templateUrl: 'app/account/login/login.html',
- controller: 'LoginController',
- controllerAs: 'vm'
- })
- .when('/logout', {
- name: 'logout',
- referrer: '/',
- template: '',
- controller: function($location, $route, Auth) {
- var referrer = $route.current.params.referrer ||
- $route.current.referrer ||
- '/';
- Auth.logout();
- $location.path(referrer);
- }
- })
- .when('/signup', {
- templateUrl: 'app/account/signup/signup.html',
- controller: 'SignupController',
- controllerAs: 'vm'
- })
- .when('/settings', {
- templateUrl: 'app/account/settings/settings.html',
- controller: 'SettingsController',
- controllerAs: 'vm',
- authenticate: true
- });
- })
- .run(function($rootScope) {
- $rootScope.$on('$routeChangeStart', function(event, next, current) {
- if (next.name === 'logout' && current && current.originalPath && !current.authenticate) {
- next.referrer = current.originalPath;
- }
- });
- });<% } %><% if (filters.uirouter) { %>.config(function($stateProvider) {
- $stateProvider
- .state('login', {
- url: '/login',
- templateUrl: 'app/account/login/login.html',
- controller: 'LoginController',
- controllerAs: 'vm'
- })
- .state('logout', {
- url: '/logout?referrer',
- referrer: 'main',
- template: '',
- controller: function($state, Auth) {
- var referrer = $state.params.referrer ||
- $state.current.referrer ||
- 'main';
- Auth.logout();
- $state.go(referrer);
- }
- })
- .state('signup', {
- url: '/signup',
- templateUrl: 'app/account/signup/signup.html',
- controller: 'SignupController',
- controllerAs: 'vm'
- })
- .state('settings', {
- url: '/settings',
- templateUrl: 'app/account/settings/settings.html',
- controller: 'SettingsController',
- controllerAs: 'vm',
- authenticate: true
- });
- })
- .run(function($rootScope) {
- $rootScope.$on('$stateChangeStart', function(event, next, nextParams, current) {
- if (next.name === 'logout' && current && current.name && !current.authenticate) {
- next.referrer = current.name;
- }
- });
- });<% } %>
diff --git a/app/templates/client/app/account(auth)/login/login(jade).jade b/app/templates/client/app/account(auth)/login/login(jade).jade
deleted file mode 100644
index c46f0e5eb..000000000
--- a/app/templates/client/app/account(auth)/login/login(jade).jade
+++ /dev/null
@@ -1,45 +0,0 @@
-.container
- .row
- .col-sm-12
- h1 Login
- p
- | Accounts are reset on server restart from
- code server/config/seed.js
- | . Default account is
- code test@example.com
- | /
- code test
- p
- | Admin account is
- code admin@example.com
- | /
- code admin
-
- .col-sm-12
- form.form(name='form', ng-submit='vm.login(form)', novalidate='')
- .form-group
- label Email
- input.form-control(type='email', name='email', ng-model='vm.user.email')
- .form-group
- label Password
- input.form-control(type='password', name='password', ng-model='vm.user.password')
-
- .form-group.has-error
- p.help-block(ng-show='form.email.$error.required && form.password.$error.required && vm.submitted')
- | Please enter your email and password.
- p.help-block {{ vm.errors.other }}
-
- div
- button.btn.btn-inverse.btn-lg.btn-login(type='submit')
- | Login
- = ' '
- a.btn.btn-default.btn-lg.btn-register(<% if (filters.uirouter) { %>ui-sref='signup'<% } else { %>href='/signup'<% } %>)
- | Register
-<% if (filters.oauth) {%>
- hr
-
- .row
- .col-sm-4.col-md-3
- oauth-buttons(classes='btn-block')
-<% } %>
- hr
diff --git a/app/templates/client/app/account(auth)/login/login.controller.js b/app/templates/client/app/account(auth)/login/login.controller.js
deleted file mode 100644
index d53fcbe20..000000000
--- a/app/templates/client/app/account(auth)/login/login.controller.js
+++ /dev/null
@@ -1,34 +0,0 @@
-'use strict';
-
-class LoginController {
- constructor(Auth<% if (filters.ngroute) { %>, $location<% } %><% if (filters.uirouter) { %>, $state<% } %>) {
- this.user = {};
- this.errors = {};
- this.submitted = false;
-
- this.Auth = Auth;<% if (filters.ngroute) { %>
- this.$location = $location;<% } if (filters.uirouter) { %>
- this.$state = $state;<% } %>
- }
-
- login(form) {
- this.submitted = true;
-
- if (form.$valid) {
- this.Auth.login({
- email: this.user.email,
- password: this.user.password
- })
- .then(() => {
- // Logged in, redirect to home
- <% if (filters.ngroute) { %>this.$location.path('/');<% } %><% if (filters.uirouter) { %>this.$state.go('main');<% } %>
- })
- .catch(err => {
- this.errors.other = err.message;
- });
- }
- }
-}
-
-angular.module('<%= scriptAppName %>')
- .controller('LoginController', LoginController);
diff --git a/app/templates/client/app/account(auth)/settings/settings(jade).jade b/app/templates/client/app/account(auth)/settings/settings(jade).jade
deleted file mode 100644
index fc4bee87f..000000000
--- a/app/templates/client/app/account(auth)/settings/settings(jade).jade
+++ /dev/null
@@ -1,35 +0,0 @@
-.container
- .row
- .col-sm-12
- h1 Change Password
- .col-sm-12
- form.form(name='form', ng-submit='vm.changePassword(form)', novalidate='')
- .form-group
- label Current Password
- input.form-control(type='password'
- name='password'
- ng-model='vm.user.oldPassword'
- mongoose-error='')
- p.help-block(ng-show='form.password.$error.mongoose')
- | {{ vm.errors.other }}
- .form-group
- label New Password
- input.form-control(type='password'
- name='newPassword'
- ng-model='vm.user.newPassword'
- ng-minlength='3', required='')
- p.help-block(ng-show='(form.newPassword.$error.minlength || form.newPassword.$error.required) && (form.newPassword.$dirty || vm.submitted)')
- | Password must be at least 3 characters.
- .form-group
- label Confirm New Password
- input.form-control(type='password'
- name='confirmPassword'
- ng-model='vm.user.confirmPassword'
- match="vm.user.newPassword"
- ng-minlength='3', required='')
- p.help-block(ng-show='fvm.orm.confirmPassword.$error.match && vm.submitted')
- | Passwords must match.
-
- p.help-block {{ vm.message }}
-
- button.btn.btn-lg.btn-primary(type='submit') Save changes
diff --git a/app/templates/client/app/account(auth)/settings/settings.controller.js b/app/templates/client/app/account(auth)/settings/settings.controller.js
deleted file mode 100644
index cbaed8885..000000000
--- a/app/templates/client/app/account(auth)/settings/settings.controller.js
+++ /dev/null
@@ -1,29 +0,0 @@
-'use strict';
-
-class SettingsController {
- constructor(Auth) {
- this.errors = {};
- this.submitted = false;
-
- this.Auth = Auth;
- }
-
- changePassword(form) {
- this.submitted = true;
-
- if (form.$valid) {
- this.Auth.changePassword(this.user.oldPassword, this.user.newPassword)
- .then(() => {
- this.message = 'Password successfully changed.';
- })
- .catch(() => {
- form.password.$setValidity('mongoose', false);
- this.errors.other = 'Incorrect password';
- this.message = '';
- });
- }
- }
-}
-
-angular.module('<%= scriptAppName %>')
- .controller('SettingsController', SettingsController);
diff --git a/app/templates/client/app/account(auth)/signup/signup(html).html b/app/templates/client/app/account(auth)/signup/signup(html).html
deleted file mode 100644
index 6b6cad4b7..000000000
--- a/app/templates/client/app/account(auth)/signup/signup(html).html
+++ /dev/null
@@ -1,86 +0,0 @@
-
diff --git a/app/templates/client/app/account(auth)/signup/signup(jade).jade b/app/templates/client/app/account(auth)/signup/signup(jade).jade
deleted file mode 100644
index 51480eefb..000000000
--- a/app/templates/client/app/account(auth)/signup/signup(jade).jade
+++ /dev/null
@@ -1,63 +0,0 @@
-.container
- .row
- .col-sm-12
- h1 Sign up
- .col-sm-12
- form.form(name='form', ng-submit='vm.register(form)', novalidate='')
- .form-group(ng-class='{ "has-success": form.name.$valid && vm.submitted,\
- "has-error": form.name.$invalid && vm.submitted }')
- label Name
- input.form-control(type='text', name='name', ng-model='vm.user.name', required='')
- p.help-block(ng-show='form.name.$error.required && vm.submitted')
- | A name is required
-
- .form-group(ng-class='{ "has-success": form.email.$valid && vm.submitted,\
- "has-error": form.email.$invalid && vm.submitted }')
- label Email
- input.form-control(type='email', name='email', ng-model='vm.user.email', required='', mongoose-error='')
- p.help-block(ng-show='form.email.$error.email && vm.submitted')
- | Doesn't look like a valid email.
- p.help-block(ng-show='form.email.$error.required && vm.submitted')
- | What's your email address?
- p.help-block(ng-show='form.email.$error.mongoose')
- | {{ vm.errors.email }}
-
- .form-group(ng-class='{ "has-success": form.password.$valid && vm.submitted,\
- "has-error": form.password.$invalid && vm.submitted }')
- label Password
- input.form-control(type='password'
- name='password'
- ng-model='vm.user.password'
- mongoose-error=''
- ng-minlength='3', required='')
-
- p.help-block(ng-show='(form.password.$error.minlength || form.password.$error.required) && vm.submitted')
- | Password must be at least 3 characters.
- p.help-block(ng-show='form.password.$error.mongoose')
- | {{ vm.errors.password }}
-
- .form-group(ng-class='{ "has-success": form.confirmPassword.$valid && vm.submitted,\
- "has-error": form.confirmPassword.$invalid && vm.submitted }')
- label Confirm Password
- input.form-control(type='password'
- name='confirmPassword'
- ng-model='vm.user.confirmPassword'
- match="vm.user.password"
- ng-minlength='3', required='')
- p.help-block(ng-show='form.confirmPassword.$error.match && vm.submitted')
- | Passwords must match.
-
- div
- button.btn.btn-inverse.btn-lg.btn-register(type='submit')
- | Sign up
- = ' '
- a.btn.btn-default.btn-lg.btn-login(<% if (filters.uirouter) { %>ui-sref='login'<% } else { %>href='/login'<% } %>)
- | Login
-<% if (filters.oauth) {%>
- hr
-
- .row
- .col-sm-4.col-md-3
- oauth-buttons(classes='btn-block')
-<% } %>
- hr
diff --git a/app/templates/client/app/account(auth)/signup/signup.controller.js b/app/templates/client/app/account(auth)/signup/signup.controller.js
deleted file mode 100644
index a6f83fb58..000000000
--- a/app/templates/client/app/account(auth)/signup/signup.controller.js
+++ /dev/null
@@ -1,52 +0,0 @@
-'use strict';
-
-class SignupController {
- //start-non-standard
- user = {};
- errors = {};
- submitted = false;
- //end-non-standard
-
- constructor(Auth<% if (filters.ngroute) { %>, $location<% } %><% if (filters.uirouter) { %>, $state<% } %>) {
- this.Auth = Auth;<% if (filters.ngroute) { %>
- this.$location = $location;<% } if (filters.uirouter) { %>
- this.$state = $state;<% } %>
- }
-
- register(form) {
- this.submitted = true;
-
- if (form.$valid) {
- this.Auth.createUser({
- name: this.user.name,
- email: this.user.email,
- password: this.user.password
- })
- .then(() => {
- // Account created, redirect to home
- <% if (filters.ngroute) { %>this.$location.path('/');<% } %><% if (filters.uirouter) { %>this.$state.go('main');<% } %>
- })
- .catch(err => {
- err = err.data;
- this.errors = {};
-<% if (filters.mongooseModels) { %>
- // Update validity of form fields that match the mongoose errors
- angular.forEach(err.errors, (error, field) => {
- form[field].$setValidity('mongoose', false);
- this.errors[field] = error.message;
- });<% }
-if (filters.sequelizeModels) { %>
- // Update validity of form fields that match the sequelize errors
- if (err.name) {
- angular.forEach(err.fields, field => {
- form[field].$setValidity('mongoose', false);
- this.errors[field] = err.message;
- });
- }<% } %>
- });
- }
- }
-}
-
-angular.module('<%= scriptAppName %>')
- .controller('SignupController', SignupController);
diff --git a/app/templates/client/app/admin(auth)/admin(html).html b/app/templates/client/app/admin(auth)/admin(html).html
deleted file mode 100644
index cbbe68a40..000000000
--- a/app/templates/client/app/admin(auth)/admin(html).html
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
The delete user and user index api routes are restricted to users with the 'admin' role.
-
-
diff --git a/app/templates/client/app/admin(auth)/admin(jade).jade b/app/templates/client/app/admin(auth)/admin(jade).jade
deleted file mode 100644
index 7da628335..000000000
--- a/app/templates/client/app/admin(auth)/admin(jade).jade
+++ /dev/null
@@ -1,10 +0,0 @@
-.container
- p
- | The delete user and user index api routes are restricted to users with the 'admin' role.
- ul.list-group
- li.list-group-item(ng-repeat='user in admin.users')
- strong {{user.name}}
- br
- span.text-muted {{user.email}}
- a.trash(ng-click='admin.delete(user)')
- span.glyphicon.glyphicon-trash.pull-right
diff --git a/app/templates/client/app/admin(auth)/admin.controller.js b/app/templates/client/app/admin(auth)/admin.controller.js
deleted file mode 100644
index 43964511a..000000000
--- a/app/templates/client/app/admin(auth)/admin.controller.js
+++ /dev/null
@@ -1,20 +0,0 @@
-'use strict';
-
-(function() {
-
-class AdminController {
- constructor(User) {
- // Use the User $resource to fetch all users
- this.users = User.query();
- }
-
- delete(user) {
- user.$remove();
- this.users.splice(this.users.indexOf(user), 1);
- }
-}
-
-angular.module('<%= scriptAppName %>.admin')
- .controller('AdminController', AdminController);
-
-})();
diff --git a/app/templates/client/app/admin(auth)/admin.module.js b/app/templates/client/app/admin(auth)/admin.module.js
deleted file mode 100644
index da769ae91..000000000
--- a/app/templates/client/app/admin(auth)/admin.module.js
+++ /dev/null
@@ -1,7 +0,0 @@
-'use strict';
-
-angular.module('<%= scriptAppName %>.admin', [
- '<%= scriptAppName %>.auth'<% if (filters.ngroute) { %>,
- 'ngRoute'<% } if (filters.uirouter) { %>,
- 'ui.router'<% } %>
-]);
diff --git a/app/templates/client/app/admin(auth)/admin.router.js b/app/templates/client/app/admin(auth)/admin.router.js
deleted file mode 100644
index cc3d9e9f9..000000000
--- a/app/templates/client/app/admin(auth)/admin.router.js
+++ /dev/null
@@ -1,21 +0,0 @@
-'use strict';
-
-angular.module('<%= scriptAppName %>.admin')
- <% if (filters.ngroute) { %>.config(function($routeProvider) {
- $routeProvider
- .when('/admin', {
- templateUrl: 'app/admin/admin.html',
- controller: 'AdminController',
- controllerAs: 'admin',
- authenticate: 'admin'
- });
- });<% } if (filters.uirouter) { %>.config(function($stateProvider) {
- $stateProvider
- .state('admin', {
- url: '/admin',
- templateUrl: 'app/admin/admin.html',
- controller: 'AdminController',
- controllerAs: 'admin',
- authenticate: 'admin'
- });
- });<% } %>
diff --git a/app/templates/client/app/app(css).css b/app/templates/client/app/app(css).css
deleted file mode 100644
index 2dbd1e8c5..000000000
--- a/app/templates/client/app/app(css).css
+++ /dev/null
@@ -1,46 +0,0 @@
-<% if (filters.bootstrap) { %>
-/**
- * Bootstrap Fonts
- */
-
-@font-face {
- font-family: 'Glyphicons Halflings';
- src: url('../bower_components/bootstrap/fonts/glyphicons-halflings-regular.eot');
- src: url('../bower_components/bootstrap/fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),
- url('../bower_components/bootstrap/fonts/glyphicons-halflings-regular.woff') format('woff'),
- url('../bower_components/bootstrap/fonts/glyphicons-halflings-regular.ttf') format('truetype'),
- url('../bower_components/bootstrap/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
-}<% } %>
-
-/**
- *Font Awesome Fonts
- */
-
-@font-face {
- font-family: 'FontAwesome';
- src: url('../bower_components/font-awesome/fonts/fontawesome-webfont.eot?v=4.1.0');
- src: url('../bower_components/font-awesome/fonts/fontawesome-webfont.eot?#iefix&v=4.1.0') format('embedded-opentype'),
- url('../bower_components/font-awesome/fonts/fontawesome-webfont.woff?v=4.1.0') format('woff'),
- url('../bower_components/font-awesome/fonts/fontawesome-webfont.ttf?v=4.1.0') format('truetype'),
- url('../bower_components/font-awesome/fonts/fontawesome-webfont.svg?v=4.1.0#fontawesomeregular') format('svg');
- font-weight: normal;
- font-style: normal;
-}
-
-/**
- * App-wide Styles
- */
-
-.browserupgrade {
- margin: 0.2em 0;
- background: #ccc;
- color: #000;
- padding: 0.2em 0;
-}
-<% if(!filters.bootstrap) { %>
-/* Responsive: Portrait tablets and up */
-@media screen and (min-width: 768px) {
- .container {
- max-width: 730px;
- }
-}<% } %>
diff --git a/app/templates/client/app/app(less).less b/app/templates/client/app/app(less).less
deleted file mode 100644
index 44268cf9f..000000000
--- a/app/templates/client/app/app(less).less
+++ /dev/null
@@ -1,29 +0,0 @@
-<% if (filters.bootstrap) { %>@import '../bower_components/bootstrap/less/bootstrap.less';
-<% if(filters.oauth) { %>@import '../bower_components/bootstrap-social/bootstrap-social.less';
-<% }} %>@import '../bower_components/font-awesome/less/font-awesome.less';
-
-<% if (filters.bootstrap) { %>@icon-font-path: '../bower_components/bootstrap/fonts/';<% } %>
-@fa-font-path: '../bower_components/font-awesome/fonts';
-
-/**
- * App-wide Styles
- */
-
-.browserupgrade {
- margin: 0.2em 0;
- background: #ccc;
- color: #000;
- padding: 0.2em 0;
-}
-<% if(!filters.bootstrap) { %>
-/* Responsive: Portrait tablets and up */
-@media screen and (min-width: 768px) {
- .container {
- max-width: 730px;
- }
-}
-<% } %>
-/* inject:less */
-@import 'admin/admin.less';
-@import 'main/main.less';
-/* endinject */
diff --git a/app/templates/client/app/app(sass).scss b/app/templates/client/app/app(sass).scss
deleted file mode 100644
index 0191121c1..000000000
--- a/app/templates/client/app/app(sass).scss
+++ /dev/null
@@ -1,29 +0,0 @@
-<% if (filters.bootstrap) { %>$icon-font-path: "../bower_components/bootstrap-sass-official/vendor/assets/fonts/bootstrap/";
-@import '../bower_components/bootstrap-sass-official/vendor/assets/stylesheets/bootstrap';
-<% if(filters.oauth) { %>@import '../bower_components/bootstrap-social/bootstrap-social.scss';
-<% }} %>$fa-font-path: "../bower_components/font-awesome/fonts";
-@import '../bower_components/font-awesome/scss/font-awesome';
-
-/**
- * App-wide Styles
- */
-
-.browserupgrade {
- margin: 0.2em 0;
- background: #ccc;
- color: #000;
- padding: 0.2em 0;
-}
-<% if(!filters.bootstrap) { %>
-/* Responsive: Portrait tablets and up */
-@media screen and (min-width: 768px) {
- .container {
- max-width: 730px;
- }
-}
-<% } %>
-// Component styles are injected through grunt
-/* inject:scss */
-@import 'admin/admin.scss';
-@import 'main/main.scss';
-/* endinject */
diff --git a/app/templates/client/app/app(stylus).styl b/app/templates/client/app/app(stylus).styl
deleted file mode 100644
index ca1778ffd..000000000
--- a/app/templates/client/app/app(stylus).styl
+++ /dev/null
@@ -1,50 +0,0 @@
-@import "../bower_components/font-awesome/css/font-awesome.css"
-<% if (filters.bootstrap) { %>@import "../bower_components/bootstrap/dist/css/bootstrap.css"
-<% if (filters.oauth) { %>@import "../bower_components/bootstrap-social/bootstrap-social.css"
-<% } %>
-//
-// Bootstrap Fonts
-//
-
-@font-face
- font-family: 'Glyphicons Halflings'
- src: url('../bower_components/bootstrap/fonts/glyphicons-halflings-regular.eot')
- src: url('../bower_components/bootstrap/fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),
- url('../bower_components/bootstrap/fonts/glyphicons-halflings-regular.woff') format('woff'),
- url('../bower_components/bootstrap/fonts/glyphicons-halflings-regular.ttf') format('truetype'),
- url('../bower_components/bootstrap/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
-<% } %>
-//
-// Font Awesome Fonts
-//
-
-@font-face
- font-family: 'FontAwesome'
- src: url('../bower_components/font-awesome/fonts/fontawesome-webfont.eot?v=4.1.0')
- src: url('../bower_components/font-awesome/fonts/fontawesome-webfont.eot?#iefix&v=4.1.0') format('embedded-opentype'),
- url('../bower_components/font-awesome/fonts/fontawesome-webfont.woff?v=4.1.0') format('woff'),
- url('../bower_components/font-awesome/fonts/fontawesome-webfont.ttf?v=4.1.0') format('truetype'),
- url('../bower_components/font-awesome/fonts/fontawesome-webfont.svg?v=4.1.0#fontawesomeregular') format('svg');
- font-weight: normal
- font-style: normal
-
-//
-// App-wide Styles
-//
-
-.browserupgrade
- background #ccc
- color #000
- margin 0.2em 0
- padding 0.2em 0
-<% if(!filters.bootstrap) { %>
-// Responsive: Portrait tablets and up
-@media screen and (min-width: 768px)
- .container
- max-width 730px
-<% } %>
-// Component styles are injected through grunt
-/* inject:styl */
-@import "admin/admin"
-@import "main/main"
-/* endinject */
diff --git a/app/templates/client/app/app.js b/app/templates/client/app/app.js
deleted file mode 100644
index a9d9f2b09..000000000
--- a/app/templates/client/app/app.js
+++ /dev/null
@@ -1,13 +0,0 @@
-'use strict';
-
-angular.module('<%= scriptAppName %>', [<%- angularModules %>])
- .config(function(<% if (filters.ngroute) { %>$routeProvider<% } if (filters.uirouter) { %>$urlRouterProvider<% } %>, $locationProvider) {<% if (filters.ngroute) { %>
- $routeProvider
- .otherwise({
- redirectTo: '/'
- });<% } if (filters.uirouter) { %>
- $urlRouterProvider
- .otherwise('/');<% } %>
-
- $locationProvider.html5Mode(true);
- });
diff --git a/app/templates/client/app/main/main(jade).jade b/app/templates/client/app/main/main(jade).jade
deleted file mode 100644
index 5084e5f22..000000000
--- a/app/templates/client/app/main/main(jade).jade
+++ /dev/null
@@ -1,22 +0,0 @@
-header#banner.hero-unit
- .container
- h1 'Allo, 'Allo!
- p.lead Kick-start your next web app with Angular Fullstack
- img(src='assets/images/yeoman.png', alt='I\'m Yeoman')
-
-.container
- .row
- .col-lg-12
- h1.page-header Features:
- ul.nav.nav-tabs.nav-stacked.col-md-4.col-lg-4.col-sm-6(ng-repeat='thing in $ctrl.awesomeThings')
- li
- a(href='#', uib-tooltip='{{thing.info}}')
- | {{thing.name}}<% if (filters.socketio) { %>
- button.close(type='button', ng-click='$ctrl.deleteThing(thing)') ×<% } %><% if (filters.socketio) { %>
-
- form.thing-form
- label Syncs in realtime across clients
- p.input-group
- input.form-control(type='text', placeholder='Add a new thing here.', ng-model='$ctrl.newThing')
- span.input-group-btn
- button.btn.btn-primary(type='submit', ng-click='$ctrl.addThing()') Add New<% } %>
diff --git a/app/templates/client/app/main/main.controller.js b/app/templates/client/app/main/main.controller.js
deleted file mode 100644
index 02f408164..000000000
--- a/app/templates/client/app/main/main.controller.js
+++ /dev/null
@@ -1,42 +0,0 @@
-'use strict';
-
-(function() {
-
-class MainController {
-
- constructor($http<% if (filters.socketio) { %>, $scope, socket<% } %>) {
- this.$http = $http;<% if (filters.socketio) { %>
- this.socket = socket;<% } %>
- this.awesomeThings = [];<% if (filters.socketio) { %>
-
- $scope.$on('$destroy', function() {
- socket.unsyncUpdates('thing');
- });<% } %>
- }
-
- $onInit() {
- this.$http.get('/api/things').then(response => {
- this.awesomeThings = response.data;<% if (filters.socketio) { %>
- this.socket.syncUpdates('thing', this.awesomeThings);<% } %>
- });
- }<% if (filters.models) { %>
-
- addThing() {
- if (this.newThing) {
- this.$http.post('/api/things', { name: this.newThing });
- this.newThing = '';
- }
- }
-
- deleteThing(thing) {
- this.$http.delete('/api/things/' + thing._id);
- }<% } %>
-}
-
-angular.module('<%= scriptAppName %>')
- .component('main', {
- templateUrl: 'app/main/main.html',
- controller: MainController
- });
-
-})();
diff --git a/app/templates/client/app/main/main.controller.spec.js b/app/templates/client/app/main/main.controller.spec.js
deleted file mode 100644
index 67982faa0..000000000
--- a/app/templates/client/app/main/main.controller.spec.js
+++ /dev/null
@@ -1,42 +0,0 @@
-'use strict';
-
-describe('Component: mainComponent', function() {
-
- // load the controller's module
- beforeEach(module('<%= scriptAppName %>'));<% if (filters.uirouter) {%>
- beforeEach(module('stateMock'));<% } %><% if (filters.socketio) {%>
- beforeEach(module('socketMock'));<% } %>
-
- var scope;
- var mainComponent;<% if (filters.uirouter) {%>
- var state;<% } %>
- var $httpBackend;
-
- // Initialize the controller and a mock scope
- beforeEach(inject(function(
- _$httpBackend_,
- $http,
- $componentController,
- $rootScope<% if (filters.uirouter) {%>,
- $state<% } %><% if (filters.socketio) {%>,
- socket<% } %>) {
- $httpBackend = _$httpBackend_;
- $httpBackend.expectGET('/api/things')
- .respond(['HTML5 Boilerplate', 'AngularJS', 'Karma', 'Express']);
-
- scope = $rootScope.$new();<% if (filters.uirouter) {%>
- state = $state;<% } %>
- mainComponent = $componentController('main', {
- $http: $http,
- $scope: scope<% if (filters.socketio) {%>,
- socket: socket<% } %>
- });
- }));
-
- it('should attach a list of things to the controller', function() {
- mainComponent.$onInit();
- $httpBackend.flush();<% if (filters.jasmine) { %>
- expect(mainComponent.awesomeThings.length).toBe(4);<% } if (filters.mocha) { %>
- <%= expect() %>mainComponent.awesomeThings.length<%= to() %>.equal(4);<% } %>
- });
-});
diff --git a/app/templates/client/app/main/main.js b/app/templates/client/app/main/main.js
deleted file mode 100644
index 9d5f59887..000000000
--- a/app/templates/client/app/main/main.js
+++ /dev/null
@@ -1,15 +0,0 @@
-'use strict';
-
-angular.module('<%= scriptAppName %>')
- <% if (filters.ngroute) { %>.config(function($routeProvider) {
- $routeProvider
- .when('/', {
- template: ''
- });
- });<% } %><% if (filters.uirouter) { %>.config(function($stateProvider) {
- $stateProvider
- .state('main', {
- url: '/',
- template: ''
- });
- });<% } %>
diff --git a/app/templates/client/components/auth(auth)/auth.module.js b/app/templates/client/components/auth(auth)/auth.module.js
deleted file mode 100644
index 60ce6e321..000000000
--- a/app/templates/client/components/auth(auth)/auth.module.js
+++ /dev/null
@@ -1,12 +0,0 @@
-'use strict';
-
-angular.module('<%= scriptAppName %>.auth', [
- '<%= scriptAppName %>.constants',
- '<%= scriptAppName %>.util',
- 'ngCookies'<% if (filters.ngroute) { %>,
- 'ngRoute'<% } if (filters.uirouter) { %>,
- 'ui.router'<% } %>
-])
- .config(function($httpProvider) {
- $httpProvider.interceptors.push('authInterceptor');
- });
diff --git a/app/templates/client/components/auth(auth)/auth.service.js b/app/templates/client/components/auth(auth)/auth.service.js
deleted file mode 100644
index dbb13603a..000000000
--- a/app/templates/client/components/auth(auth)/auth.service.js
+++ /dev/null
@@ -1,189 +0,0 @@
-'use strict';
-
-(function() {
-
-function AuthService($location, $http, $cookies, $q, appConfig, Util, User) {
- var safeCb = Util.safeCb;
- var currentUser = {};
- var userRoles = appConfig.userRoles || [];
-
- if ($cookies.get('token') && $location.path() !== '/logout') {
- currentUser = User.get();
- }
-
- var Auth = {
-
- /**
- * Authenticate user and save token
- *
- * @param {Object} user - login info
- * @param {Function} callback - optional, function(error, user)
- * @return {Promise}
- */
- login({email, password}, callback) {
- return $http.post('/auth/local', {
- email: email,
- password: password
- })
- .then(res => {
- $cookies.put('token', res.data.token);
- currentUser = User.get();
- return currentUser.$promise;
- })
- .then(user => {
- safeCb(callback)(null, user);
- return user;
- })
- .catch(err => {
- Auth.logout();
- safeCb(callback)(err.data);
- return $q.reject(err.data);
- });
- },
-
- /**
- * Delete access token and user info
- */
- logout() {
- $cookies.remove('token');
- currentUser = {};
- },
-
- /**
- * Create a new user
- *
- * @param {Object} user - user info
- * @param {Function} callback - optional, function(error, user)
- * @return {Promise}
- */
- createUser(user, callback) {
- return User.save(user,
- function(data) {
- $cookies.put('token', data.token);
- currentUser = User.get();
- return safeCb(callback)(null, user);
- },
- function(err) {
- Auth.logout();
- return safeCb(callback)(err);
- }).$promise;
- },
-
- /**
- * Change password
- *
- * @param {String} oldPassword
- * @param {String} newPassword
- * @param {Function} callback - optional, function(error, user)
- * @return {Promise}
- */
- changePassword(oldPassword, newPassword, callback) {
- return User.changePassword({ id: currentUser._id }, {
- oldPassword: oldPassword,
- newPassword: newPassword
- }, function() {
- return safeCb(callback)(null);
- }, function(err) {
- return safeCb(callback)(err);
- }).$promise;
- },
-
- /**
- * Gets all available info on a user
- * (synchronous|asynchronous)
- *
- * @param {Function|*} callback - optional, funciton(user)
- * @return {Object|Promise}
- */
- getCurrentUser(callback) {
- if (arguments.length === 0) {
- return currentUser;
- }
-
- var value = (currentUser.hasOwnProperty('$promise')) ?
- currentUser.$promise : currentUser;
- return $q.when(value)
- .then(user => {
- safeCb(callback)(user);
- return user;
- }, () => {
- safeCb(callback)({});
- return {};
- });
- },
-
- /**
- * Check if a user is logged in
- * (synchronous|asynchronous)
- *
- * @param {Function|*} callback - optional, function(is)
- * @return {Bool|Promise}
- */
- isLoggedIn(callback) {
- if (arguments.length === 0) {
- return currentUser.hasOwnProperty('role');
- }
-
- return Auth.getCurrentUser(null)
- .then(user => {
- var is = user.hasOwnProperty('role');
- safeCb(callback)(is);
- return is;
- });
- },
-
- /**
- * Check if a user has a specified role or higher
- * (synchronous|asynchronous)
- *
- * @param {String} role - the role to check against
- * @param {Function|*} callback - optional, function(has)
- * @return {Bool|Promise}
- */
- hasRole(role, callback) {
- var hasRole = function(r, h) {
- return userRoles.indexOf(r) >= userRoles.indexOf(h);
- };
-
- if (arguments.length < 2) {
- return hasRole(currentUser.role, role);
- }
-
- return Auth.getCurrentUser(null)
- .then(user => {
- var has = (user.hasOwnProperty('role')) ?
- hasRole(user.role, role) : false;
- safeCb(callback)(has);
- return has;
- });
- },
-
- /**
- * Check if a user is an admin
- * (synchronous|asynchronous)
- *
- * @param {Function|*} callback - optional, function(is)
- * @return {Bool|Promise}
- */
- isAdmin() {
- return Auth.hasRole
- .apply(Auth, [].concat.apply(['admin'], arguments));
- },
-
- /**
- * Get auth token
- *
- * @return {String} - a token string used for authenticating
- */
- getToken() {
- return $cookies.get('token');
- }
- };
-
- return Auth;
-}
-
-angular.module('<%= scriptAppName %>.auth')
- .factory('Auth', AuthService);
-
-})();
diff --git a/app/templates/client/components/auth(auth)/interceptor.service.js b/app/templates/client/components/auth(auth)/interceptor.service.js
deleted file mode 100644
index 72c3441b0..000000000
--- a/app/templates/client/components/auth(auth)/interceptor.service.js
+++ /dev/null
@@ -1,32 +0,0 @@
-'use strict';
-
-(function() {
-
-function authInterceptor($rootScope, $q, $cookies<% if (filters.ngroute) { %>, $location<% } if (filters.uirouter) { %>, $injector<% } %>, Util) {
- <% if (filters.uirouter) { %>var state;
- <% } %>return {
- // Add authorization token to headers
- request(config) {
- config.headers = config.headers || {};
- if ($cookies.get('token') && Util.isSameOrigin(config.url)) {
- config.headers.Authorization = 'Bearer ' + $cookies.get('token');
- }
- return config;
- },
-
- // Intercept 401s and redirect you to login
- responseError(response) {
- if (response.status === 401) {
- <% if (filters.ngroute) { %>$location.path('/login');<% } if (filters.uirouter) { %>(state || (state = $injector.get('$state'))).go('login');<% } %>
- // remove any stale tokens
- $cookies.remove('token');
- }
- return $q.reject(response);
- }
- };
-}
-
-angular.module('<%= scriptAppName %>.auth')
- .factory('authInterceptor', authInterceptor);
-
-})();
diff --git a/app/templates/client/components/auth(auth)/router.decorator.js b/app/templates/client/components/auth(auth)/router.decorator.js
deleted file mode 100644
index 5b8fb0e6a..000000000
--- a/app/templates/client/components/auth(auth)/router.decorator.js
+++ /dev/null
@@ -1,39 +0,0 @@
-'use strict';
-
-(function() {
-
-angular.module('<%= scriptAppName %>.auth')
- .run(function($rootScope<% if (filters.ngroute) { %>, $location<% } if (filters.uirouter) { %>, $state<% } %>, Auth) {
- // Redirect to login if route requires auth and the user is not logged in, or doesn't have required role
- $rootScope.$on(<% if (filters.ngroute) { %>'$routeChangeStart'<% } %><% if (filters.uirouter) { %>'$stateChangeStart'<% } %>, function(event, next) {
- if (!next.authenticate) {
- return;
- }
-
- if (typeof next.authenticate === 'string') {
- Auth.hasRole(next.authenticate, _.noop).then(has => {
- if (has) {
- return;
- }
-
- event.preventDefault();
- return Auth.isLoggedIn(_.noop).then(is => {<% if (filters.ngroute) { %>
- $location.path(is ? '/' : '/login');<% } if (filters.uirouter) { %>
- $state.go(is ? 'main' : 'login');<% } %>
- });
- });
- } else {
- Auth.isLoggedIn(_.noop).then(is => {
- if (is) {
- return;
- }
-
- event.preventDefault();<% if (filters.ngroute) { %>
- $location.path('/');<% } if (filters.uirouter) { %>
- $state.go('main');<% } %>
- });
- }
- });
- });
-
-})();
diff --git a/app/templates/client/components/auth(auth)/user.service.js b/app/templates/client/components/auth(auth)/user.service.js
deleted file mode 100644
index 63f4040d0..000000000
--- a/app/templates/client/components/auth(auth)/user.service.js
+++ /dev/null
@@ -1,27 +0,0 @@
-'use strict';
-
-(function() {
-
-function UserResource($resource) {
- return $resource('/api/users/:id/:controller', {
- id: '@_id'
- }, {
- changePassword: {
- method: 'PUT',
- params: {
- controller: 'password'
- }
- },
- get: {
- method: 'GET',
- params: {
- id: 'me'
- }
- }
- });
-}
-
-angular.module('<%= scriptAppName %>.auth')
- .factory('User', UserResource);
-
-})();
diff --git a/app/templates/client/components/footer/footer(html).html b/app/templates/client/components/footer/footer(html).html
deleted file mode 100644
index 35225475d..000000000
--- a/app/templates/client/components/footer/footer(html).html
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
Angular Fullstack v<%= rootGeneratorVersion() %> |
- @tyhenkel |
- Issues
-
-
diff --git a/app/templates/client/components/footer/footer(jade).jade b/app/templates/client/components/footer/footer(jade).jade
deleted file mode 100644
index 31c5ca960..000000000
--- a/app/templates/client/components/footer/footer(jade).jade
+++ /dev/null
@@ -1,7 +0,0 @@
-.container
- p
- | Angular Fullstack v<%= rootGeneratorVersion() %>
- = ' | '
- a(href='https://twitter.com/tyhenkel') @tyhenkel
- = ' | '
- a(href='https://github.com/DaftMonk/generator-angular-fullstack/issues?state=open') Issues
diff --git a/app/templates/client/components/footer/footer.directive.js b/app/templates/client/components/footer/footer.directive.js
deleted file mode 100644
index 9ed31900c..000000000
--- a/app/templates/client/components/footer/footer.directive.js
+++ /dev/null
@@ -1,12 +0,0 @@
-'use strict';
-
-angular.module('<%= scriptAppName %>')
- .directive('footer', function() {
- return {
- templateUrl: 'components/footer/footer.html',
- restrict: 'E',
- link: function(scope, element) {
- element.addClass('footer');
- }
- };
- });
diff --git a/app/templates/client/components/modal(uibootstrap)/modal(css).css b/app/templates/client/components/modal(uibootstrap)/modal(css).css
deleted file mode 100644
index ae0406856..000000000
--- a/app/templates/client/components/modal(uibootstrap)/modal(css).css
+++ /dev/null
@@ -1,23 +0,0 @@
-.modal-primary .modal-header,
-.modal-info .modal-header,
-.modal-success .modal-header,
-.modal-warning .modal-header,
-.modal-danger .modal-header {
- color: #fff;
- border-radius: 5px 5px 0 0;
-}
-.modal-primary .modal-header {
- background: #428bca;
-}
-.modal-info .modal-header {
- background: #5bc0de;
-}
-.modal-success .modal-header {
- background: #5cb85c;
-}
-.modal-warning .modal-header {
- background: #f0ad4e;
-}
-.modal-danger .modal-header {
- background: #d9534f;
-}
diff --git a/app/templates/client/components/modal(uibootstrap)/modal(html).html b/app/templates/client/components/modal(uibootstrap)/modal(html).html
deleted file mode 100644
index f04d0db03..000000000
--- a/app/templates/client/components/modal(uibootstrap)/modal(html).html
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
diff --git a/app/templates/client/components/modal(uibootstrap)/modal(jade).jade b/app/templates/client/components/modal(uibootstrap)/modal(jade).jade
deleted file mode 100644
index 71b4321b3..000000000
--- a/app/templates/client/components/modal(uibootstrap)/modal(jade).jade
+++ /dev/null
@@ -1,8 +0,0 @@
-.modal-header
- button.close(ng-if='modal.dismissable', type='button', ng-click='$dismiss()') ×
- h4.modal-title(ng-if='modal.title', ng-bind='modal.title')
-.modal-body
- p(ng-if='modal.text', ng-bind='modal.text')
- div(ng-if='modal.html', ng-bind-html='modal.html')
-.modal-footer
- button.btn(ng-repeat='button in modal.buttons', ng-class='button.classes', ng-click='button.click($event)', ng-bind='button.text')
diff --git a/app/templates/client/components/modal(uibootstrap)/modal(less).less b/app/templates/client/components/modal(uibootstrap)/modal(less).less
deleted file mode 100644
index dd1357d2c..000000000
--- a/app/templates/client/components/modal(uibootstrap)/modal(less).less
+++ /dev/null
@@ -1,25 +0,0 @@
-.modal-primary,
-.modal-info,
-.modal-success,
-.modal-warning,
-.modal-danger {
- .modal-header {
- color: #fff;
- border-radius: 5px 5px 0 0;
- }
-}
-.modal-primary .modal-header {
- background: @brand-primary;
-}
-.modal-info .modal-header {
- background: @brand-info;
-}
-.modal-success .modal-header {
- background: @brand-success;
-}
-.modal-warning .modal-header {
- background: @brand-warning;
-}
-.modal-danger .modal-header {
- background: @brand-danger;
-}
diff --git a/app/templates/client/components/modal(uibootstrap)/modal(sass).scss b/app/templates/client/components/modal(uibootstrap)/modal(sass).scss
deleted file mode 100644
index 3b0b9d96a..000000000
--- a/app/templates/client/components/modal(uibootstrap)/modal(sass).scss
+++ /dev/null
@@ -1,25 +0,0 @@
-.modal-primary,
-.modal-info,
-.modal-success,
-.modal-warning,
-.modal-danger {
- .modal-header {
- color: #fff;
- border-radius: 5px 5px 0 0;
- }
-}
-.modal-primary .modal-header {
- background: $brand-primary;
-}
-.modal-info .modal-header {
- background: $brand-info;
-}
-.modal-success .modal-header {
- background: $brand-success;
-}
-.modal-warning .modal-header {
- background: $brand-warning;
-}
-.modal-danger .modal-header {
- background: $brand-danger;
-}
diff --git a/app/templates/client/components/modal(uibootstrap)/modal(stylus).styl b/app/templates/client/components/modal(uibootstrap)/modal(stylus).styl
deleted file mode 100644
index d394ee047..000000000
--- a/app/templates/client/components/modal(uibootstrap)/modal(stylus).styl
+++ /dev/null
@@ -1,23 +0,0 @@
-.modal-primary
-.modal-info
-.modal-success
-.modal-warning
-.modal-danger
- .modal-header
- color #fff
- border-radius 5px 5px 0 0
-
-.modal-primary .modal-header
- background #428bca
-
-.modal-info .modal-header
- background #5bc0de
-
-.modal-success .modal-header
- background #5cb85c
-
-.modal-warning .modal-header
- background #f0ad4e
-
-.modal-danger .modal-header
- background #d9534f
diff --git a/app/templates/client/components/modal(uibootstrap)/modal.service.js b/app/templates/client/components/modal(uibootstrap)/modal.service.js
deleted file mode 100644
index d7807e6b5..000000000
--- a/app/templates/client/components/modal(uibootstrap)/modal.service.js
+++ /dev/null
@@ -1,73 +0,0 @@
-'use strict';
-
-angular.module('<%= scriptAppName %>')
- .factory('Modal', function($rootScope, $uibModal) {
- /**
- * Opens a modal
- * @param {Object} scope - an object to be merged with modal's scope
- * @param {String} modalClass - (optional) class(es) to be applied to the modal
- * @return {Object} - the instance $uibModal.open() returns
- */
- function openModal(scope = {}, modalClass = 'modal-default') {
- var modalScope = $rootScope.$new();
-
- angular.extend(modalScope, scope);
-
- return $uibModal.open({
- templateUrl: 'components/modal/modal.html',
- windowClass: modalClass,
- scope: modalScope
- });
- }
-
- // Public API here
- return {
-
- /* Confirmation modals */
- confirm: {
-
- /**
- * Create a function to open a delete confirmation modal (ex. ng-click='myModalFn(name, arg1, arg2...)')
- * @param {Function} del - callback, ran when delete is confirmed
- * @return {Function} - the function to open the modal (ex. myModalFn)
- */
- delete(del = angular.noop) {
- /**
- * Open a delete confirmation modal
- * @param {String} name - name or info to show on modal
- * @param {All} - any additional args are passed straight to del callback
- */
- return function() {
- var args = Array.prototype.slice.call(arguments),
- name = args.shift(),
- deleteModal;
-
- deleteModal = openModal({
- modal: {
- dismissable: true,
- title: 'Confirm Delete',
- html: 'Are you sure you want to delete ' + name + ' ?
',
- buttons: [{
- classes: 'btn-danger',
- text: 'Delete',
- click: function(e) {
- deleteModal.close(e);
- }
- }, {
- classes: 'btn-default',
- text: 'Cancel',
- click: function(e) {
- deleteModal.dismiss(e);
- }
- }]
- }
- }, 'modal-danger');
-
- deleteModal.result.then(function(event) {
- del.apply(event, args);
- });
- };
- }
- }
- };
- });
diff --git a/app/templates/client/components/mongoose-error(auth)/mongoose-error.directive.js b/app/templates/client/components/mongoose-error(auth)/mongoose-error.directive.js
deleted file mode 100644
index 3ee88f8d9..000000000
--- a/app/templates/client/components/mongoose-error(auth)/mongoose-error.directive.js
+++ /dev/null
@@ -1,15 +0,0 @@
-'use strict';
-
-/**
- * Removes server error when user updates input
- */
-angular.module('<%= scriptAppName %>')
- .directive('mongooseError', function() {
- return {
- restrict: 'A',
- require: 'ngModel',
- link: function(scope, element, attrs, ngModel) {
- element.on('keydown', () => ngModel.$setValidity('mongoose', true));
- }
- };
- });
diff --git a/app/templates/client/components/navbar/navbar(html).html b/app/templates/client/components/navbar/navbar(html).html
deleted file mode 100644
index 4b6692d36..000000000
--- a/app/templates/client/components/navbar/navbar(html).html
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
<% if (filters.auth) { %>
-
-
<% } %>
-
-
-
diff --git a/app/templates/client/components/navbar/navbar(jade).jade b/app/templates/client/components/navbar/navbar(jade).jade
deleted file mode 100644
index d8a86b647..000000000
--- a/app/templates/client/components/navbar/navbar(jade).jade
+++ /dev/null
@@ -1,34 +0,0 @@
-div.navbar.navbar-default.navbar-static-top(ng-controller='NavbarController')
- div.container
- div.navbar-header
- button.navbar-toggle(type='button', ng-click='nav.isCollapsed = !nav.isCollapsed')
- span.sr-only Toggle navigation
- span.icon-bar
- span.icon-bar
- span.icon-bar
- a.navbar-brand(href='/') <%= lodash.slugify(lodash.humanize(appname)) %>
-
- div#navbar-main.navbar-collapse.collapse(uib-collapse='nav.isCollapsed')
- ul.nav.navbar-nav
- li(ng-repeat='item in nav.menu', <% if (filters.uirouter) { %>ui-sref-active='active'<% } else { %>ng-class='{active: nav.isActive(item.link)}'<% } %>)
- a(<% if (filters.uirouter) { %>ui-sref='{{item.state}}'<% } else { %>ng-href='{{item.link}}'<% } %>) {{item.title}}<% if (filters.auth) { %>
-
- li(ng-show='nav.isAdmin()', <% if (filters.uirouter) { %>ui-sref-active='active'<% } else { %>ng-class='{active: nav.isActive("/admin")}'<% } %>)
- a(<% if (filters.uirouter) { %>ui-sref='admin'<% } else { %>href='/admin'<% } %>) Admin
-
- ul.nav.navbar-nav.navbar-right
- li(ng-hide='nav.isLoggedIn()', <% if (filters.uirouter) { %>ui-sref-active='active'<% } else { %>ng-class='{active: nav.isActive("/signup")}'<% } %>)
- a(<% if (filters.uirouter) { %>ui-sref='signup'<% } else { %>href='/signup'<% } %>) Sign up
-
- li(ng-hide='nav.isLoggedIn()', <% if (filters.uirouter) { %>ui-sref-active='active'<% } else { %>ng-class='{active: nav.isActive("/login")}'<% } %>)
- a(<% if (filters.uirouter) { %>ui-sref='login'<% } else { %>href='/login'<% } %>) Login
-
- li(ng-show='nav.isLoggedIn()')
- p.navbar-text Hello {{ nav.getCurrentUser().name }}
-
- li(ng-show='nav.isLoggedIn()', <% if (filters.uirouter) { %>ui-sref-active='active'<% } else { %>ng-class='{active: nav.isActive("/settings")}'<% } %>)
- a(<% if (filters.uirouter) { %>ui-sref='settings'<% } else { %>href='/settings'<% } %>)
- span.glyphicon.glyphicon-cog
-
- li(ng-show='nav.isLoggedIn()')
- a(<% if (filters.uirouter) { %>ui-sref='logout'<% } else { %>href='/logout'<% } %>) Logout<% } %>
diff --git a/app/templates/client/components/navbar/navbar.controller.js b/app/templates/client/components/navbar/navbar.controller.js
deleted file mode 100644
index 958355f9f..000000000
--- a/app/templates/client/components/navbar/navbar.controller.js
+++ /dev/null
@@ -1,26 +0,0 @@
-'use strict';
-
-class NavbarController {
- //start-non-standard
- menu = [{
- 'title': 'Home',
- <% if (filters.uirouter) { %>'state': 'main'<% } else { %>'link': '/'<% } %>
- }];
-
- isCollapsed = true;
- //end-non-standard
-
- constructor(<% if(!filters.uirouter) { %>$location<% } if(!filters.uirouter && filters.auth) { %>, <% } if (filters.auth) { %>Auth<% } %>) {<% if(!filters.uirouter) { %>
- this.$location = $location;<% } %>
- <% if (filters.auth) { %>this.isLoggedIn = Auth.isLoggedIn;
- this.isAdmin = Auth.isAdmin;
- this.getCurrentUser = Auth.getCurrentUser;
- <% } %>}<% if(!filters.uirouter) { %>
-
- isActive(route) {
- return route === this.$location.path();
- }<% } %>
-}
-
-angular.module('<%= scriptAppName %>')
- .controller('NavbarController', NavbarController);
diff --git a/app/templates/client/components/navbar/navbar.directive.js b/app/templates/client/components/navbar/navbar.directive.js
deleted file mode 100644
index 3ae1a4a57..000000000
--- a/app/templates/client/components/navbar/navbar.directive.js
+++ /dev/null
@@ -1,9 +0,0 @@
-'use strict';
-
-angular.module('<%= scriptAppName %>')
- .directive('navbar', () => ({
- templateUrl: 'components/navbar/navbar.html',
- restrict: 'E',
- controller: 'NavbarController',
- controllerAs: 'nav'
- }));
diff --git a/app/templates/client/components/oauth-buttons(oauth)/oauth-buttons(html).html b/app/templates/client/components/oauth-buttons(oauth)/oauth-buttons(html).html
deleted file mode 100644
index 5ea19425f..000000000
--- a/app/templates/client/components/oauth-buttons(oauth)/oauth-buttons(html).html
+++ /dev/null
@@ -1,12 +0,0 @@
-<% if(filters.facebookAuth) { %>
-
- Connect with Facebook
-
-<% } if (filters.googleAuth) { %>
-
- Connect with Google+
-
-<% } if (filters.twitterAuth) { %><% } %>
diff --git a/app/templates/client/components/oauth-buttons(oauth)/oauth-buttons(jade).jade b/app/templates/client/components/oauth-buttons(oauth)/oauth-buttons(jade).jade
deleted file mode 100644
index fd5030bd7..000000000
--- a/app/templates/client/components/oauth-buttons(oauth)/oauth-buttons(jade).jade
+++ /dev/null
@@ -1,14 +0,0 @@
-<% if(filters.facebookAuth) { %>a.btn<% if (filters.bootstrap) { %>.btn-social<% } %>.btn-facebook(ng-class='classes'
- ng-click='OauthButtons.loginOauth("facebook")')
- i.fa.fa-facebook
- | Connect with Facebook
-
-<% } if(filters.googleAuth) { %>a.btn<% if (filters.bootstrap) { %>.btn-social<% } %>.btn-google(ng-class='classes'
- ng-click='OauthButtons.loginOauth("google")')
- i.fa.fa-google-plus
- | Connect with Google+
-
-<% } if(filters.twitterAuth) { %>a.btn<% if (filters.bootstrap) { %>.btn-social<% } %>.btn-twitter(ng-class='classes'
- ng-click='OauthButtons.loginOauth("twitter")')
- i.fa.fa-twitter
- | Connect with Twitter<% } %>
diff --git a/app/templates/client/components/oauth-buttons(oauth)/oauth-buttons.controller.js b/app/templates/client/components/oauth-buttons(oauth)/oauth-buttons.controller.js
deleted file mode 100644
index 36d5d6467..000000000
--- a/app/templates/client/components/oauth-buttons(oauth)/oauth-buttons.controller.js
+++ /dev/null
@@ -1,8 +0,0 @@
-'use strict';
-
-angular.module('<%= scriptAppName %>')
- .controller('OauthButtonsCtrl', function($window) {
- this.loginOauth = function(provider) {
- $window.location.href = '/auth/' + provider;
- };
- });
diff --git a/app/templates/client/components/oauth-buttons(oauth)/oauth-buttons.controller.spec.js b/app/templates/client/components/oauth-buttons(oauth)/oauth-buttons.controller.spec.js
deleted file mode 100644
index 144745e5e..000000000
--- a/app/templates/client/components/oauth-buttons(oauth)/oauth-buttons.controller.spec.js
+++ /dev/null
@@ -1,25 +0,0 @@
-'use strict';
-
-describe('Controller: OauthButtonsCtrl', function() {
-
- // load the controller's module
- beforeEach(module('<%= scriptAppName %>'));
-
- var OauthButtonsCtrl, $window;
-
- // Initialize the controller and a mock $window
- beforeEach(inject(function($controller) {
- $window = {
- location: {}
- };
-
- OauthButtonsCtrl = $controller('OauthButtonsCtrl', {
- $window: $window
- });
- }));
-
- it('should attach loginOauth', function() {<% if (filters.jasmine) { %>
- expect(OauthButtonsCtrl.loginOauth).toEqual(jasmine.any(Function));<% } if (filters.mocha) { %>
- <%= expect() %>OauthButtonsCtrl.loginOauth<%= to() %>.be.a('function');<% } %>
- });
-});
diff --git a/app/templates/client/components/oauth-buttons(oauth)/oauth-buttons.directive.js b/app/templates/client/components/oauth-buttons(oauth)/oauth-buttons.directive.js
deleted file mode 100644
index 401f669e3..000000000
--- a/app/templates/client/components/oauth-buttons(oauth)/oauth-buttons.directive.js
+++ /dev/null
@@ -1,14 +0,0 @@
-'use strict';
-
-angular.module('<%= scriptAppName %>')
- .directive('oauthButtons', function() {
- return {
- templateUrl: 'components/oauth-buttons/oauth-buttons.html',
- restrict: 'EA',
- controller: 'OauthButtonsCtrl',
- controllerAs: 'OauthButtons',
- scope: {
- classes: '@'
- }
- };
- });
diff --git a/app/templates/client/components/oauth-buttons(oauth)/oauth-buttons.directive.spec.js b/app/templates/client/components/oauth-buttons(oauth)/oauth-buttons.directive.spec.js
deleted file mode 100644
index 14682cc6e..000000000
--- a/app/templates/client/components/oauth-buttons(oauth)/oauth-buttons.directive.spec.js
+++ /dev/null
@@ -1,51 +0,0 @@
-'use strict';
-
-describe('Directive: oauthButtons', function() {
-
- // load the directive's module and view
- beforeEach(module('<%= scriptAppName %>'));
- beforeEach(module('components/oauth-buttons/oauth-buttons.html'));
-
- var element, parentScope, elementScope;
-
- var compileDirective = function(template) {
- inject(function($compile) {
- element = angular.element(template);
- element = $compile(element)(parentScope);
- parentScope.$digest();
- elementScope = element.isolateScope();
- });
- };
-
- beforeEach(inject(function($rootScope) {
- parentScope = $rootScope.$new();
- }));
-
- it('should contain anchor buttons', function() {
- compileDirective('');<% if (filters.jasmine) { %>
- expect(element.find('a.btn<% if (filters.bootstrap) { %>.btn-social<% } %>').length).toBeGreaterThan(0);<% } if (filters.mocha) { %>
- <%= expect() %>element.find('a.btn<% if (filters.bootstrap) { %>.btn-social<% } %>').length<%= to() %>.be.at.least(1);<% } %>
- });
-
- it('should evaluate and bind the classes attribute to scope.classes', function() {
- parentScope.scopedClass = 'scopedClass1';
- compileDirective('');<% if (filters.jasmine) { %>
- expect(elementScope.classes).toEqual('testClass1 scopedClass1');<% } if (filters.mocha) { %>
- <%= expect() %>elementScope.classes<%= to() %>.equal('testClass1 scopedClass1');<% } %>
- });
-
- it('should bind scope.classes to class names on the anchor buttons', function() {
- compileDirective('');
- // Add classes
- elementScope.classes = 'testClass1 testClass2';
- elementScope.$digest();<% if (filters.jasmine) { %>
- expect(element.find('a.btn<% if (filters.bootstrap) { %>.btn-social<% } %>.testClass1.testClass2').length).toBeGreaterThan(0);<% } if (filters.mocha) { %>
- <%= expect() %>element.find('a.btn<% if (filters.bootstrap) { %>.btn-social<% } %>.testClass1.testClass2').length<%= to() %>.be.at.least(1);<% } %>
-
- // Remove classes
- elementScope.classes = '';
- elementScope.$digest();<% if (filters.jasmine) { %>
- expect(element.find('a.btn<% if (filters.bootstrap) { %>.btn-social<% } %>.testClass1.testClass2').length).toEqual(0);<% } if (filters.mocha) { %>
- <%= expect() %>element.find('a.btn<% if (filters.bootstrap) { %>.btn-social<% } %>.testClass1.testClass2').length<%= to() %>.equal(0);<% } %>
- });
-});
diff --git a/app/templates/client/components/socket(socketio)/socket.mock.js b/app/templates/client/components/socket(socketio)/socket.mock.js
deleted file mode 100644
index ba09c1d35..000000000
--- a/app/templates/client/components/socket(socketio)/socket.mock.js
+++ /dev/null
@@ -1,16 +0,0 @@
-'use strict';
-
-angular.module('socketMock', [])
- .factory('socket', function() {
- return {
- socket: {
- connect: function() {},
- on: function() {},
- emit: function() {},
- receive: function() {}
- },
-
- syncUpdates: function() {},
- unsyncUpdates: function() {}
- };
- });
diff --git a/app/templates/client/components/socket(socketio)/socket.service.js b/app/templates/client/components/socket(socketio)/socket.service.js
deleted file mode 100644
index 97e5dfee6..000000000
--- a/app/templates/client/components/socket(socketio)/socket.service.js
+++ /dev/null
@@ -1,71 +0,0 @@
-/* global io */
-'use strict';
-
-angular.module('<%= scriptAppName %>')
- .factory('socket', function(socketFactory) {
- // socket.io now auto-configures its connection when we ommit a connection url
- var ioSocket = io('', {
- // Send auth token on connection, you will need to DI the Auth service above
- // 'query': 'token=' + Auth.getToken()
- path: '/socket.io-client'
- });
-
- var socket = socketFactory({ ioSocket });
-
- return {
- socket,
-
- /**
- * Register listeners to sync an array with updates on a model
- *
- * Takes the array we want to sync, the model name that socket updates are sent from,
- * and an optional callback function after new items are updated.
- *
- * @param {String} modelName
- * @param {Array} array
- * @param {Function} cb
- */
- syncUpdates(modelName, array, cb) {
- cb = cb || angular.noop;
-
- /**
- * Syncs item creation/updates on 'model:save'
- */
- socket.on(modelName + ':save', function (item) {
- var oldItem = _.find(array, {_id: item._id});
- var index = array.indexOf(oldItem);
- var event = 'created';
-
- // replace oldItem if it exists
- // otherwise just add item to the collection
- if (oldItem) {
- array.splice(index, 1, item);
- event = 'updated';
- } else {
- array.push(item);
- }
-
- cb(event, item, array);
- });
-
- /**
- * Syncs removed items on 'model:remove'
- */
- socket.on(modelName + ':remove', function (item) {
- var event = 'deleted';
- _.remove(array, {_id: item._id});
- cb(event, item, array);
- });
- },
-
- /**
- * Removes listeners for a models updates on the socket
- *
- * @param modelName
- */
- unsyncUpdates(modelName) {
- socket.removeAllListeners(modelName + ':save');
- socket.removeAllListeners(modelName + ':remove');
- }
- };
- });
diff --git a/app/templates/client/components/ui-router(uirouter)/ui-router.mock.js b/app/templates/client/components/ui-router(uirouter)/ui-router.mock.js
deleted file mode 100644
index a5a1bf413..000000000
--- a/app/templates/client/components/ui-router(uirouter)/ui-router.mock.js
+++ /dev/null
@@ -1,34 +0,0 @@
-'use strict';
-
-angular.module('stateMock', []);
-angular.module('stateMock').service('$state', function($q) {
- this.expectedTransitions = [];
-
- this.transitionTo = function(stateName) {
- if (this.expectedTransitions.length > 0) {
- var expectedState = this.expectedTransitions.shift();
- if (expectedState !== stateName) {
- throw Error('Expected transition to state: ' + expectedState + ' but transitioned to ' + stateName);
- }
- } else {
- throw Error('No more transitions were expected! Tried to transition to ' + stateName);
- }
- console.log('Mock transition to: ' + stateName);
- var deferred = $q.defer();
- var promise = deferred.promise;
- deferred.resolve();
- return promise;
- };
-
- this.go = this.transitionTo;
-
- this.expectTransitionTo = function(stateName) {
- this.expectedTransitions.push(stateName);
- };
-
- this.ensureAllTransitionsHappened = function() {
- if (this.expectedTransitions.length > 0) {
- throw Error('Not all transitions happened!');
- }
- };
-});
diff --git a/app/templates/client/components/util/util.module.js b/app/templates/client/components/util/util.module.js
deleted file mode 100644
index 690b12456..000000000
--- a/app/templates/client/components/util/util.module.js
+++ /dev/null
@@ -1,3 +0,0 @@
-'use strict';
-
-angular.module('<%= scriptAppName %>.util', []);
diff --git a/app/templates/client/components/util/util.service.js b/app/templates/client/components/util/util.service.js
deleted file mode 100644
index 49d487396..000000000
--- a/app/templates/client/components/util/util.service.js
+++ /dev/null
@@ -1,65 +0,0 @@
-'use strict';
-
-(function() {
-
-/**
- * The Util service is for thin, globally reusable, utility functions
- */
-function UtilService($window) {
- var Util = {
- /**
- * Return a callback or noop function
- *
- * @param {Function|*} cb - a 'potential' function
- * @return {Function}
- */
- safeCb(cb) {
- return (angular.isFunction(cb)) ? cb : angular.noop;
- },
-
- /**
- * Parse a given url with the use of an anchor element
- *
- * @param {String} url - the url to parse
- * @return {Object} - the parsed url, anchor element
- */
- urlParse(url) {
- var a = document.createElement('a');
- a.href = url;
-
- // Special treatment for IE, see http://stackoverflow.com/a/13405933 for details
- if (a.host === '') {
- a.href = a.href;
- }
-
- return a;
- },
-
- /**
- * Test whether or not a given url is same origin
- *
- * @param {String} url - url to test
- * @param {String|String[]} [origins] - additional origins to test against
- * @return {Boolean} - true if url is same origin
- */
- isSameOrigin(url, origins) {
- url = Util.urlParse(url);
- origins = (origins && [].concat(origins)) || [];
- origins = origins.map(Util.urlParse);
- origins.push($window.location);
- origins = origins.filter(function(o) {
- return url.hostname === o.hostname &&
- url.port === o.port &&
- url.protocol === o.protocol;
- });
- return (origins.length >= 1);
- }
- };
-
- return Util;
-}
-
-angular.module('<%= scriptAppName %>.util')
- .factory('Util', UtilService);
-
-})();
diff --git a/app/templates/client/index.html b/app/templates/client/index.html
deleted file mode 100644
index 807f85068..000000000
--- a/app/templates/client/index.html
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <% if (filters.ngroute) { %><% } %><% if (filters.uirouter) { %><% } %>
-
-
-
-
-
-
-
-
- <% if (filters.socketio) { %>
- <% } %>
-
-
-
-
-
-
-
-
diff --git a/app/templates/e2e/account(auth)/login/login.po.js b/app/templates/e2e/account(auth)/login/login.po.js
deleted file mode 100644
index a9829c4cb..000000000
--- a/app/templates/e2e/account(auth)/login/login.po.js
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * This file uses the Page Object pattern to define the main page for tests
- * https://docs.google.com/presentation/d/1B6manhG0zEXkC-H-tPo2vwU06JhL8w9-XCF9oehXzAQ
- */
-
-'use strict';
-
-var LoginPage = function() {
- var form = this.form = element(by.css('.form'));
- form.email = form.element(by.model('vm.user.email'));
- form.password = form.element(by.model('vm.user.password'));
- form.submit = form.element(by.css('.btn-login'));<% if (filters.oauth) { %>
- form.oauthButtons = require('../../components/oauth-buttons/oauth-buttons.po').oauthButtons;<% } %>
-
- this.login = function(data) {
- for (var prop in data) {
- var formElem = form[prop];
- if (data.hasOwnProperty(prop) && formElem && typeof formElem.sendKeys === 'function') {
- formElem.sendKeys(data[prop]);
- }
- }
-
- return form.submit.click();
- };
-};
-
-module.exports = new LoginPage();
-
diff --git a/app/templates/e2e/account(auth)/login/login.spec(jasmine).js b/app/templates/e2e/account(auth)/login/login.spec(jasmine).js
deleted file mode 100644
index 03ea404df..000000000
--- a/app/templates/e2e/account(auth)/login/login.spec(jasmine).js
+++ /dev/null
@@ -1,80 +0,0 @@
-'use strict';
-
-var config = browser.params;<% if (filters.mongooseModels) { %>
-var UserModel = require(config.serverConfig.root + '/server/api/user/user.model').default;<% } %><% if (filters.sequelizeModels) { %>
-var UserModel = require(config.serverConfig.root + '/server/sqldb').User;<% } %>
-
-describe('Login View', function() {
- var page;
-
- var loadPage = function() {
- browser.get(config.baseUrl + '/login');
- page = require('./login.po');
- };
-
- var testUser = {
- name: 'Test User',
- email: 'test@example.com',
- password: 'test'
- };
-
- beforeEach(function(done) {
- <% if (filters.mongooseModels) { %>UserModel.remove()<% }
- if (filters.sequelizeModels) { %>UserModel.destroy({ where: {} })<% } %>
- .then(function() {
- return UserModel.create(testUser)
- .then(loadPage);
- })
- // .then(loadPage)
- .finally(function() {
- browser.wait(function() {
- //console.log('waiting for angular...');
- return browser.executeScript('return !!window.angular');
-
- }, 5000).then(done);
- });
- });
-
- it('should include login form with correct inputs and submit button', function() {
- expect(page.form.email.getAttribute('type')).toBe('email');
- expect(page.form.email.getAttribute('name')).toBe('email');
- expect(page.form.password.getAttribute('type')).toBe('password');
- expect(page.form.password.getAttribute('name')).toBe('password');
- expect(page.form.submit.getAttribute('type')).toBe('submit');
- expect(page.form.submit.getText()).toBe('Login');
- });<% if (filters.oauth) { %>
-
- it('should include oauth buttons with correct classes applied', function() {<% if (filters.facebookAuth) { %>
- expect(page.form.oauthButtons.facebook.getText()).toBe('Connect with Facebook');
- expect(page.form.oauthButtons.facebook.getAttribute('class')).toMatch('btn-block');<% } if (filters.googleAuth) { %>
- expect(page.form.oauthButtons.google.getText()).toBe('Connect with Google+');
- expect(page.form.oauthButtons.google.getAttribute('class')).toMatch('btn-block');<% } if (filters.twitterAuth) { %>
- expect(page.form.oauthButtons.twitter.getText()).toBe('Connect with Twitter');
- expect(page.form.oauthButtons.twitter.getAttribute('class')).toMatch('btn-block');<% } %>
- });<% } %>
-
- describe('with local auth', function() {
-
- it('should login a user and redirecting to "/"', function() {
- page.login(testUser);
-
- var navbar = require('../../components/navbar/navbar.po');
-
- expect(browser.getCurrentUrl()).toBe(config.baseUrl + '/');
- expect(navbar.navbarAccountGreeting.getText()).toBe('Hello ' + testUser.name);
- });
-
- it('should indicate login failures', function() {
- page.login({
- email: testUser.email,
- password: 'badPassword'
- });
-
- expect(browser.getCurrentUrl()).toBe(config.baseUrl + '/login');
-
- var helpBlock = page.form.element(by.css('.form-group.has-error .help-block.ng-binding'));
- expect(helpBlock.getText()).toBe('This password is not correct.');
- });
-
- });
-});
diff --git a/app/templates/e2e/account(auth)/login/login.spec(mocha).js b/app/templates/e2e/account(auth)/login/login.spec(mocha).js
deleted file mode 100644
index 08758dc07..000000000
--- a/app/templates/e2e/account(auth)/login/login.spec(mocha).js
+++ /dev/null
@@ -1,87 +0,0 @@
-'use strict';
-
-var config = browser.params;<% if (filters.mongooseModels) { %>
-var UserModel = require(config.serverConfig.root + '/server/api/user/user.model').default;<% } %><% if (filters.sequelizeModels) { %>
-var UserModel = require(config.serverConfig.root + '/server/sqldb').User;<% } %>
-
-describe('Login View', function() {
- var page;
-
- var loadPage = function() {
- let promise = browser.get(config.baseUrl + '/login');
- page = require('./login.po');
- return promise;
- };
-
- var testUser = {
- name: 'Test User',
- email: 'test@example.com',
- password: 'test'
- };
-
- before(function() {
- return UserModel
- <% if (filters.mongooseModels) { %>.remove()<% }
- if (filters.sequelizeModels) { %>.destroy({ where: {} })<% } %>
- .then(function() {
- <% if (filters.mongooseModels) { %>return UserModel.create(testUser);<% }
- if (filters.sequelizeModels) { %>return UserModel.create(testUser);<% } %>
- })
- .then(loadPage);
- });
-
- after(function() {
- <% if (filters.mongooseModels) { %>return UserModel.remove();<% }
- if (filters.sequelizeModels) { %>return UserModel.destroy({ where: {} });<% } %>
- });
-
- it('should include login form with correct inputs and submit button', function() {
- <%= expect() %>page.form.email.getAttribute('type')<%= to() %>.eventually.equal('email');
- <%= expect() %>page.form.email.getAttribute('name')<%= to() %>.eventually.equal('email');
- <%= expect() %>page.form.password.getAttribute('type')<%= to() %>.eventually.equal('password');
- <%= expect() %>page.form.password.getAttribute('name')<%= to() %>.eventually.equal('password');
- <%= expect() %>page.form.submit.getAttribute('type')<%= to() %>.eventually.equal('submit');
- <%= expect() %>page.form.submit.getText()<%= to() %>.eventually.equal('Login');
- });<% if (filters.oauth) { %>
-
- it('should include oauth buttons with correct classes applied', function() {<% if (filters.facebookAuth) { %>
- <%= expect() %>page.form.oauthButtons.facebook.getText()<%= to() %>.eventually.equal('Connect with Facebook');
- <%= expect() %>page.form.oauthButtons.facebook.getAttribute('class')<%= to() %>.eventually.contain('btn-block');<% } if (filters.googleAuth) { %>
- <%= expect() %>page.form.oauthButtons.google.getText()<%= to() %>.eventually.equal('Connect with Google+');
- <%= expect() %>page.form.oauthButtons.google.getAttribute('class')<%= to() %>.eventually.contain('btn-block');<% } if (filters.twitterAuth) { %>
- <%= expect() %>page.form.oauthButtons.twitter.getText()<%= to() %>.eventually.equal('Connect with Twitter');
- <%= expect() %>page.form.oauthButtons.twitter.getAttribute('class')<%= to() %>.eventually.contain('btn-block');<% } %>
- });<% } %>
-
- describe('with local auth', function() {
-
- it('should login a user and redirecting to "/"', function() {
- page.login(testUser);
-
- var navbar = require('../../components/navbar/navbar.po');
-
- <%= expect() %>browser.getCurrentUrl()<%= to() %>.eventually.equal(config.baseUrl + '/');
- <%= expect() %>navbar.navbarAccountGreeting.getText()<%= to() %>.eventually.equal('Hello ' + testUser.name);
- });
-
- describe('and invalid credentials', function() {
- before(function() {
- return loadPage();
- })
-
- it('should indicate login failures', function() {
- page.login({
- email: testUser.email,
- password: 'badPassword'
- });
-
- <%= expect() %>browser.getCurrentUrl()<%= to() %>.eventually.equal(config.baseUrl + '/login');
-
- var helpBlock = page.form.element(by.css('.form-group.has-error .help-block.ng-binding'));
- <%= expect() %>helpBlock.getText()<%= to() %>.eventually.equal('This password is not correct.');
- });
-
- });
-
- });
-});
diff --git a/app/templates/e2e/account(auth)/logout/logout.spec(jasmine).js b/app/templates/e2e/account(auth)/logout/logout.spec(jasmine).js
deleted file mode 100644
index f32722410..000000000
--- a/app/templates/e2e/account(auth)/logout/logout.spec(jasmine).js
+++ /dev/null
@@ -1,53 +0,0 @@
-'use strict';
-
-var config = browser.params;<% if (filters.mongooseModels) { %>
-var UserModel = require(config.serverConfig.root + '/server/api/user/user.model').default;<% } %><% if (filters.sequelizeModels) { %>
-var UserModel = require(config.serverConfig.root + '/server/sqldb').User;<% } %>
-
-describe('Logout View', function() {
- var login = function(user) {
- browser.get(config.baseUrl + '/login');
- require('../login/login.po').login(user);
- };
-
- var testUser = {
- name: 'Test User',
- email: 'test@example.com',
- password: 'test'
- };
-
- beforeEach(function(done) {
- <% if (filters.mongooseModels) { %>UserModel.remove()<% }
- if (filters.sequelizeModels) { %>UserModel.destroy({ where: {} })<% } %>
- .then(function() {
- <% if (filters.mongooseModels) { %>return UserModel.create(testUser);<% }
- if (filters.sequelizeModels) { %>return UserModel.create(testUser);<% } %>
- })
- .then(function() {
- return login(testUser);
- })
- .finally(function() {
- browser.wait(function() {
- return browser.executeScript('return !!window.angular');
- }, 5000).then(done);
- });
- });
-
- describe('with local auth', function() {
-
- it('should logout a user and redirecting to "/"', function() {
- var navbar = require('../../components/navbar/navbar.po');
-
- expect(browser.getCurrentUrl()).toBe(config.baseUrl + '/');
- expect(navbar.navbarAccountGreeting.getText()).toBe('Hello ' + testUser.name);
-
- browser.get(config.baseUrl + '/logout');
-
- navbar = require('../../components/navbar/navbar.po');
-
- expect(browser.getCurrentUrl()).toBe(config.baseUrl + '/');
- expect(navbar.navbarAccountGreeting.isDisplayed()).toBe(false);
- });
-
- });
-});
diff --git a/app/templates/e2e/account(auth)/logout/logout.spec(mocha).js b/app/templates/e2e/account(auth)/logout/logout.spec(mocha).js
deleted file mode 100644
index d1b170272..000000000
--- a/app/templates/e2e/account(auth)/logout/logout.spec(mocha).js
+++ /dev/null
@@ -1,55 +0,0 @@
-'use strict';
-
-var config = browser.params;<% if (filters.mongooseModels) { %>
-var UserModel = require(config.serverConfig.root + '/server/api/user/user.model').default;<% } %><% if (filters.sequelizeModels) { %>
-var UserModel = require(config.serverConfig.root + '/server/sqldb').User;<% } %>
-
-describe('Logout View', function() {
- var login = function(user) {
- let promise = browser.get(config.baseUrl + '/login');
- require('../login/login.po').login(user);
- return promise;
- };
-
- var testUser = {
- name: 'Test User',
- email: 'test@example.com',
- password: 'test'
- };
-
- beforeEach(function() {
- return UserModel
- <% if (filters.mongooseModels) { %>.remove()<% }
- if (filters.sequelizeModels) { %>.destroy({ where: {} })<% } %>
- .then(function() {
- <% if (filters.mongooseModels) { %>return UserModel.create(testUser);<% }
- if (filters.sequelizeModels) { %>return UserModel.create(testUser);<% } %>
- })
- .then(function() {
- return login(testUser);
- });
- });
-
- after(function() {
- <% if (filters.mongooseModels) { %>return UserModel.remove();<% }
- if (filters.sequelizeModels) { %>return UserModel.destroy({ where: {} });<% } %>
- })
-
- describe('with local auth', function() {
-
- it('should logout a user and redirecting to "/"', function() {
- var navbar = require('../../components/navbar/navbar.po');
-
- <%= expect() %>browser.getCurrentUrl()<%= to() %>.eventually.equal(config.baseUrl + '/');
- <%= expect() %>navbar.navbarAccountGreeting.getText()<%= to() %>.eventually.equal('Hello ' + testUser.name);
-
- browser.get(config.baseUrl + '/logout');
-
- navbar = require('../../components/navbar/navbar.po');
-
- <%= expect() %>browser.getCurrentUrl()<%= to() %>.eventually.equal(config.baseUrl + '/');
- <%= expect() %>navbar.navbarAccountGreeting.isDisplayed()<%= to() %>.eventually.equal(false);
- });
-
- });
-});
diff --git a/app/templates/e2e/account(auth)/signup/signup.po.js b/app/templates/e2e/account(auth)/signup/signup.po.js
deleted file mode 100644
index aee1f4194..000000000
--- a/app/templates/e2e/account(auth)/signup/signup.po.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * This file uses the Page Object pattern to define the main page for tests
- * https://docs.google.com/presentation/d/1B6manhG0zEXkC-H-tPo2vwU06JhL8w9-XCF9oehXzAQ
- */
-
-'use strict';
-
-var SignupPage = function() {
- var form = this.form = element(by.css('.form'));
- form.name = form.element(by.model('vm.user.name'));
- form.email = form.element(by.model('vm.user.email'));
- form.password = form.element(by.model('vm.user.password'));
- form.confirmPassword = form.element(by.model('vm.user.confirmPassword'));
- form.submit = form.element(by.css('.btn-register'));<% if (filters.oauth) { %>
- form.oauthButtons = require('../../components/oauth-buttons/oauth-buttons.po').oauthButtons;<% } %>
-
- this.signup = function(data) {
- for (var prop in data) {
- var formElem = form[prop];
- if (data.hasOwnProperty(prop) && formElem && typeof formElem.sendKeys === 'function') {
- formElem.sendKeys(data[prop]);
- }
- }
-
- return form.submit.click();
- };
-};
-
-module.exports = new SignupPage();
-
diff --git a/app/templates/e2e/account(auth)/signup/signup.spec(jasmine).js b/app/templates/e2e/account(auth)/signup/signup.spec(jasmine).js
deleted file mode 100644
index a70f76f19..000000000
--- a/app/templates/e2e/account(auth)/signup/signup.spec(jasmine).js
+++ /dev/null
@@ -1,79 +0,0 @@
-'use strict';
-
-var config = browser.params;<% if (filters.mongooseModels) { %>
-var UserModel = require(config.serverConfig.root + '/server/api/user/user.model').default;<% } %><% if (filters.sequelizeModels) { %>
-var UserModel = require(config.serverConfig.root + '/server/sqldb').User;<% } %>
-
-describe('Signup View', function() {
- var page;
-
- var loadPage = function() {
- browser.manage().deleteAllCookies();
- browser.get(config.baseUrl + '/signup');
- page = require('./signup.po');
- };
-
- var testUser = {
- name: 'Test',
- email: 'test@example.com',
- password: 'test',
- confirmPassword: 'test'
- };
-
- beforeEach(function(done) {
- loadPage();
- browser.wait(function() {
- return browser.executeScript('return !!window.angular');
- }, 5000).then(done);
- });
-
- it('should include signup form with correct inputs and submit button', function() {
- expect(page.form.name.getAttribute('type')).toBe('text');
- expect(page.form.name.getAttribute('name')).toBe('name');
- expect(page.form.email.getAttribute('type')).toBe('email');
- expect(page.form.email.getAttribute('name')).toBe('email');
- expect(page.form.password.getAttribute('type')).toBe('password');
- expect(page.form.password.getAttribute('name')).toBe('password');
- expect(page.form.confirmPassword.getAttribute('type')).toBe('password');
- expect(page.form.confirmPassword.getAttribute('name')).toBe('confirmPassword');
- expect(page.form.submit.getAttribute('type')).toBe('submit');
- expect(page.form.submit.getText()).toBe('Sign up');
- });<% if (filters.oauth) { %>
-
- it('should include oauth buttons with correct classes applied', function() {<% if (filters.facebookAuth) { %>
- expect(page.form.oauthButtons.facebook.getText()).toBe('Connect with Facebook');
- expect(page.form.oauthButtons.facebook.getAttribute('class')).toMatch('btn-block');<% } if (filters.googleAuth) { %>
- expect(page.form.oauthButtons.google.getText()).toBe('Connect with Google+');
- expect(page.form.oauthButtons.google.getAttribute('class')).toMatch('btn-block');<% } if (filters.twitterAuth) { %>
- expect(page.form.oauthButtons.twitter.getText()).toBe('Connect with Twitter');
- expect(page.form.oauthButtons.twitter.getAttribute('class')).toMatch('btn-block');<% } %>
- });<% } %>
-
- describe('with local auth', function() {
-
- beforeAll(function(done) {
- <% if (filters.mongooseModels) { %>UserModel.remove().then(done);<% }
- if (filters.sequelizeModels) { %>UserModel.destroy({ where: {} }).then(done);<% } %>
- });
-
- it('should signup a new user, log them in, and redirecting to "/"', function() {
- page.signup(testUser);
-
- var navbar = require('../../components/navbar/navbar.po');
-
- expect(browser.getCurrentUrl()).toBe(config.baseUrl + '/');
- expect(navbar.navbarAccountGreeting.getText()).toBe('Hello ' + testUser.name);
- });
-
- it('should indicate signup failures', function() {
- page.signup(testUser);
-
- expect(browser.getCurrentUrl()).toBe(config.baseUrl + '/signup');
- expect(page.form.email.getAttribute('class')).toContain('ng-invalid-mongoose');
-
- var helpBlock = page.form.element(by.css('.form-group.has-error .help-block.ng-binding'));
- expect(helpBlock.getText()).toBe('The specified email address is already in use.');
- });
-
- });
-});
diff --git a/app/templates/e2e/account(auth)/signup/signup.spec(mocha).js b/app/templates/e2e/account(auth)/signup/signup.spec(mocha).js
deleted file mode 100644
index f7debbe47..000000000
--- a/app/templates/e2e/account(auth)/signup/signup.spec(mocha).js
+++ /dev/null
@@ -1,89 +0,0 @@
-'use strict';
-
-var config = browser.params;<% if (filters.mongooseModels) { %>
-var UserModel = require(config.serverConfig.root + '/server/api/user/user.model').default;<% } %><% if (filters.sequelizeModels) { %>
-var UserModel = require(config.serverConfig.root + '/server/sqldb').User;<% } %>
-
-describe('Signup View', function() {
- var page;
-
- var loadPage = function() {
- browser.manage().deleteAllCookies()
- let promise = browser.get(config.baseUrl + '/signup');
- page = require('./signup.po');
- return promise;
- };
-
- var testUser = {
- name: 'Test',
- email: 'test@example.com',
- password: 'test',
- confirmPassword: 'test'
- };
-
- before(function() {
- return loadPage();
- });
-
- after(function() {
- <% if (filters.mongooseModels) { %>return UserModel.remove();<% }
- if (filters.sequelizeModels) { %>return UserModel.destroy({ where: {} });<% } %>
- });
-
- it('should include signup form with correct inputs and submit button', function() {
- <%= expect() %>page.form.name.getAttribute('type')<%= to() %>.eventually.equal('text');
- <%= expect() %>page.form.name.getAttribute('name')<%= to() %>.eventually.equal('name');
- <%= expect() %>page.form.email.getAttribute('type')<%= to() %>.eventually.equal('email');
- <%= expect() %>page.form.email.getAttribute('name')<%= to() %>.eventually.equal('email');
- <%= expect() %>page.form.password.getAttribute('type')<%= to() %>.eventually.equal('password');
- <%= expect() %>page.form.password.getAttribute('name')<%= to() %>.eventually.equal('password');
- <%= expect() %>page.form.confirmPassword.getAttribute('type')<%= to() %>.eventually.equal('password');
- <%= expect() %>page.form.confirmPassword.getAttribute('name')<%= to() %>.eventually.equal('confirmPassword');
- <%= expect() %>page.form.submit.getAttribute('type')<%= to() %>.eventually.equal('submit');
- <%= expect() %>page.form.submit.getText()<%= to() %>.eventually.equal('Sign up');
- });<% if (filters.oauth) { %>
-
- it('should include oauth buttons with correct classes applied', function() {<% if (filters.facebookAuth) { %>
- <%= expect() %>page.form.oauthButtons.facebook.getText()<%= to() %>.eventually.equal('Connect with Facebook');
- <%= expect() %>page.form.oauthButtons.facebook.getAttribute('class')<%= to() %>.eventually.contain('btn-block');<% } if (filters.googleAuth) { %>
- <%= expect() %>page.form.oauthButtons.google.getText()<%= to() %>.eventually.equal('Connect with Google+');
- <%= expect() %>page.form.oauthButtons.google.getAttribute('class')<%= to() %>.eventually.contain('btn-block');<% } if (filters.twitterAuth) { %>
- <%= expect() %>page.form.oauthButtons.twitter.getText()<%= to() %>.eventually.equal('Connect with Twitter');
- <%= expect() %>page.form.oauthButtons.twitter.getAttribute('class')<%= to() %>.eventually.contain('btn-block');<% } %>
- });<% } %>
-
- describe('with local auth', function() {
-
- before(function() {
- <% if (filters.mongooseModels) { %>return UserModel.remove();<% }
- if (filters.sequelizeModels) { %>return UserModel.destroy({ where: {} });<% } %>
- })
-
- it('should signup a new user, log them in, and redirecting to "/"', function() {
- page.signup(testUser);
-
- var navbar = require('../../components/navbar/navbar.po');
-
- <%= expect() %>browser.getCurrentUrl()<%= to() %>.eventually.equal(config.baseUrl + '/');
- <%= expect() %>navbar.navbarAccountGreeting.getText()<%= to() %>.eventually.equal('Hello ' + testUser.name);
- });
-
- describe('and invalid credentials', function() {
- before(function() {
- return loadPage();
- });
-
- it('should indicate signup failures', function() {
- page.signup(testUser);
-
- <%= expect() %>browser.getCurrentUrl()<%= to() %>.eventually.equal(config.baseUrl + '/signup');
- <%= expect() %>page.form.email.getAttribute('class')<%= to() %>.eventually.contain('ng-invalid-mongoose');
-
- var helpBlock = page.form.element(by.css('.form-group.has-error .help-block.ng-binding'));
- <%= expect() %>helpBlock.getText()<%= to() %>.eventually.equal('The specified email address is already in use.');
- });
-
- });
-
- });
-});
diff --git a/app/templates/e2e/components/navbar/navbar.po.js b/app/templates/e2e/components/navbar/navbar.po.js
deleted file mode 100644
index 80a48418e..000000000
--- a/app/templates/e2e/components/navbar/navbar.po.js
+++ /dev/null
@@ -1,16 +0,0 @@
-/**
- * This file uses the Page Object pattern to define the main page for tests
- * https://docs.google.com/presentation/d/1B6manhG0zEXkC-H-tPo2vwU06JhL8w9-XCF9oehXzAQ
- */
-
-'use strict';
-
-var NavbarComponent = function() {
- this.navbar = element(by.css('.navbar'));
- this.navbarHeader = this.navbar.element(by.css('.navbar-header'));
- this.navbarNav = this.navbar.element(by.css('#navbar-main .nav.navbar-nav:not(.navbar-right)'));<% if (filters.auth) { %>
- this.navbarAccount = this.navbar.element(by.css('#navbar-main .nav.navbar-nav.navbar-right'));
- this.navbarAccountGreeting = this.navbarAccount.element(by.binding('getCurrentUser().name'));<% } %>
-};
-
-module.exports = new NavbarComponent();
diff --git a/app/templates/e2e/components/oauth-buttons(oauth)/oauth-buttons.po.js b/app/templates/e2e/components/oauth-buttons(oauth)/oauth-buttons.po.js
deleted file mode 100644
index c25d2b994..000000000
--- a/app/templates/e2e/components/oauth-buttons(oauth)/oauth-buttons.po.js
+++ /dev/null
@@ -1,15 +0,0 @@
-/**
- * This file uses the Page Object pattern to define the main page for tests
- * https://docs.google.com/presentation/d/1B6manhG0zEXkC-H-tPo2vwU06JhL8w9-XCF9oehXzAQ
- */
-
-'use strict';
-
-var OauthButtons = function() {
- var oauthButtons = this.oauthButtons = element(by.css('oauth-buttons'));<% if (filters.facebookAuth) { %>
- oauthButtons.facebook = oauthButtons.element(by.css('.btn<% if (filters.bootstrap) { %>.btn-social<% } %>.btn-facebook'));<% } if (filters.googleAuth) { %>
- oauthButtons.google = oauthButtons.element(by.css('.btn<% if (filters.bootstrap) { %>.btn-social<% } %>.btn-google'));<% } if (filters.twitterAuth) { %>
- oauthButtons.twitter = oauthButtons.element(by.css('.btn<% if (filters.bootstrap) { %>.btn-social<% } %>.btn-twitter'));<% } %>
-};
-
-module.exports = new OauthButtons();
diff --git a/app/templates/e2e/main/main.po.js b/app/templates/e2e/main/main.po.js
deleted file mode 100644
index 6718608c7..000000000
--- a/app/templates/e2e/main/main.po.js
+++ /dev/null
@@ -1,15 +0,0 @@
-/**
- * This file uses the Page Object pattern to define the main page for tests
- * https://docs.google.com/presentation/d/1B6manhG0zEXkC-H-tPo2vwU06JhL8w9-XCF9oehXzAQ
- */
-
-'use strict';
-
-var MainPage = function() {
- this.heroEl = element(by.css('.hero-unit'));
- this.h1El = this.heroEl.element(by.css('h1'));
- this.imgEl = this.heroEl.element(by.css('img'));
-};
-
-module.exports = new MainPage();
-
diff --git a/app/templates/e2e/main/main.spec(jasmine).js b/app/templates/e2e/main/main.spec(jasmine).js
deleted file mode 100644
index 57284495a..000000000
--- a/app/templates/e2e/main/main.spec(jasmine).js
+++ /dev/null
@@ -1,18 +0,0 @@
-'use strict';
-
-var config = browser.params;
-
-describe('Main View', function() {
- var page;
-
- beforeEach(function() {
- browser.get(config.baseUrl + '/');
- page = require('./main.po');
- });
-
- it('should include jumbotron with correct data', function() {
- expect(page.h1El.getText()).toBe('\'Allo, \'Allo!');
- expect(page.imgEl.getAttribute('src')).toMatch(/yeoman.png$/);
- expect(page.imgEl.getAttribute('alt')).toBe('I\'m Yeoman');
- });
-});
diff --git a/app/templates/e2e/main/main.spec(mocha).js b/app/templates/e2e/main/main.spec(mocha).js
deleted file mode 100644
index 798b58c41..000000000
--- a/app/templates/e2e/main/main.spec(mocha).js
+++ /dev/null
@@ -1,19 +0,0 @@
-'use strict';
-
-var config = browser.params;
-
-describe('Main View', function() {
- var page;
-
- beforeEach(function() {
- let promise = browser.get(config.baseUrl + '/');
- page = require('./main.po');
- return promise;
- });
-
- it('should include jumbotron with correct data', function() {
- <%= expect() %>page.h1El.getText()<%= to() %>.eventually.equal('\'Allo, \'Allo!');
- <%= expect() %>page.imgEl.getAttribute('src')<%= to() %>.eventually.match(/yeoman.png$/);
- <%= expect() %>page.imgEl.getAttribute('alt')<%= to() %>.eventually.equal('I\'m Yeoman');
- });
-});
diff --git a/app/templates/gulpfile.babel(gulp).js b/app/templates/gulpfile.babel(gulp).js
deleted file mode 100644
index 4edb6adbd..000000000
--- a/app/templates/gulpfile.babel(gulp).js
+++ /dev/null
@@ -1,692 +0,0 @@
-// Generated on <%= (new Date).toISOString().split('T')[0] %> using <%= rootGeneratorName() %> <%= rootGeneratorVersion() %>
-'use strict';
-
-import _ from 'lodash';
-import del from 'del';
-import gulp from 'gulp';
-import path from 'path';
-import gulpLoadPlugins from 'gulp-load-plugins';
-import http from 'http';
-import open from 'open';
-import lazypipe from 'lazypipe';
-import {stream as wiredep} from 'wiredep';
-import nodemon from 'nodemon';
-import {Server as KarmaServer} from 'karma';
-import runSequence from 'run-sequence';
-import {protractor, webdriver_update} from 'gulp-protractor';
-import {Instrumenter} from 'isparta';<% if(filters.stylus) { %>
-import nib from 'nib';<% } %>
-
-var plugins = gulpLoadPlugins();
-var config;
-
-const clientPath = require('./bower.json').appPath || 'client';
-const serverPath = 'server';
-const paths = {
- client: {
- assets: `${clientPath}/assets/**/*`,
- images: `${clientPath}/assets/images/**/*`,
- scripts: [
- `${clientPath}/**/!(*.spec|*.mock).<%= scriptExt %>`,
- `!${clientPath}/bower_components/**/*`<% if(filters.ts) { %>,
- `!${clientPath}/{typings,test_typings}/**/*`<% } %>
- ],
- styles: [`${clientPath}/{app,components}/**/*.<%= styleExt %>`],
- mainStyle: `${clientPath}/app/app.<%= styleExt %>`,
- views: `${clientPath}/{app,components}/**/*.<%= templateExt %>`,
- mainView: `${clientPath}/index.html`,
- test: [`${clientPath}/{app,components}/**/*.{spec,mock}.<%= scriptExt %>`],
- e2e: ['e2e/**/*.spec.js'],
- bower: `${clientPath}/bower_components/`
- },
- server: {
- scripts: [
- `${serverPath}/**/!(*.spec|*.integration).js`,
- `!${serverPath}/config/local.env.sample.js`
- ],
- json: [`${serverPath}/**/*.json`],
- test: {
- integration: [`${serverPath}/**/*.integration.js`, 'mocha.global.js'],
- unit: [`${serverPath}/**/*.spec.js`, 'mocha.global.js']
- }
- },
- karma: 'karma.conf.js',
- dist: 'dist'
-};
-
-/********************
- * Helper functions
- ********************/
-
-function onServerLog(log) {
- console.log(plugins.util.colors.white('[') +
- plugins.util.colors.yellow('nodemon') +
- plugins.util.colors.white('] ') +
- log.message);
-}
-
-function checkAppReady(cb) {
- var options = {
- host: 'localhost',
- port: config.port
- };
- http
- .get(options, () => cb(true))
- .on('error', () => cb(false));
-}
-
-// Call page until first success
-function whenServerReady(cb) {
- var serverReady = false;
- var appReadyInterval = setInterval(() =>
- checkAppReady((ready) => {
- if (!ready || serverReady) {
- return;
- }
- clearInterval(appReadyInterval);
- serverReady = true;
- cb();
- }),
- 100);
-}
-
-function sortModulesFirst(a, b) {
- var module = /\.module\.<%= scriptExt %>$/;
- var aMod = module.test(a.path);
- var bMod = module.test(b.path);
- // inject *.module.js first
- if (aMod === bMod) {
- // either both modules or both non-modules, so just sort normally
- if (a.path < b.path) {
- return -1;
- }
- if (a.path > b.path) {
- return 1;
- }
- return 0;
- } else {
- return (aMod ? -1 : 1);
- }
-}
-
-/********************
- * Reusable pipelines
- ********************/
-
-let lintClientScripts = lazypipe()<% if(filters.babel) { %>
- .pipe(plugins.jshint, `${clientPath}/.jshintrc`)
- .pipe(plugins.jshint.reporter, 'jshint-stylish');<% } %><% if(filters.ts) { %>
- .pipe(plugins.tslint, require(`./${clientPath}/tslint.json`))
- .pipe(plugins.tslint.report, 'verbose');<% } %>
-
-let lintServerScripts = lazypipe()
- .pipe(plugins.jshint, `${serverPath}/.jshintrc`)
- .pipe(plugins.jshint.reporter, 'jshint-stylish');
-
-let lintServerTestScripts = lazypipe()
- .pipe(plugins.jshint, `${serverPath}/.jshintrc-spec`)
- .pipe(plugins.jshint.reporter, 'jshint-stylish');
-
-let styles = lazypipe()
- .pipe(plugins.sourcemaps.init)<% if(filters.stylus) { %>
- .pipe(plugins.stylus, {
- use: [nib()],
- errors: true
- })<% } if(filters.sass) { %>
- .pipe(plugins.sass)<% } if(filters.less) { %>
- .pipe(plugins.less)<% } %>
- .pipe(plugins.autoprefixer, {browsers: ['last 1 version']})
- .pipe(plugins.sourcemaps.write, '.');<% if(filters.babel) { %>
-
-let transpileClient = lazypipe()
- .pipe(plugins.sourcemaps.init)
- .pipe(plugins.babel)
- .pipe(plugins.sourcemaps.write, '.');<% } %>
-
-let transpileServer = lazypipe()
- .pipe(plugins.sourcemaps.init)
- .pipe(plugins.babel, {
- plugins: [
- 'transform-class-properties',
- 'transform-runtime'
- ]
- })
- .pipe(plugins.sourcemaps.write, '.');
-
-let mocha = lazypipe()
- .pipe(plugins.mocha, {
- reporter: 'spec',
- timeout: 5000,
- require: [
- './mocha.conf'
- ]
- });
-
-let istanbul = lazypipe()
- .pipe(plugins.istanbul.writeReports)
- .pipe(plugins.istanbulEnforcer, {
- thresholds: {
- global: {
- lines: 80,
- statements: 80,
- branches: 80,
- functions: 80
- }
- },
- coverageDirectory: './coverage',
- rootDirectory : ''
- });
-
-/********************
- * Env
- ********************/
-
-gulp.task('env:all', () => {
- let localConfig;
- try {
- localConfig = require(`./${serverPath}/config/local.env`);
- } catch (e) {
- localConfig = {};
- }
- plugins.env({
- vars: localConfig
- });
-});
-gulp.task('env:test', () => {
- plugins.env({
- vars: {NODE_ENV: 'test'}
- });
-});
-gulp.task('env:prod', () => {
- plugins.env({
- vars: {NODE_ENV: 'production'}
- });
-});
-
-/********************
- * Tasks
- ********************/
-
-gulp.task('inject', cb => {
- runSequence(['inject:js', 'inject:css', 'inject:<%= styleExt %>'<% if(filters.ts) { %>, 'inject:tsconfig'<% } %>], cb);
-});
-
-gulp.task('inject:js', () => {
- return gulp.src(paths.client.mainView)
- .pipe(plugins.inject(
- gulp.src(_.union(paths.client.scripts, [<% if(filters.ts) { %>'client/app/app.constant.js', <% } %>`!${clientPath}/**/*.{spec,mock}.<%= scriptExt %>`, `!${clientPath}/app/app.<%= scriptExt %>`]), {read: false})
- .pipe(plugins.sort(sortModulesFirst)),
- {
- starttag: '',
- endtag: '',
- transform: (filepath) => ''
- }))
- .pipe(gulp.dest(clientPath));
-});<% if(filters.ts) { %>
-
-gulp.task('inject:tsconfig', () => {
- let src = gulp.src([
- `${clientPath}/**/!(*.spec|*.mock).ts`,
- `!${clientPath}/bower_components/**/*`,
- `${clientPath}/typings/**/*.d.ts`
- ], {read: false})
- .pipe(plugins.sort());
-
- return gulp.src('./tsconfig.client.json')
- .pipe(plugins.inject(src, {
- starttag: '"files": [',
- endtag: ']',
- transform: (filepath, file, i, length) => {
- return `"${filepath.substr(1)}"${i + 1 < length ? ',' : ''}`;
- }
- }))
- .pipe(gulp.dest('./'));
-});<% } %>
-
-gulp.task('inject:css', () => {
- return gulp.src(paths.client.mainView)
- .pipe(plugins.inject(
- gulp.src(`/${clientPath}/{app,components}/**/*.css`, {read: false})
- .pipe(plugins.sort()),
- {
- starttag: '',
- endtag: '',
- transform: (filepath) => ''
- }))
- .pipe(gulp.dest(clientPath));
-});<% if(!filters.css) { %>
-
-gulp.task('inject:<%= styleExt %>', () => {
- return gulp.src(paths.client.mainStyle)
- .pipe(plugins.inject(
- gulp.src(_.union(paths.client.styles, ['!' + paths.client.mainStyle]), {read: false})
- .pipe(plugins.sort()),
- {
- <%_ if(filters.stylus) { _%>
- starttag: '/* inject:styl */',
- endtag: '/* endinject */',
- <%_ } _%>
- transform: (filepath) => {
- let newPath = filepath
- .replace(`/${clientPath}/app/`, '')
- .replace(`/${clientPath}/components/`, '../components/')
- .replace(/_(.*).<%= styleExt %>/, (match, p1, offset, string) => p1)
- .replace('.<%= styleExt %>', '');
- return `@import '${newPath}';`;
- }
- }))
- .pipe(gulp.dest(`${clientPath}/app`));
-});<% } %><% if(filters.ts) { %>
-
-// Install DefinitelyTyped TypeScript definition files
-gulp.task('tsd', cb => {
- plugins.tsd({
- command: 'reinstall',
- config: './tsd.json'
- }, cb);
-});
-
-gulp.task('tsd:test', cb => {
- plugins.tsd({
- command: 'reinstall',
- config: './tsd_test.json'
- }, cb);
-});<% } %>
-
-gulp.task('styles', () => {
- return gulp.src(paths.client.mainStyle)
- .pipe(styles())
- .pipe(gulp.dest('.tmp/app'));
-});<% if(filters.ts) { %>
-
-gulp.task('copy:constant', () => {
- return gulp.src(`${clientPath}/app/app.constant.js`, { dot: true })
- .pipe(gulp.dest('.tmp'));
-})
-
-gulp.task('transpile:client', ['constant', 'copy:constant'], () => {
- let tsProject = plugins.typescript.createProject('./tsconfig.client.json');
- return tsProject.src()
- .pipe(plugins.sourcemaps.init())
- .pipe(plugins.typescript(tsProject)).js
- .pipe(plugins.sourcemaps.write('.'))
- .pipe(gulp.dest('.tmp'));
-});
-
-gulp.task('transpile:client:test', ['tsd:test'], () => {
- let tsTestProject = plugins.typescript.createProject('./tsconfig.client.json');
- return tsTestProject.src()
- .pipe(plugins.sourcemaps.init())
- .pipe(plugins.typescript(tsTestProject)).js
- .pipe(plugins.sourcemaps.write('.'))
- .pipe(gulp.dest('.tmp/test'));
-});<% } %><% if(filters.babel) { %>
-
-gulp.task('transpile:client', () => {
- return gulp.src(paths.client.scripts)
- .pipe(transpileClient())
- .pipe(gulp.dest('.tmp'));
-});<% } %>
-
-gulp.task('transpile:server', () => {
- return gulp.src(_.union(paths.server.scripts, paths.server.json))
- .pipe(transpileServer())
- .pipe(gulp.dest(`${paths.dist}/${serverPath}`));
-});
-
-gulp.task('lint:scripts', cb => runSequence(['lint:scripts:client', 'lint:scripts:server'], cb));
-
-gulp.task('lint:scripts:client', () => {
- return gulp.src(_.union(
- paths.client.scripts,
- _.map(paths.client.test, blob => '!' + blob),
- [`!${clientPath}/app/app.constant.<%= scriptExt %>`]
- ))
- .pipe(lintClientScripts());
-});
-
-gulp.task('lint:scripts:server', () => {
- return gulp.src(_.union(paths.server.scripts, _.map(paths.server.test, blob => '!' + blob)))
- .pipe(lintServerScripts());
-});
-
-gulp.task('lint:scripts:clientTest', () => {
- return gulp.src(paths.client.test)
- .pipe(lintClientScripts());
-});
-
-gulp.task('lint:scripts:serverTest', () => {
- return gulp.src(paths.server.test)
- .pipe(lintServerTestScripts());
-});
-
-gulp.task('jscs', () => {
- return gulp.src(_.union(paths.client.scripts, paths.server.scripts))
- .pipe(plugins.jscs())
- .pipe(plugins.jscs.reporter());
-});
-
-gulp.task('clean:tmp', () => del(['.tmp/**/*'], {dot: true}));
-
-gulp.task('start:client', cb => {
- whenServerReady(() => {
- open('http://localhost:' + config.port);
- cb();
- });
-});
-
-gulp.task('start:server:prod', () => {
- process.env.NODE_ENV = process.env.NODE_ENV || 'production';
- config = require(`./${paths.dist}/${serverPath}/config/environment`);
- nodemon(`-w ${paths.dist}/${serverPath} ${paths.dist}/${serverPath}`)
- .on('log', onServerLog);
-});
-
-gulp.task('start:server', () => {
- process.env.NODE_ENV = process.env.NODE_ENV || 'development';
- config = require(`./${serverPath}/config/environment`);
- nodemon(`-w ${serverPath} ${serverPath}`)
- .on('log', onServerLog);
-});
-
-gulp.task('watch', () => {
- var testFiles = _.union(paths.client.test, paths.server.test.unit, paths.server.test.integration);
-
- plugins.livereload.listen();
-
- plugins.watch(paths.client.styles, () => { //['inject:<%= styleExt %>']
- gulp.src(paths.client.mainStyle)
- .pipe(plugins.plumber())
- .pipe(styles())
- .pipe(gulp.dest('.tmp/app'))
- .pipe(plugins.livereload());
- });
-
- plugins.watch(paths.client.views)<% if(filters.jade) { %>
- .pipe(plugins.jade())
- .pipe(gulp.dest('.tmp'))<% } %>
- .pipe(plugins.plumber())
- .pipe(plugins.livereload());<% if(filters.babel) { %>
-
- plugins.watch(paths.client.scripts) //['inject:js']
- .pipe(plugins.plumber())
- .pipe(transpileClient())
- .pipe(gulp.dest('.tmp'))
- .pipe(plugins.livereload());<% } %><% if(filters.ts) { %>
-
- gulp.watch(paths.client.scripts, ['inject:tsconfig', 'lint:scripts:client', 'transpile:client']);<% } %>
-
- plugins.watch(_.union(paths.server.scripts, testFiles))
- .pipe(plugins.plumber())
- .pipe(lintServerScripts())
- .pipe(plugins.livereload());
-
- gulp.watch('bower.json', ['wiredep:client']);
-});
-
-gulp.task('serve', cb => {
- runSequence(['clean:tmp', 'constant'<% if(filters.ts) { %>, 'tsd'<% } %>],
- ['lint:scripts', 'inject'<% if(filters.jade) { %>, 'jade'<% } %>],
- ['wiredep:client'],
- ['transpile:client', 'styles'],
- ['start:server', 'start:client'],
- 'watch',
- cb);
-});
-
-gulp.task('serve:dist', cb => {
- runSequence(
- 'build',
- 'env:all',
- 'env:prod',
- ['start:server:prod', 'start:client'],
- cb);
-});
-
-gulp.task('test', cb => {
- return runSequence('test:server', 'test:client', cb);
-});
-
-gulp.task('test:server', cb => {
- runSequence(
- 'env:all',
- 'env:test',
- 'mocha:unit',
- 'mocha:integration',
- 'mocha:coverage',
- cb);
-});
-
-gulp.task('mocha:unit', () => {
- return gulp.src(paths.server.test.unit)
- .pipe(mocha());
-});
-
-gulp.task('mocha:integration', () => {
- return gulp.src(paths.server.test.integration)
- .pipe(mocha());
-});
-
-gulp.task('test:client', ['wiredep:test', 'constant'<% if(filters.ts) { %>, 'tsd:test', 'transpile:client', 'transpile:client:test'<% } %>], (done) => {
- new KarmaServer({
- configFile: `${__dirname}/${paths.karma}`,
- singleRun: true
- }, done).start();
-});
-
-// inject bower components
-gulp.task('wiredep:client', () => {
- return gulp.src(paths.client.mainView)
- .pipe(wiredep({
- exclude: [<% if(filters.uibootstrap) { %>
- /bootstrap.js/,<% } %>
- '/json3/',
- '/es5-shim/'<% if(!filters.css) { %>,
- /font-awesome\.css/<% if(filters.bootstrap) { %>,
- /bootstrap\.css/<% if(filters.sass) { %>,
- /bootstrap-sass-official/<% } if(filters.oauth) { %>,
- /bootstrap-social\.css/<% }}} %>
- ]
- ignorePath: clientPath
- }))
- .pipe(gulp.dest(`${clientPath}/`));
-});
-
-gulp.task('wiredep:test', () => {
- return gulp.src(paths.karma)
- .pipe(wiredep({
- exclude: [<% if(filters.uibootstrap) { %>
- /bootstrap.js/,<% } %>
- '/json3/',
- '/es5-shim/'<% if(!filters.css) { %>,
- /font-awesome\.css/<% if(filters.bootstrap) { %>,
- /bootstrap\.css/<% if(filters.sass) { %>,
- /bootstrap-sass-official/<% } if(filters.oauth) { %>,
- /bootstrap-social\.css/<% }}} %>
- ]
- devDependencies: true
- }))
- .pipe(gulp.dest('./'));
-});
-
-/********************
- * Build
- ********************/
-
-//FIXME: looks like font-awesome isn't getting loaded
-gulp.task('build', cb => {
- runSequence(
- [
- 'clean:dist',
- 'clean:tmp'
- ],<% if(filters.jade) { %>
- 'jade',<% } %>
- 'inject',
- 'wiredep:client',<% if(filters.ts) { %>
- 'tsd',<% } %>
- [
- 'build:images',
- 'copy:extras',
- 'copy:fonts',
- 'copy:assets',
- 'copy:server',
- 'transpile:server',
- 'build:client'
- ],
- cb);
-});
-
-gulp.task('clean:dist', () => del([`${paths.dist}/!(.git*|.openshift|Procfile)**`], {dot: true}));
-
-gulp.task('build:client', ['transpile:client', 'styles', 'html', 'constant'], () => {
- var manifest = gulp.src(`${paths.dist}/${clientPath}/assets/rev-manifest.json`);
-
- var appFilter = plugins.filter('**/app.js', {restore: true});
- var jsFilter = plugins.filter('**/*.js', {restore: true});
- var cssFilter = plugins.filter('**/*.css', {restore: true});
- var htmlBlock = plugins.filter(['**/*.!(html)'], {restore: true});
-
- return gulp.src(paths.client.mainView)
- .pipe(plugins.useref())
- .pipe(appFilter)
- .pipe(plugins.addSrc.append('.tmp/templates.js'))
- .pipe(plugins.concat('app/app.js'))
- .pipe(appFilter.restore)
- .pipe(jsFilter)
- .pipe(plugins.ngAnnotate())
- .pipe(plugins.uglify())
- .pipe(jsFilter.restore)
- .pipe(cssFilter)
- .pipe(plugins.minifyCss({
- cache: true,
- processImportFrom: ['!fonts.googleapis.com']
- }))
- .pipe(cssFilter.restore)
- .pipe(htmlBlock)
- .pipe(plugins.rev())
- .pipe(htmlBlock.restore)
- .pipe(plugins.revReplace({manifest}))
- .pipe(gulp.dest(`${paths.dist}/${clientPath}`));
-});
-
-gulp.task('html', function() {<% if(filters.jade) { %>
- return gulp.src(`.tmp/{app,components}/**/*.html`)<% } else { %>
- return gulp.src(`${clientPath}/{app,components}/**/*.html`)<% } %>
- .pipe(plugins.angularTemplatecache({
- module: '<%= scriptAppName %>'
- }))
- .pipe(gulp.dest('.tmp'));
-});<% if (filters.jade) { %>
-gulp.task('jade', function() {
- gulp.src(paths.client.views)
- .pipe(plugins.jade())
- .pipe(gulp.dest('.tmp'));
-});<% } %>
-
-gulp.task('constant', function() {
- let sharedConfig = require(`./${serverPath}/config/environment/shared`);
- return plugins.ngConstant({
- name: '<%= scriptAppName %>.constants',
- deps: [],
- wrap: true,
- stream: true,
- constants: { appConfig: sharedConfig }
- })
- .pipe(plugins.rename({
- basename: 'app.constant'
- }))
- .pipe(gulp.dest(`${clientPath}/app/`))
-});
-
-gulp.task('build:images', () => {
- return gulp.src(paths.client.images)
- .pipe(plugins.imagemin({
- optimizationLevel: 5,
- progressive: true,
- interlaced: true
- }))
- .pipe(plugins.rev())
- .pipe(gulp.dest(`${paths.dist}/${clientPath}/assets/images`))
- .pipe(plugins.rev.manifest(`${paths.dist}/${clientPath}/assets/rev-manifest.json`, {
- base: `${paths.dist}/${clientPath}/assets`,
- merge: true
- }))
- .pipe(gulp.dest(`${paths.dist}/${clientPath}/assets`));
-});
-
-gulp.task('copy:extras', () => {
- return gulp.src([
- `${clientPath}/favicon.ico`,
- `${clientPath}/robots.txt`,
- `${clientPath}/.htaccess`
- ], { dot: true })
- .pipe(gulp.dest(`${paths.dist}/${clientPath}`));
-});
-
-gulp.task('copy:fonts', () => {<% if(filters.bootstrap) { %>
- return gulp.src(`${clientPath}/bower_components/{bootstrap,font-awesome}/fonts/**/*`, { dot: true })<% } else { %>
- return gulp.src(`${clientPath}/bower_components/font-awesome/fonts/**/*`, { dot: true })<% } %>
- .pipe(gulp.dest(`${paths.dist}/${clientPath}/bower_components`));
-});
-
-gulp.task('copy:assets', () => {
- return gulp.src([paths.client.assets, '!' + paths.client.images])
- .pipe(gulp.dest(`${paths.dist}/${clientPath}/assets`));
-});
-
-gulp.task('copy:server', () => {
- return gulp.src([
- 'package.json',
- 'bower.json',
- '.bowerrc'
- ], {cwdbase: true})
- .pipe(gulp.dest(paths.dist));
-});
-
-gulp.task('coverage:pre', () => {
- return gulp.src(paths.server.scripts)
- // Covering files
- .pipe(plugins.istanbul({
- instrumenter: Instrumenter, // Use the isparta instrumenter (code coverage for ES6)
- includeUntested: true
- }))
- // Force `require` to return covered files
- .pipe(plugins.istanbul.hookRequire());
-});
-
-gulp.task('coverage:unit', () => {
- return gulp.src(paths.server.test.unit)
- .pipe(mocha())
- .pipe(istanbul())
- // Creating the reports after tests ran
-});
-
-gulp.task('coverage:integration', () => {
- return gulp.src(paths.server.test.integration)
- .pipe(mocha())
- .pipe(istanbul())
- // Creating the reports after tests ran
-});
-
-gulp.task('mocha:coverage', cb => {
- runSequence('coverage:pre',
- 'env:all',
- 'env:test',
- 'coverage:unit',
- 'coverage:integration',
- cb);
-});
-
-// Downloads the selenium webdriver
-gulp.task('webdriver_update', webdriver_update);
-
-gulp.task('test:e2e', ['env:all', 'env:test', 'start:server', 'webdriver_update'], cb => {
- gulp.src(paths.client.e2e)
- .pipe(protractor({
- configFile: 'protractor.conf.js',
- })).on('error', err => {
- console.log(err)
- }).on('end', () => {
- process.exit();
- });
-});
diff --git a/app/templates/mocha.global(gulp).js b/app/templates/mocha.global(gulp).js
deleted file mode 100644
index c34b2da8c..000000000
--- a/app/templates/mocha.global(gulp).js
+++ /dev/null
@@ -1,8 +0,0 @@
-import app from './';<% if (filters.mongoose) { %>
-import mongoose from 'mongoose';<% } %>
-
-after(function(done) {
- app.angularFullstack.on('close', () => done());<% if (filters.mongoose) { %>
- mongoose.connection.close();<% } %>
- app.angularFullstack.close();
-});
diff --git a/app/templates/server/.jshintrc b/app/templates/server/.jshintrc
deleted file mode 100644
index 69f3b00e3..000000000
--- a/app/templates/server/.jshintrc
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "expr": true,
- "node": true,
- "esnext": true,
- "bitwise": true,
- "eqeqeq": true,
- "immed": true,
- "latedef": "nofunc",
- "newcap": true,
- "noarg": true,
- "undef": true,
- "smarttabs": true,
- "asi": true,
- "debug": true
-}
diff --git a/app/templates/server/.jshintrc-spec b/app/templates/server/.jshintrc-spec
deleted file mode 100644
index 8c9871ce0..000000000
--- a/app/templates/server/.jshintrc-spec
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "extends": ".jshintrc",
- "globals": {<% if (filters.jasmine) { %>
- "jasmine": true,<% } %>
- "describe": true,
- "it": true,
- "before": true,
- "beforeEach": true,
- "after": true,
- "afterEach": true,
- "expect": true,
- "assert": true,
- "sinon": true
- }
-}
diff --git a/app/templates/server/api/user(auth)/index.spec.js b/app/templates/server/api/user(auth)/index.spec.js
deleted file mode 100644
index 07d2aecf0..000000000
--- a/app/templates/server/api/user(auth)/index.spec.js
+++ /dev/null
@@ -1,107 +0,0 @@
-'use strict';
-
-var proxyquire = require('proxyquire').noPreserveCache();
-
-var userCtrlStub = {
- index: 'userCtrl.index',
- destroy: 'userCtrl.destroy',
- me: 'userCtrl.me',
- changePassword: 'userCtrl.changePassword',
- show: 'userCtrl.show',
- create: 'userCtrl.create'
-};
-
-var authServiceStub = {
- isAuthenticated() {
- return 'authService.isAuthenticated';
- },
- hasRole(role) {
- return 'authService.hasRole.' + role;
- }
-};
-
-var routerStub = {
- get: sinon.spy(),
- put: sinon.spy(),
- post: sinon.spy(),
- delete: sinon.spy()
-};
-
-// require the index with our stubbed out modules
-var userIndex = proxyquire('./index', {
- 'express': {
- Router() {
- return routerStub;
- }
- },
- './user.controller': userCtrlStub,
- '../../auth/auth.service': authServiceStub
-});
-
-describe('User API Router:', function() {
-
- it('should return an express router instance', function() {
- <%= expect() %>userIndex<%= to() %>.equal(routerStub);
- });
-
- describe('GET /api/users', function() {
-
- it('should verify admin role and route to user.controller.index', function() {
- <%= expect() %>routerStub.get
- .withArgs('/', 'authService.hasRole.admin', 'userCtrl.index')
- <%= to() %>.have.been.calledOnce;
- });
-
- });
-
- describe('DELETE /api/users/:id', function() {
-
- it('should verify admin role and route to user.controller.destroy', function() {
- <%= expect() %>routerStub.delete
- .withArgs('/:id', 'authService.hasRole.admin', 'userCtrl.destroy')
- <%= to() %>.have.been.calledOnce;
- });
-
- });
-
- describe('GET /api/users/me', function() {
-
- it('should be authenticated and route to user.controller.me', function() {
- <%= expect() %>routerStub.get
- .withArgs('/me', 'authService.isAuthenticated', 'userCtrl.me')
- <%= to() %>.have.been.calledOnce;
- });
-
- });
-
- describe('PUT /api/users/:id/password', function() {
-
- it('should be authenticated and route to user.controller.changePassword', function() {
- <%= expect() %>routerStub.put
- .withArgs('/:id/password', 'authService.isAuthenticated', 'userCtrl.changePassword')
- <%= to() %>.have.been.calledOnce;
- });
-
- });
-
- describe('GET /api/users/:id', function() {
-
- it('should be authenticated and route to user.controller.show', function() {
- <%= expect() %>routerStub.get
- .withArgs('/:id', 'authService.isAuthenticated', 'userCtrl.show')
- <%= to() %>.have.been.calledOnce;
- });
-
- });
-
- describe('POST /api/users', function() {
-
- it('should route to user.controller.create', function() {
- <%= expect() %>routerStub.post
- .withArgs('/', 'userCtrl.create')
- <%= to() %>.have.been.calledOnce;
- });
-
- });
-
-});
diff --git a/app/templates/server/api/user(auth)/user.controller.js b/app/templates/server/api/user(auth)/user.controller.js
deleted file mode 100644
index c79048546..000000000
--- a/app/templates/server/api/user(auth)/user.controller.js
+++ /dev/null
@@ -1,160 +0,0 @@
-'use strict';
-<% if (filters.mongooseModels) { %>
-import User from './user.model';<% } %><% if (filters.sequelizeModels) { %>
-import {User} from '../../sqldb';<% } %>
-import passport from 'passport';
-import config from '../../config/environment';
-import jwt from 'jsonwebtoken';
-
-function validationError(res, statusCode) {
- statusCode = statusCode || 422;
- return function(err) {
- res.status(statusCode).json(err);
- }
-}
-
-function handleError(res, statusCode) {
- statusCode = statusCode || 500;
- return function(err) {
- res.status(statusCode).send(err);
- };
-}
-
-/**
- * Get list of users
- * restriction: 'admin'
- */
-export function index(req, res) {
- <% if (filters.mongooseModels) { %>return User.find({}, '-salt -password').exec()<% }
- if (filters.sequelizeModels) { %>return User.findAll({
- attributes: [
- '_id',
- 'name',
- 'email',
- 'role',
- 'provider'
- ]
- })<% } %>
- .then(users => {
- res.status(200).json(users);
- })
- .catch(handleError(res));
-}
-
-/**
- * Creates a new user
- */
-export function create(req, res, next) {
- <% if (filters.mongooseModels) { %>var newUser = new User(req.body);
- newUser.provider = 'local';
- newUser.role = 'user';
- newUser.save()<% }
- if (filters.sequelizeModels) { %>var newUser = User.build(req.body);
- newUser.setDataValue('provider', 'local');
- newUser.setDataValue('role', 'user');
- return newUser.save()<% } %>
- .then(function(user) {
- var token = jwt.sign({ _id: user._id }, config.secrets.session, {
- expiresIn: 60 * 60 * 5
- });
- res.json({ token });
- })
- .catch(validationError(res));
-}
-
-/**
- * Get a single user
- */
-export function show(req, res, next) {
- var userId = req.params.id;
-
- <% if (filters.mongooseModels) { %>return User.findById(userId).exec()<% }
- if (filters.sequelizeModels) { %>return User.find({
- where: {
- _id: userId
- }
- })<% } %>
- .then(user => {
- if (!user) {
- return res.status(404).end();
- }
- res.json(user.profile);
- })
- .catch(err => next(err));
-}
-
-/**
- * Deletes a user
- * restriction: 'admin'
- */
-export function destroy(req, res) {
- <% if (filters.mongooseModels) { %>return User.findByIdAndRemove(req.params.id).exec()<% }
- if (filters.sequelizeModels) { %>return User.destroy({ _id: req.params.id })<% } %>
- .then(function() {
- res.status(204).end();
- })
- .catch(handleError(res));
-}
-
-/**
- * Change a users password
- */
-export function changePassword(req, res, next) {
- var userId = req.user._id;
- var oldPass = String(req.body.oldPassword);
- var newPass = String(req.body.newPassword);
-
- <% if (filters.mongooseModels) { %>return User.findById(userId).exec()<% }
- if (filters.sequelizeModels) { %>return User.find({
- where: {
- _id: userId
- }
- })<% } %>
- .then(user => {
- if (user.authenticate(oldPass)) {
- user.password = newPass;
- return user.save()
- .then(() => {
- res.status(204).end();
- })
- .catch(validationError(res));
- } else {
- return res.status(403).end();
- }
- });
-}
-
-/**
- * Get my info
- */
-export function me(req, res, next) {
- var userId = req.user._id;
-
- <% if (filters.mongooseModels) { %>return User.findOne({ _id: userId }, '-salt -password').exec()<% }
- if (filters.sequelizeModels) { %>return User.find({
- where: {
- _id: userId
- },
- attributes: [
- '_id',
- 'name',
- 'email',
- 'role',
- 'provider'
- ]
- })<% } %>
- .then(user => { // don't ever give out the password or salt
- if (!user) {
- return res.status(401).end();
- }
- res.json(user);
- })
- .catch(err => next(err));
-}
-
-/**
- * Authentication callback
- */
-export function authCallback(req, res, next) {
- res.redirect('/');
-}
diff --git a/app/templates/server/api/user(auth)/user.events.js b/app/templates/server/api/user(auth)/user.events.js
deleted file mode 100644
index 1cd0480e5..000000000
--- a/app/templates/server/api/user(auth)/user.events.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * User model events
- */
-
-'use strict';
-
-import {EventEmitter} from 'events';<% if (filters.mongooseModels) { %>
-import User from './user.model';<% } if (filters.sequelizeModels) { %>
-import {User} from '../../sqldb';<% } %>
-var UserEvents = new EventEmitter();
-
-// Set max event listeners (0 == unlimited)
-UserEvents.setMaxListeners(0);
-
-// Model events<% if (filters.mongooseModels) { %>
-var events = {
- 'save': 'save',
- 'remove': 'remove'
-};<% } if (filters.sequelizeModels) { %>
-var events = {
- 'afterCreate': 'save',
- 'afterUpdate': 'save',
- 'afterDestroy': 'remove'
-};<% } %>
-
-// Register the event emitter to the model events
-for (var e in events) {
- var event = events[e];<% if (filters.mongooseModels) { %>
- User.schema.post(e, emitEvent(event));<% } if (filters.sequelizeModels) { %>
- User.hook(e, emitEvent(event));<% } %>
-}
-
-function emitEvent(event) {
- return function(doc<% if (filters.sequelizeModels) { %>, options, done<% } %>) {
- UserEvents.emit(event + ':' + doc._id, doc);
- UserEvents.emit(event, doc);<% if (filters.sequelizeModels) { %>
- done(null);<% } %>
- }
-}
-
-export default UserEvents;
diff --git a/app/templates/server/api/user(auth)/user.integration.js b/app/templates/server/api/user(auth)/user.integration.js
deleted file mode 100644
index 3e6db4ebd..000000000
--- a/app/templates/server/api/user(auth)/user.integration.js
+++ /dev/null
@@ -1,70 +0,0 @@
-'use strict';
-
-import app from '../..';<% if (filters.mongooseModels) { %>
-import User from './user.model';<% } %><% if (filters.sequelizeModels) { %>
-import {User} from '../../sqldb';<% } %>
-import request from 'supertest';
-
-describe('User API:', function() {
- var user;
-
- // Clear users before testing
- before(function() {
- return <% if (filters.mongooseModels) { %>User.remove().then(function() {<% }
- if (filters.sequelizeModels) { %>User.destroy({ where: {} }).then(function() {<% } %>
- <% if (filters.mongooseModels) { %>user = new User({<% }
- if (filters.sequelizeModels) { %>user = User.build({<% } %>
- name: 'Fake User',
- email: 'test@example.com',
- password: 'password'
- });
-
- return <% if (filters.mongooseModels) { %>user.save();<% }
- if (filters.sequelizeModels) { %>user.save();<% } %>
- });
- });
-
- // Clear users after testing
- after(function() {
- <% if (filters.mongooseModels) { %>return User.remove();<% }
- if (filters.sequelizeModels) { %>return User.destroy({ where: {} });<% } %>
- });
-
- describe('GET /api/users/me', function() {
- var token;
-
- before(function(done) {
- request(app)
- .post('/auth/local')
- .send({
- email: 'test@example.com',
- password: 'password'
- })
- .expect(200)
- .expect('Content-Type', /json/)
- .end((err, res) => {
- token = res.body.token;
- done();
- });
- });
-
- it('should respond with a user profile when authenticated', function(done) {
- request(app)
- .get('/api/users/me')
- .set('authorization', 'Bearer ' + token)
- .expect(200)
- .expect('Content-Type', /json/)
- .end((err, res) => {
- <%= expect() %>res.body._id.toString()<%= to() %>.equal(user._id.toString());
- done();
- });
- });
-
- it('should respond with a 401 when not authenticated', function(done) {
- request(app)
- .get('/api/users/me')
- .expect(401)
- .end(done);
- });
- });
-});
diff --git a/app/templates/server/api/user(auth)/user.model(mongooseModels).js b/app/templates/server/api/user(auth)/user.model(mongooseModels).js
deleted file mode 100644
index 04683efb2..000000000
--- a/app/templates/server/api/user(auth)/user.model(mongooseModels).js
+++ /dev/null
@@ -1,228 +0,0 @@
-'use strict';
-
-import crypto from 'crypto';
-import mongoose from 'mongoose';
-mongoose.Promise = require('bluebird');
-import {Schema} from 'mongoose';<% if (filters.oauth) { %>
-
-const authTypes = ['github', 'twitter', 'facebook', 'google'];<% } %>
-
-var UserSchema = new Schema({
- name: String,
- email: {
- type: String,
- lowercase: true
- },
- role: {
- type: String,
- default: 'user'
- },
- password: String,
- provider: String,
- salt: String<% if (filters.oauth) { %>,<% if (filters.facebookAuth) { %>
- facebook: {},<% } %><% if (filters.twitterAuth) { %>
- twitter: {},<% } %><% if (filters.googleAuth) { %>
- google: {},<% } %>
- github: {}<% } %>
-});
-
-/**
- * Virtuals
- */
-
-// Public profile information
-UserSchema
- .virtual('profile')
- .get(function() {
- return {
- 'name': this.name,
- 'role': this.role
- };
- });
-
-// Non-sensitive info we'll be putting in the token
-UserSchema
- .virtual('token')
- .get(function() {
- return {
- '_id': this._id,
- 'role': this.role
- };
- });
-
-/**
- * Validations
- */
-
-// Validate empty email
-UserSchema
- .path('email')
- .validate(function(email) {<% if (filters.oauth) { %>
- if (authTypes.indexOf(this.provider) !== -1) {
- return true;
- }<% } %>
- return email.length;
- }, 'Email cannot be blank');
-
-// Validate empty password
-UserSchema
- .path('password')
- .validate(function(password) {<% if (filters.oauth) { %>
- if (authTypes.indexOf(this.provider) !== -1) {
- return true;
- }<% } %>
- return password.length;
- }, 'Password cannot be blank');
-
-// Validate email is not taken
-UserSchema
- .path('email')
- .validate(function(value, respond) {
- var self = this;
- return this.constructor.findOne({ email: value }).exec()
- .then(function(user) {
- if (user) {
- if (self.id === user.id) {
- return respond(true);
- }
- return respond(false);
- }
- return respond(true);
- })
- .catch(function(err) {
- throw err;
- });
- }, 'The specified email address is already in use.');
-
-var validatePresenceOf = function(value) {
- return value && value.length;
-};
-
-/**
- * Pre-save hook
- */
-UserSchema
- .pre('save', function(next) {
- // Handle new/update passwords
- if (!this.isModified('password')) {
- return next();
- }
-
- if (!validatePresenceOf(this.password)<% if (filters.oauth) { %> && authTypes.indexOf(this.provider) === -1<% } %>) {
- return next(new Error('Invalid password'));
- }
-
- // Make salt with a callback
- this.makeSalt((saltErr, salt) => {
- if (saltErr) {
- return next(saltErr);
- }
- this.salt = salt;
- this.encryptPassword(this.password, (encryptErr, hashedPassword) => {
- if (encryptErr) {
- return next(encryptErr);
- }
- this.password = hashedPassword;
- next();
- });
- });
- });
-
-/**
- * Methods
- */
-UserSchema.methods = {
- /**
- * Authenticate - check if the passwords are the same
- *
- * @param {String} password
- * @param {Function} callback
- * @return {Boolean}
- * @api public
- */
- authenticate(password, callback) {
- if (!callback) {
- return this.password === this.encryptPassword(password);
- }
-
- this.encryptPassword(password, (err, pwdGen) => {
- if (err) {
- return callback(err);
- }
-
- if (this.password === pwdGen) {
- callback(null, true);
- } else {
- callback(null, false);
- }
- });
- },
-
- /**
- * Make salt
- *
- * @param {Number} byteSize Optional salt byte size, default to 16
- * @param {Function} callback
- * @return {String}
- * @api public
- */
- makeSalt(byteSize, callback) {
- var defaultByteSize = 16;
-
- if (typeof arguments[0] === 'function') {
- callback = arguments[0];
- byteSize = defaultByteSize;
- } else if (typeof arguments[1] === 'function') {
- callback = arguments[1];
- }
-
- if (!byteSize) {
- byteSize = defaultByteSize;
- }
-
- if (!callback) {
- return crypto.randomBytes(byteSize).toString('base64');
- }
-
- return crypto.randomBytes(byteSize, (err, salt) => {
- if (err) {
- callback(err);
- } else {
- callback(null, salt.toString('base64'));
- }
- });
- },
-
- /**
- * Encrypt password
- *
- * @param {String} password
- * @param {Function} callback
- * @return {String}
- * @api public
- */
- encryptPassword(password, callback) {
- if (!password || !this.salt) {
- return null;
- }
-
- var defaultIterations = 10000;
- var defaultKeyLength = 64;
- var salt = new Buffer(this.salt, 'base64');
-
- if (!callback) {
- return crypto.pbkdf2Sync(password, salt, defaultIterations, defaultKeyLength)
- .toString('base64');
- }
-
- return crypto.pbkdf2(password, salt, defaultIterations, defaultKeyLength, (err, key) => {
- if (err) {
- callback(err);
- } else {
- callback(null, key.toString('base64'));
- }
- });
- }
-};
-
-export default mongoose.model('User', UserSchema);
diff --git a/app/templates/server/api/user(auth)/user.model(sequelizeModels).js b/app/templates/server/api/user(auth)/user.model(sequelizeModels).js
deleted file mode 100644
index e2c625378..000000000
--- a/app/templates/server/api/user(auth)/user.model(sequelizeModels).js
+++ /dev/null
@@ -1,236 +0,0 @@
-'use strict';
-
-import crypto from 'crypto';<% if (filters.oauth) { %>
-var authTypes = ['github', 'twitter', 'facebook', 'google'];<% } %>
-
-var validatePresenceOf = function(value) {
- return value && value.length;
-};
-
-module.exports = function(sequelize, DataTypes) {
- var User = sequelize.define('User', {
-
- _id: {
- type: DataTypes.INTEGER,
- allowNull: false,
- primaryKey: true,
- autoIncrement: true
- },
- name: DataTypes.STRING,
- email: {
- type: DataTypes.STRING,
- unique: {
- msg: 'The specified email address is already in use.'
- },
- validate: {
- isEmail: true
- }
- },
- role: {
- type: DataTypes.STRING,
- defaultValue: 'user'
- },
- password: {
- type: DataTypes.STRING,
- validate: {
- notEmpty: true
- }
- },
- provider: DataTypes.STRING,
- salt: DataTypes.STRING<% if (filters.oauth) { %>,<% if (filters.facebookAuth) { %>
- facebook: DataTypes.JSON,<% } %><% if (filters.twitterAuth) { %>
- twitter: DataTypes.JSON,<% } %><% if (filters.googleAuth) { %>
- google: DataTypes.JSON,<% } %>
- github: DataTypes.JSON<% } %>
-
- }, {
-
- /**
- * Virtual Getters
- */
- getterMethods: {
- // Public profile information
- profile: function() {
- return {
- 'name': this.name,
- 'role': this.role
- };
- },
-
- // Non-sensitive info we'll be putting in the token
- token: function() {
- return {
- '_id': this._id,
- 'role': this.role
- };
- }
- },
-
- /**
- * Pre-save hooks
- */
- hooks: {
- beforeBulkCreate: function(users, fields, fn) {
- var totalUpdated = 0;
- users.forEach(function(user) {
- user.updatePassword(function(err) {
- if (err) {
- return fn(err);
- }
- totalUpdated += 1;
- if (totalUpdated === users.length) {
- return fn();
- }
- });
- });
- },
- beforeCreate: function(user, fields, fn) {
- user.updatePassword(fn);
- },
- beforeUpdate: function(user, fields, fn) {
- if (user.changed('password')) {
- return user.updatePassword(fn);
- }
- fn();
- }
- },
-
- /**
- * Instance Methods
- */
- instanceMethods: {
- /**
- * Authenticate - check if the passwords are the same
- *
- * @param {String} password
- * @param {Function} callback
- * @return {Boolean}
- * @api public
- */
- authenticate: function(password, callback) {
- if (!callback) {
- return this.password === this.encryptPassword(password);
- }
-
- var _this = this;
- this.encryptPassword(password, function(err, pwdGen) {
- if (err) {
- callback(err);
- }
-
- if (_this.password === pwdGen) {
- callback(null, true);
- }
- else {
- callback(null, false);
- }
- });
- },
-
- /**
- * Make salt
- *
- * @param {Number} byteSize Optional salt byte size, default to 16
- * @param {Function} callback
- * @return {String}
- * @api public
- */
- makeSalt: function(byteSize, callback) {
- var defaultByteSize = 16;
-
- if (typeof arguments[0] === 'function') {
- callback = arguments[0];
- byteSize = defaultByteSize;
- }
- else if (typeof arguments[1] === 'function') {
- callback = arguments[1];
- }
-
- if (!byteSize) {
- byteSize = defaultByteSize;
- }
-
- if (!callback) {
- return crypto.randomBytes(byteSize).toString('base64');
- }
-
- return crypto.randomBytes(byteSize, function(err, salt) {
- if (err) {
- callback(err);
- }
- return callback(null, salt.toString('base64'));
- });
- },
-
- /**
- * Encrypt password
- *
- * @param {String} password
- * @param {Function} callback
- * @return {String}
- * @api public
- */
- encryptPassword: function(password, callback) {
- if (!password || !this.salt) {
- if (!callback) {
- return null;
- }
- return callback(null);
- }
-
- var defaultIterations = 10000;
- var defaultKeyLength = 64;
- var salt = new Buffer(this.salt, 'base64');
-
- if (!callback) {
- return crypto.pbkdf2Sync(password, salt, defaultIterations, defaultKeyLength)
- .toString('base64');
- }
-
- return crypto.pbkdf2(password, salt, defaultIterations, defaultKeyLength,
- function(err, key) {
- if (err) {
- callback(err);
- }
- return callback(null, key.toString('base64'));
- });
- },
-
- /**
- * Update password field
- *
- * @param {Function} fn
- * @return {String}
- * @api public
- */
- updatePassword: function(fn) {
- // Handle new/update passwords
- if (this.password) {
- if (!validatePresenceOf(this.password)<% if (filters.oauth) { %> && authTypes.indexOf(this.provider) === -1<% } %>) {
- fn(new Error('Invalid password'));
- }
-
- // Make salt with a callback
- var _this = this;
- this.makeSalt(function(saltErr, salt) {
- if (saltErr) {
- fn(saltErr);
- }
- _this.salt = salt;
- _this.encryptPassword(_this.password, function(encryptErr, hashedPassword) {
- if (encryptErr) {
- fn(encryptErr);
- }
- _this.password = hashedPassword;
- fn(null);
- });
- });
- } else {
- fn(null);
- }
- }
- }
- });
-
- return User;
-};
diff --git a/app/templates/server/api/user(auth)/user.model.spec(mongooseModels).js b/app/templates/server/api/user(auth)/user.model.spec(mongooseModels).js
deleted file mode 100644
index f67b01520..000000000
--- a/app/templates/server/api/user(auth)/user.model.spec(mongooseModels).js
+++ /dev/null
@@ -1,72 +0,0 @@
-'use strict';
-
-import app from '../..';
-import User from './user.model';
-var user;
-var genUser = function() {
- user = new User({
- provider: 'local',
- name: 'Fake User',
- email: 'test@example.com',
- password: 'password'
- });
- return user;
-};
-
-describe('User Model', function() {
- before(function() {
- // Clear users before testing
- return User.remove();
- });
-
- beforeEach(function() {
- genUser();
- });
-
- afterEach(function() {
- return User.remove();
- });
-
- it('should begin with no users', function() {
- return <%= expect() %>User.find({}).exec()<%= to() %>
- .eventually.have.length(0);
- });
-
- it('should fail when saving a duplicate user', function() {
- return <%= expect() %>user.save()
- .then(function() {
- var userDup = genUser();
- return userDup.save();
- })<%= to() %>.be.rejected;
- });
-
- describe('#email', function() {
- it('should fail when saving without an email', function() {
- user.email = '';
- return <%= expect() %>user.save()<%= to() %>.be.rejected;
- });
- });
-
- describe('#password', function() {
- beforeEach(function() {
- return user.save();
- });
-
- it('should authenticate user if valid', function() {
- <%= expect() %>user.authenticate('password')<%= to() %>.be.true;
- });
-
- it('should not authenticate user if invalid', function() {
- <%= expect() %>user.authenticate('blah')<%= to() %>.not.be.true;
- });
-
- it('should remain the same hash unless the password is updated', function() {
- user.name = 'Test User';
- return <%= expect() %>user.save()
- .then(function(u) {
- return u.authenticate('password');
- })<%= to() %>.eventually.be.true;
- });
- });
-
-});
diff --git a/app/templates/server/api/user(auth)/user.model.spec(sequelizeModels).js b/app/templates/server/api/user(auth)/user.model.spec(sequelizeModels).js
deleted file mode 100644
index ec4196a03..000000000
--- a/app/templates/server/api/user(auth)/user.model.spec(sequelizeModels).js
+++ /dev/null
@@ -1,74 +0,0 @@
-'use strict';
-
-import app from '../..';
-import {User} from '../../sqldb';
-var user;
-var genUser = function() {
- user = User.build({
- provider: 'local',
- name: 'Fake User',
- email: 'test@example.com',
- password: 'password'
- });
- return user;
-};
-
-describe('User Model', function() {
- before(function() {
- // Sync and clear users before testing
- return User.sync().then(function() {
- return User.destroy({ where: {} });
- });
- });
-
- beforeEach(function() {
- genUser();
- });
-
- afterEach(function() {
- return User.destroy({ where: {} });
- });
-
- it('should begin with no users', function() {
- return <%= expect() %>User.findAll()<%= to() %>
- .eventually.have.length(0);
- });
-
- it('should fail when saving a duplicate user', function() {
- return <%= expect() %>user.save()
- .then(function() {
- var userDup = genUser();
- return userDup.save();
- })<%= to() %>.be.rejected;
- });
-
- describe('#email', function() {
- it('should fail when saving without an email', function() {
- user.email = '';
- return <%= expect() %>user.save()<%= to() %>.be.rejected;
- });
- });
-
- describe('#password', function() {
- beforeEach(function() {
- return user.save();
- });
-
- it('should authenticate user if valid', function() {
- <%= expect() %>user.authenticate('password')<%= to() %>.be.true;
- });
-
- it('should not authenticate user if invalid', function() {
- <%= expect() %>user.authenticate('blah')<%= to() %>.not.be.true;
- });
-
- it('should remain the same hash unless the password is updated', function() {
- user.name = 'Test User';
- return <%= expect() %>user.save()
- .then(function(u) {
- return u.authenticate('password');
- })<%= to() %>.eventually.be.true;
- });
- });
-
-});
diff --git a/app/templates/server/app.js b/app/templates/server/app.js
deleted file mode 100644
index a63b97cab..000000000
--- a/app/templates/server/app.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * Main application file
- */
-
-'use strict';
-
-import express from 'express';<% if (filters.mongoose) { %>
-import mongoose from 'mongoose';
-mongoose.Promise = require('bluebird');<% } %><% if (filters.sequelize) { %>
-import sqldb from './sqldb';<% } %>
-import config from './config/environment';
-import http from 'http';
-<% if (filters.mongoose) { %>
-// Connect to MongoDB
-mongoose.connect(config.mongo.uri, config.mongo.options);
-mongoose.connection.on('error', function(err) {
- console.error('MongoDB connection error: ' + err);
- process.exit(-1);
-});
-<% } %><% if (filters.models) { %>
-// Populate databases with sample data
-if (config.seedDB) { require('./config/seed'); }
-<% } %>
-// Setup server
-var app = express();
-var server = http.createServer(app);<% if (filters.socketio) { %>
-var socketio = require('socket.io')(server, {
- serveClient: config.env !== 'production',
- path: '/socket.io-client'
-});
-require('./config/socketio').default(socketio);<% } %>
-require('./config/express').default(app);
-require('./routes').default(app);
-
-// Start server
-function startServer() {
- app.angularFullstack = server.listen(config.port, config.ip, function() {
- console.log('Express server listening on %d, in %s mode', config.port, app.get('env'));
- });
-}
-<% if (filters.sequelize) { %>
-sqldb.sequelize.sync()
- .then(startServer)
- .catch(function(err) {
- console.log('Server failed to start due to error: %s', err);
- });
-<% } else { %>
-setImmediate(startServer);
-<% } %>
-// Expose app
-exports = module.exports = app;
diff --git a/app/templates/server/auth(auth)/auth.service.js b/app/templates/server/auth(auth)/auth.service.js
deleted file mode 100644
index 5cab4df4c..000000000
--- a/app/templates/server/auth(auth)/auth.service.js
+++ /dev/null
@@ -1,87 +0,0 @@
-'use strict';
-
-import passport from 'passport';
-import config from '../config/environment';
-import jwt from 'jsonwebtoken';
-import expressJwt from 'express-jwt';
-import compose from 'composable-middleware';<% if (filters.mongooseModels) { %>
-import User from '../api/user/user.model';<% } %><% if (filters.sequelizeModels) { %>
-import {User} from'../sqldb';<% } %>
-
-var validateJwt = expressJwt({
- secret: config.secrets.session
-});
-
-/**
- * Attaches the user object to the request if authenticated
- * Otherwise returns 403
- */
-export function isAuthenticated() {
- return compose()
- // Validate jwt
- .use(function(req, res, next) {
- // allow access_token to be passed through query parameter as well
- if (req.query && req.query.hasOwnProperty('access_token')) {
- req.headers.authorization = 'Bearer ' + req.query.access_token;
- }
- validateJwt(req, res, next);
- })
- // Attach user to request
- .use(function(req, res, next) {
- <% if (filters.mongooseModels) { %>User.findById(req.user._id).exec()<% }
- if (filters.sequelizeModels) { %>User.find({
- where: {
- _id: req.user._id
- }
- })<% } %>
- .then(user => {
- if (!user) {
- return res.status(401).end();
- }
- req.user = user;
- next();
- })
- .catch(err => next(err));
- });
-}
-
-/**
- * Checks if the user role meets the minimum requirements of the route
- */
-export function hasRole(roleRequired) {
- if (!roleRequired) {
- throw new Error('Required role needs to be set');
- }
-
- return compose()
- .use(isAuthenticated())
- .use(function meetsRequirements(req, res, next) {
- if (config.userRoles.indexOf(req.user.role) >=
- config.userRoles.indexOf(roleRequired)) {
- next();
- } else {
- res.status(403).send('Forbidden');
- }
- });
-}
-
-/**
- * Returns a jwt token signed by the app secret
- */
-export function signToken(id, role) {
- return jwt.sign({ _id: id, role: role }, config.secrets.session, {
- expiresIn: 60 * 60 * 5
- });
-}
-
-/**
- * Set token cookie directly for oAuth strategies
- */
-export function setTokenCookie(req, res) {
- if (!req.user) {
- return res.status(404).send('It looks like you aren\'t logged in, please try again.');
- }
- var token = signToken(req.user._id, req.user.role);
- res.cookie('token', token);
- res.redirect('/');
-}
diff --git a/app/templates/server/auth(auth)/facebook(facebookAuth)/index.js b/app/templates/server/auth(auth)/facebook(facebookAuth)/index.js
deleted file mode 100644
index f0c98ef61..000000000
--- a/app/templates/server/auth(auth)/facebook(facebookAuth)/index.js
+++ /dev/null
@@ -1,20 +0,0 @@
-'use strict';
-
-import express from 'express';
-import passport from 'passport';
-import {setTokenCookie} from '../auth.service';
-
-var router = express.Router();
-
-router
- .get('/', passport.authenticate('facebook', {
- scope: ['email', 'user_about_me'],
- failureRedirect: '/signup',
- session: false
- }))
- .get('/callback', passport.authenticate('facebook', {
- failureRedirect: '/signup',
- session: false
- }), setTokenCookie);
-
-export default router;
diff --git a/app/templates/server/auth(auth)/facebook(facebookAuth)/passport.js b/app/templates/server/auth(auth)/facebook(facebookAuth)/passport.js
deleted file mode 100644
index e8c9f9d9d..000000000
--- a/app/templates/server/auth(auth)/facebook(facebookAuth)/passport.js
+++ /dev/null
@@ -1,36 +0,0 @@
-import passport from 'passport';
-import {Strategy as FacebookStrategy} from 'passport-facebook';
-
-export function setup(User, config) {
- passport.use(new FacebookStrategy({
- clientID: config.facebook.clientID,
- clientSecret: config.facebook.clientSecret,
- callbackURL: config.facebook.callbackURL,
- profileFields: [
- 'displayName',
- 'emails'
- ]
- },
- function(accessToken, refreshToken, profile, done) {
- <% if (filters.mongooseModels) { %>User.findOne({'facebook.id': profile.id}).exec()<% }
- if (filters.sequelizeModels) { %>User.find({where:{'facebook.id': profile.id}})<% } %>
- .then(user => {
- if (user) {
- return done(null, user);
- }
-
- <% if (filters.mongooseModels) { %>user = new User({<% }
- if (filters.sequelizeModels) { %>user = User.build({<% } %>
- name: profile.displayName,
- email: profile.emails[0].value,
- role: 'user',
- provider: 'facebook',
- facebook: profile._json
- });
- user.save()
- .then(user => done(null, user))
- .catch(err => done(err));
- })
- .catch(err => done(err));
- }));
-}
diff --git a/app/templates/server/auth(auth)/google(googleAuth)/index.js b/app/templates/server/auth(auth)/google(googleAuth)/index.js
deleted file mode 100644
index 25753de57..000000000
--- a/app/templates/server/auth(auth)/google(googleAuth)/index.js
+++ /dev/null
@@ -1,23 +0,0 @@
-'use strict';
-
-import express from 'express';
-import passport from 'passport';
-import {setTokenCookie} from '../auth.service';
-
-var router = express.Router();
-
-router
- .get('/', passport.authenticate('google', {
- failureRedirect: '/signup',
- scope: [
- 'profile',
- 'email'
- ],
- session: false
- }))
- .get('/callback', passport.authenticate('google', {
- failureRedirect: '/signup',
- session: false
- }), setTokenCookie);
-
-export default router;
diff --git a/app/templates/server/auth(auth)/google(googleAuth)/passport.js b/app/templates/server/auth(auth)/google(googleAuth)/passport.js
deleted file mode 100644
index 9d6d2193d..000000000
--- a/app/templates/server/auth(auth)/google(googleAuth)/passport.js
+++ /dev/null
@@ -1,34 +0,0 @@
-import passport from 'passport';
-import {Strategy as GoogleStrategy} from 'passport-google-oauth20';
-
-export function setup(User, config) {
- passport.use(new GoogleStrategy({
- clientID: config.google.clientID,
- clientSecret: config.google.clientSecret,
- callbackURL: config.google.callbackURL
- },
- function(accessToken, refreshToken, profile, done) {
- <% if (filters.mongooseModels) { %>User.findOne({'google.id': profile.id}).exec()<% }
- if (filters.sequelizeModels) { %>User.find({where:{'google.id': profile.id}})<% } %>
- .then(user => {
- if (user) {
- return done(null, user);
- }
-
- <% if (filters.mongooseModels) { %>user = new User({<% }
- if (filters.sequelizeModels) { %>user = User.build({<% } %>
- name: profile.displayName,
- email: profile.emails[0].value,
- role: 'user',
- username: profile.emails[0].value.split('@')[0],
- provider: 'google',
- google: profile._json
- });
- <% if (filters.mongooseModels) { %>user.save()<% }
- if (filters.sequelizeModels) { %>user.save()<% } %>
- .then(user => done(null, user))
- .catch(err => done(err));
- })
- .catch(err => done(err));
- }));
-}
diff --git a/app/templates/server/auth(auth)/local/index.js b/app/templates/server/auth(auth)/local/index.js
deleted file mode 100644
index 8002a8442..000000000
--- a/app/templates/server/auth(auth)/local/index.js
+++ /dev/null
@@ -1,24 +0,0 @@
-'use strict';
-
-import express from 'express';
-import passport from 'passport';
-import {signToken} from '../auth.service';
-
-var router = express.Router();
-
-router.post('/', function(req, res, next) {
- passport.authenticate('local', function(err, user, info) {
- var error = err || info;
- if (error) {
- return res.status(401).json(error);
- }
- if (!user) {
- return res.status(404).json({message: 'Something went wrong, please try again.'});
- }
-
- var token = signToken(user._id, user.role);
- res.json({ token });
- })(req, res, next)
-});
-
-export default router;
diff --git a/app/templates/server/auth(auth)/local/passport.js b/app/templates/server/auth(auth)/local/passport.js
deleted file mode 100644
index 430bbec38..000000000
--- a/app/templates/server/auth(auth)/local/passport.js
+++ /dev/null
@@ -1,40 +0,0 @@
-import passport from 'passport';
-import {Strategy as LocalStrategy} from 'passport-local';
-
-function localAuthenticate(User, email, password, done) {
- <% if (filters.mongooseModels) { %>User.findOne({
- email: email.toLowerCase()
- }).exec()<% }
- if (filters.sequelizeModels) { %>User.find({
- where: {
- email: email.toLowerCase()
- }
- })<% } %>
- .then(user => {
- if (!user) {
- return done(null, false, {
- message: 'This email is not registered.'
- });
- }
- user.authenticate(password, function(authError, authenticated) {
- if (authError) {
- return done(authError);
- }
- if (!authenticated) {
- return done(null, false, { message: 'This password is not correct.' });
- } else {
- return done(null, user);
- }
- });
- })
- .catch(err => done(err));
-}
-
-export function setup(User, config) {
- passport.use(new LocalStrategy({
- usernameField: 'email',
- passwordField: 'password' // this is the virtual field on the model
- }, function(email, password, done) {<% if (filters.models) { %>
- return localAuthenticate(User, email, password, done);
-<% } %> }));
-}
diff --git a/app/templates/server/auth(auth)/twitter(twitterAuth)/index.js b/app/templates/server/auth(auth)/twitter(twitterAuth)/index.js
deleted file mode 100644
index 3b08edd49..000000000
--- a/app/templates/server/auth(auth)/twitter(twitterAuth)/index.js
+++ /dev/null
@@ -1,19 +0,0 @@
-'use strict';
-
-import express from 'express';
-import passport from 'passport';
-import {setTokenCookie} from '../auth.service';
-
-var router = express.Router();
-
-router
- .get('/', passport.authenticate('twitter', {
- failureRedirect: '/signup',
- session: false
- }))
- .get('/callback', passport.authenticate('twitter', {
- failureRedirect: '/signup',
- session: false
- }), setTokenCookie);
-
-export default router;
diff --git a/app/templates/server/auth(auth)/twitter(twitterAuth)/passport.js b/app/templates/server/auth(auth)/twitter(twitterAuth)/passport.js
deleted file mode 100644
index 16c34339c..000000000
--- a/app/templates/server/auth(auth)/twitter(twitterAuth)/passport.js
+++ /dev/null
@@ -1,33 +0,0 @@
-import passport from 'passport';
-import {Strategy as TwitterStrategy} from 'passport-twitter';
-
-export function setup(User, config) {
- passport.use(new TwitterStrategy({
- consumerKey: config.twitter.clientID,
- consumerSecret: config.twitter.clientSecret,
- callbackURL: config.twitter.callbackURL
- },
- function(token, tokenSecret, profile, done) {
- <% if (filters.mongooseModels) { %>User.findOne({'twitter.id': profile.id}).exec()<% }
- if (filters.sequelizeModels) { %>User.find({where:{'twitter.id': profile.id}})<% } %>
- .then(user => {
- if (user) {
- return done(null, user);
- }
-
- <% if (filters.mongooseModels) { %>user = new User({<% }
- if (filters.sequelizeModels) { %>user = User.build({<% } %>
- name: profile.displayName,
- username: profile.username,
- role: 'user',
- provider: 'twitter',
- twitter: profile._json
- });
- <% if (filters.mongooseModels) { %>user.save()<% }
- if (filters.sequelizeModels) { %>user.save()<% } %>
- .then(user => done(null, user))
- .catch(err => done(err));
- })
- .catch(err => done(err));
- }));
-}
diff --git a/app/templates/server/components/errors/index.js b/app/templates/server/components/errors/index.js
deleted file mode 100644
index 598698175..000000000
--- a/app/templates/server/components/errors/index.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Error responses
- */
-
-'use strict';
-
-module.exports[404] = function pageNotFound(req, res) {
- var viewFilePath = '404';
- var statusCode = 404;
- var result = {
- status: statusCode
- };
-
- res.status(result.status);
- res.render(viewFilePath, {}, function(err, html) {
- if (err) {
- return res.status(result.status).json(result);
- }
-
- res.send(html);
- });
-};
diff --git a/app/templates/server/config/_local.env.js b/app/templates/server/config/_local.env.js
deleted file mode 100644
index 82195c471..000000000
--- a/app/templates/server/config/_local.env.js
+++ /dev/null
@@ -1,23 +0,0 @@
-'use strict';
-
-// Use local.env.js for environment variables that grunt will set when the server starts locally.
-// Use for your api keys, secrets, etc. This file should not be tracked by git.
-//
-// You will need to set these on the server you deploy to.
-
-module.exports = {
- DOMAIN: 'http://localhost:9000',
- SESSION_SECRET: '<%= lodash.slugify(appname) + "-secret" %>',<% if (filters.facebookAuth) { %>
-
- FACEBOOK_ID: 'app-id',
- FACEBOOK_SECRET: 'secret',<% } if (filters.twitterAuth) { %>
-
- TWITTER_ID: 'app-id',
- TWITTER_SECRET: 'secret',<% } if (filters.googleAuth) { %>
-
- GOOGLE_ID: 'app-id',
- GOOGLE_SECRET: 'secret',
-<% } %>
- // Control debug level for modules using visionmedia/debug
- DEBUG: ''
-};
diff --git a/app/templates/server/config/_local.env.sample.js b/app/templates/server/config/_local.env.sample.js
deleted file mode 100644
index 8106cf731..000000000
--- a/app/templates/server/config/_local.env.sample.js
+++ /dev/null
@@ -1,23 +0,0 @@
-'use strict';
-
-// Use local.env.js for environment variables that grunt will set when the server starts locally.
-// Use for your api keys, secrets, etc. This file should not be tracked by git.
-//
-// You will need to set these on the server you deploy to.
-
-module.exports = {
- DOMAIN: 'http://localhost:9000',
- SESSION_SECRET: '<%= lodash.slugify(appname) + "-secret" %>',<% if (filters.facebookAuth) { %>
-
- FACEBOOK_ID: 'app-id',
- FACEBOOK_SECRET: 'secret',<% } if (filters.twitterAuth) { %>
-
- TWITTER_ID: 'app-id',
- TWITTER_SECRET: 'secret',<% } if (filters.googleAuth) { %>
-
- GOOGLE_ID: 'app-id',
- GOOGLE_SECRET: 'secret',<% } %>
-
- // Control debug level for modules using visionmedia/debug
- DEBUG: ''
-};
diff --git a/app/templates/server/config/environment/development.js b/app/templates/server/config/environment/development.js
deleted file mode 100644
index 472ad5050..000000000
--- a/app/templates/server/config/environment/development.js
+++ /dev/null
@@ -1,27 +0,0 @@
-'use strict';
-
-// Development specific configuration
-// ==================================
-module.exports = {<% if (filters.mongoose) { %>
-
- // MongoDB connection options
- mongo: {
- uri: 'mongodb://localhost/<%= lodash.slugify(appname) %>-dev'
- },<% } if (filters.sequelize) { %>
-
- // Sequelize connection opions
- sequelize: {
- uri: 'sqlite://',
- options: {
- logging: false,
- storage: 'dev.sqlite',
- define: {
- timestamps: false
- }
- }
- },<% } %>
-
- // Seed database on startup
- seedDB: true
-
-};
diff --git a/app/templates/server/config/environment/index.js b/app/templates/server/config/environment/index.js
deleted file mode 100644
index c6115a06d..000000000
--- a/app/templates/server/config/environment/index.js
+++ /dev/null
@@ -1,68 +0,0 @@
-'use strict';
-
-var path = require('path');
-var _ = require('lodash');
-
-function requiredProcessEnv(name) {
- if (!process.env[name]) {
- throw new Error('You must set the ' + name + ' environment variable');
- }
- return process.env[name];
-}
-
-// All configurations will extend these options
-// ============================================
-var all = {
- env: process.env.NODE_ENV,
-
- // Root path of server
- root: path.normalize(__dirname + '/../../..'),
-
- // Server port
- port: process.env.PORT || 9000,
-
- // Server IP
- ip: process.env.IP || '0.0.0.0',
-
- // Should we populate the DB with sample data?
- seedDB: false,
-
- // Secret for session, you will want to change this and make it an environment variable
- secrets: {
- session: '<%= lodash.slugify(lodash.humanize(appname)) + '-secret' %>'
- },
-
- // MongoDB connection options
- mongo: {
- options: {
- db: {
- safe: true
- }
- }
- }<% if (filters.facebookAuth) { %>,
-
- facebook: {
- clientID: process.env.FACEBOOK_ID || 'id',
- clientSecret: process.env.FACEBOOK_SECRET || 'secret',
- callbackURL: (process.env.DOMAIN || '') + '/auth/facebook/callback'
- }<% } %><% if (filters.twitterAuth) { %>,
-
- twitter: {
- clientID: process.env.TWITTER_ID || 'id',
- clientSecret: process.env.TWITTER_SECRET || 'secret',
- callbackURL: (process.env.DOMAIN || '') + '/auth/twitter/callback'
- }<% } %><% if (filters.googleAuth) { %>,
-
- google: {
- clientID: process.env.GOOGLE_ID || 'id',
- clientSecret: process.env.GOOGLE_SECRET || 'secret',
- callbackURL: (process.env.DOMAIN || '') + '/auth/google/callback'
- }<% } %>
-};
-
-// Export the config object based on the NODE_ENV
-// ==============================================
-module.exports = _.merge(
- all,
- require('./shared'),
- require('./' + process.env.NODE_ENV + '.js') || {});
diff --git a/app/templates/server/config/environment/production.js b/app/templates/server/config/environment/production.js
deleted file mode 100644
index bb2a0375c..000000000
--- a/app/templates/server/config/environment/production.js
+++ /dev/null
@@ -1,36 +0,0 @@
-'use strict';
-
-// Production specific configuration
-// =================================
-module.exports = {
- // Server IP
- ip: process.env.OPENSHIFT_NODEJS_IP ||
- process.env.IP ||
- undefined,
-
- // Server port
- port: process.env.OPENSHIFT_NODEJS_PORT ||
- process.env.PORT ||
- 8080<% if (filters.mongoose) { %>,
-
- // MongoDB connection options
- mongo: {
- uri: process.env.MONGOLAB_URI ||
- process.env.MONGOHQ_URL ||
- process.env.OPENSHIFT_MONGODB_DB_URL +
- process.env.OPENSHIFT_APP_NAME ||
- 'mongodb://localhost/<%= lodash.slugify(appname) %>'
- }<% } if (filters.sequelize) { %>,
-
- sequelize: {
- uri: process.env.SEQUELIZE_URI ||
- 'sqlite://',
- options: {
- logging: false,
- storage: 'dist.sqlite',
- define: {
- timestamps: false
- }
- }
- }<% } %>
-};
diff --git a/app/templates/server/config/environment/shared.js b/app/templates/server/config/environment/shared.js
deleted file mode 100644
index 64a5eab99..000000000
--- a/app/templates/server/config/environment/shared.js
+++ /dev/null
@@ -1,6 +0,0 @@
-'use strict';
-
-exports = module.exports = {
- // List of user roles
- userRoles: ['guest', 'user', 'admin']
-};
diff --git a/app/templates/server/config/environment/test.js b/app/templates/server/config/environment/test.js
deleted file mode 100644
index ea7d65096..000000000
--- a/app/templates/server/config/environment/test.js
+++ /dev/null
@@ -1,20 +0,0 @@
-'use strict';
-
-// Test specific configuration
-// ===========================
-module.exports = {
- // MongoDB connection options
- mongo: {
- uri: 'mongodb://localhost/<%= lodash.slugify(appname) %>-test'
- },
- sequelize: {
- uri: 'sqlite://',
- options: {
- logging: false,
- storage: 'test.sqlite',
- define: {
- timestamps: false
- }
- }
- }
-};
diff --git a/app/templates/server/config/express.js b/app/templates/server/config/express.js
deleted file mode 100644
index 009400b5e..000000000
--- a/app/templates/server/config/express.js
+++ /dev/null
@@ -1,92 +0,0 @@
-/**
- * Express configuration
- */
-
-'use strict';
-
-import express from 'express';
-import favicon from 'serve-favicon';
-import morgan from 'morgan';
-import compression from 'compression';
-import bodyParser from 'body-parser';
-import methodOverride from 'method-override';
-import cookieParser from 'cookie-parser';
-import errorHandler from 'errorhandler';
-import path from 'path';
-import lusca from 'lusca';
-import config from './environment';<% if (filters.auth) { %>
-import passport from 'passport';<% } %>
-import session from 'express-session';<% if (filters.mongoose) { %>
-import connectMongo from 'connect-mongo';
-import mongoose from 'mongoose';
-var MongoStore = connectMongo(session);<% } else if(filters.sequelize) { %>
-import sqldb from '../sqldb';
-import expressSequelizeSession from 'express-sequelize-session';
-var Store = expressSequelizeSession(session.Store);<% } %>
-
-export default function(app) {
- var env = app.get('env');
-
- app.set('views', config.root + '/server/views');<% if (filters.html) { %>
- app.engine('html', require('ejs').renderFile);
- app.set('view engine', 'html');<% } %><% if (filters.jade) { %>
- app.set('view engine', 'jade');<% } %>
- app.use(compression());
- app.use(bodyParser.urlencoded({ extended: false }));
- app.use(bodyParser.json());
- app.use(methodOverride());
- app.use(cookieParser());<% if (filters.auth) { %>
- app.use(passport.initialize());<% } %>
-
- // Persist sessions with MongoStore / sequelizeStore
- // We need to enable sessions for passport-twitter because it's an
- // oauth 1.0 strategy, and Lusca depends on sessions
- app.use(session({
- secret: config.secrets.session,
- saveUninitialized: true,
- resave: false<% if (filters.mongoose) { %>,
- store: new MongoStore({
- mongooseConnection: mongoose.connection,
- db: '<%= lodash.slugify(lodash.humanize(appname)) %>'
- })<% } else if(filters.sequelize) { %>,
- store: new Store(sqldb.sequelize)<% } %>
- }));
-
- /**
- * Lusca - express server security
- * https://github.com/krakenjs/lusca
- */
- if ('test' !== env) {
- app.use(lusca({
- csrf: {
- angular: true
- },
- xframe: 'SAMEORIGIN',
- hsts: {
- maxAge: 31536000, //1 year, in seconds
- includeSubDomains: true,
- preload: true
- },
- xssProtection: true
- }));
- }
-
- app.set('appPath', path.join(config.root, 'client'));
-
- if ('production' === env) {
- app.use(favicon(path.join(config.root, 'client', 'favicon.ico')));
- app.use(express.static(app.get('appPath')));
- app.use(morgan('dev'));
- }
-
- if ('development' === env) {
- app.use(require('connect-livereload')());
- }
-
- if ('development' === env || 'test' === env) {
- app.use(express.static(path.join(config.root, '.tmp')));
- app.use(express.static(app.get('appPath')));
- app.use(morgan('dev'));
- app.use(errorHandler()); // Error handler - has to be last
- }
-}
diff --git a/app/templates/server/config/seed(models).js b/app/templates/server/config/seed(models).js
deleted file mode 100644
index 24faf233f..000000000
--- a/app/templates/server/config/seed(models).js
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * Populate DB with sample data on server start
- * to disable, edit config/environment/index.js, and set `seedDB: false`
- */
-
-'use strict';<% if (filters.mongooseModels) { %>
-import Thing from '../api/thing/thing.model';<% if (filters.auth) { %>
-import User from '../api/user/user.model';<% } %><% } %><% if (filters.sequelizeModels) { %>
-import sqldb from '../sqldb';
-var Thing = sqldb.Thing;<% if (filters.auth) { %>
-var User = sqldb.User;<% } %><% } %>
-
-<% if (filters.mongooseModels) { %>Thing.find({}).remove()<% }
- if (filters.sequelizeModels) { %>Thing.sync()
- .then(() => {
- return Thing.destroy({ where: {} });
- })<% } %>
- .then(() => {
- <% if (filters.mongooseModels) { %>Thing.create({<% }
- if (filters.sequelizeModels) { %>Thing.bulkCreate([{<% } %>
- name: 'Development Tools',
- info: 'Integration with popular tools such as Bower, Grunt, Babel, Karma, ' +
- 'Mocha, JSHint, Node Inspector, Livereload, Protractor, Jade, ' +
- 'Stylus, Sass, and Less.'
- }, {
- name: 'Server and Client integration',
- info: 'Built with a powerful and fun stack: MongoDB, Express, ' +
- 'AngularJS, and Node.'
- }, {
- name: 'Smart Build System',
- info: 'Build system ignores `spec` files, allowing you to keep ' +
- 'tests alongside code. Automatic injection of scripts and ' +
- 'styles into your index.html'
- }, {
- name: 'Modular Structure',
- info: 'Best practice client and server structures allow for more ' +
- 'code reusability and maximum scalability'
- }, {
- name: 'Optimized Build',
- info: 'Build process packs up your templates as a single JavaScript ' +
- 'payload, minifies your scripts/css/images, and rewrites asset ' +
- 'names for caching.'
- }, {
- name: 'Deployment Ready',
- info: 'Easily deploy your app to Heroku or Openshift with the heroku ' +
- 'and openshift subgenerators'
- <% if (filters.mongooseModels) { %>});<% }
- if (filters.sequelizeModels) { %>}]);<% } %>
- });
-<% if (filters.auth) { %>
-<% if (filters.mongooseModels) { %>User.find({}).remove()<% }
- if (filters.sequelizeModels) { %>User.sync()
- .then(() => User.destroy({ where: {} }))<% } %>
- .then(() => {
- <% if (filters.mongooseModels) { %>User.create({<% }
- if (filters.sequelizeModels) { %>User.bulkCreate([{<% } %>
- provider: 'local',
- name: 'Test User',
- email: 'test@example.com',
- password: 'test'
- }, {
- provider: 'local',
- role: 'admin',
- name: 'Admin',
- email: 'admin@example.com',
- password: 'admin'
- <% if (filters.mongooseModels) { %>})<% }
- if (filters.sequelizeModels) { %>}])<% } %>
- .then(() => {
- console.log('finished populating users');
- });
- });<% } %>
diff --git a/app/templates/server/config/socketio(socketio).js b/app/templates/server/config/socketio(socketio).js
deleted file mode 100644
index db5730912..000000000
--- a/app/templates/server/config/socketio(socketio).js
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
- * Socket.io configuration
- */
-'use strict';
-
-import config from './environment';
-
-// When the user disconnects.. perform this
-function onDisconnect(socket) {
-}
-
-// When the user connects.. perform this
-function onConnect(socket) {
- // When the client emits 'info', this listens and executes
- socket.on('info', data => {
- socket.log(JSON.stringify(data, null, 2));
- });
-
- // Insert sockets below
-
-}
-
-export default function(socketio) {
- // socket.io (v1.x.x) is powered by debug.
- // In order to see all the debug output, set DEBUG (in server/config/local.env.js) to including the desired scope.
- //
- // ex: DEBUG: "http*,socket.io:socket"
-
- // We can authenticate socket.io users and access their token through socket.decoded_token
- //
- // 1. You will need to send the token in `client/components/socket/socket.service.js`
- //
- // 2. Require authentication here:
- // socketio.use(require('socketio-jwt').authorize({
- // secret: config.secrets.session,
- // handshake: true
- // }));
-
- socketio.on('connection', function(socket) {
- socket.address = socket.request.connection.remoteAddress +
- ':' + socket.request.connection.remotePort;
-
- socket.connectedAt = new Date();
-
- socket.log = function(...data) {
- console.log(`SocketIO ${socket.nsp.name} [${socket.address}]`, ...data);
- };
-
- // Call onDisconnect.
- socket.on('disconnect', () => {
- onDisconnect(socket);
- socket.log('DISCONNECTED');
- });
-
- // Call onConnect.
- onConnect(socket);
- socket.log('CONNECTED');
- });
-}
diff --git a/app/templates/server/routes.js b/app/templates/server/routes.js
deleted file mode 100644
index dcef9c275..000000000
--- a/app/templates/server/routes.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * Main application routes
- */
-
-'use strict';
-
-import errors from './components/errors';
-import path from 'path';
-
-export default function(app) {
- // Insert routes below<% if (filters.auth) { %>
- app.use('/api/users', require('./api/user'));
-
- app.use('/auth', require('./auth').default);
-<% } %>
- // All undefined asset or api routes should return a 404
- app.route('/:url(api|auth|components|app|bower_components|assets)/*')
- .get(errors[404]);
-
- // All other routes should redirect to the index.html
- app.route('/*')
- .get((req, res) => {
- res.sendFile(path.resolve(app.get('appPath') + '/index.html'));
- });
-}
diff --git a/app/templates/server/views/404(jade).jade b/app/templates/server/views/404(jade).jade
deleted file mode 100644
index b5735b4f6..000000000
--- a/app/templates/server/views/404(jade).jade
+++ /dev/null
@@ -1,133 +0,0 @@
-doctype html
-html(lang='en')
-head
- meta(charset='utf-8')
- title Page Not Found :(
- style.
- ::-moz-selection {
- background: #b3d4fc;
- text-shadow: none;
- }
- ::selection {
- background: #b3d4fc;
- text-shadow: none;
- }
- html {
- padding: 30px 10px;
- font-size: 20px;
- line-height: 1.4;
- color: #737373;
- background: #f0f0f0;
- -webkit-text-size-adjust: 100%;
- -ms-text-size-adjust: 100%;
- }
- html,
- input {
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
- }
- body {
- max-width: 500px;
- _width: 500px;
- padding: 30px 20px 50px;
- border: 1px solid #b3b3b3;
- border-radius: 4px;
- margin: 0 auto;
- box-shadow: 0 1px 10px #a7a7a7, inset 0 1px 0 #fff;
- background: #fcfcfc;
- }
- h1 {
- margin: 0 10px;
- font-size: 50px;
- text-align: center;
- }
- h1 span {
- color: #bbb;
- }
- h3 {
- margin: 1.5em 0 0.5em;
- }
- p {
- margin: 1em 0;
- }
- ul {
- padding: 0 0 0 40px;
- margin: 1em 0;
- }
- .container {
- max-width: 380px;
- _width: 380px;
- margin: 0 auto;
- }
- /* google search */
- #goog-fixurl ul {
- list-style: none;
- padding: 0;
- margin: 0;
- }
- #goog-fixurl form {
- margin: 0;
- }
- #goog-wm-qt,
- #goog-wm-sb {
- border: 1px solid #bbb;
- font-size: 16px;
- line-height: normal;
- vertical-align: top;
- color: #444;
- border-radius: 2px;
- }
- #goog-wm-qt {
- width: 220px;
- height: 20px;
- padding: 5px;
- margin: 5px 10px 0 0;
- box-shadow: inset 0 1px 1px #ccc;
- }
- #goog-wm-sb {
- display: inline-block;
- height: 32px;
- padding: 0 10px;
- margin: 5px 0 0;
- white-space: nowrap;
- cursor: pointer;
- background-color: #f5f5f5;
- background-image: -webkit-linear-gradient(rgba(255,255,255,0), #f1f1f1);
- background-image: -moz-linear-gradient(rgba(255,255,255,0), #f1f1f1);
- background-image: -ms-linear-gradient(rgba(255,255,255,0), #f1f1f1);
- background-image: -o-linear-gradient(rgba(255,255,255,0), #f1f1f1);
- -webkit-appearance: none;
- -moz-appearance: none;
- appearance: none;
- *overflow: visible;
- *display: inline;
- *zoom: 1;
- }
- #goog-wm-sb:hover,
- #goog-wm-sb:focus {
- border-color: #aaa;
- box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
- background-color: #f8f8f8;
- }
- #goog-wm-qt:hover,
- #goog-wm-qt:focus {
- border-color: #105cb6;
- outline: 0;
- color: #222;
- }
- input::-moz-focus-inner {
- padding: 0;
- border: 0;
- }
- body
- .container
- h1
- | Not found
- span :(
- p Sorry, but the page you were trying to view does not exist.
- p It looks like this was the result of either:
- ul
- li a mistyped address
- li an out-of-date link
- script.
- var GOOG_FIXURL_LANG = (navigator.language || '').slice(0,2),GOOG_FIXURL_SITE = location.host;
- script(src='//linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js')
diff --git a/app/templates/tsconfig.client(ts).json b/app/templates/tsconfig.client(ts).json
deleted file mode 100644
index edbfbd011..000000000
--- a/app/templates/tsconfig.client(ts).json
+++ /dev/null
@@ -1,45 +0,0 @@
-{
- "compilerOptions": {
- "sourceMap": true,
- "rootDir": "./client",
- "outDir": ".tmp"
- },
- "filesGlob": [
- "client/{app,components}/**/!(*.spec).ts",
- "client/typings/**/*.d.ts"
- ],
- "files": [
- "client/app/account/account.ts",
- "client/app/account/login/login.controller.ts",
- "client/app/account/settings/settings.controller.ts",
- "client/app/account/signup/signup.controller.ts",
- "client/app/admin/admin.controller.ts",
- "client/app/admin/admin.module.ts",
- "client/app/admin/admin.router.ts",
- "client/app/app.ts",
- "client/app/main/main.controller.ts",
- "client/app/main/main.ts",
- "client/components/auth/auth.module.ts",
- "client/components/auth/auth.service.ts",
- "client/components/auth/interceptor.service.ts",
- "client/components/auth/router.decorator.ts",
- "client/components/auth/user.service.ts",
- "client/components/footer/footer.directive.ts",
- "client/components/modal/modal.service.ts",
- "client/components/mongoose-error/mongoose-error.directive.ts",
- "client/components/navbar/navbar.controller.ts",
- "client/components/navbar/navbar.directive.ts",
- "client/components/oauth-buttons/oauth-buttons.controller.ts",
- "client/components/oauth-buttons/oauth-buttons.directive.ts",
- "client/components/socket/socket.mock.ts",
- "client/components/socket/socket.service.ts",
- "client/components/ui-router/ui-router.mock.ts",
- "client/components/util/util.module.ts",
- "client/components/util/util.service.ts",
- "client/typings/angularjs/angular.d.ts",
- "client/typings/jquery/jquery.d.ts",
- "client/typings/lodash/lodash.d.ts",
- "client/typings/socket.io-client/socket.io-client.d.ts",
- "client/typings/tsd.d.ts"
- ]
-}
diff --git a/app/templates/tsconfig.client.test(ts).json b/app/templates/tsconfig.client.test(ts).json
deleted file mode 100644
index 9ec77ddb5..000000000
--- a/app/templates/tsconfig.client.test(ts).json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "compilerOptions": {
- "sourceMap": true,
- "rootDir": "./client",
- "outDir": ".tmp/test"
- },
- "filesGlob": [
- "client/{app,components}/**/*.{spec,mock}.ts",
- "client/test_typings/**/*.d.ts"
- ],
- "files": [
- "client/app/main/main.controller.spec.ts",
- "client/components/oauth-buttons/oauth-buttons.controller.spec.ts",
- "client/components/oauth-buttons/oauth-buttons.directive.spec.ts",
- "client/components/socket/socket.mock.ts",
- "client/components/ui-router/ui-router.mock.ts",
- "client/test_typings/angular-protractor/angular-protractor.d.ts",
- "client/test_typings/selenium-webdriver/selenium-webdriver.d.ts",<% if(filters.mocha) { %>
- "client/test_typings/mocha/mocha.d.ts",
- "client/test_typings/chai/chai.d.ts",
- "client/test_typings/assertion-error/assertion-error.d.ts",
- "client/test_typings/sinon/sinon.d.ts",
- "client/test_typings/sinon-chai/sinon-chai.d.ts",<% } %><% if(filters.jasmine) { %>
- "client/test_typings/jasmine/jasmine.d.ts",<% } %>
- "client/test_typings/tsd.d.ts"
- ]
-}
diff --git a/app/templates/tsd(ts).json b/app/templates/tsd(ts).json
deleted file mode 100644
index 9f475e502..000000000
--- a/app/templates/tsd(ts).json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "version": "v4",
- "repo": "borisyankov/DefinitelyTyped",
- "ref": "master",
- "path": "client/typings",
- "bundle": "client/typings/tsd.d.ts",
- "installed": {
- "angularjs/angular.d.ts": {
- "commit": "40c60850ad6c8175a62d5ab48c4e016ea5b3dffe"
- },
- "jquery/jquery.d.ts": {
- "commit": "40c60850ad6c8175a62d5ab48c4e016ea5b3dffe"
- },
- "lodash/lodash.d.ts": {
- "commit": "40c60850ad6c8175a62d5ab48c4e016ea5b3dffe"
- },
- "socket.io-client/socket.io-client.d.ts": {
- "commit": "40c60850ad6c8175a62d5ab48c4e016ea5b3dffe"
- }
- }
-}
diff --git a/app/templates/tsd_test(ts).json b/app/templates/tsd_test(ts).json
deleted file mode 100644
index 0a60c8103..000000000
--- a/app/templates/tsd_test(ts).json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "version": "v4",
- "repo": "borisyankov/DefinitelyTyped",
- "ref": "master",
- "path": "client/test_typings",
- "bundle": "client/test_typings/tsd.d.ts",
- "installed": {
- "angular-protractor/angular-protractor.d.ts": {
- "commit": "40c60850ad6c8175a62d5ab48c4e016ea5b3dffe"
- },
- "selenium-webdriver/selenium-webdriver.d.ts": {
- "commit": "40c60850ad6c8175a62d5ab48c4e016ea5b3dffe"
- },<% if(filters.mocha) { %>
- "mocha/mocha.d.ts": {
- "commit": "40c60850ad6c8175a62d5ab48c4e016ea5b3dffe"
- },
- "chai/chai.d.ts": {
- "commit": "40c60850ad6c8175a62d5ab48c4e016ea5b3dffe"
- },
- "assertion-error/assertion-error.d.ts": {
- "commit": "40c60850ad6c8175a62d5ab48c4e016ea5b3dffe"
- },
- "sinon/sinon.d.ts": {
- "commit": "40c60850ad6c8175a62d5ab48c4e016ea5b3dffe"
- },
- "sinon-chai/sinon-chai.d.ts": {
- "commit": "40c60850ad6c8175a62d5ab48c4e016ea5b3dffe"
- }<% } %><% if(filters.jasmine) { %>
- "jasmine/jasmine.d.ts": {
- "commit": "40c60850ad6c8175a62d5ab48c4e016ea5b3dffe"
- }<% } %>
- }
-}
diff --git a/circle.yml b/circle.yml
new file mode 100644
index 000000000..5feecc9a2
--- /dev/null
+++ b/circle.yml
@@ -0,0 +1,56 @@
+version: 2
+jobs:
+ build:
+ docker:
+ - image: circleci/node:12-browsers
+ - image: mongo
+ command: mongod
+
+ working_directory: ~/generator-angular-fullstack
+
+ environment:
+ NODE_ENV: test
+
+ branches:
+ ignore:
+ - gh-pages
+
+ steps:
+ - checkout
+ - run: git submodule sync && git submodule update --init
+
+ # Generator npm dependencies
+ - restore_cache:
+ keys:
+ - generator-angular-fullstack-npm-{{ .Branch }}-{{ checksum "package.json" }}
+ - generator-angular-fullstack-npm-{{ .Branch }}
+ - generator-angular-fullstack-npm-
+ - run: npm install --quiet
+ - save_cache:
+ key: generator-angular-fullstack-npm-{{ .Branch }}-{{ checksum "package.json" }}
+ paths:
+ - ~/generator-angular-fullstack/node_modules
+
+ # Test fixtures
+ - run: npx gulp updateFixtures:test
+ - restore_cache:
+ keys:
+ - generator-angular-fullstack-npm-fixtures-{{ .Branch }}-{{ checksum "templates/app/_package.json" }}
+ - generator-angular-fullstack-npm-fixtures-{{ .Branch }}
+ - generator-angular-fullstack-npm-fixtures-
+ - run: npx gulp installFixtures
+ - save_cache:
+ key: generator-angular-fullstack-npm-fixtures-{{ .Branch }}-{{ checksum "templates/app/_package.json" }}
+ paths:
+ - ~/generator-angular-fullstack/test/fixtures/node_modules
+
+ - run: npx gulp build
+ - run: npm test
+
+# - deploy:
+# command: |
+# if [ "${CIRCLE_BRANCH}" == "master" ]; then
+# git config --global user.email "circleci@circleci.com"
+# git config --global user.name "CircleCI"
+# cd docs && npm install && npm run build && npm run deploy
+# fi
diff --git a/contributing.md b/contributing.md
index bfcd7bb98..78170f758 100644
--- a/contributing.md
+++ b/contributing.md
@@ -1,20 +1,32 @@
# Contributing
-See the [contributing docs](https://github.com/yeoman/yeoman/blob/master/contributing.md)
+See the [Yeoman contributing docs](https://github.com/yeoman/yeoman/blob/master/contributing.md)
Additionally for this generator:
-* Please submit PRs to the `canary` branch, it is the main development branch for this generator.
+* Please submit bug fix PRs to the `master` branch. Please submit large feature PRs to the `canary` branch; it is the main development branch for this generator.
* When submitting an issue, please follow the [guidelines](https://github.com/yeoman/yeoman/blob/master/contributing.md#issue-submission). Especially important is to make sure Yeoman is up-to-date, and providing the command or commands that cause the issue.
* When submitting a PR, make sure that the commit messages match the [AngularJS conventions][commit-message-format] (see below).
* When submitting a bugfix, write a test that exposes the bug and fails before applying your fix. Submit the test alongside the fix.
* When submitting a new feature, add tests that cover the feature.
+* Open Issues marked with the [EASY](https://github.com/angular-fullstack/generator-angular-fullstack/issues?q=is%3Aopen+is%3Aissue+label%3AEasy) label are believed to be easy changes, and would be good Issues to tackle for new contributors.
+
+This project has 2 main branches: `master` and `canary`. The `master` branch is where the current stable code lives and should be used for production setups. The `canary` branch is the main development branch, this is where PRs should be submitted to (backport fixes may be applied to `master`).
+
+By separating the current stable code from the cutting-edge development we hope to provide a stable and efficient workflow for users and developers alike.
+
+When submitting a PR, make sure that the commit messages match the [AngularJS conventions](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/).
+
+When submitting a bugfix, try to write a test that exposes the bug and fails before applying your fix. Submit the test alongside the fix.
+
+When submitting a new feature, add tests that cover the feature.
To run the generator:
+
1. Clone it and `cd` to its root
2. `npm install`
-3. `npm link` (tells NPM to look to your own version)
-4. `yo angular-fullstack` as normal. It should run from your cloned version rather than the one downloaded from NPM.
+3. `npm link` (tells npm to look to your own version)
+4. `yo angular-fullstack` as normal. It should run from your cloned version rather than the one downloaded from npm.
## Git Commit Guidelines
diff --git a/contributing/releasing-a-new-version.md b/contributing/releasing-a-new-version.md
new file mode 100644
index 000000000..1c63f3966
--- /dev/null
+++ b/contributing/releasing-a-new-version.md
@@ -0,0 +1,26 @@
+# Releasing a New Version
+
+## Contributing
+
+## Releasing a new version
+
+* Bump `package.json` version
+* \[
+ * `grunt conventionalChangelog`
+ * `cd angular-fullstack-deps`
+ * `git checkout master`
+ * `git pull`
+ * `cd ..`
+ * `gulp updateFixtures:deps`
+ * `cd angular-fullstack-deps`
+ * `git add .`
+ * `git commit -m $VERSION`
+ * `git push`
+ * `# npm publish`
+
+ \]
+* `git add ./{CHANGELOG.md,angular-fullstack-deps,package.json}`
+* `git commit -m $VERSION`
+* `git push`
+* `# npm publish`
+
diff --git a/contributing/untitled-1.md b/contributing/untitled-1.md
new file mode 100644
index 000000000..543774ac4
--- /dev/null
+++ b/contributing/untitled-1.md
@@ -0,0 +1,55 @@
+# Commit Style
+
+## Commit Message Format
+
+Each commit message consists of a **header**, a **body** and a **footer**. The header has a special format that includes a **type**, a **scope** and a **subject**:
+
+```text
+():
+
+
+
+