How to use the ansi-colors.bgBlue function in ansi-colors

To help you get started, we’ve selected a few ansi-colors examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pnp / pnpjs / tools / buildsystem / src / builder.ts View on Github external
export async function builder(version: string, config: BuildSchema): Promise {

    // log we are starting the shared build tasks
    log(`${colors.bgBlue(" ")} Beginning shared build tasks.`);

    try {

        // run global tasks
        await Promise.all(config.tasks.map(task => task(version, config)));

        log(`${colors.bgGreen(" ")} Finished shared build tasks.`);

    } catch (e) {

        log(`${colors.bgRed(" ")} ${colors.bold(colors.red(`Error in shared build tasks.`))}.`);
        log(`${colors.bgRed(" ")} ${colors.bold(colors.red("Error:"))} ${colors.bold(colors.white(typeof e === "string" ? e : JSON.stringify(e)))}`);
        throw e;
    }

    // run the per package tasks
github pnp / pnpjs / tools / buildsystem / src / builder.ts View on Github external
// establish the context that will be passed through all the build pipeline functions
        const buildContext: BuildContext = {
            assets: pkg.assets || config.assets,
            name: pkg.name,
            projectFile: projectFile,
            projectFolder: projectFolder,
            targetFolder: path.join(projectFolder, tsconfigObj.compilerOptions.outDir),
            tsconfigObj: tsconfigObj,
            version: version,
        };

        // select the correct build pipeline
        const activeBuildPipeline = pkg.buildPipeline || config.buildPipeline;

        // log we have added the file
        log(`${colors.bgBlue(" ")} Adding ${colors.cyan(buildContext.projectFile)} to the build pipeline.`);

        return activeBuildPipeline.reduce((subPipe, func) => subPipe.then(() => func(buildContext)), pipe).then(_ => {

            log(`${colors.bgGreen(" ")} Built ${colors.cyan(buildContext.projectFile)}.`);

        }).catch(e => {

            log(`${colors.bgRed(" ")} ${colors.bold(colors.red(`Error building `))} ${colors.bold(colors.cyan(buildContext.projectFile))}.`);
            log(`${colors.bgRed(" ")} ${colors.bold(colors.red("Error:"))} ${colors.bold(colors.white(typeof e === "string" ? e : JSON.stringify(e)))}`);
        });

    }, Promise.resolve());
}
github pnp / pnpjs / tools / buildsystem / src / tasks / publish / publish-beta-package.ts View on Github external
promises.push(new Promise((resolve, reject) => {

            const packagePath = path.resolve(publishRoot, packageFolders[i]);

            log(`${colors.bgBlue(" ")} Publishing BETA ${packagePath}`);

            exec("npm publish --tag beta --access public",
                {
                    cwd: path.resolve(publishRoot, packageFolders[i]),
                }, (error, stdout, stderr) => {

                    if (error === null) {
                        log(`${colors.bgGreen(" ")} Published BETA ${packagePath}`);
                        resolve();
                    } else {
                        console.error(error);
                        reject(stdout);
                    }
                });
        }));
    }
github pnp / pnpjs / tools / buildsystem / src / tasks / publish / publish-package.ts View on Github external
promises.push(new Promise((resolve, reject) => {

            const packagePath = path.resolve(publishRoot, packageFolders[i]);

            log(`${colors.bgBlue(" ")} Publishing ${packagePath}`);

            exec("npm publish --access public",
                {
                    cwd: path.resolve(publishRoot, packageFolders[i]),
                }, (error, stdout, stderr) => {

                    if (error === null) {
                        log(`${colors.bgGreen(" ")} Published ${packagePath}`);
                        resolve();
                    } else {
                        console.error(error);
                        reject(error);
                    }
                });
        }));
    }
github pnp / pnpjs / tools / gulptasks / serve.js View on Github external
new server(webpack(config), serverSettings).listen(8080, "localhost", (err) => {

        if (err) {
            return done(new gutil.PluginError("serve", err));
        }

        log("File will be served from:", colors.bgBlue(colors.white("https://localhost:8080/assets/pnp.js")));
    });
});
github pnp / pnpjs / tools / gulptasks / clean.js View on Github external
gulp.task('clean', (done) => {

    if (yargs.noclean || yargs.nc) {
        log(`${colors.bgWhite(" ")} Skipping clean due to flag.`);
        return done();
    }

    const directories = [
        "./dist",
        "./serve",
        "./site",
    ];

    log(`${colors.bgBlue(" ")} Cleaning directories: ${directories.join(", ")}.`);
    del(directories).then(() => {
        log(`${colors.bgGreen(" ")} Cleaned directories: ${directories.join(", ")}.`);
        done();
    }).catch(e => {
        log(`${colors.bgRed(" ")} Error cleaning directories: ${directories.join(", ")}.`);
        done(e);
    });
});
github pnp / pnpjs / tools / buildsystem / src / packager.ts View on Github external
async function runTasks(name: string, version: string, tasks: PackageTask[], config: PackageSchema): Promise {

    log(`${colors.bgBlue(" ")} Beginning (${tasks.length}) ${name} tasks.`);
    for (let i = 0; i < tasks.length; i++) {

        const task = tasks[i];
        if (typeof task === "undefined" || task === null) {
            continue;
        }

        if (typeof task === "function") {
            await task(version, config);
        } else {
            await task.task(version, config, task.packages);
        }
    }
    log(`${colors.bgGreen(" ")} Finished ${name} tasks.`);
}
github pnp / pnpjs / tools / buildsystem / src / publisher.ts View on Github external
async function runTasks(name: string, version: string, tasks: PublishTask[], config: PublishSchema): Promise {

    log(`${colors.bgBlue(" ")} Beginning (${tasks.length}) ${name} tasks.`);
    for (let i = 0; i < tasks.length; i++) {

        const task = tasks[i];
        if (typeof task === "undefined" || task === null) {
            continue;
        }

        if (typeof task === "function") {
            await task(version, config);
        } else {
            await task.task(version, config, task.packages);
        }
    }
    log(`${colors.bgGreen(" ")} Finished ${name} tasks.`);
}

ansi-colors

Easily add ANSI colors to your text and symbols in the terminal. A faster drop-in replacement for chalk, kleur and turbocolor (without the dependencies and rendering bugs).

MIT
Latest version published 3 years ago

Package Health Score

74 / 100
Full package analysis