From 52ab8b4a2be136c7fc4af80488b2559b31833763 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Mon, 14 Jan 2013 09:33:53 -0500 Subject: [PATCH 001/128] Docs: Fixed link to publishing page from naming page. --- site-content/page/docs/names.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site-content/page/docs/names.html b/site-content/page/docs/names.html index e027303..648ae41 100644 --- a/site-content/page/docs/names.html +++ b/site-content/page/docs/names.html @@ -15,7 +15,7 @@

First Come, First Serve

-

Names are registered on a first come, first serve basis. Registering a name happens automatically the first time you publish a release of your plugin. You cannot reserve a name prior to releasing your plugin. Once you've registered a name, you are the sole owner of that name. Nobody else will be able to publish a release using the same name. There is no limit on how many plugins/names a single person may register, but all plugins must be legitimate.

+

Names are registered on a first come, first serve basis. Registering a name happens automatically the first time you publish a release of your plugin. You cannot reserve a name prior to releasing your plugin. Once you've registered a name, you are the sole owner of that name. Nobody else will be able to publish a release using the same name. There is no limit on how many plugins/names a single person may register, but all plugins must be legitimate.

Transferring Ownership

From c6b7e2afd583d153500ac4b8919275c5da55e515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Mon, 14 Jan 2013 10:01:06 -0500 Subject: [PATCH 002/128] Grunt: Cleanup. --- grunt.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/grunt.js b/grunt.js index 17f8d32..2a96fbc 100644 --- a/grunt.js +++ b/grunt.js @@ -38,13 +38,15 @@ grunt.registerTask( "docs", function() { var done = this.async(); grunt.helper( "wordpress-sync-posts", "site-content/", function( error ) { if ( error ) { - done( false ); + return done( false ); } done(); }); }); +// clean-all will delete EVERYTHING, including the plugin registery. This is +// useful only for development if you want a clean slate to test from. grunt.registerTask( "clean-all", function() { var rimraf = require( "rimraf" ), retry = require( "./lib/retrydb" ); @@ -60,6 +62,9 @@ grunt.registerTask( "clean-all", function() { rimraf.sync( retry.dbPath ); }); +// clean will only delete information about retries. It will not delete the +// plugin registry and it will not remove local clones. This is useful for +// restoring a WordPress site on a server that already has repos. grunt.registerTask( "clean", function() { var rimraf = require( "rimraf" ), retry = require( "./lib/retrydb" ); From 7dd29854609fc469d44c0b52bf7e16e1728519a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 15 Jan 2013 15:36:45 -0500 Subject: [PATCH 003/128] Perform a graceful restart on SIGHUP. --- scripts/manager.js | 32 ++++++++++++++++++++++++++++++-- scripts/retry.js | 2 +- scripts/update-server.js | 2 +- scripts/wordpress-update.js | 2 +- 4 files changed, 33 insertions(+), 5 deletions(-) diff --git a/scripts/manager.js b/scripts/manager.js index f7c528f..cfe64a3 100644 --- a/scripts/manager.js +++ b/scripts/manager.js @@ -27,10 +27,38 @@ new Process( "update-server.js" ); new Process( "wordpress-update.js" ); new Process( "retry.js" ); -// Let SIGINT pass through to spawned processes. When all children exit, +// SIGINT is a graceful shutdown of all processes. +// The signal passes through to the children and when they all exit, // the manager will end on its own. -process.on( "SIGINT", function() { +process.once( "SIGINT", function() { Process.list.forEach(function( process ) { process.respawn = false; + process.child.kill( "SIGINT" ); + }); +}); + +// SIGHUP is a graceful restart of all processes, including the manager. +// A SIGINT is sent to all children and a new manager is spawned to create +// new child processes. +process.once( "SIGHUP", function() { + var waiting = Process.list.length; + + function checkForShutdown() { + waiting--; + if ( !waiting ) { + process.exit(); + } + } + + // Spawn a new manager, which will spawn new children + spawn( process.argv[ 0 ], process.argv.slice( 1 ), { + detached: true + }); + + // Gracefully shutdown all child processes + Process.list.forEach(function( process ) { + process.respawn = false; + process.child.on( "exit", checkForShutdown ); + process.child.kill( "SIGINT" ); }); }); diff --git a/scripts/retry.js b/scripts/retry.js index becbdae..4cc41b7 100644 --- a/scripts/retry.js +++ b/scripts/retry.js @@ -89,7 +89,7 @@ processFailures(function( error ) { }); // Let the current retry finish, then stop processing and exit -process.on( "SIGINT", function() { +process.once( "SIGINT", function() { processFailures = function( fn ) { fn( null ); }; diff --git a/scripts/update-server.js b/scripts/update-server.js index 1afb568..1608af5 100644 --- a/scripts/update-server.js +++ b/scripts/update-server.js @@ -54,6 +54,6 @@ server.on( "error", function( error ) { server.listen( port ); -process.on( "SIGINT", function() { +process.once( "SIGINT", function() { server.close(); }); diff --git a/scripts/wordpress-update.js b/scripts/wordpress-update.js index 5a12b67..2eaf5c9 100644 --- a/scripts/wordpress-update.js +++ b/scripts/wordpress-update.js @@ -284,7 +284,7 @@ processActions(function( error ) { }); // Let the current action finish, then stop processing and exit -process.on( "SIGINT", function() { +process.once( "SIGINT", function() { processActionsSince = function( actionId, fn ) { fn( null ); }; From 8396170844147729907feaad059cb9490000763d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 15 Jan 2013 16:17:51 -0500 Subject: [PATCH 004/128] Don't restart the manager on SIGHUP. --- scripts/manager.js | 42 +++++++++++++----------------------------- 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/scripts/manager.js b/scripts/manager.js index cfe64a3..80319ff 100644 --- a/scripts/manager.js +++ b/scripts/manager.js @@ -8,7 +8,12 @@ function Process( script ) { Process.list.push( this ); } -Process.list = []; +Process.startAll = function() { + this.list = []; + new Process( "update-server.js" ); + new Process( "wordpress-update.js" ); + new Process( "retry.js" ); +}; Process.prototype.respawn = true; @@ -23,13 +28,9 @@ Process.prototype.onExit = function( code ) { } }; -new Process( "update-server.js" ); -new Process( "wordpress-update.js" ); -new Process( "retry.js" ); +Process.startAll(); -// SIGINT is a graceful shutdown of all processes. -// The signal passes through to the children and when they all exit, -// the manager will end on its own. +// SIGINT is a graceful shutdown of all processes process.once( "SIGINT", function() { Process.list.forEach(function( process ) { process.respawn = false; @@ -37,28 +38,11 @@ process.once( "SIGINT", function() { }); }); -// SIGHUP is a graceful restart of all processes, including the manager. -// A SIGINT is sent to all children and a new manager is spawned to create -// new child processes. -process.once( "SIGHUP", function() { - var waiting = Process.list.length; - - function checkForShutdown() { - waiting--; - if ( !waiting ) { - process.exit(); - } - } - - // Spawn a new manager, which will spawn new children - spawn( process.argv[ 0 ], process.argv.slice( 1 ), { - detached: true - }); - - // Gracefully shutdown all child processes - Process.list.forEach(function( process ) { - process.respawn = false; - process.child.on( "exit", checkForShutdown ); +// SIGHUP is a graceful restart of all child processes +process.on( "SIGHUP", function() { + var old = Process.list; + Process.startAll(); + old.forEach(function( process ) { process.child.kill( "SIGINT" ); }); }); From 8ac6082330cf2249262a066bd3c6fa52d3fb8217 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 15 Jan 2013 16:30:48 -0500 Subject: [PATCH 005/128] Update all dependencies; add .jshintrc. --- .jshintrc | 13 +++++++++++++ grunt.js | 5 +++++ lib/hook.js | 5 ++--- lib/retrydb.js | 2 +- lib/service.js | 7 ++++--- lib/service/github.js | 3 +-- package.json | 10 +++++----- scripts/wordpress-update.js | 2 +- 8 files changed, 32 insertions(+), 15 deletions(-) create mode 100644 .jshintrc diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 0000000..325f247 --- /dev/null +++ b/.jshintrc @@ -0,0 +1,13 @@ +{ + "curly": true, + "eqnull": true, + "eqeqeq": true, + "expr": true, + "noarg": true, + "node": true, + "onevar": true, + "trailing": true, + "undef": true, + "unused": true, + "strict": false +} diff --git a/grunt.js b/grunt.js index 2a96fbc..8c82f81 100644 --- a/grunt.js +++ b/grunt.js @@ -10,6 +10,11 @@ grunt.initConfig({ src: [ "lib/**", "scripts/**" ] }, + jshint: { + grunt: { options: grunt.file.readJSON( ".jshintrc" ) }, + src: { options: grunt.file.readJSON( ".jshintrc" ) } + }, + test: { files: [ "test/**/*.js" ] }, diff --git a/lib/hook.js b/lib/hook.js index 2a545ec..dca57f2 100644 --- a/lib/hook.js +++ b/lib/hook.js @@ -1,5 +1,4 @@ -var semver = require( "semver" ), - Step = require( "step" ), +var Step = require( "step" ), pluginsDb = require( "./pluginsdb" ), retry = require( "./retrydb" ), logger = require( "./logger" ); @@ -136,7 +135,7 @@ function processRelease( repo, tag, file, manifest, fn ) { }, // track the new release - function( error, owner ) { + function( /*error, owner*/ ) { pluginsDb.addRelease( repo.id, tag, file, manifest, this ); }, diff --git a/lib/retrydb.js b/lib/retrydb.js index 2ce87ca..d045350 100644 --- a/lib/retrydb.js +++ b/lib/retrydb.js @@ -88,7 +88,7 @@ module.exports = { var Step = require( "step" ); Step( - function( error ) { + function() { connect( this ); }, diff --git a/lib/service.js b/lib/service.js index 4a7385f..84e78ae 100644 --- a/lib/service.js +++ b/lib/service.js @@ -20,7 +20,7 @@ function isObject( obj ) { return ({}).toString.call( obj ) === "[object Object]"; } -function isUrl( str ) { +function isUrl( /*str*/ ) { // TODO: URL validation return true; } @@ -342,7 +342,8 @@ extend( Repo.prototype, { // validate manifests function( error, files, manifests ) { - var mappedManifests = {}; + var i, l, + mappedManifests = {}; if ( error ) { return fn( error ); @@ -355,7 +356,7 @@ extend( Repo.prototype, { return fn( null, null ); } - for ( var i = 0, l = manifests.length; i < l; i++ ) { + for ( i = 0, l = manifests.length; i < l; i++ ) { if ( repo.validateManifest( manifests[ i ], tag, suites[ repo.id ], files[ i ] ).length ) { return fn( null, null ); diff --git a/lib/service/github.js b/lib/service/github.js index c4cd874..a2caf4e 100644 --- a/lib/service/github.js +++ b/lib/service/github.js @@ -1,7 +1,6 @@ var fs = require( "fs" ), querystring = require( "querystring" ), exec = require( "child_process" ).exec, - semver = require( "semver" ), Step = require( "step" ), mkdirp = require( "mkdirp" ), service = require( "../service" ); @@ -97,7 +96,7 @@ extend( GithubRepo.prototype, { }, getManifestFiles: function( tag, fn ) { - exec( "git ls-tree " + tag + " --name-only", { cwd: this.path }, function( error, stdout, stderr ) { + exec( "git ls-tree " + tag + " --name-only", { cwd: this.path }, function( error, stdout ) { if ( error ) { return fn( error ); } diff --git a/package.json b/package.json index 857ec41..df847a3 100644 --- a/package.json +++ b/package.json @@ -9,14 +9,14 @@ "url": "git://github.com/jquery/plugins.jquery.com.git" }, "dependencies": { - "mkdirp": "0.3.3", - "semver": "1.0.14", + "mkdirp": "0.3.4", + "semver": "1.1.2", "sqlite3": "2.1.5", "step": "0.0.5", - "rimraf": "2.0.2", + "rimraf": "2.1.1", "wordpress": "0.1.3", - "grunt": "0.3.12", - "grunt-wordpress": "1.0.2", + "grunt": "0.3.17", + "grunt-wordpress": "1.0.5", "logger": "git://github.com/jquery/node-logger.git" } } diff --git a/scripts/wordpress-update.js b/scripts/wordpress-update.js index 2eaf5c9..ecd7cf1 100644 --- a/scripts/wordpress-update.js +++ b/scripts/wordpress-update.js @@ -168,7 +168,7 @@ actions.addRelease = function( data, fn ) { wordpress.newPost( pageDetails, this.parallel() ); }, - function( error, versions, latest ) { + function( error /*, versions, latest*/ ) { if ( error ) { return fn( error ); } From a656edb19d92ca787e7779be70ed66c086cd8b37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 15 Jan 2013 20:47:57 -0500 Subject: [PATCH 006/128] Real list of suites. --- lib/suites.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/suites.json b/lib/suites.json index d84b2f6..797e3c8 100644 --- a/lib/suites.json +++ b/lib/suites.json @@ -1,3 +1,3 @@ { - "github/rdworth/temp-jqueryui": "ui." + "github/jquery/jquery-ui": "ui." } From 348f41127c2202edde2904b49a8bf27a2434a5cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 16 Jan 2013 11:07:27 -0500 Subject: [PATCH 007/128] Ensure the path to last-action is correct. --- grunt.js | 4 ++-- lib/config.js | 1 + scripts/wordpress-update.js | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/grunt.js b/grunt.js index 8c82f81..7513424 100644 --- a/grunt.js +++ b/grunt.js @@ -61,7 +61,7 @@ grunt.registerTask( "clean-all", function() { // clean pluginsDb rimraf.sync( config.pluginsDb ); - rimraf.sync( "last-action" ); + rimraf.sync( config.lastActionFile ); // clean retrydb rimraf.sync( retry.dbPath ); @@ -74,7 +74,7 @@ grunt.registerTask( "clean", function() { var rimraf = require( "rimraf" ), retry = require( "./lib/retrydb" ); - rimraf.sync( "last-action" ); + rimraf.sync( config.lastActionFile ); rimraf.sync( retry.dbPath ); }); diff --git a/lib/config.js b/lib/config.js index 99bb738..7dd033c 100644 --- a/lib/config.js +++ b/lib/config.js @@ -11,5 +11,6 @@ function resolvePath( key, _default ) { resolvePath( "repoDir", path.resolve( tmpDir, "plugin-repos" ) ); resolvePath( "pluginsDb", "plugins.db" ); +resolvePath( "lastActionFile", "last-action" ); module.exports = config; diff --git a/scripts/wordpress-update.js b/scripts/wordpress-update.js index ecd7cf1..0569444 100644 --- a/scripts/wordpress-update.js +++ b/scripts/wordpress-update.js @@ -1,6 +1,7 @@ var fs = require( "fs" ), semver = require( "semver" ), Step = require( "step" ), + config = require( "../lib/config" ), wordpress = require( "../lib/wordpress" ), pluginsDb = require( "../lib/pluginsdb" ), service = require( "../lib/service" ), @@ -186,7 +187,7 @@ actions.addRelease = function( data, fn ) { function processActions( fn ) { Step( function() { - fs.readFile( "last-action", "utf8", this ); + fs.readFile( config.lastActionFile, "utf8", this ); }, function( error, lastAction ) { @@ -231,7 +232,7 @@ var processActionsSince = function( actionId, fn ) { } this.parallel()( null, action ); - fs.writeFile( "last-action", action.id, this.parallel() ); + fs.writeFile( config.lastActionFile, action.id, this.parallel() ); }, function( error, action ) { From 80125950549e54c9c51ef867a46d450427c476d2 Mon Sep 17 00:00:00 2001 From: David Schnur Date: Tue, 15 Jan 2013 18:37:01 -0500 Subject: [PATCH 008/128] Catch SIGTERM for graceful shutdown. SIGTERM now mirrors the behavior of SIGINT. --- scripts/manager.js | 8 +++++--- scripts/retry.js | 7 +++++-- scripts/update-server.js | 7 +++++-- scripts/wordpress-update.js | 7 +++++-- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/scripts/manager.js b/scripts/manager.js index 80319ff..dc47482 100644 --- a/scripts/manager.js +++ b/scripts/manager.js @@ -30,13 +30,15 @@ Process.prototype.onExit = function( code ) { Process.startAll(); -// SIGINT is a graceful shutdown of all processes -process.once( "SIGINT", function() { +// SIGINT and SIGTERM perform a graceful shutdown of all processes +function shutdownHook() { Process.list.forEach(function( process ) { process.respawn = false; process.child.kill( "SIGINT" ); }); -}); +} +process.once( "SIGINT", shutdownHook ); +process.once( "SIGTERM", shutdownHook ); // SIGHUP is a graceful restart of all child processes process.on( "SIGHUP", function() { diff --git a/scripts/retry.js b/scripts/retry.js index 4cc41b7..720026b 100644 --- a/scripts/retry.js +++ b/scripts/retry.js @@ -89,8 +89,11 @@ processFailures(function( error ) { }); // Let the current retry finish, then stop processing and exit -process.once( "SIGINT", function() { +function shutdownHook() { processFailures = function( fn ) { fn( null ); }; -}); +} + +process.once( "SIGINT", shutdownHook ); +process.once( "SIGTERM", shutdownHook ); diff --git a/scripts/update-server.js b/scripts/update-server.js index 1608af5..64d4e27 100644 --- a/scripts/update-server.js +++ b/scripts/update-server.js @@ -54,6 +54,9 @@ server.on( "error", function( error ) { server.listen( port ); -process.once( "SIGINT", function() { +function shutdownHook() { server.close(); -}); +} + +process.once( "SIGINT", shutdownHook ); +process.once( "SIGTERM", shutdownHook ); diff --git a/scripts/wordpress-update.js b/scripts/wordpress-update.js index 0569444..a6495e5 100644 --- a/scripts/wordpress-update.js +++ b/scripts/wordpress-update.js @@ -285,8 +285,11 @@ processActions(function( error ) { }); // Let the current action finish, then stop processing and exit -process.once( "SIGINT", function() { +function shutdownHook() { processActionsSince = function( actionId, fn ) { fn( null ); }; -}); +} + +process.once( "SIGINT", shutdownHook ); +process.once( "SIGTERM", shutdownHook ); From d18bdb084db4b888b3ef77b92182e49045c2ae90 Mon Sep 17 00:00:00 2001 From: Corey Frang Date: Wed, 16 Jan 2013 11:05:09 -0600 Subject: [PATCH 009/128] Adding support for bugs: { url: "..." } --- lib/service.js | 18 ++++++++++++++---- test/service.js | 12 ++++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/lib/service.js b/lib/service.js index 84e78ae..60e21ce 100644 --- a/lib/service.js +++ b/lib/service.js @@ -217,11 +217,21 @@ extend( Repo.prototype, { } } + if ( "bugs" in manifest ) { - if ( typeof manifest.bugs !== "string" ) { - errors.push( "Invalid data type for bugs; must be a string." ); - } else if ( !isUrl( manifest.bugs ) ) { - errors.push( "Invalid value for bugs." ); + // check { url: "..." } format + if ( typeof manifest.bugs === "object" ) { + if ( typeof manifest.bugs.url !== "string" ) { + errors.push( "Invalid data type for bugs.url; must be a string." ); + } else if ( !isUrl( manifest.bugs.url ) ) { + errors.push( "Invalid value for bugs.url." ); + } + } else { + if ( typeof manifest.bugs !== "string" ) { + errors.push( "Invalid data type for bugs; must be a string." ); + } else if ( !isUrl( manifest.bugs ) ) { + errors.push( "Invalid value for bugs." ); + } } } diff --git a/test/service.js b/test/service.js index 836f0cc..d0c3052 100644 --- a/test/service.js +++ b/test/service.js @@ -335,6 +335,18 @@ var tests = { // ]); // }, + "bugs - invalid type {}": function( manifest, fn ) { + manifest.bugs = {}; + fn( manifest, manifest.version, [ + "Invalid data type for bugs.url; must be a string." + ]); + }, + + "bugs - { url: \"valid\" }": function( manifest, fn ) { + manifest.bugs = { url: "http://example.com/bugs/" }; + fn( manifest, manifest.version, [] ); + }, + "maintainers - invalid type": function( manifest, fn ) { manifest.maintainers = "John"; fn( manifest, manifest.version, [ From 0905d72615b3ebe66956d41d21a505ac0f83eb95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 16 Jan 2013 13:02:10 -0500 Subject: [PATCH 010/128] Whitespace. --- lib/service.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/service.js b/lib/service.js index 60e21ce..fcf5831 100644 --- a/lib/service.js +++ b/lib/service.js @@ -217,7 +217,6 @@ extend( Repo.prototype, { } } - if ( "bugs" in manifest ) { // check { url: "..." } format if ( typeof manifest.bugs === "object" ) { From 08e689ac7fcfc6f398185344d884b25a54dda961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 16 Jan 2013 13:07:05 -0500 Subject: [PATCH 011/128] Switch from logger to simple-log. --- lib/logger.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/logger.js b/lib/logger.js index 1f6897c..75e4d37 100644 --- a/lib/logger.js +++ b/lib/logger.js @@ -1 +1 @@ -module.exports = require( "logger" ).init( "plugins.jquery.com" ); +module.exports = require( "simple-log" ).init( "plugins.jquery.com" ); diff --git a/package.json b/package.json index df847a3..072c474 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,6 @@ "wordpress": "0.1.3", "grunt": "0.3.17", "grunt-wordpress": "1.0.5", - "logger": "git://github.com/jquery/node-logger.git" + "simple-log": "1.0.1" } } From 42e704b81c31544e6f88f340d8b68784dfdec960 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 16 Jan 2013 13:22:04 -0500 Subject: [PATCH 012/128] Log all manifest errors. --- lib/service.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/service.js b/lib/service.js index fcf5831..5663bb6 100644 --- a/lib/service.js +++ b/lib/service.js @@ -1,6 +1,7 @@ var semver = require( "semver" ), Step = require( "step" ), config = require( "./config" ), + logger = require( "./logger" ), suites = require( "./suites" ), blacklist = require( "./blacklist" ); @@ -269,6 +270,10 @@ extend( Repo.prototype, { } } + if ( errors.length ) { + logger.log( "Manifest errors:", this.id, version, errors ); + } + return errors; } }); From 68de49f3e9b148bee56056e6611a59131ea40ff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 16 Jan 2013 13:40:56 -0500 Subject: [PATCH 013/128] 1.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 072c474..5061dcd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plugins.jquery.com", - "version": "0.0.0", + "version": "1.0.0", "author": "jQuery Project", "description": "The official jQuery plugins site", "homepage": "https://github.com/jquery/plugins.jquery.com", From a5cb570e5a7e186ce530317263e4262265dc4168 Mon Sep 17 00:00:00 2001 From: "adam j. sontag" Date: Wed, 16 Jan 2013 16:14:40 -0500 Subject: [PATCH 014/128] Reconfiguring build process to use grunt-jquery-content to build documentation --- .gitignore | 3 +- grunt.js | 36 +++++++++++++------ package.json | 3 ++ {site-content/page => pages}/docs.html | 0 {site-content/page => pages}/docs/names.html | 0 .../page => pages}/docs/publish.html | 0 6 files changed, 30 insertions(+), 12 deletions(-) rename {site-content/page => pages}/docs.html (100%) rename {site-content/page => pages}/docs/names.html (100%) rename {site-content/page => pages}/docs/publish.html (100%) diff --git a/.gitignore b/.gitignore index 8ed5d67..679bd82 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ config.json last-action plugins.db retry.db -node_modules \ No newline at end of file +node_modules +dist/ diff --git a/grunt.js b/grunt.js index 7513424..3582f19 100644 --- a/grunt.js +++ b/grunt.js @@ -3,23 +3,37 @@ var config = require( "./lib/config" ); module.exports = function( grunt ) { grunt.loadNpmTasks( "grunt-wordpress" ); +grunt.loadNpmTasks( "grunt-clean" ); +grunt.loadNpmTasks( "grunt-jquery-content" ); +grunt.loadNpmTasks( "grunt-check-modules" ); grunt.initConfig({ + clean: { + wordpress: "dist/" + }, lint: { grunt: "grunt.js", src: [ "lib/**", "scripts/**" ] }, - jshint: { grunt: { options: grunt.file.readJSON( ".jshintrc" ) }, src: { options: grunt.file.readJSON( ".jshintrc" ) } }, - + watch: { + docs: { + files: "pages/**", + tasks: "docs" + } + }, test: { files: [ "test/**/*.js" ] }, - - wordpress: config.wordpress + "build-pages": { + all: grunt.file.expandFiles( "pages/**" ) + }, + wordpress: grunt.utils._.extend({ + dir: "dist/wordpress" + }, config.wordpress ) }); // We only want to sync the documentation, so we override wordpress-get-postpaths @@ -39,9 +53,9 @@ grunt.registerHelper( "wordpress-get-postpaths", function( fn ) { }); }); -grunt.registerTask( "docs", function() { +grunt.registerTask( "sync-docs", function() { var done = this.async(); - grunt.helper( "wordpress-sync-posts", "site-content/", function( error ) { + grunt.helper( "wordpress-sync-posts", "dist/wordpress/posts/", function( error ) { if ( error ) { return done( false ); } @@ -67,10 +81,10 @@ grunt.registerTask( "clean-all", function() { rimraf.sync( retry.dbPath ); }); -// clean will only delete information about retries. It will not delete the +// clean-retries will only delete information about retries. It will not delete the // plugin registry and it will not remove local clones. This is useful for // restoring a WordPress site on a server that already has repos. -grunt.registerTask( "clean", function() { +grunt.registerTask( "clean-retries", function() { var rimraf = require( "rimraf" ), retry = require( "./lib/retrydb" ); @@ -119,8 +133,8 @@ grunt.registerTask( "restore-repos", function() { }); grunt.registerTask( "default", "lint test" ); -grunt.registerTask( "setup", "setup-pluginsdb setup-retrydb docs" ); -grunt.registerTask( "update", "docs" ); -grunt.registerTask( "restore", "clean setup-retrydb docs restore-repos" ); +grunt.registerTask( "setup", "setup-pluginsdb setup-retrydb sync-docs" ); +grunt.registerTask( "docs", "clean build-pages sync-docs" ); +grunt.registerTask( "restore", "clean-retries setup-retrydb sync-docs restore-repos" ); }; diff --git a/package.json b/package.json index 5061dcd..ad43b59 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,9 @@ "wordpress": "0.1.3", "grunt": "0.3.17", "grunt-wordpress": "1.0.5", + "grunt-check-modules": "0.1.0", + "grunt-jquery-content": "0.8.1", + "grunt-clean": "0.3.0", "simple-log": "1.0.1" } } diff --git a/site-content/page/docs.html b/pages/docs.html similarity index 100% rename from site-content/page/docs.html rename to pages/docs.html diff --git a/site-content/page/docs/names.html b/pages/docs/names.html similarity index 100% rename from site-content/page/docs/names.html rename to pages/docs/names.html diff --git a/site-content/page/docs/publish.html b/pages/docs/publish.html similarity index 100% rename from site-content/page/docs/publish.html rename to pages/docs/publish.html From 2ed5244f487f758d467b8edafdeee2630fe6554c Mon Sep 17 00:00:00 2001 From: "adam j. sontag" Date: Wed, 16 Jan 2013 16:15:16 -0500 Subject: [PATCH 015/128] Move package manifest documentation out of vestigial "docs" folder into actual site documentation proper --- README.md | 2 +- .../docs/package-manifest.md | 184 +++++++++--------- 2 files changed, 97 insertions(+), 89 deletions(-) rename docs/manifest.md => pages/docs/package-manifest.md (67%) diff --git a/README.md b/README.md index bce669e..33b71bd 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ The jQuery Plugins site, http://plugins.jquery.com/ ### How it works -The plugins site is an index of GitHub repositories that contain jQuery plugins. The repositories can contain one or many jQuery plugin with an accompanying valid jquery.json manifest files in the repository root. The specification for this file is in [docs/manifest.md](/jquery/plugins.jquery.com/blob/master/docs/manifest.md). +The plugins site is an index of GitHub repositories that contain jQuery plugins. The repositories can contain one or many jQuery plugin with an accompanying valid jquery.json manifest files in the repository root. The specification for this file lives [here](plugins.jquery.com/docs/package-manifest). ### How to list a plugin diff --git a/docs/manifest.md b/pages/docs/package-manifest.md similarity index 67% rename from docs/manifest.md rename to pages/docs/package-manifest.md index 5841df5..c572525 100644 --- a/docs/manifest.md +++ b/pages/docs/package-manifest.md @@ -1,9 +1,8 @@ -Specification of the jQuery Plugins Site Manifest File -====================================================== + -# LIVING SPEC (heavily inspired by that of npm, thanks isaacs) - -This document is all you need to know about what's required in your jquery.json +This document is all you need to know about what's required in your `*.jquery.json` manifest file(s). Manifest files must live in the root of your repository and exist in your tags. @@ -11,9 +10,11 @@ The files must be actual JSON, not just a JavaScript object literal. **NOTE: Manifest file names must contain the plugin name, e.g. foo.jquery.json.** -# Fields +--- + +## Fields -## Required Fields +### Required Fields * name * version @@ -22,7 +23,7 @@ The files must be actual JSON, not just a JavaScript object literal. * licenses * dependencies -## Optional Fields +### Optional Fields * description * keywords @@ -33,7 +34,7 @@ The files must be actual JSON, not just a JavaScript object literal. * bugs * maintainers -## name +### name The *most* important things in your manifest file are the name and version fields. The name and version together form an identifier that is assumed @@ -43,17 +44,17 @@ changes to the version. The name is what your thing is called. Some tips: * Don't put "js" or "jquery" in the name. It's assumed that it's js and jquery, since - you're writing a jquery.json manifest file. +you're writing a jquery.json manifest file. * The name ends up being part of a URL. Any name with non-url-safe characters will - be rejected. The jQuery Plugins Site is UTF-8. +be rejected. The jQuery Plugins Site is UTF-8. * The name should be short, but also reasonably descriptive. * You may want to check [the plugins site](http://plugins.jquery.com/) - to see if there's something by that name already, before you get too attached to it. +to see if there's something by that name already, before you get too attached to it. * If you have a plugin with the same name as a plugin already in the jQuery Plugins - Site, either consider renaming your plugin or namespacing it. For example, jQuery UI - plugins are listed with the "ui." prefix (e.g. ui.dialog, ui.autocomplete). +Site, either consider renaming your plugin or namespacing it. For example, jQuery UI +plugins are listed with the "ui." prefix (e.g. ui.dialog, ui.autocomplete). -## version +### version The *most* important things in your manifest file are the name and version fields. The name and version together form an identifier that is assumed @@ -63,31 +64,33 @@ per [node-semver](https://github.com/isaacs/node-semver). See [Specifying Versions](#specifying-versions). -## title +### title A nice complete and pretty title of your plugin. This will be used for the page title and top-level heading on your plugin's page. Include jQuery (if you want) and spaces and mixed case, unlike [name](#field-name). -## author +### author One person. See [People Fields](#people-fields). -## licenses +### licenses Array of licenses under which the plugin is provided. Each license is a hash with a url property linking to the actual text and an optional "type" property specifying the type of license. If the license is one of the [official open source licenses](http://www.opensource.org/licenses/alphabetical), the official license name or its abbreviation may be explicated with the "type" property. - "licenses": [ - { - "type": "GPLv2", - "url": "http://www.example.com/licenses/gpl.html" - } - ] +``` +"licenses": [ + { + "type": "GPLv2", + "url": "http://www.example.com/licenses/gpl.html" + } +] +``` -## dependencies +### dependencies Dependencies are specified with a simple hash of package name to version range. The version range is EITHER a string which has one or more @@ -103,59 +106,63 @@ of each library you depend on. You must list at least one dependency, `jquery` (note that it's lower-case). -## description +### description Put a description in it. It's a string. This helps people discover your plugin, as it's listed on the jQuery Plugins Site. -## keywords +### keywords Put keywords in it. It's an array of strings. This helps people discover your plugin as it's listed on the jQuery Plugins Site. Keywords may only contain letters, numbers, hyphens, and dots. -## homepage +### homepage The url to the plugin homepage. -## docs +### docs The url to the plugin documentation. -## demo +### demo The url to the plugin demo or demos. -## download +### download The url to download the plugin. A download URL will be automatically generated based on the tag in GitHub, but you can specify a custom URL if you'd prefer to send users to your own site. -## bugs +### bugs The url to the bug tracker for the plugin. -## maintainers +### maintainers An array of people. See [People Fields](#people-fields). -# People Fields +## People Fields A "person" is an object with a "name" field and optionally "url" and "email", like this: - { - "name" : "Barney Rubble", - "email" : "b@rubble.com", - "url" : "http://barnyrubble.tumblr.com/" - } +``` json +{ + "name" : "Barney Rubble", + "email" : "b@rubble.com", + "url" : "http://barnyrubble.tumblr.com/" +} +``` Both the email and url are optional. -# Specifying Versions +--- + +## Specifying Versions Version range descriptors may be any of the following styles, where "version" is a semver compatible version identifier. @@ -175,22 +182,24 @@ is a semver compatible version identifier. For example, these are all valid: - { "dependencies" : - { - "foo" : "1.0.0 - 2.9999.9999", - "bar" : ">=1.0.2 <2.1.2", - "baz" : ">1.0.2 <=2.3.4", - "boo" : "2.0.1", - "qux" : "<1.0.0 || >=2.3.1 <2.4.5 || >=2.5.2 <3.0.0", - "asd" : "http://asdf.com/asdf.tar.gz", - "til" : "~1.2", - "elf" : "~1.2.3", - "two" : "2.x", - "thr" : "3.3.x" - } - } +```json +{ "dependencies" : + { + "foo" : "1.0.0 - 2.9999.9999", + "bar" : ">=1.0.2 <2.1.2", + "baz" : ">1.0.2 <=2.3.4", + "boo" : "2.0.1", + "qux" : "<1.0.0 || >=2.3.1 <2.4.5 || >=2.5.2 <3.0.0", + "asd" : "http://asdf.com/asdf.tar.gz", + "til" : "~1.2", + "elf" : "~1.2.3", + "two" : "2.x", + "thr" : "3.3.x" + } +} +``` -## Tilde Version Ranges +### Tilde Version Ranges A range specifier starting with a tilde `~` character is matched against a version in the following fashion. @@ -204,7 +213,7 @@ For example, the following are equivalent: * `"~1.2" = ">=1.2.0 <2.0.0"` * `"~1" = ">=1.0.0 <2.0.0"` -## X Version Ranges +### X Version Ranges An "x" in a version range specifies that the version number must start with the supplied digits, but any digit may be used in place of the x. @@ -220,45 +229,44 @@ The following are equivalent: You may not supply a comparator with a version containing an x. Any digits after the first "x" are ignored. -## Sample manifest +### Sample manifest **color.jquery.json** ```json { - "name": "color", - "version": "2.0.0-beta.1", - "title": "jQuery.Color()", + "name": "color", + "title": "jQuery Color", + "description": "jQuery plugin for color manipulation and animation support.", + "keywords": [ + "color", + "animation" + ], + "version": "2.1.2", "author": { - "name": "John Resig", - "url": "https://github.com/jeresig" + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-color/blob/2.1.2/AUTHORS.txt" }, + "maintainers": [ + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + } + ], "licenses": [ - { - "type": "MIT", - "url": "https://github.com/jquery/jquery-color/raw/2.0.0-beta.1/MIT-LICENSE.txt" - }, - { - "type": "GPLv2", - "url": "https://github.com/jquery/jquery-color/raw/2.0.0-beta.1/GPL-LICENSE.txt" - } - ], - "dependencies": { - "jquery": ">=1.6" - }, - "description": "The main purpose of this plugin is to animate color properties on elements using jQuery's .animate()", - "keywords": [ - "color", - "animate", - "rgba", - "hsla" - ], + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-color/blob/2.1.2/MIT-LICENSE.txt" + } + ], + "bugs": "https://github.com/jquery/jquery-color/issues", "homepage": "https://github.com/jquery/jquery-color", - "maintainers": [ - { - "name": "Corey Frang", - "url": "https://github.com/gnarf37" - } - ] + "docs": "https://github.com/jquery/jquery-color", + "download": "http://code.jquery.com/#color", + "dependencies": { + "jquery": ">=1.5" + } } -``` \ No newline at end of file +``` + From 387397c8ddaf31e5ad7fc9c43ab1eb75b0f53423 Mon Sep 17 00:00:00 2001 From: "adam j. sontag" Date: Wed, 16 Jan 2013 16:21:10 -0500 Subject: [PATCH 016/128] Rename docs task back to update --- grunt.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grunt.js b/grunt.js index 3582f19..ffd1851 100644 --- a/grunt.js +++ b/grunt.js @@ -134,7 +134,7 @@ grunt.registerTask( "restore-repos", function() { grunt.registerTask( "default", "lint test" ); grunt.registerTask( "setup", "setup-pluginsdb setup-retrydb sync-docs" ); -grunt.registerTask( "docs", "clean build-pages sync-docs" ); +grunt.registerTask( "update", "clean build-pages sync-docs" ); grunt.registerTask( "restore", "clean-retries setup-retrydb sync-docs restore-repos" ); }; From b8cbd0f528609e753ee8d9e02bbf5a5fa92fc5f3 Mon Sep 17 00:00:00 2001 From: Corey Frang Date: Wed, 16 Jan 2013 16:16:39 -0600 Subject: [PATCH 017/128] Updating publishing docs --- pages/docs/publish.html | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pages/docs/publish.html b/pages/docs/publish.html index ace352b..bcb9747 100644 --- a/pages/docs/publish.html +++ b/pages/docs/publish.html @@ -1,5 +1,5 @@

