88 lines
12 KiB
JavaScript
88 lines
12 KiB
JavaScript
"use strict";
|
|
/**
|
|
* @license
|
|
* Copyright Google LLC All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
* found in the LICENSE file at https://angular.io/license
|
|
*/
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.FallbackEngineHost = void 0;
|
|
const rxjs_1 = require("rxjs");
|
|
const src_1 = require("../src");
|
|
/**
|
|
* An EngineHost that support multiple hosts in a fallback configuration. If a host does not
|
|
* have a collection/schematics, use the following host before giving up.
|
|
*/
|
|
class FallbackEngineHost {
|
|
constructor() {
|
|
this._hosts = [];
|
|
}
|
|
addHost(host) {
|
|
this._hosts.push(host);
|
|
}
|
|
createCollectionDescription(name, requester) {
|
|
for (const host of this._hosts) {
|
|
try {
|
|
const description = host.createCollectionDescription(name, requester);
|
|
return { name, host, description };
|
|
}
|
|
catch (_) { }
|
|
}
|
|
throw new src_1.UnknownCollectionException(name);
|
|
}
|
|
createSchematicDescription(name, collection) {
|
|
const description = collection.host.createSchematicDescription(name, collection.description);
|
|
if (!description) {
|
|
return null;
|
|
}
|
|
return { name, collection, description };
|
|
}
|
|
getSchematicRuleFactory(schematic, collection) {
|
|
return collection.host.getSchematicRuleFactory(schematic.description, collection.description);
|
|
}
|
|
createSourceFromUrl(url, context) {
|
|
return context.schematic.collection.description.host.createSourceFromUrl(url, context);
|
|
}
|
|
transformOptions(schematic, options, context) {
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
return (0, rxjs_1.of)(options).pipe(...this._hosts.map((host) => (0, rxjs_1.mergeMap)((opt) => host.transformOptions(schematic, opt, context))));
|
|
}
|
|
transformContext(context) {
|
|
let result = context;
|
|
this._hosts.forEach((host) => {
|
|
result = (host.transformContext(result) || result);
|
|
});
|
|
return result;
|
|
}
|
|
listSchematicNames(collection, includeHidden) {
|
|
const allNames = new Set();
|
|
this._hosts.forEach((host) => {
|
|
try {
|
|
host
|
|
.listSchematicNames(collection.description, includeHidden)
|
|
.forEach((name) => allNames.add(name));
|
|
}
|
|
catch (_) { }
|
|
});
|
|
return [...allNames];
|
|
}
|
|
createTaskExecutor(name) {
|
|
for (const host of this._hosts) {
|
|
if (host.hasTaskExecutor(name)) {
|
|
return host.createTaskExecutor(name);
|
|
}
|
|
}
|
|
return (0, rxjs_1.throwError)(new src_1.UnregisteredTaskException(name));
|
|
}
|
|
hasTaskExecutor(name) {
|
|
for (const host of this._hosts) {
|
|
if (host.hasTaskExecutor(name)) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
exports.FallbackEngineHost = FallbackEngineHost;
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFsbGJhY2stZW5naW5lLWhvc3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9hbmd1bGFyX2RldmtpdC9zY2hlbWF0aWNzL3Rvb2xzL2ZhbGxiYWNrLWVuZ2luZS1ob3N0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTs7Ozs7O0dBTUc7OztBQUVILCtCQUE0RTtBQUU1RSxnQ0FVZ0I7QUFjaEI7OztHQUdHO0FBQ0gsTUFBYSxrQkFBa0I7SUFBL0I7UUFDVSxXQUFNLEdBQXlCLEVBQUUsQ0FBQztJQXdHNUMsQ0FBQztJQXRHQyxPQUFPLENBQ0wsSUFBeUM7UUFFekMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUM7SUFDekIsQ0FBQztJQUVELDJCQUEyQixDQUN6QixJQUFZLEVBQ1osU0FBcUM7UUFFckMsS0FBSyxNQUFNLElBQUksSUFBSSxJQUFJLENBQUMsTUFBTSxFQUFFO1lBQzlCLElBQUk7Z0JBQ0YsTUFBTSxXQUFXLEdBQUcsSUFBSSxDQUF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