Skip to content

Commit 16f928b

Browse files
committed
Merge branch 'master' into canary
2 parents 6079484 + 870058d commit 16f928b

File tree

12 files changed

+108
-28
lines changed

12 files changed

+108
-28
lines changed

Diff for: .gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ test/temp
44
demo
55
.idea
66
.DS_Store
7-
release.txt
7+
release.txt
8+
fixtures/bower.json
9+
fixtures/package.json

Diff for: .travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
language: node_js
22
node_js:
33
- '0.10'
4+
- '0.11'
45
before_install:
56
- gem update --system
67
- gem install sass --version "=3.3.7"
78
- npm install -g bower grunt-cli
8-
- cd test/fixtures && npm install && bower install && cd .. && cd ..
9-
services: mongodb
9+
services: mongodb

Diff for: Gruntfile.js

+56
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ var shell = require('shelljs');
66
var process = require('child_process');
77
var Q = require('q');
88
var helpers = require('yeoman-generator').test;
9+
var fs = require('fs-extra');
10+
var path = require('path');
911

1012
module.exports = function (grunt) {
1113
require('load-grunt-tasks')(grunt);
@@ -56,6 +58,17 @@ module.exports = function (grunt) {
5658
},
5759
all: ['Gruntfile.js', '*/index.js']
5860
},
61+
mochaTest: {
62+
test: {
63+
src: [
64+
'test/*.js'
65+
],
66+
options: {
67+
reporter: 'spec',
68+
timeout: 120000
69+
}
70+
}
71+
},
5972
clean: {
6073
demo: {
6174
files: [{
@@ -103,6 +116,7 @@ module.exports = function (grunt) {
103116
grunt.registerTask('generateDemo', 'generate demo', function () {
104117
var done = this.async();
105118

119+
shell.mkdir(grunt.config('config').demo);
106120
shell.cd(grunt.config('config').demo);
107121

108122
Q()
@@ -185,6 +199,48 @@ module.exports = function (grunt) {
185199
}
186200
});
187201

202+
grunt.registerTask('updateFixtures', 'updates package and bower fixtures', function() {
203+
var done = this.async();
204+
var packageJson = fs.readFileSync(path.resolve('app/templates/_package.json'), 'utf8');
205+
var bowerJson = fs.readFileSync(path.resolve('app/templates/_bower.json'), 'utf8');
206+
207+
// replace package name
208+
packageJson = packageJson.replace(/"name": "<%(.*)%>"/g, '"name": "tempApp"');
209+
packageJson = packageJson.replace(/<%(.*)%>/g, '');
210+
211+
// remove all ejs conditionals
212+
bowerJson = bowerJson.replace(/"name": "<%(.*)%>"/g, '"name": "tempApp"');
213+
bowerJson = bowerJson.replace(/<%(.*)%>/g, '');
214+
215+
// save files
216+
fs.writeFile(path.resolve(__dirname + '/test/fixtures/package.json'), packageJson, function() {
217+
fs.writeFile(path.resolve(__dirname + '/test/fixtures/bower.json'), bowerJson, function() {
218+
done();
219+
});
220+
});
221+
});
222+
223+
grunt.registerTask('installFixtures', 'install package and bower fixtures', function() {
224+
var done = this.async();
225+
226+
shell.cd('test/fixtures');
227+
grunt.log.ok('installing npm dependencies for generated app');
228+
process.exec('npm install --quiet', {cwd: '../fixtures'}, function (error, stdout, stderr) {
229+
230+
grunt.log.ok('installing bower dependencies for generated app');
231+
process.exec('bower install', {cwd: '../fixtures'}, function (error, stdout, stderr) {
232+
shell.cd('../../');
233+
done();
234+
})
235+
});
236+
});
237+
238+
grunt.registerTask('test', [
239+
'updateFixtures',
240+
'installFixtures',
241+
'mochaTest'
242+
]);
243+
188244
grunt.registerTask('demo', [
189245
'clean:demo',
190246
'generateDemo'

Diff for: app/templates/_package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"dependencies": {
66
"express": "~4.0.0",
77
"morgan": "~1.0.0",
8-
"body-parser": "~1.0.0",
8+
"body-parser": "~1.5.0",
99
"method-override": "~1.0.0",
10-
"static-favicon": "~1.0.1",
10+
"serve-favicon": "^2.0.1",
1111
"cookie-parser": "~1.0.1",
1212
"express-session": "~1.0.2",
1313
"errorhandler": "~1.0.0",

Diff for: app/templates/server/config/express.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
'use strict';
66

77
var express = require('express');
8-
var favicon = require('static-favicon');
8+
var favicon = require('serve-favicon');
99
var morgan = require('morgan');
1010
var compression = require('compression');
1111
var bodyParser = require('body-parser');

Diff for: contributing.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ See the [contributing docs](https://github.com/yeoman/yeoman/blob/master/contrib
44

55
Additionally for this generator:
66

7+
* Please submit PRs to the `canary` branch, it is the main development branch for this generator.
78
* When submitting an issue, please follow the [guidelines](https://github.com/yeoman/yeoman/blob/master/contributing.md#issue-submission). Especially important is to make sure Yeoman is up-to-date, and providing the command or commands that cause the issue.
89
* When submitting a PR, make sure that the commit messages match the [AngularJS conventions][commit-message-format] (see below).
910
* When submitting a bugfix, write a test that exposes the bug and fails before applying your fix. Submit the test alongside the fix.

Diff for: package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
"url": "git://github.com/DaftMonk/generator-angular-fullstack.git"
2424
},
2525
"scripts": {
26-
"test": "mocha"
26+
"test": "grunt test"
2727
},
2828
"dependencies": {
2929
"yeoman-generator": "~0.17.0",
3030
"chalk": "~0.4.0",
3131
"wiredep": "~0.4.2",
32-
"generator-ng-component": ">=0.0.4"
32+
"generator-ng-component": "~0.0.4"
3333
},
3434
"peerDependencies": {
3535
"yo": ">=1.2.0"
@@ -38,14 +38,15 @@
3838
"chai": "^1.9.1",
3939
"fs-extra": "^0.9.1",
4040
"grunt": "~0.4.1",
41+
"grunt-build-control": "DaftMonk/grunt-build-control",
4142
"grunt-contrib-clean": "^0.6.0",
4243
"grunt-contrib-jshint": "^0.10.0",
4344
"grunt-conventional-changelog": "~1.0.0",
44-
"grunt-build-control": "DaftMonk/grunt-build-control",
45+
"grunt-mocha-test": "^0.11.0",
4546
"grunt-release": "~0.6.0",
4647
"load-grunt-tasks": "~0.2.0",
4748
"marked": "~0.2.8",
48-
"mocha": "~1.14.0",
49+
"mocha": "~1.21.0",
4950
"q": "^1.0.1",
5051
"semver": "~2.2.1",
5152
"shelljs": "^0.3.0",

Diff for: readme.md

+4
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,10 @@ An example server component in `server/api`
384384

385385
See the [contributing docs](https://github.com/DaftMonk/generator-angular-fullstack/blob/master/contributing.md)
386386

387+
This project has 2 main branches: `master` and `canary`. The `master` branch is where the current stable code lives and should be used for production setups. The `canary` branch is the main development branch, this is where PRs should be submitted to (backport fixes may be applied to `master`).
388+
389+
By seperating the current stable code from the cutting-edge development we hope to provide a stable and efficient workflow for users and developers alike.
390+
387391
When submitting an issue, please follow the [guidelines](https://github.com/yeoman/yeoman/blob/master/contributing.md#issue-submission). Especially important is to make sure Yeoman is up-to-date, and providing the command or commands that cause the issue.
388392

389393
When submitting a PR, make sure that the commit messages match the [AngularJS conventions](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/).

Diff for: test/fixtures/.bowerrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"directory": "bower_components"
3+
}

Diff for: test/fixtures/bower.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"name": "fixtures",
2+
"name": "tempApp",
3+
"version": "0.0.0",
34
"dependencies": {
45
"angular": ">=1.2.*",
56
"json3": "~3.3.1",
67
"es5-shim": "~3.0.1",
78
"jquery": "~1.11.0",
89
"bootstrap-sass-official": "~3.1.1",
9-
"bootstrap-stylus": "latest",
1010
"bootstrap": "~3.1.1",
1111
"angular-resource": ">=1.2.*",
1212
"angular-cookies": ">=1.2.*",

Diff for: test/fixtures/package.json

+20-11
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
{
2-
"name": "fixtures",
2+
"name": "tempApp",
3+
"version": "0.0.0",
4+
"main": "server/app.js",
35
"dependencies": {
46
"express": "~4.0.0",
57
"morgan": "~1.0.0",
6-
"body-parser": "~1.0.0",
8+
"body-parser": "~1.5.0",
79
"method-override": "~1.0.0",
8-
"static-favicon": "~1.0.1",
10+
"serve-favicon": "^2.0.1",
911
"cookie-parser": "~1.0.1",
1012
"express-session": "~1.0.2",
1113
"errorhandler": "~1.0.0",
@@ -23,16 +25,16 @@
2325
"passport-google-oauth": "latest",
2426
"composable-middleware": "^0.3.0",
2527
"connect-mongo": "^0.4.1",
26-
"socket.io": "~1.0.6",
28+
"socket.io": "^1.0.6",
29+
"socket.io-client": "^1.0.6",
2730
"socketio-jwt": "^2.0.2"
2831
},
2932
"devDependencies": {
3033
"grunt": "~0.4.4",
3134
"grunt-autoprefixer": "~0.7.2",
32-
"grunt-bower-install": "~1.4.0",
35+
"grunt-wiredep": "~1.8.0",
3336
"grunt-concurrent": "~0.5.0",
3437
"grunt-contrib-clean": "~0.5.0",
35-
"grunt-contrib-compass": "~0.7.2",
3638
"grunt-contrib-concat": "~0.4.0",
3739
"grunt-contrib-copy": "~0.5.0",
3840
"grunt-contrib-cssmin": "~0.9.0",
@@ -44,10 +46,9 @@
4446
"grunt-contrib-coffee": "^0.10.1",
4547
"grunt-contrib-jade": "^0.11.0",
4648
"grunt-contrib-less": "^0.11.0",
47-
"grunt-contrib-stylus": "latest",
4849
"grunt-google-cdn": "~0.4.0",
4950
"grunt-newer": "~0.7.0",
50-
"grunt-ngmin": "~0.0.3",
51+
"grunt-ng-annotate": "^0.2.3",
5152
"grunt-rev": "~0.1.0",
5253
"grunt-svgmin": "~0.4.0",
5354
"grunt-usemin": "~2.1.1",
@@ -59,8 +60,10 @@
5960
"grunt-protractor-runner": "^1.1.0",
6061
"grunt-asset-injector": "^0.1.0",
6162
"grunt-karma": "~0.8.2",
63+
"grunt-build-control": "DaftMonk/grunt-build-control",
6264
"grunt-mocha-test": "~0.10.2",
6365
"grunt-contrib-sass": "^0.7.3",
66+
"grunt-contrib-stylus": "latest",
6467
"jit-grunt": "^0.5.0",
6568
"time-grunt": "~0.3.1",
6669
"grunt-express-server": "~0.4.17",
@@ -72,13 +75,13 @@
7275
"karma-firefox-launcher": "~0.1.3",
7376
"karma-script-launcher": "~0.1.0",
7477
"karma-html2js-preprocessor": "~0.1.0",
78+
"karma-ng-jade2js-preprocessor": "^0.1.2",
7579
"karma-jasmine": "~0.1.5",
7680
"karma-chrome-launcher": "~0.1.3",
7781
"requirejs": "~2.1.11",
7882
"karma-requirejs": "~0.2.1",
7983
"karma-coffee-preprocessor": "~0.2.1",
8084
"karma-jade-preprocessor": "0.0.11",
81-
"karma-ng-jade2js-preprocessor": "^0.1.2",
8285
"karma-phantomjs-launcher": "~0.1.4",
8386
"karma": "~0.12.9",
8487
"karma-ng-html2js-preprocessor": "~0.1.0",
@@ -87,5 +90,11 @@
8790
},
8891
"engines": {
8992
"node": ">=0.10.0"
90-
}
91-
}
93+
},
94+
"scripts": {
95+
"start": "node server/app.js",
96+
"test": "grunt test",
97+
"update-webdriver": "node node_modules/grunt-protractor-runner/node_modules/protractor/bin/webdriver-manager update"
98+
},
99+
"private": true
100+
}

Diff for: test/test-file-creation.js

+9-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe('angular-fullstack generator', function () {
1717
auth: true,
1818
oauth: [],
1919
socketio: true
20-
};
20+
}, dependenciesInstalled = false;
2121

2222
function generatorTest(generatorType, name, mockPrompt, callback) {
2323
gen.run({}, function () {
@@ -54,10 +54,12 @@ describe('angular-fullstack generator', function () {
5454
});
5555

5656
describe('running app', function() {
57+
;
5758
beforeEach(function() {
5859
this.timeout(20000);
59-
fs.copySync(__dirname + '/fixtures/node_modules', __dirname + '/temp/node_modules');
60-
fs.copySync(__dirname +'/fixtures/bower_components', __dirname +'/temp/client/bower_components');
60+
fs.mkdirSync(__dirname + '/temp/client');
61+
fs.symlinkSync(__dirname + '/fixtures/node_modules', __dirname + '/temp/node_modules');
62+
fs.symlinkSync(__dirname +'/fixtures/bower_components', __dirname +'/temp/client/bower_components');
6163
});
6264

6365
describe('with default options', function() {
@@ -178,7 +180,7 @@ describe('angular-fullstack generator', function () {
178180
});
179181

180182
describe('with other preprocessors and no server options', function() {
181-
beforeEach(function() {
183+
beforeEach(function(done) {
182184
helpers.mockPrompt(gen, {
183185
script: 'coffee',
184186
markup: 'jade',
@@ -189,6 +191,7 @@ describe('angular-fullstack generator', function () {
189191
oauth: [],
190192
socketio: false
191193
});
194+
done();
192195
});
193196

194197
it('should run client tests successfully', function(done) {
@@ -224,7 +227,7 @@ describe('angular-fullstack generator', function () {
224227
});
225228

226229
describe('with no preprocessors and no server options', function() {
227-
beforeEach(function() {
230+
beforeEach(function(done) {
228231
helpers.mockPrompt(gen, {
229232
script: 'js',
230233
markup: 'html',
@@ -235,6 +238,7 @@ describe('angular-fullstack generator', function () {
235238
oauth: [],
236239
socketio: false
237240
});
241+
done();
238242
});
239243

240244
it('should run client tests successfully', function(done) {

0 commit comments

Comments
 (0)