Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(async () => {
console.log(`\nBuilding ${yellow(name)}, version ${yellow(version)}`);
// Beginners example selection
if (prog.prompt) {
srcDir = await utils.prompt();
}
c.info(`Compiler will compile ${yellow(`./${srcDir}/plugin.html`)}`);
reloadConfig();
try {
// Basic assertions
assert(
typeof config === 'object',
'Missing basic config object. Make sure you have valid ' +
'config.js in src dir'
warn(...args) {
if (this.options.logLevel < 2) {
return
}
console.warn(colors.yellow('warning'), ...args)
}
dir = join('examples',list[ value - 1 ])
} else if(value === 0) {
console.log(`----------------------------------------------------
Please change ${ yellow( 'package.json' ) } now:
${ yellow( 'name') }: Must contain name of your plugin in a form windy-plugin-AnyName
${ yellow( 'description') }: Should be description of what your plugin does
${ yellow( 'author') }: Should contain your name
${ yellow( 'repository') }: Should be actual link to your hosting repo
Also ${ yellow('./README.md') } should contain some info about your plugin if you wish
For faster work use directlly ${ yellow('npm run start-dev' ) } to skip this prompt
After you will be done use ${ yellow('npm publish')} to publish your plugin.
-----------------------------------------------------`)
}
return dir
}
console.warn(colorette.red(WARNING.replace(/`[^`]+`/g, function (i) {
return colorette.yellow(i.slice(1, -1));
})));
} else {
message: `Which example you want to launch? (press 0 - ${ list.length }):`,
validate: value => value >= 0 && value < list.length + 1 ? true : false
});
if(value > 0) {
dir = join('examples',list[ value - 1 ])
} else if(value === 0) {
console.log(`----------------------------------------------------
Please change ${ yellow( 'package.json' ) } now:
${ yellow( 'name') }: Must contain name of your plugin in a form windy-plugin-AnyName
${ yellow( 'description') }: Should be description of what your plugin does
${ yellow( 'author') }: Should contain your name
${ yellow( 'repository') }: Should be actual link to your hosting repo
Also ${ yellow('./README.md') } should contain some info about your plugin if you wish
For faster work use directlly ${ yellow('npm run start-dev' ) } to skip this prompt
After you will be done use ${ yellow('npm publish')} to publish your plugin.
-----------------------------------------------------`)
}
return dir
}
}
if (d.relFilePath) {
if (header.length > 0) {
header += ': ';
}
header += color.cyan(d.relFilePath);
if (typeof d.lineNumber === 'number' && d.lineNumber > -1) {
header += color.dim(`:`);
header += color.yellow(`${d.lineNumber}`);
if (typeof d.columnNumber === 'number' && d.columnNumber > -1) {
header += color.dim(`:`);
header += color.yellow(`${d.columnNumber}`);
}
}
}
if (header.length > 0) {
outputLines.unshift(INDENT + header);
}
outputLines.push('');
if (d.lines && d.lines.length) {
const lines = prepareLines(d.lines);
lines.forEach((l) => {
if (!isMeaningfulLine(l.text)) {
return;
const color = (clr: string | undefined, message: string): string => {
switch (clr) {
case 'brightblue':
return blueBright(message);
case 'brightred':
return redBright(message);
case 'red':
return red(message);
case 'green':
return green(message);
case 'yellow':
return yellow(message);
default:
return message;
}
};
import { yellow } from 'colorette';
import * as boxen from 'boxen';
import * as terminalLink from 'terminal-link';
const url = 'https://donate.biesbjerg.com';
const link = terminalLink(url, url);
const message = `
If this tool saves you or your company time, please consider making a
donation to support my work and the continued maintainence and development:
${yellow(link)}`;
export const donateMessage = boxen(message.trim(), {
padding: 1,
margin: 0,
dimBorder: true
});
warn: (...args) => log(yellow(args.join(' '))),
error: (err, msg) =>
}).replace(/\[([^[\]]+)\]/gi, (match) => {
return c.yellow(match);
}).replace(/ --?([^\s,]+)/gi, (match) => {
return c.green(match);