Distributing and installing custom Cloud9 plugins

plugins
sdk

#1

Distributing Cloud9 plugins

Cloud9 plugins are simple JavaScript files and can be loaded from any CDN.

There are many free and easy to use ways to put some static content (Github pages or cdn.rawgit.com for projects hosted on Github, unpkg.com for modules published to npm, etc).

To publish a plugin make sure that you have the latest version of c9 cli installed from npm. Go to the directory of your plugin and run c9 build. This command will create c9build folder with all the code of your plugin optimized for loading.

Publish the build folder to the cdn of your choice. And you are done.

Note: If your plugin requires some server-side component, client-side code should not assume that it exists on the server, it should handle errors and install that when needed.

Installing Cloud9 plugins

IMPORTANT: Cloud9 plugins have full access to your Cloud9 account, and therefore to everything you can access from Cloud9, so you should only install plugins from sources you trust. In other words, it is your responsibility to personally inspect each plugin you install for suspicious or unexpected activity.

To load a plugin open your Init Script from Cloud9 > Open Your Init Script menu.
And add code like this:

// check that this is the workspace you want to use
if (services.c9.workspaceId.match("{username}/{workspacename}")) {
    // call plugin manager with a list of plugins you want to load
    // this takes either url, or a path on your vm
    services.pluginManager.loadPackage([
        "https://cdn.url/pluginName1/package.pluginName1.js", 
        "~/.c9/plugins/pluginName2/c9build/package.pluginName2.js" 
    ])
}

Installing Cloud9 plugins for the local version

When using the SDK, in addition to the above, you can load plugins from user-plugins directory inside the sdk folder, which may be more convenient for debugging. To do this, clone the plugin you want to work on into that directory and pass the package path "plugins/pluginName1/package.json" without ~ or /.


Is there a way to create private plugins?
Unable to Publish Plugin/Package
Enable customized plugins by default
Unable to publish C9 package
loadPlugins from vfs doesn't always work
Plugin Username and Password
AWS C9 Plugins and active development
Allow Wakatime in "Normal Mode"
Print Function for the IDE?
#2

9 posts were split to a new topic: loadPlugins from vfs doesn’t always work