mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 08:47:44 +00:00
fix: prepublish changes to package names (#1420)
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
import { describe, it, expect, vi, beforeEach, afterEach, Mock } from 'vitest';
|
||||
import type { Mocked } from 'vitest';
|
||||
import { handleAtCommand } from './atCommandProcessor.js';
|
||||
import { Config, FileDiscoveryService } from '@gemini-cli/core';
|
||||
import { Config, FileDiscoveryService } from '@google/gemini-cli-core';
|
||||
import { ToolCallStatus } from '../types.js';
|
||||
import { UseHistoryManagerReturn } from './useHistoryManager.js';
|
||||
import * as fsPromises from 'fs/promises';
|
||||
@@ -52,8 +52,8 @@ vi.mock('fs/promises', async () => {
|
||||
};
|
||||
});
|
||||
|
||||
vi.mock('@gemini-cli/core', async () => {
|
||||
const actual = await vi.importActual('@gemini-cli/core');
|
||||
vi.mock('@google/gemini-cli-core', async () => {
|
||||
const actual = await vi.importActual('@google/gemini-cli-core');
|
||||
return {
|
||||
...actual,
|
||||
FileDiscoveryService: vi.fn(),
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
getErrorMessage,
|
||||
isNodeError,
|
||||
unescapePath,
|
||||
} from '@gemini-cli/core';
|
||||
} from '@google/gemini-cli-core';
|
||||
import {
|
||||
HistoryItem,
|
||||
IndividualToolCallDisplay,
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import { act, renderHook } from '@testing-library/react';
|
||||
import { vi } from 'vitest';
|
||||
import { useShellCommandProcessor } from './shellCommandProcessor';
|
||||
import { Config, GeminiClient } from '@gemini-cli/core';
|
||||
import { Config, GeminiClient } from '@google/gemini-cli-core';
|
||||
import * as fs from 'fs';
|
||||
import EventEmitter from 'events';
|
||||
|
||||
@@ -22,7 +22,7 @@ vi.mock('os', () => ({
|
||||
platform: () => 'linux',
|
||||
tmpdir: () => '/tmp',
|
||||
}));
|
||||
vi.mock('@gemini-cli/core');
|
||||
vi.mock('@google/gemini-cli-core');
|
||||
vi.mock('../utils/textUtils.js', () => ({
|
||||
isBinary: vi.fn(),
|
||||
}));
|
||||
|
||||
@@ -8,7 +8,7 @@ import { spawn } from 'child_process';
|
||||
import { StringDecoder } from 'string_decoder';
|
||||
import type { HistoryItemWithoutId } from '../types.js';
|
||||
import { useCallback } from 'react';
|
||||
import { Config, GeminiClient } from '@gemini-cli/core';
|
||||
import { Config, GeminiClient } from '@google/gemini-cli-core';
|
||||
import { type PartListUnion } from '@google/genai';
|
||||
import { formatMemoryUsage } from '../utils/formatters.js';
|
||||
import { isBinary } from '../utils/textUtils.js';
|
||||
|
||||
@@ -68,7 +68,7 @@ import {
|
||||
getMCPDiscoveryState,
|
||||
getMCPServerStatus,
|
||||
GeminiClient,
|
||||
} from '@gemini-cli/core';
|
||||
} from '@google/gemini-cli-core';
|
||||
import { useSessionStats } from '../contexts/SessionContext.js';
|
||||
import { LoadedSettings } from '../../config/settings.js';
|
||||
|
||||
@@ -712,7 +712,7 @@ Add any other context about the problem here.
|
||||
describe('/mcp command', () => {
|
||||
beforeEach(() => {
|
||||
// Mock the core module with getMCPServerStatus and getMCPDiscoveryState
|
||||
vi.mock('@gemini-cli/core', async (importOriginal) => {
|
||||
vi.mock('@google/gemini-cli-core', async (importOriginal) => {
|
||||
const actual = await importOriginal();
|
||||
return {
|
||||
...actual,
|
||||
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
MCPServerStatus,
|
||||
getMCPDiscoveryState,
|
||||
getMCPServerStatus,
|
||||
} from '@gemini-cli/core';
|
||||
} from '@google/gemini-cli-core';
|
||||
import { useSessionStats } from '../contexts/SessionContext.js';
|
||||
import {
|
||||
Message,
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
Config,
|
||||
clearCachedCredentialFile,
|
||||
getErrorMessage,
|
||||
} from '@gemini-cli/core';
|
||||
} from '@google/gemini-cli-core';
|
||||
|
||||
async function performAuthFlow(authMethod: AuthType, config: Config) {
|
||||
await config.refreshAuth(authMethod);
|
||||
|
||||
@@ -20,14 +20,14 @@ import {
|
||||
Config,
|
||||
Config as ActualConfigType,
|
||||
ApprovalMode,
|
||||
} from '@gemini-cli/core';
|
||||
} from '@google/gemini-cli-core';
|
||||
import { useInput, type Key as InkKey } from 'ink';
|
||||
|
||||
vi.mock('ink');
|
||||
|
||||
vi.mock('@gemini-cli/core', async () => {
|
||||
vi.mock('@google/gemini-cli-core', async () => {
|
||||
const actualServerModule = (await vi.importActual(
|
||||
'@gemini-cli/core',
|
||||
'@google/gemini-cli-core',
|
||||
)) as Record<string, unknown>;
|
||||
return {
|
||||
...actualServerModule,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useInput } from 'ink';
|
||||
import { ApprovalMode, type Config } from '@gemini-cli/core';
|
||||
import { ApprovalMode, type Config } from '@google/gemini-cli-core';
|
||||
|
||||
export interface UseAutoAcceptIndicatorArgs {
|
||||
config: Config;
|
||||
|
||||
@@ -9,13 +9,13 @@ import type { Mocked } from 'vitest';
|
||||
import { renderHook, act } from '@testing-library/react';
|
||||
import { useCompletion } from './useCompletion.js';
|
||||
import * as fs from 'fs/promises';
|
||||
import { FileDiscoveryService } from '@gemini-cli/core';
|
||||
import { FileDiscoveryService } from '@google/gemini-cli-core';
|
||||
import { glob } from 'glob';
|
||||
|
||||
// Mock dependencies
|
||||
vi.mock('fs/promises');
|
||||
vi.mock('@gemini-cli/core', async () => {
|
||||
const actual = await vi.importActual('@gemini-cli/core');
|
||||
vi.mock('@google/gemini-cli-core', async () => {
|
||||
const actual = await vi.importActual('@google/gemini-cli-core');
|
||||
return {
|
||||
...actual,
|
||||
FileDiscoveryService: vi.fn(),
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
getErrorMessage,
|
||||
Config,
|
||||
FileDiscoveryService,
|
||||
} from '@gemini-cli/core';
|
||||
} from '@google/gemini-cli-core';
|
||||
import {
|
||||
MAX_SUGGESTIONS_TO_SHOW,
|
||||
Suggestion,
|
||||
|
||||
@@ -22,10 +22,10 @@ import {
|
||||
type EditorType,
|
||||
checkHasEditorType,
|
||||
allowEditorTypeInSandbox,
|
||||
} from '@gemini-cli/core';
|
||||
} from '@google/gemini-cli-core';
|
||||
|
||||
vi.mock('@gemini-cli/core', async () => {
|
||||
const actual = await vi.importActual('@gemini-cli/core');
|
||||
vi.mock('@google/gemini-cli-core', async () => {
|
||||
const actual = await vi.importActual('@google/gemini-cli-core');
|
||||
return {
|
||||
...actual,
|
||||
checkHasEditorType: vi.fn(() => true),
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
allowEditorTypeInSandbox,
|
||||
checkHasEditorType,
|
||||
EditorType,
|
||||
} from '@gemini-cli/core';
|
||||
} from '@google/gemini-cli-core';
|
||||
|
||||
interface UseEditorSettingsReturn {
|
||||
isEditorDialogOpen: boolean;
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
TrackedExecutingToolCall,
|
||||
TrackedCancelledToolCall,
|
||||
} from './useReactToolScheduler.js';
|
||||
import { Config, EditorType, AuthType } from '@gemini-cli/core';
|
||||
import { Config, EditorType, AuthType } from '@google/gemini-cli-core';
|
||||
import { Part, PartListUnion } from '@google/genai';
|
||||
import { UseHistoryManagerReturn } from './useHistoryManager.js';
|
||||
import { HistoryItem, MessageType, StreamingState } from '../types.js';
|
||||
@@ -42,7 +42,7 @@ const MockedUserPromptEvent = vi.hoisted(() =>
|
||||
vi.fn().mockImplementation(() => {}),
|
||||
);
|
||||
|
||||
vi.mock('@gemini-cli/core', async (importOriginal) => {
|
||||
vi.mock('@google/gemini-cli-core', async (importOriginal) => {
|
||||
const actualCoreModule = (await importOriginal()) as any;
|
||||
return {
|
||||
...actualCoreModule,
|
||||
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
ThoughtSummary,
|
||||
UnauthorizedError,
|
||||
UserPromptEvent,
|
||||
} from '@gemini-cli/core';
|
||||
} from '@google/gemini-cli-core';
|
||||
import { type Part, type PartListUnion } from '@google/genai';
|
||||
import {
|
||||
StreamingState,
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
import { useState, useEffect } from 'react';
|
||||
import { sessionId, Logger } from '@gemini-cli/core';
|
||||
import { sessionId, Logger } from '@google/gemini-cli-core';
|
||||
|
||||
/**
|
||||
* Hook to manage the logger instance.
|
||||
|
||||
@@ -21,7 +21,7 @@ import {
|
||||
ToolCall,
|
||||
Status as CoreStatus,
|
||||
EditorType,
|
||||
} from '@gemini-cli/core';
|
||||
} from '@google/gemini-cli-core';
|
||||
import { useCallback, useState, useMemo } from 'react';
|
||||
import {
|
||||
HistoryItemToolGroup,
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import { useState, useEffect, useCallback } from 'react';
|
||||
import * as fs from 'fs/promises';
|
||||
import * as path from 'path';
|
||||
import { isNodeError, getProjectTempDir } from '@gemini-cli/core';
|
||||
import { isNodeError, getProjectTempDir } from '@google/gemini-cli-core';
|
||||
|
||||
const HISTORY_FILE = 'shell_history';
|
||||
const MAX_HISTORY_LENGTH = 100;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
import { Message, MessageType } from '../types.js';
|
||||
import { Config } from '@gemini-cli/core';
|
||||
import { Config } from '@google/gemini-cli-core';
|
||||
import { LoadedSettings } from '../../config/settings.js';
|
||||
|
||||
export function createShowMemoryAction(
|
||||
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
ToolCall, // Import from core
|
||||
Status as ToolCallStatusType,
|
||||
ApprovalMode, // Import from core
|
||||
} from '@gemini-cli/core';
|
||||
} from '@google/gemini-cli-core';
|
||||
import {
|
||||
HistoryItemWithoutId,
|
||||
ToolCallStatus,
|
||||
@@ -32,8 +32,8 @@ import {
|
||||
} from '../types.js';
|
||||
|
||||
// Mocks
|
||||
vi.mock('@gemini-cli/core', async () => {
|
||||
const actual = await vi.importActual('@gemini-cli/core');
|
||||
vi.mock('@google/gemini-cli-core', async () => {
|
||||
const actual = await vi.importActual('@google/gemini-cli-core');
|
||||
return {
|
||||
...actual,
|
||||
ToolRegistry: vi.fn(),
|
||||
|
||||
Reference in New Issue
Block a user