Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import * as chalk from 'chalk';
/* import * as clear from 'clear'; */
import * as program from 'commander';
import * as figlet from 'figlet';
import * as inquirer from 'inquirer';
import { classComp } from './src/definitions/class-component';
import { funcComp } from './src/definitions/functional-component';
import { pageComp } from './src/definitions/page-component';
console.clear();
console.log(
chalk.default(
figlet.textSync('Pankod CLI Boilerplate')
)
);
const questions = [
{
choices: ['page', 'functional component', 'class component'],
message: 'What do you want to add?',
name: 'fileType',
type: 'list'
}
];
program
.command('addFile')
.alias('a')
.description('Add a file')
import * as yargs from 'yargs';
import * as chalk from 'chalk';
import * as figlet from 'figlet';
import * as zipLambda from './commands/zip-lambda';
import * as create from './commands/create';
const NAME = 'cloudcomponents';
// eslint-disable-next-line no-console
console.log(chalk.red(figlet.textSync(NAME)), '\n');
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { version } = require('../package.json');
// eslint-disable-next-line no-unused-expressions
yargs
.version(version)
.scriptName(NAME)
.help('help')
.command(zipLambda)
.command(create).argv;
import * as chalk from 'chalk';
/* import * as clear from 'clear'; */
import * as program from 'commander';
import * as figlet from 'figlet';
import * as inquirer from 'inquirer';
import { classComp } from './src/definations/class-component';
import { funcComp } from './src/definations/functional-component';
import { pageComp } from './src/definations/page-component';
console.clear();
console.log(
chalk.default(
figlet.textSync('Pankod CLI Boilerplate')
)
);
const questions = [
{
choices: ['page', 'functional component', 'class component'],
message: 'What do you want to add?',
name: 'fileType',
type: 'list'
}
];
program
.command('addFile')
.alias('a')
.description('Add a file')
server.listen(env.port || config.get('port'), _ => {
figlet.text('connect', (err, data) => {
if (err) return console.error(err); // TODO ::: Create ErrorHandler
console.log(data);
})
});
function spawn() {
figlet.text('Gon', {
font: 'univers',
}, (err, data) => {
if (err) {
console.error(err)
return
}
console.log(data)
console.log('Okay dokey, ready to workโฆ')
})
const gulp = path.join(__dirname, '../node_modules/gulp-cli/bin/gulp.js')
const gulpfile = path.join(__dirname, 'gulpfile.babel.js')
// --gulpfile will manually set path of gulpfile. Useful if you have multiple gulpfiles. This will set the CWD to the gulpfile directory as well
subApp = exec(`${gulp} --color --gulpfile ${gulpfile} --cwd ${CWD}` , (error, stdout) => {
const showInfoPage = (deferred) => {
// { fontlist: true/false, formats: true/false, codecs: true/false }
if (global.info.fontsample) {
console.log(`Sample of: ${global.info.fontsample}\n`);
figlet.text(global.info.fontsample , {
font: global.info.fontsample
}, (err, data) => {
if (err) {
console.log(err);
deferred.reject(err);
} else {
console.log(data);
return deferred.resolve();
}
});
}
// List of Figlet Fonts
if (global.info.fontlist) {
console.log('Available fonts:');
figlet.fonts((err, fonts) => {
let fout = [];
import chokidar from 'chokidar';
import http from 'http';
import express from 'express';
import webpack from 'webpack';
import webpackDevMiddleware from 'webpack-dev-middleware';
import webpackHotMiddleware from 'webpack-hot-middleware';
import env from 'dotenv';
import chalk from 'chalk';
import figlet from 'figlet';
import reporter from './server/lib/webpackReporter';
import { name } from '../package.json';
env.config();
figlet.text(`Welcome to \n ${process.env.APPLICATION_NAME || name}`, {
verticalLayout: 'full',
kerning: 'fitted',
}, (err, data) => {
if (!err) {
console.log(chalk.green(data));
}
});
const app = express();
if (process.env.NODE_ENV === 'development') {
const config = require('../webpack.config.babel.js').default; // eslint-disable-line
const compiler = webpack(config);
// Serve hot-reloading bundle to client
app.use(webpackDevMiddleware(compiler, {
publicPath: config.output.publicPath,
{
name: 'task',
depends: ['name']
},
{
name: '.'
},
{
name: 'production',
depends: ['name']
}
];
/* ====== Initialize ====== */
figlet('GTB', function (err, data) {
console.log(data.toString());
gtbConfig = readGtbConfig();
initialize();
});
function addCliCommands() {
program
.option('-n, --name [projectName]', 'option: Run project')
.option('-t, --task [taskName]', 'option: Run specific gulp task on a project [default]', 'default')
.option('-p, --production', 'option: Set production mode')
.option('list', 'command: List all the projects')
.option('add [add]', 'command: Adds a new project to gtb')
.option('deploy [deploy]', 'command: Deploys project to surge.sh')
.option('delete [delete]', 'command: Deletes project')
.option('.')
.parse(process.argv);
exports.run = (bot, msg, args) => {
// -l -- List all fonts
// -f <font> -- Set font
const parsed = bot.utils.parseArgs(args, ['l', 'f:']);
if (parsed.options.l) {
bot.utils.textUpload(figlet.fontsSync().join('\n')).then(({ url }) => {
if (!url) {
return msg.error('Failed to upload fonts list!');
}
msg.edit({
embed: bot.utils.embed('Available Fonts', `A list of available fonts can be found [here](${url}).`)
}).then(m => m.delete(5000));
});
return;
}
if (parsed.leftover.length < 1) {
throw 'You must provide some text to render!';
}
const options = {};</font>
figlet.text(global.info.fontsample , {
font: global.info.fontsample
}, (err, data) => {
if (err) {
console.log(err);
deferred.reject(err);
} else {
console.log(data);
return deferred.resolve();
}
});
}
// List of Figlet Fonts
if (global.info.fontlist) {
console.log('Available fonts:');
figlet.fonts((err, fonts) => {
let fout = [];
fonts.forEach( (font, idx) => {
if (idx%6 === 0) {
fout.push([]);
}
fout[fout.length-1].push(font);
});
console.log(columnify(fout, {
showHeaders: false
}));
return deferred.resolve();
});
}