You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ni...@apache.org on 2016/03/15 06:13:33 UTC

docs commit: Update details for publishing plugins. Remove authors.html page.

Repository: cordova-docs
Updated Branches:
  refs/heads/master 3b1aec669 -> a9058c4e4


Update details for publishing plugins. Remove authors.html page.

This closes #548


Project: http://git-wip-us.apache.org/repos/asf/cordova-docs/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-docs/commit/a9058c4e
Tree: http://git-wip-us.apache.org/repos/asf/cordova-docs/tree/a9058c4e
Diff: http://git-wip-us.apache.org/repos/asf/cordova-docs/diff/a9058c4e

Branch: refs/heads/master
Commit: a9058c4e46b785dcb6a0c5c2f41b1f803075c531
Parents: 3b1aec6
Author: Nikhil Khandelwal <ni...@microsoft.com>
Authored: Wed Mar 9 10:53:35 2016 -0800
Committer: Nikhil Khandelwal <ni...@microsoft.com>
Committed: Mon Mar 14 22:11:07 2016 -0700

----------------------------------------------------------------------
 www/_data/redirects.yml                       |  1 +
 www/docs/en/dev/guide/hybrid/plugins/index.md | 63 +++++++++++++---------
 www/plugins/authors.md                        | 47 ----------------
 www/static/plugins/app.js                     |  2 +-
 4 files changed, 39 insertions(+), 74 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a9058c4e/www/_data/redirects.yml
----------------------------------------------------------------------
diff --git a/www/_data/redirects.yml b/www/_data/redirects.yml
index 7a60869..15388ab 100644
--- a/www/_data/redirects.yml
+++ b/www/_data/redirects.yml
@@ -3,6 +3,7 @@
 
 # redirects paths relative to /
 general:
+   - {old: "plugins/authors.html", new: "docs/en/latest/guide/hybrid/plugins/index.html#publishing-plugins" }
 
 # redirects paths relative to /docs/XX/
 docs:

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a9058c4e/www/docs/en/dev/guide/hybrid/plugins/index.md
----------------------------------------------------------------------
diff --git a/www/docs/en/dev/guide/hybrid/plugins/index.md b/www/docs/en/dev/guide/hybrid/plugins/index.md
index c0d1a7f..ec05499 100644
--- a/www/docs/en/dev/guide/hybrid/plugins/index.md
+++ b/www/docs/en/dev/guide/hybrid/plugins/index.md
@@ -160,18 +160,22 @@ Here is how each parameter works:
 This example shows one way to implement the plugin's JavaScript
 interface:
 
-        window.echo = function(str, callback) {
-            cordova.exec(callback, function(err) {
-                callback('Nothing to echo.');
-            }, "Echo", "echo", [str]);
-        };
+```js
+    window.echo = function(str, callback) {
+        cordova.exec(callback, function(err) {
+            callback('Nothing to echo.');
+        }, "Echo", "echo", [str]);
+    };
+```
 
 In this example, the plugin attaches itself to the `window` object as
 the `echo` function, which plugin users would call as follows:
 
-        window.echo("echome", function(echoValue) {
-            alert(echoValue == "echome"); // should alert true.
-        });
+```js
+    window.echo("echome", function(echoValue) {
+        alert(echoValue == "echome"); // should alert true.
+    });
+```
 
 Look at the last three arguments to the `cordova.exec` function. The
 first calls the `Echo` _service_, a class name. The second requests
@@ -198,23 +202,13 @@ listed below, and each builds on the simple Echo Plugin example above:
 
 ## Publishing Plugins
 
