Skip to content

Commit

Permalink
putting the project on github
Browse files Browse the repository at this point in the history
  • Loading branch information
Thibault de Lambilly committed Mar 31, 2017
1 parent 116873d commit e9d01e0
Show file tree
Hide file tree
Showing 82 changed files with 3,981 additions and 0 deletions.
3 changes: 3 additions & 0 deletions front/.bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory": "bower_components"
}
13 changes: 13 additions & 0 deletions front/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
6 changes: 6 additions & 0 deletions front/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules/
bower_components/
.sass-cache/
.idea/
.tmp/
dist/
17 changes: 17 additions & 0 deletions front/.jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"strict": true,
"bitwise": true,
"curly": true,
"eqeqeq": true,
"latedef": false,
"noarg": true,
"undef": true,
"unused": true,
"validthis": true,
"jasmine": true,
"globals": {
"angular": false,
"inject": false,
"module": false
}
}
70 changes: 70 additions & 0 deletions front/.yo-rc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"generator-gulp-angular": {
"version": "0.12.1",
"props": {
"angularVersion": "~1.4.0",
"angularModules": [
{
"key": "animate",
"module": "ngAnimate"
},
{
"key": "cookies",
"module": "ngCookies"
},
{
"key": "touch",
"module": "ngTouch"
},
{
"key": "sanitize",
"module": "ngSanitize"
}
],
"jQuery": {
"key": "jquery2"
},
"resource": {
"key": "angular-resource",
"module": "ngResource"
},
"router": {
"key": "angular-route",
"module": "ngRoute"
},
"ui": {
"key": "bootstrap",
"module": null
},
"bootstrapComponents": {
"key": "none",
"module": null
},
"cssPreprocessor": {
"key": "less",
"extension": "less"
},
"jsPreprocessor": {
"key": "none",
"extension": "js",
"srcExtension": "js"
},
"htmlPreprocessor": {
"key": "none",
"extension": "html"
},
"foundationComponents": {
"name": null,
"version": null,
"key": null,
"module": null
},
"paths": {
"src": "src",
"dist": "dist",
"e2e": "e2e",
"tmp": ".tmp"
}
}
}
}
30 changes: 30 additions & 0 deletions front/bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "loanWizard",
"version": "0.0.0",
"dependencies": {
"angular-animate": "~1.4.0",
"angular-cookies": "~1.4.0",
"angular-touch": "~1.4.0",
"angular-sanitize": "~1.4.0",
"jquery": "~2.1.4",
"angular-resource": "~1.4.0",
"angular-route": "~1.4.0",
"bootstrap": "~3.3.4",
"malarkey": "yuanqing/malarkey#~1.3.0",
"toastr": "~2.1.1",
"moment": "~2.10.3",
"animate.css": "~3.3.0",
"angular": "~1.4.0",
"Chart.js": "~1.0.2",
"eonasdan-bootstrap-datetimepicker": "~4.14.30",
"loaders.css": "0.1.0",
"underscore": "~1.8.3"
},
"devDependencies": {
"angular-mocks": "~1.4.0"
},
"resolutions": {
"jquery": "~2.1.4",
"angular": "~1.4.0"
}
}
10 changes: 10 additions & 0 deletions front/e2e/.jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "../.jshintrc",
"globals": {
"browser": false,
"element": false,
"by": false,
"$": false,
"$$": false
}
}
15 changes: 15 additions & 0 deletions front/e2e/main.po.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* This file uses the Page Object pattern to define the main page for tests
* https://docs.google.com/presentation/d/1B6manhG0zEXkC-H-tPo2vwU06JhL8w9-XCF9oehXzAQ
*/

'use strict';

var MainPage = function() {
this.jumbEl = element(by.css('.jumbotron'));
this.h1El = this.jumbEl.element(by.css('h1'));
this.imgEl = this.jumbEl.element(by.css('img'));
this.thumbnailEls = element(by.css('body')).all(by.repeater('awesomeThing in main.awesomeThings'));
};

module.exports = new MainPage();
21 changes: 21 additions & 0 deletions front/e2e/main.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'use strict';

describe('The main view', function () {
var page;

beforeEach(function () {
browser.get('/index.html');
page = require('./main.po');
});

it('should include jumbotron with correct data', function() {
expect(page.h1El.getText()).toBe('\'Allo, \'Allo!');
expect(page.imgEl.getAttribute('src')).toMatch(/assets\/images\/yeoman.png$/);
expect(page.imgEl.getAttribute('alt')).toBe('I\'m Yeoman');
});

it('should list more than 5 awesome things', function () {
expect(page.thumbnailEls.count()).toBeGreaterThan(5);
});

});
4 changes: 4 additions & 0 deletions front/gulp/.jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "../.jshintrc",
"node": true
}
94 changes: 94 additions & 0 deletions front/gulp/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
'use strict';

var path = require('path');
var gulp = require('gulp');
var conf = require('./conf');

var $ = require('gulp-load-plugins')({
pattern: ['gulp-*', 'main-bower-files', 'uglify-save-license', 'del']
});

