diff --git a/.gitignore b/.gitignore
index 230257f1f..ffabd5c3d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,4 +5,7 @@ bower_components
demo
.idea
.DS_Store
-release.txt
\ No newline at end of file
+release.txt
+static
+generator-angular-fullstack.iml
+src/generator-angular-fullstack.iml
diff --git a/.gitmodules b/.gitmodules
index ff287e31c..9b20da6e4 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,6 @@
[submodule "angular-fullstack-deps"]
path = angular-fullstack-deps
url = git@github.com:angular-fullstack/angular-fullstack-deps.git
+[submodule "angular-fullstack-dockerfile"]
+ path = angular-fullstack-dockerfile
+ url = git@github.com:angular-fullstack/angular-fullstack-dockerfile.git
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bb3bbb480..55c91a2e2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,123 @@
+
+## [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 boostrap-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)
@@ -8,7 +128,6 @@
* 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)
diff --git a/Gruntfile.js b/Gruntfile.js
index 37efd2c0d..d75515f33 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -261,49 +261,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('templates/app/_package.json', dest + 'package.json');
- processJson('templates/app/_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([
diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md
index 6cf5aa437..cf31e70c0 100644
--- a/ISSUE_TEMPLATE.md
+++ b/ISSUE_TEMPLATE.md
@@ -11,7 +11,7 @@ etc | etc
Item | Answer
----- | -----
Transpiler | Babel / TypeScript
-Markup | HTML / Jade
+Markup | HTML / Pug
CSS | CSS / LESS / SCSS / Stylus
Router | ngRoute / ui-router
Client Tests | Jasmine / Mocha
diff --git a/angular-fullstack-deps b/angular-fullstack-deps
index eada40699..e2f7def7e 160000
--- a/angular-fullstack-deps
+++ b/angular-fullstack-deps
@@ -1 +1 @@
-Subproject commit eada40699249e9e82510b43685f8df5f4eb6cc31
+Subproject commit e2f7def7efccdf97c5b08cfa76409b3b4469b1a5
diff --git a/angular-fullstack-dockerfile b/angular-fullstack-dockerfile
new file mode 160000
index 000000000..d92e4d3a1
--- /dev/null
+++ b/angular-fullstack-dockerfile
@@ -0,0 +1 @@
+Subproject commit d92e4d3a18fda5b44fd872c3f41490008a736fca
diff --git a/circle.yml b/circle.yml
index ad8bf69e5..270f82955 100644
--- a/circle.yml
+++ b/circle.yml
@@ -5,6 +5,11 @@ machine:
post:
- npm install -g gulp-cli
+ - wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
+ - sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
+ - sudo apt-get update
+ - sudo apt-get install google-chrome-stable
+
## Customize checkout
checkout:
post:
@@ -29,6 +34,14 @@ notify:
# gitter hook
- url: https://webhooks.gitter.im/e/ac3980c61cb722b9e789
+## Deployments
+deployment:
+ docker:
+ # update the upstream dockerfile after a push
+ branch: [master, docker-integration]
+ commands:
+ - generator-angular-fullstack/angular-fullstack-dockerfile/create_branch.sh
+
test:
pre:
- cd sc-*-linux && ./bin/sc --user $SAUCE_USERNAME --api-key $SAUCE_ACCESS_KEY --readyfile ~/sauce_is_ready:
diff --git a/daux/templates/content.php b/daux/templates/content.php
new file mode 100644
index 000000000..4a892507f
--- /dev/null
+++ b/daux/templates/content.php
@@ -0,0 +1,41 @@
+layout('theme::layout/05_page') ?>
+
+
+
+
+
+
+
+
+ = $page['content']; ?>
+
+
+
+
+
+
+
diff --git a/daux/templates/error.php b/daux/templates/error.php
new file mode 100644
index 000000000..c3ae7a5b2
--- /dev/null
+++ b/daux/templates/error.php
@@ -0,0 +1,11 @@
+layout('theme::layout/05_page') ?>
+
+
+
+
+
+ = $page['content']; ?>
+
+
diff --git a/daux/templates/home.php b/daux/templates/home.php
new file mode 100644
index 000000000..873d2eabe
--- /dev/null
+++ b/daux/templates/home.php
@@ -0,0 +1,85 @@
+layout('theme::layout/00_layout') ?>
+
+
+ insert('theme::partials/navbar_content', ['params' => $params]); ?>
+
+
+
+
+
+
+
+
+
+ ' . $params['tagline'] . '';
+} ?>
+
+
+
+ ';
+} ?>
+
+
+
+
+ View On GitHub';
+ }
+ foreach ($page['entry_page'] as $key => $node) {
+ echo '
' . $key . '';
+ }
+ ?>
+
+
+
+
+
+
+
+
+
+ = $page['content']; ?>
+
+
+
+
+
+
diff --git a/daux/templates/layout/00_layout.php b/daux/templates/layout/00_layout.php
new file mode 100644
index 000000000..8452b6b82
--- /dev/null
+++ b/daux/templates/layout/00_layout.php
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+ = $page['title']; ?>
+
+
+
+
+
+
+
+
+
+ ";
+} ?>
+
+
+ ";
+} ?>
+
+
+
+
+
+
+
+
+
+ = $this->section('content'); ?>
+
+ insert('theme::partials/google_analytics', ['analytics' => $params['html']['google_analytics'], 'host' => array_key_exists('host', $params) ? $params['host'] : '']);
+ }
+ if ($params['html']['piwik_analytics']) {
+ $this->insert('theme::partials/piwik_analytics', ['url' => $params['html']['piwik_analytics'], 'id' => $params['html']['piwik_analytics_id']]);
+ }
+ ?>
+
+
+
+
+
+
+
+
+
+ ';
+ } ?>
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/daux/templates/layout/05_page.php b/daux/templates/layout/05_page.php
new file mode 100644
index 000000000..0f6f70e74
--- /dev/null
+++ b/daux/templates/layout/05_page.php
@@ -0,0 +1,108 @@
+layout('theme::layout/00_layout') ?>
+
+
+
+
+
+
+ insert('theme::partials/navbar_content', ['params' => $params]); ?>
+
+
+
+
+
+
+
+
+
+ value[$page['language']];
+ $path = $page['language'];
+ }
+
+ echo $this->get_navigation($rendertree, $path, isset($params['request']) ? $params['request'] : '', $base_page, $params['mode']);
+ ?>
+
+
+
+
+
+ $url) {
+ ?>
+
= $name ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ = $this->section('content'); ?>
+
+
+
+
diff --git a/daux/templates/partials/google_analytics.php b/daux/templates/partials/google_analytics.php
new file mode 100644
index 000000000..2f6328b71
--- /dev/null
+++ b/daux/templates/partials/google_analytics.php
@@ -0,0 +1,9 @@
+
diff --git a/daux/templates/partials/navbar_content.php b/daux/templates/partials/navbar_content.php
new file mode 100644
index 000000000..92991af09
--- /dev/null
+++ b/daux/templates/partials/navbar_content.php
@@ -0,0 +1,11 @@
+= $params['title']; ?>
+
+
+
+
diff --git a/daux/templates/partials/piwik_analytics.php b/daux/templates/partials/piwik_analytics.php
new file mode 100644
index 000000000..32ddcacb3
--- /dev/null
+++ b/daux/templates/partials/piwik_analytics.php
@@ -0,0 +1,15 @@
+
+
diff --git a/docs/01_Getting_Started/01_Prerequisites.md b/docs/01_Getting_Started/01_Prerequisites.md
new file mode 100644
index 000000000..b210ffa31
--- /dev/null
+++ b/docs/01_Getting_Started/01_Prerequisites.md
@@ -0,0 +1,59 @@
+## Prerequisites
+
+### npm modules
+
+Make sure you have all the required Node dependencies available:
+
+```bash
+npm install -g yo gulp-cli generator-angular-fullstack
+```
+
+### MongoDB
+
+If you're using MongoDB (which you probably are), you'll have to install it from [here](https://www.mongodb.com/download-center#community).
+You should then run the `mongod` process, which is in `/MongoDB/Server//bin/`. You'll also want a `/data/db` folder
+somewhere for Mongo to put your database in. It would be wise to make a script to automate this command, and maybe even run this script on
+your computer's startup. Example:
+
+```bash
+#!/bin/bash
+
+/var/lib/mongo/server/3.2/bin/mongod --dbpath /data/db
+```
+
+### node-gyp
+
+`node-gyp` is a cross-platform command-line tool written in Node.js for compiling native addon modules for Node.js. You'll need it for things like brotli compression.
+
+Read through the [Installation section of the `node-gyp` readme](https://github.com/nodejs/node-gyp#installation). Basically you'll need [Python 2.7](https://www.python.org/downloads/), `make`, and a C/C++ compiler (like GCC on unix, Xcode on OS X, or Visual Studio tools on Windows). To tell npm to use Python 2.7 (if you also have a different version installed), run `npm config set python /path/to/executable/python2.7`. Here's a snapshot of the instructions from their readme:
+
+ * On Unix:
+ * `python` (`v2.7` recommended, `v3.x.x` is __*not*__ supported)
+ * `make`
+ * A proper C/C++ compiler toolchain, like [GCC](https://gcc.gnu.org)
+ * On Mac OS X:
+ * `python` (`v2.7` recommended, `v3.x.x` is __*not*__ supported) (already installed on Mac OS X)
+ * [Xcode](https://developer.apple.com/xcode/download/)
+ * You also need to install the `Command Line Tools` via Xcode. You can find this under the menu `Xcode -> Preferences -> Downloads`
+ * This step will install `gcc` and the related toolchain containing `make`
+ * On Windows:
+ * Option 1: Install all the required tools and configurations using Microsoft's [windows-build-tools](https://github.com/felixrieseberg/windows-build-tools) using `npm install --global --production windows-build-tools` from an elevated PowerShell or CMD.exe (run as Administrator).
+ * Option 2: Install tools and configuration manually:
+ * Visual C++ Build Environment:
+ * Option 1: Install [Visual C++ Build Tools](http://landinghub.visualstudio.com/visual-cpp-build-tools) using the **Default Install** option.
+
+ * Option 2: Install [Visual Studio 2015](https://www.visualstudio.com/products/visual-studio-community-vs) (or modify an existing installation) and select *Common Tools for Visual C++* during setup. This also works with the free Community and Express for Desktop editions.
+
+ > :bulb: [Windows Vista / 7 only] requires [.NET Framework 4.5.1](http://www.microsoft.com/en-us/download/details.aspx?id=40773)
+
+ * Install [Python 2.7](https://www.python.org/downloads/) (`v3.x.x` is not supported), and run `npm config set python python2.7` (or see below for further instructions on specifying the proper Python version and path.)
+ * Launch cmd, `npm config set msvs_version 2015`
+
+ If the above steps didn't work for you, please visit [Microsoft's Node.js Guidelines for Windows](https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#compiling-native-addon-modules) for additional tips.
+
+### Create a new folder for your project
+
+Make a new directory, and `cd` into it:
+```bash
+mkdir myapp && cd $_
+```
diff --git a/docs/01_Getting_Started/02_Installation.md b/docs/01_Getting_Started/02_Installation.md
new file mode 100644
index 000000000..caf517734
--- /dev/null
+++ b/docs/01_Getting_Started/02_Installation.md
@@ -0,0 +1,14 @@
+## Installation
+
+Run `yo angular-fullstack` (optionally passing an app name):
+```bash
+yo angular-fullstack
+```
+
+You'll then be asked a series of questions regarding options for the generated app. Such things include using JavaScript or TypeScript,
+HTML or Pug, Bootstrap, SQL, and so on. If you don't know what to answer for a question, or just want to use our preferred options,
+hitting `ENTER` will use the default options for that question, and move on to the next one.
+
+Once you've answered all the questions, a project will be scaffolded for you according to the options you entered. Then, npm dependencies
+will automatically be installed. Once that's all complete, you're ready to get started with your app!
+
diff --git a/docs/01_Getting_Started/03_Running_Your_New_App.md b/docs/01_Getting_Started/03_Running_Your_New_App.md
new file mode 100644
index 000000000..140d04528
--- /dev/null
+++ b/docs/01_Getting_Started/03_Running_Your_New_App.md
@@ -0,0 +1,10 @@
+## Running Your New App
+
+You can start your new app by running `gulp serve`. This will do some preliminary things like clean out temporary
+files, lint your scripts, inject any new CSS files into your main one, apply environment variables, and download
+any new TypeScript definitions. It will then start up a new development server, which will kick off a Webpack build.
+it uses Browser Sync to facilitate front-end development. Your files will also be watched for changes. Any front-end
+changes will kick off another webpack build. Any back-end changes will restart the back-end server, cleaning the
+development database and re-seeding it as well.
+
+Once the `serve` tasks are complete, a browser tab should be opened to your new app server.
diff --git a/docs/01_Getting_Started/04_Project_Overview.md b/docs/01_Getting_Started/04_Project_Overview.md
new file mode 100644
index 000000000..6b8ac7a78
--- /dev/null
+++ b/docs/01_Getting_Started/04_Project_Overview.md
@@ -0,0 +1,128 @@
+## Project Overview
+
+What follows is an overfiew of the files/folders in your newly generated project.
+
+### Project Root
+
+```
+.babelrc // configuration for [Babel], a JavaScript transpiler
+.editorconfig // config file used to keep conistent file editing across text editors
+.eslintrc // all of the rules applying to the ESLint JavaScript linter
+.travis.yml // a sample configuration file for Travis CI
+.yo-rc.json // a configuration file for the Angular Full-Stack Generator
+gulpfile.babel.js // Gulp task runner file
+karma.conf.js // Karma browser testing configuration
+mocha.conf.js // Mocha test framework configuration
+mocha.global.js // teardown file for Mocha
+package.json // npm manifest, contains information for all project dependencies
+protractor.conf.js // configuration for Protractor e2e test framework
+README.md // a readme file generator based on your options, for your scaffolded project
+spec.js // test file for Webpack used by Karma
+webpack.make.js // main file for Webpack configuration
+ //The following export the config from `webpack.make.js` for their respective build targets:
+ webpack.dev.js
+ webpack.test.js
+ webpack.build.js
+```
+
+### `client/`
+
+```
+│ .eslintrc // eslint config for client files
+│ polyfills.js // imports of polyfills
+│ _index.html // template for the root HTML file of your app
+│
+├───app
+│ │ app.config.js // contains app-wide configuration code
+│ │ app.constants.js // gets injected with constants from `server/config/environment/shared.js`
+│ │ app.{js,ts} // root JavaScript file of your app
+│ │ app.{css,scss,stylus,less} // root CSS file of your app
+│ │
+│ ├───account // pages related to login / signup / user settings
+│ │ │ account.routes.js // route information
+│ │ │ index.js // account module root
+│ │ │
+│ │ ├───login
+│ │ ├───settings
+│ │ └───signup
+│ │
+│ ├───admin // site admin page
+│ │
+│ └───main // main component, homepage
+│
+├───assets // where static assets are stored
+│
+└───components
+ ├───auth
+ │ auth.module.js // module containing auth components
+ │ auth.service.js // authentication service
+ │ interceptor.service.js // intercepts requests and adds tokens if needed. Also redirects 401s to the login page.
+ │ router.decorator.js // facilitates auth-based routing configuration
+ │ user.service.js // user resource service
+ │
+ ├───footer
+ │
+ ├───modal
+ │
+ ├───navbar
+ │
+ ├───oauth-buttons // buttons for oauth login on signup / login pages
+ │
+ ├───socket
+ │ socket.mock.js // mock service for unit testing
+ │ socket.service.js // service for Socket IO integration
+ │
+ ├───ui-router
+ │ ui-router.mock.js // mock service for unit testing
+ │
+ └───util // general utility service
+```
+
+### `server/`
+
+```
+│ .eslintrc // server-specific ESLint config, imports rules from root file
+│ app.js // root server module
+│ index.js // imports `app.js`. Enables Babel require hook when in development mode.
+│ routes.js // imports / config for server endpoints
+│
+├───api
+│ ├───thing
+│ │ index.js // root module
+│ │ index.spec.js // root module tests
+│ │ thing.controller.js // endpoint logic
+│ │ thing.events.js // endpoint events (save, delete, etc) logic
+│ │ thing.integration.js // integration tests
+│ │ thing.model.js // Mongoose / Sequelize data model
+│ │ thing.socket.js // Socket IO logic / config
+│ │
+│ └───user // API for Users
+│
+├───auth
+│ │ auth.service.js
+│ │ index.js // imports local/oauth auth modules
+│ │
+│ ├───local // regular auth, signed up directly via your site
+│ ├───google // Google OAuth
+│ └───
+│
+└───config
+ │ express.js // Express server setup
+ │ local.env.js // ignored by Git
+ │ local.env.sample.js // sensitive environment variables are stored here, and added at server start. Copy to `local.env.js`.
+ │ seed.js // re-seeds database with fresh data
+ │ socketio.js // Socket IO configuration / imports
+ │
+ └───environment
+ development.js
+ index.js
+ production.js
+ shared.js // config constants shared with the client code
+ test.js
+```
+
+### `e2e/`
+
+End-To-End testing files (use by [Protractor](https://github.com/angular/protractor) with [Mocha](https://github.com/mochajs/mocha))
+
+[Babel]: https://babeljs.io/
diff --git a/docs/02_Developing/00_title.md b/docs/02_Developing/00_title.md
new file mode 100644
index 000000000..18bc89112
--- /dev/null
+++ b/docs/02_Developing/00_title.md
@@ -0,0 +1 @@
+[STUB]
diff --git a/docs/03_Deployment/00_title.md b/docs/03_Deployment/00_title.md
new file mode 100644
index 000000000..18bc89112
--- /dev/null
+++ b/docs/03_Deployment/00_title.md
@@ -0,0 +1 @@
+[STUB]
diff --git a/docs/Contributing/00_title.md b/docs/Contributing/00_title.md
new file mode 100644
index 000000000..2ad089d04
--- /dev/null
+++ b/docs/Contributing/00_title.md
@@ -0,0 +1,22 @@
+## 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/docs/Examples/00_title.md b/docs/Examples/00_title.md
new file mode 100644
index 000000000..18bc89112
--- /dev/null
+++ b/docs/Examples/00_title.md
@@ -0,0 +1 @@
+[STUB]
diff --git a/docs/Examples/Heroku_Deployment.md b/docs/Examples/Heroku_Deployment.md
new file mode 100644
index 000000000..2d7cda3b7
--- /dev/null
+++ b/docs/Examples/Heroku_Deployment.md
@@ -0,0 +1,11 @@
+After you have generated the app, go to heroku.com and create and application manually (ex. foo-bar-42424). Then, starting frome the root folder, run the following commands:
+
+* `grunt build`
+* `cd dist
+* `heroku login` (if you are not already authenticated)
+* `heroku git:remote -a foo-bar-42424`
+* `cd ..`
+* `grunt build` (not sure if this one is necessary)
+* `grunt buildcontrol:heroku`
+
+-- [@flaurian](https://github.com/flaurian) via [#1966](https://github.com/angular-fullstack/generator-angular-fullstack/issues/1966#issuecomment-231297368)
diff --git a/docs/Examples/IIS.md b/docs/Examples/IIS.md
new file mode 100644
index 000000000..2bc3d9975
--- /dev/null
+++ b/docs/Examples/IIS.md
@@ -0,0 +1,132 @@
+# Angular Full-Stack Generator deployment on Windows
+This is a walk through to get generator-angular-fullstack up and running on a windows machine.
+This walk through has been tested on:
+ - Windows Vista
+ - Windows 7
+ - Windows 8
+ - Windows Server 2008 (*all builds/ updates*)
+ - Windows Server 2012 (*all builds/ updates*)
+
+## Prerequisites
+
+**Install Python**
+ - Download Python 2.7 from [python.org/downloads](https://www.python.org/downloads/)
+ - Install to `C:\Python27` (*The Default Path*) **
+ - After Python is installed add the path (*`C:\Python27\`*) to your Windows `PATH` environment variable.
+ - Start > Type `Environment Variables` > click "Edit the System Environment Variables" > Envrionment Variables > Click "Path" > "Edit"
+ - Add C:\Python27\python.exe to the very end. (*Click into box and press 'End'*)
+
+**Install NodeJS on Windows**
+ - Download & Install [nvm-windows](https://github.com/coreybutler/nvm-windows/releases).
+ - Run `nvm install 6.4.0` for the version of node that you want
+ - Run `nvm use 6.4.0` to use that version
+
+**Install IISNode**
+ - Install Latest Stable release of [IISNode](https://github.com/tjanczuk/iisnode)
+
+**Install IIS URL-Rewrite Module**
+ - Install the [URL-Rewrite Module](http://www.iis.net/downloads/microsoft/url-rewrite) extension
+
+**Install MongoDB on Windows**
+ - Download the current stable release of MongoDB from https://www.mongodb.org/downloads and install using the "Complete" setup type and all the default options.
+ - Create the MongoDB data directory
+ - Create an empty folder at ex. `C:\data\db`.
+ - MongoDB requires a directory for storing all of it's data. The default directory is `C:\data\db`. You can use a different directory if you prefer by specifying the "--dbpath" parameter when starting the MongoDB server (below).
+ - Start the MongoDB server daemon by running `mongod.exe` from the command line. `mongod.exe` is likely located in `C:\Program Files\MongoDB\Server\[MONGODB VERSION]\bin`; for example for version 3.2 the following command will start MongoDB: `C:\Program Files\MongoDB\Server\3.2\bin\mongod`
+
+## Getting your project started
+
+**Install the generator**
+ - Create an empty folder for your project
+ - Open a terminal and change directories to your app's directory `cd c:\example`
+ - Run `npm install -g yo gulp-cli generator-angular-fullstack`
+ - Run `yo angular-fullstack`
+
+## Move App into production
+The below steps assume you have purchased a domain and have pointed your DNS to your public IP
+
+**Build and prep**
+ - Run the build process `gulp serve:dist`
+ - Move your `dist/` folder to your desired directory (*This is where IIS will be pointed at*)
+ - Copy the contents of the `server/` folder **into** your `client/` folder
+ - Copy down the web.config from below and place this inside your 'client' folder (*save it as 'web.config'*)
+
+```
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+```
+
+**Setup IIS**
+ - Open IIS Manager (*Start > Type 'IIS Manager'*)
+ - Create your new site (*Expand Server > Right click sites > 'Add Websites'*)
+ - Enter your site's name
+ - Enter the directory path to your `client/` folder (*`C:\example\dist\client\`*)
+ - Enter your hostname (*Your a-record*)
+ - Leave all other defaults and click 'Ok'
+
+**Start your server**
+ - Run `gulp serve:dist`
+
+# Congratulations, you did it! Now go code something awesome!
diff --git a/docs/Examples/Modal.md b/docs/Examples/Modal.md
new file mode 100644
index 000000000..7f7b37f8d
--- /dev/null
+++ b/docs/Examples/Modal.md
@@ -0,0 +1 @@
+[stub]
diff --git a/docs/angular-fullstack-logo.svg b/docs/angular-fullstack-logo.svg
new file mode 100644
index 000000000..bf40810ac
--- /dev/null
+++ b/docs/angular-fullstack-logo.svg
@@ -0,0 +1,9045 @@
+
+
+
+
diff --git a/docs/config.json b/docs/config.json
new file mode 100644
index 000000000..1b1761576
--- /dev/null
+++ b/docs/config.json
@@ -0,0 +1,34 @@
+{
+ "title": "Angular Full-Stack",
+ "tagline": "Yeoman generator for creating MEAN/SEAN stack applications, using ES6, MongoDB/SQL, Express, AngularJS, and Node - lets you quickly set up a project following best practices.",
+ "author": "Andrew Koroluk",
+ "image": "angular-fullstack-logo.svg",
+ "templates": "daux/templates",
+ "ignore": {
+ "files": ["Work_In_Progress.md"],
+ "folders": ["99_Not_Ready"]
+ },
+ "live": {
+ "clean_urls": true
+ },
+ "html": {
+ "theme": "daux-blue",
+ "breadcrumbs": true,
+ "breadcrumb_separator": "Chevrons",
+ "toggle_code": true,
+ "date_modified": true,
+ "float": false,
+ "inherit_index": true,
+ "search": true,
+
+ "repo": "angular-fullstack/generator-angular-fullstack",
+ "google_analytics": "UA-48443700-5",
+ "links": {
+ "Download": "https://www.npmjs.com/package/generator-angular-fullstack",
+ "GitHub Repo": "https://github.com/angular-fullstack/generator-angular-fullstack",
+ "Help/Support/Bugs": "https://github.com/angular-fullstack/generator-angular-fullstack/issues",
+ "Our Gitter Chatroom": "https://gitter.im/angular-fullstack/generator-angular-fullstack",
+ "Support our Open Collective": "https://opencollective.com/angular-fullstack"
+ }
+ }
+}
\ No newline at end of file
diff --git a/docs/generators/docker.md b/docs/generators/docker.md
new file mode 100644
index 000000000..e37637ba8
--- /dev/null
+++ b/docs/generators/docker.md
@@ -0,0 +1,22 @@
+### Docker
+
+Adding a Dockerfile
+
+ yo angular-fullstack:docker
+
+This will add a Dockerfile to your dist folder
+
+This file will survive `clean` operations so if it isn't to your requirements you can change it without losing it
+
+
+#### Upstream Image
+
+* includes node modules for the angular-fullstack version in use
+
+* uses an official node.js image
+
+* incorporarates changes automatically using the hub.docker infrastructure
+
+
+
+
diff --git a/docs/generators/heroku.md b/docs/generators/heroku.md
index 20336b82c..8024dd55b 100644
--- a/docs/generators/heroku.md
+++ b/docs/generators/heroku.md
@@ -2,24 +2,28 @@
Deploying to heroku only takes a few steps.
- yo angular-fullstack:heroku
+```
+yo angular-fullstack:heroku
+```
To work with your new heroku app using the command line, you will need to run any `heroku` commands from the `dist` folder.
If you're using mongoDB you will need to add a database to your app:
- heroku addons:create mongolab
+```
+heroku addons:create mongolab
+```
Note: if you get an `Error: No valid replicaset instance servers found` you need to modify moongose connection options in config/environment/production.js as follows:
```
options: {
- db: {
- safe: true,
- replset: { socketOptions: { keepAlive: 1, connectTimeoutMS: 30000 } },
- server: { socketOptions: { keepAlive: 1, connectTimeoutMS: 30000 } }
- }
- }
+ db: {
+ safe: true,
+ replset: { socketOptions: { keepAlive: 1, connectTimeoutMS: 30000 } },
+ server: { socketOptions: { keepAlive: 1, connectTimeoutMS: 30000 } }
+ }
+}
```
One of the odd things about the Node driver is that the default timeout for replica set connections is only 1 second, so make sure you're setting it to something more like 30s like in this example.
@@ -29,24 +33,30 @@ Your app should now be live. To view it run `heroku open`.
>
> If you're using any oAuth strategies, you must set environment variables for your selected oAuth. For example, if we're using **Facebook** oAuth we would do this :
>
-> heroku config:set FACEBOOK_ID=id
-> heroku config:set FACEBOOK_SECRET=secret
+> ```
+> heroku config:set FACEBOOK_ID=id
+> heroku config:set FACEBOOK_SECRET=secret
+> ```
>
> You will also need to set `DOMAIN` environment variable:
>
-> heroku config:set DOMAIN=.herokuapp.com
->
-> # or (if you're using it):
->
-> heroku config:set DOMAIN=
+> ```
+> heroku config:set DOMAIN=.herokuapp.com
+> # or (if you're using it):
+> heroku config:set DOMAIN=
+> ```
>
To make your deployment process easier consider using [grunt-build-control](https://github.com/robwierzbowski/grunt-build-control).
#### Pushing Updates
- gulp build
+```
+gulp build
+```
Commit and push the resulting build, located in your dist folder:
- gulp buildcontrol:heroku
+```
+gulp buildcontrol:heroku
+```
diff --git a/docs/index.md b/docs/index.md
index 043388816..53ede32c5 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -5,60 +5,27 @@
Available generators:
* App
- - [angular-fullstack](/docs/generators/app.md) (aka [angular-fullstack:app](/docs/generators/app.md))
+ - [angular-fullstack](Generators/app.md) (aka [angular-fullstack:app](Generators/app.md))
* Server Side
- - [angular-fullstack:endpoint](/docs/generators/endpoint.md)
-* Client Side
- - [angular-fullstack:route](/docs/generators/route.md)
- - [angular-fullstack:component](/docs/generators/component.md)
- - [angular-fullstack:controller](/docs/generators/controller.md)
- - [angular-fullstack:filter](/docs/generators/filter.md)
- - [angular-fullstack:directive](/docs/generators/directive.md)
- - [angular-fullstack:service](/docs/generators/service.md)
- - [angular-fullstack:provider](/docs/generators/service.md)
- - [angular-fullstack:factory](/docs/generators/service.md)
- - [angular-fullstack:decorator](/docs/generators/decorator.md)
+ - [angular-fullstack:endpoint](Generators/endpoint.md)
+* Client Side (via [generator-ng-component](https://github.com/DaftMonk/generator-ng-component))
+ - [angular-fullstack:route](Generators/route.md)
+ - [angular-fullstack:component](Generators/component.md)
+ - [angular-fullstack:controller](Generators/controller.md)
+ - [angular-fullstack:filter](Generators/filter.md)
+ - [angular-fullstack:directive](Generators/directive.md)
+ - [angular-fullstack:service](Generators/service.md)
+ - [angular-fullstack:provider](Generators/service.md)
+ - [angular-fullstack:factory](Generators/service.md)
+ - [angular-fullstack:decorator](Generators/decorator.md)
* Deployment
- - [angular-fullstack:openshift](/docs/generators/openshift.md)
- - [angular-fullstack:heroku](/docs/generators/heroku.md)
+ - [angular-fullstack:openshift](Generators/openshift.md)
+ - [angular-fullstack:heroku](Generators/heroku.md)
-## Bower Components
-
-The following packages are always installed by the [app](#app) generator:
-
-* angular
-* angular-cookies
-* angular-mocks
-* angular-resource
-* angular-sanitize
-* es5-shim
-* font-awesome
-* json3
-* jquery
-* lodash
-
-These packages are installed optionally depending on your configuration:
-
-* angular-route
-* angular-ui-router
-* angular-socket-io
-* angular-bootstrap
-* bootstrap
-
-All of these can be updated with `bower update` as new versions are released.
-
## Injection
-A gulp task looks for new files in your `client/app` and `client/components` folder and automatically injects them in the appropriate places based on an injection block.
-
-* `less` files into `client/app/app.less`
-* `scss` files into `client/app/app.scss`
-* `stylus` files into `client/app/app.styl`
-* `css` files into `client/index.html`
-* `js` files into `client/index.html`
-* `babel`/`typescript` temp `js` files into `client/index.html`
-* `typescript types` into `tsconfig.client.json` & `tsconfig.client.test.json`
+A gulp task looks for new SCSS/LESS/Stylus files in your `client/app` and `client/components` folder and automatically injects them into the main style file (ex `client/app/app.scss`) based on an injection block.
## Configuration
diff --git a/gulpfile.js b/gulpfile.js
index 6d6752aeb..f0cb747c6 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -15,6 +15,7 @@ const lazypipe = require('lazypipe');
const runSequence = require('run-sequence');
const merge = require('merge-stream');
const shell = require('shelljs');
+const ghPages = require('gulp-gh-pages');
var watching = false;
@@ -168,3 +169,28 @@ gulp.task('test', () => {
return gulp.src(['test/pre.test.js', 'test/*.test.js'])
.pipe(mocha());
});
+
+gulp.task('updateSubmodules', () => console.log('TODO'));
+gulp.task('changelog', () => console.log('TODO'));
+gulp.task('generateDemo', () => console.log('TODO'));
+gulp.task('demo', () => console.log('TODO')); // ['clean:demo', 'generateDemo']
+gulp.task('releaseDemo', () => console.log('TODO')); //['demo', 'releaseDemoBuild', 'buildcontrol:release']
+gulp.task('releaseDemoBuild', () => console.log('TODO'));
+gulp.task('deps', () => console.log('TODO')); // updateFixtures, david
+gulp.task('release', () => console.log('TODO'));
+gulp.task('lint', () => console.log('TODO'));
+
+gulp.task('daux', () => {
+ return execAsync('daux');
+});
+gulp.task('copy_docs_images', () => {
+ return gulp.src('./media/svg/*')
+ .pipe(gulp.dest('./static/'));
+});
+gulp.task('gh-pages', () => {
+ return gulp.src('./static/**/*')
+ .pipe(ghPages());
+});
+gulp.task('docs', cb => {
+ return runSequence('daux', 'copy_docs_images', 'gh-pages', cb);
+});
diff --git a/package.json b/package.json
index 910b44953..f5ee4c24a 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "generator-angular-fullstack",
- "version": "4.0.0-rc.0",
+ "version": "4.0.5",
"description": "Yeoman generator for creating MEAN stack applications, using MongoDB, Express, AngularJS, and Node",
"keywords": [
"yeoman-generator",
@@ -17,9 +17,9 @@
],
"homepage": "https://github.com/angular-fullstack/generator-angular-fullstack",
"bugs": "https://github.com/angular-fullstack/generator-angular-fullstack/issues",
- "author": "Tyler Henkel (http://tylerhenkel.com/)",
+ "author": "Andrew Koroluk (http://andrewk.me/)",
"contributors": [
- "Andrew Koroluk (http://andrewk.me/)",
+ "Tyler Henkel (http://tylerhenkel.com/)",
"Cody Mize (http://codymize.com/)",
"Brian Ford (http://briantford.com/)",
"Pascal Hartig (http://passy.me/)",
@@ -35,19 +35,21 @@
"prepublish": "gulp build"
},
"dependencies": {
- "babel-plugin-syntax-class-properties": "^6.5.0",
- "babel-plugin-syntax-flow": "^6.5.0",
- "babel-plugin-transform-flow-strip-types": "^6.7.0",
- "bluebird": "^3.3.5",
+ "babel-eslint": "^6.1.2",
+ "babel-plugin-syntax-class-properties": "^6.13.0",
+ "babel-plugin-syntax-flow": "^6.13.0",
+ "babel-plugin-transform-flow-strip-types": "^6.14.0",
+ "bluebird": "^3.4.5",
"chalk": "^1.1.0",
- "generator-ng-component": "~1.0.1",
- "glob": "^7.0.3",
+ "generator-ng-component": "~1.0.2",
+ "glob": "^7.0.5",
"gulp-babel": "^6.1.2",
"gulp-beautify": "^2.0.0",
+ "gulp-eslint": "^3.0.1",
"gulp-filter": "^4.0.0",
"gulp-tap": "^0.1.3",
- "insight": "~0.8.1",
- "lodash": "^4.13.1",
+ "insight": "~0.8.3",
+ "lodash": "^4.15.0",
"semver": "^5.1.0",
"underscore.string": "^3.1.1",
"yeoman-generator": "~0.24.1",
@@ -56,7 +58,7 @@
"devDependencies": {
"babel-plugin-transform-class-properties": "^6.9.0",
"babel-preset-es2015": "^6.6.0",
- "babel-register": "^6.6.5",
+ "babel-register": "^6.11.6",
"chai": "^3.2.0",
"del": "^2.2.0",
"grunt": "^1.0.1",
@@ -69,22 +71,23 @@
"grunt-mocha-test": "^0.12.7",
"grunt-release": "^0.14.0",
"gulp": "^3.9.1",
+ "gulp-gh-pages": "^0.5.4",
"gulp-if": "^2.0.1",
- "gulp-mocha": "^2.2.0",
+ "gulp-mocha": "^3.0.0",
"gulp-plumber": "^1.1.0",
"gulp-util": "^3.0.7",
"jit-grunt": "~0.10.0",
"lazypipe": "^1.0.1",
"merge-stream": "^1.0.0",
"minimatch": "^3.0.2",
- "mocha": "^2.5.2",
+ "mocha": "^3.0.0",
"q": "^1.0.1",
"recursive-readdir": "^2.0.0",
"run-sequence": "^1.2.1",
"shelljs": "^0.7.0",
- "should": "^9.0.2",
+ "should": "^11.1.0",
"yeoman-assert": "^2.0.0",
- "yeoman-test": "~1.4.0"
+ "yeoman-test": "~1.5.0"
},
"engines": {
"node": "^6.2.2",
diff --git a/readme.md b/readme.md
index dfaf24c7b..6c2036e57 100644
--- a/readme.md
+++ b/readme.md
@@ -1,5 +1,5 @@
# AngularJS Full-Stack generator
-
+

[](https://www.npmjs.com/package/generator-angular-fullstack)
@@ -24,24 +24,18 @@ Install `yo`, `gulp-cli`, and `generator-angular-fullstack`:
npm install -g yo gulp-cli generator-angular-fullstack
```
-> To install the latest 4.0.0 Beta with Webpack support, use `generator-angular-fullstack@beta`
-
-Make a new directory, and `cd` into it:
-```
-mkdir my-new-project && cd $_
-```
-
-Run `yo angular-fullstack`, optionally passing an app name:
+Run `yo angular-fullstack`
```
-yo angular-fullstack [app-name]
+yo angular-fullstack
```
-Run `gulp build` for building, `gulp serve` for development, and `gulp serve:dist` for a preview of the built app.
+**See the [Getting Started](http://angular-fullstack.github.io/generator-angular-fullstack/Getting_Started/Prerequisites.html) 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.
* 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/
+* [`node-gyp`](https://github.com/nodejs/node-gyp) - You'll likely need to be able to use `node-gyp`, Node's tool for compiling native add-ons (for things like database drivers). See its [Installation section](https://github.com/nodejs/node-gyp#installation) for more instructions.
## Supported Configurations
@@ -58,8 +52,8 @@ Run `gulp build` for building, `gulp serve` for development, and `gulp serve:dis
**Client**
* Scripts: `JavaScript (Babel)`, `TypeScript`
-* Module Systems: `Bower`, `Webpack` (soon), `SystemJS + JSPM` (planned)
-* Markup: `HTML`, `Jade`
+* Module Systems: `Webpack`, ~~`SystemJS + JSPM`~~ (maybe)
+* Markup: `HTML`, `Pug`
* Stylesheets: `CSS`, `Stylus`, `Sass`, `Less`
* Angular Routers: `ngRoute`, `ui-router`
* CSS Frameworks: `Bootstrap`
@@ -72,7 +66,7 @@ Run `gulp build` for building, `gulp serve` for development, and `gulp serve:dis
* `None`,
* `MongoDB`, `SQL`
* Authentication boilerplate: `Yes`, `No`
- * oAuth integrations: `Facebook` `Twitter` `Google`
+ * oAuth integrations: `Facebook`, `Twitter`, `Google`
* Socket.io integration: `Yes`, `No`
@@ -84,7 +78,7 @@ Available generators:
- [angular-fullstack](/docs/generators/app.md) (aka [angular-fullstack:app](/docs/generators/app.md))
* Server Side
- [angular-fullstack:endpoint](/docs/generators/endpoint.md)
-* Client Side
+* Client Side (via [generator-ng-component](https://github.com/DaftMonk/generator-ng-component))
- [angular-fullstack:route](/docs/generators/route.md)
- [angular-fullstack:component](/docs/generators/component.md)
- [angular-fullstack:controller](/docs/generators/controller.md)
@@ -101,7 +95,7 @@ Available generators:
## Documentation
-Check out our [documentation home page](/docs/index.md).
+Check out our [documentation home page](http://angular-fullstack.github.io/generator-angular-fullstack).
## Contribute
@@ -168,4 +162,4 @@ Is your company using Angular-FullStack? Ask your boss to support the project. Y
-
+
diff --git a/src/generators/app/USAGE b/src/generators/app/USAGE
index 22bfcb18d..b4467276f 100644
--- a/src/generators/app/USAGE
+++ b/src/generators/app/USAGE
@@ -22,3 +22,4 @@ Sub Generators:
Deployment:
angular-fullstack:openshift
angular-fullstack:heroku
+ angular-fullstack:docker
diff --git a/src/generators/app/index.js b/src/generators/app/index.js
index 3e199b59a..d66e6f9c6 100644
--- a/src/generators/app/index.js
+++ b/src/generators/app/index.js
@@ -13,6 +13,7 @@ import babelStream from 'gulp-babel';
import beaufityStream from 'gulp-beautify';
import tap from 'gulp-tap';
import filter from 'gulp-filter';
+import eslint from 'gulp-eslint';
import semver from 'semver';
export class Generator extends Base {
@@ -119,7 +120,7 @@ export class Generator extends Base {
this.filters = existingFilters;
this.scriptExt = this.filters.ts ? 'ts' : 'js';
- this.templateExt = this.filters.jade ? 'jade' : 'html';
+ this.templateExt = this.filters.pug ? 'pug' : 'html';
this.styleExt = this.filters.sass ? 'scss' :
this.filters.less ? 'less' :
this.filters.stylus ? 'styl' :
@@ -169,7 +170,7 @@ export class Generator extends Base {
type: 'list',
name: 'markup',
message: 'What would you like to write markup with?',
- choices: ['HTML', 'Jade'],
+ choices: ['HTML', 'Pug'],
filter: val => val.toLowerCase()
}, {
type: 'list',
@@ -408,7 +409,7 @@ export class Generator extends Base {
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.pug) extensions.push('pug');
if(this.filters.css) extensions.push('css');
if(this.filters.stylus) extensions.push('styl');
if(this.filters.sass) extensions.push('scss');
@@ -485,9 +486,11 @@ export class Generator extends Base {
babelPlugins.push('babel-plugin-transform-flow-strip-types');
}
- let jsFilter = filter(['client/**/*.js'], {restore: true});
+ const genDir = path.join(__dirname, '../../');
+
+ let clientJsFilter = filter(['client/**/*.js'], {restore: true});
this.registerTransformStream([
- jsFilter,
+ clientJsFilter,
babelStream({
plugins: babelPlugins.map(require.resolve),
/* Babel get's confused about these if you're using an `npm link`ed
@@ -523,7 +526,11 @@ export class Generator extends Base {
"wrap_attributes_indent_size": 4,
"end_with_newline": true
}),
- jsFilter.restore
+ eslint({
+ fix: true,
+ configFile: path.join(genDir, 'templates/app/client/.eslintrc(babel)')
+ }),
+ clientJsFilter.restore
]);
/**
@@ -563,6 +570,16 @@ export class Generator extends Base {
]);
}
+ let serverJsFilter = filter(['server/**/*.js'], {restore: true});
+ this.registerTransformStream([
+ serverJsFilter,
+ eslint({
+ fix: true,
+ configFile: path.join(genDir, 'templates/app/server/.eslintrc')
+ }),
+ serverJsFilter.restore
+ ]);
+
let self = this;
this.sourceRoot(path.join(__dirname, '../../templates/app'));
this.processDirectory('.', '.');
diff --git a/src/generators/docker/USAGE b/src/generators/docker/USAGE
new file mode 100644
index 000000000..32eca24b1
--- /dev/null
+++ b/src/generators/docker/USAGE
@@ -0,0 +1,8 @@
+Description:
+ Add a Dockerfile to the dist folder.
+
+Example:
+ yo angular-fullstack:docker
+
+ This will create:
+ a dist folder with a Dockerfile in it
diff --git a/src/generators/docker/index.js b/src/generators/docker/index.js
new file mode 100644
index 000000000..77b593ce9
--- /dev/null
+++ b/src/generators/docker/index.js
@@ -0,0 +1,50 @@
+'use strict';
+import util from 'util';
+import yeoman from 'yeoman-generator';
+import {Base} from 'yeoman-generator';
+import {exec} from 'child_process';
+import chalk from 'chalk';
+import path from 'path';
+import s from 'underscore.string';
+import {genBase} from '../generator-base';
+
+export class Generator extends Base {
+ constructor(...args) {
+ super(...args);
+
+ this.sourceRoot(path.join(__dirname, '../../templates/docker'));
+ }
+
+ initializing() {
+ return genBase(this);
+ }
+
+ copyDockerfile() {
+ var done = this.async();
+ this.log(chalk.bold('Creating Dockerfile'));
+ this.fs.copyTpl(this.templatePath('_Dockerfile'), 'dist/Dockerfile', this);
+ this.conflicter.resolve(err => {
+ done(err);
+ });
+ }
+
+ build() {
+ this.log(chalk.bold('\nBuilding dist folder, please wait...'));
+
+ var buildCommand = 'gulp build';
+
+ return new Promise((resolve, reject) => {
+ var child = exec(buildCommand, (err, stdout) => {
+ if(err) return reject(err);
+
+ resolve();
+ });
+
+ child.stdout.on('data', data => {
+ this.log(data.toString());
+ });
+ });
+ }
+}
+
+module.exports = Generator;
diff --git a/src/generators/heroku/index.js b/src/generators/heroku/index.js
index 0f86008f8..e44eed61e 100644
--- a/src/generators/heroku/index.js
+++ b/src/generators/heroku/index.js
@@ -6,9 +6,9 @@ import {exec} from 'child_process';
import chalk from 'chalk';
import path from 'path';
import s from 'underscore.string';
-import {genNamedBase} from '../generator-base';
+import {genBase} from '../generator-base';
-export default class Generator extends Base {
+export class Generator extends Base {
constructor(...args) {
super(...args);
@@ -16,7 +16,7 @@ export default class Generator extends Base {
}
initializing() {
- return genNamedBase(this);
+ return genBase(this);
}
askForName() {
@@ -203,3 +203,5 @@ Then deploy with
});
}
}
+
+module.exports = Generator;
diff --git a/src/test/get-expected-files.js b/src/test/get-expected-files.js
index d70c7c101..70b4bfc9c 100644
--- a/src/test/get-expected-files.js
+++ b/src/test/get-expected-files.js
@@ -14,7 +14,7 @@ export function app(options) {
css: 'css'
},
markup: {
- jade: 'jade',
+ pug: 'pug',
html: 'html'
},
script: {
diff --git a/src/test/main.test.js b/src/test/main.test.js
index c34b1ade0..79dbfff5d 100644
--- a/src/test/main.test.js
+++ b/src/test/main.test.js
@@ -183,7 +183,7 @@ describe('angular-fullstack:app', function() {
});
});
- describe('with TypeScript, Jade, Jasmine, LESS, & OAuth', function() {
+ describe('with TypeScript, Pug, Jasmine, LESS, & OAuth', function() {
var dir;
var lintResult;
var clientTestResult;
@@ -191,7 +191,7 @@ describe('angular-fullstack:app', function() {
var testOptions = {
buildtool: 'gulp',
transpiler: 'ts',
- markup: 'jade',
+ markup: 'pug',
stylesheet: 'less',
router: 'uirouter',
testing: 'jasmine',
@@ -263,7 +263,7 @@ describe('angular-fullstack:app', function() {
var testOptions = {
buildtool: 'gulp',
transpiler: 'babel',
- markup: 'jade',
+ markup: 'pug',
stylesheet: 'css',
router: 'uirouter',
testing: 'jasmine',
@@ -335,7 +335,7 @@ describe('angular-fullstack:app', function() {
var testOptions = {
buildtool: 'gulp',
transpiler: 'ts',
- markup: 'jade',
+ markup: 'pug',
stylesheet: 'stylus',
router: 'uirouter',
testing: 'mocha',
diff --git a/templates/app/.eslintrc b/templates/app/.eslintrc
index ef5d7de07..93dbcc287 100644
--- a/templates/app/.eslintrc
+++ b/templates/app/.eslintrc
@@ -175,7 +175,10 @@
"new-parens": 2, //disallow the omission of parentheses when invoking a constructor with no arguments
"newline-after-var": 0, //require or disallow an empty newline after variable declarations
"newline-before-return": 0, //require newline before return statement
- "newline-per-chained-call": 0, //enforce newline after each call when chaining the calls
+ "newline-per-chained-call": [
+ "error",
+ {"ignoreChainWithDepth": 2}
+ ], //enforce newline after each call when chaining the calls
"no-array-constructor": 2, //disallow use of the Array constructor
"no-bitwise": 0, //disallow use of bitwise operators
"no-continue": 0, //disallow use of the continue statement
diff --git a/templates/app/README.md b/templates/app/README.md
index 68aeef789..291bfa652 100644
--- a/templates/app/README.md
+++ b/templates/app/README.md
@@ -7,7 +7,7 @@ This project was generated with the [Angular Full-Stack Generator](https://githu
### Prerequisites
- [Git](https://git-scm.com/)
-- [Node.js and npm](nodejs.org) Node ^4.4.6, npm ^2.15.5
+- [Node.js and npm](nodejs.org) Node >= 4.x.x, npm >= 2.x.x
- [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)<% } %>
diff --git a/templates/app/_package.json b/templates/app/_package.json
index da24c6ced..0512f43e6 100644
--- a/templates/app/_package.json
+++ b/templates/app/_package.json
@@ -5,20 +5,20 @@
"dependencies": {
<%# CLIENT %>
"angular": "~1.5.5",<% if(filters.bootstrap) { if(filters.sass) { %>
- "bootstrap-sass": "~3.1.1",<% } %>
- "bootstrap": "~3.1.1",<% if(filters.oauth) { %>
- "bootstrap-social": "~4.9.1",<% }} %>
+ "bootstrap-sass": "~3.3.7",<% } %>
+ "bootstrap": "~3.3.7",<% if(filters.oauth) { %>
+ "bootstrap-social": "^5.0.0",<% }} %>
"angular-animate": "~1.5.5",
"angular-aria": "~1.5.5",
"angular-resource": "~1.5.5",
"angular-cookies": "~1.5.5",
"angular-sanitize": "~1.5.5",<% if(filters.ngroute) { %>
"angular-route": "~1.5.5",<% } if(filters.uibootstrap) { %>
- "angular-ui-bootstrap": "~1.1.2",<% } %>
+ "angular-ui-bootstrap": "^2.0.1",<% } %>
"font-awesome": ">=4.1.0",<% 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",<% } %>
+ "angular-ui-router": "~0.3.1",<% } if(filters.auth) { %>
+ "angular-validation-match": "^1.9.0",<% } %>
<%# END CLIENT %>
"core-js": "^2.2.1",
"express": "^4.13.3",
@@ -28,19 +28,18 @@
"cookie-parser": "^1.3.5",
"express-session": "^1.11.3",
"errorhandler": "^1.4.2",
- "compression": "^1.5.2",
"composable-middleware": "^0.3.0",
"fast-json-patch": "^1.0.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) { %>
+ "babel-polyfill": "^6.7.2",<% if(filters.pug) { %>
+ "pug": "2.0.0-beta4",<% } %><% if(filters.html) { %>
"ejs": "^2.3.3",<% } %><% if(filters.mongoose) { %>
"mongoose": "^4.1.2",
"bluebird": "^3.3.3",
"connect-mongo": "^1.2.1",<% } %><% if(filters.sequelize) { %>
- "sequelize": "^3.5.1",
+ "sequelize": "^3.23.6",
"sqlite3": "~3.1.1",
"express-sequelize-session": "0.4.0",<% } %><% if(filters.auth) { %>
"jsonwebtoken": "^7.0.0",
@@ -54,12 +53,14 @@
"socket.io-client": "^1.3.5",
"socketio-jwt": "^4.2.0",<% } %>
"serve-favicon": "^2.3.0",
+ "shrink-ray": "^0.1.3",
"sprint-js": "~0.1.0"
},
"devDependencies": {
<%# CLIENT %>
"angular-mocks": "~1.5.5",<% if(filters.stylus) { %>
- "bootstrap-styl": "^5.0.5",
+ <%_ if(filters.bootstrap) { -%>
+ "bootstrap-styl": "^5.0.5",<% } %>
"font-awesome-stylus": "^4.6.2",<% } %>
<%# END CLIENT %>
"autoprefixer": "^6.0.0",
@@ -69,7 +70,7 @@
"browser-sync": "^2.8.0",
"bs-fullscreen-message": "^1.0.0",
<%_ if(filters.flow) { -%>
- "flow-bin": "^0.27.0",
+ "flow-bin": "^0.31.0",
"babel-plugin-syntax-flow": "^6.8.0",
"babel-plugin-transform-flow-comments": "^6.8.0",<% } %>
"babel-plugin-transform-class-properties": "^6.6.0",
@@ -78,90 +79,71 @@
"eslint": "^2.12.0",
"del": "^2.0.2",
"gulp": "^3.9.1",
- "gulp-add-src": "^0.2.0",
- "gulp-angular-templatecache": "^2.0.0",
- "gulp-autoprefixer": "^3.1.0",
"gulp-babel": "^6.1.2",<% if(filters.ts) { %>
"gulp-typescript": "~2.13.0",
"gulp-typings": "^1.3.6",
"gulp-tslint": "^5.0.0",
"ts-helpers": "1.1.1",<% } %>
- "gulp-cache": "^0.4.2",
- "gulp-concat": "^2.6.0",
"gulp-env": "^0.4.0",
"gulp-eslint": "^2.0.0",
- "gulp-filter": "^4.0.0",
- "gulp-imagemin": "^2.2.1",
+ "gulp-imagemin": "^3.0.1",
"gulp-inject": "^4.0.0",
- "gulp-istanbul": "~0.10.3",
+ "gulp-istanbul": "^1.1.1",
"gulp-istanbul-enforcer": "^1.0.3",
"gulp-load-plugins": "^1.0.0-rc.1",
- "gulp-clean-css": "^2.0.6",
"gulp-mocha": "^2.1.3",
- "gulp-ng-annotate": "^2.0.0",
"gulp-node-inspector": "^0.1.0",
"gulp-plumber": "^1.0.1",
- "gulp-protractor": "^2.1.0",
- "gulp-rename": "^1.2.2",
+ "gulp-protractor": "^3.0.0",
"gulp-rev": "^7.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-watch": "^4.3.5",
"gulp-stylint": "^3.0.0",
- "nib": "^1.1.0",<% } if(filters.sass) { %>
- "gulp-sass": "^2.2.0",
- "gulp-scss-lint": "^0.3.9",<% } if(filters.less) { %>
- "gulp-less": "^3.0.3",
- "gulp-recess": "^1.1.2",<% } %>
"grunt": "^1.0.1",
"grunt-build-control": "^0.7.0",
"isparta": "^4.0.0",
- "utile": "~0.3.0",
"nodemon": "^1.3.7",
"run-sequence": "^1.1.0",
"lazypipe": "^1.0.1",
<%# WEBPACK %>
"webpack": "^1.12.14",
"webpack-dev-middleware": "^1.5.1",
- "webpack-dev-server": "~1.14.0",
"webpack-stream": "^3.2.0",
"extract-text-webpack-plugin": "^1.0.1",
"html-webpack-plugin": "^2.16.0",
"html-webpack-harddisk-plugin": "~0.0.2",
- <%_ if(filters.jade) { _%>
+ <%_ if(filters.pug) { _%>
"pug-html-loader": "^1.0.8",<% } %>
"awesome-typescript-loader": "0.17.0",
"ng-annotate-loader": "~0.1.0",
"babel-loader": "^6.2.4",
- "css-loader": "^0.23.1",
- "file-loader": "^0.8.4",
+ "css-loader": "^0.24.0",
+ "file-loader": "^0.9.0",
"imports-loader": "^0.6.5",
"isparta-instrumenter-loader": "^1.0.0",
"isparta-loader": "^2.0.0",
"istanbul-instrumenter-loader": "^0.2.0",
"null-loader": "^0.1.1",
- "postcss-loader": "^0.9.1",
+ "postcss-loader": "^0.11.1",
"raw-loader": "^0.5.1",
"style-loader": "^0.13.0",
<%_ if(filters.sass) { _%>
- "sass-loader": "^3.1.1",<% } %>
+ "node-sass": "^3.8.0",
+ "sass-loader": "^4.0.1",<% } %>
<%_ if(filters.less) { _%>
+ "less": "^2.7.1",
"less-loader": "^2.2.3",<% } %>
<%_ if(filters.stylus) { _%>
+ "stylus": "^0.54.5",
"stylus-loader": "^2.1.1",<% } %>
- "tiny-lr": "^0.2.1",
"karma-webpack": "^1.7.0",
<%# END WEBPACK %>
"through2": "^2.0.1",
"open": "~0.0.4",
- "istanbul": "~0.4.1",
+ "istanbul": "1.1.0-alpha.1",
"chai": "^3.2.0",
"sinon": "^1.16.1",
"chai-as-promised": "^5.1.0",
@@ -169,13 +151,13 @@
"karma": "~0.13.3",
"karma-firefox-launcher": "^1.0.0",
"karma-script-launcher": "^1.0.0",
- "karma-coverage": "^0.5.3",
- "karma-chrome-launcher": "^1.0.1",
+ "karma-coverage": "^1.0.0",
+ "karma-chrome-launcher": "^2.0.0",
"karma-phantomjs-launcher": "~1.0.0",
"karma-spec-reporter": "~0.0.20",
"karma-sourcemap-loader": "~0.3.7",
"sinon-chai": "^2.8.0",
- "mocha": "^2.2.5",<% if(filters.mocha) { %>
+ "mocha": "^3.0.2",<% if(filters.mocha) { %>
"karma-mocha": "^1.0.1",
"karma-chai-plugins": "~0.7.0",<% } if(filters.jasmine) { %>
"jasmine-core": "^2.3.4",
@@ -189,8 +171,8 @@
"typings": "^0.8.1"<% } %>
},
"engines": {
- "node": "^4.4.6",
- "npm": "^2.15.5"
+ "node": "^6.2.2",
+ "npm": "^3.9.5"
},
"scripts": {
"test": "gulp test",
diff --git a/templates/app/client/app/account(auth)/login/index.js b/templates/app/client/app/account(auth)/login/index.js
index 187b43be5..ded119f9e 100644
--- a/templates/app/client/app/account(auth)/login/index.js
+++ b/templates/app/client/app/account(auth)/login/index.js
@@ -1,4 +1,5 @@
'use strict';
+import angular from 'angular';
import LoginController from './login.controller';
export default angular.module('<%= scriptAppName %>.login', [])
diff --git a/templates/app/client/app/account(auth)/login/login(jade).jade b/templates/app/client/app/account(auth)/login/login(pug).pug
similarity index 100%
rename from templates/app/client/app/account(auth)/login/login(jade).jade
rename to templates/app/client/app/account(auth)/login/login(pug).pug
diff --git a/templates/app/client/app/account(auth)/settings/index.js b/templates/app/client/app/account(auth)/settings/index.js
index 823caa530..6b5eddabe 100644
--- a/templates/app/client/app/account(auth)/settings/index.js
+++ b/templates/app/client/app/account(auth)/settings/index.js
@@ -1,4 +1,5 @@
'use strict';
+import angular from 'angular';
import SettingsController from './settings.controller';
export default angular.module('<%= scriptAppName %>.settings', [])
diff --git a/templates/app/client/app/account(auth)/settings/settings(jade).jade b/templates/app/client/app/account(auth)/settings/settings(pug).pug
similarity index 100%
rename from templates/app/client/app/account(auth)/settings/settings(jade).jade
rename to templates/app/client/app/account(auth)/settings/settings(pug).pug
diff --git a/templates/app/client/app/account(auth)/signup/index.js b/templates/app/client/app/account(auth)/signup/index.js
index 43b4842b7..b95da83e1 100644
--- a/templates/app/client/app/account(auth)/signup/index.js
+++ b/templates/app/client/app/account(auth)/signup/index.js
@@ -1,5 +1,5 @@
'use strict';
-
+import angular from 'angular';
import SignupController from './signup.controller';
export default angular.module('<%= scriptAppName %>.signup', [])
diff --git a/templates/app/client/app/account(auth)/signup/signup(jade).jade b/templates/app/client/app/account(auth)/signup/signup(pug).pug
similarity index 100%
rename from templates/app/client/app/account(auth)/signup/signup(jade).jade
rename to templates/app/client/app/account(auth)/signup/signup(pug).pug
diff --git a/templates/app/client/app/account(auth)/signup/signup.controller.js b/templates/app/client/app/account(auth)/signup/signup.controller.js
index 196684c24..85e71d28f 100644
--- a/templates/app/client/app/account(auth)/signup/signup.controller.js
+++ b/templates/app/client/app/account(auth)/signup/signup.controller.js
@@ -1,5 +1,7 @@
'use strict';
// @flow
+import angular from 'angular';
+
<%_ if(filters.flow) { -%>
type User = {
name: string;
diff --git a/templates/app/client/app/admin(auth)/admin(jade).jade b/templates/app/client/app/admin(auth)/admin(pug).pug
similarity index 100%
rename from templates/app/client/app/admin(auth)/admin(jade).jade
rename to templates/app/client/app/admin(auth)/admin(pug).pug
diff --git a/templates/app/client/app/admin(auth)/index.js b/templates/app/client/app/admin(auth)/index.js
index d78165412..72422ea8f 100644
--- a/templates/app/client/app/admin(auth)/index.js
+++ b/templates/app/client/app/admin(auth)/index.js
@@ -1,4 +1,5 @@
'use strict';
+import angular from 'angular';
import routes from './admin.routes';
import AdminController from './admin.controller';
diff --git a/templates/app/client/app/app(sass).scss b/templates/app/client/app/app(sass).scss
index e0956fff7..1f774272e 100644
--- a/templates/app/client/app/app(sass).scss
+++ b/templates/app/client/app/app(sass).scss
@@ -1,6 +1,6 @@
<%_ if (filters.bootstrap) { _%>
$icon-font-path: '/assets/fonts/bootstrap/';
-@import '~bootstrap-sass/vendor/assets/stylesheets/bootstrap';
+@import '~bootstrap-sass/assets/stylesheets/bootstrap';
<%_ if(filters.oauth) { _%>
@import '~bootstrap-social/bootstrap-social.scss';
<% }} _%>
diff --git a/templates/app/client/app/app.js b/templates/app/client/app/app.js
index 7ccaaf89c..2937399dd 100644
--- a/templates/app/client/app/app.js
+++ b/templates/app/client/app/app.js
@@ -14,7 +14,7 @@ import uiRouter from 'angular-ui-router';<% } %>
import uiBootstrap from 'angular-ui-bootstrap';<% } %>
// import ngMessages from 'angular-messages';
<%_ if(filters.auth) { _%>
-//import ngValidationMatch from 'angular-validation-match';<% } %>
+// import ngValidationMatch from 'angular-validation-match';<% } %>
import {routeConfig} from './app.config';
@@ -35,7 +35,6 @@ import socket from '../components/socket/socket.service';<% } %>
import './app.<%= styleExt %>';
angular.module('<%= scriptAppName %>', [
- // ngAnimate,
ngCookies,
ngResource,
ngSanitize,
@@ -47,9 +46,7 @@ angular.module('<%= scriptAppName %>', [
uiRouter,<% } _%>
<%_ if(filters.uibootstrap) { %>
uiBootstrap,<% } %>
- // ngMessages,
<%_ if(filters.auth) { %>
- // ngValidationMatch,
_Auth,
account,
admin,<% } _%>
diff --git a/templates/app/client/app/main/main(jade).jade b/templates/app/client/app/main/main(pug).pug
similarity index 100%
rename from templates/app/client/app/main/main(jade).jade
rename to templates/app/client/app/main/main(pug).pug
diff --git a/templates/app/client/components/auth(auth)/auth.service.js b/templates/app/client/components/auth(auth)/auth.service.js
index 87a0adb2f..e38a12632 100644
--- a/templates/app/client/components/auth(auth)/auth.service.js
+++ b/templates/app/client/components/auth(auth)/auth.service.js
@@ -1,6 +1,6 @@
'use strict';
// @flow
-class User {
+class _User {
_id: string = '';
name: string = '';
email: string = '';
@@ -11,7 +11,7 @@ class User {
export function AuthService($location, $http, $cookies, $q, appConfig, Util, User) {
'ngInject';
var safeCb = Util.safeCb;
- var currentUser: User = new User();
+ var currentUser: _User = new _User();
var userRoles = appConfig.userRoles || [];
/**
* Check if userRole is >= role
@@ -27,7 +27,6 @@ export function AuthService($location, $http, $cookies, $q, appConfig, Util, Use
}
var Auth = {
-
/**
* Authenticate user and save token
*
@@ -58,7 +57,7 @@ export function AuthService($location, $http, $cookies, $q, appConfig, Util, Use
*/
logout() {
$cookies.remove('token');
- currentUser = new User();
+ currentUser = new _User();
},
/**
@@ -104,7 +103,7 @@ export function AuthService($location, $http, $cookies, $q, appConfig, Util, Use
* @return {Promise}
*/
getCurrentUser(callback?: Function) {
- var value = currentUser.hasOwnProperty('$promise')
+ var value = _.get(currentUser, '$promise')
? currentUser.$promise
: currentUser;
@@ -136,7 +135,8 @@ export function AuthService($location, $http, $cookies, $q, appConfig, Util, Use
isLoggedIn(callback?: Function) {
return Auth.getCurrentUser(undefined)
.then(user => {
- var is = user.hasOwnProperty('role');
+ let is = _.get(user, 'role');
+
safeCb(callback)(is);
return is;
});
@@ -148,7 +148,7 @@ export function AuthService($location, $http, $cookies, $q, appConfig, Util, Use
* @return {Bool}
*/
isLoggedInSync() {
- return currentUser.hasOwnProperty('role');
+ return !!_.get(currentUser, 'role');
},
/**
@@ -161,9 +161,7 @@ export function AuthService($location, $http, $cookies, $q, appConfig, Util, Use
hasRole(role, callback?: Function) {
return Auth.getCurrentUser(undefined)
.then(user => {
- var has = user.hasOwnProperty('role')
- ? hasRole(user.role, role)
- : false;
+ let has = hasRole(_.get(user, 'role'), role);
safeCb(callback)(has);
return has;
@@ -177,7 +175,7 @@ export function AuthService($location, $http, $cookies, $q, appConfig, Util, Use
* @return {Bool}
*/
hasRoleSync(role) {
- return hasRole(currentUser.role, role);
+ return hasRole(_.get(currentUser, 'role'), role);
},
/**
diff --git a/templates/app/client/components/auth(auth)/router.decorator.js b/templates/app/client/components/auth(auth)/router.decorator.js
index ea205ec7d..aaff3be32 100644
--- a/templates/app/client/components/auth(auth)/router.decorator.js
+++ b/templates/app/client/components/auth(auth)/router.decorator.js
@@ -1,5 +1,4 @@
'use strict';
-import * as _ from 'lodash';
export function routerDecorator($rootScope<% if(filters.ngroute) { %>, $location<% } if(filters.uirouter) { %>, $state<% } %>, Auth) {
'ngInject';
diff --git a/templates/app/client/components/footer/footer(jade).jade b/templates/app/client/components/footer/footer(pug).pug
similarity index 100%
rename from templates/app/client/components/footer/footer(jade).jade
rename to templates/app/client/components/footer/footer(pug).pug
diff --git a/templates/app/client/components/modal(uibootstrap)/modal(jade).jade b/templates/app/client/components/modal(uibootstrap)/modal(pug).pug
similarity index 100%
rename from templates/app/client/components/modal(uibootstrap)/modal(jade).jade
rename to templates/app/client/components/modal(uibootstrap)/modal(pug).pug
diff --git a/templates/app/client/components/modal(uibootstrap)/modal.service.js b/templates/app/client/components/modal(uibootstrap)/modal.service.js
index 91d94894c..1269ac83b 100644
--- a/templates/app/client/components/modal(uibootstrap)/modal.service.js
+++ b/templates/app/client/components/modal(uibootstrap)/modal.service.js
@@ -1,4 +1,5 @@
'use strict';
+import angular from 'angular';
export function Modal($rootScope, $uibModal) {
/**
@@ -37,9 +38,9 @@ export function Modal($rootScope, $uibModal) {
* @param {All} - any additional args are passed straight to del callback
*/
return function() {
- var args = Array.prototype.slice.call(arguments),
- name = args.shift(),
- deleteModal;
+ var args = Array.prototype.slice.call(arguments);
+ var name = args.shift();
+ var deleteModal;
deleteModal = openModal({
modal: {
diff --git a/templates/app/client/components/mongoose-error(auth)/mongoose-error.directive.js b/templates/app/client/components/mongoose-error(auth)/mongoose-error.directive.js
index 3ee88f8d9..6405202a5 100644
--- a/templates/app/client/components/mongoose-error(auth)/mongoose-error.directive.js
+++ b/templates/app/client/components/mongoose-error(auth)/mongoose-error.directive.js
@@ -1,4 +1,5 @@
'use strict';
+import angular from 'angular';
/**
* Removes server error when user updates input
diff --git a/templates/app/client/components/navbar/navbar(jade).jade b/templates/app/client/components/navbar/navbar(pug).pug
similarity index 100%
rename from templates/app/client/components/navbar/navbar(jade).jade
rename to templates/app/client/components/navbar/navbar(pug).pug
diff --git a/templates/app/client/components/navbar/navbar.component.js b/templates/app/client/components/navbar/navbar.component.js
index 6a6d37282..8cf2ab0b1 100644
--- a/templates/app/client/components/navbar/navbar.component.js
+++ b/templates/app/client/components/navbar/navbar.component.js
@@ -1,4 +1,6 @@
'use strict';
+/* eslint no-sync: 0 */
+import angular from 'angular';
export class NavbarComponent {
menu = [{
diff --git a/templates/app/client/components/oauth-buttons(oauth)/index.js b/templates/app/client/components/oauth-buttons(oauth)/index.js
index 8ce33c85e..5b328d684 100644
--- a/templates/app/client/components/oauth-buttons(oauth)/index.js
+++ b/templates/app/client/components/oauth-buttons(oauth)/index.js
@@ -1,6 +1,8 @@
'use strict';
+import angular from 'angular';
export function OauthButtonsController($window) {
+ 'ngInject';
this.loginOauth = function(provider) {
$window.location.href = '/auth/' + provider;
};
diff --git a/templates/app/client/components/oauth-buttons(oauth)/oauth-buttons(jade).jade b/templates/app/client/components/oauth-buttons(oauth)/oauth-buttons(pug).pug
similarity index 100%
rename from templates/app/client/components/oauth-buttons(oauth)/oauth-buttons(jade).jade
rename to templates/app/client/components/oauth-buttons(oauth)/oauth-buttons(pug).pug
diff --git a/templates/app/client/components/socket(socketio)/socket.service.js b/templates/app/client/components/socket(socketio)/socket.service.js
index bcaa55b18..a41af682a 100644
--- a/templates/app/client/components/socket(socketio)/socket.service.js
+++ b/templates/app/client/components/socket(socketio)/socket.service.js
@@ -1,8 +1,10 @@
'use strict';
-
+import * as _ from 'lodash';
+import angular from 'angular';
import io from 'socket.io-client';
function Socket(socketFactory) {
+ 'ngInject';
// 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
diff --git a/templates/app/client/components/util/util.module.js b/templates/app/client/components/util/util.module.js
index 3e93a69b9..b627e4486 100644
--- a/templates/app/client/components/util/util.module.js
+++ b/templates/app/client/components/util/util.module.js
@@ -1,4 +1,5 @@
'use strict';
+import angular from 'angular';
import {UtilService} from './util.service';
export default angular.module('<%= scriptAppName %>.util', [])
diff --git a/templates/app/client/components/util/util.service.js b/templates/app/client/components/util/util.service.js
index 39b108988..7101c92f8 100644
--- a/templates/app/client/components/util/util.service.js
+++ b/templates/app/client/components/util/util.service.js
@@ -1,4 +1,5 @@
'use strict';
+import angular from 'angular';
/**
* The Util service is for thin, globally reusable, utility functions
diff --git a/templates/app/gulpfile.babel.js b/templates/app/gulpfile.babel.js
index 3272062f0..ae1a67d85 100644
--- a/templates/app/gulpfile.babel.js
+++ b/templates/app/gulpfile.babel.js
@@ -15,8 +15,7 @@ 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';<% } %>
+import {Instrumenter} from 'isparta';
import webpack from 'webpack-stream';
import makeWebpackConfig from './webpack.make';
@@ -236,6 +235,9 @@ gulp.task('webpack:dist', function() {
const webpackDistConfig = makeWebpackConfig({ BUILD: true });
return gulp.src(webpackDistConfig.entry.app)
.pipe(webpack(webpackDistConfig))
+ .on('error', (err) => {
+ this.emit('end'); // Recover from errors
+ })
.pipe(gulp.dest(`${paths.dist}/client`));
});
@@ -491,8 +493,8 @@ gulp.task('build', cb => {
'inject',
'transpile:server',
[
- 'build:images',
- 'typings'
+ 'build:images'<% if(filters.ts) { %>,
+ 'typings'<% } %>
],
[
'copy:extras',
@@ -505,15 +507,16 @@ gulp.task('build', cb => {
cb);
});
-gulp.task('clean:dist', () => del([`${paths.dist}/!(.git*|.openshift|Procfile)**`], {dot: true}));
+gulp.task('clean:dist', () => del([`${paths.dist}/!(.git*|.openshift|Procfile|Dockerfile)**`], {dot: true}));
gulp.task('build:images', () => {
return gulp.src(paths.client.images)
- .pipe(plugins.imagemin({
- optimizationLevel: 5,
- progressive: true,
- interlaced: true
- }))
+ .pipe(plugins.imagemin([
+ plugins.imagemin.optipng({optimizationLevel: 5}),
+ plugins.imagemin.jpegtran({progressive: true}),
+ plugins.imagemin.gifsicle({interlaced: true}),
+ plugins.imagemin.svgo({plugins: [{removeViewBox: false}]})
+ ]))
.pipe(plugins.rev())
.pipe(gulp.dest(`${paths.dist}/${clientPath}/assets/images`))
.pipe(plugins.rev.manifest(`${paths.dist}/${paths.client.revManifest}`, {
diff --git a/templates/app/karma.conf.js b/templates/app/karma.conf.js
index 7297c1bd0..812e588b2 100644
--- a/templates/app/karma.conf.js
+++ b/templates/app/karma.conf.js
@@ -47,7 +47,6 @@ module.exports = function(config) {
},
plugins: [
- require('karma-chai-plugins'),
require('karma-chrome-launcher'),
require('karma-coverage'),
require('karma-firefox-launcher'),
diff --git a/templates/app/server/api/user(auth)/user.controller.js b/templates/app/server/api/user(auth)/user.controller.js
index c3e0d50ed..d8a1f5fe3 100644
--- a/templates/app/server/api/user(auth)/user.controller.js
+++ b/templates/app/server/api/user(auth)/user.controller.js
@@ -2,7 +2,6 @@
<% 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';
@@ -44,7 +43,7 @@ export function index(req, res) {
/**
* Creates a new user
*/
-export function create(req, res, next) {
+export function create(req, res) {
<% if (filters.mongooseModels) { %>var newUser = new User(req.body);
newUser.provider = 'local';
newUser.role = 'user';
@@ -99,7 +98,7 @@ export function destroy(req, res) {
/**
* Change a users password
*/
-export function changePassword(req, res, next) {
+export function changePassword(req, res) {
var userId = req.user._id;
var oldPass = String(req.body.oldPassword);
var newPass = String(req.body.newPassword);
@@ -155,6 +154,6 @@ export function me(req, res, next) {
/**
* Authentication callback
*/
-export function authCallback(req, res, next) {
+export function authCallback(req, res) {
res.redirect('/');
}
diff --git a/templates/app/server/api/user(auth)/user.events.js b/templates/app/server/api/user(auth)/user.events.js
index 1cd0480e5..f8ebebe90 100644
--- a/templates/app/server/api/user(auth)/user.events.js
+++ b/templates/app/server/api/user(auth)/user.events.js
@@ -14,18 +14,18 @@ UserEvents.setMaxListeners(0);
// Model events<% if (filters.mongooseModels) { %>
var events = {
- 'save': 'save',
- 'remove': 'remove'
+ save: 'save',
+ remove: 'remove'
};<% } if (filters.sequelizeModels) { %>
var events = {
- 'afterCreate': 'save',
- 'afterUpdate': 'save',
- 'afterDestroy': 'remove'
+ 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) { %>
+for(var e in events) {
+ let event = events[e];<% if (filters.mongooseModels) { %>
User.schema.post(e, emitEvent(event));<% } if (filters.sequelizeModels) { %>
User.hook(e, emitEvent(event));<% } %>
}
diff --git a/templates/app/server/api/user(auth)/user.model(mongooseModels).js b/templates/app/server/api/user(auth)/user.model(mongooseModels).js
index c67632162..f23208f12 100644
--- a/templates/app/server/api/user(auth)/user.model(mongooseModels).js
+++ b/templates/app/server/api/user(auth)/user.model(mongooseModels).js
@@ -244,14 +244,14 @@ UserSchema.methods = {
if(!callback) {
return crypto.pbkdf2Sync(password, salt, defaultIterations, defaultKeyLength)
- .toString('base64');
+ .toString('base64');
}
return crypto.pbkdf2(password, salt, defaultIterations, defaultKeyLength, (err, key) => {
if(err) {
- callback(err);
+ return callback(err);
} else {
- callback(null, key.toString('base64'));
+ return callback(null, key.toString('base64'));
}
});
}
diff --git a/templates/app/server/app.js b/templates/app/server/app.js
index a63b97cab..7dbbcba9f 100644
--- a/templates/app/server/app.js
+++ b/templates/app/server/app.js
@@ -15,11 +15,13 @@ import http from 'http';
mongoose.connect(config.mongo.uri, config.mongo.options);
mongoose.connection.on('error', function(err) {
console.error('MongoDB connection error: ' + err);
- process.exit(-1);
+ process.exit(-1); // eslint-disable-line no-process-exit
});
-<% } %><% if (filters.models) { %>
+<% } %><% if(filters.models) { %>
// Populate databases with sample data
-if (config.seedDB) { require('./config/seed'); }
+if(config.seedDB) {
+ require('./config/seed');
+}
<% } %>
// Setup server
var app = express();
@@ -38,7 +40,7 @@ function startServer() {
console.log('Express server listening on %d, in %s mode', config.port, app.get('env'));
});
}
-<% if (filters.sequelize) { %>
+<% if(filters.sequelize) { %>
sqldb.sequelize.sync()
.then(startServer)
.catch(function(err) {
diff --git a/templates/app/server/auth(auth)/auth.service.js b/templates/app/server/auth(auth)/auth.service.js
index 43de0a3c5..13b345c3b 100644
--- a/templates/app/server/auth(auth)/auth.service.js
+++ b/templates/app/server/auth(auth)/auth.service.js
@@ -1,6 +1,4 @@
'use strict';
-
-import passport from 'passport';
import config from '../config/environment';
import jwt from 'jsonwebtoken';
import expressJwt from 'express-jwt';
@@ -60,11 +58,10 @@ export function hasRole(roleRequired) {
return compose()
.use(isAuthenticated())
.use(function meetsRequirements(req, res, next) {
- if (config.userRoles.indexOf(req.user.role) >=
- config.userRoles.indexOf(roleRequired)) {
- next();
+ if (config.userRoles.indexOf(req.user.role) >= config.userRoles.indexOf(roleRequired)) {
+ return next();
} else {
- res.status(403).send('Forbidden');
+ return res.status(403).send('Forbidden');
}
});
}
diff --git a/templates/app/server/auth(auth)/index.js b/templates/app/server/auth(auth)/index.js
index 09564fe28..3f9983fb3 100644
--- a/templates/app/server/auth(auth)/index.js
+++ b/templates/app/server/auth(auth)/index.js
@@ -1,7 +1,5 @@
'use strict';
-
import express from 'express';
-import passport from 'passport';
import config from '../config/environment';<% if (filters.mongooseModels) { %>
import User from '../api/user/user.model';<% } %><% if (filters.sequelizeModels) { %>
import {User} from '../sqldb';<% } %>
diff --git a/templates/app/server/auth(auth)/twitter(twitterAuth)/passport.js b/templates/app/server/auth(auth)/twitter(twitterAuth)/passport.js
index f13b4cfe7..7eb009912 100644
--- a/templates/app/server/auth(auth)/twitter(twitterAuth)/passport.js
+++ b/templates/app/server/auth(auth)/twitter(twitterAuth)/passport.js
@@ -8,6 +8,9 @@ export function setup(User, config) {
callbackURL: config.twitter.callbackURL
},
function(token, tokenSecret, profile, done) {
+ profile._json.id = `${profile._json.id}`;
+ profile.id = `${profile.id}`;
+
<% if(filters.mongooseModels) { %>User.findOne({'twitter.id': profile.id}).exec()<% }
if(filters.sequelizeModels) { %>User.find({where:{'twitter.id': profile.id}})<% } %>
.then(user => {
diff --git a/templates/app/server/config/environment/production.js b/templates/app/server/config/environment/production.js
index 188362d88..96d5de11c 100644
--- a/templates/app/server/config/environment/production.js
+++ b/templates/app/server/config/environment/production.js
@@ -11,7 +11,7 @@ module.exports = {
// Server port
port: process.env.OPENSHIFT_NODEJS_PORT
- || process.env.port
+ || process.env.PORT
|| <%= prodPort %><% if(filters.mongoose) { %>,
// MongoDB connection options
diff --git a/templates/app/server/config/express.js b/templates/app/server/config/express.js
index 993fb7a8d..f80dc5a73 100644
--- a/templates/app/server/config/express.js
+++ b/templates/app/server/config/express.js
@@ -7,7 +7,7 @@
import express from 'express';
import favicon from 'serve-favicon';
import morgan from 'morgan';
-import compression from 'compression';
+import shrinkRay from 'shrink-ray';
import bodyParser from 'body-parser';
import methodOverride from 'method-override';
import cookieParser from 'cookie-parser';
@@ -15,9 +15,9 @@ import errorHandler from 'errorhandler';
import path from 'path';
<%_ if(!filters.noModels) { -%>
import lusca from 'lusca';<% } %>
-import config from './environment';<% if (filters.auth) { %>
+import config from './environment';<% if(filters.auth) { %>
import passport from 'passport';<% } %><% if(!filters.noModels) { %>
-import session from 'express-session';<% } %><% if (filters.mongoose) { %>
+import session from 'express-session';<% } %><% if(filters.mongoose) { %>
<%_ if(semver.satisfies(nodeVersion, '>= 4')) { _%>
import connectMongo from 'connect-mongo';<% } else { _%>
import connectMongo from 'connect-mongo/es5';<% } %>
@@ -26,18 +26,15 @@ var MongoStore = connectMongo(session);<% } else if(filters.sequelize) { %>
import sqldb from '../sqldb';
import expressSequelizeSession from 'express-sequelize-session';
var Store = expressSequelizeSession(session.Store);<% } %>
-import stripAnsi from 'strip-ansi';
-
-var browserSync = require('browser-sync').create();
export default function(app) {
var env = app.get('env');
- if (env === 'development' || env === 'test') {
+ if(env === 'development' || env === 'test') {
app.use(express.static(path.join(config.root, '.tmp')));
}
- if (env === 'production') {
+ if(env === 'production') {
app.use(favicon(path.join(config.root, 'client', 'favicon.ico')));
}
@@ -45,15 +42,15 @@ export default function(app) {
app.use(express.static(app.get('appPath')));
app.use(morgan('dev'));
- app.set('views', config.root + '/server/views');<% if (filters.html) { %>
+ 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.set('view engine', 'html');<% } %><% if(filters.pug) { %>
+ app.set('view engine', 'pug');<% } %>
+ app.use(shrinkRay());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
app.use(methodOverride());
- app.use(cookieParser());<% if (filters.auth) { %>
+ app.use(cookieParser());<% if(filters.auth) { %>
app.use(passport.initialize());<% } %>
<% if(!filters.noModels) { %>
@@ -63,7 +60,7 @@ export default function(app) {
app.use(session({
secret: config.secrets.session,
saveUninitialized: true,
- resave: false<% if (filters.mongoose) { %>,
+ resave: false<% if(filters.mongoose) { %>,
store: new MongoStore({
mongooseConnection: mongoose.connection,
db: '<%= lodash.slugify(lodash.humanize(appname)) %>'
@@ -75,7 +72,7 @@ export default function(app) {
* Lusca - express server security
* https://github.com/krakenjs/lusca
*/
- if (env !== 'test' && !process.env.SAUCE_USERNAME) {
+ if(env !== 'test' && !process.env.SAUCE_USERNAME) {
app.use(lusca({
csrf: {
angular: true
@@ -90,12 +87,14 @@ export default function(app) {
}));
}<% } %>
- if ('development' === env) {
+ if(env === 'development') {
const webpackDevMiddleware = require('webpack-dev-middleware');
+ const stripAnsi = require('strip-ansi');
const webpack = require('webpack');
const makeWebpackConfig = require('../../webpack.make');
const webpackConfig = makeWebpackConfig({ DEV: true });
const compiler = webpack(webpackConfig);
+ const browserSync = require('browser-sync').create();
/**
* Run Browsersync and use middleware for Hot Module Replacement
@@ -125,10 +124,10 @@ export default function(app) {
*/
compiler.plugin('done', function (stats) {
console.log('webpack done hook');
- if (stats.hasErrors() || stats.hasWarnings()) {
+ if(stats.hasErrors() || stats.hasWarnings()) {
return browserSync.sockets.emit('fullscreen:message', {
title: "Webpack Error:",
- body: stripAnsi(stats.toString()),
+ body: stripAnsi(stats.toString()),
timeout: 100000
});
}
@@ -136,7 +135,7 @@ export default function(app) {
});
}
- if ('development' === env || 'test' === env) {
+ if(env === 'development' || env === 'test') {
app.use(errorHandler()); // Error handler - has to be last
}
}
diff --git a/templates/app/server/config/seed(models).js b/templates/app/server/config/seed(models).js
index 07d9d52b8..627aa5a36 100644
--- a/templates/app/server/config/seed(models).js
+++ b/templates/app/server/config/seed(models).js
@@ -19,31 +19,31 @@ var User = sqldb.User;<% } %><% } %>
<% if (filters.mongooseModels) { %>Thing.create({<% }
if (filters.sequelizeModels) { %>Thing.bulkCreate([{<% } %>
name: 'Development Tools',
- info: 'Integration with popular tools such as Webpack, Gulp, Babel, TypeScript, Karma, ' +
- 'Mocha, ESLint, Node Inspector, Livereload, Protractor, Pug, ' +
- 'Stylus, Sass, and Less.'
+ info: 'Integration with popular tools such as Webpack, Gulp, Babel, TypeScript, Karma, '
+ + 'Mocha, ESLint, Node Inspector, Livereload, Protractor, Pug, '
+ + 'Stylus, Sass, and Less.'
}, {
name: 'Server and Client integration',
- info: 'Built with a powerful and fun stack: MongoDB, Express, ' +
- 'AngularJS, and Node.'
+ 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'
+ 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'
+ 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.'
+ 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'
+ info: 'Easily deploy your app to Heroku or Openshift with the heroku '
+ + 'and openshift subgenerators'
<% if (filters.mongooseModels) { %>});<% }
if (filters.sequelizeModels) { %>}]);<% } %>
});
diff --git a/templates/app/server/config/socketio(socketio).js b/templates/app/server/config/socketio(socketio).js
index db5730912..367677f82 100644
--- a/templates/app/server/config/socketio(socketio).js
+++ b/templates/app/server/config/socketio(socketio).js
@@ -3,11 +3,10 @@
*/
'use strict';
-import config from './environment';
+// import config from './environment';
// When the user disconnects.. perform this
-function onDisconnect(socket) {
-}
+function onDisconnect(/*socket*/) {}
// When the user connects.. perform this
function onConnect(socket) {
@@ -37,8 +36,7 @@ export default function(socketio) {
// }));
socketio.on('connection', function(socket) {
- socket.address = socket.request.connection.remoteAddress +
- ':' + socket.request.connection.remotePort;
+ socket.address = `${socket.request.connection.remoteAddress}:${socket.request.connection.remotePort}`;
socket.connectedAt = new Date();
diff --git a/templates/app/server/views/404(jade).jade b/templates/app/server/views/404(pug).pug
similarity index 100%
rename from templates/app/server/views/404(jade).jade
rename to templates/app/server/views/404(pug).pug
diff --git a/templates/app/typings(ts).json b/templates/app/typings(ts).json
index 6ec1e1e7a..efb332ec4 100644
--- a/templates/app/typings(ts).json
+++ b/templates/app/typings(ts).json
@@ -10,15 +10,15 @@
"webpack": "github:DefinitelyTyped/DefinitelyTyped/webpack/webpack.d.ts#95c02169ba8fa58ac1092422efbd2e3174a206f4"
},
"ambientDevDependencies": {
- "angular-protractor": "github:DefinitelyTyped/DefinitelyTyped/angular-protractor/angular-protractor.d.ts#40c60850ad6c8175a62d5ab48c4e016ea5b3dffe",
"selenium-webdriver": "github:DefinitelyTyped/DefinitelyTyped/selenium-webdriver/selenium-webdriver.d.ts#40c60850ad6c8175a62d5ab48c4e016ea5b3dffe",
<%_ if(filters.mocha) { _%>
"mocha": "github:DefinitelyTyped/DefinitelyTyped/mocha/mocha.d.ts#40c60850ad6c8175a62d5ab48c4e016ea5b3dffe",
"chai": "github:DefinitelyTyped/DefinitelyTyped/chai/chai.d.ts#40c60850ad6c8175a62d5ab48c4e016ea5b3dffe",
"assertion-error": "github:DefinitelyTyped/DefinitelyTyped/assertion-error/assertion-error.d.ts#40c60850ad6c8175a62d5ab48c4e016ea5b3dffe",
"sinon": "github:DefinitelyTyped/DefinitelyTyped/sinon/sinon.d.ts#40c60850ad6c8175a62d5ab48c4e016ea5b3dffe",
- "sinon-chai": "github:DefinitelyTyped/DefinitelyTyped/sinon-chai/sinon-chai.d.ts#40c60850ad6c8175a62d5ab48c4e016ea5b3dffe"<% } %>
+ "sinon-chai": "github:DefinitelyTyped/DefinitelyTyped/sinon-chai/sinon-chai.d.ts#40c60850ad6c8175a62d5ab48c4e016ea5b3dffe",<% } %>
<%_ if(filters.jasmine) { _%>
- "jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#40c60850ad6c8175a62d5ab48c4e016ea5b3dffe"<% } %>
+ "jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#40c60850ad6c8175a62d5ab48c4e016ea5b3dffe",<% } %>
+ "selenium-webdriver": "github:DefinitelyTyped/DefinitelyTyped/selenium-webdriver/selenium-webdriver.d.ts#40c60850ad6c8175a62d5ab48c4e016ea5b3dffe"
}
}
diff --git a/templates/app/webpack.make.js b/templates/app/webpack.make.js
index 393e4c961..6c04a7449 100644
--- a/templates/app/webpack.make.js
+++ b/templates/app/webpack.make.js
@@ -49,8 +49,10 @@ module.exports = function makeWebpackConfig(options) {
<%_ if(filters.ngroute) { _%>
'angular-route',<% } %>
'angular-sanitize',
- 'angular-socket-io',
- 'angular-ui-bootstrap',
+ <%_ if(filters.socketio) { _%>
+ 'angular-socket-io',<% } %>
+ <%_ if(filters.uibootstrap) { -%>
+ 'angular-ui-bootstrap',<% } %>
<%_ if(filters.uirouter) { _%>
'angular-ui-router',<% } %>
'lodash'
@@ -182,7 +184,7 @@ module.exports = function makeWebpackConfig(options) {
test: /\.(png|jpg|jpeg|gif|svg|woff|woff2|ttf|eot)([\?]?.*)$/,
loader: 'file'
}, {
- <%_ if(filters.jade) { _%>
+ <%_ if(filters.pug) { _%>
// Pug HTML LOADER
// Reference: https://github.com/willyelm/pug-html-loader
// Allow loading Pug throw js
diff --git a/templates/docker/_Dockerfile b/templates/docker/_Dockerfile
new file mode 100644
index 000000000..89837b8e6
--- /dev/null
+++ b/templates/docker/_Dockerfile
@@ -0,0 +1,2 @@
+FROM generatorangularfullstack/angular-fullstack-dist:<%= rootGeneratorVersion() %>
+
diff --git a/templates/endpoint/basename.controller.js b/templates/endpoint/basename.controller.js
index 364879ecf..63279b423 100644
--- a/templates/endpoint/basename.controller.js
+++ b/templates/endpoint/basename.controller.js
@@ -101,7 +101,7 @@ export function upsert(req, res) {
delete req.body._id;
}
<%_ if(filters.mongooseModels) { -%>
- return <%= classedName %>.findOneAndUpdate(req.params.id, req.body, {upsert: true, setDefaultsOnInsert: true, runValidators: true}).exec()<% } %>
+ return <%= classedName %>.findOneAndUpdate({_id: req.params.id}, req.body, {upsert: true, setDefaultsOnInsert: true, runValidators: true}).exec()<% } %>
<%_ if(filters.sequelizeModels) { -%>
return <%= classedName %>.upsert(req.body, {
where: {
diff --git a/test/fixtures/.yo-rc.json b/test/fixtures/.yo-rc.json
index b6bc72cce..ca971c119 100644
--- a/test/fixtures/.yo-rc.json
+++ b/test/fixtures/.yo-rc.json
@@ -46,7 +46,8 @@
"expect",
"should",
"uirouter",
- "es6"
+ "es6",
+ "webpack"
],
"extensions": [
"babel",