1
1
mirror of https://github.com/primer/css.git synced 2024-11-24 13:15:00 +03:00

replace chalk with colorette

This commit is contained in:
Shawn Allen 2018-11-07 15:59:40 -08:00
parent 36ae59c3d4
commit a574addca7
4 changed files with 636 additions and 623 deletions

View File

@ -1,4 +1,4 @@
const chalk = require("chalk") const {green, red, bold} = require("colorette")
const fse = require("fs-extra") const fse = require("fs-extra")
const path = require("path") const path = require("path")
const Generator = require("yeoman-generator") const Generator = require("yeoman-generator")
@ -37,7 +37,7 @@ module.exports = class PrimerModule extends Generator {
if (this.options.module) { if (this.options.module) {
this.log( this.log(
"Okay, let's get you started with %s...", "Okay, let's get you started with %s...",
chalk.green(this.options.module) green(this.options.module)
) )
} }
@ -79,7 +79,7 @@ module.exports = class PrimerModule extends Generator {
} }
writing() { writing() {
this.log("creating: %s", chalk.green(this.basePath)) this.log("creating: %s", green(this.basePath))
const data = { const data = {
"dependencies": this.dependencies, "dependencies": this.dependencies,
@ -99,7 +99,7 @@ module.exports = class PrimerModule extends Generator {
const debugData = Object.assign({}, data, { const debugData = Object.assign({}, data, {
"dependencies": Object.keys(data.dependencies), "dependencies": Object.keys(data.dependencies),
}) })
console.warn(chalk.green("data:"), JSON.stringify(debugData, null, " ")) console.warn(green("data:"), JSON.stringify(debugData, null, " "))
} }
// for the index.scss import // for the index.scss import
@ -130,7 +130,7 @@ module.exports = class PrimerModule extends Generator {
this._addAsDependencyTo(pkg, dependent) this._addAsDependencyTo(pkg, dependent)
}) })
} else { } else {
this.log(chalk.red("No dependents!"), dependents) this.log(red("No dependents!"), dependents)
} }
} }
@ -138,7 +138,7 @@ module.exports = class PrimerModule extends Generator {
if (this.options.todo === true) { if (this.options.todo === true) {
this.log( this.log(
"\n📝 ", "\n📝 ",
chalk.bold("Remember to fill in any remaining TODOs below:"), bold("Remember to fill in any remaining TODOs below:"),
"\n" "\n"
) )
this.spawnCommandSync("ack", ["TODO", this.basePath], { this.spawnCommandSync("ack", ["TODO", this.basePath], {

View File

@ -1,4 +1,4 @@
const chalk = require("chalk") const {yellow} = require("chalk")
const fse = require("fs-extra") const fse = require("fs-extra")
const capitalize = require("./lib/capitalize") const capitalize = require("./lib/capitalize")
@ -91,7 +91,7 @@ module.exports = {
prompt: { prompt: {
message: [ message: [
"Describe your module in a single sentence.", "Describe your module in a single sentence.",
chalk.yellow("(This will go into the package.json and README.md.)"), yellow("(This will go into the package.json and README.md.)"),
].join("\n"), ].join("\n"),
type: "input", type: "input",
default: "TODO: fill in this description later", default: "TODO: fill in this description later",
@ -160,7 +160,7 @@ module.exports = {
type: "input", type: "input",
message: [ message: [
"Where can we find the docs?", "Where can we find the docs?",
chalk.yellow("(We'll read this file from the path you provide.)"), yellow("(We'll read this file from the path you provide.)"),
].join("\n"), ].join("\n"),
validate: (filePath) => { validate: (filePath) => {
if (!filePath) { if (!filePath) {

File diff suppressed because it is too large Load Diff

View File

@ -16,7 +16,7 @@
"watch": "npm run test -- --watch" "watch": "npm run test -- --watch"
}, },
"dependencies": { "dependencies": {
"chalk": "^2.1.0", "colorette": "1.0.7",
"primer-support": "4.6.1", "primer-support": "4.6.1",
"yeoman-generator": "^1.1.1" "yeoman-generator": "^1.1.1"
}, },