mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user