Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"use strict";
const schematic_command_1 = require("@angular/cli/models/schematic-command");
const config_1 = require("@angular/cli/utilities/config");
let workspace = config_1.getWorkspace();
if (!workspace || !workspace.root)
throw new Error("Try 9.0 provider");
let command = new schematic_command_1.SchematicCommand({ workspace }, null, null);
let engineHost = command.createWorkflow({ interactive: false }).engineHost;
const schematicsProvider = Promise.resolve({
getCollection(collectionName) {
return command.getCollection(collectionName);
},
listSchematics(collection) {
return engineHost.listSchematics(collection);
},
getSchematic(collection, schematicName, allowPrivate) {
return command.getSchematic(collection, schematicName, allowPrivate);
},
getDefaultSchematicCollection() {
return command.getDefaultSchematicCollection();
}
});
module.exports = schematicsProvider;
"use strict";
const schematic_command_1 = require("@angular/cli/models/schematic-command");
let command = new schematic_command_1.SchematicCommand({}, null);
let defaultCollectionName;
try {
defaultCollectionName = require('@angular/cli/utilities/config').getDefaultSchematicCollection();
}
catch (e) {
defaultCollectionName = require('@angular/cli/models/config').CliConfig.getValue('defaults.schematics.collection');
}
let engineHost = command.getEngineHost();
const schematicsProvider = Promise.resolve({
getCollection(collectionName) {
return command.getCollection(collectionName);
},
listSchematics(collection) {
return engineHost.listSchematics(collection);
},
getSchematic(collection, schematicName, allowPrivate) {
const schematicsProvider = (async function () {
let workspace = await config_1.getWorkspace('local');
let command = new schematic_command_1.SchematicCommand({ workspace: workspace }, null, null);
let { listSchematicNames } = (await command.createWorkflow({ interactive: false })).engineHost;
let defaultSchematicCollection = await command.getDefaultSchematicCollection();
return {
getCollection(collectionName) {
return command.getCollection(collectionName);
},
listSchematics(collection) {
return listSchematicNames(collection.description);
},
getSchematic(collection, schematicName, allowPrivate) {
return command.getSchematic(collection, schematicName, allowPrivate);
},
getDefaultSchematicCollection() {
return defaultSchematicCollection;
}
};
"use strict";
const schematic_command_1 = require("@angular/cli/models/schematic-command");
let command = new schematic_command_1.SchematicCommand({}, null);
let engineHost = command.getEngineHost();
const schematicsProvider = Promise.resolve({
getCollection(collectionName) {
return command.getCollection(collectionName);
},
listSchematics(collection) {
return engineHost.listSchematics(collection);
},
getSchematic(collection, schematicName, allowPrivate) {
return command.getSchematic(collection, schematicName, allowPrivate);
},
getDefaultSchematicCollection() {
return command.getDefaultSchematicCollection();
}
});
module.exports = schematicsProvider;