Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Registry Plugins #68

Merged
merged 17 commits into from
May 22, 2015
Merged

Registry Plugins #68

merged 17 commits into from
May 22, 2015

Conversation

matteofigus
Copy link
Member

The dependencies that are require-able should just be listed.
The idea is to create something new and provided by the server.js's context to make the registry able to share functionalities with component server-side's logic.

// registry conf - dependencies need to be installed and available first
conf.dependencies = ['underscore', 'async'];

// registry conf - plugins 
registry.register({
  name: 'doSomething',
  register: require('./my-plugin'),
  options: { ... }
});

// component - server.js
module.exports.data = function(context, callback){
  context.plugins.doSomething('hello');
  callback(null, { hello: 1234});
};

// component - package.json
{
  "oc": {
    ...
    plugins: ["doSomething"]
  }
}

// dev watcher dir - oc.json
// $ oc mock plugin doSomething "hello"
{
  ...
  "mocks": {
    "plugins": {
      "static": {
        "doSomething": "hello"
      }
    }
  }
}

@matteofigus matteofigus changed the title [not merge yet] Dependencies [not merge yet] Registry Plugins May 20, 2015
@matteofigus matteofigus changed the title [not merge yet] Registry Plugins Registry Plugins May 22, 2015
matteofigus added a commit that referenced this pull request May 22, 2015
@matteofigus matteofigus merged commit 3b705bc into master May 22, 2015
@matteofigus matteofigus deleted the dependencies branch May 22, 2015 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant