Giter Site home page Giter Site logo

ember-cli-deploy-plugin's Introduction

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
        },
        capsKey: function(context, pluginHelper) {
          return pluginHelper.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 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();
  }
};

ember-cli-deploy-plugin's People

Contributors

achambers avatar dschmidt avatar ghedamat avatar levelbossmike avatar lukemelia avatar raycohen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ember-cli-deploy-plugin's Issues

Can't list or activate revisions

Each time I try to run ember deploy:list or ember deploy:activate --revision *** I get You need to provide a deployTarget: 'ember deploy production'

Lodash Requirement.

Why are are we requiring lodash when it isn't being used? Ran into this due to a failing build of Cannot find module 'lodash-node' which brought me here, but it looks like it's not even being used after it's required. Can we just remove that dependency?

lodash-node and core-object deprecations

I'm getting this deprecation warning when running npm install.

npm WARN deprecated [email protected]: This package has been discontinued in favor of lodash@^4.0.0.
$ npm list lodash-node
├─┬ [email protected]
│ └─┬ [email protected]
│   └── [email protected] 
├─┬ [email protected]
│ └─┬ [email protected]
│   └─┬ [email protected]
│     └── [email protected] 
├─┬ [email protected]
│ └─┬ [email protected]
│   └─┬ [email protected]
│     └── [email protected] 
├─┬ [email protected]
│ └─┬ [email protected]
│   └─┬ [email protected]
│     └── [email protected] 
└─┬ [email protected]
  └─┬ [email protected]
    └─┬ [email protected]
      └── [email protected] 

Why are we using such an old version of core-object? Seems like the latest verions is 2.0.5. Can we bump it? Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.