Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var config = require('../config')(), // TODO: config
napi = config.napiUrl,
shell = require('shelljs'),
fs = require('fs'),
chalk = require('chalk'),
utils = require('./utils'),
mongoCtrl = require('./controllers/mongo'), // TODO: mongoCtrl
users = require('./controllers/users'), // TODO: user
series = require('async-series'),
request = require('request'),
qs = require('querystring'),
inquirer = require('inquirer'),
prompt = require('prompt'),
yeoman = require('yeoman-environment'),
env = yeoman.createEnv();
var progress = new utils.Progress();
exports.init = function(options) {
progress.start();
series([
checkPermissions,
function(done) {
cloneVulgar(options, done);
},
const createYeomanEnv = () => {
const env = yeoman.createEnv();
/* Register yeoman generators */
Object.keys(SUB_GENERATORS)
.filter(command => !SUB_GENERATORS[command].cliOnly)
.forEach(generator => {
if (SUB_GENERATORS[generator].blueprint) {
/* eslint-disable prettier/prettier */
env.register(require.resolve(`${SUB_GENERATORS[generator].blueprint}/generators/${generator}`), `${CLI_NAME}:${generator}`);
} else {
env.register(require.resolve(`../generators/${generator}`), `${CLI_NAME}:${generator}`);
}
});
return env;
};
it('exposes the wiring interface', function () {
var Dummy = generators.Base.extend({
exec: function () {}
});
var dummy = new Dummy([], {
resolved: 'foo',
namespace: 'bar',
env: yeoman.createEnv()
});
assert.implement(dummy, wiring);
});
});
beforeEach(function() {
this.beforeDir = process.cwd();
this.storePath = path.join(tmpdir, 'new-config.json');
this.memFs = env.createEnv().sharedFs;
this.fs = FileEditor.create(this.memFs);
this.store = new Storage('test', this.fs, this.storePath);
this.store.set('foo', 'bar');
});
function init(projectDir, argsOrName) {
console.log('Setting up new React Native app in ' + projectDir);
var env = yeoman.createEnv();
env.register(require.resolve(path.join(__dirname, 'generator')), 'react:app');
var args = Array.isArray(argsOrName) ? argsOrName : [argsOrName].concat(process.argv.slice(4));
var generator = env.create('react:app', {args: args});
generator.destinationRoot(projectDir);
generator.run();
}
function commandInit() {
const env = yeoman.createEnv();
const dir = path.resolve(__dirname, `../commands/init`);
const done = (exitCode) => process.exit(exitCode || 0);
env.register(require.resolve(dir), `dvhb:init`);
env.run(`dvhb:init`, done);
}
function run(namespace, socket, envOptions, runOptions, cb) {
var env = yeoman.createEnv([], envOptions, new SocketAdapter(socket));
env.lookup(function () {
env.run(namespace, runOptions, cb);
});
}
module.exports = function upgrade(args, config) {
args = args || process.argv;
let env = yeoman.createEnv();
let name = JSON.parse(fs.readFileSync('package.json', 'utf8')).name;
let generatorPath = path.join(__dirname, '..', 'generator');
env.register(generatorPath, 'react:app');
let generatorArgs = ['react:app', name].concat(args);
return new Promise((resolve) => env.run(generatorArgs, {upgrade: true}, resolve));
};
module.exports = function(projectDir, name) {
var oldCwd = process.cwd();
process.chdir(projectDir);
var env = yeoman.createEnv();
var generatorPath = path.join(__dirname, 'generator');
env.register(generatorPath, 'react:app');
var args = ['react:app', name].concat(process.argv.slice(4));
env.run(args, {'skip-ios': true}, function() {
process.chdir(oldCwd);
});
};
import yeoman from 'yeoman-environment';
import _ from 'lodash';
const env = yeoman.createEnv();
const reazyGenerators = '../reazy-generator/generators';
env.register(require.resolve(`${reazyGenerators}/mobile-app`), 'reazy:mobile-app');
env.register(require.resolve(`${reazyGenerators}/web-app`), 'reazy:web-app');
env.register(require.resolve(`${reazyGenerators}/plugin`), 'reazy:plugin');
env.register(require.resolve(`${reazyGenerators}/add-plugin`), 'reazy:add-plugin');
env.register(require.resolve(`${reazyGenerators}/remove-plugin`), 'reazy:remove-plugin');
const generatorOptions = {
disableNotifyUpdate: true
};
function requireFromString(src, filename) {
var m = new module.constructor();
m.paths = module.paths;