Skip to content

Commit

Permalink
Merge branch 'main' into mdonnalley/test-v4
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed May 20, 2024
2 parents c4cde20 + 315d165 commit 5da1f54
Show file tree
Hide file tree
Showing 5 changed files with 288 additions and 450 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [3.1.10](https://github.com/oclif/plugin-not-found/compare/3.1.9...3.1.10) (2024-05-19)

### Bug Fixes

- **deps:** bump @inquirer/confirm from 3.1.6 to 3.1.8 ([#628](https://github.com/oclif/plugin-not-found/issues/628)) ([777d85c](https://github.com/oclif/plugin-not-found/commit/777d85c09792307c69c68dcaa1c9d756fba18587))

## [3.1.9](https://github.com/oclif/plugin-not-found/compare/3.1.8...3.1.9) (2024-05-13)

### Bug Fixes
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"name": "@oclif/plugin-not-found",
"description": "\"did you mean\" for oclif",
"version": "3.1.9",
"version": "3.1.10",
"author": "Salesforce",
"bugs": "https://github.com/oclif/plugin-not-found/issues",
"dependencies": {
"@inquirer/confirm": "^3.1.6",
"@inquirer/confirm": "^3.1.8",
"@oclif/core": "^3.26.5",
"chalk": "^5.3.0",
"ansis": "^3.2.0",
"fast-levenshtein": "^3.0.0"
},
"devDependencies": {
"@commitlint/config-conventional": "^18",
"@commitlint/config-conventional": "^19",
"@oclif/plugin-commands": "^3.3.3",
"@oclif/plugin-help": "^6",
"@oclif/prettier-config": "^0.2.1",
Expand All @@ -22,15 +22,15 @@
"@types/node": "^18",
"@types/sinon": "^17.0.3",
"chai": "^4.4.1",
"commitlint": "^18",
"commitlint": "^19",
"eslint": "^8.57.0",
"eslint-config-oclif": "^5.2.0",
"eslint-config-oclif-typescript": "^3.1.7",
"eslint-config-prettier": "^9.1.0",
"husky": "^9",
"lint-staged": "^15",
"mocha": "^10.4.0",
"oclif": "^4.10.9",
"oclif": "^4.10.11",
"prettier": "^3.2.5",
"shx": "^0.3.4",
"sinon": "^18.0.0",
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Hook, toConfiguredId} from '@oclif/core'
import chalk from 'chalk'
import {cyan, yellow} from 'ansis'

import utils from './utils.js'

Expand All @@ -26,7 +26,7 @@ const hook: Hook.CommandNotFound = async function (opts) {

const readableSuggestion = toConfiguredId(suggestion, this.config)
const originalCmd = toConfiguredId(opts.id, this.config)
this.warn(`${chalk.yellow(originalCmd)} is not a ${opts.config.bin} command.`)
this.warn(`${yellow(originalCmd)} is not a ${opts.config.bin} command.`)

const response = await utils.getConfirmation(readableSuggestion).catch(() => false)

Expand All @@ -46,7 +46,7 @@ const hook: Hook.CommandNotFound = async function (opts) {
return this.config.runCommand(suggestion, argv)
}

this.error(`Run ${chalk.bold.cyan(binHelp)} for a list of available commands.`, {exit: 127})
this.error(`Run ${cyan.bold(binHelp)} for a list of available commands.`, {exit: 127})
}

export default hook
6 changes: 3 additions & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import confirm from '@inquirer/confirm'
import chalk from 'chalk'
import {blueBright, reset} from 'ansis'
import {default as levenshtein} from 'fast-levenshtein'
import {setTimeout} from 'node:timers/promises'

Expand All @@ -8,11 +8,11 @@ const getConfirmation = async (suggestion: string): Promise<boolean> => {
const {signal} = ac
const confirmation = confirm({
default: true,
message: `Did you mean ${chalk.blueBright(suggestion)}?`,
message: `Did you mean ${blueBright(suggestion)}?`,
theme: {
prefix: '',
style: {
message: (text: string) => chalk.reset(text),
message: (text: string) => reset(text),
},
},
})
Expand Down
Loading

0 comments on commit 5da1f54

Please sign in to comment.