gulp.task('partials', function () {
return gulp.src([
path.join(conf.paths.src, '/app/**/*.html'),
path.join(conf.paths.tmp, '/serve/app/**/*.html')
])
.pipe($.minifyHtml({
empty: true,
spare: true,
quotes: true
}))
.pipe($.angularTemplatecache('templateCacheHtml.js', {
module: 'loanWizard',
root: 'app'
}))
.pipe(gulp.dest(conf.paths.tmp + '/partials/'));
});

gulp.task('html', ['inject', 'partials'], function () {
var partialsInjectFile = gulp.src(path.join(conf.paths.tmp, '/partials/templateCacheHtml.js'), { read: false });
var partialsInjectOptions = {
starttag: '<!-- inject:partials -->',
ignorePath: path.join(conf.paths.tmp, '/partials'),
addRootSlash: false
};

var htmlFilter = $.filter('*.html');
var jsFilter = $.filter('**/*.js');
var cssFilter = $.filter('**/*.css');
var assets;

return gulp.src(path.join(conf.paths.tmp, '/serve/*.html'))
.pipe($.inject(partialsInjectFile, partialsInjectOptions))
.pipe(assets = $.useref.assets())
.pipe($.rev())
.pipe(jsFilter)
.pipe($.ngAnnotate())
.pipe($.uglify({ preserveComments: $.uglifySaveLicense })).on('error', conf.errorHandler('Uglify'))
.pipe(jsFilter.restore())
.pipe(cssFilter)
.pipe($.replace('../../bower_components/bootstrap/fonts/', '../fonts/'))
.pipe($.csso())
.pipe(cssFilter.restore())
.pipe(assets.restore())
.pipe($.useref())
.pipe($.revReplace())
.pipe(htmlFilter)
.pipe($.minifyHtml({
empty: true,
spare: true,
quotes: true,
conditionals: true
}))
.pipe(htmlFilter.restore())
.pipe(gulp.dest(path.join(conf.paths.dist, '/')))
.pipe($.size({ title: path.join(conf.paths.dist, '/'), showFiles: true }));
});

// Only applies for fonts from bower dependencies
// Custom fonts are handled by the "other" task
gulp.task('fonts', function () {
return gulp.src($.mainBowerFiles())
.pipe($.filter('**/*.{eot,svg,ttf,woff,woff2}'))
.pipe($.flatten())
.pipe(gulp.dest(path.join(conf.paths.dist, '/fonts/')));
});

gulp.task('other', function () {
var fileFilter = $.filter(function (file) {
return file.stat.isFile();
});

return gulp.src([
path.join(conf.paths.src, '/**/*'),
path.join('!' + conf.paths.src, '/**/*.{html,css,js,less}')
])
.pipe(fileFilter)
.pipe(gulp.dest(path.join(conf.paths.dist, '/')));
});

gulp.task('clean', function (done) {
$.del([path.join(conf.paths.dist, '/'), path.join(conf.paths.tmp, '/')], done);
});

gulp.task('build', ['html', 'fonts', 'other']);
41 changes: 41 additions & 0 deletions front/gulp/conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/**
* This file contains the variables used in other gulp files
* which defines tasks
* By design, we only put there very generic config values
* which are used in several places to keep good readability
* of the tasks
*/

var gutil = require('gulp-util');

/**
* The main paths of your project handle these with care
*/
exports.paths = {
src: 'src',
dist: 'dist',
tmp: '.tmp',
e2e: 'e2e'
};

/**
* Wiredep is the lib which inject bower dependencies in your project
* Mainly used to inject script tags in the index.html but also used
* to inject css preprocessor deps and js files in karma
*/
exports.wiredep = {
exclude: [/bootstrap.js$/, /bootstrap\.css/],
directory: 'bower_components'
};

/**
* Common implementation for an error handler of a Gulp plugin
*/
exports.errorHandler = function(title) {
'use strict';

return function(err) {
gutil.log(gutil.colors.red('[' + title + ']'), err.toString());
this.emit('end');
};
};
38 changes: 38 additions & 0 deletions front/gulp/e2e-tests.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
'use strict';

var path = require('path');
var gulp = require('gulp');
var conf = require('./conf');

var browserSync = require('browser-sync');

var $ = require('gulp-load-plugins')();

// Downloads the selenium webdriver
gulp.task('webdriver-update', $.protractor.webdriver_update);

gulp.task('webdriver-standalone', $.protractor.webdriver_standalone);

function runProtractor (done) {
var params = process.argv;
var args = params.length > 3 ? [params[3], params[4]] : [];

gulp.src(path.join(conf.paths.e2e, '/**/*.js'))
.pipe($.protractor.protractor({
configFile: 'protractor.conf.js',
args: args
}))
.on('error', function (err) {
// Make sure failed tests cause gulp to exit non-zero
throw err;
})
.on('end', function () {
// Close browser sync server
browserSync.exit();
done();
});
}

gulp.task('protractor', ['protractor:src']);
gulp.task('protractor:src', ['serve:e2e', 'webdriver-update'], runProtractor);
gulp.task('protractor:dist', ['serve:e2e-dist', 'webdriver-update'], runProtractor);
Loading

0 comments on commit e9d01e0

Please sign in to comment.