fix(kit)!: handle prerelease constraint (#7116)

This commit is contained in:
pooya parsa 2022-08-31 21:18:05 +02:00 committed by GitHub
parent 612580d633
commit 0339a23372
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,8 +11,9 @@ export async function checkNuxtCompatibility (constraints: NuxtCompatibility, nu
// Nuxt version check // Nuxt version check
if (constraints.nuxt) { if (constraints.nuxt) {
const nuxtVersion = getNuxtVersion(nuxt) const nuxtVersion = getNuxtVersion(nuxt)
const nuxtSemanticVersion = nuxtVersion.split('-').shift() const nuxtSemanticVersion = nuxtVersion
if (!satisfies(nuxtSemanticVersion, constraints.nuxt)) { .replace(/-[0-9]+\.[0-9a-f]{7}/, '') // Remove edge prefix
if (!satisfies(nuxtSemanticVersion, constraints.nuxt, { includePrerelease: true })) {
issues.push({ issues.push({
name: 'nuxt', name: 'nuxt',
message: `Nuxt version \`${constraints.nuxt}\` is required but currently using \`${nuxtVersion}\`` message: `Nuxt version \`${constraints.nuxt}\` is required but currently using \`${nuxtVersion}\``