Skip to content

Commit

Permalink
Merge pull request #611 from oclif/mdonnalley/core-v4
Browse files Browse the repository at this point in the history
feat: use @oclif/core v4
  • Loading branch information
iowillhoit authored May 31, 2024
2 parents 99b9e8d + 2465305 commit b16ec91
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"author": "Salesforce",
"bugs": "https://github.com/oclif/plugin-warn-if-update-available/issues",
"dependencies": {
"@oclif/core": "^3.26.6",
"chalk": "^5.3.0",
"@oclif/core": "^4.0.0-beat.13",
"ansis": "^3.2.0",
"debug": "^4.1.0",
"http-call": "^5.2.2",
"lodash": "^4.17.21"
Expand Down
8 changes: 6 additions & 2 deletions src/hooks/init/check-update.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
/* eslint-disable valid-jsdoc */
import {Hook, Interfaces} from '@oclif/core'
import chalk from 'chalk'
import {Ansis} from 'ansis'
import makeDebug from 'debug'
import {spawn} from 'node:child_process'
import {readFile, stat, writeFile} from 'node:fs/promises'
import {dirname, join, resolve} from 'node:path'
import {fileURLToPath} from 'node:url'

const ansis = new Ansis()

async function readJSON<T>(file: string): Promise<T> {
return JSON.parse(await readFile(file, 'utf8')) as T
}
Expand Down Expand Up @@ -172,7 +174,9 @@ const hook: Hook.Init = async function ({config}) {
])
this.warn(
lodash.template(message)({
chalk,
ansis,
// chalk and ansis have the same api. Keeping chalk for backwards compatibility.
chalk: ansis,
config,
latest: newerVersion,
}),
Expand Down
33 changes: 33 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1451,6 +1451,29 @@
wordwrap "^1.0.0"
wrap-ansi "^7.0.0"

"@oclif/core@^4.0.0-beat.13":
version "4.0.0-beta.13"
resolved "https://registry.yarnpkg.com/@oclif/core/-/core-4.0.0-beta.13.tgz#0e0a6431cfe612db77073d2f9ef361f14e4090b8"
integrity sha512-ug8CZUCJphgetSZVgd4HQgyewlYVGGG1LIeFXGxjgYsjZ/f5I3nSCj7xpAMEDqjVD/lwmSujtVwa7tvEgLGICw==
dependencies:
ansi-escapes "^4.3.2"
ansis "^3.0.1"
clean-stack "^3.0.1"
cli-spinners "^2.9.2"
cosmiconfig "^9.0.0"
debug "^4.3.4"
ejs "^3.1.10"
get-package-type "^0.1.0"
globby "^11.1.0"
indent-string "^4.0.0"
is-wsl "^2.2.0"
minimatch "^9.0.4"
string-width "^4.2.3"
supports-color "^9.4.0"
widest-line "^3.1.0"
wordwrap "^1.0.0"
wrap-ansi "^7.0.0"

"@oclif/plugin-help@^6.0.21":
version "6.0.21"
resolved "https://registry.yarnpkg.com/@oclif/plugin-help/-/plugin-help-6.0.21.tgz#c48e688bf6df574e74557ebe2f877556f08dc60b"
Expand Down Expand Up @@ -2756,6 +2779,11 @@ ansicolors@~0.3.2:
resolved "https://registry.yarnpkg.com/ansicolors/-/ansicolors-0.3.2.tgz#665597de86a9ffe3aa9bfbe6cae5c6ea426b4979"
integrity sha1-ZlWX3oap/+Oqm/vmyuXG6kJrSXk=

ansis@^3.0.1, ansis@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/ansis/-/ansis-3.2.0.tgz#0e050c5be94784f32ffdac4b84fccba064aeae4b"
integrity sha512-Yk3BkHH9U7oPyCN3gL5Tc7CpahG/+UFv/6UG03C311Vy9lzRmA5uoxDTpU9CO3rGHL6KzJz/pdDeXZCZ5Mu/Sg==

anymatch@~3.1.2:
version "3.1.3"
resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e"
Expand Down Expand Up @@ -5996,6 +6024,11 @@ supports-color@^7, supports-color@^7.0.0, supports-color@^7.1.0:
dependencies:
has-flag "^4.0.0"

supports-color@^9.4.0:
version "9.4.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-9.4.0.tgz#17bfcf686288f531db3dea3215510621ccb55954"
integrity sha512-VL+lNrEoIXww1coLPOmiEmK/0sGigko5COxI09KzHc2VJXJsQ37UaQ+8quuxjDeA7+KnLGTWRyOXSLLR2Wb4jw==

supports-hyperlinks@^2.2.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/supports-hyperlinks/-/supports-hyperlinks-2.3.0.tgz#3943544347c1ff90b15effb03fc14ae45ec10624"
Expand Down

0 comments on commit b16ec91

Please sign in to comment.