mirror of
https://github.com/arnaucube/commonroutesApp.git
synced 2026-02-07 11:36:42 +01:00
geolocation added on offerCar and travel page
This commit is contained in:
51
www/lib/ui-leaflet/grunt/aliases.coffee
Normal file
51
www/lib/ui-leaflet/grunt/aliases.coffee
Normal file
@@ -0,0 +1,51 @@
|
||||
module.exports =
|
||||
test:[ 'jshint', 'testunit', 'teste2e']
|
||||
|
||||
testunit: ['karma']
|
||||
|
||||
teste2e:[ 'shell:protractor_update', 'connect:testserver', 'protractor:run']
|
||||
|
||||
teste2efirefox:[ 'shell:protractor_update', 'connect:testserver', 'protractor:firefox']
|
||||
|
||||
testcoverage: ['karma']
|
||||
|
||||
coverage:['karma', 'open:coverage', 'connect:coverage']
|
||||
|
||||
install:[ 'shell:npm_install','bower:install','shell:protractor_update']
|
||||
|
||||
default:['build']
|
||||
|
||||
# cause zsh always puts me in grunt folder
|
||||
d:['default']
|
||||
|
||||
#force:on to keep failing specs from killing grunt
|
||||
dev:['force:on', 'connect:devserver', 'open:devserver', 'concurrent:dev' ]
|
||||
|
||||
#continuos running specs
|
||||
spec: [ 'fastbuild', 'concurrent:unit' ]
|
||||
|
||||
serve:['concurrent:watchServe']
|
||||
|
||||
s:['serve']
|
||||
|
||||
fastbuild:[ 'clean:dist', 'jshint' ,'babel', 'concat:dist', 'concat:distMapped', 'ngAnnotate']
|
||||
|
||||
dwatch:[ 'fastbuild', 'concurrent:unit' ]
|
||||
|
||||
build:[ 'fastbuild', 'uglify', 'testunit', 'concat:license', 'clean:pre' ]
|
||||
|
||||
travis:[ 'fastbuild', 'bower:install', 'testunit' ]
|
||||
|
||||
changelog: ['conventionalChangelog']
|
||||
|
||||
'bump@':[ 'bumponly', 'default', 'changelog', 'bumpcommit' ]
|
||||
|
||||
'bump@minor':[ 'bumponly:minor', 'default', 'changelog', 'bumpcommit' ]
|
||||
|
||||
'bump@major':[ 'bumponly:major', 'default', 'changelog', 'bumpcommit' ]
|
||||
#To Update examples for Viewer
|
||||
examples:[ 'shell:examples', 'concat:examples' ]
|
||||
|
||||
graph:['angular_architecture_graph']
|
||||
|
||||
website:['concurrent:website']
|
||||
11
www/lib/ui-leaflet/grunt/angular_architecture_graph.js
vendored
Normal file
11
www/lib/ui-leaflet/grunt/angular_architecture_graph.js
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function (grunt, options) {
|
||||
return {
|
||||
diagram: {
|
||||
files: {
|
||||
"dist/architecture": ["dist/<%= pkg.name %>.js"]
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
20
www/lib/ui-leaflet/grunt/babel.js
Normal file
20
www/lib/ui-leaflet/grunt/babel.js
Normal file
@@ -0,0 +1,20 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function (grunt, options) {
|
||||
return {
|
||||
options: {
|
||||
sourceMap: false,
|
||||
compact: false,
|
||||
presets: ['es2015']
|
||||
},
|
||||
dist: {
|
||||
files: [{
|
||||
expand: true,
|
||||
cwd: 'src',
|
||||
src: ['**/*.js'],
|
||||
dest: 'dist/src',
|
||||
ext: '.js'
|
||||
}]
|
||||
}
|
||||
};
|
||||
};
|
||||
12
www/lib/ui-leaflet/grunt/bower.js
Normal file
12
www/lib/ui-leaflet/grunt/bower.js
Normal file
@@ -0,0 +1,12 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function (grunt, options) {
|
||||
return {
|
||||
install: {
|
||||
// options: {
|
||||
// targetDir: './bower_components',
|
||||
// cleanup: true
|
||||
// }
|
||||
}
|
||||
};
|
||||
};
|
||||
30
www/lib/ui-leaflet/grunt/bump.js
Normal file
30
www/lib/ui-leaflet/grunt/bump.js
Normal file
@@ -0,0 +1,30 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function (grunt, options) {
|
||||
return {
|
||||
options: {
|
||||
files: ['package.json', 'bower.json'],
|
||||
updateConfigs: [],
|
||||
commit: true,
|
||||
commitMessage: 'Release v%VERSION%',
|
||||
commitFiles: [
|
||||
'CHANGELOG.md',
|
||||
'package.json',
|
||||
'bower.json',
|
||||
'dist/<%= pkg.name %>.js',
|
||||
'dist/<%= pkg.name %>.min.js',
|
||||
'dist/<%= pkg.name %>.min.no-header.js',
|
||||
'dist/<%= pkg.name %>.js',
|
||||
'dist/<%= pkg.name %>_dev_mapped.js',
|
||||
'dist/<%= pkg.name %>_dev_mapped.js.map',
|
||||
'dist/architecture/**/*'
|
||||
],
|
||||
createTag: true,
|
||||
tagName: 'v%VERSION%',
|
||||
tagMessage: 'Version %VERSION%',
|
||||
push: false,
|
||||
pushTo: 'origin',
|
||||
gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d'
|
||||
}
|
||||
};
|
||||
};
|
||||
9
www/lib/ui-leaflet/grunt/clean.js
Normal file
9
www/lib/ui-leaflet/grunt/clean.js
Normal file
@@ -0,0 +1,9 @@
|
||||
'use strict';
|
||||
var pkg = require('./pkg');
|
||||
|
||||
module.exports = function (grunt, options) {
|
||||
return {
|
||||
dist: ["dist/"],
|
||||
pre: ['dist/*.pre.js']
|
||||
};
|
||||
};
|
||||
54
www/lib/ui-leaflet/grunt/concat.js
Normal file
54
www/lib/ui-leaflet/grunt/concat.js
Normal file
@@ -0,0 +1,54 @@
|
||||
'use strict';
|
||||
|
||||
var concatDist, concatDistMapped = null;
|
||||
|
||||
concatDist = {
|
||||
options: {
|
||||
banner: require('./utils/banner') + "(function(angular){\n" + "'use strict';\n",
|
||||
footer: '\n}(angular));'
|
||||
},
|
||||
src: [
|
||||
'dist/src/directives/leaflet.js',
|
||||
'dist/src/services/*.js',
|
||||
'dist/src/**/*.js'
|
||||
|
||||
],
|
||||
dest: 'dist/<%= pkg.name %>.pre.js'
|
||||
};
|
||||
|
||||
concatDistMapped = _.clone(concatDist, true);
|
||||
concatDistMapped.options.sourceMap = true;
|
||||
concatDistMapped.options.sourceMapName = "dist/<%= pkg.name %>_dev_mapped.js.map";
|
||||
concatDistMapped.dest = "dist/<%= pkg.name %>_dev_mapped.js";
|
||||
|
||||
|
||||
module.exports = function (grunt, options) {
|
||||
return {
|
||||
dist: concatDist,
|
||||
distMapped: concatDistMapped,
|
||||
license: {
|
||||
src: [
|
||||
'src/header-MIT-license.txt',
|
||||
'dist/<%= pkg.name %>.min.no-header.js'
|
||||
],
|
||||
dest: 'dist/<%= pkg.name %>.min.js'
|
||||
},
|
||||
examples: {
|
||||
options: {
|
||||
banner: '(function(angular){ \nvar app = angular.module(\'webapp\');\n',
|
||||
footer: '}(angular));'
|
||||
},
|
||||
src: ['examples/js/controllers/*.js'],
|
||||
dest: 'examples/js/controllers.js'
|
||||
},
|
||||
website: {
|
||||
options: {
|
||||
//separator: ';',
|
||||
banner: '(function (angular) {\n',
|
||||
footer: '})(window.angular);'
|
||||
},
|
||||
src: ['website/src/js/app.js', 'website/src/js/**/*.js'],
|
||||
dest: 'website/dist/js/<%= pkg.name %>-webpage.js',
|
||||
}
|
||||
};
|
||||
};
|
||||
30
www/lib/ui-leaflet/grunt/concurrent.js
Normal file
30
www/lib/ui-leaflet/grunt/concurrent.js
Normal file
@@ -0,0 +1,30 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function (grunt, options) {
|
||||
return {
|
||||
watchServe: {
|
||||
tasks: ['watch:fast', 'connect:webserver'],
|
||||
options: {
|
||||
logConcurrentOutput: true
|
||||
}
|
||||
},
|
||||
unit: {
|
||||
tasks: ['karma', 'watch:unit'],
|
||||
options: {
|
||||
logConcurrentOutput: true
|
||||
}
|
||||
},
|
||||
dev: {
|
||||
tasks: ['karma', 'watch:unit', 'watch:source'],
|
||||
options: {
|
||||
logConcurrentOutput: true
|
||||
}
|
||||
},
|
||||
website: {
|
||||
tasks: ['concat:website', 'watch:website', 'connect:webserver'],
|
||||
options: {
|
||||
logConcurrentOutput: true
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
35
www/lib/ui-leaflet/grunt/connect.js
Normal file
35
www/lib/ui-leaflet/grunt/connect.js
Normal file
@@ -0,0 +1,35 @@
|
||||
'use strict';
|
||||
var getAvailPort = require('./utils/getAvailPort');
|
||||
var port = getAvailPort(8888);
|
||||
|
||||
module.exports = function (grunt, options) {
|
||||
return {
|
||||
options: {
|
||||
base: ''
|
||||
},
|
||||
webserver: {
|
||||
options: {
|
||||
port: port,
|
||||
keepalive: true
|
||||
}
|
||||
},
|
||||
devserver: {
|
||||
options: {
|
||||
port: 8888
|
||||
}
|
||||
},
|
||||
testserver: {
|
||||
options: {
|
||||
port: 9999
|
||||
}
|
||||
},
|
||||
coverage: {
|
||||
options: {
|
||||
base: 'coverage/',
|
||||
directory: 'coverage/',
|
||||
port: 5555,
|
||||
keepalive: true
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
33
www/lib/ui-leaflet/grunt/conventionalChangelog.js
Normal file
33
www/lib/ui-leaflet/grunt/conventionalChangelog.js
Normal file
@@ -0,0 +1,33 @@
|
||||
'use strict';
|
||||
var _pkg = require('../package.json');
|
||||
var argv = require('yargs').argv;
|
||||
|
||||
/*
|
||||
_pkg.nextVersion only works for patch updates
|
||||
|
||||
Using changelog in the workflow is not really recommended right now as changelog is not really able to be modified until
|
||||
a new tag is released.
|
||||
|
||||
Using Yargs as a workaround which grunt should be used in this way:
|
||||
|
||||
`grunt changelog --ui_leaflet_ver SOME_TAG_NUMBER`
|
||||
*/
|
||||
|
||||
module.exports = function (grunt, options) {
|
||||
console.log('version:', argv.ui_leaflet_ver || _pkg.version);
|
||||
return {
|
||||
options: {
|
||||
changelogOpts: {
|
||||
// conventional-changelog options go here
|
||||
preset: 'angular',
|
||||
releaseCount: 0
|
||||
},
|
||||
context: {
|
||||
currentTag: 'v' + (argv.ui_leaflet_ver || _pkg.version)
|
||||
}
|
||||
},
|
||||
release: {
|
||||
src: 'CHANGELOG.md'
|
||||
}
|
||||
};
|
||||
};
|
||||
11
www/lib/ui-leaflet/grunt/coveralls.js
Normal file
11
www/lib/ui-leaflet/grunt/coveralls.js
Normal file
@@ -0,0 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function (grunt, options) {
|
||||
// Options
|
||||
return {
|
||||
options: {
|
||||
debug: true,
|
||||
coverage_dir: 'coverage'
|
||||
}
|
||||
};
|
||||
};
|
||||
17
www/lib/ui-leaflet/grunt/jshint.js
Normal file
17
www/lib/ui-leaflet/grunt/jshint.js
Normal file
@@ -0,0 +1,17 @@
|
||||
'use strict';
|
||||
var fs = require('fs');
|
||||
|
||||
module.exports = function (grunt, options) {
|
||||
return {
|
||||
options: JSON.parse(fs.readFileSync('.jshintrc')),
|
||||
source: {
|
||||
src: ['src/directives/*.js', 'src/services/*.js', 'website/js/**/*.js']
|
||||
},
|
||||
tests: {
|
||||
src: ['test/unit/*.js', 'test/e2e/*.js']
|
||||
},
|
||||
grunt: {
|
||||
src: ['Gruntfile.js']
|
||||
}
|
||||
};
|
||||
};
|
||||
12
www/lib/ui-leaflet/grunt/ngAnnotate.js
Normal file
12
www/lib/ui-leaflet/grunt/ngAnnotate.js
Normal file
@@ -0,0 +1,12 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function ngAnnotate(grunt, options) {
|
||||
return {
|
||||
options: {},
|
||||
dist: {
|
||||
files: {
|
||||
'dist/<%= pkg.name %>.js': ['dist/<%= pkg.name %>.pre.js']
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
12
www/lib/ui-leaflet/grunt/open.js
Normal file
12
www/lib/ui-leaflet/grunt/open.js
Normal file
@@ -0,0 +1,12 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function (grunt, options) {
|
||||
return {
|
||||
devserver: {
|
||||
path: 'http://localhost:8888'
|
||||
},
|
||||
coverage: {
|
||||
path: 'http://localhost:5555'
|
||||
}
|
||||
};
|
||||
};
|
||||
13
www/lib/ui-leaflet/grunt/pkg.js
Normal file
13
www/lib/ui-leaflet/grunt/pkg.js
Normal file
@@ -0,0 +1,13 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function (grunt, options) {
|
||||
var pkgFunction = function () {
|
||||
return grunt.file.readJSON('package.json')
|
||||
};
|
||||
//THIS extension forces the banner or whatever uses pkgFunction to always get the latest version
|
||||
//where as pkg is only done once at grunt init.
|
||||
_.extend(options, {
|
||||
pkgFunction: pkgFunction
|
||||
});
|
||||
return pkgFunction();
|
||||
};
|
||||
23
www/lib/ui-leaflet/grunt/protractor.js
Normal file
23
www/lib/ui-leaflet/grunt/protractor.js
Normal file
@@ -0,0 +1,23 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function (grunt, options) {
|
||||
return {
|
||||
options: {
|
||||
keepAlive: false,
|
||||
configFile: 'test/protractor.conf.js',
|
||||
args: {
|
||||
specs: ['test/e2e/*.js']
|
||||
}
|
||||
},
|
||||
run: {},
|
||||
saucelabs: {
|
||||
options: {
|
||||
args: {
|
||||
baseUrl: "http://<%= pkg.org %>.github.io/<%= pkg.name %>/examples/",
|
||||
sauceUser: process.env.SAUCE_USERNAME,
|
||||
sauceKey: process.env.SAUCE_ACCESS_KEY
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
25
www/lib/ui-leaflet/grunt/shell.js
Normal file
25
www/lib/ui-leaflet/grunt/shell.js
Normal file
@@ -0,0 +1,25 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function (grunt, options) {
|
||||
return {
|
||||
options: {
|
||||
stdout: true
|
||||
},
|
||||
selenium: {
|
||||
command: 'node node_modules/protractor/bin/webdriver-manager start',
|
||||
options: {
|
||||
stdout: false,
|
||||
async: true
|
||||
}
|
||||
},
|
||||
protractor_update: {
|
||||
command: 'node node_modules/protractor/bin/webdriver-manager update'
|
||||
},
|
||||
npm_install: {
|
||||
command: 'npm install'
|
||||
},
|
||||
examples: {
|
||||
command: 'node generate-examples.js'
|
||||
}
|
||||
};
|
||||
};
|
||||
14
www/lib/ui-leaflet/grunt/uglify.js
Normal file
14
www/lib/ui-leaflet/grunt/uglify.js
Normal file
@@ -0,0 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function (grunt, options) {
|
||||
return {
|
||||
options: {
|
||||
banner: require('./utils/banner')
|
||||
},
|
||||
dist: {
|
||||
files: {
|
||||
'dist/<%= pkg.name %>.min.no-header.js': ['dist/<%= pkg.name %>.js']
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
6
www/lib/ui-leaflet/grunt/utils/banner.js
Normal file
6
www/lib/ui-leaflet/grunt/utils/banner.js
Normal file
@@ -0,0 +1,6 @@
|
||||
module.exports =
|
||||
'/*!\n' +
|
||||
'* <%= pkg.name %> <%= pkgFunction().version %> <%= grunt.template.today(\"yyyy-mm-dd\") %>\n' +
|
||||
'* <%= pkg.description %>\n' +
|
||||
'* <%= pkg.repository.type %>: <%= pkg.repository.url %>\n' +
|
||||
'*/\n'
|
||||
23
www/lib/ui-leaflet/grunt/utils/getAvailPort.js
Normal file
23
www/lib/ui-leaflet/grunt/utils/getAvailPort.js
Normal file
@@ -0,0 +1,23 @@
|
||||
var exec = require('shelljs').exec;
|
||||
|
||||
var isWin = /^win/.test(process.platform);
|
||||
|
||||
var isPortOpen = function (port) {
|
||||
var cmd;
|
||||
if (isWin)
|
||||
cmd = 'netstat -an | find /i ":' + port + '" | find /i "listening"';
|
||||
else
|
||||
cmd = 'lsof -i:' + port + " | tail -n 1 | awk '{print $2}'";
|
||||
var portResponse = exec(cmd, {
|
||||
silent: true
|
||||
}).output;
|
||||
return portResponse ? false : true;
|
||||
}
|
||||
|
||||
module.exports = function (startPort) {
|
||||
while (!isPortOpen(startPort)) {
|
||||
startPort += 1;
|
||||
}
|
||||
|
||||
return startPort;
|
||||
}
|
||||
33
www/lib/ui-leaflet/grunt/utils/karma.js
Normal file
33
www/lib/ui-leaflet/grunt/utils/karma.js
Normal file
@@ -0,0 +1,33 @@
|
||||
const karmaLib = require('karma');
|
||||
//<=0.12 || //^0.13
|
||||
const twelveKarma = karmaLib.server ? karmaLib.server.start : undefined;
|
||||
const thirteenKarma = karmaLib.Server || undefined;
|
||||
const Karma = thirteenKarma || twelveKarma;
|
||||
|
||||
// console.log(Karma,true);
|
||||
module.exports = (pathToKarmaFile, grunt) => {
|
||||
var log;
|
||||
log = grunt.log.oklns;
|
||||
return (done, karmaConf) => {
|
||||
var e, server;
|
||||
if (karmaConf == null) {
|
||||
karmaConf = require.resolve(pathToKarmaFile);
|
||||
}
|
||||
log('-- Karma Setup --');
|
||||
try {
|
||||
server = new Karma({
|
||||
configFile: karmaConf,
|
||||
singleRun: true
|
||||
}, (code) => {
|
||||
log("Karma Callback Code: " + code);
|
||||
done(!code ? void 0 : false);
|
||||
});
|
||||
if (server.start)
|
||||
server.start(); //^0.13
|
||||
} catch (_error) {
|
||||
e = _error;
|
||||
log("KARMA ERROR: " + e);
|
||||
return done(false);
|
||||
}
|
||||
};
|
||||
};
|
||||
50
www/lib/ui-leaflet/grunt/watch.js
Normal file
50
www/lib/ui-leaflet/grunt/watch.js
Normal file
@@ -0,0 +1,50 @@
|
||||
'use strict';
|
||||
var getAvailPort = require('./utils/getAvailPort');
|
||||
var port = getAvailPort(7777);
|
||||
|
||||
var _files = ['src/**/*.js'];
|
||||
var _testFiles = ['test/unit/**.js', 'test/unit/**.coffee',
|
||||
'test/e2e/**.js', 'test/unit/**/**.js', 'test/unit/**/**.coffee', 'test/e2e/**/**.js'];
|
||||
|
||||
module.exports = function (grunt, options) {
|
||||
return {
|
||||
// NOT WORTH THE PINTA when having multiple watches
|
||||
// options: {
|
||||
// livereload: port
|
||||
// },
|
||||
fast: {
|
||||
files: _files,
|
||||
tasks: [
|
||||
'fastbuild',
|
||||
'uglify',
|
||||
'concat:license'
|
||||
]
|
||||
},
|
||||
source: {
|
||||
files: _files,
|
||||
tasks: [
|
||||
'fastbuild',
|
||||
'uglify',
|
||||
'testunit',
|
||||
'concat:license'
|
||||
]
|
||||
},
|
||||
unit: {
|
||||
files: _testFiles,
|
||||
tasks: [
|
||||
'fastbuild',
|
||||
'karma'
|
||||
]
|
||||
},
|
||||
examples: {
|
||||
files: ['examples/*.html'],
|
||||
tasks: [
|
||||
'examples'
|
||||
]
|
||||
},
|
||||
website: {
|
||||
files: ['website/src/js/app.js', 'website/src/js/**/*.js'],
|
||||
tasks: ['jshint', 'concat:website', 'uglify'] //'ngmin'
|
||||
}
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user