Publishing your plugin on this site is a simple two step process.

@@ -12,12 +12,13 @@

Post-Receive Hook

http://plugins.jquery.com/postreceive-hook. Now you're ready to publish your plugin.

+

Adding a Manifest

+ +

The jQuery Plugins Registry will look in the root level of your repository for any files named *.jquery.json. You will want to create yourplugin.jquery.json according to the package manifest specification. +

Publishing a Version

-

Once the post-receive hook is setup, publishing your plugin is as simple as -tagging the version in git and pushing the tag to GitHub. The post-receive hook -will notify the plugins site that a new tag is available and the plugins site -will take care of the rest!

+

After the post-receive hook is setup and your manifest has been added, publishing your plugin is as simple as tagging the version in git and pushing the tag to GitHub. The post-receive hook will notify the plugins site that a new tag is available and the plugins site will take care of the rest!

The name of the tag must be a valid semver value. The tag name may contain an @@ -25,7 +26,10 @@

Publishing a Version

in the manifest file. If the manifest file is valid, then the version will be automatically added to the plugins site.

+

Having Trouble?

Unfortunately we do not currently have a system for notifying you if there is a problem. If you're interested in helping improve this aspect of the plugins site, we'd love your help.

+ +

If you encounter trouble getting this process to work with your plugin, please join the IRC channel #jquery-content on freenode. If you can't seem to connect with someone in the IRC channel, please feel free to email us at plugins@jquery.com.

From 80349a2e016f527487d93598b8d71703596bb756 Mon Sep 17 00:00:00 2001 From: Corey Frang Date: Wed, 16 Jan 2013 16:22:28 -0600 Subject: [PATCH 018/128] Adding email to names page instead of 'contact a team member' --- pages/docs/names.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/docs/names.html b/pages/docs/names.html index 648ae41..cb7dce3 100644 --- a/pages/docs/names.html +++ b/pages/docs/names.html @@ -19,7 +19,7 @@

First Come, First Serve

Transferring Ownership

-

While most plugins will only ever have one owner, there are times when the original owner may move on to other projects and wish to transfer ownership to someone else. There is currently no automated process for this, the original owner must contact a jQuery team member, prove ownership and indicate who the new owner should be.

+

While most plugins will only ever have one owner, there are times when the original owner may move on to other projects and wish to transfer ownership to someone else. There is currently no automated process for this, the original owner must contact plugins@jquery.com, prove ownership and indicate who the new owner should be.

In the case of an abandoned plugin where the original owner is no longer active, the jQuery team can choose to change ownership at their discretion. These will indeed be a rare occurrence, likely requiring an event such as _why or Mark Pilgrim's infosuicide.

From 6f2e87ce8c533820e93e153528bdd51442c59f25 Mon Sep 17 00:00:00 2001 From: Corey Frang Date: Wed, 16 Jan 2013 16:36:42 -0600 Subject: [PATCH 019/128] Converted publishing docs to markdown, added tag example using bash --- pages/docs/publish.html | 35 ----------------------------------- pages/docs/publish.md | 31 +++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 35 deletions(-) delete mode 100644 pages/docs/publish.html create mode 100644 pages/docs/publish.md diff --git a/pages/docs/publish.html b/pages/docs/publish.html deleted file mode 100644 index bcb9747..0000000 --- a/pages/docs/publish.html +++ /dev/null @@ -1,35 +0,0 @@ - - -

Publishing your plugin on this site is a simple two step process.

- -

Post-Receive Hook

- -

First, you'll need to create a post-receive hook on GitHub. Just follow the -step-by-step guide -for adding a webhook and set the URL to -http://plugins.jquery.com/postreceive-hook. Now you're ready to publish -your plugin.

- -

Adding a Manifest

- -

The jQuery Plugins Registry will look in the root level of your repository for any files named *.jquery.json. You will want to create yourplugin.jquery.json according to the package manifest specification. - -

Publishing a Version

- -

After the post-receive hook is setup and your manifest has been added, publishing your plugin is as simple as tagging the version in git and pushing the tag to GitHub. The post-receive hook will notify the plugins site that a new tag is available and the plugins site will take care of the rest!

- -

The name of the tag must be a valid -semver value. The tag name may contain an -optional v prefix. The tag name must also match the version listed -in the manifest file. If the manifest file is valid, then the version will be -automatically added to the plugins site.

- -

Having Trouble?

-

Unfortunately we do not currently have a system for notifying you if there is -a problem. If you're interested in helping improve this aspect of the plugins -site, we'd love -your help.

- -

If you encounter trouble getting this process to work with your plugin, please join the IRC channel #jquery-content on freenode. If you can't seem to connect with someone in the IRC channel, please feel free to email us at plugins@jquery.com.

diff --git a/pages/docs/publish.md b/pages/docs/publish.md new file mode 100644 index 0000000..bab0dc3 --- /dev/null +++ b/pages/docs/publish.md @@ -0,0 +1,31 @@ + + +Publishing your plugin on the site is a three step process: + +## Add a Post-Receive Hook + +First, you'll need to create a post-receive hook on GitHub. Just follow the +[step-by-step guide for adding a webhook](https://help.github.com/articles/post-receive-hooks) and set the URL to `http://plugins.jquery.com/postreceive-hook`. + +## Add a Manifest to your Repository + +The jQuery Plugins Registry will look in the root level of your repository for any files named `*.jquery.json`. You will want to create yourplugin.jquery.json according to the [package manifest specification](/docs/package-manifest/). You are now ready to publish your plugin! + +## Publishing a Version + +After the post-receive hook is setup and your manifest has been added, publishing your plugin is as simple as tagging the version in git and pushing the tag to GitHub. The post-receive hook will notify the plugins site that a new tag is available and the plugins site will take care of the rest! + +```bash +git tag 0.1.0 ; git push origin --tags +``` + +The name of the tag **must** be a valid [semver](http://semver.org/) value. The tag name may contain an optional `v` prefix. The tag name must also match the version listed +in the manifest file. If the manifest file is valid, then the version will be +automatically added to the plugins site. + +## Having Trouble? +Unfortunately we do not currently have a system for notifying you if there is a problem. If you're interested in helping improve this aspect of the plugins site, we'd [love your help](https://github.com/jquery/plugins.jquery.com/issues/11). + +If you encounter trouble getting this process to work with your plugin, please join the IRC channel [#jquery-content](irc://freenode.net:6667/#jquery-content) on freenode. If you can't seem to connect with someone in the IRC channel, please feel free to email us at [plugins@jquery.com](mailto:plugins@jquery.com). From f5a18b754138c89ee865d8a5666e220ae8077a7f Mon Sep 17 00:00:00 2001 From: Corey Frang Date: Wed, 16 Jan 2013 16:45:25 -0600 Subject: [PATCH 020/128] Made names a markdown file too, all the rest are also --- pages/docs/names.html | 30 ------------------------------ pages/docs/names.md | 30 ++++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 30 deletions(-) delete mode 100644 pages/docs/names.html create mode 100644 pages/docs/names.md diff --git a/pages/docs/names.html b/pages/docs/names.html deleted file mode 100644 index cb7dce3..0000000 --- a/pages/docs/names.html +++ /dev/null @@ -1,30 +0,0 @@ - - -

Before you can list your plugin on this site, you'll need to choose a name for your plugin. The name is a unique identifier that distinguishes your plugin from all other plugins. This is different from the title of your plugin, which you can think of as the display name.

- -

Plugin names may only contain letters, numbers, hypens, dots, and underscores.

- -

We encourage you to follow a few simple tips as well:

-
    -
  • Choose a name that is short, but also reasonably descriptive.
  • -
  • Match your plugin name to your file name, e.g., the foo plugin would live in a file named jquery.foo.js.
  • -
  • Check the site to see if the name you want is available, before getting your heart set on a name that's already taken.
  • -
- -

First Come, First Serve

- -

Names are registered on a first come, first serve basis. Registering a name happens automatically the first time you publish a release of your plugin. You cannot reserve a name prior to releasing your plugin. Once you've registered a name, you are the sole owner of that name. Nobody else will be able to publish a release using the same name. There is no limit on how many plugins/names a single person may register, but all plugins must be legitimate.

- -

Transferring Ownership

- -

While most plugins will only ever have one owner, there are times when the original owner may move on to other projects and wish to transfer ownership to someone else. There is currently no automated process for this, the original owner must contact plugins@jquery.com, prove ownership and indicate who the new owner should be.

- -

In the case of an abandoned plugin where the original owner is no longer active, the jQuery team can choose to change ownership at their discretion. These will indeed be a rare occurrence, likely requiring an event such as _why or Mark Pilgrim's infosuicide.

- -

Prefixes & Plugin Suites

- -

Certain prefixes will also be blacklisted for individual plugins. Large projects which include many plugins in a single repository, such as jQuery UI, are registered as suites. Each suite is required to have a unique prefix and all of their plugin names must use that prefix. As such, no other plugin may use a name with a suite's prefix. Suites must be manually vetted by the jQuery team.

- -

Note: In order to allow proper naming of extensions for plugins in a suite, the prefix blacklisting is only one level deep. For example, jQuery UI owns all ui.* names, but ui.autocomplete.* is open to the public.