-Once you develop your plugin, you may want to publish and share it
-with the community. You can publish your plugin to any `npmjs`-based
-registry, but the recommended one is the [NPM registry](https://www.npmjs.com).
-Please read our [publishing plugins to npm guide](http://plugins.cordova.io/npm/developers.html).
-
-
-__NOTE__: [Cordova plugin registry](https://plugins.cordova.io) is
-moving to a read-only state. `publish`/
-`unpublish` commands have been removed from `plugman`, so you'll need to
-use corresponding `npm` commands.
-
-Other developers can install your plugin automatically using either `plugman`
- or the Cordova CLI.  (For details on each development path, see
- [Using Plugman to Manage Plugins](../../../plugin_ref/plugman.html) and [The Command-Line Interface reference](../../../cordova-cli/index.html).)
+You can publish your plugin to any `npmjs`-based registry, but the recommended one is the [NPM registry](https://www.npmjs.com). Other developers can install your plugin automatically using either `plugman` or the Cordova CLI.  
 
 To publish a plugin to NPM registry you need to follow steps below:
-
+  * install the `plugman` CLI:
+        
+        $ npm install -g plugman
+ 
   * create `package.json` file for your plugin:
 
         $ plugman createpackagejson /path/to/your/plugin
@@ -224,7 +218,24 @@ To publish a plugin to NPM registry you need to follow steps below:
         $ npm adduser # that is if you don't have an account yet
         $ npm publish /path/to/your/plugin
 
-That is it!
+For more details on npm usage refer to [publishing a npm package](https://docs.npmjs.com/getting-started/publishing-npm-packages) on the NPM documentation site.
+
+## Integrating with Plugin Search
+
+To surface the plugin in [Cordova Plugin Search](/plugins/), add the `ecosystem:cordova` keyword to the `package.json` file of your plugin before publishing. 
+
+To indicate support for a particular platform add a keyword with the `<platformName>` as `**cordova-<platformName>**` to the list of keywords in package.json. 
+Plugman's `createpackagejson` command does this for you, but if you did not use it to generate your `package.json`, you should manually edit it as shown below.
+
+For example, for a plugin that supports android, iOS & Windows, the keywords in package.json should include:
+
+```json
+    "keywords": [
+      "ecosystem:cordova",
+      "cordova-android",
+      "cordova-ios",
+      "cordova-windows"
+    ]
+```
 
-Running `plugman --help` lists other available registry-based
-commands.
+For more detailed example of a package.json, review the [package.json file of cordova-plugin-device](https://github.com/apache/cordova-plugin-device/blob/master/package.json).

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a9058c4e/www/plugins/authors.md
----------------------------------------------------------------------
diff --git a/www/plugins/authors.md b/www/plugins/authors.md
deleted file mode 100644
index bc0a567..0000000
--- a/www/plugins/authors.md
+++ /dev/null
@@ -1,47 +0,0 @@
----
-layout: plugins
-title: Plugin Contributors
----
-
-# Plugin Search for Plugin Authors
-
-## How do I add a new plugin to Plugin Search?
-
-If you want your Cordova Plugin to show up in search, simply add the `ecosystem:cordova` keyword to the `package.json` file of your plugin and publish it to npm registry.
-
-## How can I tag supported platforms for my plugin?
-
-Similar to `ecosystem:cordova`, platform support too uses keywords. Just add the platform name prefixed with "**cordova-**" to the plugin's list of keywords. E.g.
-
-
-        "keywords": [
-          "ecosystem:cordova",
-          "cordova-android",
-          "cordova-ios",
-          "cordova-windows"
-        ]
-
-
-## My plugin is in plugins.cordova.io but I want to publish to npm. How do I do that?
-
-1. **Optional** Decide if you want to change your plugin’s id. If you decide to change it,
-    1. Update the id in `plugin.xml` and update your readme with the new id.
-    2. Send a pull request adding your new id and old id to Cordova Registry Mapper.
-    3. We integrate that module into the Cordova CLI to warn users to use the new id when adding plugins to their projects.
-2. Add a `package.json` to your plugins,
-    * **Note**: To keep things simple, please make sure your `id` in `plugin.xml` is the same as your `package-name` in `package.json`.
-    * Use `plugman createpackagejson [PLUGIN DIRECTORY]` to create `package.json`.
-        * This will create defaults based on existing values in your `plugin.xml`.
-        * It will also automatically add the keyword `ecosystem:cordova` to your newly generated `package.json` file.
-        * In addition, a cordova key will be added to your `package.json` which we plan to use in future updates of the tooling.
-    * View the `package.json` of [cordova-plugin-device](https://github.com/apache/cordova-plugin-device/blob/master/package.json) to see an example of what your `package.json` should look like after running `plugman createpackagejson [PLUGIN DIRECTORY]` command.
-    * Plugins still require a `plugin.xml` to be installed into **Cordova** projects.
-3. Publish your plugin to npm using the `npm publish [PLUGIN DIRECTORY]`.
-
-## Are there any additional documents to assist me with plugins?
-
-Yes there are. Please take a look at the [Plugin Development Guide]({{ site.baseurl }}/docs/en/{{ site.default_linked_docs_version }}/guide/hybrid/plugins/index.html) for a more detailed guide.
-
-## I don't like X. How can I help improve the website?
-
-You can help improve this site by opening bugs on [JIRA](https://issues.apache.org/jira/issues/?jql=project%20%3D%20CB%20AND%20status%20%3D%20Open%20AND%20component%20%3D%20%22Registry%20Web%22) or by sending PRs on [GitHub](https://github.com/apache/cordova-docs/).

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a9058c4e/www/static/plugins/app.js
----------------------------------------------------------------------
diff --git a/www/static/plugins/app.js b/www/static/plugins/app.js
index e8f6344..5746c41 100755
--- a/www/static/plugins/app.js
+++ b/www/static/plugins/app.js
@@ -458,7 +458,7 @@ var App = React.createClass({
                         </div>
                             <div className="plugins_links">
                                     <ul className="nav nav-justified">
-                                    <li><a href="{{ site.baseurl }}/plugins/authors.html"><span className="glyphicon glyphicon-plus"></span><i>&nbsp;</i>Contribute Plugins</a></li>
+                                    <li><a href="{{ site.baseurl }}/docs/en//{{ site.default_linked_docs_version }}/guide/hybrid/plugins/index.html#publishing-plugins"><span className="glyphicon glyphicon-plus"></span><i>&nbsp;</i>Contribute Plugins</a></li>
                                     <li><a href="{{ site.baseurl }}/plugins/faq.html"><span className="glyphicon glyphicon-question-sign"></span><i>&nbsp;</i>Plugin Help</a></li>
                                     </ul>
                             </div>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org