Merge pull request #23 from jgable/GruntBuild
Initial Grunt configuration
This commit is contained in:
commit
7cac1de6be
54
Gruntfile.js
Normal file
54
Gruntfile.js
Normal file
@ -0,0 +1,54 @@
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
var configureGrunt = function (grunt) {
|
||||
|
||||
var cfg = {
|
||||
// JSLint all the things!
|
||||
jslint: {
|
||||
directives: {
|
||||
node: true,
|
||||
browser: true,
|
||||
nomen: true,
|
||||
todo: true
|
||||
},
|
||||
files: [
|
||||
// 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-jslint");
|
||||
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", ["jslint", "nodeunit:all"]);
|
||||
};
|
||||
|
||||
module.exports = configureGrunt;
|
||||
|
||||
}());
|
@ -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) {
|
||||
|
||||
|
@ -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')));
|
||||
}
|
||||
|
@ -19,6 +19,9 @@
|
||||
|
||||
if (lang === 'en') {
|
||||
// TODO: do stuff here to optimise for en
|
||||
|
||||
// Make jslint empty block error go away
|
||||
lang = 'en';
|
||||
}
|
||||
|
||||
/** TODO potentially use req.acceptedLanguages rather than the default
|
||||
|
@ -20,6 +20,10 @@
|
||||
"jugglingdb-sqlite3": "git+https://github.com/jugglingdb/sqlite3-adapter.git#master"
|
||||
},
|
||||
"devDependencies": {
|
||||
"nodeunit": "*"
|
||||
"grunt": "~0.4.1",
|
||||
"grunt-contrib-nodeunit": "~0.1.2",
|
||||
"grunt-contrib-compass": "~0.2.0",
|
||||
"nodeunit": "*",
|
||||
"grunt-jslint": "~0.2.5a"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user