From c9d6f9b2261432ed48a1bfa643841ad5c1685e2d Mon Sep 17 00:00:00 2001 From: Sandy Tao Date: Thu, 15 Jan 2026 15:22:06 +0800 Subject: [PATCH] chore: fix TS5055 by mapping paths to source and adding project references --- packages/a2a-server/tsconfig.json | 3 ++- packages/cli/tsconfig.json | 2 +- packages/core/src/utils/memoryDiscovery.ts | 3 +-- packages/core/src/utils/paths.ts | 1 + packages/core/tsconfig.json | 3 ++- tsconfig.json | 13 ++++++++++++- 6 files changed, 19 insertions(+), 6 deletions(-) diff --git a/packages/a2a-server/tsconfig.json b/packages/a2a-server/tsconfig.json index 06e3256b97..bd10d0d4b2 100644 --- a/packages/a2a-server/tsconfig.json +++ b/packages/a2a-server/tsconfig.json @@ -7,5 +7,6 @@ "types": ["node", "vitest/globals"] }, "include": ["index.ts", "src/**/*.ts", "src/**/*.json"], - "exclude": ["node_modules", "dist"] + "exclude": ["node_modules", "dist"], + "references": [{ "path": "../core" }] } diff --git a/packages/cli/tsconfig.json b/packages/cli/tsconfig.json index e361d7ffe0..260cafe1d8 100644 --- a/packages/cli/tsconfig.json +++ b/packages/cli/tsconfig.json @@ -14,5 +14,5 @@ "./package.json" ], "exclude": ["node_modules", "dist"], - "references": [{ "path": "../core" }] + "references": [{ "path": "../core" }, { "path": "../test-utils" }] } diff --git a/packages/core/src/utils/memoryDiscovery.ts b/packages/core/src/utils/memoryDiscovery.ts index 88a6760fe0..4997f543a0 100644 --- a/packages/core/src/utils/memoryDiscovery.ts +++ b/packages/core/src/utils/memoryDiscovery.ts @@ -7,14 +7,13 @@ import * as fs from 'node:fs/promises'; import * as fsSync from 'node:fs'; import * as path from 'node:path'; -import { homedir } from 'node:os'; import { bfsFileSearch } from './bfsFileSearch.js'; import { getAllGeminiMdFilenames } from '../tools/memoryTool.js'; import type { FileDiscoveryService } from '../services/fileDiscoveryService.js'; import { processImports } from './memoryImportProcessor.js'; import type { FileFilteringOptions } from '../config/constants.js'; import { DEFAULT_MEMORY_FILE_FILTERING_OPTIONS } from '../config/constants.js'; -import { GEMINI_DIR } from './paths.js'; +import { GEMINI_DIR, homedir } from './paths.js'; import type { ExtensionLoader } from './extensionLoader.js'; import { debugLogger } from './debugLogger.js'; import type { Config } from '../config/config.js'; diff --git a/packages/core/src/utils/paths.ts b/packages/core/src/utils/paths.ts index c32a3ce9f3..40172b8976 100644 --- a/packages/core/src/utils/paths.ts +++ b/packages/core/src/utils/paths.ts @@ -8,6 +8,7 @@ import path from 'node:path'; import os from 'node:os'; import * as crypto from 'node:crypto'; +export const homedir = os.homedir; export const GEMINI_DIR = '.gemini'; export const GOOGLE_ACCOUNTS_FILENAME = 'google_accounts.json'; diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index 06e3256b97..a321111540 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -7,5 +7,6 @@ "types": ["node", "vitest/globals"] }, "include": ["index.ts", "src/**/*.ts", "src/**/*.json"], - "exclude": ["node_modules", "dist"] + "exclude": ["node_modules", "dist"], + "references": [{ "path": "../test-utils" }] } diff --git a/tsconfig.json b/tsconfig.json index c4542cc833..5ec255ec46 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -26,6 +26,17 @@ "moduleResolution": "nodenext", "target": "es2022", "types": ["node", "vitest/globals"], - "jsx": "react-jsx" + "jsx": "react-jsx", + "baseUrl": ".", + "paths": { + "@google/gemini-cli-core": ["./packages/core/index.ts"], + "@google/gemini-cli-core/*": ["./packages/core/*"], + "@google/gemini-cli-a2a-server": ["./packages/a2a-server/index.ts"], + "@google/gemini-cli-a2a-server/*": ["./packages/a2a-server/*"], + "@google/gemini-cli": ["./packages/cli/index.ts"], + "@google/gemini-cli/*": ["./packages/cli/*"], + "@google/gemini-cli-test-utils": ["./packages/test-utils/src/index.ts"], + "@google/gemini-cli-test-utils/*": ["./packages/test-utils/src/*"] + } } }