diff options
author | 2023-11-28 15:20:16 -0600 | |
---|---|---|
committer | 2023-11-28 15:20:16 -0600 | |
commit | 54e57fe9d7600c888fc7b0bc3f5dbca5543f36cd (patch) | |
tree | 5e4cfc4fe86172c6499824cb4deec0a88073e090 /packages/upgrade/src/messages.ts | |
parent | 0dc99c9a28fcb6b46db49eefac6afa415875edcb (diff) | |
download | astro-54e57fe9d7600c888fc7b0bc3f5dbca5543f36cd.tar.gz astro-54e57fe9d7600c888fc7b0bc3f5dbca5543f36cd.tar.zst astro-54e57fe9d7600c888fc7b0bc3f5dbca5543f36cd.zip |
fix(upgrade): Remove semver parse (#9213)
Diffstat (limited to 'packages/upgrade/src/messages.ts')
-rw-r--r-- | packages/upgrade/src/messages.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/packages/upgrade/src/messages.ts b/packages/upgrade/src/messages.ts index e159a6f06..ae2ec49eb 100644 --- a/packages/upgrade/src/messages.ts +++ b/packages/upgrade/src/messages.ts @@ -1,7 +1,6 @@ /* eslint no-console: 'off' */ import { color, label, spinner as load } from '@astrojs/cli-kit'; import { align } from '@astrojs/cli-kit/utils'; -import semverParse from 'semver/functions/parse.js'; import terminalLink from 'terminal-link'; import detectPackageManager from 'which-pm-runs'; import type { PackageInfo } from './actions/context.js'; @@ -110,8 +109,8 @@ export const upgrade = async (packageInfo: PackageInfo, text: string) => { const bg = isMajor ? (v: string) => color.bgYellow(color.black(` ${v} `)) : color.green; const style = isMajor ? color.yellow : color.green; const symbol = isMajor ? '▲' : '●'; - const toVersion = semverParse(targetVersion)!; - const version = `v${toVersion.version}`; + const toVersion = targetVersion.replace(/^\D+/, ''); + const version = `v${toVersion}`; const length = 12 + name.length + text.length + version.length; if (length > stdout.columns) { |