Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
import {Collection, Schematic} from '@angular-devkit/schematics';
import {SchematicsProvider} from "./schematicsProvider";
import {SchematicCommand} from "@angular/cli/models/schematic-command";
let command = new (SchematicCommand as any)({}, 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 = Promise.resolve({
getCollection(collectionName: string): Collection {
return command.getCollection(collectionName);
},
listSchematics(collection): string[] {
return engineHost.listSchematics(collection)
},
getSchematic(collection: Collection, schematicName: string, allowPrivate?: boolean): Schematic {
return command.getSchematic(collection, schematicName, allowPrivate);
},
getDefaultSchematicCollection() {
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
import {SchematicsProvider} from "./schematicsProvider";
let schematicsUtils = require('@angular/cli/utilities/schematics');
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 = schematicsUtils.getEngineHost()
const schematicsProvider: Promise = Promise.resolve({
getCollection: schematicsUtils.getCollection,
getSchematic: schematicsUtils.getSchematic,
listSchematics(collection): string[] {
return engineHost.listSchematics(collection)
},
getDefaultSchematicCollection: () => defaultCollectionName
})
export = schematicsProvider;
"use strict";
let schematicsUtils = require('@angular/cli/utilities/schematics');
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 = schematicsUtils.getEngineHost();
const schematicsProvider = Promise.resolve({
getCollection: schematicsUtils.getCollection,
getSchematic: schematicsUtils.getSchematic,
listSchematics(collection) {
return engineHost.listSchematics(collection);
},
getDefaultSchematicCollection: () => defaultCollectionName
});
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) {
return command.getSchematic(collection, schematicName, allowPrivate);
},
getDefaultSchematicCollection() {