diff --git a/package-lock.json b/package-lock.json index 074f28f..379a71e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.5.16", "license": "MIT", "dependencies": { - "@nbtca/docs": "^0.3.2", + "@nbtca/docs": "^0.3.3", "@nbtca/nbtcal": "^0.4.3", "chalk": "^5.6.2", "marked": "^15.0.12" @@ -770,9 +770,9 @@ "license": "MIT" }, "node_modules/@nbtca/docs": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@nbtca/docs/-/docs-0.3.2.tgz", - "integrity": "sha512-4yGM0fjlbZvq/B4hVmrKNpMYnEK9IYrGhTr55bAS+tg2JJdiGRb0czC3rRSBrnNJQjjP5hz9U34HkRIESp0oNQ==", + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@nbtca/docs/-/docs-0.3.3.tgz", + "integrity": "sha512-uXxgas3/ymvJ61bYP4R3sfnB4XYC2LyI4ARAEDRnONF+UJX2RL4nHvyCYY9O/xTNklOO/StcZtEV51VKrEMAyA==", "license": "MIT", "engines": { "node": ">=20.12.0" diff --git a/package.json b/package.json index 95a0b75..3407b91 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "interactive" ], "dependencies": { - "@nbtca/docs": "^0.3.2", + "@nbtca/docs": "^0.3.3", "@nbtca/nbtcal": "^0.4.3", "chalk": "^5.6.2", "marked": "^15.0.12" diff --git a/src/features/docs-client.ts b/src/features/docs-client.ts index 9ad5ca4..8d84a6a 100644 --- a/src/features/docs-client.ts +++ b/src/features/docs-client.ts @@ -1,6 +1,7 @@ import { AsyncLocalStorage } from 'node:async_hooks'; import { createDocsClient, parseDoc } from '@nbtca/docs'; import type { DocItem, DocPage, DocsClient } from '@nbtca/docs'; +import { URLS } from '../config/data.js'; import { createDocsStore } from './docs-store.js'; interface DocsFetchStore { @@ -181,7 +182,8 @@ function beginDocsFetch(): { context: DocsFetchContext; finish(): void } { } const store = createDocsStore(); -const defaultClient = createDocsClient({ store }); +const options = { store, mirror: `${URLS.docs}/docs-api` }; +const defaultClient = createDocsClient(options); const clientsBySignal = new WeakMap(); const clients = new Set([defaultClient]); @@ -190,7 +192,7 @@ function clientFor(signal: AbortSignal | undefined): DocsClient { const existing = clientsBySignal.get(signal); if (existing) return existing; - const client = createDocsClient({ store }); + const client = createDocsClient(options); clientsBySignal.set(signal, client); clients.add(client); signal.addEventListener(