Skip to content

Commit

Permalink
Set up repository.
Browse files Browse the repository at this point in the history
  • Loading branch information
justinmanley committed Sep 23, 2014
1 parent 3ffc263 commit ac055a3
Show file tree
Hide file tree
Showing 3 changed files with 227 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
coverage
node_modules
156 changes: 156 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
module.exports = function(grunt) {

require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

changelog: {},

bump: {
options: {
files: ['package.json'],
updateConfigs: [],
commit: true,
commitMessage: 'Release v%VERSION%',
commitFiles: ['package.json'],
createTag: true,
tagName: 'v%VERSION%',
tagMessage: 'Version %VERSION%',
push: true,
pushTo: 'origin',
gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d'
}
},

jshint: {
options: {
node: true,
browser: true,
esnext: true,
bitwise: true,
curly: true,
eqeqeq: true,
immed: true,
indent: 4,
latedef: true,
newcap: true,
noarg: true,
regexp: true,
undef: true,
unused: true,
trailing: true,
smarttabs: true,
globals: {
L: false,

// Mocha

describe: false,
it: false,
before: false,
after: false,
beforeEach: false,
afterEach: false,
chai: false,
expect: false,
sinon: false
}
},
source: {
src: [ 'src/**', 'Gruntfile.js', 'package.json' ]
},
test: {
src: [ 'test/SpecHelper.js', 'test/src/**' ],
},
grunt: {
src: [ 'Gruntfile.js' ]
}
},

karma: {
travis: {
configFile: 'test/karma.conf.js',
background: false,
singleRun: true,
browsers: [ 'PhantomJS' ]
},
development: {
configFile: 'test/karma.conf.js',
background: true
},
unit: {
configFile: 'test/karma.conf.js',
background: false,
singleRun: true
}
},

watch: {
options : {
livereload: true
},
source: {
files: [
'src/**',
'test/**',
'Gruntfile.js'
],
tasks: [ 'build' ]
}
},

concat: {
dist: {
options: {
banner: '(function(window, document, undefined) {\n\n"use strict";\n\n',
footer: '\n\n}(window, document));'
},
src: [
'src/ToolbarAction.js',
'src/Toolbar.js',
'src/ToolbarGroup.js',
'src/Toolbar.*.js'
],
dest: 'dist/Leaflet.Toolbar.js',
}
}
});

/* Run tests once. */
grunt.registerTask('test', [ 'jshint', 'karma:test', 'coverage' ]);

/* Default (development): Watch files and lint, test, and build on change. */
grunt.registerTask('default', ['karma:development:start', 'watch']);

grunt.registerTask('build', [
'jshint',
'karma:development:run',
'coverage',
'concat:dist',
]);

grunt.registerTask('coverage', 'Custom commmand-line reporter for karma-coverage', function() {
var coverageReports = grunt.file.expand('coverage/*/coverage.txt'),
reports = {},
report, i, len;

for (i = 0, len = coverageReports.length; i < len; i++) {
report = grunt.file.read(coverageReports[i]);
if (!reports[report]) {
reports[report] = [coverageReports[i]];
} else {
reports[report].push(coverageReports[i]);
}
}

for (report in reports) {
if (reports.hasOwnProperty(report)) {
for (i = 0, len = reports[report].length; i < len; i++) {
grunt.log.writeln(reports[report][i]);
}
grunt.log.writeln(report);
}
}
});
};
69 changes: 69 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"name": "leaflet-illustrate",
"version": "0.0.2",
"description": "Rich annotation plugin for Leaflet.",
"scripts": {
"test": "grunt travis",
"coveralls": "PHANTOM=`ls ./coverage | grep PhantomJS` && cat \"coverage/$PHANTOM/lcov.info\" | coveralls"
},
"devDependencies": {
"jshint": "2.5.x",
"uglify-js": "~2.4.3",

"grunt": "~0.4.2",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-coffee": "~0.10.1",
"grunt-contrib-concat": "0.4.x",
"grunt-contrib-jshint": "~0.6.3",
"grunt-contrib-less": "~0.11.0",
"grunt-contrib-nodeunit": "~0.2.0",
"grunt-contrib-uglify": "~0.2.2",
"grunt-contrib-watch": ">=0.3.1",
"grunt-mocha": "~0.4.11",
"grunt-karma": "0.8.3",
"grunt-bump": "0.0.14",
"matchdep": "~0.3.0",

"chai": "1.9.1",
"mocha": "~1.14.0",
"sinon": "1.10.3",

"karma": "0.12.16",
"karma-chrome-launcher": "^0.1.4",
"karma-firefox-launcher": "^0.1.3",
"karma-phantomjs-launcher": "0.1.4",
"karma-mocha": "^0.1.4",
"karma-safari-launcher": "^0.1.1",
"karma-mocha-reporter": "0.2.7",
"karma-coverage": "0.2.4",

"leaflet": "~0.7.0",
"leaflet-draw": "0.2.3",

"coveralls": "2.11.1"
},
"peerDependencies": {
"grunt-cli": "0.1.13"
},
"directories": {
"examples": "./examples",
"distribution": "./dist",
"source": "./src",
"tests": "./test"
},
"repository": {
"type": "git",
"url": "https://github.com/manleyjster/Leaflet.Illustrate.git"
},
"keywords": [
"maps",
"leaflet",
"client",
"annotate",
"illustrate",
"draw"
],
"author": "Justin Manley",
"license": "MIT",
"readmeFilename": "README.md"
}

0 comments on commit ac055a3

Please sign in to comment.