mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-23 11:34:44 -07:00
Rationalize different Extension typings (#10435)
This commit is contained in:
@@ -5,16 +5,14 @@
|
||||
*/
|
||||
|
||||
import { Box, Text, useInput } from 'ink';
|
||||
import {
|
||||
type Extension,
|
||||
performWorkspaceExtensionMigration,
|
||||
} from '../../config/extension.js';
|
||||
import type { GeminiCLIExtension } from '@google/gemini-cli-core';
|
||||
import { performWorkspaceExtensionMigration } from '../../config/extension.js';
|
||||
import { RadioButtonSelect } from './shared/RadioButtonSelect.js';
|
||||
import { theme } from '../semantic-colors.js';
|
||||
import { useState } from 'react';
|
||||
|
||||
export function WorkspaceMigrationDialog(props: {
|
||||
workspaceExtensions: Extension[];
|
||||
workspaceExtensions: GeminiCLIExtension[];
|
||||
onOpen: () => void;
|
||||
onClose: () => void;
|
||||
}) {
|
||||
@@ -92,7 +90,7 @@ export function WorkspaceMigrationDialog(props: {
|
||||
|
||||
<Box flexDirection="column" marginTop={1} marginLeft={2}>
|
||||
{workspaceExtensions.map((extension) => (
|
||||
<Text key={extension.config.name}>- {extension.config.name}</Text>
|
||||
<Text key={extension.name}>- {extension.name}</Text>
|
||||
))}
|
||||
</Box>
|
||||
<Box marginTop={1}>
|
||||
|
||||
@@ -70,6 +70,7 @@ describe('useExtensionUpdates', () => {
|
||||
source: 'https://some/repo',
|
||||
autoUpdate: false,
|
||||
},
|
||||
contextFiles: [],
|
||||
},
|
||||
];
|
||||
const addItem = vi.fn();
|
||||
@@ -262,6 +263,7 @@ describe('useExtensionUpdates', () => {
|
||||
source: 'https://some/repo1',
|
||||
autoUpdate: false,
|
||||
},
|
||||
contextFiles: [],
|
||||
},
|
||||
{
|
||||
name: 'test-extension-2',
|
||||
@@ -274,6 +276,7 @@ describe('useExtensionUpdates', () => {
|
||||
source: 'https://some/repo2',
|
||||
autoUpdate: false,
|
||||
},
|
||||
contextFiles: [],
|
||||
},
|
||||
];
|
||||
const addItem = vi.fn();
|
||||
|
||||
@@ -5,19 +5,17 @@
|
||||
*/
|
||||
|
||||
import { useState, useEffect } from 'react';
|
||||
import {
|
||||
type Extension,
|
||||
getWorkspaceExtensions,
|
||||
} from '../../config/extension.js';
|
||||
import type { GeminiCLIExtension } from '@google/gemini-cli-core';
|
||||
import { getWorkspaceExtensions } from '../../config/extension.js';
|
||||
import { type LoadedSettings, SettingScope } from '../../config/settings.js';
|
||||
import process from 'node:process';
|
||||
|
||||
export function useWorkspaceMigration(settings: LoadedSettings) {
|
||||
const [showWorkspaceMigrationDialog, setShowWorkspaceMigrationDialog] =
|
||||
useState(false);
|
||||
const [workspaceExtensions, setWorkspaceExtensions] = useState<Extension[]>(
|
||||
[],
|
||||
);
|
||||
const [workspaceExtensions, setWorkspaceExtensions] = useState<
|
||||
GeminiCLIExtension[]
|
||||
>([]);
|
||||
|
||||
useEffect(() => {
|
||||
// Default to true if not set.
|
||||
|
||||
Reference in New Issue
Block a user