From 928b562948a90a9e546f3f50733a54bbecc19a44 Mon Sep 17 00:00:00 2001 From: Harry Wolff Date: Tue, 18 Feb 2014 22:41:21 -0500 Subject: [PATCH] Fix package.json scripts to be more in line with expected behavior of npm packages fixes #1053 - updates travis config to be more in line with current dev steps - fix `grunt-cli` warning from appearing when running grunt --- .travis.yml | 3 +-- CONTRIBUTING.md | 7 +++---- Gruntfile.js | 8 ++++++-- package.json | 3 +-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7b718b3c23..39be9700d7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,9 +9,7 @@ matrix: allow_failures: - env: DB=pg before_install: - - rvm use 1.9.3 - gem install bundler - - npm install -g grunt-cli - git clone git://github.com/n1k0/casperjs.git ~/casperjs - cd ~/casperjs - git checkout tags/1.1-beta3 @@ -22,3 +20,4 @@ before_install: before_script: - phantomjs --version - casperjs --version + - grunt init \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 54e95d80cf..090838ac73 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -194,14 +194,13 @@ developing Ghost. 1. cd into the project folder 1. Run `npm install -g grunt-cli` 1. Run `npm install`. - * If the install fails with errors to do with "node-gyp rebuild" or "SQLite3", follow the SQLite3 install + * If the install fails with errors to do with "node-gyp rebuild" or "SQLite3", follow the SQLite3 install instructions below this list * Usually if you're within vagrant, and have installed the guest plugins and updated that, this will not happen -1. Run `grunt init` from the root - this generates the Bourbon directory, compiles SASS and compiles Handlebars -templates +1. Run `grunt init` from the root - this runs bundler, generates the Bourbon directory, compiles SASS and compiles Handlebars templates 1. Run `npm start` from the root to start the server. -If something goes wrong, please see the +If something goes wrong, please see the [troubleshooting tips](https://github.com/TryGhost/Ghost/blob/master/CONTRIBUTING.md#troubleshooting--faq) below. ### Developer Tips diff --git a/Gruntfile.js b/Gruntfile.js index dd34e289f3..7144a71533 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -49,7 +49,7 @@ var path = require('path'), configureGrunt = function (grunt) { // load all grunt tasks - require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks); + require('matchdep').filterDev(['grunt-*', '!grunt-cli']).forEach(grunt.loadNpmTasks); var cfg = { // Common paths to be used by tasks @@ -277,6 +277,10 @@ var path = require('path'), // ### config for grunt-shell // command line tools shell: { + // run bundle + bundle: { + command: 'bundle install' + }, // install bourbon bourbon: { command: 'bourbon install --path <%= paths.adminAssets %>/sass/modules/' @@ -847,7 +851,7 @@ var path = require('path'), // ### Tools for building assets - grunt.registerTask('init', 'Prepare the project for development', ['shell:bourbon', 'default']); + grunt.registerTask('init', 'Prepare the project for development', ['shell:bundle', 'shell:bourbon', 'default']); // Before running in production mode grunt.registerTask('prod', 'Build CSS, JS & templates for production', ['sass:compress', 'handlebars', 'concat', 'uglify']); diff --git a/package.json b/package.json index 5bf43f0872..664c461539 100644 --- a/package.json +++ b/package.json @@ -25,8 +25,7 @@ "main": "./core/index", "scripts": { "start": "node index", - "test": "./node_modules/.bin/grunt validate --verbose", - "install": "bundle install && grunt init" + "test": "./node_modules/.bin/grunt validate --verbose" }, "engines": { "node": "~0.10.0"