@@ -6,7 +6,6 @@ import type {
66import type { FetchError } from 'ofetch'
77import type { ExtendedPackageJson } from '~~/shared/utils/package-analysis'
88import { type RepoRef , parseRepoUrl } from '~~/shared/utils/git-providers'
9- import { type NuxtError , createError , isNuxtError } from 'nuxt/app'
109import { ERROR_CHANGELOG_NOT_FOUND , ERROR_UNGH_API_KEY_EXHAUSTED } from '~~/shared/utils/constants'
1110import { GithubReleaseSchama } from '~~/shared/schemas/changelog/release'
1211import { resolveURL } from 'ufo'
@@ -28,7 +27,7 @@ export async function detectChangelog(pkg: ExtendedPackageJson) {
2827 }
2928
3029 const releases = await checkReleases ( repoRef , pkg . repository . directory )
31- if ( releases && ! isNuxtError ( releases ) ) {
30+ if ( releases && ! isError ( releases ) ) {
3231 return releases
3332 }
3433
@@ -37,7 +36,7 @@ export async function detectChangelog(pkg: ExtendedPackageJson) {
3736 return changelog
3837 }
3938
40- if ( isNuxtError ( releases ) ) {
39+ if ( isError ( releases ) ) {
4140 throw releases
4241 }
4342
@@ -54,7 +53,7 @@ export async function detectChangelog(pkg: ExtendedPackageJson) {
5453async function checkReleases (
5554 ref : RepoRef ,
5655 directory ?: string ,
57- ) : Promise < ChangelogInfo | false | NuxtError > {
56+ ) : Promise < ChangelogInfo | false | Error > {
5857 switch ( ref . provider ) {
5958 case 'github' : {
6059 return checkLatestGithubRelease ( ref , directory )
@@ -72,7 +71,7 @@ const ROOT_ONLY_REGEX = /^\/[^/]+$/
7271function checkLatestGithubRelease (
7372 ref : RepoRef ,
7473 directory ?: string ,
75- ) : Promise < ChangelogInfo | false | NuxtError > {
74+ ) : Promise < ChangelogInfo | false | Error > {
7675 return $fetch ( `https://ungh.cc/repos/${ ref . owner } /${ ref . repo } /releases/latest` )
7776 . then ( r => {
7877 const { release } = v . parse ( v . object ( { release : GithubReleaseSchama } ) , r )
0 commit comments