Commit d80953d7 authored by luxcem's avatar luxcem

Initial commit

parents
{
"directory": "bower_components"
}
# 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
node_modules/
bower_components/
.sass-cache/
.tmp/
dist/
{
"globalstrict": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 2,
"latedef": true,
"newcap": true,
"noarg": true,
"quotmark": "single",
"regexp": true,
"undef": true,
"unused": true,
"strict": true,
"trailing": true,
"smarttabs": true,
"white": true,
"validthis": true,
"globals": {
"angular": false,
// Angular Mocks
"inject": false,
"module": false,
// JASMINE
"describe": false,
"it": false,
"before": false,
"beforeEach": false,
"after": false,
"afterEach": false,
"expect": false
}
}
{
"generator-gulp-angular": {
"props": {
"angularVersion": "~1.3.4",
"angularModules": [
{
"key": "animate",
"module": "ngAnimate"
},
{
"key": "cookies",
"module": "ngCookies"
},
{
"key": "touch",
"module": "ngTouch"
},
{
"key": "sanitize",
"module": "ngSanitize"
}
],
"jQuery": {
"key": "jquery2"
},
"resource": {
"key": "none",
"module": null
},
"router": {
"key": "ui-router",
"module": "ui.router"
},
"ui": {
"key": "bootstrap",
"module": null,
"name": "bootstrap"
},
"bootstrapComponents": {
"key": "ui-bootstrap",
"module": "ui.bootstrap"
},
"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"
}
}
}
}
\ No newline at end of file
{
"name": "soussurveillance",
"version": "0.0.0",
"dependencies": {
"angular-animate": "~1.3.4",
"angular-cookies": "~1.3.4",
"angular-touch": "~1.3.4",
"angular-sanitize": "~1.3.4",
"jquery": "~2.1.1",
"angular-ui-router": "~0.2.13",
"bootstrap": "~3.3.1",
"angular-bootstrap": "~0.12.0",
"angular": "~1.3.4",
"angular-timer": "~1.3.1",
"underscore": "~1.8.2"
},
"devDependencies": {
"angular-mocks": "~1.3.4"
},
"resolutions": {
"jquery": "~2.1.1",
"angular": "~1.3.4"
}
}
{
"extends": "../.jshintrc",
"globals": {
"browser": false,
"element": false,
"by": false,
"$": false,
"$$": false
}
}
/**
* 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 awesomeThings'));
};
module.exports = new MainPage();
'use strict';
describe('The main view', function () {
var page;
beforeEach(function () {
browser.get('http://localhost:3000/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('list more than 5 awesome things', function () {
expect(page.thumbnailEls.count()).toBeGreaterThan(5);
});
});
{
"extends": "../.jshintrc",
"node": true
}
'use strict';
var gulp = require('gulp');
var $ = require('gulp-load-plugins')({
pattern: ['gulp-*', 'main-bower-files', 'uglify-save-license', 'del']
});
module.exports = function(options) {
gulp.task('partials', function () {
return gulp.src([
options.src + '/{app,components}/**/*.html',
options.tmp + '/serve/{app,components}/**/*.html'
])
.pipe($.minifyHtml({
empty: true,
spare: true,
quotes: true
}))
.pipe($.angularTemplatecache('templateCacheHtml.js', {
module: 'soussurveillance'
}))
.pipe(gulp.dest(options.tmp + '/partials/'));
});
gulp.task('html', ['inject', 'partials'], function () {
var partialsInjectFile = gulp.src(options.tmp + '/partials/templateCacheHtml.js', { read: false });
var partialsInjectOptions = {
starttag: '<!-- inject:partials -->',
ignorePath: options.tmp + '/partials',
addRootSlash: false
};
var htmlFilter = $.filter('*.html');
var jsFilter = $.filter('**/*.js');
var cssFilter = $.filter('**/*.css');
var assets;
return gulp.src(options.tmp + '/serve/*.html')
.pipe($.inject(partialsInjectFile, partialsInjectOptions))
.pipe(assets = $.useref.assets())
.pipe($.rev())
.pipe(jsFilter)
.pipe($.ngAnnotate())
.pipe($.uglify({ preserveComments: $.uglifySaveLicense })).on('error', options.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(options.dist + '/'))
.pipe($.size({ title: options.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(options.dist + '/fonts/'));
});
gulp.task('other', function () {
return gulp.src([
options.src + '/**/*',
'!' + options.src + '/**/*.{html,css,js,less}'
])
.pipe(gulp.dest(options.dist + '/'));
});
gulp.task('clean', function (done) {
$.del([options.dist + '/', options.tmp + '/'], done);
});
gulp.task('build', ['html', 'fonts', 'other']);
};
'use strict';
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var browserSync = require('browser-sync');
module.exports = function(options) {
// Downloads the selenium webdriver
gulp.task('webdriver-update', $.protractor.webdriver_update);
gulp.task('webdriver-standalone', $.protractor.webdriver_standalone);
function runProtractor (done) {
gulp.src(options.e2e + '/**/*.js')
.pipe($.protractor.protractor({
configFile: 'protractor.conf.js'
}))
.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);
};
'use strict';
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var wiredep = require('wiredep').stream;
module.exports = function(options) {
gulp.task('inject', ['scripts', 'styles'], function () {
var injectStyles = gulp.src([
options.tmp + '/serve/{app,components}/**/*.css',
'!' + options.tmp + '/serve/app/vendor.css'
], { read: false });
var injectScripts = gulp.src([
options.src + '/{app,components}/**/*.js',
'!' + options.src + '/{app,components}/**/*.spec.js',
'!' + options.src + '/{app,components}/**/*.mock.js'
])
.pipe($.angularFilesort()).on('error', options.errorHandler('AngularFilesort'));
var injectOptions = {
ignorePath: [options.src, options.tmp + '/serve'],
addRootSlash: false
};
var wiredepOptions = {
directory: 'bower_components',
exclude: [/bootstrap\.js/, /bootstrap\.css/]
};
return gulp.src(options.src + '/*.html')
.pipe($.inject(injectStyles, injectOptions))
.pipe($.inject(injectScripts, injectOptions))
.pipe(wiredep(wiredepOptions))
.pipe(gulp.dest(options.tmp + '/serve'));
});
};
/*jshint unused:false */
/***************
This file allow to configure a proxy system plugged into BrowserSync
in order to redirect backend requests while still serving and watching
files from the web project
IMPORTANT: The proxy is disabled by default.
If you want to enable it, watch at the configuration options and finally
change the `module.exports` at the end of the file
***************/
'use strict';
var httpProxy = require('http-proxy');
var chalk = require('chalk');
/*
* Location of your backend server
*/
var proxyTarget = 'http://server/context/';
var proxy = httpProxy.createProxyServer({
target: proxyTarget
});
proxy.on('error', function(error, req, res) {
res.writeHead(500, {
'Content-Type': 'text/plain'
});
console.error(chalk.red('[Proxy]'), error);
});
/*
* The proxy middleware is an Express middleware added to BrowserSync to
* handle backend request and proxy them to your backend.
*/
function proxyMiddleware(req, res, next) {
/*
* This test is the switch of each request to determine if the request is
* for a static file to be handled by BrowserSync or a backend request to proxy.
*
* The existing test is a standard check on the files extensions but it may fail
* for your needs. If you can, you could also check on a context in the url which
* may be more reliable but can't be generic.
*/
if (/\.(html|css|js|png|jpg|jpeg|gif|ico|xml|rss|txt|eot|svg|ttf|woff|woff2|cur)(\?((r|v|rel|rev)=[\-\.\w]*)?)?$/.test(req.url)) {
next();
} else {
proxy.web(req, res);
}
}
/*
* This is where you activate or not your proxy.
*
* The first line activate if and the second one ignored it
*/
//module.exports = [proxyMiddleware];
module.exports = function() {
return [];
};
'use strict';
var gulp = require('gulp');
var browserSync = require('browser-sync');
var $ = require('gulp-load-plugins')();
module.exports = function(options) {
gulp.task('scripts', function () {
return gulp.src(options.src + '/{app,components}/**/*.js')
.pipe($.jshint())
.pipe($.jshint.reporter('jshint-stylish'))
.pipe(browserSync.reload({ stream: true }))
.pipe($.size());
});
};
'use strict';
var gulp = require('gulp');
var browserSync = require('browser-sync');
var browserSyncSpa = require('browser-sync-spa');
var util = require('util');
var middleware = require('./proxy');
module.exports = function(options) {
function browserSyncInit(baseDir, browser) {
browser = browser === undefined ? 'default' : browser;
var routes = null;
if(baseDir === options.src || (util.isArray(baseDir) && baseDir.indexOf(options.src) !== -1)) {
routes = {
'/bower_components': 'bower_components'
};
}
var server = {
baseDir: baseDir,
routes: routes
};
if(middleware.length > 0) {
server.middleware = middleware;
}
browserSync.instance = browserSync.init({
startPath: '/',
server: server,
browser: browser
});
}
browserSync.use(browserSyncSpa({
selector: '[ng-app]'// Only needed for angular apps
}));
gulp.task('serve', ['watch'], function () {
browserSyncInit([options.tmp + '/serve', options.src]);
});
gulp.task('serve:dist', ['build'], function () {
browserSyncInit(options.dist);
});
gulp.task('serve:e2e', ['inject'], function () {
browserSyncInit([options.tmp + '/serve', options.src], []);
});
gulp.task('serve:e2e-dist', ['build'], function () {
browserSyncInit(options.dist, []);
});
};
'use strict';
var gulp = require('gulp');
var browserSync = require('browser-sync');
var $ = require('gulp-load-plugins')();
module.exports = function(options) {
gulp.task('styles', function () {
var lessOptions = {
options: [
'bower_components',
options.src + '/app',
options.src + '/components'
]
};
var injectFiles = gulp.src([
options.src + '/{app,components}/**/*.less',
'!' + options.src + '/app/index.less',
'!' + options.src + '/app/vendor.less'
], { read: false });
var injectOptions = {
transform: function(filePath) {
filePath = filePath.replace(options.src + '/app/', '');
filePath = filePath.replace(options.src + '/components/', '../components/');
return '@import \'' + filePath + '\';';
},
starttag: '// injector',
endtag: '// endinjector',
addRootSlash: false
};
var indexFilter = $.filter('index.less');
return gulp.src([
options.src + '/app/index.less',
options.src + '/app/vendor.less'
])
.pipe(indexFilter)
.pipe($.inject(injectFiles, injectOptions))
.pipe(indexFilter.restore())
.pipe($.sourcemaps.init())
.pipe($.less(lessOptions)).on('error', options.errorHandler('Less'))
.pipe($.autoprefixer()).on('error', options.errorHandler('Autoprefixer'))
.pipe($.sourcemaps.write())
.pipe(gulp.dest(options.tmp + '/serve/app/'))
.pipe(browserSync.reload({ stream: true }));
});
};
'use strict';
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var wiredep = require('wiredep');
var karma = require('karma');
var concat = require('concat-stream');
var _ = require('lodash');
module.exports = function(options) {
function listFiles(callback) {
var bowerDeps = wiredep({
directory: 'bower_components',
exclude: [/bootstrap\.js/, /bootstrap\.css/],
dependencies: true,
devDependencies: true
});
var specFiles = [
options.src + '/**/*.spec.js',
options.src + '/**/*.mock.js'
];
var htmlFiles = [
options.src + '/**/*.html'
];
var srcFiles = [
options.src + '/{app,components}/**/*.js'
].concat(specFiles.map(function(file) {
return '!' + file;
}));
gulp.src(srcFiles)
.pipe(concat(function(files) {
callback(bowerDeps.js
.concat(_.pluck(files, 'path'))
.concat(htmlFiles)
.concat(specFiles));
}));
}
function runTests (singleRun, done) {
listFiles(function(files) {
karma.server.start({
configFile: __dirname + '/../karma.conf.js',
files: files,
singleRun: singleRun
}, done);
});
}
gulp.task('test', ['scripts'], function(done) {
runTests(true, done);
});
gulp.task('test:auto', ['watch'], function(done) {
runTests(false, done);
});
};
'use strict';
var gulp = require('gulp');
var browserSync = require('browser-sync');
function isOnlyChange(event) {
return event.type === 'changed';
}
module.exports = function(options) {
gulp.task('watch', ['inject'], function () {
gulp.watch([options.src + '/*.html', 'bower.json'], ['inject']);
gulp.watch([
options.src + '/{app,components}/**/*.css',
options.src + '/{app,components}/**/*.less'
], function(event) {
if(isOnlyChange(event)) {
gulp.start('styles');
} else {
gulp.start('inject');
}
});
gulp.watch(options.src + '/{app,components}/**/*.js', function(event) {
if(isOnlyChange(event)) {
gulp.start('scripts');
} else {
gulp.start('inject');
}
});
gulp.watch(options.src + '/{app,components}/**/*.html', function(event) {
browserSync.reload(event.path);
});
});
};
'use strict';
var gulp = require('gulp');
var gutil = require('gulp-util');
var _ = require('lodash');
var wrench = require('wrench');
var options = {
src: 'src',
dist: 'dist',
tmp: '.tmp',
e2e: 'e2e',
errorHandler: function(title) {
return function(err) {
gutil.log(gutil.colors.red('[' + title + ']'), err.toString());
this.emit('end');
};
}
};
wrench.readdirSyncRecursive('./gulp').filter(function(file) {
return (/\.(js|coffee)$/i).test(file);
}).map(function(file) {
require('./gulp/' + file)(options);
});
gulp.task('default', ['clean'], function () {
gulp.start('build');
});
'use strict';
module.exports = function(config) {
var configuration = {
autoWatch : false,
frameworks: ['jasmine'],
ngHtml2JsPreprocessor: {
stripPrefix: 'src/',
moduleName: 'gulpAngular'