Skip to content

Commit

Permalink
refactor: remove syntax highlighting for now
Browse files Browse the repository at this point in the history
Since it bring some heavy dependency in the core. Let's keep that for later
  • Loading branch information
Julien-R44 committed Jul 3, 2023
1 parent c2c05ad commit 4631277
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 70 deletions.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@
},
"dependencies": {
"@poppinss/colors": "4.1.0-2",
"emphasize": "^6.0.0",
"pretty-repl": "^4.0.0",
"string-width": "^6.1.0"
},
"author": "virk,julien-r44,adonisjs",
Expand Down
62 changes: 0 additions & 62 deletions src/colorizer.ts

This file was deleted.

8 changes: 2 additions & 6 deletions src/repl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@
*/

import useColors from '@poppinss/colors'
import { REPLServer, Recoverable } from 'node:repl'
import prettyRepl from 'pretty-repl'
import { REPLServer, Recoverable, start as startRepl } from 'node:repl'
import stringWidth from 'string-width'
import { inspect, promisify as utilPromisify } from 'node:util'
import { colorizer } from './colorizer.js'
import { Handler, ContextOptions, Compiler } from './types.js'

/**
Expand Down Expand Up @@ -348,14 +346,12 @@ export class Repl {
start() {
this.#printWelcomeMessage()

this.server = prettyRepl.start({
this.server = startRepl({
prompt: '> ',
input: process.stdin,
output: process.stdout,
terminal: process.stdout.isTTY && !Number.parseInt(process.env.NODE_NO_READLINE!, 10),
useGlobal: true,
// @ts-ignore
colorize: colorizer(),
})

/**
Expand Down

0 comments on commit 4631277

Please # to comment.