How to use the @angular/cli/models/config.CliConfig function in @angular/cli

To help you get started, we’ve selected a few @angular/cli examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github JetBrains / intellij-plugins / AngularJS / src / ngCli / schematicsProvider60.ts View on Github external
// 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;
github JetBrains / intellij-plugins / AngularJS / src / ngCli / schematicsProvider62.ts View on Github external
// 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() {
        return defaultCollectionName;
    }
github JetBrains / intellij-plugins / AngularJS / gen / ngCli / schematicsProvider62.js View on Github external
"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() {
        return defaultCollectionName;
    }
});
github JetBrains / intellij-plugins / AngularJS / gen / ngCli / schematicsProvider60.js View on Github external
"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;