Skip to content

Instantly share code, notes, and snippets.

@joggienl
Created May 27, 2016 23:43
Show Gist options
  • Save joggienl/a70e54e811e184c70667e37a27b9a44d to your computer and use it in GitHub Desktop.
Save joggienl/a70e54e811e184c70667e37a27b9a44d to your computer and use it in GitHub Desktop.
Up-to-date packages
{
"name": "<%= utils.slug(projectName) %>",
"version": "0.0.0",
"private": true,
"engines": {
"node": ">=0.10.22",
"npm": ">=1.3.14"
},
"scripts": {
"start": "<%= taskRunner !== 'none' ? taskRunner : 'node keystone.js' %>"
},
"main": "keystone.js"
}
// Put this between these two:
//
// KeystoneGenerator.prototype.project = function project () { ... }
// KeystoneGenerator.prototype.tasks = function tasks () { ... }
KeystoneGenerator.prototype.deps = function deps () {
var deps = [];
var devDeps = [];
deps.push(
'keystone@0.3.16',
'async',
'lodash',
'dotenv'
);
switch (this.viewEngine) {
case 'hbs':
deps.push(
'moment',
'cloudinary',
'express-handlebars',
'handlebars'
);
break;
case 'swig':
deps.push(
'swig'
);
break;
case 'nunjucks':
deps.push(
'consolidate',
'nunjucks'
);
break;
case 'twig':
deps.push(
'twig'
);
break;
}
switch (this.preprocessor) {
case 'sass':
deps.push(
'node-sass',
'node-sass-middleware'
);
break;
case 'stylus':
deps.push(
'stylus'
);
break;
}
switch (this.taskRunner) {
case 'grunt':
devDeps.push(
'grunt',
'grunt-express-server',
'grunt-contrib-watch',
'load-grunt-tasks',
'load-grunt-configs',
'grunt-node-inspector',
'time-grunt',
'grunt-concurrent',
'grunt-nodemon',
'open'
);
switch (this.preprocessor) {
case 'sass':
devDeps.push(
'grunt-sass'
);
break;
case 'less':
devDeps.push(
'grunt-contrib-less'
);
break;
case 'stylus':
devDeps.push(
'grunt-contrib-stylus'
);
break;
}
break;
case 'gulp':
devDeps.push(
'gulp',
'gulp-shell',
'gulp-watch'
);
switch (this.preprocessor) {
case 'sass':
devDeps.push(
'gulp-sass'
);
break;
case 'stylus':
devDeps.push(
'gulp-stylus'
);
break;
}
break;
}
this.npmInstall(deps, { save: true });
this.npmInstall(devDeps, { saveDev: true });
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment