Skip to content

Commit

Permalink
fix: fix errors caused by chalk package.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Oct 14, 2023
1 parent 71434a1 commit 6c41d7c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
9 changes: 2 additions & 7 deletions core/src/overrides/printInstructions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import chalk from 'chalk';
import { reactDevUtils } from '../utils/path';
import { getDocsData } from '../plugins/staticDoc';
import { DevServerOptions } from '../utils/conf';
Expand All @@ -18,12 +17,8 @@ export function overridesPrintInstructions(opt: OverridesPrintInstructionsOption
devServerUtils.createCompiler = (option: any) => {
if (opt.docs && !opt.printInstructions) {
const { route } = getDocsData(opt.docs);
option.urls.localUrlForTerminal += `\n ${chalk.bold('Docs Local:')} ${
option.urls?.localUrlForTerminal
}${route}\n`;
option.urls.lanUrlForTerminal += `\n ${chalk.bold('Docs On Your Network:')} ${
option.urls?.lanUrlForTerminal
}${route}\n`;
option.urls.localUrlForTerminal += `\n \\033[1mDocs Local:\\033[0m ${option.urls?.localUrlForTerminal}${route}\n`;
option.urls.lanUrlForTerminal += `\n \\033[1mDocs On Your Network:\\033[0m ${option.urls?.lanUrlForTerminal}${route}\n`;
}
if (opt.docs && opt.printInstructions) {
const docData = getDocsData(opt.docs);
Expand Down
7 changes: 3 additions & 4 deletions packages/react-library/src/checkRequiredFiles.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import path from 'path';
import fs from 'fs';
import chalk from 'chalk';

/**
* Checked `paths.appHtml`, `paths.appIndexJs`
Expand All @@ -21,9 +20,9 @@ export const checkRequiredFiles = (files: string[], isNotCheckHTML = true) => {
if (currentFilePath) {
const dirName = path.dirname(currentFilePath);
const fileName = path.basename(currentFilePath);
console.log(chalk.red('Could not find a required file.'));
console.log(chalk.red(' Name: ') + chalk.cyan(fileName));
console.log(chalk.red(' Searched in: ') + chalk.cyan(dirName));
console.log('\\033[1mCould not find a required file.\\033[0m');
console.log(' \\033[1mName: \\033[0m' + `\\033[36m${fileName}\\033[0m`);
console.log(' \\033[1mSearched in: \\033[0m' + `\\033[36m${dirName}\\033[0m`);
}
return false;
}
Expand Down

0 comments on commit 6c41d7c

Please sign in to comment.