UNPKG

@o3r/core

Version:
24 lines 975 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getExternalPreset = getExternalPreset; const schematics_1 = require("@o3r/schematics"); const helpers_1 = require("./helpers"); /** * Generate the Preset runner for external presets * @param externalPresetLabel * @param tree * @param context */ function getExternalPreset(externalPresetLabel, tree, context) { const presetLabel = `${schematics_1.OTTER_MODULE_PRESET_PREFIX}${externalPresetLabel}`; return async (options) => { const modules = (await (0, schematics_1.getAvailableModules)(presetLabel, schematics_1.OTTER_MODULE_SUPPORTED_SCOPES, { logger: context.logger, workspaceConfig: (0, schematics_1.getWorkspaceConfig)(tree) })) .map((mod) => mod.name); const rule = (0, helpers_1.defaultPresetRuleFactory)(modules, options); return { modules, rule }; }; } //# sourceMappingURL=external-preset.js.map