silverwolf-x/project / packages /next /src /server /dev /hot-reloader-shared-utils.ts
silverwolf-x's picture
download
raw
884 Bytes
import { getPathMatch } from '../../shared/lib/router/utils/path-match'
import { parseVersionInfo, type VersionInfo } from './parse-version-info'
export const matchNextPageBundleRequest = getPathMatch(
'/_next/static/chunks/pages/:path*.js(\\.map|)'
)
export async function getVersionInfo(): Promise<VersionInfo> {
let installed = '0.0.0'
try {
installed = require('next/package.json').version
let res
try {
// use NPM registry regardless user using Yarn
res = await fetch('https://registry.npmjs.org/-/package/next/dist-tags')
} catch {
// ignore fetch errors
}
if (!res || !res.ok) return { installed, staleness: 'unknown' }
const { latest, canary } = await res.json()
return parseVersionInfo({ installed, latest, canary })
} catch (e: any) {
console.error(e)
return { installed, staleness: 'unknown' }
}
}

Xet Storage Details

Size:
884 Bytes
·
Xet hash:
b413ca18d9343533f18df5295d7290b820a106696802550765a5d8eda0162136

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.