diff --git a/.gitignore b/.gitignore index 9f48aa73b..ac2c46917 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,5 @@ perf/* .DS_Store npm-debug.log -node_modules \ No newline at end of file +node_modules +dist \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js index c8cfbe7d1..220f7c567 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -27,6 +27,10 @@ module.exports = function(grunt) { debug: './build/output/knockout-latest.debug.js', min: './build/output/knockout-latest.js' }, + dist: { + debug: './dist/knockout.debug.js', + min: './dist/knockout.js' + }, test: { phantomjs: 'spec/runner.phantom.js', node: 'spec/runner.node.js' @@ -147,6 +151,29 @@ module.exports = function(grunt) { ); }); + grunt.registerTask('dist', ['clean'], function() { + // Update the version in bower.json + var bowerConfig = grunt.file.readJSON('bower.json'), + version = grunt.config('pkg.version'); + bowerConfig.version = version; + grunt.file.write('bower.json', JSON.stringify(bowerConfig, true, 2)); + + var buildConfig = grunt.config('build'), + distConfig = grunt.config('dist'); + grunt.file.copy(buildConfig.debug, distConfig.debug); + grunt.file.copy(buildConfig.min, distConfig.min); + + console.log('To publish, run:'); + console.log(' git add bower.json'); + console.log(' git add -f ' + distConfig.debug); + console.log(' git add -f ' + distConfig.min); + console.log(' git checkout head'); + console.log(' git commit -m \'Version ' + version + ' for distribution\''); + console.log(' git tag -a v' + version + ' -m \'Add tag v' + version + '\''); + console.log(' git checkout master'); + console.log(' git push origin --tags'); + }); + // Default task. grunt.registerTask('default', ['clean', 'checktrailingspaces', 'build', 'test']); }; diff --git a/bower.json b/bower.json new file mode 100644 index 000000000..e7c18dc11 --- /dev/null +++ b/bower.json @@ -0,0 +1,26 @@ +{ + "name": "knockout", + "version": "3.2.0-alpha", + "homepage": "http://knockoutjs.com/", + "description": "Knockout makes it easier to create rich, responsive UIs with JavaScript", + "main": "dist/knockout.js", + "moduleType": [ + "amd", + "globals", + "node" + ], + "keywords": [ + "knockout", + "mvvm", + "mvc", + "spa" + ], + "license": "MIT", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "spec", + "build/output" + ] +} \ No newline at end of file diff --git a/package.json b/package.json index 0532aefe1..816a75d5b 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "knockout", "description": "Knockout makes it easier to create rich, responsive UIs with JavaScript", "homepage": "http://knockoutjs.com/", - "version": "3.1.0", + "version": "3.2.0-alpha", "license": "MIT", "author": "The Knockout.js team", "main": "build/output/knockout-latest.debug.js",