Permalink
Browse files

Replace grunt with npm scripts.

  • Loading branch information...
1 parent 37ef043 commit bcb1919e26ad222c11e5f927dc6424d46432bb01 @blueimp committed Oct 17, 2016
Showing with 26 additions and 46 deletions.
  1. +0 −42 Gruntfile.js
  2. +16 −0 bower-version-update.js
  3. +10 −4 package.json
View
@@ -1,42 +0,0 @@
-/*
- * jQuery File Upload Gruntfile
- * https://github.com/blueimp/jQuery-File-Upload
- *
- * Copyright 2013, Sebastian Tschan
- * https://blueimp.net
- *
- * Licensed under the MIT license:
- * http://www.opensource.org/licenses/MIT
- */
-
-/*global module, require */
-
-module.exports = function (grunt) {
- 'use strict';
-
- function bowerJson() {
- require('bower-json').validate(require('./bower.json'));
- }
-
- grunt.initConfig({
- jshint: {
- options: {
- jshintrc: '.jshintrc'
- },
- all: [
- 'Gruntfile.js',
- 'js/cors/*.js',
- 'js/*.js',
- 'server/node/server.js',
- 'test/test.js'
- ]
- }
- });
-
- grunt.loadNpmTasks('grunt-contrib-jshint');
- grunt.loadNpmTasks('grunt-bump-build-git');
- grunt.registerTask('bower-json', bowerJson);
- grunt.registerTask('test', ['jshint', 'bower-json']);
- grunt.registerTask('default', ['test']);
-
-};
@@ -0,0 +1,16 @@
+#!/usr/bin/env node
+
+'use strict';
+
+var path = require('path');
+var packageJSON = require(path.join(__dirname, 'package.json'));
+var bowerFile = path.join(__dirname, 'bower.json');
+var bowerJSON = require('bower-json').parse(
+ require(bowerFile),
+ {normalize: true}
+);
+bowerJSON.version = packageJSON.version;
+require('fs').writeFileSync(
+ bowerFile,
+ JSON.stringify(bowerJSON, null, 2) + '\n'
+);
View
@@ -43,9 +43,15 @@
"license": "MIT",
"main": "js/jquery.fileupload.js",
"devDependencies": {
- "bower-json": "0.6.0",
- "grunt": "0.4.5",
- "grunt-bump-build-git": "1.1.2",
- "grunt-contrib-jshint": "0.11.2"
+ "bower-json": "0.8.1",
+ "jshint": "2.9.3"
+ },
+ "scripts": {
+ "bower-version-update": "./bower-version-update.js",
+ "lint": "jshint *.js js/*.js js/cors/*.js",
+ "test": "npm run lint",
+ "preversion": "npm test",
+ "version": "npm run bower-version-update && git add bower.json",
+ "postversion": "git push --tags origin master && npm publish"
}
}

0 comments on commit bcb1919

Please sign in to comment.