New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@generilla/cli

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@generilla/cli - npm Package Compare versions

Comparing version
1.0.5
to
2.0.0
+9
build/commands/commands.d.ts
import { Command as CommanderCommand } from 'commander';
import { CommandRun } from './run/run';
import { ActionCallback } from './type';
export declare class Commands {
protected static getCommands(): (typeof CommandRun)[];
static getDefaultCommand(): typeof CommandRun;
static processCLI(program: CommanderCommand): void;
static attachCommands(program: CommanderCommand, actionCallback: ActionCallback): void;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const run_1 = require("./run/run");
const list_1 = require("./list/list");
const generators_1 = require("./generators/generators");
const scaffold_1 = require("./scaffold/scaffold");
class Commands {
static getCommands() {
return [run_1.CommandRun, list_1.CommandList, generators_1.CommandGenerator, scaffold_1.CommandScaffold];
}
static getDefaultCommand() {
return run_1.CommandRun;
}
static processCLI(program) { }
static attachCommands(program, actionCallback) {
this.getCommands().forEach(command => command.attach(program, actionCallback));
}
}
exports.Commands = Commands;
//# sourceMappingURL=commands.js.map
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/commands/commands.ts"],"names":[],"mappings":";;AAEA,mCAAuC;AACvC,sCAA0C;AAC1C,wDAA2D;AAC3D,kDAAsD;AAGtD,MAAa,QAAQ;IACP,MAAM,CAAC,WAAW;QACxB,OAAO,CAAC,gBAAU,EAAE,kBAAW,EAAE,6BAAgB,EAAE,0BAAe,CAAC,CAAC;IACxE,CAAC;IAEM,MAAM,CAAC,iBAAiB;QAC3B,OAAO,gBAAU,CAAC;IACtB,CAAC;IAEM,MAAM,CAAC,UAAU,CAAC,OAAyB,IAAG,CAAC;IAE/C,MAAM,CAAC,cAAc,CACxB,OAAyB,EACzB,cAA8B;QAE9B,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CACjC,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,cAAc,CAAC,CAC1C,CAAC;IACN,CAAC;CACJ;AAnBD,4BAmBC"}
import { Command as CommanderCommand } from 'commander';
import { ActionCallback } from '../type';
import { Generilla } from '../../lib/generilla';
import { ObjectLiteral } from '../../type';
export declare class CommandGenerator {
static attach(program: CommanderCommand, actionCallback: ActionCallback): void;
static process(generilla: Generilla, args: ObjectLiteral): Promise<void>;
private static promptProceed;
}
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@generilla/core");
const inquirer_1 = __importDefault(require("inquirer"));
const type_1 = require("../type");
let CommandGenerator = class CommandGenerator {
static attach(program, actionCallback) {
program
.command('generator [action] [reference]')
.usage('add|update|remove <reference>')
.alias('gen')
.description('Manage installed generators')
.on('--help', () => {
console.log('');
console.log('Examples:');
console.log(' $ generilla generator add https://github.com/joe/generators/tree/master/awesome.generator');
console.log(' $ generilla generator add https://github.com/joe/generators.git|master|/awesome.generator');
console.log(' $ generilla generator add git@github.com:joe/generators.git|master|/awesome.generator');
console.log(' $ generilla generator update awesome.generator');
console.log(' $ generilla generator remove awesome.generator');
})
.action((action, reference) => actionCallback({
command: this,
arguments: {
action,
reference,
},
}));
}
static process(generilla, args) {
return __awaiter(this, void 0, void 0, function* () {
yield generilla.showPreFlight();
if (args.action === 'add') {
let result = null;
try {
result = core_1.ReferenceParser.parse(args.reference);
}
catch (e) {
console.error('The generator reference you provided looks really weird.');
return;
}
const manager = new core_1.GeneratorRecordManager(generilla.getGeneratorsPath());
return manager.add(result);
}
if (args.action === 'update' || args.action === 'up') {
const proceed = yield this.promptProceed(generilla, args, 'Will be updated #COUNT# generator(s). Proceed?', 'remote');
if (proceed) {
const manager = new core_1.GeneratorRecordManager(generilla.getGeneratorsPath());
yield manager.update(args.reference);
}
return;
}
if (args.action === 'remove' || args.action === 'rm') {
const proceed = yield this.promptProceed(generilla, args, 'Will be removed #COUNT# generator(s). Proceed?');
if (proceed) {
const manager = new core_1.GeneratorRecordManager(generilla.getGeneratorsPath());
yield manager.remove(args.reference);
}
return;
}
throw new Error(`Unknown action: ${args.action}`);
});
}
static promptProceed(generilla, args, question, type) {
return __awaiter(this, void 0, void 0, function* () {
const generators = yield core_1.GeneratorList.getList(generilla.getGeneratorsPath(), args.reference, type);
const count = generators.length;
if (count) {
const answers = yield inquirer_1.default.prompt([
{
type: 'confirm',
name: 'proceed',
message: question.replace('#COUNT#', count.toString()),
},
]);
if (answers.proceed) {
return true;
}
}
else {
console.log('No generators match the given criteria');
}
return false;
});
}
};
CommandGenerator = __decorate([
type_1.Implements()
], CommandGenerator);
exports.CommandGenerator = CommandGenerator;
//# sourceMappingURL=generators.js.map
{"version":3,"file":"generators.js","sourceRoot":"","sources":["../../../src/commands/generators/generators.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AACA,0CAKyB;AACzB,wDAAgC;AA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C,IAAI,KAAK,EAAE;gBACP,MAAM,OAAO,GAAG,MAAM,kBAAQ,CAAC,MAAM,CAAC;oBAClC;wBACI,IAAI,EAAE,SAAS;wBACf,IAAI,EAAE,SAAS;wBACf,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC;qBACzD;iBACJ,CAAC,CAAC;gBACH,IAAI,OAAO,CAAC,OAAO,EAAE;oBACjB,OAAO,IAAI,CAAC;iBACf;aACJ;iBAAM;gBACH,OAAO,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAC;aACzD;YAED,OAAO,KAAK,CAAC;QACjB,CAAC;KAAA;CACJ,CAAA;AAvHY,gBAAgB;IAD5B,iBAAU,EAAoB;GAClB,gBAAgB,CAuH5B;AAvHY,4CAAgB"}
import { Command as CommanderCommand } from 'commander';
import { ActionCallback } from '../type';
import { Generilla } from '../../lib/generilla';
export declare class CommandList {
static attach(program: CommanderCommand, actionCallback: ActionCallback): void;
static process(generilla: Generilla): Promise<void>;
}
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@generilla/core");
const type_1 = require("../type");
let CommandList = class CommandList {
static attach(program, actionCallback) {
program
.command('list')
.alias('ls')
.description('Display a list of available generators')
.action(() => actionCallback({
command: this,
arguments: {},
}));
}
static process(generilla) {
return __awaiter(this, void 0, void 0, function* () {
yield generilla.showPreFlight();
const generators = yield core_1.GeneratorList.getList(generilla.getGeneratorsPath());
if (!generators.length) {
console.log('No generators installed yet.');
}
else {
console.log('Available generators:');
console.log('');
generators.forEach(generator => console.log(` * ${core_1.describeGenerator(generator)}`));
console.log('');
}
});
}
};
CommandList = __decorate([
type_1.Implements()
], CommandList);
exports.CommandList = CommandList;
//# sourceMappingURL=list.js.map
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/list/list.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,0CAAmE;AAEnE,kCAAuE;AAIvE,IAAa,WAAW,GAAxB,MAAa,WAAW;IACb,MAAM,CAAC,MAAM,CAChB,OAAyB,EACzB,cAA8B;QAE9B,OAAO;aACF,OAAO,CAAC,MAAM,CAAC;aACf,KAAK,CAAC,IAAI,CAAC;aACX,WAAW,CAAC,wCAAwC,CAAC;aACrD,MAAM,CAAC,GAAG,EAAE,CACT,cAAc,CAAC;YACX,OAAO,EAAE,IAAI;YACb,SAAS,EAAE,EAAE;SAChB,CAAC,CACL,CAAC;IACV,CAAC;IAEM,MAAM,CAAO,OAAO,CAAC,SAAoB;;YAC5C,MAAM,SAAS,CAAC,aAAa,EAAE,CAAC;YAChC,MAAM,UAAU,GAAG,MAAM,oBAAa,CAAC,OAAO,CAC1C,SAAS,CAAC,iBAAiB,EAAE,CAChC,CAAC;YACF,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE;gBACpB,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;aAC/C;iBAAM;gBACH,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;gBACrC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;gBAChB,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAC3B,OAAO,CAAC,GAAG,CAAC,QAAQ,wBAAiB,CAAC,SAAS,CAAC,EAAE,CAAC,CACtD,CAAC;gBACF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;aACnB;QACL,CAAC;KAAA;CACJ,CAAA;AAjCY,WAAW;IADvB,iBAAU,EAAoB;GAClB,WAAW,CAiCvB;AAjCY,kCAAW"}
import { Command as CommanderCommand } from 'commander';
import { ActionCallback, CommandActionArguments } from '../type';
import { Generilla } from '../../lib/generilla';
export declare class CommandRun {
static attach(program: CommanderCommand, actionCallback: ActionCallback): void;
static process(generilla: Generilla, args: CommandActionArguments): Promise<void>;
}
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@generilla/core");
const type_1 = require("../type");
const constants_1 = require("../../lib/constants");
let CommandRun = class CommandRun {
static attach(program, actionCallback) {
program
.command('run [generator]')
.alias('r')
.description('Run a specified generator')
.option('-a, --answers <answers>', 'Answers as JSON object')
.option('-y, --yes', 'Use the default answers when possible')
.option('-o, --output <output>', 'Specify an alternative target folder, rather than CWD')
.action((generator, command) => actionCallback({
command: this,
arguments: {
generator,
answers: command.answers,
yes: command.yes,
output: command.output,
},
}));
}
static process(generilla, args) {
return __awaiter(this, void 0, void 0, function* () {
let generatorCode = args.generator;
let generatorItem;
const list = yield core_1.GeneratorList.getList(generilla.getGeneratorsPath());
if (!list.length) {
console.log('No generators installed yet.');
console.log('Type "generilla generator add <reference>" to add an existing generator, or');
console.log('type "generilla scaffold" to make a brand new one!');
return;
}
let chosenFromList = false;
if (!generatorCode) {
yield generilla.showIntro();
generatorCode = yield generilla.selectGenerator(list);
if (generatorCode === constants_1.NOTHING) {
console.log('Well then, see you round!');
return;
}
chosenFromList = true;
}
generatorItem = list.find(item => item.code === generatorCode);
if (!generatorItem) {
console.log('Emm... I am not aware of such generator to be out there.');
return;
}
yield generilla.showIntro();
if (!chosenFromList) {
console.log(`Running '${generatorItem.name}' [${generatorItem.code}] generator`);
}
const generator = new core_1.GeneratorController(generatorItem);
const destination = args.output || process.env.GENERILLA_DST || process.cwd();
const { originalAnswers } = yield generator.runPipeline(destination, args);
console.log('Enjoy your brand new whatever you generated there!');
if (args.mould) {
console.log('Ah, yes. If you would like to run this process non-interactively, use the following command:');
console.log(`generilla run ${generatorItem.code} -a '${JSON.stringify(originalAnswers || {})}'`);
}
});
}
};
CommandRun = __decorate([
type_1.Implements()
], CommandRun);
exports.CommandRun = CommandRun;
//# sourceMappingURL=run.js.map
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../../src/commands/run/run.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,0CAIyB;AACzB,kCAKiB;AAEjB,mDAA8C;AAG9C,IAAa,UAAU,GAAvB,MAAa,UAAU;IACZ,MAAM,CAAC,MAAM,CAChB,OAAyB,EACzB,cAA8B;QAE9B,OAAO;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BACV;gBAED,cAAc,GAAG,IAAI,CAAC;aACzB;YAED,aAAa,GAAG,IAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,aAAa,CAAC,CAAC;YAChE,IAAI,CAAC,aAAa,EAAE;gBAChB,OAAO,CAAC,GAAG,CACP,0DAA0D,CAC7D,CAAC;gBACF,OAAO;aACV;YAED,MAAM,SAAS,CAAC,SAAS,EAAE,CAAC;YAC5B,IAAI,CAAC,cAAc,EAAE;gBACjB,OAAO,CAAC,GAAG,CACP,YAAY,aAAa,CAAC,IAAI,MAAM,aAAa,CAAC,IAAI,aAAa,CACtE,CAAC;aACL;YAED,MAAM,SAAS,GAAG,IAAI,0BAAmB,CAAC,aAAc,CAAC,CAAC;YAE1D,MAAM,WAAW,GACb,IAAI,CAAC,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;YAC9D,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,SAAS,CAAC,WAAW,CACnD,WAAW,EACX,IAAI,CACP,CAAC;YAEF,OAAO,CAAC,GAAG,CAAC,oDAAoD,CAAC,CAAC;YAElE,IAAI,IAAI,CAAC,KAAK,EAAE;gBACZ,OAAO,CAAC,GAAG,CACP,8FAA8F,CACjG,CAAC;gBACF,OAAO,CAAC,GAAG,CACP,iBAAiB,aAAa,CAAC,IAAI,QAAQ,IAAI,CAAC,SAAS,CACrD,eAAe,IAAI,EAAE,CACxB,GAAG,CACP,CAAC;aACL;QACL,CAAC;KAAA;CACJ,CAAA;AAhGY,UAAU;IADtB,iBAAU,EAAoB;GAClB,UAAU,CAgGtB;AAhGY,gCAAU"}
import { Command as CommanderCommand } from 'commander';
import { ActionCallback } from '../type';
import { Generilla } from '../../lib/generilla';
import { ObjectLiteral } from '../../type';
export declare class CommandScaffold {
static attach(program: CommanderCommand, actionCallback: ActionCallback): void;
static process(generilla: Generilla, args: ObjectLiteral): Promise<void>;
}
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@generilla/core");
const path_1 = __importDefault(require("path"));
const type_1 = require("../type");
let CommandScaffold = class CommandScaffold {
static attach(program, actionCallback) {
program
.command('scaffold')
.alias('sc')
.description('Create a generator boilerplate in the current folder')
.action((action, reference) => actionCallback({
command: this,
arguments: {
action,
reference,
},
}));
}
static process(generilla, args) {
return __awaiter(this, void 0, void 0, function* () {
yield generilla.showPreFlight();
const textConverter = new core_1.TextConverter();
const packageRoot = path_1.default.join(__dirname, '../../../');
const generatorItem = yield core_1.GeneratorList.getGeneratorItem(packageRoot, {
id: 'generator-generator',
branch: '',
path: '',
type: 'local',
}, {
textConverter,
});
if (!generatorItem) {
throw new Error('Generator generator is not accessible');
}
const generator = new core_1.GeneratorController(generatorItem);
const destination = process.env.GENERILLA_DST || process.cwd();
const { answers } = yield generator.runPipeline(destination, args);
const manager = new core_1.GeneratorRecordManager(generilla.getGeneratorsPath());
yield manager.add({
path: path_1.default.join(destination, answers.generator_name_kebab),
type: 'local',
});
console.log(`A boilerplate has been created. Now go to ${answers.generator_name_kebab}/ and make something beautiful ❤️`);
});
}
};
CommandScaffold = __decorate([
type_1.Implements()
], CommandScaffold);
exports.CommandScaffold = CommandScaffold;
//# sourceMappingURL=scaffold.js.map
{"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../../../src/commands/scaffold/scaffold.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AACA,0CAKyB;AACzB,gDAAwB;AAExB,kCAAuE;AAKvE,IAAa,eAAe,GAA5B,MAAa,eAAe;IACjB,MAAM,CAAC,MAAM,CAChB,OAAyB,EACzB,cAA8B;QAE9B,OAAO;aACF,OAAO,CAAC,UAAU,CAAC;aACnB,KAAK,CAAC,IAAI,CAAC;aACX,WAAW,CAAC,sDAAsD,CAAC;aACnE,MAAM,CAAC,CAAC,MAAc,EAAE,SAAiB,EAAE,EAAE,CAC1C,cAAc,CAAC;YACX,OAAO,EAAE,IAAI;YACb,SAAS,EAAE;gBACP,MAAM;gBACN,SAAS;aACZ;SACJ,CAAC,CACL,CAAC;IACV,CAAC;IAEM,MAAM,CAAO,OAAO,CAAC,SAAoB,EAAE,IAAmB;;YACjE,MAAM,SAAS,CAAC,aAAa,EAAE,CAAC;YAEhC,MAAM,aAAa,GAAG,IAAI,oBAAa,EAAE,CAAC;YAE1C,MAAM,WAAW,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;YACtD,MAAM,aAAa,GAAG,MAAM,oBAAa,CAAC,gBAAgB,CACtD,WAAW,EACX;gBACI,EAAE,EAAE,qBAAqB;gBACzB,MAAM,EAAE,EAAE;gBACV,IAAI,EAAE,EAAE;gBACR,IAAI,EAAE,OAAO;aAChB,EACD;gBACI,aAAa;aAChB,CACJ,CAAC;YAEF,IAAI,CAAC,aAAa,EAAE;gBAChB,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;aAC5D;YAED,MAAM,SAAS,GAAG,IAAI,0BAAmB,CAAC,aAAa,CAAC,CAAC;YAEzD,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;YAC/D,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,SAAS,CAAC,WAAW,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;YAEnE,MAAM,OAAO,GAAG,IAAI,6BAAsB,CACtC,SAAS,CAAC,iBAAiB,EAAE,CAChC,CAAC;YACF,MAAM,OAAO,CAAC,GAAG,CAAC;gBACd,IAAI,EAAE,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,oBAAoB,CAAC;gBAC1D,IAAI,EAAE,OAAO;aAChB,CAAC,CAAC;YAEH,OAAO,CAAC,GAAG,CACP,6CAA6C,OAAO,CAAC,oBAAoB,mCAAmC,CAC/G,CAAC;QACN,CAAC;KAAA;CACJ,CAAA;AA5DY,eAAe;IAD3B,iBAAU,EAAoB;GAClB,eAAe,CA4D3B;AA5DY,0CAAe"}
import { Command as CommanderCommand } from 'commander';
import { ObjectLiteral } from '../type';
import { Generilla } from '../lib/generilla';
export declare type CommandActionArguments = ObjectLiteral;
export interface CommandAction {
command: CommandProcessor;
arguments: CommandActionArguments;
}
export declare type ActionCallback = (action: CommandAction) => void;
interface CommandProcessorInstance {
}
export interface CommandProcessor {
new (): CommandProcessorInstance;
attach(program: CommanderCommand, actionCallback: ActionCallback): void;
process(generilla: Generilla, args?: CommandActionArguments): Promise<void>;
}
export declare function Implements<T>(): <U extends T>(constructor: U) => void;
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function Implements() {
return (constructor) => {
constructor;
};
}
exports.Implements = Implements;
//# sourceMappingURL=type.js.map
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../src/commands/type.ts"],"names":[],"mappings":";;AAqBA,SAAgB,UAAU;IACtB,OAAO,CAAc,WAAc,EAAE,EAAE;QACnC,WAAW,CAAC;IAChB,CAAC,CAAC;AACN,CAAC;AAJD,gCAIC"}
export declare type Nullable<X = any> = X | null;
export interface ObjectLiteral<P = any> {
[k: string]: P;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=type.js.map
{"version":3,"file":"type.js","sourceRoot":"","sources":["../src/type.ts"],"names":[],"mappings":""}
+1
-1
export declare const HOME_SUBFOLDER = ".generilla";
export declare const NOTHING = "__nothing__";
export declare const VERSION = "1.0.5";
export declare const VERSION = "2.0.0";

@@ -5,3 +5,3 @@ "use strict";

exports.NOTHING = '__nothing__';
exports.VERSION = '1.0.5';
exports.VERSION = '2.0.0';
//# sourceMappingURL=constants.js.map
import { GeneratorListItem } from '@generilla/core';
import { Command } from './type';
export declare class Generilla {
private generatorsPath;
private introShown;
private preFlightShown;
constructor(generatorsPath: string);
getGeneratorsPath(): string;
run(): Promise<void>;
protected runCommandRun(command: Command): Promise<void>;
protected runCommandList(command: Command): Promise<void>;
protected showIntro(): void;
protected selectGenerator(list: GeneratorListItem[]): Promise<any>;
showIntro(): Promise<void>;
selectGenerator(list: GeneratorListItem[]): Promise<any>;
protected formatGeneratorChoices(list: GeneratorListItem[]): {

@@ -18,2 +17,3 @@ name: string;

private processCLI;
showPreFlight(): Promise<void>;
}

@@ -19,7 +19,8 @@ "use strict";

const inquirer_1 = __importDefault(require("inquirer"));
const fs_1 = __importDefault(require("fs"));
const fs_extra_1 = __importDefault(require("fs-extra"));
const commander_1 = __importDefault(require("commander"));
const core_1 = require("@generilla/core");
const commands_1 = require("./commands");
const constants_1 = require("./constants");
const commands_1 = require("../commands/commands");
const core_2 = require("@generilla/core");
class Generilla {

@@ -29,5 +30,10 @@ constructor(generatorsPath) {

this.introShown = false;
this.preFlightShown = false;
}
getGeneratorsPath() {
return this.generatorsPath;
}
run() {
return __awaiter(this, void 0, void 0, function* () {
yield fs_extra_1.default.ensureDir(this.generatorsPath);
if (!this.isObjectExist(this.generatorsPath)) {

@@ -37,63 +43,19 @@ throw new Error(`No such directory: ${this.generatorsPath}`);

const command = this.processCLI();
if (command.args.debug) {
if (command.arguments.debug) {
core_1.Debug.enable();
}
if (command.name === commands_1.COMMAND_RUN) {
yield this.runCommandRun(command);
}
else if (command.name === commands_1.COMMAND_LIST) {
yield this.runCommandList(command);
}
yield command.command.process(this, command.arguments);
});
}
runCommandRun(command) {
showIntro() {
return __awaiter(this, void 0, void 0, function* () {
let generatorCode = command.args.generator;
let generatorItem;
const list = yield core_1.GeneratorList.getList(this.generatorsPath);
let chosenFromList = false;
if (!generatorCode) {
this.showIntro();
generatorCode = yield this.selectGenerator(list);
if (generatorCode === constants_1.NOTHING) {
console.log('Well then, see you round!');
return;
}
chosenFromList = true;
}
generatorItem = list.find(item => item.code === generatorCode);
if (!generatorItem) {
console.log('Emm... I am not aware of such generator to be out there.');
if (this.introShown) {
return;
}
this.showIntro();
if (!chosenFromList) {
console.log(`Running '${generatorItem.name}' [${generatorItem.code}] generator`);
}
const generator = new core_1.GeneratorController(generatorItem);
const destination = command.args.output || process.env.GENERILLA_DST || process.cwd();
const { originalAnswers } = yield generator.runPipeline(destination, command.args);
console.log('Enjoy your brand new whatever you generated there!');
if (command.args.mould) {
console.log('Ah, yes. If you would like to run this process non-interactively, use the following command:');
console.log(`generilla run ${generatorItem.code} -a '${JSON.stringify(originalAnswers || {})}'`);
}
clear_1.default();
yield this.showPreFlight();
console.log(chalk_1.default.red(figlet_1.default.textSync('Generilla', { horizontalLayout: 'full' })));
this.introShown = true;
});
}
runCommandList(command) {
return __awaiter(this, void 0, void 0, function* () {
console.log('Available generators:');
console.log('');
(yield core_1.GeneratorList.getList(this.generatorsPath)).forEach(generator => console.log(` * ${generator.name} [${generator.code}]`));
console.log('');
});
}
showIntro() {
if (this.introShown) {
return;
}
clear_1.default();
console.log(chalk_1.default.red(figlet_1.default.textSync('Generilla', { horizontalLayout: 'full' })));
this.introShown = true;
}
selectGenerator(list) {

@@ -125,3 +87,3 @@ return __awaiter(this, void 0, void 0, function* () {

try {
return fs_1.default.existsSync(objectPath);
return fs_extra_1.default.existsSync(objectPath);
}

@@ -134,44 +96,42 @@ catch (err) {

const program = new commander_1.default.Command();
let commandToRun = '';
let commandToRun = null;
let commandArguments = {};
program
.name('generilla')
.version(constants_1.VERSION, '-v, --version', 'Output the current version')
.version(constants_1.VERSION, '-v, --version', 'output the current version')
.description('Generilla: an extremely simple code generator runner')
.option('-m, --mould', 'Output a mould of just executed generation, so it is possible to repeat it again later in a non-interactive way')
.option('-d, --debug', 'Output an additional debug info');
program
.command('run [generator]')
.alias('r')
.description('Run a specified generator')
.option('-a, --answers <answers>', 'Answers as JSON object')
.option('-y, --yes', 'Use the default answers when possible')
.option('-o, --output <output>', 'Specify an alternative target folder, rather than CWD')
.action((generator, command) => {
commandToRun = commands_1.COMMAND_RUN;
commandArguments = {
generator,
answers: command.answers,
yes: command.yes,
output: command.output,
};
.option('-m, --mould', 'output a mould of just executed generation, so it is possible to repeat it again later in a non-interactive way')
.option('-d, --debug', 'output an additional debug info');
commands_1.Commands.attachCommands(program, command => {
commandToRun = command.command;
commandArguments = command.arguments || {};
});
program
.command('list')
.alias('l')
.description('Display a list of available generators')
.action(function () {
commandToRun = commands_1.COMMAND_LIST;
});
program.parse(process.argv);
if (!commandToRun) {
commandToRun = commands_1.COMMAND_RUN;
commandToRun = commands_1.Commands.getDefaultCommand();
}
return {
name: commandToRun,
args: Object.assign(Object.assign({}, commandArguments), { mould: program.mould, debug: program.debug }),
command: commandToRun,
arguments: Object.assign(Object.assign({}, commandArguments), { mould: program.mould, debug: program.debug }),
};
}
showPreFlight() {
return __awaiter(this, void 0, void 0, function* () {
if (this.preFlightShown) {
return;
}
this.preFlightShown = true;
if (!(yield core_2.GIT.isAvailable())) {
console.log(chalk_1.default.yellow("* Warning! You don't have GIT installed. Some functionality may not work as expected."));
console.log(` ${core_2.GIT.getInstallationInfo()}`);
}
if (!(yield core_2.NPM.isAvailable())) {
console.log(chalk_1.default.yellow("* Warning! You don't have neither Yarn nor NPM installed. Some functionality may not work as expected."));
console.log(` ${core_2.NPM.getInstallationInfoYarn()}`);
console.log(` ${core_2.NPM.getInstallationInfoNPM()}`);
}
});
}
}
exports.Generilla = Generilla;
//# sourceMappingURL=generilla.js.map

@@ -1,1 +0,1 @@

{"version":3,"file":"generilla.js","sourceRoot":"","sources":["../../src/lib/generilla.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,kDAA0B;AAE1B,kDAA0B;AAE1B,oDAA4B;AAC5B,wDAAgC;AAChC,4CAAoB;AACpB,0DAAmE;AAEnE,0CAMyB;AAEzB,yCAAuD;AACvD,2CAA+C;AAE/C,MAAa,SAAS;IAGlB,YAAoB,cAAsB;QAAtB,mBAAc,GAAd,cAAc,CAAQ;QAFlC,eAAU,GAAG,KAAK,CAAC;IAEkB,CAAC;IAEjC,GAAG;;YACZ,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE;gBAC1C,MAAM,IAAI,KAAK,CAAC,sBAAsB,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;aAChE;YAED,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;YAClC,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE;gBACpB,YAAK,CAAC,MAAM,EAAE,CAAC;aAClB;YAED,IAAI,OAAO,CAAC,IAAI,KAAK,sBAAW,EAAE;gBAC9B,MAAM,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;aACrC;iBAAM,IAAI,OAAO,CAAC,IAAI,KAAK,uBAAY,EAAE;gBACtC,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;aACtC;QACL,CAAC;KAAA;IAEe,aAAa,CAAC,OAAgB;;YAC1C,IAAI,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,SAAmB,CAAC;YACrD,IAAI,aAA4C,CAAC;YAEjD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IAAI,CAAC,CAAC,MAAM,UAAG,CAAC,WAAW,EAAE,CAAC,EAAE;gBAC5B,OAAO,CAAC,GAAG,CACP,eAAK,CAAC,MAAM,CACR,uFAAuF,CAC1F,CACJ,CAAC;gBACF,OAAO,CAAC,GAAG,CAAC,KAAK,UAAG,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC;aACjD;YACD,IAAI,CAAC,CAAC,MAAM,UAAG,CAAC,WAAW,EAAE,CAAC,EAAE;gBAC5B,OAAO,CAAC,GAAG,CACP,eAAK,CAAC,MAAM,CACR,wGAAwG,CAC3G,CACJ,CAAC;gBACF,OAAO,CAAC,GAAG,CAAC,KAAK,UAAG,CAAC,uBAAuB,EAAE,EAAE,CAAC,CAAC;gBAClD,OAAO,CAAC,GAAG,CAAC,KAAK,UAAG,CAAC,sBAAsB,EAAE,EAAE,CAAC,CAAC;aACpD;QACL,CAAC;KAAA;CACJ;AAzID,8BAyIC"}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=type.js.map
{
"name": "@generilla/cli",
"version": "1.0.5",
"version": "2.0.0",
"license": "MIT",

@@ -12,6 +12,15 @@ "main": "./build/index.js",

},
"keywords": [
"code",
"generator",
"generilla",
"cli"
],
"scripts": {
"start": "GENERILLA_DST=./../../_output ts-node src/index.ts",
"start": "GENERILLA_DST=./../../_output GENERILLA_GENERATORS_HOME=./../../_generators ts-node src/index.ts",
"build:watch": "rm -rf ./build/*; tsc -w -p .",
"build": "rm -rf ./build/*; tsc -p .; chmod +x ./build/index.js"
"build": "rm -rf ./build/*; tsc -p .; chmod +x ./build/index.js",
"lint": "eslint ./src --ext .js,.ts",
"lint:fix": "eslint ./src --fix --ext .js,.ts",
"release": "./script/release.sh"
},

@@ -21,2 +30,3 @@ "devDependencies": {

"@types/ejs": "^2.6.3",
"@types/fs-extra": "^8.0.1",
"@types/inquirer": "^6.5.0",

@@ -30,3 +40,3 @@ "@types/node": "^12.7.8",

"dependencies": {
"@generilla/core": "^1.0.6",
"@generilla/core": "^2.0.0",
"case-formatter": "^1.0.9",

@@ -41,2 +51,3 @@ "chalk": "^2.4.2",

"findit": "^2.0.0",
"fs-extra": "^8.1.0",
"inquirer": "^7.0.0"

@@ -46,4 +57,3 @@ },

"access": "public"
},
"gitHead": "de1a7835fb6bcdf482005516c53a5b489a62729b"
}
}
# @generilla/cli
This is the command line tool package of `Generilla`. [See the full README here.](https://github.com/awesome1888/generilla)
This is the command line tool package of `Generilla`. [See the full README here.](https://github.com/gannochenko/generilla)
export declare const COMMAND_RUN = "run";
export declare const COMMAND_LIST = "list";
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.COMMAND_RUN = 'run';
exports.COMMAND_LIST = 'list';
//# sourceMappingURL=commands.js.map
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/lib/commands.ts"],"names":[],"mappings":";;AAAa,QAAA,WAAW,GAAG,KAAK,CAAC;AACpB,QAAA,YAAY,GAAG,MAAM,CAAC"}
MIT License
Copyright (c) 2019 - present Sergei Gannochenko
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.