Skip to content

Commit

Permalink
Cutting over to browserify
Browse files Browse the repository at this point in the history
  • Loading branch information
andredumas committed Jun 2, 2014
1 parent ba29326 commit cd63924
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 53 deletions.
3 changes: 3 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"node": true
}
49 changes: 38 additions & 11 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,39 @@ module.exports = function(grunt) {
build: ['build']
},

concat: {
browserify: {
options: {
bundleOptions: {
standalone: 'techan'
}
},
dev: {
options: {
// TODO Strip comments
banner: '<%= config.banner %>\n'
bundleOptions: {
debug: true,
standalone: '<%= browserify.options.bundleOptions.standalone %>'
}
},
dist: {
src: ['src/intro.js', 'src/*/*.js', 'src/outro.js'],
dest: 'dist/techan.js'
src: 'src/techan.js',
dest: 'build/techan.js'
},
dist: {
src: 'src/techan.js',
dest: 'dist/techan.js'
}
},

usebanner: {
options: {
position: 'top',
banner: '<%= config.banner %>',
linebreak: true
},
dist: {
files: {
src: '<%= browserify.dist.dest %>'
}
}
},

jsonlint: {
Expand All @@ -38,11 +62,14 @@ module.exports = function(grunt) {
},

jshint: {
options: {
jshintrc: ".jshintrc"
},
dev: {
src: ['src/**/*.js', 'lib/**/*.js', 'Gruntfile.js', 'test/**/*.js']
},
dist: {
src: '<%= concat.dist.dest %>'
src: '<%= browserify.dist.dest %>'
}
},

Expand Down Expand Up @@ -70,7 +97,7 @@ module.exports = function(grunt) {
}
},
test: {
src: '<%= concat.dist.dest %>'
src: '<%= browserify.dev.dest %>'
}
},

Expand All @@ -82,7 +109,7 @@ module.exports = function(grunt) {
},
dist: {
files: {
'dist/techan.min.js': '<%= concat.dist.dest %>'
'dist/techan.min.js': '<%= browserify.dist.dest %>'
}
}
}
Expand All @@ -93,8 +120,8 @@ module.exports = function(grunt) {

grunt.registerTask('lint:dev', ['jshint:dev', 'jscs:dev']);
grunt.registerTask('lint:dist', ['jshint:dist', 'jscs:dist']);
grunt.registerTask('dev', ['lint:dev', 'concat', 'lint:dist', 'test']);
grunt.registerTask('dev', ['lint:dev', 'browserify:dev', 'test']);
grunt.registerTask('test', ['jasmine']);

grunt.registerTask('default', ['bower', 'clean', 'dev', 'uglify']);
grunt.registerTask('default', ['bower', 'clean', 'dev', 'browserify:dist', 'usebanner', 'uglify']);
};
64 changes: 33 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
{
"name": "techanjs",
"version": "0.1.0",
"repository": {
"type": "git",
"url": "https://github.com/andredumas/techan.js.git"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/andredumas/techan.js/blob/master/LICENSE"
}
],
"dependencies": { },
"devDependencies": {
"grunt": "~0.4.5",
"grunt-cli": "~0.1.13",
"grunt-contrib-jshint": "~0.10.0",
"grunt-contrib-uglify": "~0.4.0",
"grunt-contrib-watch": "~0.6.1",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-concat": "~0.4.0",
"grunt-contrib-jasmine": "0.6.4",
"grunt-jsonlint": "~1.0.4",
"grunt-jscs-checker": "~0.4.4",
"load-grunt-tasks": "~0.3.0",
"bower": "~1.3.3"
},
"scripts": {
"start": "grunt watch",
"test": "grunt"
"name": "techanjs",
"version": "0.1.0",
"repository": {
"type": "git",
"url": "https://github.com/andredumas/techan.js.git"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/andredumas/techan.js/blob/master/LICENSE"
}
}
],
"dependencies": {},
"devDependencies": {
"grunt": "~0.4.5",
"grunt-cli": "~0.1.13",
"grunt-contrib-jshint": "~0.10.0",
"grunt-contrib-uglify": "~0.4.0",
"grunt-contrib-watch": "~0.6.1",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-jasmine": "0.6.4",
"grunt-jsonlint": "~1.0.4",
"grunt-jscs-checker": "~0.4.4",
"load-grunt-tasks": "~0.3.0",
"bower": "~1.3.3",
"grunt-browserify": "~2.1.0",
"grunt-banner": "~0.2.3"
},
"scripts": {
"watch": "grunt watch",
"start": "grunt watch",
"test": "grunt"
}
}
2 changes: 0 additions & 2 deletions src/intro.js

This file was deleted.

8 changes: 0 additions & 8 deletions src/outro.js

This file was deleted.

4 changes: 4 additions & 0 deletions src/plot/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";

var plot = require("./plot");
module.exports = plot;
6 changes: 5 additions & 1 deletion src/plot/plot.js
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
techan.plot = {};
"use strict";

module.exports = function() {
return {};
};
5 changes: 5 additions & 0 deletions src/techan.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"use strict";

var techan = {version: "0.1.0"};
techan.plot = require("./plot");
module.exports = techan;
5 changes: 5 additions & 0 deletions test/spec/techanSpec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe('techan.version', function() {
it('should be defined', function() {
expect(techan.version).toBeDefined();
});
});

0 comments on commit cd63924

Please sign in to comment.