diff --git a/pages/docs/names.md b/pages/docs/names.md new file mode 100644 index 0000000..5f52859 --- /dev/null +++ b/pages/docs/names.md @@ -0,0 +1,30 @@ + + +Before you can list your plugin on this site, you'll need to choose a name for your plugin. The name is a unique identifier that distinguishes your plugin from all other plugins. This is different from the title of your plugin, which you can think of as the display name. + +**Plugin names may only contain letters, numbers, hypens, dots, and underscores.** + +We encourage you to follow a few simple tips as well: + + +* Choose a name that is short, but also reasonably descriptive. +* Match your plugin name to your file name, e.g., the foo plugin would live in a file named jquery.foo.js. +* Check the site to see if the name you want is available, before getting your heart set on a name that's already taken. + +## First Come, First Serve + +Names are registered on a first come, first serve basis. Registering a name happens automatically the first time you [publish a release](/docs/publish/) of your plugin. You cannot reserve a name prior to releasing your plugin. Once you've registered a name, you are the sole owner of that name. Nobody else will be able to publish a release using the same name. There is no limit on how many plugins/names a single person may register, but all plugins must be legitimate. + +## Transferring Ownership + +While most plugins will only ever have one owner, there are times when the original owner may move on to other projects and wish to transfer ownership to someone else. There is currently no automated process for this, the original owner must contact [plugins@jquery.com](mailto:plugins@jquery.com), prove ownership and indicate who the new owner should be. + +In the case of an abandoned plugin where the original owner is no longer active, the jQuery team can choose to change ownership at their discretion. These will indeed be a rare occurrence, likely requiring an event such as _why or Mark Pilgrim's infosuicide. + +## Prefixes & Plugin Suites + +Certain prefixes will also be blacklisted for individual plugins. Large projects which include many plugins in a single repository, such as [jQuery UI](http://jqueryui.com), are registered as suites. Each suite is required to have a unique prefix and all of their plugin names must use that prefix. As such, no other plugin may use a name with a suite's prefix. Suites must be manually vetted by the jQuery team. + +*Note: In order to allow proper naming of extensions for plugins in a suite, the prefix blacklisting is only one level deep. For example, jQuery UI owns all `ui.*` names, but `ui.autocomplete.*` is open to the public.* From 8aef70b8bf7fedaf75057f7eb9f4c07da6cdcc80 Mon Sep 17 00:00:00 2001 From: Corey Frang Date: Wed, 16 Jan 2013 16:46:18 -0600 Subject: [PATCH 021/128] Fixing a rendering error in markdown content --- pages/docs/names.html | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 pages/docs/names.html diff --git a/pages/docs/names.html b/pages/docs/names.html new file mode 100644 index 0000000..9f72ab6 --- /dev/null +++ b/pages/docs/names.html @@ -0,0 +1,30 @@ + + +Before you can list your plugin on this site, you'll need to choose a name for your plugin. The name is a unique identifier that distinguishes your plugin from all other plugins. This is different from the title of your plugin, which you can think of as the display name. + +**Plugin names may only contain letters, numbers, hypens, dots, and underscores.** + +We encourage you to follow a few simple tips as well: + + +* Choose a name that is short, but also reasonably descriptive. +* Match your plugin name to your file name, e.g., the foo plugin would live in a file named jquery.foo.js. +* Check the site to see if the name you want is available, before getting your heart set on a name that's already taken. + +## First Come, First Serve + +Names are registered on a first come, first serve basis. Registering a name happens automatically the first time you [publish a release](/docs/publish/) of your plugin. You cannot reserve a name prior to releasing your plugin. Once you've registered a name, you are the sole owner of that name. Nobody else will be able to publish a release using the same name. There is no limit on how many plugins/names a single person may register, but all plugins must be legitimate. + +## Transferring Ownership + +While most plugins will only ever have one owner, there are times when the original owner may move on to other projects and wish to transfer ownership to someone else. There is currently no automated process for this, the original owner must contact [plugins@jquery.com](mailto:plugins@jquery.com), prove ownership and indicate who the new owner should be. + +In the case of an abandoned plugin where the original owner is no longer active, the jQuery team can choose to change ownership at their discretion. These will indeed be a rare occurrence, likely requiring an event such as _why or Mark Pilgrim's infosuicide. + +## Prefixes & Plugin Suites + +Certain prefixes will also be blacklisted for individual plugins. Large projects which include many plugins in a single repository, such as [jQuery UI](http://jqueryui.com), are registered as suites. Each suite is required to have a unique prefix and all of their plugin names must use that prefix. As such, no other plugin may use a name with a suite's prefix. Suites must be manually vetted by the jQuery team. + +**Note:** In order to allow proper naming of extensions for plugins in a suite, the prefix blacklisting is only one level deep. For example, jQuery UI owns all `ui.*` names, but `ui.autocomplete.*` is open to the public. From dd325283fc46f5874c71340291b73e23912222c4 Mon Sep 17 00:00:00 2001 From: Corey Frang Date: Wed, 16 Jan 2013 16:47:43 -0600 Subject: [PATCH 022/128] Accidentially re-commited names.html --- pages/docs/names.html | 30 ------------------------------ pages/docs/names.md | 2 +- 2 files changed, 1 insertion(+), 31 deletions(-) delete mode 100644 pages/docs/names.html diff --git a/pages/docs/names.html b/pages/docs/names.html deleted file mode 100644 index 9f72ab6..0000000 --- a/pages/docs/names.html +++ /dev/null @@ -1,30 +0,0 @@ - - -Before you can list your plugin on this site, you'll need to choose a name for your plugin. The name is a unique identifier that distinguishes your plugin from all other plugins. This is different from the title of your plugin, which you can think of as the display name. - -**Plugin names may only contain letters, numbers, hypens, dots, and underscores.** - -We encourage you to follow a few simple tips as well: - - -* Choose a name that is short, but also reasonably descriptive. -* Match your plugin name to your file name, e.g., the foo plugin would live in a file named jquery.foo.js. -* Check the site to see if the name you want is available, before getting your heart set on a name that's already taken. - -## First Come, First Serve - -Names are registered on a first come, first serve basis. Registering a name happens automatically the first time you [publish a release](/docs/publish/) of your plugin. You cannot reserve a name prior to releasing your plugin. Once you've registered a name, you are the sole owner of that name. Nobody else will be able to publish a release using the same name. There is no limit on how many plugins/names a single person may register, but all plugins must be legitimate. - -## Transferring Ownership - -While most plugins will only ever have one owner, there are times when the original owner may move on to other projects and wish to transfer ownership to someone else. There is currently no automated process for this, the original owner must contact [plugins@jquery.com](mailto:plugins@jquery.com), prove ownership and indicate who the new owner should be. - -In the case of an abandoned plugin where the original owner is no longer active, the jQuery team can choose to change ownership at their discretion. These will indeed be a rare occurrence, likely requiring an event such as _why or Mark Pilgrim's infosuicide. - -## Prefixes & Plugin Suites - -Certain prefixes will also be blacklisted for individual plugins. Large projects which include many plugins in a single repository, such as [jQuery UI](http://jqueryui.com), are registered as suites. Each suite is required to have a unique prefix and all of their plugin names must use that prefix. As such, no other plugin may use a name with a suite's prefix. Suites must be manually vetted by the jQuery team. - -**Note:** In order to allow proper naming of extensions for plugins in a suite, the prefix blacklisting is only one level deep. For example, jQuery UI owns all `ui.*` names, but `ui.autocomplete.*` is open to the public. diff --git a/pages/docs/names.md b/pages/docs/names.md index 5f52859..9f72ab6 100644 --- a/pages/docs/names.md +++ b/pages/docs/names.md @@ -27,4 +27,4 @@ In the case of an abandoned plugin where the original owner is no longer active, Certain prefixes will also be blacklisted for individual plugins. Large projects which include many plugins in a single repository, such as [jQuery UI](http://jqueryui.com), are registered as suites. Each suite is required to have a unique prefix and all of their plugin names must use that prefix. As such, no other plugin may use a name with a suite's prefix. Suites must be manually vetted by the jQuery team. -*Note: In order to allow proper naming of extensions for plugins in a suite, the prefix blacklisting is only one level deep. For example, jQuery UI owns all `ui.*` names, but `ui.autocomplete.*` is open to the public.* +**Note:** In order to allow proper naming of extensions for plugins in a suite, the prefix blacklisting is only one level deep. For example, jQuery UI owns all `ui.*` names, but `ui.autocomplete.*` is open to the public. From e6d4864cb8a33b0fa6dbfee39be96a1802dde2a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 16 Jan 2013 18:06:37 -0500 Subject: [PATCH 023/128] Avoid processing the same repo twice at the same time. --- scripts/update-server.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/update-server.js b/scripts/update-server.js index 64d4e27..22f756c 100644 --- a/scripts/update-server.js +++ b/scripts/update-server.js @@ -1,7 +1,8 @@ var http = require( "http" ), service = require( "../lib/service" ), hook = require( "../lib/hook" ), - logger = require( "../lib/logger" ); + logger = require( "../lib/logger" ), + processing = {}; var port = (function() { var index = process.argv.indexOf( "-p" ); @@ -33,8 +34,17 @@ var server = http.createServer(function( request, response ) { response.writeHead( 202 ); response.end(); + // If we're already processing a request from this repo, skip the new + // request. This prevents parallel processing of the same data which + // could result in duplicate entries. + if ( processing[ repo.id ] ) { + return; + } + // Process the request + processing[ repo.id ] = true; hook.processHook( repo, function( error ) { + delete processing[ repo.id ]; if ( error ) { logger.error( "Error processing hook: " + error.stack ); } From b10ce7e2ba920efd91a23b99b50f9eb1a9ac9ff4 Mon Sep 17 00:00:00 2001 From: Corey Frang Date: Wed, 16 Jan 2013 17:21:04 -0600 Subject: [PATCH 024/128] 1.0.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ad43b59..966e7e4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plugins.jquery.com", - "version": "1.0.0", + "version": "1.0.1", "author": "jQuery Project", "description": "The official jQuery plugins site", "homepage": "https://github.com/jquery/plugins.jquery.com", From 4fbda4318244daa11bf2b4f2581f11f2187126a8 Mon Sep 17 00:00:00 2001 From: "adam j. sontag" Date: Wed, 16 Jan 2013 21:11:56 -0500 Subject: [PATCH 025/128] Formatting changes to publishing docs --- pages/docs/publish.md | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/pages/docs/publish.md b/pages/docs/publish.md index bab0dc3..d2b4e55 100644 --- a/pages/docs/publish.md +++ b/pages/docs/publish.md @@ -7,25 +7,42 @@ Publishing your plugin on the site is a three step process: ## Add a Post-Receive Hook First, you'll need to create a post-receive hook on GitHub. Just follow the -[step-by-step guide for adding a webhook](https://help.github.com/articles/post-receive-hooks) and set the URL to `http://plugins.jquery.com/postreceive-hook`. +[step-by-step guide for adding a +webhook](https://help.github.com/articles/post-receive-hooks) and set the URL +to `http://plugins.jquery.com/postreceive-hook`. ## Add a Manifest to your Repository -The jQuery Plugins Registry will look in the root level of your repository for any files named `*.jquery.json`. You will want to create yourplugin.jquery.json according to the [package manifest specification](/docs/package-manifest/). You are now ready to publish your plugin! +The jQuery Plugins Registry will look in the root level of your repository for +any files named `*.jquery.json`. You will want to create +yourplugin.jquery.json according to the [package manifest +specification](/docs/package-manifest/). You are now ready to publish your +plugin! ## Publishing a Version -After the post-receive hook is setup and your manifest has been added, publishing your plugin is as simple as tagging the version in git and pushing the tag to GitHub. The post-receive hook will notify the plugins site that a new tag is available and the plugins site will take care of the rest! +After the post-receive hook is setup and your manifest has been added, +publishing your plugin is as simple as tagging the version in git and pushing +the tag to GitHub. The post-receive hook will notify the plugins site that a +new tag is available and the plugins site will take care of the rest! ```bash -git tag 0.1.0 ; git push origin --tags +$ git tag 0.1.0 +$ git push origin --tags ``` -The name of the tag **must** be a valid [semver](http://semver.org/) value. The tag name may contain an optional `v` prefix. The tag name must also match the version listed -in the manifest file. If the manifest file is valid, then the version will be -automatically added to the plugins site. - -## Having Trouble? -Unfortunately we do not currently have a system for notifying you if there is a problem. If you're interested in helping improve this aspect of the plugins site, we'd [love your help](https://github.com/jquery/plugins.jquery.com/issues/11). - -If you encounter trouble getting this process to work with your plugin, please join the IRC channel [#jquery-content](irc://freenode.net:6667/#jquery-content) on freenode. If you can't seem to connect with someone in the IRC channel, please feel free to email us at [plugins@jquery.com](mailto:plugins@jquery.com). +The name of the tag **must** be a valid [semver](http://semver.org/) value. The +tag name may contain an optional `v` prefix. The tag name must also match the +version listed in the manifest file. If the manifest file is valid, then the +version will be automatically added to the plugins site. + +## Having Trouble? Unfortunately we do not currently have a system for +notifying you if there is a problem. If you're interested in helping improve +this aspect of the plugins site, we'd [love your +help](https://github.com/jquery/plugins.jquery.com/issues/11). + +If you encounter trouble getting this process to work with your plugin, please +join the IRC channel [#jquery-content](irc://freenode.net:6667/#jquery-content) +on [freenode](http://freenode.net). If you can't seem to connect with someone +in the IRC channel, please feel free to email us at +[plugins@jquery.com](mailto:plugins@jquery.com). From fc985775bc1162e3542c0423796df5ae96363728 Mon Sep 17 00:00:00 2001 From: "adam j. sontag" Date: Wed, 16 Jan 2013 21:12:34 -0500 Subject: [PATCH 026/128] Add notes on package squatting and common decency to names doc --- pages/docs/names.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pages/docs/names.md b/pages/docs/names.md index 9f72ab6..ba609b4 100644 --- a/pages/docs/names.md +++ b/pages/docs/names.md @@ -17,6 +17,10 @@ We encourage you to follow a few simple tips as well: Names are registered on a first come, first serve basis. Registering a name happens automatically the first time you [publish a release](/docs/publish/) of your plugin. You cannot reserve a name prior to releasing your plugin. Once you've registered a name, you are the sole owner of that name. Nobody else will be able to publish a release using the same name. There is no limit on how many plugins/names a single person may register, but all plugins must be legitimate. +Package squatting is not allowed. If you sit on a package name and don't publish code, it may be deleted without warning. + +In these early days of the registry's existence, we do ask that authors reserve judgment and respect for other popular, widely-adopted plugins that may already have a reasonable historical claim to a particular name, even if it has not yet been registered. + ## Transferring Ownership While most plugins will only ever have one owner, there are times when the original owner may move on to other projects and wish to transfer ownership to someone else. There is currently no automated process for this, the original owner must contact [plugins@jquery.com](mailto:plugins@jquery.com), prove ownership and indicate who the new owner should be. From d9035106af97438d2cab9b433b84f9e6db40b6d5 Mon Sep 17 00:00:00 2001 From: "adam j. sontag" Date: Wed, 16 Jan 2013 21:13:03 -0500 Subject: [PATCH 027/128] Update README with accurate post-receive URL and package manifest doc links --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 33b71bd..11c5ff4 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,11 @@ The jQuery Plugins site, http://plugins.jquery.com/ ### How it works -The plugins site is an index of GitHub repositories that contain jQuery plugins. The repositories can contain one or many jQuery plugin with an accompanying valid jquery.json manifest files in the repository root. The specification for this file lives [here](plugins.jquery.com/docs/package-manifest). +The plugins site is an index of GitHub repositories that contain jQuery plugins. The repositories can contain one or many jQuery plugin with an accompanying valid `plugin.jquery.json` manifest file in the repository root. The specification for this file lives [here](plugins.jquery.com/docs/package-manifest). ### How to list a plugin -Simply add a [post-receive hook](http://help.github.com/post-receive-hooks/) to your repository with our web hook url, `http://plugins.jquery.com/_update`. -**Warning:** This is not yet functional! +Simply add a [post-receive hook](http://help.github.com/post-receive-hooks/) to your repository with our web hook url, `http://plugins.jquery.com/postreceive-hook.`. ## Development From 763f77ca4102b55880556e2a1321135727ce0987 Mon Sep 17 00:00:00 2001 From: "adam j. sontag" Date: Wed, 16 Jan 2013 21:22:31 -0500 Subject: [PATCH 028/128] Fix formatting in names and publishing docs --- pages/docs/names.md | 42 ++++++++++++++++++++++++++++++++++-------- pages/docs/publish.md | 4 +++- 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/pages/docs/names.md b/pages/docs/names.md index ba609b4..c1d0295 100644 --- a/pages/docs/names.md +++ b/pages/docs/names.md @@ -2,7 +2,10 @@ "title": "Naming Your Plugin" } -Before you can list your plugin on this site, you'll need to choose a name for your plugin. The name is a unique identifier that distinguishes your plugin from all other plugins. This is different from the title of your plugin, which you can think of as the display name. +Before you can list your plugin on this site, you'll need to choose a name for +your plugin. The name is a unique identifier that distinguishes your plugin +from all other plugins. This is different from the title of your plugin, which +you can think of as the display name. **Plugin names may only contain letters, numbers, hypens, dots, and underscores.** @@ -15,20 +18,43 @@ We encourage you to follow a few simple tips as well: ## First Come, First Serve -Names are registered on a first come, first serve basis. Registering a name happens automatically the first time you [publish a release](/docs/publish/) of your plugin. You cannot reserve a name prior to releasing your plugin. Once you've registered a name, you are the sole owner of that name. Nobody else will be able to publish a release using the same name. There is no limit on how many plugins/names a single person may register, but all plugins must be legitimate. +Names are registered on a first come, first serve basis. Registering a name +happens automatically the first time you [publish a release](/docs/publish/) of +your plugin. You cannot reserve a name prior to releasing your plugin. Once +you've registered a name, you are the sole owner of that name. Nobody else will +be able to publish a release using the same name. There is no limit on how many +plugins/names a single person may register, but all plugins must be legitimate. -Package squatting is not allowed. If you sit on a package name and don't publish code, it may be deleted without warning. +Package squatting is not allowed. If you sit on a package name and don't +publish code, it may be deleted without warning. -In these early days of the registry's existence, we do ask that authors reserve judgment and respect for other popular, widely-adopted plugins that may already have a reasonable historical claim to a particular name, even if it has not yet been registered. +In these early days of the registry's existence, we do ask that authors reserve +judgment and respect for other popular, widely-adopted plugins that may already +have a reasonable historical claim to a particular name, even if it has not yet +been registered. ## Transferring Ownership -While most plugins will only ever have one owner, there are times when the original owner may move on to other projects and wish to transfer ownership to someone else. There is currently no automated process for this, the original owner must contact [plugins@jquery.com](mailto:plugins@jquery.com), prove ownership and indicate who the new owner should be. +While most plugins will only ever have one owner, there are times when the +original owner may move on to other projects and wish to transfer ownership to +someone else. There is currently no automated process for this, the original +owner must contact [plugins@jquery.com](mailto:plugins@jquery.com), prove +ownership and indicate who the new owner should be. -In the case of an abandoned plugin where the original owner is no longer active, the jQuery team can choose to change ownership at their discretion. These will indeed be a rare occurrence, likely requiring an event such as _why or Mark Pilgrim's infosuicide. +In the case of an abandoned plugin where the original owner is no longer +active, the jQuery team can choose to change ownership at their discretion. +These will indeed be a rare occurrence, likely requiring an event such as _why +or Mark Pilgrim's infosuicide. ## Prefixes & Plugin Suites -Certain prefixes will also be blacklisted for individual plugins. Large projects which include many plugins in a single repository, such as [jQuery UI](http://jqueryui.com), are registered as suites. Each suite is required to have a unique prefix and all of their plugin names must use that prefix. As such, no other plugin may use a name with a suite's prefix. Suites must be manually vetted by the jQuery team. +Certain prefixes will also be blacklisted for individual plugins. Large +projects which include many plugins in a single repository, such as [jQuery +UI](http://jqueryui.com), are registered as suites. Each suite is required to +have a unique prefix and all of their plugin names must use that prefix. As +such, no other plugin may use a name with a suite's prefix. Suites must be +manually vetted by the jQuery team. -**Note:** In order to allow proper naming of extensions for plugins in a suite, the prefix blacklisting is only one level deep. For example, jQuery UI owns all `ui.*` names, but `ui.autocomplete.*` is open to the public. +**Note:** In order to allow proper naming of extensions for plugins in a suite, +the prefix blacklisting is only one level deep. For example, jQuery UI owns all +`ui.*` names, but `ui.autocomplete.*` is open to the public. diff --git a/pages/docs/publish.md b/pages/docs/publish.md index d2b4e55..e1d7b5a 100644 --- a/pages/docs/publish.md +++ b/pages/docs/publish.md @@ -36,7 +36,9 @@ tag name may contain an optional `v` prefix. The tag name must also match the version listed in the manifest file. If the manifest file is valid, then the version will be automatically added to the plugins site. -## Having Trouble? Unfortunately we do not currently have a system for +## Having Trouble? + +Unfortunately we do not currently have a system for notifying you if there is a problem. If you're interested in helping improve this aspect of the plugins site, we'd [love your help](https://github.com/jquery/plugins.jquery.com/issues/11). From b07291c4e02e4f772c62b17cdbfd7a69b9660f21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 17 Jan 2013 00:40:26 -0500 Subject: [PATCH 029/128] More logging. --- lib/hook.js | 3 +++ lib/service.js | 4 +++- scripts/manager.js | 5 ++++- scripts/retry.js | 1 + scripts/update-server.js | 6 ++++++ scripts/wordpress-update.js | 1 + 6 files changed, 18 insertions(+), 2 deletions(-) diff --git a/lib/hook.js b/lib/hook.js index dca57f2..2c14e26 100644 --- a/lib/hook.js +++ b/lib/hook.js @@ -54,9 +54,11 @@ function processVersions( repo, fn ) { } if ( !tags.length ) { + logger.log( "No tags to process for " + repo.id ); return fn( null ); } + logger.log( "Processing", repo.id, tags ); this.parallel()( null, tags ); var group = this.group(); tags.forEach(function( tag ) { @@ -92,6 +94,7 @@ function processVersions( repo, fn ) { } if ( !releases.length ) { + logger.log( "No valid releases for " + repo.id ); return fn( null ); } diff --git a/lib/service.js b/lib/service.js index 5663bb6..97be252 100644 --- a/lib/service.js +++ b/lib/service.js @@ -271,7 +271,7 @@ extend( Repo.prototype, { } if ( errors.length ) { - logger.log( "Manifest errors:", this.id, version, errors ); + logger.log( "Manifest errors:", this.id, version, filename, errors ); } return errors; @@ -343,9 +343,11 @@ extend( Repo.prototype, { } if ( !files.length ) { + logger.log( "No manifest files for", repo.id, tag ); return fn( null, null ); } + logger.log( "Found manifest files for", repo.id, tag, files ); this.parallel()( null, files ); var group = this.group(); diff --git a/scripts/manager.js b/scripts/manager.js index dc47482..dcf4a3f 100644 --- a/scripts/manager.js +++ b/scripts/manager.js @@ -1,5 +1,6 @@ var path = require( "path" ), - spawn = require( "child_process" ).spawn; + spawn = require( "child_process" ).spawn, + logger = require( "../lib/logger" ); function Process( script ) { this.args = [].slice.call( arguments ); @@ -32,6 +33,7 @@ Process.startAll(); // SIGINT and SIGTERM perform a graceful shutdown of all processes function shutdownHook() { + logger.log( "Shutting down manager." ); Process.list.forEach(function( process ) { process.respawn = false; process.child.kill( "SIGINT" ); @@ -42,6 +44,7 @@ process.once( "SIGTERM", shutdownHook ); // SIGHUP is a graceful restart of all child processes process.on( "SIGHUP", function() { + logger.log( "Restarting child processes." ); var old = Process.list; Process.startAll(); old.forEach(function( process ) { diff --git a/scripts/retry.js b/scripts/retry.js index 720026b..54ec535 100644 --- a/scripts/retry.js +++ b/scripts/retry.js @@ -90,6 +90,7 @@ processFailures(function( error ) { // Let the current retry finish, then stop processing and exit function shutdownHook() { + logger.log( "Shutting down retry." ); processFailures = function( fn ) { fn( null ); }; diff --git a/scripts/update-server.js b/scripts/update-server.js index 22f756c..ece1886 100644 --- a/scripts/update-server.js +++ b/scripts/update-server.js @@ -22,6 +22,7 @@ var server = http.createServer(function( request, response ) { request.on( "end", function() { var repo = service.getRepoByHook( data ); + if ( !repo ) { // Invalid data, stop processing logger.error( "Invalid request: " + data ); @@ -30,6 +31,8 @@ var server = http.createServer(function( request, response ) { return; } + logger.log( "Received request: " + repo.id ); + // Accept the request and close the connection response.writeHead( 202 ); response.end(); @@ -38,6 +41,7 @@ var server = http.createServer(function( request, response ) { // request. This prevents parallel processing of the same data which // could result in duplicate entries. if ( processing[ repo.id ] ) { + logger.log( "Skipping parallel processing." ); return; } @@ -45,6 +49,7 @@ var server = http.createServer(function( request, response ) { processing[ repo.id ] = true; hook.processHook( repo, function( error ) { delete processing[ repo.id ]; + logger.log( "Done processing request: " + repo.id ); if ( error ) { logger.error( "Error processing hook: " + error.stack ); } @@ -65,6 +70,7 @@ server.on( "error", function( error ) { server.listen( port ); function shutdownHook() { + logger.log( "Shutting down update-server." ); server.close(); } diff --git a/scripts/wordpress-update.js b/scripts/wordpress-update.js index a6495e5..83e8021 100644 --- a/scripts/wordpress-update.js +++ b/scripts/wordpress-update.js @@ -286,6 +286,7 @@ processActions(function( error ) { // Let the current action finish, then stop processing and exit function shutdownHook() { + logger.log( "Shutting down wordpress-update." ); processActionsSince = function( actionId, fn ) { fn( null ); }; From 5cb784f4f5e58e5cea22ecda3879ccb715ad5555 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 17 Jan 2013 00:47:24 -0500 Subject: [PATCH 030/128] 1.0.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 966e7e4..ae9a872 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plugins.jquery.com", - "version": "1.0.1", + "version": "1.0.3", "author": "jQuery Project", "description": "The official jQuery plugins site", "homepage": "https://github.com/jquery/plugins.jquery.com", From 954441da521b29a3cb0de5b535c238c4c850c1b0 Mon Sep 17 00:00:00 2001 From: Mark Dalgleish Date: Thu, 17 Jan 2013 20:18:03 +1100 Subject: [PATCH 031/128] Fix inconsistent indentation in sample manifest --- pages/docs/package-manifest.md | 38 +++++++++++++++++----------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/pages/docs/package-manifest.md b/pages/docs/package-manifest.md index c572525..e27f4b3 100644 --- a/pages/docs/package-manifest.md +++ b/pages/docs/package-manifest.md @@ -236,37 +236,37 @@ digits after the first "x" are ignored. ```json { "name": "color", - "title": "jQuery Color", - "description": "jQuery plugin for color manipulation and animation support.", - "keywords": [ - "color", + "title": "jQuery Color", + "description": "jQuery plugin for color manipulation and animation support.", + "keywords": [ + "color", "animation" - ], - "version": "2.1.2", - "author": { - "name": "jQuery Foundation and other contributors", - "url": "https://github.com/jquery/jquery-color/blob/2.1.2/AUTHORS.txt" - }, - "maintainers": [ + ], + "version": "2.1.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-color/blob/2.1.2/AUTHORS.txt" + }, + "maintainers": [ { "name": "Corey Frang", "email": "gnarf37@gmail.com", "url": "http://gnarf.net" } ], - "licenses": [ + "licenses": [ { "type": "MIT", "url": "https://github.com/jquery/jquery-color/blob/2.1.2/MIT-LICENSE.txt" } ], - "bugs": "https://github.com/jquery/jquery-color/issues", - "homepage": "https://github.com/jquery/jquery-color", - "docs": "https://github.com/jquery/jquery-color", - "download": "http://code.jquery.com/#color", - "dependencies": { - "jquery": ">=1.5" - } + "bugs": "https://github.com/jquery/jquery-color/issues", + "homepage": "https://github.com/jquery/jquery-color", + "docs": "https://github.com/jquery/jquery-color", + "download": "http://code.jquery.com/#color", + "dependencies": { + "jquery": ">=1.5" + } } ``` From 12566609fe38977efe9a9b0d2d0e791d858ea9d4 Mon Sep 17 00:00:00 2001 From: "adam j. sontag" Date: Thu, 17 Jan 2013 04:31:07 -0500 Subject: [PATCH 032/128] Indentation and other minor cleanup in package manifest docs --- pages/docs/package-manifest.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/docs/package-manifest.md b/pages/docs/package-manifest.md index c572525..4d0ea7d 100644 --- a/pages/docs/package-manifest.md +++ b/pages/docs/package-manifest.md @@ -85,7 +85,7 @@ a url property linking to the actual text and an optional "type" property specif "licenses": [ { "type": "GPLv2", - "url": "http://www.example.com/licenses/gpl.html" + "url": "http://www.example.com/licenses/gpl.html" } ] ``` @@ -213,7 +213,7 @@ For example, the following are equivalent: * `"~1.2" = ">=1.2.0 <2.0.0"` * `"~1" = ">=1.0.0 <2.0.0"` -### X Version Ranges +### X Version Ranges An "x" in a version range specifies that the version number must start with the supplied digits, but any digit may be used in place of the x. @@ -229,7 +229,7 @@ The following are equivalent: You may not supply a comparator with a version containing an x. Any digits after the first "x" are ignored. -### Sample manifest +### Sample manifest **color.jquery.json** From df2f40f0854d4e65f5dd7a039017eb8e06c0523c Mon Sep 17 00:00:00 2001 From: "adam j. sontag" Date: Thu, 17 Jan 2013 04:50:28 -0500 Subject: [PATCH 033/128] 1.0.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ae9a872..0afb87b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plugins.jquery.com", - "version": "1.0.3", + "version": "1.0.4", "author": "jQuery Project", "description": "The official jQuery plugins site", "homepage": "https://github.com/jquery/plugins.jquery.com", From 28912087486346ae75943ef7110178c697faec30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 17 Jan 2013 08:24:36 -0500 Subject: [PATCH 034/128] Log when any script starts. --- scripts/manager.js | 2 ++ scripts/retry.js | 2 ++ scripts/update-server.js | 2 ++ scripts/wordpress-update.js | 2 ++ 4 files changed, 8 insertions(+) diff --git a/scripts/manager.js b/scripts/manager.js index dcf4a3f..5250020 100644 --- a/scripts/manager.js +++ b/scripts/manager.js @@ -2,6 +2,8 @@ var path = require( "path" ), spawn = require( "child_process" ).spawn, logger = require( "../lib/logger" ); +logger.log( "Manager started." ); + function Process( script ) { this.args = [].slice.call( arguments ); this.args[ 0 ] = path.join( __dirname, script ); diff --git a/scripts/retry.js b/scripts/retry.js index 54ec535..cbe5fde 100644 --- a/scripts/retry.js +++ b/scripts/retry.js @@ -4,6 +4,8 @@ var Step = require( "step" ), retry = require( "../lib/retrydb" ), logger = require( "../lib/logger" ); +logger.log( "retry started." ); + process.on( "uncaughtException", function( error ) { logger.error( "Uncaught exception: " + error.stack ); }); diff --git a/scripts/update-server.js b/scripts/update-server.js index ece1886..9ce82c6 100644 --- a/scripts/update-server.js +++ b/scripts/update-server.js @@ -9,6 +9,8 @@ var port = (function() { return index === -1 ? 8001 : +process.argv[ index + 1 ]; })(); +logger.log( "update-server started; listening on port " + port + "." ); + process.on( "uncaughtException", function( error ) { logger.error( "Uncaught exception: " + error.stack ); }); diff --git a/scripts/wordpress-update.js b/scripts/wordpress-update.js index 83e8021..814374f 100644 --- a/scripts/wordpress-update.js +++ b/scripts/wordpress-update.js @@ -7,6 +7,8 @@ var fs = require( "fs" ), service = require( "../lib/service" ), logger = require( "../lib/logger" ); +logger.log( "wordpress-update started." ); + process.on( "uncaughtException", function( error ) { logger.error( "Uncaught exception: " + error.stack ); }); From 230bfed64211e0e4d7d4d853a744f41d30d36cec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 17 Jan 2013 08:24:49 -0500 Subject: [PATCH 035/128] 1.0.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0afb87b..beecacc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plugins.jquery.com", - "version": "1.0.4", + "version": "1.0.5", "author": "jQuery Project", "description": "The official jQuery plugins site", "homepage": "https://github.com/jquery/plugins.jquery.com", From 9a2dbd4e00446c035c751a2fb36711eb38adbd99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 17 Jan 2013 09:05:49 -0500 Subject: [PATCH 036/128] More logging for wordpress-update. --- scripts/wordpress-update.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/wordpress-update.js b/scripts/wordpress-update.js index 814374f..4ddfaed 100644 --- a/scripts/wordpress-update.js +++ b/scripts/wordpress-update.js @@ -110,12 +110,14 @@ actions.addRelease = function( data, fn ) { Step( function getPageData() { + logger.log( "getPageData()" ); getPageDetails( this.parallel() ); pluginsDb.getMeta( manifest.name, this.parallel() ); wordpress.getPostForPlugin( manifest.name, this.parallel() ); }, function updateMainPage( error, pageDetails, repoMeta, existingPage ) { + logger.log( "updateMainPage()" ); if ( error ) { return fn( error ); } @@ -162,6 +164,7 @@ actions.addRelease = function( data, fn ) { }, function createVersionPage( error, pageDetails, mainPageId ) { + logger.log( "createVersionPage()" ); if ( error ) { return fn( error ); } @@ -187,6 +190,7 @@ actions.addRelease = function( data, fn ) { function processActions( fn ) { + logger.log( "Processing actions." ); Step( function() { fs.readFile( config.lastActionFile, "utf8", this ); @@ -194,6 +198,7 @@ function processActions( fn ) { function( error, lastAction ) { if ( error && error.code === "ENOENT" ) { + logger.log( "No last-action file." ); return null; } @@ -217,6 +222,7 @@ function processActions( fn ) { var processActionsSince = function( actionId, fn ) { Step( function() { + logger.log( "Parsing actions since " + actionId ); processNextAction( actionId, this ); }, @@ -263,6 +269,7 @@ function processNextAction( actionId, fn ) { } if ( !action ) { + logger.log( "No actions after " + actionId ); return fn( null, null ); } From 77df4130f2e52ac6da98b929aba0da30a3137985 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 17 Jan 2013 09:06:11 -0500 Subject: [PATCH 037/128] 1.0.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index beecacc..c7caa2a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plugins.jquery.com", - "version": "1.0.5", + "version": "1.0.6", "author": "jQuery Project", "description": "The official jQuery plugins site", "homepage": "https://github.com/jquery/plugins.jquery.com", From 65056f22fdc3e97e354ed66e67c185e288b4c23b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 17 Jan 2013 09:18:50 -0500 Subject: [PATCH 038/128] Handle plugins that don't have keywords. --- scripts/wordpress-update.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/wordpress-update.js b/scripts/wordpress-update.js index 4ddfaed..cdbe86d 100644 --- a/scripts/wordpress-update.js +++ b/scripts/wordpress-update.js @@ -42,7 +42,7 @@ actions.addRelease = function( data, fn ) { content: manifest.description, date: date, termNames: { - post_tag: manifest.keywords.map(function( keyword ) { + post_tag: (manifest.keywords || []).map(function( keyword ) { return keyword.toLowerCase(); }) }, From ed806087e0cc40c85b445c2fa43f9a8eb0ed9280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 17 Jan 2013 09:18:58 -0500 Subject: [PATCH 039/128] 1.0.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c7caa2a..0d8bf1a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plugins.jquery.com", - "version": "1.0.6", + "version": "1.0.7", "author": "jQuery Project", "description": "The official jQuery plugins site", "homepage": "https://github.com/jquery/plugins.jquery.com", From fa45cf4c32f37fb7d9282cc937a8e588d55e514d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 17 Jan 2013 09:23:29 -0500 Subject: [PATCH 040/128] Remove noisy logging. --- scripts/wordpress-update.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/scripts/wordpress-update.js b/scripts/wordpress-update.js index cdbe86d..50df195 100644 --- a/scripts/wordpress-update.js +++ b/scripts/wordpress-update.js @@ -110,14 +110,12 @@ actions.addRelease = function( data, fn ) { Step( function getPageData() { - logger.log( "getPageData()" ); getPageDetails( this.parallel() ); pluginsDb.getMeta( manifest.name, this.parallel() ); wordpress.getPostForPlugin( manifest.name, this.parallel() ); }, function updateMainPage( error, pageDetails, repoMeta, existingPage ) { - logger.log( "updateMainPage()" ); if ( error ) { return fn( error ); } @@ -164,7 +162,6 @@ actions.addRelease = function( data, fn ) { }, function createVersionPage( error, pageDetails, mainPageId ) { - logger.log( "createVersionPage()" ); if ( error ) { return fn( error ); } @@ -222,7 +219,6 @@ function processActions( fn ) { var processActionsSince = function( actionId, fn ) { Step( function() { - logger.log( "Parsing actions since " + actionId ); processNextAction( actionId, this ); }, @@ -269,7 +265,6 @@ function processNextAction( actionId, fn ) { } if ( !action ) { - logger.log( "No actions after " + actionId ); return fn( null, null ); } From c2fcfe7826091034ae4dda23d8584f374193f0f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 17 Jan 2013 09:23:34 -0500 Subject: [PATCH 041/128] 1.0.8 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0d8bf1a..c8f96d5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plugins.jquery.com", - "version": "1.0.7", + "version": "1.0.8", "author": "jQuery Project", "description": "The official jQuery plugins site", "homepage": "https://github.com/jquery/plugins.jquery.com", From 47d0dfdac965123202765d3315a0124fb918e7e5 Mon Sep 17 00:00:00 2001 From: Corey Frang Date: Thu, 17 Jan 2013 12:52:46 -0600 Subject: [PATCH 042/128] Adding some small bits of documentation for publishing --- pages/docs/publish.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pages/docs/publish.md b/pages/docs/publish.md index e1d7b5a..0a0f4fc 100644 --- a/pages/docs/publish.md +++ b/pages/docs/publish.md @@ -36,6 +36,10 @@ tag name may contain an optional `v` prefix. The tag name must also match the version listed in the manifest file. If the manifest file is valid, then the version will be automatically added to the plugins site. +We highly suggest that you **do not overwrite old tags**, instead, push a new +version number tag (and commit to the manifest) to fix any errors you've +encounterd. + ## Having Trouble? Unfortunately we do not currently have a system for @@ -48,3 +52,11 @@ join the IRC channel [#jquery-content](irc://freenode.net:6667/#jquery-content) on [freenode](http://freenode.net). If you can't seem to connect with someone in the IRC channel, please feel free to email us at [plugins@jquery.com](mailto:plugins@jquery.com). + +## How long should the process take + +When everything works, this process is pretty close to instant. There are +caches in place, etc, but in general, if you haven't seen your plugin get +updated on the site within 5 minutes, there is a good chance something went +wrong. Going into your Web Hooks settings and hitting the "Test Hook" button +(once) may help if you recently pushed a new tag. From cc6dd79b10099abf5858a9126560abbb07934edd Mon Sep 17 00:00:00 2001 From: Corey Frang Date: Thu, 17 Jan 2013 16:06:14 -0600 Subject: [PATCH 043/128] Making --console option pass through to children processes --- scripts/manager.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/manager.js b/scripts/manager.js index 5250020..7e3eaf2 100644 --- a/scripts/manager.js +++ b/scripts/manager.js @@ -1,6 +1,7 @@ var path = require( "path" ), spawn = require( "child_process" ).spawn, - logger = require( "../lib/logger" ); + logger = require( "../lib/logger" ), + consoleOption = process.argv.indexOf( "--console" ) ? "--console" : ""; logger.log( "Manager started." ); @@ -13,15 +14,15 @@ function Process( script ) { Process.startAll = function() { this.list = []; - new Process( "update-server.js" ); - new Process( "wordpress-update.js" ); - new Process( "retry.js" ); + new Process( "update-server.js", consoleOption ); + new Process( "wordpress-update.js", consoleOption ); + new Process( "retry.js", consoleOption ); }; Process.prototype.respawn = true; Process.prototype.start = function() { - this.child = spawn( "node", this.args ); + this.child = spawn( "node", this.args, { stdio: "inherit" } ); this.child.on( "exit", this.onExit.bind( this ) ); }; From 6c21a96d90720104cdcb339b318d74ab71bfc8d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ramiro=20G=C3=B3mez?= Date: Thu, 17 Jan 2013 22:09:59 +0100 Subject: [PATCH 044/128] Updated links to the web-based template in README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 11c5ff4..19a97e3 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Simply add a [post-receive hook](http://help.github.com/post-receive-hooks/) to ### Requires -* jQuery's [web-base-template](https://github.com/jquery/web-base-template) +* jQuery's [web-base-template](https://github.com/jquery/jquery-wp-content/) * Web server (such as Apache) * PHP * MySQL @@ -26,7 +26,7 @@ Simply add a [post-receive hook](http://help.github.com/post-receive-hooks/) to #### web-base-template -1. Follow the installation steps for [web-base-template](https://github.com/jquery/web-base-template). +1. Follow the installation steps for [web-base-template](https://github.com/jquery/jquery-wp-content/). #### Install node >=0.6.4 From d9f1c5396eddd6a9b7fb4bcbe6ae65dd85d983d2 Mon Sep 17 00:00:00 2001 From: Corey Frang Date: Thu, 17 Jan 2013 16:38:05 -0600 Subject: [PATCH 045/128] Might as well make the link text read jquery-wp-content too :) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 19a97e3..6d9071d 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Simply add a [post-receive hook](http://help.github.com/post-receive-hooks/) to ### Requires -* jQuery's [web-base-template](https://github.com/jquery/jquery-wp-content/) +* jQuery's [jquery-wp-content](https://github.com/jquery/jquery-wp-content/) * Web server (such as Apache) * PHP * MySQL @@ -26,7 +26,7 @@ Simply add a [post-receive hook](http://help.github.com/post-receive-hooks/) to #### web-base-template -1. Follow the installation steps for [web-base-template](https://github.com/jquery/jquery-wp-content/). +1. Follow the installation steps for [jquery-wp-content](https://github.com/jquery/jquery-wp-content/). #### Install node >=0.6.4 From 560d5b1ecc8e15c49833daa30414cb7db1aea894 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 17 Jan 2013 23:38:38 -0500 Subject: [PATCH 046/128] Wait 20 seconds before processing a request to deal with GitHub being flaky about when tags are available relative to when post-receive hooks are sent. --- scripts/update-server.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/scripts/update-server.js b/scripts/update-server.js index 9ce82c6..d22ddd6 100644 --- a/scripts/update-server.js +++ b/scripts/update-server.js @@ -49,13 +49,18 @@ var server = http.createServer(function( request, response ) { // Process the request processing[ repo.id ] = true; - hook.processHook( repo, function( error ) { - delete processing[ repo.id ]; - logger.log( "Done processing request: " + repo.id ); - if ( error ) { - logger.error( "Error processing hook: " + error.stack ); - } - }); + // GitHub seems to notify us too soon when there are tags. If we + // immediately check for new tags, the data may not be available yet, + // so we wait a bit before trying to process the request. + setTimeout(function() { + hook.processHook( repo, function( error ) { + delete processing[ repo.id ]; + logger.log( "Done processing request: " + repo.id ); + if ( error ) { + logger.error( "Error processing hook: " + error.stack ); + } + }); + }, 20000 ); }); }); From b589c78dedc4b2b4b7dc85f6460d59e74156ff60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 17 Jan 2013 23:40:10 -0500 Subject: [PATCH 047/128] 1.0.9 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c8f96d5..e109f7b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plugins.jquery.com", - "version": "1.0.8", + "version": "1.0.9", "author": "jQuery Project", "description": "The official jQuery plugins site", "homepage": "https://github.com/jquery/plugins.jquery.com", From 99275e85051ab2e9c54ab071277bed8cab025e25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Fri, 18 Jan 2013 07:06:00 -0500 Subject: [PATCH 048/128] Trim manifest files to avoid BOM issues. --- lib/service/github.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/service/github.js b/lib/service/github.js index a2caf4e..8fae960 100644 --- a/lib/service/github.js +++ b/lib/service/github.js @@ -120,7 +120,7 @@ extend( GithubRepo.prototype, { return fn( error ); } - fn( null, stdout ); + fn( null, stdout.trim() ); }); }, From 1c4c3bf8d269c2c085907693863a4136deddfed3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Fri, 18 Jan 2013 07:06:29 -0500 Subject: [PATCH 049/128] Log when a manifest file has invalid JSON. --- lib/service.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/service.js b/lib/service.js index 97be252..37b3c0b 100644 --- a/lib/service.js +++ b/lib/service.js @@ -33,18 +33,21 @@ function isEmail( str ) { // manifest extend( Repo.prototype, { getManifest: function( version, file, fn ) { + var repo = this; this._getManifest( version, file, function( error, manifest ) { if ( error ) { return fn( error ); } if ( !manifest ) { + logger.log( "Error getting manifest", repo.id, version, file ); return fn( null, null ); } try { manifest = JSON.parse( manifest ); } catch( error ) { + logger.log( "Invalid JSON in manifest", repo.id, version, file ); // TODO: report error to user? return fn( null, null ); } From e77c400eb2902c37570afdfd63a89882e1ee9748 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Fri, 18 Jan 2013 07:06:39 -0500 Subject: [PATCH 050/128] 1.0.10 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e109f7b..c659d12 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plugins.jquery.com", - "version": "1.0.9", + "version": "1.0.10", "author": "jQuery Project", "description": "The official jQuery plugins site", "homepage": "https://github.com/jquery/plugins.jquery.com", From 0774df61aa81231ba20c98d414e465cbbcbf4ae0 Mon Sep 17 00:00:00 2001 From: Jonathan Sharp Date: Fri, 18 Jan 2013 15:50:43 -0600 Subject: [PATCH 051/128] Update README.md Fixed link to plugin manifest --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6d9071d..e29dbd4 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ The jQuery Plugins site, http://plugins.jquery.com/ ### How it works -The plugins site is an index of GitHub repositories that contain jQuery plugins. The repositories can contain one or many jQuery plugin with an accompanying valid `plugin.jquery.json` manifest file in the repository root. The specification for this file lives [here](plugins.jquery.com/docs/package-manifest). +The plugins site is an index of GitHub repositories that contain jQuery plugins. The repositories can contain one or many jQuery plugin with an accompanying valid `plugin.jquery.json` manifest file in the repository root. The specification for this file lives [here](http://plugins.jquery.com/docs/package-manifest). ### How to list a plugin From 51462d6391c58a190b9d1e116545d240323570cc Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sat, 19 Jan 2013 14:05:58 -0500 Subject: [PATCH 052/128] Fix docs on ~1.2 version range, close gh-93. --- pages/docs/package-manifest.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/docs/package-manifest.md b/pages/docs/package-manifest.md index b815e2c..968d839 100644 --- a/pages/docs/package-manifest.md +++ b/pages/docs/package-manifest.md @@ -210,7 +210,7 @@ a version in the following fashion. For example, the following are equivalent: * `"~1.2.3" = ">=1.2.3 <1.3.0"` -* `"~1.2" = ">=1.2.0 <2.0.0"` +* `"~1.2" = ">=1.2.0 <1.3.0"` * `"~1" = ">=1.0.0 <2.0.0"` ### X Version Ranges From 50adbbeacd19dc48997835141fac9ebe4b8fa767 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sat, 19 Jan 2013 14:14:55 -0500 Subject: [PATCH 053/128] Clarifying manifest and tag rules to reduce errors. --- pages/docs/publish.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pages/docs/publish.md b/pages/docs/publish.md index 0a0f4fc..6927d6a 100644 --- a/pages/docs/publish.md +++ b/pages/docs/publish.md @@ -16,8 +16,9 @@ to `http://plugins.jquery.com/postreceive-hook`. The jQuery Plugins Registry will look in the root level of your repository for any files named `*.jquery.json`. You will want to create yourplugin.jquery.json according to the [package manifest -specification](/docs/package-manifest/). You are now ready to publish your -plugin! +specification](/docs/package-manifest/). Use an online JSON verifier such as +[JSONlint](http://jsonlint.com) to make sure the file is valid. You are now +ready to publish your plugin! ## Publishing a Version @@ -31,14 +32,15 @@ $ git tag 0.1.0 $ git push origin --tags ``` -The name of the tag **must** be a valid [semver](http://semver.org/) value. The -tag name may contain an optional `v` prefix. The tag name must also match the -version listed in the manifest file. If the manifest file is valid, then the -version will be automatically added to the plugins site. +The name of the tag **must** be a valid [semver](http://semver.org/) value, but +may contain an optional `v` prefix. The tag name must also match the +version listed in the manifest file. So, if the version field in the manifest +is "0.1.1" the tag should be either "0.1.1" or "v0.1.1". If the manifest file +is valid, the version will be automatically added to the plugins site. We highly suggest that you **do not overwrite old tags**, instead, push a new version number tag (and commit to the manifest) to fix any errors you've -encounterd. +encountered. ## Having Trouble? From a2c2342721ca1fb66e035c94f661aac8ba1b652a Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sat, 19 Jan 2013 14:19:01 -0500 Subject: [PATCH 054/128] Clarify how to update version and tag. --- pages/docs/publish.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/docs/publish.md b/pages/docs/publish.md index 6927d6a..bddbb8b 100644 --- a/pages/docs/publish.md +++ b/pages/docs/publish.md @@ -38,9 +38,9 @@ version listed in the manifest file. So, if the version field in the manifest is "0.1.1" the tag should be either "0.1.1" or "v0.1.1". If the manifest file is valid, the version will be automatically added to the plugins site. -We highly suggest that you **do not overwrite old tags**, instead, push a new -version number tag (and commit to the manifest) to fix any errors you've -encountered. +We highly suggest that you **do not overwrite old tags**, instead, update the +version number tag in the manifest, commit, and create a new tag to fix any +errors you've encountered. ## Having Trouble? From 98f37f2ead9d31b0774565858dfed7ef41c2429a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Mon, 21 Jan 2013 11:23:27 -0500 Subject: [PATCH 055/128] Bump waiting period up to 60 seconds before processing a request. --- scripts/update-server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/update-server.js b/scripts/update-server.js index d22ddd6..dfa0732 100644 --- a/scripts/update-server.js +++ b/scripts/update-server.js @@ -60,7 +60,7 @@ var server = http.createServer(function( request, response ) { logger.error( "Error processing hook: " + error.stack ); } }); - }, 20000 ); + }, 60000 ); }); }); From ea13e70c13f81a700d06122429fdc9c65cf2d586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Mon, 21 Jan 2013 11:26:34 -0500 Subject: [PATCH 056/128] Remove empty string as valid version range. Fixes #113. --- pages/docs/package-manifest.md | 106 ++++++++++++++++----------------- 1 file changed, 52 insertions(+), 54 deletions(-) diff --git a/pages/docs/package-manifest.md b/pages/docs/package-manifest.md index 968d839..8b11131 100644 --- a/pages/docs/package-manifest.md +++ b/pages/docs/package-manifest.md @@ -83,10 +83,10 @@ a url property linking to the actual text and an optional "type" property specif ``` "licenses": [ - { - "type": "GPLv2", - "url": "http://www.example.com/licenses/gpl.html" - } + { + "type": "GPLv2", + "url": "http://www.example.com/licenses/gpl.html" + } ] ``` @@ -150,11 +150,11 @@ See [People Fields](#people-fields). A "person" is an object with a "name" field and optionally "url" and "email", like this: -``` json +```json { - "name" : "Barney Rubble", - "email" : "b@rubble.com", - "url" : "http://barnyrubble.tumblr.com/" + "name" : "Barney Rubble", + "email" : "b@rubble.com", + "url" : "http://barnyrubble.tumblr.com/" } ``` @@ -176,7 +176,6 @@ is a semver compatible version identifier. * `~version` See 'Tilde Version Ranges' below * `1.2.x` See 'X Version Ranges' below * `*` Matches any version -* `""` (just an empty string) Same as `*` * `version1 - version2` Same as `>=version1 <=version2`. * `range1 || range2` Passes if either range1 or range2 are satisfied. @@ -184,18 +183,18 @@ For example, these are all valid: ```json { "dependencies" : - { - "foo" : "1.0.0 - 2.9999.9999", - "bar" : ">=1.0.2 <2.1.2", - "baz" : ">1.0.2 <=2.3.4", - "boo" : "2.0.1", - "qux" : "<1.0.0 || >=2.3.1 <2.4.5 || >=2.5.2 <3.0.0", - "asd" : "http://asdf.com/asdf.tar.gz", - "til" : "~1.2", - "elf" : "~1.2.3", - "two" : "2.x", - "thr" : "3.3.x" - } + { + "foo" : "1.0.0 - 2.9999.9999", + "bar" : ">=1.0.2 <2.1.2", + "baz" : ">1.0.2 <=2.3.4", + "boo" : "2.0.1", + "qux" : "<1.0.0 || >=2.3.1 <2.4.5 || >=2.5.2 <3.0.0", + "asd" : "http://asdf.com/asdf.tar.gz", + "til" : "~1.2", + "elf" : "~1.2.3", + "two" : "2.x", + "thr" : "3.3.x" + } } ``` @@ -235,38 +234,37 @@ digits after the first "x" are ignored. ```json { - "name": "color", - "title": "jQuery Color", - "description": "jQuery plugin for color manipulation and animation support.", - "keywords": [ - "color", - "animation" - ], - "version": "2.1.2", - "author": { - "name": "jQuery Foundation and other contributors", - "url": "https://github.com/jquery/jquery-color/blob/2.1.2/AUTHORS.txt" - }, - "maintainers": [ - { - "name": "Corey Frang", - "email": "gnarf37@gmail.com", - "url": "http://gnarf.net" - } - ], - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/jquery/jquery-color/blob/2.1.2/MIT-LICENSE.txt" - } - ], - "bugs": "https://github.com/jquery/jquery-color/issues", - "homepage": "https://github.com/jquery/jquery-color", - "docs": "https://github.com/jquery/jquery-color", - "download": "http://code.jquery.com/#color", - "dependencies": { - "jquery": ">=1.5" - } + "name": "color", + "title": "jQuery Color", + "description": "jQuery plugin for color manipulation and animation support.", + "keywords": [ + "color", + "animation" + ], + "version": "2.1.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-color/blob/2.1.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-color/blob/2.1.2/MIT-LICENSE.txt" + } + ], + "bugs": "https://github.com/jquery/jquery-color/issues", + "homepage": "https://github.com/jquery/jquery-color", + "docs": "https://github.com/jquery/jquery-color", + "download": "http://code.jquery.com/#color", + "dependencies": { + "jquery": ">=1.5" + } } ``` - From e96c0ff302d2b72cc15da4cc95bddc745aa20091 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Mon, 21 Jan 2013 11:57:27 -0500 Subject: [PATCH 057/128] Handled * version range. Fixes #78. --- lib/service.js | 2 +- test/service.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/service.js b/lib/service.js index 37b3c0b..7b94b2f 100644 --- a/lib/service.js +++ b/lib/service.js @@ -163,7 +163,7 @@ extend( Repo.prototype, { if ( typeof manifest.dependencies[ dependency ] !== "string" ) { errors.push( "Invalid data type for dependencies[" + dependency + "];" + " must be a string." ); - } else if ( !semver.validRange( manifest.dependencies[ dependency ] ) ) { + } else if ( semver.validRange( manifest.dependencies[ dependency ] ) === null ) { errors.push( "Invalid version range for dependency: " + dependency + "." ); } }); diff --git a/test/service.js b/test/service.js index d0c3052..110cd45 100644 --- a/test/service.js +++ b/test/service.js @@ -209,6 +209,11 @@ var tests = { // ]); // }, + "dependencies - infinite version range": function( manifest, fn ) { + manifest.dependencies.jquery = "*"; + fn( manifest, manifest.version, [] ); + }, + "dependencies - invalid type": function( manifest, fn ) { manifest.dependencies = [ "jquery" ]; fn( manifest, manifest.version, [ From 837d45e0976ceabf086c93acaaacd3f1e1d1a1cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Mon, 21 Jan 2013 12:40:17 -0500 Subject: [PATCH 058/128] Remove explicit handling for invalid manifest path. This should never happen now that we search for manifest files before trying to read them. --- lib/service.js | 5 ----- lib/service/github.js | 7 +------ 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/lib/service.js b/lib/service.js index 7b94b2f..68434f0 100644 --- a/lib/service.js +++ b/lib/service.js @@ -39,11 +39,6 @@ extend( Repo.prototype, { return fn( error ); } - if ( !manifest ) { - logger.log( "Error getting manifest", repo.id, version, file ); - return fn( null, null ); - } - try { manifest = JSON.parse( manifest ); } catch( error ) { diff --git a/lib/service/github.js b/lib/service/github.js index 8fae960..212be6f 100644 --- a/lib/service/github.js +++ b/lib/service/github.js @@ -110,12 +110,7 @@ extend( GithubRepo.prototype, { _getManifest: function( version, file, fn ) { version = version || "master"; - exec( "git show " + version + ":" + file, { cwd: this.path }, function( error, stdout, stderr ) { - // this will also result in an error being passed, so we check stderr first - if ( stderr && stderr.substring( 0, 11 ) === "fatal: Path" ) { - return fn( null, null ); - } - + exec( "git show " + version + ":" + file, { cwd: this.path }, function( error, stdout ) { if ( error ) { return fn( error ); } From e7886ce8c58e568524dc9f9dca93ceceb93f240a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Mon, 21 Jan 2013 13:15:44 -0500 Subject: [PATCH 059/128] 1.0.12 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c659d12..9afd108 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plugins.jquery.com", - "version": "1.0.10", + "version": "1.0.12", "author": "jQuery Project", "description": "The official jQuery plugins site", "homepage": "https://github.com/jquery/plugins.jquery.com", From d89f00adfc57a505098bfa01ba4c434bd3f7812a Mon Sep 17 00:00:00 2001 From: Dan Heberden Date: Mon, 21 Jan 2013 11:23:32 -0800 Subject: [PATCH 060/128] update setup and restore grunt tasks to build-pages before sync-docs --- grunt.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grunt.js b/grunt.js index ffd1851..921915d 100644 --- a/grunt.js +++ b/grunt.js @@ -133,8 +133,8 @@ grunt.registerTask( "restore-repos", function() { }); grunt.registerTask( "default", "lint test" ); -grunt.registerTask( "setup", "setup-pluginsdb setup-retrydb sync-docs" ); +grunt.registerTask( "setup", "setup-pluginsdb setup-retrydb build-pages sync-docs" ); grunt.registerTask( "update", "clean build-pages sync-docs" ); -grunt.registerTask( "restore", "clean-retries setup-retrydb sync-docs restore-repos" ); +grunt.registerTask( "restore", "clean-retries setup-retrydb build-pages sync-docs restore-repos" ); }; From c4d62d0d0e90ddccf0be6f80b3ff67b8ba35fd53 Mon Sep 17 00:00:00 2001 From: Dan Heberden Date: Mon, 21 Jan 2013 11:49:20 -0800 Subject: [PATCH 061/128] Improve documentation for adding plugins as well as developing for the plugins site itself --- README.md | 43 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e29dbd4..1d6fdcb 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,17 @@ The plugins site is an index of GitHub repositories that contain jQuery plugins. ### How to list a plugin -Simply add a [post-receive hook](http://help.github.com/post-receive-hooks/) to your repository with our web hook url, `http://plugins.jquery.com/postreceive-hook.`. +Simply add a [post-receive hook](http://help.github.com/post-receive-hooks/) to your repository with our web hook url, `http://plugins.jquery.com/postreceive-hook.`. When you push +to your repository, the plugins site will look at your repository's tags and their corresponding manifest file (thepluginname.jquery.json). You can read up on this process, +as well as the requirements of the manifest file on [the jQuery Plugins Site](http://plugins.jquery.com/docs/publish/). + +Assuming there were no errors in your manifest file, your plugin should be on the plugins site within one to two minutes after pushing to github. If you +still don't see your plugin listed, you can click the "Test Hook" button on the same page you added the service hook to your repository and the +plugins site will re-query github for changes, in case github didn't update your repository in time. + +We are currently exploring options to provide feedback on errors encountered during the process of adding your +plugin to the plugins site. If you are still encountering issues after verifying the post-receive hook is in +place and that your manifest file is valid, ask for assistance in #jquery-content on [freenode.net](http://freenode.net). ## Development @@ -32,6 +42,9 @@ Simply add a [post-receive hook](http://help.github.com/post-receive-hooks/) to 1. Follow https://github.com/joyent/node/wiki/Installation +You can also install [nave](https://github.com/isaacs/nave), a node version manager. You can easily install it +using [nave-installer](https://github.com/danheberden/nave-installer) or download it manually. + #### plugins.jquery.com setup 1. `git clone git@github.com:jquery/plugins.jquery.com.git` @@ -45,8 +58,30 @@ Simply add a [post-receive hook](http://help.github.com/post-receive-hooks/) to 5. Edit config.json * Set `wordpress` properties to contain a valid username and password for the WordPress site. -6. `grunt setup` +If you want to setup and ultimately run the node scripts that manage plugin entries, run `grunt setup`. +If you need to clear the db or are getting and error running `grunt setup` regarding the setupdb or +retrydb tasks failing, run `grunt clean-all`. + +If you have made changes to the documentation and simply want to deploy or update that content, run +`grunt update`. + +#### Running the site for development and debugging + +1. `node scripts/update-server.js --console` will start the update server and log its output +to the terminal window. This will *not* update wordpress, but will let you see the result of +adding a plugin locally. + +2. `node scripts/wordpress-update.js --console` will process the changes in sqlite into +entries in wordpress. Note, if you're re-adding plugins that have already been added, you +will need to remove those entries from wordpress. + +### Running the site normally + +`node scripts/manager.js` runs the update-server and wordpress-update scripts automatically. +However, because it handless restarts/failures of these scripts, it is harder to stop this +process (you have to kill the pid's from the processes' pid file). Also, running the servers +manually and individually is much easier for development, as you will probably only *need* +update-server.js running. + -### Running the site -`node scripts/manager.js` From 04a131e1285affe9e4355a102be605c9496b7f6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Mon, 21 Jan 2013 16:14:10 -0500 Subject: [PATCH 062/128] Create an error log of user errors. First step at providing public feedback. --- .gitignore | 1 + lib/config.js | 1 + lib/service.js | 40 ++++++++++++++++++++++++++++++++-------- 3 files changed, 34 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 679bd82..6716162 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,6 @@ config.json last-action plugins.db retry.db +error.log node_modules dist/ diff --git a/lib/config.js b/lib/config.js index 7dd033c..72c2f59 100644 --- a/lib/config.js +++ b/lib/config.js @@ -12,5 +12,6 @@ function resolvePath( key, _default ) { resolvePath( "repoDir", path.resolve( tmpDir, "plugin-repos" ) ); resolvePath( "pluginsDb", "plugins.db" ); resolvePath( "lastActionFile", "last-action" ); +resolvePath( "errorLog", "error.log" ); module.exports = config; diff --git a/lib/service.js b/lib/service.js index 68434f0..4e60911 100644 --- a/lib/service.js +++ b/lib/service.js @@ -1,4 +1,5 @@ -var semver = require( "semver" ), +var fs = require( "fs" ), + semver = require( "semver" ), Step = require( "step" ), config = require( "./config" ), logger = require( "./logger" ), @@ -32,9 +33,9 @@ function isEmail( str ) { // manifest extend( Repo.prototype, { - getManifest: function( version, file, fn ) { + getManifest: function( tag, file, fn ) { var repo = this; - this._getManifest( version, file, function( error, manifest ) { + this._getManifest( tag, file, function( error, manifest ) { if ( error ) { return fn( error ); } @@ -42,8 +43,8 @@ extend( Repo.prototype, { try { manifest = JSON.parse( manifest ); } catch( error ) { - logger.log( "Invalid JSON in manifest", repo.id, version, file ); - // TODO: report error to user? + logger.log( "Invalid JSON in manifest", repo.id, tag, file ); + repo.informInvalidJson({ tag: tag, file: file }); return fn( null, null ); } @@ -342,6 +343,7 @@ extend( Repo.prototype, { if ( !files.length ) { logger.log( "No manifest files for", repo.id, tag ); + repo.informMissingManifset({ tag: tag }); return fn( null, null ); } @@ -356,7 +358,7 @@ extend( Repo.prototype, { // validate manifests function( error, files, manifests ) { - var i, l, + var i, l, errors, mappedManifests = {}; if ( error ) { @@ -371,8 +373,14 @@ extend( Repo.prototype, { } for ( i = 0, l = manifests.length; i < l; i++ ) { - if ( repo.validateManifest( manifests[ i ], tag, - suites[ repo.id ], files[ i ] ).length ) { + errors = repo.validateManifest( manifests[ i ], tag, + suites[ repo.id ], files[ i ] ); + if ( errors.length ) { + repo.informInvalidManifest({ + tag: tag, + file: files[ i ], + errors: errors + }); return fn( null, null ); } mappedManifests[ files[ i ] ] = manifests[ i ]; @@ -384,6 +392,22 @@ extend( Repo.prototype, { } }); +// error notification +extend( Repo.prototype, { + inform: function( msg ) { + fs.appendFile( config.errorLog, msg + "\n" ); + }, + informMissingManifset: function( data ) { + this.inform( this.id + " " + data.tag + " has no manifest file(s)." ); + }, + informInvalidJson: function( data ) { + this.inform( this.id + " " + data.tag + " " + data.file + " is invalid JSON." ); + }, + informInvalidManifest: function( data ) { + this.inform( this.id + " " + data.tag + " " + data.file + " has the following errors: " + data.errors ); + } +}); + var services = {}; module.exports = { From 2fbbb5b608a393e9945971a2e498b14e47abee87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Mon, 21 Jan 2013 16:21:58 -0500 Subject: [PATCH 063/128] 1.0.13 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9afd108..3bc2239 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plugins.jquery.com", - "version": "1.0.12", + "version": "1.0.13", "author": "jQuery Project", "description": "The official jQuery plugins site", "homepage": "https://github.com/jquery/plugins.jquery.com", From db341eda33895f6dad6e7f117955787df2b86f7b Mon Sep 17 00:00:00 2001 From: Dan Heberden Date: Tue, 22 Jan 2013 12:34:13 -0800 Subject: [PATCH 064/128] Add validation service to publish documentation to validate common manifest errors and modify grunt file to support resource files --- grunt.js | 30 +++++++++++++++++++++++------- pages/docs/publish.md | 14 +++++++++++++- 2 files changed, 36 insertions(+), 8 deletions(-) diff --git a/grunt.js b/grunt.js index 921915d..8fa32f1 100644 --- a/grunt.js +++ b/grunt.js @@ -1,7 +1,10 @@ var config = require( "./lib/config" ); +var path = require( "path" ); module.exports = function( grunt ) { +var async = grunt.utils.async; + grunt.loadNpmTasks( "grunt-wordpress" ); grunt.loadNpmTasks( "grunt-clean" ); grunt.loadNpmTasks( "grunt-jquery-content" ); @@ -31,6 +34,9 @@ grunt.initConfig({ "build-pages": { all: grunt.file.expandFiles( "pages/**" ) }, + "build-resources": { + all: grunt.file.expandFiles( "resources/**/*" ) + }, wordpress: grunt.utils._.extend({ dir: "dist/wordpress" }, config.wordpress ) @@ -55,12 +61,21 @@ grunt.registerHelper( "wordpress-get-postpaths", function( fn ) { grunt.registerTask( "sync-docs", function() { var done = this.async(); - grunt.helper( "wordpress-sync-posts", "dist/wordpress/posts/", function( error ) { - if ( error ) { - return done( false ); + var dir = grunt.config( "wordpress.dir" ); + + async.waterfall([ + function syncPosts( fn ) { + grunt.helper( "wordpress-sync-posts", "dist/wordpress/posts/", fn ); + }, + function syncResources( fn ) { + grunt.helper( "wordpress-sync-resources", path.join( dir, "resources/" ), fn ); + } + ], function( error ) { + if ( !error ) { + return done(); } - done(); + done( false ); }); }); @@ -132,9 +147,10 @@ grunt.registerTask( "restore-repos", function() { }); }); + grunt.registerTask( "default", "lint test" ); -grunt.registerTask( "setup", "setup-pluginsdb setup-retrydb build-pages sync-docs" ); -grunt.registerTask( "update", "clean build-pages sync-docs" ); -grunt.registerTask( "restore", "clean-retries setup-retrydb build-pages sync-docs restore-repos" ); +grunt.registerTask( "setup", "setup-pluginsdb setup-retrydb build-pages sync-docs build-resources" ); +grunt.registerTask( "update", "clean build-pages build-resources sync-docs" ); +grunt.registerTask( "restore", "clean-retries setup-retrydb build-pages sync-docs build-resources restore-repos" ); }; diff --git a/pages/docs/publish.md b/pages/docs/publish.md index bddbb8b..56355d3 100644 --- a/pages/docs/publish.md +++ b/pages/docs/publish.md @@ -20,6 +20,16 @@ specification](/docs/package-manifest/). Use an online JSON verifier such as [JSONlint](http://jsonlint.com) to make sure the file is valid. You are now ready to publish your plugin! +

