@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
27 lines • 1.75 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.createPipeline = createPipeline;
const create_pipeline_1 = require("./create-pipeline");
/**
* Creates a {@link Pipeline|pipeline} from a given collection of {@link IPipelineStep|steps}.
* To be valid, the collection of {@link IPipelineStep|steps} must satisfy the following set of constraints
* (which should be logical, when you consider what a pipeline should achieve):
*
* 0) the collection of {@link IPipelineStep|steps} is not empty
* 1) all {@link IPipelineStepOrder#name|names} of {@link IPipelineStep|steps} are unique for the given pipeline
* 2) all {@link IPipelineStepOrder#dependencies|dependencies} of all {@link IPipelineStep|steps} exist
* 3) there are no cycles in the dependency graph
* 4) the target of a {@link IPipelineStepOrder#decorates|step's decoration} exists
* 5) if a {@link IPipelineStepOrder#decorates|decoration} applies, all of its {@link IPipelineStepOrder#dependencies|dependencies} are already in the pipeline
* 6) in the resulting {@link Pipeline|pipeline}, there is a strict cut between {@link IPipelineStep|steps} that are executed
* {@link PipelineStepStage#OncePerFile|once per file} and {@link PipelineStepStage#OncePerRequest|once per request}.
*
* @returns The function will try to order your collection steps so that all the constraints hold.
* If it succeeds it will return the resulting {@link Pipeline|pipeline}, otherwise it will throw an {@link InvalidPipelineError}.
*
* @throws InvalidPipelineError If any of the constraints listed above are not satisfied.
*/
function createPipeline(...steps) {
return (0, create_pipeline_1.verifyAndBuildPipeline)(steps);
}
//# sourceMappingURL=pipeline.js.map