Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = async (argv, globalOpts) => {
const projectRoot = globalOpts['project-root']
const alreadyInstalled = await checkManifest(projectRoot)
const isWanted = await confirmWanted(alreadyInstalled, projectRoot)
if (isWanted) {
const version = await selectVersion(projectRoot)
const tool = await withTool(projectRoot)
console.log(blue(`> Installing @bugsnag/expo with ${tool}. This could take a while!`))
await install(tool, version, projectRoot)
}
}
render() {
if (this.closed) return;
if (!this.firstRender) this.out.write(clear(this.outputText));
super.render();
this.outputText = [color.bold(style.symbol(this.done, this.aborted)), color.bold(this.msg), style.delimiter(this.completing), this.done && this.suggestions[this.page][this.select] ? this.suggestions[this.page][this.select].title : this.rendered = this.transform.render(this.input)].join(' ');
if (!this.done) {
const suggestions = this.suggestions[this.page].map((item, i) => this.renderOption(item, this.select === i)).join('\n');
this.outputText += `\n` + (suggestions || color.gray(this.fallback.title));
if (this.suggestions[this.page].length > 1) {
this.outputText += color.blue(`\nPage ${this.page + 1}/${this.suggestions.length}`);
}
}
this.out.write(erase.line + cursor.to(0) + this.outputText);
}
displayValue = blue('null');
break;
case 'undefined':
displayValue = blue('undefined');
break;
case 'number':
displayType = Number.isInteger(originalValue) ? 'int' : 'float';
displayValue = green(originalValue);
break;
case 'function':
displayType = '';
displayValue = 'function () {}';
break;
case 'regexp':
displayType = '';
displayValue = blue(originalValue);
break;
default:
displayType = '';
displayValue = originalValue;
break;
}
return `${cyan(displayType)} ${displayValue}`;
}
displayType = '';
displayValue = this.generateDump(originalValue, `${indent}${this.spaces}`);
break;
case 'boolean':
displayType = 'boolean';
displayValue = magenta(`${originalValue}`);
break;
case 'string':
displayType = 'string';
displayValue = `${red(`"${originalValue}"`)} (length=${originalValue.length})`;
break;
case 'null':
displayValue = blue('null');
break;
case 'undefined':
displayValue = blue('undefined');
break;
case 'number':
displayType = Number.isInteger(originalValue) ? 'int' : 'float';
displayValue = green(originalValue);
break;
case 'function':
displayType = '';
displayValue = 'function () {}';
break;
case 'regexp':
displayType = '';
displayValue = blue(originalValue);
break;
default:
displayType = '';
displayValue = originalValue;
switch (paramType) {
case 'array':
case 'object':
displayType = '';
displayValue = this.generateDump(originalValue, `${indent}${this.spaces}`);
break;
case 'boolean':
displayType = 'boolean';
displayValue = magenta(`${originalValue}`);
break;
case 'string':
displayType = 'string';
displayValue = `${red(`"${originalValue}"`)} (length=${originalValue.length})`;
break;
case 'null':
displayValue = blue('null');
break;
case 'undefined':
displayValue = blue('undefined');
break;
case 'number':
displayType = Number.isInteger(originalValue) ? 'int' : 'float';
displayValue = green(originalValue);
break;
case 'function':
displayType = '';
displayValue = 'function () {}';
break;
case 'regexp':
displayType = '';
displayValue = blue(originalValue);
break;
_.each(this.options, (option) => {
strings.push(` ${kleur.blue(_.padEnd(this._getArgOrOptionName(option), maxWidth))} ${option.description}`)
})
}
_.each(options, (option) => {
strings.push(` ${kleur.blue(_.padEnd(option.long, maxWidth))} ${option.description}`)
})
}
}
let cache;
let out = await series(
steps.map(config => async () => {
const { inputOptions, outputOptions } = config;
inputOptions.cache = cache;
let bundle = await rollup(inputOptions);
cache = bundle;
await bundle.write(outputOptions);
return await config._sizeInfo;
}),
);
return (
blue(
`Build "${options.name}" to ${relative(cwd, dirname(options.output)) ||
'.'}:`,
) +
'\n ' +
out.join('\n ')
);
}
function getFormatedOutput(pkgName, filesOutput) {
const MAGIC_INDENTATION = 3;
const WHITE_SPACE = ' '.repeat(MAGIC_INDENTATION);
return (
kolor.blue(`${pkgName} bundle sizes: 📦`) +
`\n${WHITE_SPACE}` +
readFile.name +
filesOutput.join(`\n${WHITE_SPACE}`)
);
}