mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-26 06:31:49 +00:00
CLI: improve for Sanity registry
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@fumadocs/cli': patch
|
||||
---
|
||||
|
||||
Improve for Sanity registry
|
||||
@@ -124,8 +124,8 @@ export const registry: Registry = {
|
||||
},
|
||||
{
|
||||
name: 'ai/openrouter',
|
||||
title: 'AI Chat (Next.js + OpenRouter)',
|
||||
description: 'Ask AI dialog for your docs, requires OPENROUTER_API_KEY',
|
||||
title: 'AI Chat (AI SDK)',
|
||||
description: 'Ask AI dialog for your docs, default using OpenRouter',
|
||||
files: [
|
||||
{
|
||||
type: 'components',
|
||||
@@ -154,7 +154,7 @@ export const registry: Registry = {
|
||||
},
|
||||
{
|
||||
name: 'ai/inkeep',
|
||||
title: 'AI Chat (Next.js + Inkeep AI)',
|
||||
title: 'AI Chat (Inkeep AI)',
|
||||
description: 'Ask AI dialog for your docs, requires Inkeep AI',
|
||||
files: [
|
||||
{
|
||||
@@ -176,7 +176,7 @@ export const registry: Registry = {
|
||||
},
|
||||
{
|
||||
name: 'og/mono',
|
||||
description: 'Open graph image generation (mono-style)',
|
||||
description: 'Open graph image generation - mono style',
|
||||
files: [
|
||||
{
|
||||
type: 'lib',
|
||||
|
||||
@@ -328,7 +328,6 @@ export const registry: Registry = {
|
||||
},
|
||||
{
|
||||
name: 'ai/page-actions',
|
||||
title: 'Page Actions',
|
||||
description: 'Common page actions',
|
||||
files: [
|
||||
{
|
||||
|
||||
@@ -25,11 +25,11 @@ export async function add(input: string[], connector: RegistryConnector, config:
|
||||
const spin = spinner();
|
||||
spin.start('fetching registry');
|
||||
|
||||
async function scan(subRegistry?: string): Promise<AddOption[]> {
|
||||
async function scan(subRegistry?: string, prefix?: string): Promise<AddOption[]> {
|
||||
const info = await connector.fetchRegistryInfo(subRegistry);
|
||||
|
||||
return info.indexes.map((item) => ({
|
||||
label: item.title ?? item.name,
|
||||
label: `${prefix ? `${picocolors.bold(prefix)} - ` : ''}${item.title ?? item.name}`,
|
||||
value: { name: item.name, subRegistry },
|
||||
hint: item.description,
|
||||
}));
|
||||
@@ -38,7 +38,11 @@ export async function add(input: string[], connector: RegistryConnector, config:
|
||||
spin.stop(picocolors.bold(picocolors.greenBright('registry fetched')));
|
||||
const value = await autocompleteMultiselect({
|
||||
message: 'Select components to install',
|
||||
options: [...(await scan()), ...(await scan(subRegistry))],
|
||||
options: [
|
||||
...(await scan(undefined, 'common')),
|
||||
...(await scan('fumadocs/sanity', 'sanity')),
|
||||
...(await scan(subRegistry, 'ui')),
|
||||
].sort((a, b) => a.label.localeCompare(b.label)),
|
||||
});
|
||||
|
||||
if (isCancel(value)) {
|
||||
|
||||
@@ -328,7 +328,6 @@ export const registry: Registry = {
|
||||
},
|
||||
{
|
||||
name: 'ai/page-actions',
|
||||
title: 'Page Actions',
|
||||
description: 'Common page actions',
|
||||
files: [
|
||||
{
|
||||
|
||||
@@ -57,7 +57,7 @@ export const registry: Registry = {
|
||||
name: 'all',
|
||||
subComponents: components.map((comp) => ({
|
||||
type: 'sub-registry',
|
||||
subRegistry: 'sanity',
|
||||
subRegistry: 'fumadocs/sanity',
|
||||
component: comp.name,
|
||||
})),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user