Skip to content

Commit c3a395c

Browse files
committed
generate application using yeoman
0 parents  commit c3a395c

40 files changed

+1104
-0
lines changed

.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+
}

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules/
2+
bower_components/
3+
.sass-cache/
4+
.tmp/
5+
dist/

.jshintrc

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"node": true,
3+
"esnext": true,
4+
"bitwise": true,
5+
"camelcase": true,
6+
"curly": true,
7+
"eqeqeq": true,
8+
"immed": true,
9+
"indent": 2,
10+
"latedef": true,
11+
"newcap": true,
12+
"noarg": true,
13+
"quotmark": "single",
14+
"regexp": true,
15+
"undef": true,
16+
"unused": true,
17+
"strict": true,
18+
"trailing": true,
19+
"smarttabs": true,
20+
"white": true,
21+
"validthis": true,
22+
"globals": {
23+
"angular": false,
24+
// Angular Mocks
25+
"inject": false,
26+
// JASMINE
27+
"describe": false,
28+
"it": false,
29+
"before": false,
30+
"beforeEach": false,
31+
"after": false,
32+
"afterEach": false,
33+
"expect": false
34+
}
35+
}

.yo-rc.json

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
{
2+
"generator-gulp-angular": {
3+
"props": {
4+
"paths": {
5+
"src": "src",
6+
"dist": "dist",
7+
"e2e": "e2e",
8+
"tmp": ".tmp"
9+
},
10+
"angularVersion": "~1.3.4",
11+
"angularModules": [
12+
{
13+
"name": "angular-animate",
14+
"module": "ngAnimate"
15+
},
16+
{
17+
"name": "angular-cookies",
18+
"module": "ngCookies"
19+
},
20+
{
21+
"name": "angular-touch",
22+
"module": "ngTouch"
23+
},
24+
{
25+
"name": "angular-sanitize",
26+
"module": "ngSanitize"
27+
}
28+
],
29+
"jQuery": {
30+
"name": "jquery",
31+
"version": "~2.1.1"
32+
},
33+
"resource": {
34+
"name": null,
35+
"version": null,
36+
"module": null
37+
},
38+
"router": {
39+
"name": "angular-ui-router",
40+
"version": "~0.2.13",
41+
"module": "ui.router"
42+
},
43+
"ui": {
44+
"name": "angular-material",
45+
"version": "~0.5.1",
46+
"key": "angular-material",
47+
"module": "ngMaterial"
48+
},
49+
"cssPreprocessor": {
50+
"key": "ruby-sass",
51+
"extension": "scss",
52+
"module": "gulp-ruby-sass",
53+
"version": "~0.7.1"
54+
},
55+
"jsPreprocessor": {
56+
"key": "none",
57+
"extension": "js",
58+
"srcExtension": "js",
59+
"module": null,
60+
"version": null
61+
},
62+
"htmlPreprocessor": {
63+
"key": "none",
64+
"extension": "html",
65+
"module": null,
66+
"version": null
67+
},
68+
"bootstrapComponents": {
69+
"name": null,
70+
"version": null,
71+
"key": null,
72+
"module": null
73+
},
74+
"foundationComponents": {
75+
"name": null,
76+
"version": null,
77+
"key": null,
78+
"module": null
79+
}
80+
}
81+
}
82+
}

bower.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "angularMaterialAdmin",
3+
"version": "0.0.0",
4+
"dependencies": {
5+
"jquery": "~2.1.1",
6+
"angular-animate": "~1.3.4",
7+
"angular-cookies": "~1.3.4",
8+
"angular-touch": "~1.3.4",
9+
"angular-sanitize": "~1.3.4",
10+
"angular-ui-router": "~0.2.13",
11+
"angular-material": "~0.5.1",
12+
"angular": "~1.3.4"
13+
},
14+
"devDependencies": {
15+
"angular-mocks": "~1.3.4"
16+
},
17+
"resolutions": {
18+
"jquery": "~2.1.1",
19+
"angular": "~1.3.4"
20+
}
21+
}

e2e/main.po.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/**
2+
* This file uses the Page Object pattern to define the main page for tests
3+
* https://docs.google.com/presentation/d/1B6manhG0zEXkC-H-tPo2vwU06JhL8w9-XCF9oehXzAQ
4+
*/
5+
6+
'use strict';
7+
8+
var MainPage = function() {
9+
this.jumbEl = element(by.css('.jumbotron'));
10+
this.h1El = this.jumbEl.element(by.css('h1'));
11+
this.imgEl = this.jumbEl.element(by.css('img'));
12+
this.thumbnailEls = element(by.css('body')).all(by.repeater('awesomeThing in awesomeThings'));
13+
};
14+
15+
module.exports = new MainPage();

e2e/main.spec.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
'use strict';
2+
3+
describe('The main view', function () {
4+
var page;
5+
6+
beforeEach(function () {
7+
browser.get('http://localhost:3000/index.html');
8+
page = require('./main.po');
9+
});
10+
11+
it('should include jumbotron with correct data', function() {
12+
expect(page.h1El.getText()).toBe('\'Allo, \'Allo!');
13+
expect(page.imgEl.getAttribute('src')).toMatch(/assets\/images\/yeoman.png$/);
14+
expect(page.imgEl.getAttribute('alt')).toBe('I\'m Yeoman');
15+
});
16+
17+
it('list more than 5 awesome things', function () {
18+
expect(page.thumbnailEls.count()).toBeGreaterThan(5);
19+
});
20+
21+
});

gulp/build.js

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
'use strict';
2+
3+
var gulp = require('gulp');
4+
5+
var paths = gulp.paths;
6+
7+
var $ = require('gulp-load-plugins')({
8+
pattern: ['gulp-*', 'main-bower-files', 'uglify-save-license', 'del']
9+
});
10+
11+
gulp.task('partials', function () {
12+
return gulp.src([
13+
paths.src + '/{app,components}/**/*.html',
14+
paths.tmp + '/{app,components}/**/*.html'
15+
])
16+
.pipe($.minifyHtml({
17+
empty: true,
18+
spare: true,
19+
quotes: true
20+
}))
21+
.pipe($.angularTemplatecache('templateCacheHtml.js', {
22+
module: 'angularMaterialAdmin'
23+
}))
24+
.pipe(gulp.dest(paths.tmp + '/partials/'));
25+
});
26+
27+
gulp.task('html', ['inject', 'partials'], function () {
28+
var partialsInjectFile = gulp.src(paths.tmp + '/partials/templateCacheHtml.js', { read: false });
29+
var partialsInjectOptions = {
30+
starttag: '<!-- inject:partials -->',
31+
ignorePath: paths.tmp + '/partials',
32+
addRootSlash: false
33+
};
34+
35+
var htmlFilter = $.filter('*.html');
36+
var jsFilter = $.filter('**/*.js');
37+
var cssFilter = $.filter('**/*.css');
38+
var assets;
39+
40+
return gulp.src(paths.tmp + '/serve/*.html')
41+
.pipe($.inject(partialsInjectFile, partialsInjectOptions))
42+
.pipe(assets = $.useref.assets())
43+
.pipe($.rev())
44+
.pipe(jsFilter)
45+
.pipe($.ngAnnotate())
46+
.pipe($.uglify({preserveComments: $.uglifySaveLicense}))
47+
.pipe(jsFilter.restore())
48+
.pipe(cssFilter)
49+
.pipe($.csso())
50+
.pipe(cssFilter.restore())
51+
.pipe(assets.restore())
52+
.pipe($.useref())
53+
.pipe($.revReplace())
54+
.pipe(htmlFilter)
55+
.pipe($.minifyHtml({
56+
empty: true,
57+
spare: true,
58+
quotes: true
59+
}))
60+
.pipe(htmlFilter.restore())
61+
.pipe(gulp.dest(paths.dist + '/'))
62+
.pipe($.size({ title: paths.dist + '/', showFiles: true }));
63+
});
64+
65+
gulp.task('images', function () {
66+
return gulp.src(paths.src + '/assets/images/**/*')
67+
.pipe(gulp.dest(paths.dist + '/assets/images/'));
68+
});
69+
70+
gulp.task('fonts', function () {
71+
return gulp.src($.mainBowerFiles())
72+
.pipe($.filter('**/*.{eot,svg,ttf,woff}'))
73+
.pipe($.flatten())
74+
.pipe(gulp.dest(paths.dist + '/fonts/'));
75+
});
76+
77+
gulp.task('misc', function () {
78+
return gulp.src(paths.src + '/**/*.ico')
79+
.pipe(gulp.dest(paths.dist + '/'));
80+
});
81+
82+
gulp.task('clean', function (done) {
83+
$.del([paths.dist + '/', paths.tmp + '/'], done);
84+
});
85+
86+
gulp.task('build', ['html', 'images', 'fonts', 'misc']);

gulp/e2e-tests.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
'use strict';
2+
3+
var gulp = require('gulp');
4+
5+
var $ = require('gulp-load-plugins')();
6+
7+
var browserSync = require('browser-sync');
8+
9+
var paths = gulp.paths;
10+
11+
// Downloads the selenium webdriver
12+
gulp.task('webdriver-update', $.protractor.webdriver_update);
13+
14+
gulp.task('webdriver-standalone', $.protractor.webdriver_standalone);
15+
16+
function runProtractor (done) {
17+
18+
gulp.src(paths.e2e + '/**/*.js')
19+
.pipe($.protractor.protractor({
20+
configFile: 'protractor.conf.js',
21+
}))
22+
.on('error', function (err) {
23+
// Make sure failed tests cause gulp to exit non-zero
24+
throw err;
25+
})
26+
.on('end', function () {
27+
// Close browser sync server
28+
browserSync.exit();
29+
done();
30+
});
31+
}
32+
33+
gulp.task('protractor', ['protractor:src']);
34+
gulp.task('protractor:src', ['serve:e2e', 'webdriver-update'], runProtractor);
35+
gulp.task('protractor:dist', ['serve:e2e-dist', 'webdriver-update'], runProtractor);

gulp/inject.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
'use strict';
2+
3+
var gulp = require('gulp');
4+
5+
var paths = gulp.paths;
6+
7+
var $ = require('gulp-load-plugins')();
8+
9+
var wiredep = require('wiredep').stream;
10+
11+
gulp.task('inject', ['styles'], function () {
12+
13+
var injectStyles = gulp.src([
14+
paths.tmp + '/serve/{app,components}/**/*.css',
15+
'!' + paths.tmp + '/serve/app/vendor.css'
16+
], { read: false });
17+
18+
var injectScripts = gulp.src([
19+
paths.src + '/{app,components}/**/*.js',
20+
'!' + paths.src + '/{app,components}/**/*.spec.js',
21+
'!' + paths.src + '/{app,components}/**/*.mock.js'
22+
]).pipe($.angularFilesort());
23+
24+
var injectOptions = {
25+
ignorePath: [paths.src, paths.tmp + '/serve'],
26+
addRootSlash: false
27+
};
28+
29+
var wiredepOptions = {
30+
directory: 'bower_components',
31+
exclude: [/bootstrap\.css/, /foundation\.css/]
32+
};
33+
34+
return gulp.src(paths.src + '/*.html')
35+
.pipe($.inject(injectStyles, injectOptions))
36+
.pipe($.inject(injectScripts, injectOptions))
37+
.pipe(wiredep(wiredepOptions))
38+
.pipe(gulp.dest(paths.tmp + '/serve'));
39+
40+
});

0 commit comments

Comments
 (0)