Skip to content

Commit

Permalink
wip: scaffold for upgrading
Browse files Browse the repository at this point in the history
  • Loading branch information
agoose77 committed Jan 6, 2025
1 parent e9aad2d commit a422919
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/myst-cli/src/transforms/crossReferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,17 @@ export async function fetchMystXRefData(session: ISession, node: CrossReference,
const rawData = await fetchMystData(session, dataUrl, node.urlSource, vfile);
let data: MystData | undefined;
if (node.remoteBaseUrl) {
// TODO
const cachePath = mystXRefsCacheFilename(node.remoteBaseUrl);
const mystXRefData = loadFromCache(session, cachePath, {
maxAge: XREF_MAX_AGE,
});
if (!mystXRefData) {
fileWarn(vfile, `Unable to load external MyST reference data: ${node.remoteBaseUrl}`);
} else {
const { version } = JSON.parse(mystXRefData) as { version: string };
console.log(`Loading xref ${node.urlSource} with version ${version}`);
}
data = rawData;
} else {
fileWarn(
vfile,
Expand Down

0 comments on commit a422919

Please sign in to comment.