Validate Your Manifest File Here

+ +
+ Upload your manifest file to check for common errors: + +
+
+ + + ## Publishing a Version After the post-receive hook is setup and your manifest has been added, @@ -42,7 +52,9 @@ We highly suggest that you **do not overwrite old tags**, instead, update the version number tag in the manifest, commit, and create a new tag to fix any errors you've encountered. -## Having Trouble? + +## Troubleshooting + Unfortunately we do not currently have a system for notifying you if there is a problem. If you're interested in helping improve From b32402537a718f473d095a4501bef5dedd60638c Mon Sep 17 00:00:00 2001 From: Dan Heberden Date: Tue, 22 Jan 2013 12:38:43 -0800 Subject: [PATCH 065/128] add the actual validator script --- resources/validate.js | 80 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 resources/validate.js diff --git a/resources/validate.js b/resources/validate.js new file mode 100644 index 0000000..0c96b4b --- /dev/null +++ b/resources/validate.js @@ -0,0 +1,80 @@ +(function() { + + var log = (function(){ + var logger = function(content, skip) { + if ( !skip ) { + content = "
"+content+"
"; + } + logger.output.push( content ); + }; + logger.heading = function( content ) { + logger( "

"+content+"

", true ); + }; + logger.details = function( content ) { + logger( "
"+content+"
", true ); + }; + logger.output = []; + return logger; + })(); + + var helpLinks = { + people: "People Fields" + }; + + var handler = function( e ) { + e.preventDefault(); + var output = $( ".validator-output" ).empty(); + var files = e.target.files; + var file = files && files[0]; + if ( !file ) { + return; + } + + var filename = file.name.replace(".jquery.json", "" ); + var reader = new FileReader(); + + // Closure to capture the file information. + reader.onload = function( e ) { + var result = e.target.result; + var manifest; + try { + manifest = $.parseJSON( result ); + } catch( e ) { + log.heading( "JSON Validation Error" ); + log( "Your json is not valid. See json.org for more information." ); + log.details( e.name + ": " + e.type + " " + e['arguments'].join(',') ); + } + if ( manifest ) { + var required = "name version title author licenses dependencies".split(" "); + $.each( required, function( i, v ) { + if ( !manifest[ v ] ) { + log( "" + v + " attribute is required" ); + } + }); + + if ( manifest.name && ( manifest.name !== filename ) ) { + log( "expected " + manifest.name + ".jquery.json as filename due " + + "to name attribute of '" + manifest.name + "'" ); + } + + if ( manifest.author ) { + if ( typeof manifest.author !== "object" ) { + log( "author property must be an object. See " + helpLinks.people + " for more information" ); + } else if ( !manifest.author.name ) { + log( "the name propety of the author people object is required. See " + helpLinks.people + " for more information" ); + } + } + } + var logContent = log.output.join(''); + output.html( logContent || "

