Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ember-cli-deploy-plugin

Package Overview
Dependencies
Maintainers
3
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-cli-deploy-plugin

For building plugins for ember-cli-deploy

  • 0.2.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
27K
increased by3.51%
Maintainers
3
Weekly downloads
 
Created
Source

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';

var DeployPluginBase = require('ember-cli-deploy-plugin');

module.exports = {
  name: 'ember-cli-deploy-awesomeness',

  createDeployPlugin: function(options) {
    var DeployPlugin = DeployPluginBase.extend({
      name: options.name,

      // note: most plugins can simply implement these next two properties and use
      // the base class' implementation of the `configure` hook
      defaultConfig: {
        someKey: 'defaultValue',
        anotherKey: function(context) {
          return context.anotherKey; // to use data added to the context by another plugin
        }
      },
      requiredConfig: ['awesomeApiKey'], // throw an error if this is not configured

      // implement any hooks appropriate for your plugin
      willUpload: function(context) {
        // Use the `readConfig` method for uniform access to this plugin's config,
        // whether via a dynamic function or a configured value
        var someValue     = this.readConfig('someKey');
        var anotherValue  = this.readConfig('anotherKey');
        var awesomeApiKey = this.readConfig('awesomeApiKey');

        // Use the `log` method to generate output consistent with the tree style
        // of ember-cli-deploy's verbose output
        this.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 rejected
        return Promise.resolve();
      },
    });
    return new DeployPlugin();
  }
};

## TODO

Tests

FAQs

Package last updated on 21 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc