Permalink
Browse files

Simplify the release process

Features that were previously automated (like changelog, contributors,
or pages generation) are now provided by GitHub, so there is no need
to have such a complicated release process.

The current release process is:

$ npm run jshint && npm test && npm version && npm publish
  • Loading branch information...
1 parent 7b8a963 commit 40673af6bbb58a8792a33b0b269fb42665534255 @rafeca committed Feb 2, 2014
View
@@ -1,3 +0,0 @@
-{
- "node" : true
-}
View
@@ -0,0 +1,34 @@
+{
+ "node": true,
+ "browser": true,
+ "esnext": true,
+ "bitwise": true,
+ "camelcase": true,
+ "curly": true,
+ "eqeqeq": true,
+ "immed": true,
+ "indent": 2,
+ "latedef": true,
+ "newcap": true,
+ "noarg": true,
+ "quotmark": "single",
+ "regexp": true,
+ "undef": true,
+ "unused": true,
+ "strict": true,
+ "trailing": true,
+ "smarttabs": false,
+ "maxlen": 80,
+ "maxdepth": 2,
+ "predef": [
+ "define",
+ "require",
+ "describe",
+ "it",
+ "xit",
+ "before",
+ "beforeEach",
+ "after",
+ "afterEach"
+ ]
+}
View
@@ -1,5 +0,0 @@
-- Rafael de Oleza <rafeca@gmail.com>
-- Dave Eddy
-- Elias Amaral
-- jiyinyiyong
-- Maciej Małecki
View
@@ -0,0 +1,2 @@
+Go to the [https://github.com/rafeca/prettyjson/graphs/contributors](GitHub contributors graph page)
+to see the list of contributors.
View
@@ -1,91 +1,2 @@
-### 0.10.0 — *December 10, 2013*
-
- * Add pretty printing of errors (by @mmalecki)
- * Deprecate Node.js 0.6.x and 0.8.x
-
-### 0.9.0 — *October 4, 2013*
-
- * Checks for hasOwnProperty in function render (by @dlight)
-
-### 0.8.1 — *March 11, 2013*
-
- * Add compatibility for Node.js 0.10.0
- * Update dependencies
-
-### 0.8.0 — *February 23, 2013*
-
- * Fix: ENV vars were not being used correctly
- * Add an option to change the color of the strings
- * Minor codestyle improvements
-
-### 0.7.1 — *October 29, 2012*
-
- * Fix bug in 0.7.0 when input is an array
-
-### 0.7.0 — *October 25, 2012*
-
- * Allow having non-JSON characters at the beginning of the input string (ideal for curl -i)
- * Add a renderString() method to be used by the CLI
- * Change test reporter style to spec
- * Upgrade dependencies to the last versions
-
-### 0.6.0 — *June 29, 2012*
-
- * Update dependencies to support Node.js v0.8
- * Adding ability to use environmental variables
-
-### 0.5.0 — *June 24, 2012*
-
- * Updated dependencies, added support for Node.js up to 0.7.12
- * Minor improvements in README file
- * Add JSHint to the build process
- * Add jake task to execute tests automatically
- * Add test coverage info
-
-### 0.4.0 — *February 24, 2012*
-
- * Now prettyjson uses Mocha test framework instead of jasmine-node
- * Fixed leak in a "key" variable
-
-### 0.3.1 — *February 15, 2012*
-
- * Modified website design
- * Modify webpage link in package.json
-
-### 0.3.0 — *January 24, 2012*
-
- * Added CLI interface
- * Now prettyjson package requires Nodejs 0.6.x
-
-### 0.2.1 — *January 23, 2012*
-
- * Fix: Bug when the JSON has attributes with booleans, integers or null values
-
-### 0.2.0 — *January 22, 2012*
-
- * Now using node-releasetools for the release process
- * Disabled Node.js 0.6 from Travis CI temporally
- * Minor copy in Readme.md
-
-### 0.1.4 — *December 1, 2011*
-
- * Added contributors to the Readme file
-
-### 0.1.3 — *November 17, 2011*
-
- * Fixed the GitHub publishing of tags in the jake task
- * Updated package.json to make it compatible with Node.js 0.6.x
- * Updated travis YAML file to use the new Node.js support on Travis
-
-### 0.1.2 — *November 14, 2011*
-
- * Updated Jakefile with tasks to automate publishing new versions
-
-### 0.1.1 — *October 11, 2011*
-
- * Added changelog jake task to add changelog automatically
- * The library version is retrieved from `package.json` file
-
-### 0.1.0 — *October 10, 2011*
-
- * Initial release
+Go to [GitHub releases page](https://github.com/rafeca/prettyjson/releases) to
+see the history of releases.
View
231 Jakefile
@@ -1,231 +0,0 @@
-var releaseTools = require('releasetools');
-var Step = require('step');
-var exec = require('child_process').exec;
-
-releaseTools.setOptions({
- examplePaths: [
- 'lib/prettyjson.js'
- ],
- siteAssetsPaths: [
- 'site/images',
- 'site/javascripts',
- 'site/stylesheets'
- ]
-});
-
-// Test task
-desc("execute tests");
-task("test", function() {
- var spawn = require('child_process').spawn;
- var child = spawn('npm', ['test']);
-
- console.log('executing the tests...');
-
- child.stderr.on('data', function(stderr) {
- process.stderr.write(stderr);
- });
- child.stdout.on('data', function(stdout) {
- process.stdout.write(stdout);
- });
- child.on('exit', function(code) {
- if (code !== 0) {
- fail(code);
- } else {
- console.log('Done!');
- complete();
- }
- });
-}, true);
-
-
-// Lint task
-desc("execute JSHint checks");
-task("jshint", function() {
- exec('node_modules/jshint/bin/jshint bin/ lib/ --config ".jshint"', function(err, stdout, stderr) {
- if (err) {
- console.log(err);
- fail(err);
- }
- else {
- console.log('Done!');
- complete();
- }
- });
-}, true);
-
-// Auto tests task
-desc("auto execute tests");
-task("watch", function() {
- var spawn = require('child_process').spawn;
- var child = spawn('node_modules/mocha/bin/mocha', ['-w', '-G', '--reporter', 'spec']);
-
- child.stderr.on('data', function(stderr) {
- process.stderr.write(stderr);
- });
- child.stdout.on('data', function(stdout) {
- process.stdout.write(stdout);
- });
- child.on('exit', function(code) {
- if (code !== 0) {
- fail(code);
- } else {
- console.log('Done!');
- complete();
- }
- });
-}, true);
-
-desc("create test coverage file");
-task("test-cov", function() {
- console.log('Creating test coverage file...');
-
- Step(
- function() {
- exec('rm -fr lib-cov', this);
- },
- function(err, stdout, stderr) {
- if (err) throw err;
- exec('node_modules/jscoverage/bin/jscoverage lib lib-cov', this);
- },
- function(err, stdout, stderr) {
- if (err) throw err;
- exec('EXPRESS_COV=1 node_modules/mocha/bin/mocha -R html-cov > docs/coverage.html', this);
- },
- function(err, stdout, stderr) {
- if (err) fail(err);
- else {
- console.log('Done!');
- complete();
- }
- }
- );
-}, true);
-
-// Namespace with all the release related tasks
-namespace('release', function() {
-
- // Build task
- desc('Modify the working copy with all the release information');
- task('build', ['test', 'test-cov', 'jshint'], function(releaseType) {
- Step(
-
- // Update Changelog
- function() {
- console.log('Updating History.md file...');
- releaseTools.updateChangelog(this);
- },
- // Update Contributors
- function(err) {
- if (err) throw err;
- console.log('Updating AUTHORS file...');
- releaseTools.updateAuthorsFile(this);
- },
- // Create Example HTML files
- function(err) {
- if (err) throw err;
- console.log('creating examples documentation...');
- releaseTools.createExamples(this);
- },
- function(err) {
- if (err) fail(err);
- else complete();
- }
- );
- }, true);
-
- // Create site task
- desc('Create the public site');
- task('site', function(releaseType) {
- console.log('Creating the public site page...');
- releaseTools.createSite(function(err) {
- if (err) fail();
- else complete();
- });
- }, true);
-
- // Publish task
- desc('Publish only the static site');
- task('publish-site', ['site'], function() {
- Step(
- // Update gh-pages branch
- function(err) {
- if (err) throw err;
- console.log('Merging changes into gh-pages branch...');
- releaseTools.updatePagesBranch(this);
- },
- // Push to GitHub
- function(err) {
- if (err) throw err;
- console.log('Pushing changes to GitHub...');
- releaseTools.pushToGit(this);
- },
- function(err){
- if (err) fail(err);
- else complete();
- }
- );
- }, true);
-
- // Publish task
- desc('Publish to GitHub and NPM the new version');
- task('publish', ['test'] , function() {
- Step(
- // Check if the `History.md` is modified
- // (to ensure that the `release:build` task has been already executed)
- function() {
- releaseTools.isWorkingCopyClean('History.md', this);
- },
-
- // Commit to Git
- function(err, result) {
- if (err) throw('Error while checking if the git tree is clean: ' + err);
- if (result) throw('You must run jake release:build before publish');
- console.log('Bumping version and creating git tag...');
- releaseTools.commitToGit(this);
- },
-
- // Update gh-pages branch
- function(err) {
- if (err) throw err;
- console.log('Merging changes into gh-pages branch...');
- releaseTools.updatePagesBranch(this);
- },
-
- // Push to GitHub
- function(err) {
- if (err) throw err;
- console.log('Pushing changes to GitHub...');
- releaseTools.pushToGit(this);
- },
-
- // Publish to NPM
- function(err) {
- if (err) throw err;
- console.log('Publishing NPM package...');
- releaseTools.npmPublish(this);
- },
- function(err){
- if (err) fail(err);
- else complete();
- }
- );
- }, true);
-
- // Update package.json task
- desc('Bump version in package.json');
- task('bump', function(releaseType) {
- releaseType = releaseType || 'patch';
- console.log('Bumping version in package.json...');
- releaseTools.updateVersionInPackageJson(releaseType, function(err, oldVersion, newVersion) {
- if (err) {
- return fail('Error while updating version in package.json: ' + err);
- }
- console.log(oldVersion + ' --> ' + newVersion);
- console.log('Done!');
- complete();
- });
- }, true);
-});
-
-desc('Default task is test');
-task('default', ['test'], function(){}, true);
Oops, something went wrong.

0 comments on commit 40673af

Please sign in to comment.