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

.gitignore

Lines changed: 3 additions & 1 deletion
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

.travis.yml

Lines changed: 2 additions & 2 deletions
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

Gruntfile.js

Lines changed: 56 additions & 0 deletions
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'

app/templates/_package.json

Lines changed: 2 additions & 2 deletions
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",

app/templates/server/config/express.js

Lines changed: 1 addition & 1 deletion
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');

contributing.md

Lines changed: 1 addition & 0 deletions
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.

package.json

Lines changed: 5 additions & 4 deletions
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",

readme.md

Lines changed: 4 additions & 0 deletions
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/).

test/fixtures/.bowerrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"directory": "bower_components"
3+
}

test/fixtures/bower.json

Lines changed: 2 additions & 2 deletions
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.*",

0 commit comments

Comments
 (0)