Unverified Commit 0aa01792 authored by Sukka's avatar Sukka Committed by GitHub

refactor(dev-overlay): remove `chalk` (#60317)

Per @styfle suggestion, #58038 has been split into multiple PRs for
easier review.

- Remove `chalk` inside `@next/react-dev-overlay`
- `@next/react-dev-overlay` is bundled with Next.js. The usage of
`chalk` inside `@next/react-dev-overlay` was not removed in
https://github.com/vercel/next.js/pull/55992, thus the `chalk` is still
being shipped.

---------
Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
parent 0a34e047
This diff is collapsed.
...@@ -21,9 +21,9 @@ ...@@ -21,9 +21,9 @@
"@babel/code-frame": "7.22.5", "@babel/code-frame": "7.22.5",
"@types/babel__code-frame": "7.0.3", "@types/babel__code-frame": "7.0.3",
"anser": "1.4.9", "anser": "1.4.9",
"chalk": "4.0.0",
"css.escape": "1.5.1", "css.escape": "1.5.1",
"data-uri-to-buffer": "3.0.1", "data-uri-to-buffer": "3.0.1",
"picocolors": "1.0.0",
"platform": "1.3.6", "platform": "1.3.6",
"shell-quote": "1.7.3", "shell-quote": "1.7.3",
"source-map": "0.8.0-beta.0", "source-map": "0.8.0-beta.0",
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * SOFTWARE.
*/ */
import chalk from 'chalk' import pc from 'picocolors'
import child_process from 'child_process' import child_process from 'child_process'
import fs from 'fs' import fs from 'fs'
import os from 'os' import os from 'os'
...@@ -278,22 +278,22 @@ function guessEditor(): string[] { ...@@ -278,22 +278,22 @@ function guessEditor(): string[] {
function printInstructions(fileName: string, errorMessage: string | null) { function printInstructions(fileName: string, errorMessage: string | null) {
console.log() console.log()
console.log( console.log(
chalk.red('Could not open ' + path.basename(fileName) + ' in the editor.') pc.red('Could not open ' + path.basename(fileName) + ' in the editor.')
) )
if (errorMessage) { if (errorMessage) {
if (errorMessage[errorMessage.length - 1] !== '.') { if (errorMessage[errorMessage.length - 1] !== '.') {
errorMessage += '.' errorMessage += '.'
} }
console.log( console.log(
chalk.red('The editor process exited with an error: ' + errorMessage) pc.red('The editor process exited with an error: ' + errorMessage)
) )
} }
console.log() console.log()
console.log( console.log(
'To set up the editor integration, add something like ' + 'To set up the editor integration, add something like ' +
chalk.cyan('REACT_EDITOR=atom') + pc.cyan('REACT_EDITOR=atom') +
' to the ' + ' to the ' +
chalk.green('.env.local') + pc.green('.env.local') +
' file in your project folder ' + ' file in your project folder ' +
'and restart the development server.' 'and restart the development server.'
) )
...@@ -353,7 +353,7 @@ function launchEditor(fileName: string, lineNumber: number, colNumber: number) { ...@@ -353,7 +353,7 @@ function launchEditor(fileName: string, lineNumber: number, colNumber: number) {
) { ) {
console.log() console.log()
console.log( console.log(
chalk.red('Could not open ' + path.basename(fileName) + ' in the editor.') pc.red('Could not open ' + path.basename(fileName) + ' in the editor.')
) )
console.log() console.log()
console.log( console.log(
......
...@@ -1552,15 +1552,15 @@ importers: ...@@ -1552,15 +1552,15 @@ importers:
anser: anser:
specifier: 1.4.9 specifier: 1.4.9
version: 1.4.9 version: 1.4.9
chalk:
specifier: 4.0.0
version: 4.0.0
css.escape: css.escape:
specifier: 1.5.1 specifier: 1.5.1
version: 1.5.1 version: 1.5.1
data-uri-to-buffer: data-uri-to-buffer:
specifier: 3.0.1 specifier: 3.0.1
version: 3.0.1 version: 3.0.1
picocolors:
specifier: 1.0.0
version: 1.0.0
platform: platform:
specifier: 1.3.6 specifier: 1.3.6
version: 1.3.6 version: 1.3.6
...@@ -9257,6 +9257,7 @@ packages: ...@@ -9257,6 +9257,7 @@ packages:
dependencies: dependencies:
ansi-styles: 4.3.0 ansi-styles: 4.3.0
supports-color: 7.2.0 supports-color: 7.2.0
dev: true
/chalk@4.1.2: /chalk@4.1.2:
resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment