From ab95442de11fadad88ed27be74668225de29afde Mon Sep 17 00:00:00 2001 From: p-sw Date: Sat, 15 Jun 2024 03:40:52 +0900 Subject: [PATCH] fix(cli): replace old getAvailableComponentNames to Object.keys --- packages/cli/src/commands/add.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/commands/add.tsx b/packages/cli/src/commands/add.tsx index 6b146d0..4e9ea89 100644 --- a/packages/cli/src/commands/add.tsx +++ b/packages/cli/src/commands/add.tsx @@ -3,7 +3,7 @@ import {loadConfig, validateConfig} from '../helpers/config.js' import {existsSync} from 'node:fs' import {mkdir, writeFile} from 'node:fs/promises' import {join} from 'node:path' -import {getAvailableComponentNames, getComponentURL, getRegistry} from '../helpers/registry.js' +import {getComponentURL, getDirComponentURL, getRegistry} from '../helpers/registry.js' import ora from 'ora' import React, {ComponentPropsWithoutRef} from 'react' import {render, Box} from 'ink' @@ -119,7 +119,7 @@ export default class Add extends Command { return } const registry = unsafeRegistry.registry - const componentNames = await getAvailableComponentNames(registry) + const componentNames = Object.keys(registry.components) loadRegistryOra.succeed(`Successfully fetched registry! (${componentNames.length} components)`) const searchBoxComponent: {displayName: string; key: string; installed: boolean}[] = [] for await (const name of componentNames) {