Your manifest file passed all tests

" ); + }; + + // Read in the image file as a data URL. + reader.readAsText(file); + }; + + $( document ).ready( function() { + $( 'input[name="files"]' ).on( 'change', handler ); + }); + +})(); From e8e1e900899056f77eb8d3c514119a0399589e16 Mon Sep 17 00:00:00 2001 From: Dan Heberden Date: Tue, 22 Jan 2013 20:38:37 -0800 Subject: [PATCH 066/128] update validator with more rules and clear log on each upload. also add more info about the tool to the page --- pages/docs/publish.md | 3 +++ resources/validate.js | 45 ++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/pages/docs/publish.md b/pages/docs/publish.md index 56355d3..85b1da7 100644 --- a/pages/docs/publish.md +++ b/pages/docs/publish.md @@ -25,6 +25,9 @@ ready to publish your plugin!
Upload your manifest file to check for common errors: +

Since this tool uses the new HTML5 FileReader API to look at the file contents + without actually uploading your file to the server, you'll need a moder browser + like Chrome, Safari, Firefox, Opera or IE10.

diff --git a/resources/validate.js b/resources/validate.js index 0c96b4b..b412841 100644 --- a/resources/validate.js +++ b/resources/validate.js @@ -12,8 +12,11 @@ }; logger.details = function( content ) { logger( "
"+content+"
", true ); - }; - logger.output = []; + }; + logger.clear = function() { + logger.output = []; + }; + logger.clear(); return logger; })(); @@ -23,7 +26,8 @@ var handler = function( e ) { e.preventDefault(); - var output = $( ".validator-output" ).empty(); + var output = $( ".validator-output" ); + log.clear(); var files = e.target.files; var file = files && files[0]; if ( !file ) { @@ -64,6 +68,41 @@ log( "the name propety of the author people object is required. See " + helpLinks.people + " for more information" ); } } + + if ( manifest.keywords ) { + if ( $.type( manifest.keywords ) !== "array" ) { + log( "keywords property must be an array" ); + } else { + $.each( manifest.keywords, function( i, v ) { + if ( !(/^[a-zA-Z0-9\.\-]+$/).test( v ) ) { + log( "Keyword " + v + " has invalid characters. Only letters, numbers, periods and hiphens are allowed" ); + } + }); + } + } + + if ( manifest.licenses ) { + if ( $.type( manifest.licenses ) !== "array" ) { + log( "licences property must be an array" ); + } else { + $.each( manifest.licenses, function( i, v ) { + if ( $.type( v ) !== "object" ) { + log( "The elements in the licenses array must be objects" ); + } else { + if ( !v.type ) { + log( "Each license object must have a type property" ); + } + if ( !v.url ) { + log( "Each license object must have a url property" ); + } + } + }); + } + } + + + + } var logContent = log.output.join(''); output.html( logContent || "

Your manifest file passed all tests

" ); From 19410b69efcacba4fb4f5a3b4a7a658aea521c3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 23 Jan 2013 10:47:05 -0500 Subject: [PATCH 067/128] Inform user when a plugin is already owned by someone else. --- lib/hook.js | 6 +++++- lib/service.js | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/hook.js b/lib/hook.js index 2c14e26..a8f2960 100644 --- a/lib/hook.js +++ b/lib/hook.js @@ -129,8 +129,12 @@ function processRelease( repo, tag, file, manifest, fn ) { // the plugin is owned by someone else if ( owner !== repo.userId ) { - // TODO: report error to user logger.log( repo.userId + " attempted to add " + manifest.name + " which is owned by " + owner ); + repo.informOtherOwner({ + tag: tag, + name: manifest.name, + owner: owner + }); return fn( null, null ); } diff --git a/lib/service.js b/lib/service.js index 4e60911..56bece7 100644 --- a/lib/service.js +++ b/lib/service.js @@ -405,6 +405,9 @@ extend( Repo.prototype, { }, informInvalidManifest: function( data ) { this.inform( this.id + " " + data.tag + " " + data.file + " has the following errors: " + data.errors ); + }, + informOtherOwner: function( data ) { + this.inform( this.id + " " + data.tag + " cannot publish " + data.name + " which is owned by " + data.owner ); } }); From b70694981090ab9ed45a7b9665366f1198f72985 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 23 Jan 2013 10:52:14 -0500 Subject: [PATCH 068/128] Include a timestamp in the user error log. --- lib/service.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/service.js b/lib/service.js index 56bece7..1f03ac9 100644 --- a/lib/service.js +++ b/lib/service.js @@ -395,7 +395,7 @@ extend( Repo.prototype, { // error notification extend( Repo.prototype, { inform: function( msg ) { - fs.appendFile( config.errorLog, msg + "\n" ); + fs.appendFile( config.errorLog, (new Date()).toGMTString() + " " + msg + "\n" ); }, informMissingManifset: function( data ) { this.inform( this.id + " " + data.tag + " has no manifest file(s)." ); From 6be9e88144713984684d6b03a16b18ddfd17e6a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 23 Jan 2013 10:52:32 -0500 Subject: [PATCH 069/128] 1.0.14 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3bc2239..3119d9e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plugins.jquery.com", - "version": "1.0.13", + "version": "1.0.14", "author": "jQuery Project", "description": "The official jQuery plugins site", "homepage": "https://github.com/jquery/plugins.jquery.com", From 6c82b013c9f51ff0e9ed4da9e2fe4a241b3eee66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 23 Jan 2013 18:03:02 -0500 Subject: [PATCH 070/128] Add pass-thru for error.log in HTTP server. --- scripts/update-server.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/update-server.js b/scripts/update-server.js index dfa0732..d8d7745 100644 --- a/scripts/update-server.js +++ b/scripts/update-server.js @@ -1,4 +1,6 @@ var http = require( "http" ), + fs = require( "fs" ), + config = require( "../lib/config" ), service = require( "../lib/service" ), hook = require( "../lib/hook" ), logger = require( "../lib/logger" ), @@ -23,6 +25,10 @@ var server = http.createServer(function( request, response ) { }); request.on( "end", function() { + if ( request.url === "/error.log" ) { + return fs.createReadStream( config.errorLog ).pipe( response ); + } + var repo = service.getRepoByHook( data ); if ( !repo ) { From d8b44908e9fb94630684a14a735f435053bda974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 23 Jan 2013 18:03:36 -0500 Subject: [PATCH 071/128] 1.0.15 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3119d9e..39863af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plugins.jquery.com", - "version": "1.0.14", + "version": "1.0.15", "author": "jQuery Project", "description": "The official jQuery plugins site", "homepage": "https://github.com/jquery/plugins.jquery.com", From fa83ed55703c2f1742ad4ede8e9f0569f5a0da81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 23 Jan 2013 23:08:13 -0500 Subject: [PATCH 072/128] Inform user upon success. --- lib/hook.js | 1 + lib/service.js | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/hook.js b/lib/hook.js index a8f2960..f0f825e 100644 --- a/lib/hook.js +++ b/lib/hook.js @@ -153,6 +153,7 @@ function processRelease( repo, tag, file, manifest, fn ) { return fn( error ); } + repo.informSuccess({ name: manifest.name, version: manifest.version }); logger.log( "Added " + manifest.name + " v" + manifest.version + " to plugins DB" ); fn( null, manifest ); } diff --git a/lib/service.js b/lib/service.js index 1f03ac9..ec48572 100644 --- a/lib/service.js +++ b/lib/service.js @@ -392,7 +392,7 @@ extend( Repo.prototype, { } }); -// error notification +// Status notifications extend( Repo.prototype, { inform: function( msg ) { fs.appendFile( config.errorLog, (new Date()).toGMTString() + " " + msg + "\n" ); @@ -408,6 +408,9 @@ extend( Repo.prototype, { }, informOtherOwner: function( data ) { this.inform( this.id + " " + data.tag + " cannot publish " + data.name + " which is owned by " + data.owner ); + }, + informSuccess: function( data ) { + this.inform( this.id + " SUCCESSFULLY ADDED " + data.name + " v" + data.version + "!" ); } }); From b1a0eca395b2d66d2f8f2aec41a621266f9446b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 23 Jan 2013 23:08:32 -0500 Subject: [PATCH 073/128] 1.0.16 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 39863af..e3b83e1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plugins.jquery.com", - "version": "1.0.15", + "version": "1.0.16", "author": "jQuery Project", "description": "The official jQuery plugins site", "homepage": "https://github.com/jquery/plugins.jquery.com", From 75d548dffae46b9761e3f265286833fdbc02ccae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 24 Jan 2013 08:58:47 -0500 Subject: [PATCH 074/128] Remove delay before processing a request. Fix early return from git fetch. --- lib/service/github.js | 3 ++- scripts/update-server.js | 19 +++++++------------ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/lib/service/github.js b/lib/service/github.js index 212be6f..e664d6b 100644 --- a/lib/service/github.js +++ b/lib/service/github.js @@ -158,7 +158,8 @@ extend( GithubRepo.prototype, { function( error ) { // repo already exists if ( !error ) { - return exec( "git fetch -t", { cwd: repo.path }, this ); + exec( "git fetch -t", { cwd: repo.path }, this ); + return; } // error other than repo not existing diff --git a/scripts/update-server.js b/scripts/update-server.js index d8d7745..939a32a 100644 --- a/scripts/update-server.js +++ b/scripts/update-server.js @@ -55,18 +55,13 @@ var server = http.createServer(function( request, response ) { // Process the request processing[ repo.id ] = true; - // GitHub seems to notify us too soon when there are tags. If we - // immediately check for new tags, the data may not be available yet, - // so we wait a bit before trying to process the request. - setTimeout(function() { - hook.processHook( repo, function( error ) { - delete processing[ repo.id ]; - logger.log( "Done processing request: " + repo.id ); - if ( error ) { - logger.error( "Error processing hook: " + error.stack ); - } - }); - }, 60000 ); + hook.processHook( repo, function( error ) { + delete processing[ repo.id ]; + logger.log( "Done processing request: " + repo.id ); + if ( error ) { + logger.error( "Error processing hook: " + error.stack ); + } + }); }); }); From 071627def31087109baa8c0c35e12af841464f2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 24 Jan 2013 08:59:07 -0500 Subject: [PATCH 075/128] 1.1.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e3b83e1..714e9d2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plugins.jquery.com", - "version": "1.0.16", + "version": "1.1.0", "author": "jQuery Project", "description": "The official jQuery plugins site", "homepage": "https://github.com/jquery/plugins.jquery.com", From 817ee31d8dcd9c5bde7deda158446d0202873e3f Mon Sep 17 00:00:00 2001 From: Ralph Whitbeck Date: Thu, 24 Jan 2013 21:44:56 -0500 Subject: [PATCH 076/128] Updated the troubleshooting section to add a line for the error.log, Fixes #118. --- pages/docs/publish.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pages/docs/publish.md b/pages/docs/publish.md index 85b1da7..4039ab5 100644 --- a/pages/docs/publish.md +++ b/pages/docs/publish.md @@ -58,13 +58,10 @@ errors you've encountered. ## Troubleshooting +If you have problems with your plugin not publishing you should check the +[error log](/error.log) for hints on what the problem might be. -Unfortunately we do not currently have a system for -notifying you if there is a problem. If you're interested in helping improve -this aspect of the plugins site, we'd [love your -help](https://github.com/jquery/plugins.jquery.com/issues/11). - -If you encounter trouble getting this process to work with your plugin, please +If you still encounter trouble getting this process to work with your plugin, please join the IRC channel [#jquery-content](irc://freenode.net:6667/#jquery-content) on [freenode](http://freenode.net). If you can't seem to connect with someone in the IRC channel, please feel free to email us at From f7ce01d452ff939c3be96bd36a1428df72e03bba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Fri, 25 Jan 2013 14:18:12 -0500 Subject: [PATCH 077/128] Docs: Whitespace. --- pages/docs/publish.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/pages/docs/publish.md b/pages/docs/publish.md index 4039ab5..3f95092 100644 --- a/pages/docs/publish.md +++ b/pages/docs/publish.md @@ -1,5 +1,5 @@ Publishing your plugin on the site is a three step process: @@ -23,12 +23,12 @@ ready to publish your plugin!

Validate Your Manifest File Here

- Upload your manifest file to check for common errors: - -

Since this tool uses the new HTML5 FileReader API to look at the file contents - without actually uploading your file to the server, you'll need a moder browser - like Chrome, Safari, Firefox, Opera or IE10.

-
+ Upload your manifest file to check for common errors: + +

Since this tool uses the new HTML5 FileReader API to look at the file contents + without actually uploading your file to the server, you'll need a moder browser + like Chrome, Safari, Firefox, Opera or IE10.

+
@@ -55,7 +55,6 @@ We highly suggest that you **do not overwrite old tags**, instead, update the version number tag in the manifest, commit, and create a new tag to fix any errors you've encountered. - ## Troubleshooting If you have problems with your plugin not publishing you should check the From 976035aa1e138fe1dd39037d49747effaed3dc4d Mon Sep 17 00:00:00 2001 From: Istvan Halmen Date: Tue, 29 Jan 2013 14:34:29 +0200 Subject: [PATCH 078/128] Adding mobiscroll to suites list --- lib/suites.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/suites.json b/lib/suites.json index 797e3c8..cecb6cf 100644 --- a/lib/suites.json +++ b/lib/suites.json @@ -1,3 +1,4 @@ { - "github/jquery/jquery-ui": "ui." + "github/jquery/jquery-ui": "ui.", + "github/acidb/mobiscroll": "mobiscroll." } From 6eef509da52dbb65d8656fd7901e9501e201450c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 29 Jan 2013 15:52:00 -0500 Subject: [PATCH 079/128] Use the real validator for the hosted version in the docs. --- grunt.js | 73 +++++++++---- lib/manifest.js | 243 ++++++++++++++++++++++++++++++++++++++++++ lib/service.js | 233 +--------------------------------------- pages/docs/publish.md | 2 +- resources/validate.js | 133 +++++------------------ 5 files changed, 327 insertions(+), 357 deletions(-) create mode 100644 lib/manifest.js diff --git a/grunt.js b/grunt.js index 8fa32f1..6e5c9f6 100644 --- a/grunt.js +++ b/grunt.js @@ -34,9 +34,9 @@ grunt.initConfig({ "build-pages": { all: grunt.file.expandFiles( "pages/**" ) }, - "build-resources": { - all: grunt.file.expandFiles( "resources/**/*" ) - }, + "build-resources": { + all: grunt.file.expandFiles( "resources/**" ) + }, wordpress: grunt.utils._.extend({ dir: "dist/wordpress" }, config.wordpress ) @@ -59,23 +59,54 @@ grunt.registerHelper( "wordpress-get-postpaths", function( fn ) { }); }); +grunt.registerMultiTask( "build-resources", "Copy resources", function() { + var task = this, + taskDone = task.async(), + files = this.data, + targetDir = grunt.config( "wordpress.dir" ) + "/resources/"; + + grunt.file.mkdir( targetDir ); + + grunt.utils.async.forEachSeries( files, function( fileName, fileDone ) { + grunt.file.copy( fileName, targetDir + fileName.replace( /^.+?\//, "" ) ); + fileDone(); + }, function() { + if ( task.errorCount ) { + grunt.warn( "Error building resources." ); + return taskDone( false ); + } + + grunt.log.writeln( "Built " + files.length + " resources." ); + + // Build validate.js + grunt.file.write( targetDir + "/validate.js", + "(function() {" + + grunt.file.read( require.resolve( "semver" ) ) + ";" + + grunt.file.read( "lib/manifest.js" ) + + grunt.file.read( "resources/validate.js" ) + + "})();" ); + + taskDone(); + }); +}); + grunt.registerTask( "sync-docs", function() { - var done = this.async(); - var dir = grunt.config( "wordpress.dir" ); - - async.waterfall([ - function syncPosts( fn ) { - grunt.helper( "wordpress-sync-posts", "dist/wordpress/posts/", fn ); - }, - function syncResources( fn ) { - grunt.helper( "wordpress-sync-resources", path.join( dir, "resources/" ), fn ); - } - ], function( error ) { - if ( !error ) { - return done(); + var done = this.async(), + dir = grunt.config( "wordpress.dir" ); + + async.waterfall([ + function syncPosts( fn ) { + grunt.helper( "wordpress-sync-posts", path.join( dir, "posts/" ), fn ); + }, + function syncResources( fn ) { + grunt.helper( "wordpress-sync-resources", path.join( dir, "resources/" ), fn ); + } + ], function( error ) { + if ( error ) { + return done( false ); } - done( false ); + done(); }); }); @@ -148,9 +179,11 @@ grunt.registerTask( "restore-repos", function() { }); + grunt.registerTask( "default", "lint test" ); -grunt.registerTask( "setup", "setup-pluginsdb setup-retrydb build-pages sync-docs build-resources" ); -grunt.registerTask( "update", "clean build-pages build-resources sync-docs" ); -grunt.registerTask( "restore", "clean-retries setup-retrydb build-pages sync-docs build-resources restore-repos" ); +grunt.registerTask( "publish-docs", "build-pages build-resources sync-docs" ); +grunt.registerTask( "setup", "setup-pluginsdb setup-retrydb publish-docs" ); +grunt.registerTask( "update", "clean publish-docs" ); +grunt.registerTask( "restore", "clean-retries setup-retrydb publish-docs restore-repos" ); }; diff --git a/lib/manifest.js b/lib/manifest.js new file mode 100644 index 0000000..921a63d --- /dev/null +++ b/lib/manifest.js @@ -0,0 +1,243 @@ +(function ( exports, semver ) { + +exports.blacklist = []; +exports.suites = []; + +function isObject( obj ) { + return ({}).toString.call( obj ) === "[object Object]"; +} + +function isUrl( /*str*/ ) { + // TODO: URL validation + return true; +} + +function isEmail( str ) { + return (/^[a-zA-Z0-9.!#$%&'*+\/=?\^_`{|}~\-]+@[a-zA-Z0-9\-]+(?:\.[a-zA-Z0-9\-]+)*$/).test( str ); +} + +exports.validate = function( manifest, version, prefix, filename ) { + var errors = []; + + /** required fields **/ + + if ( !manifest.name ) { + errors.push( "Missing required field: name." ); + } else if ( typeof manifest.name !== "string" ) { + errors.push( "Invalid data type for name; must be a string." ); + } else if ( !(/^[a-zA-Z0-9_\.\-]+$/).test( manifest.name ) ) { + errors.push( "Name contains invalid characters." ); + } else if ( exports.blacklist.indexOf( manifest.name ) !== -1 ) { + errors.push( "Name must not be '" + manifest.name + "'." ); + } else { + if ( prefix ) { + if ( manifest.name.indexOf( prefix ) !== 0 ) { + errors.push( "Name must start with '" + prefix + "'." ); + } + } else { + Object.keys( exports.suites ).forEach(function( repoId ) { + var prefix = exports.suites[ repoId ]; + if ( manifest.name.indexOf( prefix ) === 0 && + !(/\./).test( manifest.name.substr( prefix.length ) ) ) { + errors.push( "Name must not start with '" + prefix + "'." ); + } + }); + } + + if ( filename && filename.substr( 0, filename.length - 12 ) !== manifest.name ) { + errors.push( "Name must match manifest file name." ); + } + } + + if ( !manifest.version ) { + errors.push( "Missing required field: version." ); + } else if ( typeof manifest.version !== "string" ) { + errors.push( "Invalid data type for version; must be a string." ); + } else if ( manifest.version !== semver.clean( manifest.version ) ) { + errors.push( "Manifest version (" + manifest.version + ") is invalid." ); + // version may not be provided when run as a standalone validator + } else if ( version && (manifest.version !== semver.clean( version )) ) { + errors.push( "Manifest version (" + manifest.version + ") does not match tag (" + version + ")." ); + } + + if ( !manifest.title ) { + errors.push( "Missing required field: title." ); + } else if ( typeof manifest.title !== "string" ) { + errors.push( "Invalid data type for title; must be a string." ); + } + + if ( !manifest.author ) { + errors.push( "Missing required field: author." ); + } else if ( !isObject( manifest.author ) ) { + errors.push( "Invalid data type for author; must be an object." ); + } else if ( !manifest.author.name ) { + errors.push( "Missing required field: author.name." ); + } else { + if ( typeof manifest.author.name !== "string" ) { + errors.push( "Invalid data type for author.name; must be a string." ); + } + + if ( "email" in manifest.author ) { + if ( typeof manifest.author.email !== "string" ) { + errors.push( "Invalid data type for author.email; must be a string." ); + } else if ( !isEmail( manifest.author.email ) ) { + errors.push( "Invalid value for author.email." ); + } + } + + if ( "url" in manifest.author ) { + if ( typeof manifest.author.url !== "string" ) { + errors.push( "Invalid data type for author.url; must be a string." ); + } else if ( !isUrl( manifest.author.url ) ) { + errors.push( "Invalid value for author.url." ); + } + } + } + + if ( !manifest.licenses ) { + errors.push( "Missing required field: licenses." ); + } else if ( !Array.isArray( manifest.licenses ) ) { + errors.push( "Invalid data type for licenses; must be an array." ); + } else if ( !manifest.licenses.length ) { + errors.push( "There must be at least one license." ); + } else { + manifest.licenses.forEach(function( license, i ) { + if ( !license.url ) { + errors.push( "Missing required field: licenses[" + i + "].url." ); + } else if ( typeof license.url !== "string" ) { + errors.push( "Invalid data type for licenses[" + i + "].url; must be a string." ); + } else if ( !isUrl( license.url ) ) { + errors.push( "Invalid value for license.url." ); + } + }); + } + + if ( !manifest.dependencies ) { + errors.push( "Missing required field: dependencies." ); + } else if ( !isObject( manifest.dependencies ) ) { + errors.push( "Invalid data type for dependencies; must be an object." ); + } else { + if ( !manifest.dependencies.jquery ) { + errors.push( "Missing required dependency: jquery." ); + } + Object.keys( manifest.dependencies ).forEach(function( dependency ) { + if ( typeof manifest.dependencies[ dependency ] !== "string" ) { + errors.push( "Invalid data type for dependencies[" + dependency + "];" + + " must be a string." ); + } else if ( semver.validRange( manifest.dependencies[ dependency ] ) === null ) { + errors.push( "Invalid version range for dependency: " + dependency + "." ); + } + }); + } + + /** optional fields **/ + + if ( "description" in manifest && typeof manifest.description !== "string" ) { + errors.push( "Invalid data type for description; must be a string." ); + } + + if ( "keywords" in manifest ) { + if ( !Array.isArray( manifest.keywords ) ) { + errors.push( "Invalid data type for keywords; must be an array." ); + } else { + manifest.keywords.forEach(function( keyword, i ) { + if ( typeof keyword !== "string" ) { + errors.push( "Invalid data type for keywords[" + i + "]; must be a string." ); + } else if ( !(/^[a-zA-Z0-9\.\-]+$/).test( keyword ) ) { + errors.push( "Invalid characters for keyword: " + keyword + "." ); + } + }); + } + } + + if ( "homepage" in manifest ) { + if ( typeof manifest.homepage !== "string" ) { + errors.push( "Invalid data type for homepage; must be a string." ); + } else if ( !isUrl( manifest.homepage ) ) { + errors.push( "Invalid value for homepage." ); + } + } + + if ( "docs" in manifest ) { + if ( typeof manifest.docs !== "string" ) { + errors.push( "Invalid data type for docs; must be a string." ); + } else if ( !isUrl( manifest.docs ) ) { + errors.push( "Invalid value for docs." ); + } + } + + if ( "demo" in manifest ) { + if ( typeof manifest.demo !== "string" ) { + errors.push( "Invalid data type for demo; must be a string." ); + } else if ( !isUrl( manifest.demo ) ) { + errors.push( "Invalid value for demo." ); + } + } + + if ( "download" in manifest ) { + if ( typeof manifest.download !== "string" ) { + errors.push( "Invalid data type for download; must be a string." ); + } else if ( !isUrl( manifest.download ) ) { + errors.push( "Invalid value for download." ); + } + } + + if ( "bugs" in manifest ) { + // check { url: "..." } format + if ( typeof manifest.bugs === "object" ) { + if ( typeof manifest.bugs.url !== "string" ) { + errors.push( "Invalid data type for bugs.url; must be a string." ); + } else if ( !isUrl( manifest.bugs.url ) ) { + errors.push( "Invalid value for bugs.url." ); + } + } else { + if ( typeof manifest.bugs !== "string" ) { + errors.push( "Invalid data type for bugs; must be a string." ); + } else if ( !isUrl( manifest.bugs ) ) { + errors.push( "Invalid value for bugs." ); + } + } + } + + if ( "maintainers" in manifest ) { + if ( !Array.isArray( manifest.maintainers ) ) { + errors.push( "Invalid data type for maintainers; must be an array." ); + } else { + manifest.maintainers.forEach(function( maintainer, i ) { + if ( !isObject( maintainer ) ) { + errors.push( "Invalid data type for maintainers[" + i + "]; must be an object." ); + return; + } + + if ( !("name" in maintainer) ) { + errors.push( "Missing required field: maintainers[" + i + "].name." ); + } else if ( typeof maintainer.name !== "string" ) { + errors.push( "Invalid data type for maintainers[" + i + "].name; must be a string." ); + } + + if ( "email" in maintainer ) { + if ( typeof maintainer.email !== "string" ) { + errors.push( "Invalid data type for maintainers[" + i + "].email; must be a string." ); + } else if ( !isEmail( maintainer.email ) ) { + errors.push( "Invalid value for maintainers[" + i + "].email." ); + } + } + + if ( "url" in maintainer ) { + if ( typeof maintainer.url !== "string" ) { + errors.push( "Invalid data type for maintainers[" + i + "].url; must be a string." ); + } else if ( !isUrl( maintainer.url ) ) { + errors.push( "Invalid value for maintainers[" + i + "].url." ); + } + } + }); + } + } + + return errors; +}; + +})( + typeof exports === "object" ? exports : this.Manifest = {}, + this.semver || require( "semver" ) +); \ No newline at end of file diff --git a/lib/service.js b/lib/service.js index ec48572..40d04f3 100644 --- a/lib/service.js +++ b/lib/service.js @@ -3,9 +3,13 @@ var fs = require( "fs" ), Step = require( "step" ), config = require( "./config" ), logger = require( "./logger" ), + Manifest = require( "./manifest" ), suites = require( "./suites" ), blacklist = require( "./blacklist" ); +Manifest.suites = suites; +Manifest.blacklist = blacklist; + function extend( a, b ) { for ( var prop in b ) { a[ prop ] = b[ prop ]; @@ -18,19 +22,6 @@ function Repo() { this.path = config.repoDir + "/" + this.id; } -function isObject( obj ) { - return ({}).toString.call( obj ) === "[object Object]"; -} - -function isUrl( /*str*/ ) { - // TODO: URL validation - return true; -} - -function isEmail( str ) { - return (/^[a-zA-Z0-9.!#$%&'*+\/=?\^_`{|}~\-]+@[a-zA-Z0-9\-]+(?:\.[a-zA-Z0-9\-]+)*$/).test( str ); -} - // manifest extend( Repo.prototype, { getManifest: function( tag, file, fn ) { @@ -53,221 +44,7 @@ extend( Repo.prototype, { }, validateManifest: function( manifest, version, prefix, filename ) { - var errors = []; - - /** required fields **/ - - if ( !manifest.name ) { - errors.push( "Missing required field: name." ); - } else if ( typeof manifest.name !== "string" ) { - errors.push( "Invalid data type for name; must be a string." ); - } else if ( !(/^[a-zA-Z0-9_\.\-]+$/).test( manifest.name ) ) { - errors.push( "Name contains invalid characters." ); - } else if ( blacklist.indexOf( manifest.name ) !== -1 ) { - errors.push( "Name must not be '" + manifest.name + "'." ); - } else { - if ( prefix ) { - if ( manifest.name.indexOf( prefix ) !== 0 ) { - errors.push( "Name must start with '" + prefix + "'." ); - } - } else { - Object.keys( suites ).forEach(function( repoId ) { - var prefix = suites[ repoId ]; - if ( manifest.name.indexOf( prefix ) === 0 && - !(/\./).test( manifest.name.substr( prefix.length ) ) ) { - errors.push( "Name must not start with '" + prefix + "'." ); - } - }); - } - - if ( filename && filename.substr( 0, filename.length - 12 ) !== manifest.name ) { - errors.push( "Name must match manifest file name." ); - } - } - - if ( !manifest.version ) { - errors.push( "Missing required field: version." ); - } else if ( typeof manifest.version !== "string" ) { - errors.push( "Invalid data type for version; must be a string." ); - } else if ( manifest.version !== semver.clean( manifest.version ) ) { - errors.push( "Manifest version (" + manifest.version + ") is invalid." ); - } else if ( manifest.version !== semver.clean( version ) ) { - errors.push( "Manifest version (" + manifest.version + ") does not match tag (" + version + ")." ); - } - - if ( !manifest.title ) { - errors.push( "Missing required field: title." ); - } else if ( typeof manifest.title !== "string" ) { - errors.push( "Invalid data type for title; must be a string." ); - } - - if ( !manifest.author ) { - errors.push( "Missing required field: author." ); - } else if ( !isObject( manifest.author ) ) { - errors.push( "Invalid data type for author; must be an object." ); - } else if ( !manifest.author.name ) { - errors.push( "Missing required field: author.name." ); - } else { - if ( typeof manifest.author.name !== "string" ) { - errors.push( "Invalid data type for author.name; must be a string." ); - } - - if ( "email" in manifest.author ) { - if ( typeof manifest.author.email !== "string" ) { - errors.push( "Invalid data type for author.email; must be a string." ); - } else if ( !isEmail( manifest.author.email ) ) { - errors.push( "Invalid value for author.email." ); - } - } - - if ( "url" in manifest.author ) { - if ( typeof manifest.author.url !== "string" ) { - errors.push( "Invalid data type for author.url; must be a string." ); - } else if ( !isUrl( manifest.author.url ) ) { - errors.push( "Invalid value for author.url." ); - } - } - } - - if ( !manifest.licenses ) { - errors.push( "Missing required field: licenses." ); - } else if ( !Array.isArray( manifest.licenses ) ) { - errors.push( "Invalid data type for licenses; must be an array." ); - } else if ( !manifest.licenses.length ) { - errors.push( "There must be at least one license." ); - } else { - manifest.licenses.forEach(function( license, i ) { - if ( !license.url ) { - errors.push( "Missing required field: licenses[" + i + "].url." ); - } else if ( typeof license.url !== "string" ) { - errors.push( "Invalid data type for licenses[" + i + "].url; must be a string." ); - } else if ( !isUrl( license.url ) ) { - errors.push( "Invalid value for license.url." ); - } - }); - } - - if ( !manifest.dependencies ) { - errors.push( "Missing required field: dependencies." ); - } else if ( !isObject( manifest.dependencies ) ) { - errors.push( "Invalid data type for dependencies; must be an object." ); - } else { - if ( !manifest.dependencies.jquery ) { - errors.push( "Missing required dependency: jquery." ); - } - Object.keys( manifest.dependencies ).forEach(function( dependency ) { - if ( typeof manifest.dependencies[ dependency ] !== "string" ) { - errors.push( "Invalid data type for dependencies[" + dependency + "];" + - " must be a string." ); - } else if ( semver.validRange( manifest.dependencies[ dependency ] ) === null ) { - errors.push( "Invalid version range for dependency: " + dependency + "." ); - } - }); - } - - /** optional fields **/ - - if ( "description" in manifest && typeof manifest.description !== "string" ) { - errors.push( "Invalid data type for description; must be a string." ); - } - - if ( "keywords" in manifest ) { - if ( !Array.isArray( manifest.keywords ) ) { - errors.push( "Invalid data type for keywords; must be an array." ); - } else { - manifest.keywords.forEach(function( keyword, i ) { - if ( typeof keyword !== "string" ) { - errors.push( "Invalid data type for keywords[" + i + "]; must be a string." ); - } else if ( !(/^[a-zA-Z0-9\.\-]+$/).test( keyword ) ) { - errors.push( "Invalid characters for keyword: " + keyword + "." ); - } - }); - } - } - - if ( "homepage" in manifest ) { - if ( typeof manifest.homepage !== "string" ) { - errors.push( "Invalid data type for homepage; must be a string." ); - } else if ( !isUrl( manifest.homepage ) ) { - errors.push( "Invalid value for homepage." ); - } - } - - if ( "docs" in manifest ) { - if ( typeof manifest.docs !== "string" ) { - errors.push( "Invalid data type for docs; must be a string." ); - } else if ( !isUrl( manifest.docs ) ) { - errors.push( "Invalid value for docs." ); - } - } - - if ( "demo" in manifest ) { - if ( typeof manifest.demo !== "string" ) { - errors.push( "Invalid data type for demo; must be a string." ); - } else if ( !isUrl( manifest.demo ) ) { - errors.push( "Invalid value for demo." ); - } - } - - if ( "download" in manifest ) { - if ( typeof manifest.download !== "string" ) { - errors.push( "Invalid data type for download; must be a string." ); - } else if ( !isUrl( manifest.download ) ) { - errors.push( "Invalid value for download." ); - } - } - - if ( "bugs" in manifest ) { - // check { url: "..." } format - if ( typeof manifest.bugs === "object" ) { - if ( typeof manifest.bugs.url !== "string" ) { - errors.push( "Invalid data type for bugs.url; must be a string." ); - } else if ( !isUrl( manifest.bugs.url ) ) { - errors.push( "Invalid value for bugs.url." ); - } - } else { - if ( typeof manifest.bugs !== "string" ) { - errors.push( "Invalid data type for bugs; must be a string." ); - } else if ( !isUrl( manifest.bugs ) ) { - errors.push( "Invalid value for bugs." ); - } - } - } - - if ( "maintainers" in manifest ) { - if ( !Array.isArray( manifest.maintainers ) ) { - errors.push( "Invalid data type for maintainers; must be an array." ); - } else { - manifest.maintainers.forEach(function( maintainer, i ) { - if ( !isObject( maintainer ) ) { - errors.push( "Invalid data type for maintainers[" + i + "]; must be an object." ); - return; - } - - if ( !("name" in maintainer) ) { - errors.push( "Missing required field: maintainers[" + i + "].name." ); - } else if ( typeof maintainer.name !== "string" ) { - errors.push( "Invalid data type for maintainers[" + i + "].name; must be a string." ); - } - - if ( "email" in maintainer ) { - if ( typeof maintainer.email !== "string" ) { - errors.push( "Invalid data type for maintainers[" + i + "].email; must be a string." ); - } else if ( !isEmail( maintainer.email ) ) { - errors.push( "Invalid value for maintainers[" + i + "].email." ); - } - } - - if ( "url" in maintainer ) { - if ( typeof maintainer.url !== "string" ) { - errors.push( "Invalid data type for maintainers[" + i + "].url; must be a string." ); - } else if ( !isUrl( maintainer.url ) ) { - errors.push( "Invalid value for maintainers[" + i + "].url." ); - } - } - }); - } - } + var errors = Manifest.validate( manifest, version, prefix, filename ); if ( errors.length ) { logger.log( "Manifest errors:", this.id, version, filename, errors ); diff --git a/pages/docs/publish.md b/pages/docs/publish.md index 3f95092..19e00e9 100644 --- a/pages/docs/publish.md +++ b/pages/docs/publish.md @@ -28,7 +28,7 @@ ready to publish your plugin!

Since this tool uses the new HTML5 FileReader API to look at the file contents without actually uploading your file to the server, you'll need a moder browser like Chrome, Safari, Firefox, Opera or IE10.

-
+

 
 
 
diff --git a/resources/validate.js b/resources/validate.js
index b412841..1807392 100644
--- a/resources/validate.js
+++ b/resources/validate.js
@@ -1,119 +1,36 @@
-(function() {
+$(function() {
+	var output = $( "#validator-output" );
+	function log( msg ) {
+		output.text( msg );
+	}
+
+	$( "input[name='files']" ).on( "change", function( event ) {
+		event.preventDefault();
+		var reader = new FileReader(),
+			files = event.target.files,
+			file = files && files[0];
 
-	var log = (function(){
-		var logger = function(content, skip) {
-			if ( !skip ) {
-				content = "
"+content+"
"; - } - logger.output.push( content ); - }; - logger.heading = function( content ) { - logger( "

"+content+"

", true ); - }; - logger.details = function( content ) { - logger( "
"+content+"
", true ); - }; - logger.clear = function() { - logger.output = []; - }; - logger.clear(); - return logger; - })(); - - var helpLinks = { - people: "People Fields" - }; - - var handler = function( e ) { - e.preventDefault(); - var output = $( ".validator-output" ); - log.clear(); - var files = e.target.files; - var file = files && files[0]; if ( !file ) { return; } - var filename = file.name.replace(".jquery.json", "" ); - var reader = new FileReader(); - - // Closure to capture the file information. - reader.onload = function( e ) { - var result = e.target.result; - var manifest; + reader.onload = function( event ) { + var manifest, errors; try { - manifest = $.parseJSON( result ); - } catch( e ) { - log.heading( "JSON Validation Error" ); - log( "Your json is not valid. See json.org for more information." ); - log.details( e.name + ": " + e.type + " " + e['arguments'].join(',') ); + manifest = $.parseJSON( event.target.result ); + } catch( error ) { + return log( "Your manifest file contains invalid JSON." ); } - if ( manifest ) { - var required = "name version title author licenses dependencies".split(" "); - $.each( required, function( i, v ) { - if ( !manifest[ v ] ) { - log( "" + v + " attribute is required" ); - } - }); - - if ( manifest.name && ( manifest.name !== filename ) ) { - log( "expected " + manifest.name + ".jquery.json as filename due " + - "to name attribute of '" + manifest.name + "'" ); - } - - if ( manifest.author ) { - if ( typeof manifest.author !== "object" ) { - log( "author property must be an object. See " + helpLinks.people + " for more information" ); - } else if ( !manifest.author.name ) { - log( "the name propety of the author people object is required. See " + helpLinks.people + " for more information" ); - } - } - - if ( manifest.keywords ) { - if ( $.type( manifest.keywords ) !== "array" ) { - log( "keywords property must be an array" ); - } else { - $.each( manifest.keywords, function( i, v ) { - if ( !(/^[a-zA-Z0-9\.\-]+$/).test( v ) ) { - log( "Keyword " + v + " has invalid characters. Only letters, numbers, periods and hiphens are allowed" ); - } - }); - } - } - if ( manifest.licenses ) { - if ( $.type( manifest.licenses ) !== "array" ) { - log( "licences property must be an array" ); - } else { - $.each( manifest.licenses, function( i, v ) { - if ( $.type( v ) !== "object" ) { - log( "The elements in the licenses array must be objects" ); - } else { - if ( !v.type ) { - log( "Each license object must have a type property" ); - } - if ( !v.url ) { - log( "Each license object must have a url property" ); - } - } - }); - } + errors = Manifest.validate( manifest, null, null, file.name ); + if ( errors.length ) { + log( "Your manifest file contains the following errors:\n\n" + + errors.join( "\n" ) ); + } else { + log( "Congratulations, your manifest file is valid." ); } - - - - - } - var logContent = log.output.join(''); - output.html( logContent || "

Your manifest file passed all tests

" ); }; - - // Read in the image file as a data URL. - reader.readAsText(file); - }; - - $( document ).ready( function() { - $( 'input[name="files"]' ).on( 'change', handler ); - }); -})(); + reader.readAsText( file ); + }); +}); From 7e7eed0fedfd8f85ed06bde244c451eb9fe00d42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 29 Jan 2013 16:14:52 -0500 Subject: [PATCH 080/128] 1.1.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 714e9d2..5b08c4a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plugins.jquery.com", - "version": "1.1.0", + "version": "1.1.1", "author": "jQuery Project", "description": "The official jQuery plugins site", "homepage": "https://github.com/jquery/plugins.jquery.com", From d3e57f1f44cff2f2433e6b6545fa9aad859df79a Mon Sep 17 00:00:00 2001 From: Jack Moore Date: Thu, 31 Jan 2013 03:50:49 -0500 Subject: [PATCH 081/128] fixed typo --- pages/docs/publish.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/docs/publish.md b/pages/docs/publish.md index 19e00e9..74cad2c 100644 --- a/pages/docs/publish.md +++ b/pages/docs/publish.md @@ -26,7 +26,7 @@ ready to publish your plugin! Upload your manifest file to check for common errors:

Since this tool uses the new HTML5 FileReader API to look at the file contents - without actually uploading your file to the server, you'll need a moder browser + without actually uploading your file to the server, you'll need a modern browser like Chrome, Safari, Firefox, Opera or IE10.


 

From 76a677cc58d3e381935d343c1eec7be6f91a42de Mon Sep 17 00:00:00 2001
From: "adam j. sontag" 
Date: Mon, 4 Feb 2013 17:10:17 -0500
Subject: [PATCH 082/128] Publishing docs: strengthen language around not
 re-using tags, add example.

---
 pages/docs/publish.md | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/pages/docs/publish.md b/pages/docs/publish.md
index 74cad2c..f80023f 100644
--- a/pages/docs/publish.md
+++ b/pages/docs/publish.md
@@ -51,9 +51,16 @@ version listed in the manifest file. So, if the version field in the manifest
 is "0.1.1" the tag should be either "0.1.1" or "v0.1.1". If the manifest file
 is valid, the version will be automatically added to the plugins site.
 
-We highly suggest that you **do not overwrite old tags**, instead, update the
-version number tag in the manifest, commit, and create a new tag to fix any
-errors you've encountered.
+The registry **does not support re-processing tags that it has already seen.**
+Therefore, we strongly suggest that you **do not overwrite old tags**. Instead,
+update the version number tag in the manifest, commit, and create a new tag to
+fix any errors you've encountered. 
+
+For example, you've pushed version `v1.7.0` of your plugin, but there is an
+[error detected](/error.log) in the manifest. If you fix the error, delete,
+re-create, and push another `v1.7.0` tag, the registry **will not** detect it.
+You will have to create and push `v1.7.1`.
+
 
 ## Troubleshooting
 

From ddf1df2fda669e2df6a000a833885f5259094818 Mon Sep 17 00:00:00 2001
From: "adam j. sontag" 
Date: Mon, 4 Feb 2013 17:12:44 -0500
Subject: [PATCH 083/128] 1.1.2

---
 package.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package.json b/package.json
index 5b08c4a..1e12630 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "plugins.jquery.com",
-  "version": "1.1.1",
+  "version": "1.1.2",
   "author": "jQuery Project",
   "description": "The official jQuery plugins site",
   "homepage": "https://github.com/jquery/plugins.jquery.com",

From c3c7fea77fdda0727b1f7c42f4254d7dca07b56a Mon Sep 17 00:00:00 2001
From: "adam j. sontag" 
Date: Mon, 4 Feb 2013 17:17:03 -0500
Subject: [PATCH 084/128] Update config-sample.json to use local.* prefix

---
 config-sample.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/config-sample.json b/config-sample.json
index 3bb0433..dc4f393 100644
--- a/config-sample.json
+++ b/config-sample.json
@@ -2,7 +2,7 @@
 	"repoDir": "/tmp/plugin-repos",
 	"pluginsDb": "plugins.db",
 	"wordpress": {
-		"url": "dev.plugins.jquery.com",
+		"url": "local.plugins.jquery.com",
 		"username": "admin",
 		"password": "secret"
 	}

From 61d85c069eb599b787de1e2d0d0778a075bac235 Mon Sep 17 00:00:00 2001
From: "adam j. sontag" 
Date: Tue, 12 Feb 2013 10:58:34 -0500
Subject: [PATCH 085/128] Link directly to contribute.jquery.org docs in README
 to explain build instructions

---
 README.md | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/README.md b/README.md
index 1d6fdcb..9429fb8 100644
--- a/README.md
+++ b/README.md
@@ -47,16 +47,10 @@ using [nave-installer](https://github.com/danheberden/nave-installer) or downloa
 
 #### plugins.jquery.com setup
 
-1. `git clone git@github.com:jquery/plugins.jquery.com.git`
-
-2. `cd plugins.jquery.com`
-
-3. `npm install`
-
-4. `cp config-sample.json config.json`
-
-5. Edit config.json
-    * Set `wordpress` properties to contain a valid username and password for the WordPress site.
+To build and deploy your changes for previewing in a
+[`jquery-wp-content`](https://github.com/jquery/jquery-wp-content) instance,
+follow the [workflow instructions](http://contribute.jquery.org/web-sites/#workflow) from our
+documentation on [contributing to jQuery Foundation web sites](http://contribute.jquery.org/web-sites/).
 
 If you want to setup and ultimately run the node scripts that manage plugin entries, run `grunt setup`. 
 If you need to clear the db or are getting and error running `grunt setup` regarding the setupdb or 

From 16d99d56966e79f758b391b83b664ba7447aa0e0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
Date: Wed, 13 Feb 2013 22:05:44 -0500
Subject: [PATCH 086/128] Disambiguate tags and paths for git log.

---
 lib/service/github.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/service/github.js b/lib/service/github.js
index e664d6b..a616667 100644
--- a/lib/service/github.js
+++ b/lib/service/github.js
@@ -120,7 +120,9 @@ extend( GithubRepo.prototype, {
 	},
 
 	getReleaseDate: function( tag, fn ) {
-		exec( "git log --pretty='%cD' -1 " + tag, { cwd: this.path }, function( error, stdout ) {
+		// The trailing "--" avoids an ambiguous argument in case a repo
+		// contains a path that matches the tag name
+		exec( "git log --pretty='%cD' -1 " + tag + " --", { cwd: this.path }, function( error, stdout ) {
 			if ( error ) {
 				return fn( error );
 			}

From efe15bf96d37199e1cde8bcdba0a0aa66cadfbd6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
Date: Wed, 13 Feb 2013 22:06:20 -0500
Subject: [PATCH 087/128] 1.1.3

---
 package.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package.json b/package.json
index 1e12630..2c08e7c 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "plugins.jquery.com",
-  "version": "1.1.2",
+  "version": "1.1.3",
   "author": "jQuery Project",
   "description": "The official jQuery plugins site",
   "homepage": "https://github.com/jquery/plugins.jquery.com",

From 04abde838e005a8d853f8e858b8ef2859db4c402 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
Date: Wed, 13 Feb 2013 23:07:04 -0500
Subject: [PATCH 088/128] Fixed detection of --console in manager.

---
 scripts/manager.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/manager.js b/scripts/manager.js
index 7e3eaf2..9f70173 100644
--- a/scripts/manager.js
+++ b/scripts/manager.js
@@ -1,7 +1,7 @@
 var path = require( "path" ),
 	spawn = require( "child_process" ).spawn,
 	logger = require( "../lib/logger" ),
-	consoleOption = process.argv.indexOf( "--console" ) ? "--console" : "";
+	consoleOption = process.argv.indexOf( "--console" ) !== -1 ? "--console" : "";
 
 logger.log( "Manager started." );
 

From 3541ce8436aecb1b3763726542c3a99b9033ed51 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
Date: Wed, 13 Feb 2013 23:07:13 -0500
Subject: [PATCH 089/128] 1.2.0

---
 package.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package.json b/package.json
index 2c08e7c..1508099 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "plugins.jquery.com",
-  "version": "1.1.3",
+  "version": "1.2.0",
   "author": "jQuery Project",
   "description": "The official jQuery plugins site",
   "homepage": "https://github.com/jquery/plugins.jquery.com",

From 37be402ca5f7adac59d2b7797538843dcbaa1ce1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
Date: Thu, 28 Mar 2013 10:17:53 -0400
Subject: [PATCH 090/128] Added script to transfer ownership of a plugin.

---
 bin/transfer.js  | 106 +++++++++++++++++++++++++++++++++++++++++++++++
 lib/pluginsdb.js |   5 +++
 2 files changed, 111 insertions(+)
 create mode 100755 bin/transfer.js

diff --git a/bin/transfer.js b/bin/transfer.js
new file mode 100755
index 0000000..f956610
--- /dev/null
+++ b/bin/transfer.js
@@ -0,0 +1,106 @@
+#!/usr/bin/env node
+
+var Step = require( "step" ),
+	service = require( "../lib/service" ),
+	pluginsDb = require( "../lib/pluginsdb" );
+
+process.stdin.setEncoding( "utf8" );
+
+function prompt( message, fn ) {
+	process.stdout.write( message + " " );
+	process.stdin.resume();
+
+	process.stdin.once( "data", function( chunk ) {
+		process.stdin.pause();
+		fn( null, chunk.trim() );
+	});
+}
+
+function showError( error ) {
+	console.log( "Error transferring ownership" );
+	console.log( error.stack );
+	process.exit( 1 );
+}
+
+function transfer( fn ) {
+	var plugin;
+
+	Step(
+		function() {
+			// Find out which plugin to transfer
+			prompt( "Plugin:", this );
+		},
+
+		function( error, _plugin ) {
+			if ( error ) {
+				return showError( error );
+			}
+
+			plugin = _plugin;
+
+			// Find out who currently owns the plugin
+			pluginsDb.getOwner( plugin, this.parallel() );
+		},
+
+		function( error, actualOwner ) {
+			if ( error ) {
+				return showError( error );
+			}
+
+			// Verify the plugin exists
+			if ( !actualOwner ) {
+				console.log( plugin + " does not exist." );
+				process.exit( 1 );
+			}
+
+			// Find out who we think owns the plugin
+			this.parallel()( null, actualOwner );
+			prompt( "Current owner:", this.parallel() );
+		},
+
+		function( error, actualOwner, providedOwner ) {
+			if ( error ) {
+				return showError( error );
+			}
+
+			// Verify the expected owner is the real owner
+			if ( providedOwner !== actualOwner ) {
+				console.log( plugin + " is owned by " + actualOwner +
+					", not " + providedOwner + "." );
+				process.exit( 1 );
+			}
+
+			// Find out where the plugin is being transferred to
+			prompt( "New repository id (e.g., github/owner/repo)", this );
+		},
+
+		function( error, id ) {
+			if ( error ) {
+				return showError( error );
+			}
+
+			// Create a Repo instance to verify the new id and parse the data
+			var repo;
+			try {
+				repo = service.getRepoById( id );
+			} catch ( error ) {
+				fn( error );
+				return;
+			}
+
+			// Transfer ownersip
+			this.parallel()( null, repo.userId );
+			pluginsDb.transferOwnership( plugin, repo.userId, repo.id, this.parallel() );
+		},
+
+		function( error, owner ) {
+			if ( error ) {
+				return showError( error );
+			}
+
+			console.log( "Succesfully transferred " + plugin + " to " + owner + "." );
+		}
+	);
+}
+
+transfer();
diff --git a/lib/pluginsdb.js b/lib/pluginsdb.js
index 8bf13cb..9686f8c 100644
--- a/lib/pluginsdb.js
+++ b/lib/pluginsdb.js
@@ -69,6 +69,11 @@ var pluginsDb = module.exports = {
 		});
 	}),
 
+	transferOwnership: auto(function( plugin, owner, repo, fn ) {
+		db.run( "UPDATE plugins SET owner = ?, repo = ? WHERE plugin = ?",
+			[ owner, repo, plugin ], fn );
+	}),
+
 	getTags: auto(function( repoId, fn ) {
 		db.all( "SELECT tag FROM repos WHERE repo = ?", [ repoId ], function( error, tags ) {
 			if ( error ) {

From c3787665b46653d6f5ac63ce46f6a07161701cca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
Date: Thu, 28 Mar 2013 10:18:11 -0400
Subject: [PATCH 091/128] 1.2.1

---
 package.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package.json b/package.json
index 1508099..04a1cdc 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "plugins.jquery.com",
-  "version": "1.2.0",
+  "version": "1.2.1",
   "author": "jQuery Project",
   "description": "The official jQuery plugins site",
   "homepage": "https://github.com/jquery/plugins.jquery.com",

From 60ba56da5f296b9a141e576a0ad6994924b7dfaf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
Date: Thu, 28 Mar 2013 10:42:30 -0400
Subject: [PATCH 092/128] README: Added description for transferring ownership.

---
 README.md | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/README.md b/README.md
index 9429fb8..aec2ff7 100644
--- a/README.md
+++ b/README.md
@@ -77,5 +77,13 @@ process (you have to kill the pid's from the processes' pid file). Also, running
 manually and individually is much easier for development, as you will probably only *need* 
 update-server.js running. 
 
+### Transferring ownership of a plugin
 
+On occassion, a plugin will be transferred from one owner to another. When this
+happens, you will need to verify that the transfer is legitimate. The request
+should come from the original owner, but in rare circumstances the request may
+come from the new owner and the original owner may not be reachable.
 
+To transfer a plugin, log into the production server and run the `bin/transfer.js`
+script. The script will prompt you for the necessary information and has several
+checks to ensure that the data provided isn't junk.

From 2cba6d07d76a2a5842f1437b19036852a00297c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
Date: Thu, 28 Mar 2013 10:48:56 -0400
Subject: [PATCH 093/128] README: Cleanup.

---
 README.md | 71 ++++++++++++++++++++++++++++++++-----------------------
 1 file changed, 41 insertions(+), 30 deletions(-)

diff --git a/README.md b/README.md
index aec2ff7..f898df8 100644
--- a/README.md
+++ b/README.md
@@ -4,21 +4,29 @@ The jQuery Plugins site, http://plugins.jquery.com/
 
 ### How it works
 
-The plugins site is an index of GitHub repositories that contain jQuery plugins. The repositories can contain one or many jQuery plugin with an accompanying valid `plugin.jquery.json` manifest file in the repository root. The specification for this file lives [here](http://plugins.jquery.com/docs/package-manifest).
+The plugins site is an index of GitHub repositories that contain jQuery plugins.
+The repositories can contain one or many jQuery plugin with an accompanying
+valid `plugin.jquery.json` manifest file in the repository root. The
+specification for this file lives [here](http://plugins.jquery.com/docs/package-manifest).
 
 ### How to list a plugin
 
-Simply add a [post-receive hook](http://help.github.com/post-receive-hooks/) to your repository with our web hook url, `http://plugins.jquery.com/postreceive-hook.`. When you push
-to your repository, the plugins site will look at your repository's tags and their corresponding manifest file (thepluginname.jquery.json). You can read up on this process,
-as well as the requirements of the manifest file on [the jQuery Plugins Site](http://plugins.jquery.com/docs/publish/).
+Simply add a [post-receive hook](http://help.github.com/post-receive-hooks/) to
+your repository with our Web Hook URL, `http://plugins.jquery.com/postreceive-hook.`.
+When you push to your repository, the plugins site will look at your repository's
+tags and their corresponding manifest file (thepluginname.jquery.json). You can
+read up on this process, as well as the requirements of the manifest file on
+[the jQuery Plugins Site](http://plugins.jquery.com/docs/publish/).
 
-Assuming there were no errors in your manifest file, your plugin should be on the plugins site within one to two minutes after pushing to github. If you 
-still don't see your plugin listed, you can click the "Test Hook" button on the same page you added the service hook to your repository and the 
-plugins site will re-query github for changes, in case github didn't update your repository in time. 
+Assuming there were no errors in your manifest file, your plugin should be on
+the plugins site within a minute after pushing to GitHub. If you still don't see
+your plugin listed, check the [error log](http://plugins.jquery.com/error.log).
 
-We are currently exploring options to provide feedback on errors encountered during the process of adding your 
-plugin to the plugins site. If you are still encountering issues after verifying the post-receive hook is in 
-place and that your manifest file is valid, ask for assistance in #jquery-content on [freenode.net](http://freenode.net).
+We are currently exploring options to provide better feedback on errors encountered
+during the process of adding your plugin to the plugins site. If you are still
+encountering issues after verifying the post-receive hook is in place and that
+your manifest file is valid, ask for assistance in #jquery-content
+on [freenode.net](http://freenode.net).
 
 ## Development
 
@@ -42,40 +50,43 @@ place and that your manifest file is valid, ask for assistance in #jquery-conten
 
 1. Follow https://github.com/joyent/node/wiki/Installation
 
-You can also install [nave](https://github.com/isaacs/nave), a node version manager. You can easily install it
-using [nave-installer](https://github.com/danheberden/nave-installer) or download it manually. 
+You can also install [nave](https://github.com/isaacs/nave), a node version manager.
+You can easily install it using [nave-installer](https://github.com/danheberden/nave-installer)
+or download it manually.
 
 #### plugins.jquery.com setup
 
 To build and deploy your changes for previewing in a
 [`jquery-wp-content`](https://github.com/jquery/jquery-wp-content) instance,
-follow the [workflow instructions](http://contribute.jquery.org/web-sites/#workflow) from our
-documentation on [contributing to jQuery Foundation web sites](http://contribute.jquery.org/web-sites/).
+follow the [workflow instructions](http://contribute.jquery.org/web-sites/#workflow)
+from our documentation on
+[contributing to jQuery Foundation web sites](http://contribute.jquery.org/web-sites/).
 
-If you want to setup and ultimately run the node scripts that manage plugin entries, run `grunt setup`. 
-If you need to clear the db or are getting and error running `grunt setup` regarding the setupdb or 
-retrydb tasks failing, run `grunt clean-all`. 
+If you want to setup and ultimately run the node scripts that manage plugin
+entries, run `grunt setup`. If you need to clear the db or are getting and error
+running `grunt setup` regarding the setupdb or retrydb tasks failing,
+run `grunt clean-all`.
 
-If you have made changes to the documentation and simply want to deploy or update that content, run
-`grunt update`. 
+If you have made changes to the documentation and simply want to deploy or update
+that content, run `grunt update`.
 
 #### Running the site for development and debugging
 
-1. `node scripts/update-server.js --console` will start the update server and log its output 
-to the terminal window. This will *not* update wordpress, but will let you see the result of 
-adding a plugin locally. 
+1. `node scripts/update-server.js --console` will start the update server and
+log its output to the terminal window. This will *not* update wordpress, but
+will let you see the result of adding a plugin locally.
 
-2. `node scripts/wordpress-update.js --console` will process the changes in sqlite into 
-entries in wordpress. Note, if you're re-adding plugins that have already been added, you 
-will need to remove those entries from wordpress.
+2. `node scripts/wordpress-update.js --console` will process the changes in
+sqlite into entries in wordpress. Note, if you're re-adding plugins that have
+already been added, you will need to remove those entries from wordpress.
 
 ### Running the site normally
 
-`node scripts/manager.js` runs the update-server and wordpress-update scripts automatically. 
-However, because it handless restarts/failures of these scripts, it is harder to stop this
-process (you have to kill the pid's from the processes' pid file). Also, running the servers
-manually and individually is much easier for development, as you will probably only *need* 
-update-server.js running. 
+`node scripts/manager.js` runs the update-server and wordpress-update scripts
+automatically. However, because it handless restarts/failures of these scripts,
+it is harder to stop this process. Also, running the servers manually and
+individually is much easier for development, as you will probably only *need*
+update-server.js running.
 
 ### Transferring ownership of a plugin
 

From 0f27bb77457e7b1b19832d40954d7ed164b8ee0e Mon Sep 17 00:00:00 2001
From: "Richard D. Worth" 
Date: Mon, 1 Apr 2013 04:35:24 -0500
Subject: [PATCH 094/128] Happy New Year

---
 LICENSE.txt => LICENSE-MIT.txt | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
 rename LICENSE.txt => LICENSE-MIT.txt (79%)

diff --git a/LICENSE.txt b/LICENSE-MIT.txt
similarity index 79%
rename from LICENSE.txt
rename to LICENSE-MIT.txt
index 5a0c597..1b5c731 100644
--- a/LICENSE.txt
+++ b/LICENSE-MIT.txt
@@ -1,4 +1,8 @@
-Copyright (c) 2011 jQuery Team, http://jquery.org/team
+Copyright (c) 2013 jQuery Foundation, http://jquery.org/
+
+This software consists of voluntary contributions made by many
+individuals. For exact contribution history, see the revision history
+and logs, available at http://github.com/jquery/plugins.jquery.com
 
 Permission is hereby granted, free of charge, to any person obtaining
 a copy of this software and associated documentation files (the

From 664ffaedbb921c7a0a0999f4a7cf605ff5486c6e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
Date: Mon, 1 Apr 2013 10:34:04 -0400
Subject: [PATCH 095/128] Upgrade to grunt-wordpress 1.0.7 and
 grunt-jquery-content 0.9.0.

---
 package.json | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package.json b/package.json
index 04a1cdc..338ce28 100644
--- a/package.json
+++ b/package.json
@@ -16,9 +16,9 @@
     "rimraf": "2.1.1",
     "wordpress": "0.1.3",
     "grunt": "0.3.17",
-    "grunt-wordpress": "1.0.5",
+    "grunt-wordpress": "1.0.7",
     "grunt-check-modules": "0.1.0",
-    "grunt-jquery-content": "0.8.1",
+    "grunt-jquery-content": "0.9.0",
     "grunt-clean": "0.3.0",
     "simple-log": "1.0.1"
   }

From 7af64f492a5919bdb7c2c2dc63cc781325951823 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
Date: Mon, 22 Apr 2013 14:10:40 -0400
Subject: [PATCH 096/128] When the retry script fails, exit with an error code
 so the manager will restart it.

---
 scripts/retry.js | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/scripts/retry.js b/scripts/retry.js
index cbe5fde..64c0b4d 100644
--- a/scripts/retry.js
+++ b/scripts/retry.js
@@ -87,6 +87,9 @@ var processFailures = function( fn ) {
 processFailures(function( error ) {
 	if ( error ) {
 		logger.error( "Error during retry: " + error.stack );
+
+		// Kill the process with an error code and let the manager restart it
+		process.exit( 1 );
 	}
 });
 

From f900e81caf216d86e324e2694ae837cd4a12627c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
Date: Mon, 22 Apr 2013 15:01:46 -0400
Subject: [PATCH 097/128] Gracefully handle remote repos that don't exist.

---
 lib/service.js | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lib/service.js b/lib/service.js
index 40d04f3..d676f62 100644
--- a/lib/service.js
+++ b/lib/service.js
@@ -65,6 +65,11 @@ extend( Repo.prototype, {
 
 			function( error, tags ) {
 				if ( error ) {
+					if ( /Repository not found/.test( error.message ) ) {
+						repo.informRepoNotFound();
+						return fn( null, [] );
+					}
+
 					return fn( error );
 				}
 
@@ -186,6 +191,9 @@ extend( Repo.prototype, {
 	informOtherOwner: function( data ) {
 		this.inform( this.id + " " + data.tag + " cannot publish " + data.name + " which is owned by " + data.owner );
 	},
+	informRepoNotFound: function() {
+		this.inform( this.id + " repo not found on remote server." );
+	},
 	informSuccess: function( data ) {
 		this.inform( this.id + " SUCCESSFULLY ADDED " + data.name + " v" + data.version + "!" );
 	}

From fb146ffb967ced529af56a33731cd00b192515e3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
Date: Mon, 22 Apr 2013 15:23:07 -0400
Subject: [PATCH 098/128] Track tags when a plugin is already owned by someone
 else. Fixes #107.

---
 lib/hook.js | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/lib/hook.js b/lib/hook.js
index f0f825e..954fd05 100644
--- a/lib/hook.js
+++ b/lib/hook.js
@@ -135,7 +135,16 @@ function processRelease( repo, tag, file, manifest, fn ) {
 					name: manifest.name,
 					owner: owner
 				});
-				return fn( null, null );
+
+				// track the tag so we don't process it on the next update
+				pluginsDb.addTag( repo.id, tag, function( error ) {
+					if ( error ) {
+						return fn( error );
+					}
+
+					fn( null, null );
+				});
+				return;
 			}
 
 			return owner;

From 943e453ec216b0d94b451e7252c6883889553498 Mon Sep 17 00:00:00 2001
From: Corey Frang 
Date: Wed, 17 Apr 2013 04:13:10 -0500
Subject: [PATCH 099/128] Ensure parent post doesn't have it's date updated on
 new release - Fixes #76

---
 scripts/wordpress-update.js | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/scripts/wordpress-update.js b/scripts/wordpress-update.js
index 50df195..e6633fa 100644
--- a/scripts/wordpress-update.js
+++ b/scripts/wordpress-update.js
@@ -16,6 +16,13 @@ process.on( "uncaughtException", function( error ) {
 function isStable( version ) {
 	return (/^\d+\.\d+\.\d+$/).test( version );
 }
+function extend( a, b ) {
+	for ( var p in b ) {
+		a[ p ] = b[ p ];
+	}
+
+	return a;
+}
 
 var actions = {};
 
@@ -134,7 +141,10 @@ actions.addRelease = function( data, fn ) {
 			// main page is constructed from the new version since pretty much
 			// anything can change between versions.
 			if ( versions.latest === manifest.version ) {
-				mainPage = Object.create( pageDetails );
+				extend( mainPage, pageDetails );
+				// don't update the post date on main page, and let it be set
+				// to whenever we processed it, no harm here.
+				delete mainPage.date;
 				mainPage.name = manifest.name;
 				mainPage.customFields = mergeCustomFields(
 					existingCustomFields, pageDetails.customFields );

From 755d9a0c7c32dc3b7dfbac21879432f67408e851 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
Date: Mon, 22 Apr 2013 15:56:57 -0400
Subject: [PATCH 100/128] 1.2.2

---
 package.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package.json b/package.json
index 338ce28..cb3206e 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "plugins.jquery.com",
-  "version": "1.2.1",
+  "version": "1.2.2",
   "author": "jQuery Project",
   "description": "The official jQuery plugins site",
   "homepage": "https://github.com/jquery/plugins.jquery.com",

From c3ea7f2a5d102fcb0ab6a8d4c919ea2c61224c4a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
Date: Mon, 29 Apr 2013 16:21:52 -0400
Subject: [PATCH 101/128] Upgrade to sqlite3 2.1.7.

---
 package.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package.json b/package.json
index cb3206e..128479f 100644
--- a/package.json
+++ b/package.json
@@ -11,7 +11,7 @@
   "dependencies": {
     "mkdirp": "0.3.4",
     "semver": "1.1.2",
-    "sqlite3": "2.1.5",
+    "sqlite3": "2.1.7",
     "step": "0.0.5",
     "rimraf": "2.1.1",
     "wordpress": "0.1.3",

From 781d7714044c90dcbc3853b3de8b39d4f3121106 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
Date: Mon, 29 Apr 2013 16:22:03 -0400
Subject: [PATCH 102/128] Upgrade to simple-log 1.1.0.

---
 package.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package.json b/package.json
index 128479f..bc750a6 100644
--- a/package.json
+++ b/package.json
@@ -20,6 +20,6 @@
     "grunt-check-modules": "0.1.0",
     "grunt-jquery-content": "0.9.0",
     "grunt-clean": "0.3.0",
-    "simple-log": "1.0.1"
+    "simple-log": "1.1.0"
   }
 }

From 69f2357de544ea4ac19b5b7efd2808b593468590 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
Date: Wed, 8 May 2013 10:37:11 -0400
Subject: [PATCH 103/128] When the wordpress update script fails, exit with an
 error code so the manager will restart it.

---
 scripts/wordpress-update.js | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/scripts/wordpress-update.js b/scripts/wordpress-update.js
index e6633fa..5abf49a 100644
--- a/scripts/wordpress-update.js
+++ b/scripts/wordpress-update.js
@@ -295,6 +295,9 @@ function processNextAction( actionId, fn ) {
 processActions(function( error ) {
 	if ( error ) {
 		logger.error( "Error updating WordPress: " + error.stack );
+
+		// Kill the process with an error code and let the manager restart it
+		process.exit( 1 );
 	}
 });
 

From 7e348d9e3589c2a9ace633b7079b09e5c97e4d8e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
Date: Wed, 8 May 2013 10:37:20 -0400
Subject: [PATCH 104/128] 1.2.3

---
 package.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package.json b/package.json
index bc750a6..f8ae077 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "plugins.jquery.com",
-  "version": "1.2.2",
+  "version": "1.2.3",
   "author": "jQuery Project",
   "description": "The official jQuery plugins site",
   "homepage": "https://github.com/jquery/plugins.jquery.com",

From 1281dd1fd1286ad29c76b489aac4a62a972dd0a7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
Date: Tue, 31 Dec 2013 14:56:01 -0500
Subject: [PATCH 105/128] Docs: Added CONTRIBUTING.md

---
 CONTRIBUTING.md | 5 +++++
 1 file changed, 5 insertions(+)
 create mode 100644 CONTRIBUTING.md

diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..479c2b8
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,5 @@
+Welcome! Thanks for your interest in contributing to plugins.jquery.com. You're **almost** in the right place. More information on how to contribute to this and all other jQuery Foundation projects is over at [contribute.jquery.org](http://contribute.jquery.org). You'll definitely want to take a look at the articles on contributing [to our websites](http://contribute.jquery.org/web-sites/) and [code](http://contribute.jquery.org/code).
+
+You may also want to take a look at our [commit & pull request guide](http://contribute.jquery.org/commits-and-pull-requests/) and [style guides](http://contribute.jquery.org/style-guide/) for instructions on how to maintain your fork and submit your code. Before we can merge any pull request, we'll also need you to sign our [contributor license agreement](http://contribute.jquery.org/cla).
+
+You can find us on [IRC](http://irc.jquery.org), specifically in #jquery-content should you have any questions. If you've never contributed to open source before, we've put together [a short guide with tips, tricks, and ideas on getting started](http://contribute.jquery.org/open-source/).

From 2e3e3e4f55aa32a49575b8bce15a14bc6bfe0526 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
Date: Mon, 6 Jan 2014 15:08:17 -0500
Subject: [PATCH 106/128] Build: Upgrade to grunt-jquery-content 0.11.1

---
 package.json                   |  2 +-
 pages/docs/package-manifest.md | 68 +++++++++++++++++-----------------
 pages/docs/publish.md          |  6 +--
 3 files changed, 38 insertions(+), 38 deletions(-)

diff --git a/package.json b/package.json
index f8ae077..28625e4 100644
--- a/package.json
+++ b/package.json
@@ -18,7 +18,7 @@
     "grunt": "0.3.17",
     "grunt-wordpress": "1.0.7",
     "grunt-check-modules": "0.1.0",
-    "grunt-jquery-content": "0.9.0",
+    "grunt-jquery-content": "0.11.1",
     "grunt-clean": "0.3.0",
     "simple-log": "1.1.0"
   }
diff --git a/pages/docs/package-manifest.md b/pages/docs/package-manifest.md
index 8b11131..8a41b02 100644
--- a/pages/docs/package-manifest.md
+++ b/pages/docs/package-manifest.md
@@ -16,25 +16,25 @@ The files must be actual JSON, not just a JavaScript object literal.
 
 ### Required Fields
 
-* name
-* version
-* title
-* author
-* licenses
-* dependencies
+* name
+* version
+* title
+* author
+* licenses
+* dependencies
 
 ### Optional Fields
 
-* description
-* keywords
-* homepage
-* docs
-* demo
-* download
-* bugs
-* maintainers
+* description
+* keywords
+* homepage
+* docs
+* demo
+* download
+* bugs
+* maintainers
 
-### name
+### name
 
 The *most* important things in your manifest file are the name and version fields.
 The name and version together form an identifier that is assumed
@@ -54,7 +54,7 @@ to see if there's something by that name already, before you get too attached to
 Site, either consider renaming your plugin or namespacing it. For example, jQuery UI
 plugins are listed with the "ui." prefix (e.g. ui.dialog, ui.autocomplete).
 
-### version
+### version
 
 The *most* important things in your manifest file are the name and version fields.
 The name and version together form an identifier that is assumed
@@ -64,19 +64,19 @@ per [node-semver](https://github.com/isaacs/node-semver).
 
 See [Specifying Versions](#specifying-versions).
 
-### title
+### title
 
 A nice complete and pretty title of your plugin. This will be used for the page
 title and top-level heading on your plugin's page. Include jQuery (if you want) and
-spaces and mixed case, unlike [name](#field-name).
+spaces and mixed case, unlike [name](#name).
 
-### author
+### author
 
 One person.
 
 See [People Fields](#people-fields).
 
-### licenses
+### licenses
 
 Array of licenses under which the plugin is provided. Each license is a hash with
 a url property linking to the actual text and an optional "type" property specifying the type of license. If the license is one of the [official open source licenses](http://www.opensource.org/licenses/alphabetical), the official license name or its abbreviation may be explicated with the "type" property.
@@ -90,7 +90,7 @@ a url property linking to the actual text and an optional "type" property specif
 ]
 ```
 
-### dependencies
+### dependencies
 
 Dependencies are specified with a simple hash of package name to version
 range. The version range is EITHER a string which has one or more
@@ -106,46 +106,46 @@ of each library you depend on.
 
 You must list at least one dependency, `jquery` (note that it's lower-case).
 
-### description
+### description
 
 Put a description in it. It's a string. This helps people discover your
 plugin, as it's listed on the jQuery Plugins Site.
 
-### keywords
+### keywords
 
 Put keywords in it. It's an array of strings. This helps people
 discover your plugin as it's listed on the jQuery Plugins Site.
 Keywords may only contain letters, numbers, hyphens, and dots.
 
-### homepage
+### homepage
 
 The url to the plugin homepage.
 
-### docs
+### docs
 
 The url to the plugin documentation.
 
-### demo
+### demo
 
 The url to the plugin demo or demos.
 
-### download
+### download
 
 The url to download the plugin. A download URL will be automatically generated
 based on the tag in GitHub, but you can specify a custom URL if you'd prefer
 to send users to your own site.
 
-### bugs
+### bugs
 
 The url to the bug tracker for the plugin.
 
-### maintainers
+### maintainers
 
 An array of people.
 
 See [People Fields](#people-fields).
 
-## People Fields
+## People Fields
 
 A "person" is an object with a "name" field and optionally "url" and
 "email", like this:
@@ -162,7 +162,7 @@ Both the email and url are optional.
 
 ---
 
-## Specifying Versions
+## Specifying Versions
 
 Version range descriptors may be any of the following styles, where "version"
 is a semver compatible version identifier.
@@ -198,7 +198,7 @@ For example, these are all valid:
 }
 ```
 
-### Tilde Version Ranges
+### Tilde Version Ranges
 
 A range specifier starting with a tilde `~` character is matched against
 a version in the following fashion.
@@ -212,7 +212,7 @@ For example, the following are equivalent:
 * `"~1.2" = ">=1.2.0 <1.3.0"`
 * `"~1" = ">=1.0.0 <2.0.0"`
 
-### X Version Ranges
+### X Version Ranges
 
 An "x" in a version range specifies that the version number must start
 with the supplied digits, but any digit may be used in place of the x.
@@ -228,7 +228,7 @@ The following are equivalent:
 You may not supply a comparator with a version containing an x. Any
 digits after the first "x" are ignored.
 
-### Sample manifest
+### Sample manifest
 
 **color.jquery.json**
 
diff --git a/pages/docs/publish.md b/pages/docs/publish.md
index f80023f..0f32cd1 100644
--- a/pages/docs/publish.md
+++ b/pages/docs/publish.md
@@ -14,13 +14,13 @@ to `http://plugins.jquery.com/postreceive-hook`.
 ## Add a Manifest to your Repository
 
 The jQuery Plugins Registry will look in the root level of your repository for
-any files named `*.jquery.json`.  You will want to create
-yourplugin.jquery.json according to the [package manifest
+any files named `*.jquery.json`. You will want to create
+`*yourplugin*.jquery.json` according to the [package manifest
 specification](/docs/package-manifest/). Use an online JSON verifier such as
 [JSONlint](http://jsonlint.com) to make sure the file is valid. You are now
 ready to publish your plugin!
 
-

Validate Your Manifest File Here

+## Validate Your Manifest File Here
Upload your manifest file to check for common errors: From c13ee7145f5070a8cf36d8253352597d2358c8de Mon Sep 17 00:00:00 2001 From: Boris Lykah Date: Fri, 10 Jan 2014 10:05:42 -0500 Subject: [PATCH 107/128] Docs: Fix a typo Closes: gh-155 --- pages/docs/names.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/docs/names.md b/pages/docs/names.md index c1d0295..00263fd 100644 --- a/pages/docs/names.md +++ b/pages/docs/names.md @@ -7,7 +7,7 @@ your plugin. The name is a unique identifier that distinguishes your plugin from all other plugins. This is different from the title of your plugin, which you can think of as the display name. -**Plugin names may only contain letters, numbers, hypens, dots, and underscores.** +**Plugin names may only contain letters, numbers, hyphens, dots, and underscores.** We encourage you to follow a few simple tips as well: From bd074f79b09d7f796492d92ddc1fd3e8e160e3f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Fri, 10 Jan 2014 11:40:51 -0500 Subject: [PATCH 108/128] 1.2.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 28625e4..3fba43c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plugins.jquery.com", - "version": "1.2.3", + "version": "1.2.4", "author": "jQuery Project", "description": "The official jQuery plugins site", "homepage": "https://github.com/jquery/plugins.jquery.com", From 19388ab0b1098f7f320e2a9dfb8bd4c2f9f2899e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Fri, 21 Feb 2014 09:13:09 -0500 Subject: [PATCH 109/128] Docs: Use jQuery Plugins service hook instead of web hook Fixes gh-156 --- pages/docs/publish.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pages/docs/publish.md b/pages/docs/publish.md index 0f32cd1..5ef19a6 100644 --- a/pages/docs/publish.md +++ b/pages/docs/publish.md @@ -4,12 +4,13 @@ Publishing your plugin on the site is a three step process: -## Add a Post-Receive Hook +## Add a Service Hook -First, you'll need to create a post-receive hook on GitHub. Just follow the -[step-by-step guide for adding a -webhook](https://help.github.com/articles/post-receive-hooks) and set the URL -to `http://plugins.jquery.com/postreceive-hook`. +First, you'll need to enable the jQuery Plugins service hook on GitHub. On the +settings page for your repository, click the Webhooks & Services link, then +click the Configure services button. Scroll down to find the jQuery Plugins +service and enable it (there's no config, just check the Active checkbox and +click the Update settings button). ## Add a Manifest to your Repository From ee21599bce4eeb2e0355b4984052bea9964cd2c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Fri, 21 Feb 2014 09:13:55 -0500 Subject: [PATCH 110/128] 1.2.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3fba43c..fb4bead 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plugins.jquery.com", - "version": "1.2.4", + "version": "1.2.5", "author": "jQuery Project", "description": "The official jQuery plugins site", "homepage": "https://github.com/jquery/plugins.jquery.com", From 24c01a8ccd40bb52b18254aa7022a4d17ec95013 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Mon, 14 Apr 2014 13:46:36 -0400 Subject: [PATCH 111/128] Build: Normalize line endings --- .gitattributes | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..b7ca95b --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +# Auto detect text files and perform LF normalization +* text=auto + +# JS files must always use LF for tools to work +*.js eol=lf From 11ee7ad231a0194b90d28afac7aeced35c13f617 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 15 May 2014 19:13:32 -0400 Subject: [PATCH 112/128] Build: Use vagrant for sample config --- config-sample.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config-sample.json b/config-sample.json index dc4f393..90bce25 100644 --- a/config-sample.json +++ b/config-sample.json @@ -2,7 +2,7 @@ "repoDir": "/tmp/plugin-repos", "pluginsDb": "plugins.db", "wordpress": { - "url": "local.plugins.jquery.com", + "url": "vagrant.plugins.jquery.com", "username": "admin", "password": "secret" } From 0da761b2c4a067458d11ba1f73ed9df78551a65a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 27 May 2014 15:31:46 -0400 Subject: [PATCH 113/128] Build: Update license Closes gh-157 --- LICENSE-MIT.txt => LICENSE.txt | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) rename LICENSE-MIT.txt => LICENSE.txt (71%) diff --git a/LICENSE-MIT.txt b/LICENSE.txt similarity index 71% rename from LICENSE-MIT.txt rename to LICENSE.txt index 1b5c731..5549c20 100644 --- a/LICENSE-MIT.txt +++ b/LICENSE.txt @@ -1,8 +1,14 @@ -Copyright (c) 2013 jQuery Foundation, http://jquery.org/ +Copyright 2011, 2014 jQuery Foundation and other contributors, +https://jquery.org/ This software consists of voluntary contributions made by many individuals. For exact contribution history, see the revision history -and logs, available at http://github.com/jquery/plugins.jquery.com +available at https://github.com/jquery/plugins.jquery.com + +The following license applies to all parts of this software except as +documented below: + +==== Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -22,3 +28,10 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==== + +All files located in the node_modules directory are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. From 0aa255a0d64e6d68c1a446ecc1a4fa9a34f66a5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Fri, 18 Jul 2014 13:09:17 -0400 Subject: [PATCH 114/128] Docs: post-receive hook -> service hook --- pages/docs/publish.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/docs/publish.md b/pages/docs/publish.md index 5ef19a6..a35fcd8 100644 --- a/pages/docs/publish.md +++ b/pages/docs/publish.md @@ -36,9 +36,9 @@ ready to publish your plugin! ## Publishing a Version -After the post-receive hook is setup and your manifest has been added, +After the service hook is setup and your manifest has been added, publishing your plugin is as simple as tagging the version in git and pushing -the tag to GitHub. The post-receive hook will notify the plugins site that a +the tag to GitHub. The service hook will notify the plugins site that a new tag is available and the plugins site will take care of the rest! ```bash From 134b4e3cd253c695342d6377f08ccff2e759f8d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Fri, 18 Jul 2014 13:09:41 -0400 Subject: [PATCH 115/128] 1.2.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fb4bead..7db673e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plugins.jquery.com", - "version": "1.2.5", + "version": "1.2.6", "author": "jQuery Project", "description": "The official jQuery plugins site", "homepage": "https://github.com/jquery/plugins.jquery.com", From 707c44ae1bd9e3327cc654f8404c2254f97fed3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 19 Aug 2014 16:56:59 -0400 Subject: [PATCH 116/128] Build: Upgrade to grunt-jquery-content 0.12.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7db673e..7b574bc 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "grunt": "0.3.17", "grunt-wordpress": "1.0.7", "grunt-check-modules": "0.1.0", - "grunt-jquery-content": "0.11.1", + "grunt-jquery-content": "0.12.0", "grunt-clean": "0.3.0", "simple-log": "1.1.0" } From af258df92a92f71a57b9c78312ad2012c62a751a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 19 Aug 2014 16:57:05 -0400 Subject: [PATCH 117/128] 1.2.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7b574bc..9815903 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plugins.jquery.com", - "version": "1.2.6", + "version": "1.2.7", "author": "jQuery Project", "description": "The official jQuery plugins site", "homepage": "https://github.com/jquery/plugins.jquery.com", From c7886ade31d6a821f4c75d4ba13f6b3926f2737f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Sat, 13 Sep 2014 14:29:58 -0500 Subject: [PATCH 118/128] Build: Upgrade to grunt-wordpress 1.1.0 and grunt-jquery-content 0.12.1 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 9815903..fa0a4fe 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,9 @@ "rimraf": "2.1.1", "wordpress": "0.1.3", "grunt": "0.3.17", - "grunt-wordpress": "1.0.7", + "grunt-wordpress": "1.1.0", "grunt-check-modules": "0.1.0", - "grunt-jquery-content": "0.12.0", + "grunt-jquery-content": "0.12.1", "grunt-clean": "0.3.0", "simple-log": "1.1.0" } From 08c3f150ec1ad0a2fd7aaed253606b0aa05912e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Sat, 13 Sep 2014 16:37:59 -0500 Subject: [PATCH 119/128] 1.2.8 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fa0a4fe..aa33a3b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plugins.jquery.com", - "version": "1.2.7", + "version": "1.2.8", "author": "jQuery Project", "description": "The official jQuery plugins site", "homepage": "https://github.com/jquery/plugins.jquery.com", From 306e2def81e88cd575b50edcfc4ced4ccc58d150 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 30 Sep 2014 15:07:21 -0400 Subject: [PATCH 120/128] Build: Upgrade to grunt-wordpress 1.2.1 and grunt-jquery-content 0.13.0 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index aa33a3b..679f6d6 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,9 @@ "rimraf": "2.1.1", "wordpress": "0.1.3", "grunt": "0.3.17", - "grunt-wordpress": "1.1.0", + "grunt-wordpress": "1.2.1", "grunt-check-modules": "0.1.0", - "grunt-jquery-content": "0.12.1", + "grunt-jquery-content": "0.13.0", "grunt-clean": "0.3.0", "simple-log": "1.1.0" } From 4579a6e7cb108a754fd0c2940a210e7da096fdef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Fri, 10 Oct 2014 16:31:21 -0400 Subject: [PATCH 121/128] Manager: Just spin forever --- scripts/manager.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/manager.js b/scripts/manager.js index 9f70173..d2373fd 100644 --- a/scripts/manager.js +++ b/scripts/manager.js @@ -1,3 +1,8 @@ +function wait() { + setTimeout( wait, 1000 ); +} +return wait(); + var path = require( "path" ), spawn = require( "child_process" ).spawn, logger = require( "../lib/logger" ), From 41598a0cd2da0ae3059bbfec1cd26cf103b142a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Fri, 10 Oct 2014 16:32:28 -0400 Subject: [PATCH 122/128] 1.3.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 679f6d6..c9b455d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plugins.jquery.com", - "version": "1.2.8", + "version": "1.3.0", "author": "jQuery Project", "description": "The official jQuery plugins site", "homepage": "https://github.com/jquery/plugins.jquery.com", From 0b40a424b130ba5f942813c4bbf4dac37f8d5be2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 2 Dec 2014 16:15:22 -0500 Subject: [PATCH 123/128] Build: Replace grunt-clean with rimraf --- grunt.js | 16 ++++++++-------- package.json | 1 - 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/grunt.js b/grunt.js index 6e5c9f6..5e8bd23 100644 --- a/grunt.js +++ b/grunt.js @@ -1,19 +1,16 @@ -var config = require( "./lib/config" ); -var path = require( "path" ); +var path = require( "path" ), + rimraf = require( "rimraf" ), + config = require( "./lib/config" ); module.exports = function( grunt ) { var async = grunt.utils.async; grunt.loadNpmTasks( "grunt-wordpress" ); -grunt.loadNpmTasks( "grunt-clean" ); grunt.loadNpmTasks( "grunt-jquery-content" ); grunt.loadNpmTasks( "grunt-check-modules" ); grunt.initConfig({ - clean: { - wordpress: "dist/" - }, lint: { grunt: "grunt.js", src: [ "lib/**", "scripts/**" ] @@ -42,6 +39,10 @@ grunt.initConfig({ }, config.wordpress ) }); +grunt.registerTask( "clean", function() { + rimraf.sync( "dist" ); +}); + // We only want to sync the documentation, so we override wordpress-get-postpaths // to only find pages. This ensures that we don't delete all of the plugin posts. grunt.registerHelper( "wordpress-get-postpaths", function( fn ) { @@ -113,8 +114,7 @@ grunt.registerTask( "sync-docs", function() { // clean-all will delete EVERYTHING, including the plugin registery. This is // useful only for development if you want a clean slate to test from. grunt.registerTask( "clean-all", function() { - var rimraf = require( "rimraf" ), - retry = require( "./lib/retrydb" ); + var retry = require( "./lib/retrydb" ); // clean repo checkouts rimraf.sync( config.repoDir ); diff --git a/package.json b/package.json index c9b455d..fd205e7 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,6 @@ "grunt-wordpress": "1.2.1", "grunt-check-modules": "0.1.0", "grunt-jquery-content": "0.13.0", - "grunt-clean": "0.3.0", "simple-log": "1.1.0" } } From c77032d5dfe1fbe7a16bad308db7c1c44bd330f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 2 Dec 2014 16:16:35 -0500 Subject: [PATCH 124/128] Build: Remove watch task --- grunt.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/grunt.js b/grunt.js index 5e8bd23..9dbff99 100644 --- a/grunt.js +++ b/grunt.js @@ -19,12 +19,6 @@ grunt.initConfig({ grunt: { options: grunt.file.readJSON( ".jshintrc" ) }, src: { options: grunt.file.readJSON( ".jshintrc" ) } }, - watch: { - docs: { - files: "pages/**", - tasks: "docs" - } - }, test: { files: [ "test/**/*.js" ] }, From 51a4dbee0d9b3bd802d809eab3b0c7e32653b118 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 2 Dec 2014 16:17:10 -0500 Subject: [PATCH 125/128] Build: Remove dates from copyright notice --- LICENSE.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index 5549c20..8ec0732 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,5 +1,4 @@ -Copyright 2011, 2014 jQuery Foundation and other contributors, -https://jquery.org/ +Copyright jQuery Foundation and other contributors, https://jquery.org/ This software consists of voluntary contributions made by many individuals. For exact contribution history, see the revision history From 9a1807464101c761c0d2a62026f5a27551cafc93 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Mon, 20 Jun 2016 12:16:18 +0100 Subject: [PATCH 126/128] Publish: Added note about the plugins website's deprecation Fixes https://github.com/jquery/jquery.com/issues/134 --- pages/docs/publish.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pages/docs/publish.md b/pages/docs/publish.md index a35fcd8..f9648ca 100644 --- a/pages/docs/publish.md +++ b/pages/docs/publish.md @@ -4,6 +4,10 @@ Publishing your plugin on the site is a three step process: +
+ The jQuery Plugin Registry is in read-only mode. New plugin releases will not be processed. We recommend moving to npm, using "jquery-plugin" as the keyword in your package.json. The npm blog has instructions for publishing your plugin to npm. +
+ ## Add a Service Hook First, you'll need to enable the jQuery Plugins service hook on GitHub. On the From 2b1e812796715ba631d32315bf46473a91d98687 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Mon, 27 Jun 2016 13:23:42 +0100 Subject: [PATCH 127/128] fixup! Updated based on comments --- pages/docs/publish.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/docs/publish.md b/pages/docs/publish.md index f9648ca..b3b3cb5 100644 --- a/pages/docs/publish.md +++ b/pages/docs/publish.md @@ -2,12 +2,12 @@ "title": "Publishing Your Plugin" } -Publishing your plugin on the site is a three step process: -
The jQuery Plugin Registry is in read-only mode. New plugin releases will not be processed. We recommend moving to npm, using "jquery-plugin" as the keyword in your package.json. The npm blog has instructions for publishing your plugin to npm.
+Publishing your plugin on the site is a three step process: + ## Add a Service Hook First, you'll need to enable the jQuery Plugins service hook on GitHub. On the From 7cf6c209efe2e40f67a8ff89bbb60a16cff49208 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Mon, 28 Aug 2017 16:20:38 -0400 Subject: [PATCH 128/128] 1.3.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fd205e7..088f01f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plugins.jquery.com", - "version": "1.3.0", + "version": "1.3.1", "author": "jQuery Project", "description": "The official jQuery plugins site", "homepage": "https://github.com/jquery/plugins.jquery.com",