mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-27 08:48:46 +00:00
Initialize spyglass project and load vanilla-mcdoc
This commit is contained in:
@@ -16,6 +16,7 @@ const changesUrl = 'https://raw.githubusercontent.com/misode/technical-changes'
|
||||
const fixesUrl = 'https://raw.githubusercontent.com/misode/mcfixes'
|
||||
const versionDiffUrl = 'https://mcmeta-diff.misode.workers.dev'
|
||||
const whatsNewUrl = 'https://whats-new.misode.workers.dev'
|
||||
const vanillaMcdocUrl = 'https://proxy.misode.workers.dev/mcdoc'
|
||||
|
||||
type McmetaTypes = 'summary' | 'data' | 'data-json' | 'assets' | 'assets-json' | 'registries' | 'atlas'
|
||||
|
||||
@@ -39,6 +40,15 @@ async function validateCache(version: RefInfo) {
|
||||
}
|
||||
}
|
||||
|
||||
export async function fetchVanillaMcdoc() {
|
||||
try {
|
||||
// TODO: enable refresh
|
||||
return cachedFetch(vanillaMcdocUrl, { decode: res => res.arrayBuffer(), refresh: false })
|
||||
} catch (e) {
|
||||
throw new Error(`Error occured while fetching vanilla-mcdoc: ${message(e)}`)
|
||||
}
|
||||
}
|
||||
|
||||
export async function fetchRegistries(versionId: VersionId) {
|
||||
console.debug(`[fetchRegistries] ${versionId}`)
|
||||
const version = config.versions.find(v => v.id === versionId)!
|
||||
@@ -51,7 +61,7 @@ export async function fetchRegistries(versionId: VersionId) {
|
||||
}
|
||||
return result
|
||||
} catch (e) {
|
||||
throw new Error(`Error occurred while fetching registries (2): ${message(e)}`)
|
||||
throw new Error(`Error occurred while fetching registries: ${message(e)}`)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user