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 01/83] 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 02/83] 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 03/83] 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 04/83] 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 05/83] 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 06/83] 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 07/83] 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 08/83] 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 09/83] 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 10/83] 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 11/83] 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 12/83] 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 13/83] 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 14/83] 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 15/83] 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 16/83] 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 17/83] 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 18/83] 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 19/83] 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 20/83] 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 = "
", 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 21/83] 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.
", 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 22/83] 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 23/83] 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 24/83] 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 25/83] 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 26/83] 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 27/83] 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 28/83] 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 29/83] 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 30/83] 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 31/83] 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 32/83] 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 33/83] 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 34/83] 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.
", 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 35/83] 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 36/83] 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 37/83] 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 38/83] 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 39/83] 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 40/83] 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 41/83] 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 42/83] 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 43/83] 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 44/83] 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 45/83] 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 46/83] 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 47/83] 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 48/83] 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 49/83] 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 50/83] 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 51/83] 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 52/83] 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 53/83] 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 54/83] 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 55/83] 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 56/83] 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 57/83] 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 58/83] 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 59/83] 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 60/83] 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 61/83] 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 62/83] 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 63/83] 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 64/83] 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 65/83] 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 66/83] 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 67/83] 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 68/83] 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 69/83] 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 70/83] 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 71/83] 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 72/83] 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 73/83] 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 74/83] 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 75/83] 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 76/83] 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 77/83] 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 78/83] 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 79/83] 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 80/83] 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 81/83] 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:
+
+
## 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 82/83] 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:
-
+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 83/83] 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",