mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 20:03:12 +03:00
Gruntfile.js cleanup & removed unused dependency
- grunt-open is no longer needed - grunt build isn't used, so get rid.
This commit is contained in:
parent
a395361e6e
commit
56ea2bb557
87
Gruntfile.js
87
Gruntfile.js
@ -47,11 +47,10 @@ var path = require('path'),
|
|||||||
build: buildDirectory,
|
build: buildDirectory,
|
||||||
nightlyBuild: path.join(buildDirectory, 'nightly'),
|
nightlyBuild: path.join(buildDirectory, 'nightly'),
|
||||||
weeklyBuild: path.join(buildDirectory, 'weekly'),
|
weeklyBuild: path.join(buildDirectory, 'weekly'),
|
||||||
buildBuild: path.join(buildDirectory, 'build'),
|
releaseBuild: path.join(buildDirectory, 'release'),
|
||||||
dist: distDirectory,
|
dist: distDirectory,
|
||||||
nightlyDist: path.join(distDirectory, 'nightly'),
|
nightlyDist: path.join(distDirectory, 'nightly'),
|
||||||
weeklyDist: path.join(distDirectory, 'weekly'),
|
weeklyDist: path.join(distDirectory, 'weekly'),
|
||||||
buildDist: path.join(distDirectory, 'build'),
|
|
||||||
releaseDist: path.join(distDirectory, 'release')
|
releaseDist: path.join(distDirectory, 'release')
|
||||||
},
|
},
|
||||||
buildType: 'Build',
|
buildType: 'Build',
|
||||||
@ -121,14 +120,6 @@ var path = require('path'),
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// Open the site in a browser
|
|
||||||
open: {
|
|
||||||
server: {
|
|
||||||
// TODO: Load this port from config?
|
|
||||||
path: 'http://127.0.0.1:2368'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// JSLint all the things!
|
// JSLint all the things!
|
||||||
jslint: {
|
jslint: {
|
||||||
server: {
|
server: {
|
||||||
@ -300,8 +291,8 @@ var path = require('path'),
|
|||||||
},
|
},
|
||||||
|
|
||||||
clean: {
|
clean: {
|
||||||
build: {
|
release: {
|
||||||
src: ['<%= paths.buildBuild %>/**']
|
src: ['<%= paths.releaseBuild %>/**']
|
||||||
},
|
},
|
||||||
test: {
|
test: {
|
||||||
src: ['content/data/ghost-test.db']
|
src: ['content/data/ghost-test.db']
|
||||||
@ -323,11 +314,11 @@ var path = require('path'),
|
|||||||
dest: '<%= paths.weeklyBuild %>/<%= pkg.version %>/'
|
dest: '<%= paths.weeklyBuild %>/<%= pkg.version %>/'
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
build: {
|
release: {
|
||||||
files: [{
|
files: [{
|
||||||
expand: true,
|
expand: true,
|
||||||
src: buildGlob,
|
src: buildGlob,
|
||||||
dest: '<%= paths.buildBuild %>/'
|
dest: '<%= paths.releaseBuild %>/'
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -349,20 +340,12 @@ var path = require('path'),
|
|||||||
cwd: '<%= paths.weeklyBuild %>/<%= pkg.version %>/',
|
cwd: '<%= paths.weeklyBuild %>/<%= pkg.version %>/',
|
||||||
src: ['**']
|
src: ['**']
|
||||||
},
|
},
|
||||||
build: {
|
|
||||||
options: {
|
|
||||||
archive: '<%= paths.buildDist %>/Ghost-Build.zip'
|
|
||||||
},
|
|
||||||
expand: true,
|
|
||||||
cwd: '<%= paths.buildBuild %>/',
|
|
||||||
src: ['**']
|
|
||||||
},
|
|
||||||
release: {
|
release: {
|
||||||
options: {
|
options: {
|
||||||
archive: '<%= paths.releaseDist %>/Ghost-<%= pkg.version %>.zip'
|
archive: '<%= paths.releaseDist %>/Ghost-<%= pkg.version %>.zip'
|
||||||
},
|
},
|
||||||
expand: true,
|
expand: true,
|
||||||
cwd: '<%= paths.buildBuild %>/',
|
cwd: '<%= paths.releaseBuild %>/',
|
||||||
src: ['**']
|
src: ['**']
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -793,6 +776,9 @@ var path = require('path'),
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// ## Tools for packaging builds - these can be weeklies, nightlies or releases
|
||||||
|
|
||||||
|
/* These tools are currently unused
|
||||||
grunt.registerTask('nightly',
|
grunt.registerTask('nightly',
|
||||||
'Nightly builds\n' +
|
'Nightly builds\n' +
|
||||||
' - Do our standard build steps (sass, handlebars, etc)\n' +
|
' - Do our standard build steps (sass, handlebars, etc)\n' +
|
||||||
@ -815,7 +801,15 @@ var path = require('path'),
|
|||||||
'compress:nightly'
|
'compress:nightly'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
grunt.registerTask('weekly', [
|
grunt.registerTask('weekly',
|
||||||
|
'Weekly builds\n' +
|
||||||
|
' - Do our standard build steps (sass, handlebars, etc)\n' +
|
||||||
|
' - Bump patch version in package.json, commit, tag and push\n' +
|
||||||
|
' - Generate changelog for the past 14 releases\n' +
|
||||||
|
' - Copy files to build-folder/#/#{version} directory\n' +
|
||||||
|
' - Clean out unnecessary files (travis, .git*, .af*, .groc*)\n' +
|
||||||
|
' - Zip files in build folder to dist-folder/#{version} directory',
|
||||||
|
[
|
||||||
'setCurrentBuildType:Weekly',
|
'setCurrentBuildType:Weekly',
|
||||||
'shell:bourbon',
|
'shell:bourbon',
|
||||||
'sass:compress',
|
'sass:compress',
|
||||||
@ -828,28 +822,24 @@ var path = require('path'),
|
|||||||
'copy:weekly',
|
'copy:weekly',
|
||||||
'compress:weekly'
|
'compress:weekly'
|
||||||
]);
|
]);
|
||||||
|
*/
|
||||||
|
|
||||||
grunt.registerTask('build', [
|
grunt.registerTask('release',
|
||||||
|
'Release task - creates a final built zip\n' +
|
||||||
|
' - Do our standard build steps (sass, handlebars, etc)\n' +
|
||||||
|
' - Generate changelog for the past 14 releases\n' +
|
||||||
|
' - Copy files to release-folder/#/#{version} directory\n' +
|
||||||
|
' - Clean out unnecessary files (travis, .git*, .af*, .groc*)\n' +
|
||||||
|
' - Zip files in release-folder to dist-folder/#{version} directory',
|
||||||
|
[
|
||||||
'shell:bourbon',
|
'shell:bourbon',
|
||||||
'sass:compress',
|
'sass:compress',
|
||||||
'handlebars',
|
'handlebars',
|
||||||
'concat',
|
'concat',
|
||||||
'uglify',
|
'uglify',
|
||||||
'changelog',
|
'changelog',
|
||||||
'clean:build',
|
'clean:release',
|
||||||
'copy:build',
|
'copy:release',
|
||||||
'compress:build'
|
|
||||||
]);
|
|
||||||
|
|
||||||
grunt.registerTask('release', [
|
|
||||||
'shell:bourbon',
|
|
||||||
'sass:admin',
|
|
||||||
'handlebars',
|
|
||||||
'concat',
|
|
||||||
'uglify',
|
|
||||||
'changelog',
|
|
||||||
'clean:build',
|
|
||||||
'copy:build',
|
|
||||||
'compress:release'
|
'compress:release'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@ -863,8 +853,8 @@ var path = require('path'),
|
|||||||
'watch'
|
'watch'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// TODO: Git submodule init/update (https://github.com/jaubourg/grunt-update-submodules)?
|
|
||||||
grunt.registerTask('init', 'Prepare the project for development', ['shell:bourbon', 'default']);
|
// ## Running the test suites
|
||||||
|
|
||||||
grunt.registerTask('test-unit', 'Run unit tests', ['clean:test', 'setTestEnv', 'loadConfig', 'express:test', 'mochacli:all']);
|
grunt.registerTask('test-unit', 'Run unit tests', ['clean:test', 'setTestEnv', 'loadConfig', 'express:test', 'mochacli:all']);
|
||||||
|
|
||||||
@ -874,13 +864,22 @@ var path = require('path'),
|
|||||||
|
|
||||||
grunt.registerTask('validate', 'Run tests and lint code', ['jslint', 'test-unit', 'test-integration', 'test-functional']);
|
grunt.registerTask('validate', 'Run tests and lint code', ['jslint', 'test-unit', 'test-integration', 'test-functional']);
|
||||||
|
|
||||||
|
|
||||||
|
// ## Documentation
|
||||||
|
|
||||||
grunt.registerTask('docs', 'Generate Docs', ['groc']);
|
grunt.registerTask('docs', 'Generate Docs', ['groc']);
|
||||||
|
|
||||||
// TODO: Production build task that minifies with uglify:prod
|
|
||||||
grunt.registerTask('prod', ['sass:compress', 'handlebars', 'concat', 'uglify']);
|
// ## Tools for building assets
|
||||||
|
|
||||||
|
// TODO: Git submodule init/update (https://github.com/jaubourg/grunt-update-submodules)?
|
||||||
|
grunt.registerTask('init', 'Prepare the project for development', ['shell:bourbon', 'default']);
|
||||||
|
|
||||||
|
// Before running in production mode
|
||||||
|
grunt.registerTask('prod', 'Build CSS, JS & templates for production', ['sass:compress', 'handlebars', 'concat', 'uglify']);
|
||||||
|
|
||||||
// When you just say 'grunt'
|
// When you just say 'grunt'
|
||||||
grunt.registerTask('default', ['sass:compress', 'handlebars', 'concat']);
|
grunt.registerTask('default', 'Build CSS, JS & templates for development', ['sass:compress', 'handlebars', 'concat']);
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = configureGrunt;
|
module.exports = configureGrunt;
|
||||||
|
@ -68,7 +68,6 @@
|
|||||||
"grunt-groc": "~0.4.0",
|
"grunt-groc": "~0.4.0",
|
||||||
"grunt-jslint": "~1.1.1",
|
"grunt-jslint": "~1.1.1",
|
||||||
"grunt-mocha-cli": "~1.3.0",
|
"grunt-mocha-cli": "~1.3.0",
|
||||||
"grunt-open": "~0.2.2",
|
|
||||||
"grunt-shell": "~0.5.0",
|
"grunt-shell": "~0.5.0",
|
||||||
"matchdep": "~0.3.0",
|
"matchdep": "~0.3.0",
|
||||||
"mocha": "~1.13.0",
|
"mocha": "~1.13.0",
|
||||||
|
Loading…
Reference in New Issue
Block a user