Skip to content

Latest commit

History

46 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

ember-cli-deploy-plugin

This NPM module exposes a base class that can be used by ember-cli-deploy plugins to streamline implementation of a plugin.

Usage

In your plugin's directory:

npm install ember-cli-deploy-plugin --save

In your plugin's index.js file:

/* jshint node: true */'use strict';varDeployPluginBase=require('ember-cli-deploy-plugin');module.exports={name: 'ember-cli-deploy-awesomeness',createDeployPlugin: function(options){varDeployPlugin=DeployPluginBase.extend({name: options.name,// note: most plugins can simply implement these next two properties and use// the base class' implementation of the `configure` hookdefaultConfig: {someKey: 'defaultValue',anotherKey: function(context){returncontext.anotherKey;// to use data added to the context by another plugin},capsKey: function(context,pluginHelper){returnpluginHelper.readConfig('someKey').toUppercase();// pluginHelper.readConfig returns a clone of the specified config value}},requiredConfig: ['awesomeApiKey'],// throw an error if this is not configured// implement any hooks appropriate for your pluginwillUpload: function(context){// Use the `readConfig` method for uniform access to this plugin's config,// whether via a dynamic function or a configured valuevarsomeValue=this.readConfig('someKey');varanotherValue=this.readConfig('anotherKey');varawesomeApiKey=this.readConfig('awesomeApiKey');// Use the `log` method to generate output consistent with the tree style// of ember-cli-deploy's verbose outputthis.log('output some awesomeness');this.log('output some red awesomeness',{color: 'red'});this.log('output this only when verbose option is enabled',{verbose: true});// Need to do something async? You can return a promise.// Need to fail out? Throw an error or return a promise which becomes rejectedreturnPromise.resolve();},});returnnewDeployPlugin();}};

About

Provides a base class for ember-cli-deploy plugins

Topics

Resources

Stars

5 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages