feat: add a CDN media-availability manifest and read it across install surfaces (#1737)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Darius Cepulis
2026-06-25 11:20:45 -07:00
committed by GitHub
co-authored by Claude
parent a74b8c0993
commit f1f2129739
20 changed files with 300 additions and 77 deletions
+15 -1
View File
@@ -5,7 +5,13 @@ import type { Framework } from '../utils/config.js';
import { getConfigValue } from '../utils/config.js';
import { docExistsInAnyFramework, readBundledDoc, readLlmsTxt } from '../utils/docs.js';
import { formatInstallationCode } from '../utils/format.js';
import { mapRawSkin, type PartialInstallFlags, promptFramework, promptInstallOptions } from '../utils/prompts.js';
import {
mapRawSkin,
type PartialInstallFlags,
promptFramework,
promptInstallOptions,
supportsCdnInstall,
} from '../utils/prompts.js';
import { replaceMarker, stripOmitMarkers } from '../utils/replace.js';
interface ParsedFlags {
@@ -177,6 +183,14 @@ export async function handleDocs(flags: ParsedFlags, positionals: string[]): Pro
process.exit(1);
}
// The interactive prompt hides CDN for renderers without a CDN build; guard
// the non-interactive flag path so a `--install-method cdn` request for one
// can't emit a broken snippet.
if (opts.installMethod === 'cdn' && !supportsCdnInstall(opts.renderer)) {
console.error('Error: this source type has no CDN build. Install it with npm, pnpm, yarn, or bun.');
process.exit(1);
}
const generated = formatInstallationCode(opts);
const output = stripOmitMarkers(replaceMarker(markdown, 'installation', generated));
printVersionHeader();