{"__v":5,"_id":"54d5635732d98b0d00384b1f","category":{"__v":4,"_id":"54d5635632d98b0d00384b00","pages":["54d5635732d98b0d00384b17","54ef76a36ce8d81900c1c3dd","554559a635b2240d00838915","5624bfd26ff1010d009b15f9"],"project":"54d53c7b23010a0d001aca0c","version":"54d5635532d98b0d00384afb","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-02-06T23:56:35.650Z","from_sync":false,"order":1,"slug":"development-workflow","title":"Development Workflow"},"parentDoc":null,"project":"54d53c7b23010a0d001aca0c","user":"54cfa8e1a8a4fd0d00b7fd1d","version":{"__v":10,"_id":"54d5635532d98b0d00384afb","forked_from":"54d53c7c23010a0d001aca0f","project":"54d53c7b23010a0d001aca0c","createdAt":"2015-02-07T00:59:01.934Z","releaseDate":"2015-02-07T00:59:01.934Z","categories":["54d5635632d98b0d00384afc","54d5635632d98b0d00384afd","54d5635632d98b0d00384afe","54d5635632d98b0d00384aff","54d5635632d98b0d00384b00","54d5635632d98b0d00384b01","54d5635632d98b0d00384b02","54d652097e05890d006f153e","54dd1315ca1e5219007e9daa","54e21e2b22de1c230094b147","54e68e62a43fe13500db3879","54fa1d3fe7a0ba2f00306309","551c453a23a1ee190034d19a","551df586e52a0b23000c62b6","551f39be6886f8230055f02a","55a6720751457325000e4d97"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"0.1.0","version":"0.1"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-02-06T23:55:53.128Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"In order to have others discover and install your plugin as well as provide feedback and contribute you'll want to publish your package to the c9.io registry. This will make your plugin available to all Cloud9 users. They can [find and install your plugin](installing_packages.md).\n\nThis guide assumes your package's name is `my-package` but you should pick a better name.\n\n# Use the c9 cli\n\nThe `c9` cli is pre-installed in all Cloud9 workspaces. When running the SDK locally or for SSH workspace you can install the `c9` cli via:\n\n```\nnpm install c9\n```\n\nNote that this might not work in the alpha version of Cloud9.\n\nYou can check that `c9` is installed correctly by running the following command in the terminal:\n\n```\nc9 publish --help\n```\n\nYou should see a message print out with details about the c9 publish command.\n\n# Prepare your package\n\nIf you've followed the steps in the [your first package](doc:create-your-first-package) guide then you should be ready to publish and you can skip to the next step.\n\nIf not, there are a few things you should check before publishing:\n\n- Your *package.json* file has `name`, `description`, `categories`, `plugins` and `repository` fields.\n- Your *package.json* file has a version field with a value of \"0.0.0\".\n- Your *package.json* file has an engines field that contains an entry for c9 such as: \"engines\": {\"c9\": \">=3.0.0\"}.\n- Your package has a README.md file at the root.\n- Your package is in a Git or Mercurial repository that has been pushed to a source control host.\n\n# Publish your package\n\nIt is important to make sure your package has a unique name. You can use `c9 list` to see which packages have already been registered. If the initial name you want is not available choose a new one and change the name in your package.\n\nThis is what `c9 publish` does:\n\n1. Registers the package name on c9.io if it is being published for the first time.\n1. Updates the `version` field in the package.json file and commits it.\n1. Creates a new Git tag for the version being published.\n1. Pushes the tag and current branch to origin.\n1. Updates c9.io with the new version being published.\n\nTo publish run the following command:\n\n```\ncd ~/.c9/plugins/my-package\nc9 publish [version]\n```\n\n`version` can be either a specific version number you’d like it to be (e.g. 0.1.2) or one of the following:\n```\nmajor - Increments the major number (X.0.0) by 1 and publishes\nminor - Increments the minor number (0.X.0) by 1 and publishes\npatch - Increments the patch number (0.0.X) by 1 and publishes\n```\n\nWe use [semver versioning](http://semver.org/) for plugins, please follow that guide when deciding what patch level you’re releasing. Plugins with a version < 1.0.0 are considered beta.\n\nIf this is the first package you are publishing, the `c9 publish` command may prompt you for your Cloud9 username and password. This is required to publish and you only need to enter this information the first time you publish.\n\nCongratulations! Your package is now available on c9.io. Check if it's there by running `c9 list`.","excerpt":"","slug":"publishing-packages","type":"basic","title":"Publishing Packages"}

Publishing Packages


In order to have others discover and install your plugin as well as provide feedback and contribute you'll want to publish your package to the c9.io registry. This will make your plugin available to all Cloud9 users. They can [find and install your plugin](installing_packages.md). This guide assumes your package's name is `my-package` but you should pick a better name. # Use the c9 cli The `c9` cli is pre-installed in all Cloud9 workspaces. When running the SDK locally or for SSH workspace you can install the `c9` cli via: ``` npm install c9 ``` Note that this might not work in the alpha version of Cloud9. You can check that `c9` is installed correctly by running the following command in the terminal: ``` c9 publish --help ``` You should see a message print out with details about the c9 publish command. # Prepare your package If you've followed the steps in the [your first package](doc:create-your-first-package) guide then you should be ready to publish and you can skip to the next step. If not, there are a few things you should check before publishing: - Your *package.json* file has `name`, `description`, `categories`, `plugins` and `repository` fields. - Your *package.json* file has a version field with a value of "0.0.0". - Your *package.json* file has an engines field that contains an entry for c9 such as: "engines": {"c9": ">=3.0.0"}. - Your package has a README.md file at the root. - Your package is in a Git or Mercurial repository that has been pushed to a source control host. # Publish your package It is important to make sure your package has a unique name. You can use `c9 list` to see which packages have already been registered. If the initial name you want is not available choose a new one and change the name in your package. This is what `c9 publish` does: 1. Registers the package name on c9.io if it is being published for the first time. 1. Updates the `version` field in the package.json file and commits it. 1. Creates a new Git tag for the version being published. 1. Pushes the tag and current branch to origin. 1. Updates c9.io with the new version being published. To publish run the following command: ``` cd ~/.c9/plugins/my-package c9 publish [version] ``` `version` can be either a specific version number you’d like it to be (e.g. 0.1.2) or one of the following: ``` major - Increments the major number (X.0.0) by 1 and publishes minor - Increments the minor number (0.X.0) by 1 and publishes patch - Increments the patch number (0.0.X) by 1 and publishes ``` We use [semver versioning](http://semver.org/) for plugins, please follow that guide when deciding what patch level you’re releasing. Plugins with a version < 1.0.0 are considered beta. If this is the first package you are publishing, the `c9 publish` command may prompt you for your Cloud9 username and password. This is required to publish and you only need to enter this information the first time you publish. Congratulations! Your package is now available on c9.io. Check if it's there by running `c9 list`.