Initial Grunt configuration

This commit is contained in:
Jacob Gable 2013-05-12 08:40:59 -05:00
parent 956cda158a
commit 99c13c02c0
5 changed files with 64 additions and 6 deletions

5
.jshintrc Normal file
View File

@ -0,0 +1,5 @@
{
"node": true,
"browser": true,
"undef": true
}

47
Gruntfile.js Normal file
View File

@ -0,0 +1,47 @@
var configureGrunt = function(grunt) {
var cfg = {
// JSHint all the things!
jshint2: {
options: {
jshintrc: ".jshintrc"
},
all: [
// Lint files in the root, including Gruntfile.js
"*.js",
// Lint core files, but not libs
["core/**/*.js", "!**/assets/lib/**/*.js"]
]
},
// Unit test all the things!
nodeunit: {
all: ['core/test/ghost/**/test-*.js']
},
// Compile all the SASS!
compass: {
options: {
config: "config.rb"
},
// No need for config, but separated for future options
admin: {}
}
};
grunt.initConfig(cfg);
grunt.loadNpmTasks("grunt-jshint2");
grunt.loadNpmTasks("grunt-contrib-nodeunit");
grunt.loadNpmTasks("grunt-contrib-compass");
// Prepare the project for development
// TODO: Git submodule init/update (https://github.com/jaubourg/grunt-update-submodules)?
grunt.registerTask("init", ["compass:admin"]);
// Run tests and lint code
grunt.registerTask("validate", ["jshint2:all", "nodeunit:all"]);
};
module.exports = configureGrunt;

View File

@ -99,8 +99,8 @@
}
} else if (e.keyCode === keys.ESC) {
suggestions.hide();
} else if ((e.keyCode === keys.ENTER || e.keyCode === keys.COMMA)
&& searchTerm) { // Submit tag using enter or comma key
} else if ((e.keyCode === keys.ENTER || e.keyCode === keys.COMMA)&& searchTerm) {
// Submit tag using enter or comma key
e.preventDefault();
if (suggestions.is(":visible") && suggestions.children(".selected").length !== 0) {

View File

@ -75,7 +75,7 @@
polyglot: function () { return polyglot; },
paths: function () {
return {
'activeTheme': __dirname + '/../content/' + config.themeDir + '/' + config.activeTheme + '/',
'activeTheme': path.resolve(__dirname + '/../content/' + config.themeDir + '/' + config.activeTheme + '/'),
'adminViews': __dirname + '/admin/views/',
'lang': __dirname + '/lang/'
};
@ -158,7 +158,7 @@
));
app.set('views', self.paths().activeTheme);
} else {
app.engine('hbs', hbs.express3({partialsDir: self.paths().adminViews + '/partials'}));
app.engine('hbs', hbs.express3({partialsDir: self.paths().adminViews + 'partials'}));
app.set('views', self.paths().adminViews);
app.use('/core/admin/assets', express['static'](path.join(__dirname, '/admin/assets')));
}

View File

@ -12,11 +12,17 @@
"css": "*",
"moment": "*",
"underscore": "*",
"nodeunit": "*",
"showdown": "*",
"node-polyglot": "*",
"sqlite3": "2.1.7",
"jugglingdb": "0.2.x",
"jugglingdb-sqlite3": "git+https://github.com/jugglingdb/sqlite3-adapter.git#master"
},
"devDependencies": {
"nodeunit": "*",
"grunt": "~0.4.1",
"grunt-contrib-nodeunit": "~0.1.2",
"grunt-jshint2": "~0.1.1",
"grunt-contrib-compass": "~0.2.0"
}
}