Meta modules (#308)

* meta-modules in node

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* meta-modules in browser

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* update docs

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* more doc

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* fix typo

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* update docs and sample meta-module

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* add dynamic modules CLI from npm

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* update

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* meta-modules and sequence saving completed

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* add docs

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* update docs

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* fixed test

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>
This commit is contained in:
Varun Gupta
2018-08-04 19:37:20 +05:30
committed by Jeffrey Warren
parent 10e47656a3
commit 5ab018fb84
22 changed files with 664 additions and 306 deletions

View File

@@ -2,10 +2,15 @@ const getStepUtils = require('./util/getStep.js');
// insert one or more steps at a given index in the sequencer
function InsertStep(ref, image, index, name, o) {
if (ref.sequences[name]) {
return ref.importJSON(ref.sequences[name]);
}
function insertStep(image, index, name, o_) {
if (ref.modules[name]) var moduleInfo = ref.modules[name][1];
else console.log('Module ' + name + ' not found.');
else {
console.log('Module ' + name + ' not found.');
}
var o = ref.copy(o_);
o.number = ref.options.sequencerCounter++; //Gives a Unique ID to each step
@@ -32,8 +37,14 @@ function InsertStep(ref, image, index, name, o) {
// Tell UI that a step has been set up.
o = o || {};
UI.onSetup(o.step);
ref.modules[name].expandSteps = function expandSteps(stepsArray) {
for (var step of stepsArray) {
ref.addSteps(step['name'], step['options']);
}
}
var module = ref.modules[name][0](o, UI);
ref.images[image].steps.splice(index, 0, module);
if (!module.isMeta)
ref.images[image].steps.splice(index, 0, module);
return true;
}