chore: consistently import node modules with prefix (#3013)

Co-authored-by: N. Taylor Mullen <ntaylormullen@google.com>
This commit is contained in:
Pascal Birchler
2025-08-25 22:11:27 +02:00
committed by GitHub
parent 415d3413c4
commit ee4feea006
168 changed files with 420 additions and 405 deletions

View File

@@ -16,11 +16,11 @@ import {
COMMON_IGNORE_PATTERNS,
DEFAULT_FILE_EXCLUDES,
} from '@google/gemini-cli-core';
import * as os from 'os';
import * as os from 'node:os';
import { ToolCallStatus } from '../types.js';
import { UseHistoryManagerReturn } from './useHistoryManager.js';
import * as fsPromises from 'fs/promises';
import * as path from 'path';
import * as fsPromises from 'node:fs/promises';
import * as path from 'node:path';
describe('handleAtCommand', () => {
let testRootDir: string;

View File

@@ -4,8 +4,8 @@
* SPDX-License-Identifier: Apache-2.0
*/
import * as fs from 'fs/promises';
import * as path from 'path';
import * as fs from 'node:fs/promises';
import * as path from 'node:path';
import { PartListUnion, PartUnion } from '@google/genai';
import {
AnyToolInvocation,

View File

@@ -36,10 +36,10 @@ import {
type ShellExecutionResult,
type ShellOutputEvent,
} from '@google/gemini-cli-core';
import * as fs from 'fs';
import * as os from 'os';
import * as path from 'path';
import * as crypto from 'crypto';
import * as fs from 'node:fs';
import * as os from 'node:os';
import * as path from 'node:path';
import * as crypto from 'node:crypto';
import { ToolCallStatus } from '../types.js';
describe('useShellCommandProcessor', () => {

View File

@@ -21,10 +21,10 @@ import { type PartListUnion } from '@google/genai';
import { UseHistoryManagerReturn } from './useHistoryManager.js';
import { SHELL_COMMAND_NAME } from '../constants.js';
import { formatMemoryUsage } from '../utils/formatters.js';
import crypto from 'crypto';
import path from 'path';
import os from 'os';
import fs from 'fs';
import crypto from 'node:crypto';
import path from 'node:path';
import os from 'node:os';
import fs from 'node:fs';
export const OUTPUT_UPDATE_INTERVAL_MS = 1000;
const MAX_OUTPUT_LENGTH = 10000;

View File

@@ -5,7 +5,7 @@
*/
import { renderHook, act } from '@testing-library/react';
import { EventEmitter } from 'events';
import { EventEmitter } from 'node:events';
import { useFocus } from './useFocus.js';
import { vi } from 'vitest';
import { useStdin, useStdout } from 'ink';

View File

@@ -13,7 +13,7 @@ import {
LoadedTrustedFolders,
TrustLevel,
} from '../../config/trustedFolders.js';
import * as process from 'process';
import * as process from 'node:process';
import * as trustedFolders from '../../config/trustedFolders.js';

View File

@@ -12,7 +12,7 @@ import {
TrustLevel,
isWorkspaceTrusted,
} from '../../config/trustedFolders.js';
import * as process from 'process';
import * as process from 'node:process';
export const useFolderTrust = (
settings: LoadedSettings,

View File

@@ -47,8 +47,8 @@ import { findLastSafeSplitPoint } from '../utils/markdownUtilities.js';
import { useStateAndRef } from './useStateAndRef.js';
import { UseHistoryManagerReturn } from './useHistoryManager.js';
import { useLogger } from './useLogger.js';
import { promises as fs } from 'fs';
import path from 'path';
import { promises as fs } from 'node:fs';
import path from 'node:path';
import {
useReactToolScheduler,
mapToDisplay as mapTrackedToolCallsToDisplay,

View File

@@ -8,7 +8,7 @@ import { useState, useEffect, useCallback } from 'react';
import { exec } from 'node:child_process';
import fs from 'node:fs';
import fsPromises from 'node:fs/promises';
import path from 'path';
import path from 'node:path';
export function useGitBranchName(cwd: string): string | undefined {
const [branchName, setBranchName] = useState<string | undefined>(undefined);

View File

@@ -9,8 +9,8 @@ import { renderHook, act } from '@testing-library/react';
import { useKeypress, Key } from './useKeypress.js';
import { KeypressProvider } from '../contexts/KeypressContext.js';
import { useStdin } from 'ink';
import { EventEmitter } from 'events';
import { PassThrough } from 'stream';
import { EventEmitter } from 'node:events';
import { PassThrough } from 'node:stream';
// Mock the 'ink' module to control stdin
vi.mock('ink', async (importOriginal) => {

View File

@@ -6,10 +6,10 @@
import { renderHook, act, waitFor } from '@testing-library/react';
import { useShellHistory } from './useShellHistory.js';
import * as fs from 'fs/promises';
import * as path from 'path';
import * as os from 'os';
import * as crypto from 'crypto';
import * as fs from 'node:fs/promises';
import * as path from 'node:path';
import * as os from 'node:os';
import * as crypto from 'node:crypto';
vi.mock('fs/promises', () => ({
readFile: vi.fn(),

View File

@@ -5,8 +5,8 @@
*/
import { useState, useEffect, useCallback } from 'react';
import * as fs from 'fs/promises';
import * as path from 'path';
import * as fs from 'node:fs/promises';
import * as path from 'node:path';
import { isNodeError, Storage } from '@google/gemini-cli-core';
const MAX_HISTORY_LENGTH = 100;