Skip to content

Commit

Permalink
fix: remove boxen dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jun 19, 2023
1 parent 0011a96 commit e9c9b49
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 104 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nuxi-ng",
"version": "0.3.5",
"version": "0.0.1",
"repository": "nuxt/nuxt",
"license": "MIT",
"type": "module",
Expand Down Expand Up @@ -41,7 +41,6 @@
"@types/mri": "^1.1.1",
"@types/node": "^20.3.1",
"@types/semver": "^7.5.0",
"boxen": "^7.1.0",
"c12": "^1.4.1",
"changelogen": "^0.5.3",
"chokidar": "^3.5.3",
Expand Down
83 changes: 0 additions & 83 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 10 additions & 19 deletions src/utils/update.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { name as pkgName, version as currentVersion } from '../../package.json'
import { $fetch } from 'ofetch'
import { cyan, green, yellow, underline } from 'colorette'
import boxen from 'boxen'
import { cyan, green, yellow, underline, gray } from 'colorette'
import * as semver from 'semver'

export async function checkForUpdates() {
Expand All @@ -15,25 +14,17 @@ export async function checkForUpdates() {
return
}
if (semver.gt(latestVersion, currentVersion, { loose: true })) {
const changelogVersionHash = 'v' + latestVersion.replace(/\./g, '')
const changelogURL = `https://github.com/nuxt/cli/blob/main/CHANGELOG.md#${changelogVersionHash}`
const changelogURL = `https://github.com/nuxt/cli/releases/tag/v${latestVersion}`
console.log(
boxen(
`
A new version of Nuxt CLI is available: ${green(latestVersion)}
You are currently using ${yellow(currentVersion)}
Changelog: ${underline(cyan(changelogURL))}
`
${gray(' --------------------------------------------------------------')}
A new version of Nuxt CLI is available: ${green(latestVersion)}
You are currently using ${yellow(currentVersion)}
Release notes: ${underline(cyan(changelogURL))}
To update: ${cyan(`npm install -g ${pkgName}`)}
`.trim(),
{
padding: 1,
margin: 1,
borderStyle: 'round',
title: 'CLI Update Available',
borderColor: 'yellow',
}
)
To update: ${cyan(`npm install -g ${pkgName}`)}
${gray(' --------------------------------------------------------------')}
`.trim() + '\n'
)
}
}

0 comments on commit e9c9b49

Please sign in to comment.