@datagica/plugin-engine
v0.0.0
Published
Plugin engine
Downloads
7
Readme
Plugin Engine
Architecture
A plugin is a collection of services
Plugins may share the same service (eg. multiple plugins may package the same "sql import service").
There can't be any conflict, because Datagica always use the latest version of a service, and only start it once.
How to package a plugin
You need to create a zip file containing the plugin code and dependencies, but not the dev dependencies:
rm -Rf node_modules
and npm install --production
tar -czvf ../module.tar.gz --exclude ".git/*" --exclude "tests/*" .
shasum ../module.tar.gz
Of course this is a bit cumbersome to do all these commands manually we should write a script to do that in one line.
Structure of a repository
url: 'http://127.0.0.1:8080',
lastUpdate: 0,
purchases: [],
plugins: [
{
name: "@datagica/plugin-bundle-test",
label: {
en: "Test Bundle"
},
description: {
en: "A simple test bundle"
},
author: "Julian Bilcke",
licence: "commercial",
release: {
version: "0.0.0", // optional
revision: 1, // automatic
downloadSize: "10 Mb", // note: automatically computed from sub-modules
date: "2016/01/01 01:01" // when upsed to the api
},
contact: {
email: "[email protected]",
phone: "0"
},
price: {
value: 499,
unit: 'USD',
period: 'monthly'
},
// main module
main: "@datagica/plugin-link-test",
modules: [
{
name: "@datagica/plugin-link-test",
// set to "true" for easy development and debugging: it will use a
// globally installed or linked module, instead of download it
isGlobal: false,
// url: "http://127.0.0.1:8080/plugins/%40datagica/plugin-bundle-test/node_modules/%40datagica/plugin-link-test.zip",
main: 'lib/plugin-link-test.js',
// note: all plugins are automatically using the latest version
// so this is gived for information only
version: "0.0.0",
// download used to give an estimation to the user
downloadSize: "10 Mb",
// for security purposes, we will check the signature
sha1: ""
}
]
}
]
};