Skip to content

Commit 22d3226

Browse files
committed
feat: use ansis instead of chalk
1 parent b14f4a9 commit 22d3226

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"bugs": "https://github.com/oclif/plugin-autocomplete/issues",
77
"dependencies": {
88
"@oclif/core": "^4.0.0-beta.13",
9-
"chalk": "^5.3.0",
9+
"ansis": "^3.2.0",
1010
"debug": "^4.3.4",
1111
"ejs": "^3.1.10"
1212
},

src/commands/autocomplete/index.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {Args, Flags, ux} from '@oclif/core'
2-
import chalk from 'chalk'
2+
import {bold, cyan} from 'ansis'
33
import {EOL} from 'node:os'
44

55
import {AutocompleteBase} from '../../base.js'
@@ -38,7 +38,7 @@ export default class Index extends AutocompleteBase {
3838
)
3939
}
4040

41-
ux.action.start(`${chalk.bold('Building the autocomplete cache')}`)
41+
ux.action.start(`${bold('Building the autocomplete cache')}`)
4242
await Create.run([], this.config)
4343
ux.action.stop()
4444

@@ -62,22 +62,22 @@ Setup Instructions for ${this.config.bin.toUpperCase()} CLI Autocomplete ---
6262
instructions += `
6363
1) Run this command in your terminal window:
6464
65-
${chalk.cyan(`printf "eval $(${scriptCommand})" >> ~/.bashrc; source ~/.bashrc`)}
65+
${cyan(`printf "eval $(${scriptCommand})" >> ~/.bashrc; source ~/.bashrc`)}
6666
67-
The previous command adds the ${chalk.cyan(setupEnvVar)} environment variable to your Bash config file and then sources the file.
67+
The previous command adds the ${cyan(setupEnvVar)} environment variable to your Bash config file and then sources the file.
6868
69-
${chalk.bold('NOTE')}: If you’ve configured your terminal to start as a login shell, you may need to modify the command so it updates either the ~/.bash_profile or ~/.profile file. For example:
69+
${bold('NOTE')}: If you’ve configured your terminal to start as a login shell, you may need to modify the command so it updates either the ~/.bash_profile or ~/.profile file. For example:
70+
71+
${cyan(`printf "eval $(${scriptCommand}) >> ~/.bash_profile; source ~/.bash_profile`)}
7072
71-
${chalk.cyan(`printf "eval $(${scriptCommand}) >> ~/.bash_profile; source ~/.bash_profile`)}
72-
7373
Or:
7474
75-
${chalk.cyan(`printf "eval $(${scriptCommand})" >> ~/.profile; source ~/.profile`)}
75+
${cyan(`printf "eval $(${scriptCommand})" >> ~/.profile; source ~/.profile`)}
7676
7777
2) Start using autocomplete:
7878
79-
${chalk.cyan(`${this.config.bin} ${tabStr}`)} # Command completion
80-
${chalk.cyan(`${this.config.bin} command --${tabStr}`)} # Flag completion
79+
${cyan(`${this.config.bin} ${tabStr}`)} # Command completion
80+
${cyan(`${this.config.bin} command --${tabStr}`)} # Flag completion
8181
`
8282
break
8383
}
@@ -86,18 +86,18 @@ Setup Instructions for ${this.config.bin.toUpperCase()} CLI Autocomplete ---
8686
instructions += `
8787
1) Run this command in your terminal window:
8888
89-
${chalk.cyan(`printf "eval $(${scriptCommand})" >> ~/.zshrc; source ~/.zshrc`)}
89+
${cyan(`printf "eval $(${scriptCommand})" >> ~/.zshrc; source ~/.zshrc`)}
9090
91-
The previous command adds the ${chalk.cyan(setupEnvVar)} environment variable to your zsh config file and then sources the file.
91+
The previous command adds the ${cyan(setupEnvVar)} environment variable to your zsh config file and then sources the file.
9292
9393
2) (Optional) Run this command to ensure that you have no permissions conflicts:
9494
95-
${chalk.cyan('compaudit -D')}
95+
${cyan('compaudit -D')}
9696
9797
3) Start using autocomplete:
9898
99-
${chalk.cyan(`${this.config.bin} ${tabStr}`)} # Command completion
100-
${chalk.cyan(`${this.config.bin} command --${tabStr}`)} # Flag completion
99+
${cyan(`${this.config.bin} ${tabStr}`)} # Command completion
100+
${cyan(`${this.config.bin} command --${tabStr}`)} # Flag completion
101101
`
102102
break
103103
}
@@ -106,17 +106,17 @@ Setup Instructions for ${this.config.bin.toUpperCase()} CLI Autocomplete ---
106106
instructions += `
107107
1) Run these two cmdlets in your PowerShell window in the order shown:
108108
109-
${chalk.cyan(`New-Item -Type Directory -Path (Split-Path -Parent $PROFILE) -ErrorAction SilentlyContinue
109+
${cyan(`New-Item -Type Directory -Path (Split-Path -Parent $PROFILE) -ErrorAction SilentlyContinue
110110
Add-Content -Path $PROFILE -Value (Invoke-Expression -Command "${scriptCommand}"); .$PROFILE`)}
111111
112112
2) (Optional) If you want matching completions printed below the command line, run this cmdlet:
113113
114-
${chalk.cyan('Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete')}
114+
${cyan('Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete')}
115115
116116
3) Start using autocomplete:
117117
118-
${chalk.cyan(`${this.config.bin} ${tabStr}`)} # Command completion
119-
${chalk.cyan(`${this.config.bin} command --${tabStr}`)} # Flag completion
118+
${cyan(`${this.config.bin} ${tabStr}`)} # Command completion
119+
${cyan(`${this.config.bin} command --${tabStr}`)} # Flag completion
120120
`
121121
break
122122
}

0 commit comments

Comments
 (0)