Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const schematicsProvider: Promise = (async function () {
let workspace = await getWorkspace('local');
let command = new (SchematicCommand as any)({workspace: workspace}, null, null);
let {listSchematicNames} = (await command.createWorkflow({interactive: false})).engineHost;
let defaultSchematicCollection = await command.getDefaultSchematicCollection()
return {
getCollection(collectionName: string): Collection {
return command.getCollection(collectionName);
},
listSchematics(collection): string[] {
return listSchematicNames(collection.description)
},
getSchematic(collection: Collection, schematicName: string, allowPrivate?: boolean): Schematic {
return command.getSchematic(collection, schematicName, allowPrivate);
},
getDefaultSchematicCollection() {
return defaultSchematicCollection;
"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();
function getWorkspace() {
return cliUtilConfig.getWorkspace();
}
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;
}