Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use @oclif/core v4 #611

Merged
merged 1 commit into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -92,7 +94,7 @@
// do not show warning if running `update` command of <CLI>_SKIP_NEW_VERSION_CHECK=true
if (argv[2] === 'update' || config.scopedEnvVarTrue('SKIP_NEW_VERSION_CHECK')) return

// TODO: handle prerelease channels

Check warning on line 97 in src/hooks/init/check-update.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (current)

Unexpected 'todo' comment: 'TODO: handle prerelease channels'

Check warning on line 97 in src/hooks/init/check-update.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (lts/*)

Unexpected 'todo' comment: 'TODO: handle prerelease channels'

Check warning on line 97 in src/hooks/init/check-update.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (lts/-1)

Unexpected 'todo' comment: 'TODO: handle prerelease channels'

Check warning on line 97 in src/hooks/init/check-update.ts

View workflow job for this annotation

GitHub Actions / windows-unit-tests / windows-unit-tests (current)

Unexpected 'todo' comment: 'TODO: handle prerelease channels'

Check warning on line 97 in src/hooks/init/check-update.ts

View workflow job for this annotation

GitHub Actions / windows-unit-tests / windows-unit-tests (lts/*)

Unexpected 'todo' comment: 'TODO: handle prerelease channels'

Check warning on line 97 in src/hooks/init/check-update.ts

View workflow job for this annotation

GitHub Actions / windows-unit-tests / windows-unit-tests (lts/-1)

Unexpected 'todo' comment: 'TODO: handle prerelease channels'
if (config.version.includes('-')) return

const {frequency, frequencyUnit} = config.pjson.oclif['warn-if-update-available'] ?? {}
Expand Down Expand Up @@ -172,7 +174,9 @@
])
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
Loading