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

@@ -5,9 +5,9 @@
*/
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
import * as fs from 'fs/promises';
import * as os from 'os';
import * as path from 'path';
import * as fs from 'node:fs/promises';
import * as os from 'node:os';
import * as path from 'node:path';
import { FileDiscoveryService } from './fileDiscoveryService.js';
describe('FileDiscoveryService', () => {

View File

@@ -6,7 +6,7 @@
import { GitIgnoreParser, GitIgnoreFilter } from '../utils/gitIgnoreParser.js';
import { isGitRepository } from '../utils/gitUtils.js';
import * as path from 'path';
import * as path from 'node:path';
const GEMINI_IGNORE_FILE_NAME = '.geminiignore';

View File

@@ -5,7 +5,7 @@
*/
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
import fs from 'fs/promises';
import fs from 'node:fs/promises';
import { StandardFileSystemService } from './fileSystemService.js';
vi.mock('fs/promises');

View File

@@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
import fs from 'fs/promises';
import fs from 'node:fs/promises';
/**
* Interface for file system operations that may be delegated to different implementations

View File

@@ -7,9 +7,9 @@
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
import { GitService } from './gitService.js';
import { Storage } from '../config/storage.js';
import * as path from 'path';
import * as fs from 'fs/promises';
import * as os from 'os';
import * as path from 'node:path';
import * as fs from 'node:fs/promises';
import * as os from 'node:os';
import type { ChildProcess } from 'node:child_process';
import { getProjectHash, GEMINI_DIR } from '../utils/paths.js';

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 { isNodeError } from '../utils/errors.js';
import { exec } from 'node:child_process';
import { simpleGit, SimpleGit, CheckRepoActions } from 'simple-git';

View File

@@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
import { createHash } from 'crypto';
import { createHash } from 'node:crypto';
import { GeminiEventType, ServerGeminiStreamEvent } from '../core/turn.js';
import { logLoopDetected } from '../telemetry/loggers.js';
import { LoopDetectedEvent, LoopType } from '../telemetry/types.js';

View File

@@ -5,9 +5,9 @@
*/
import { vi, describe, it, expect, beforeEach, type Mock } from 'vitest';
import EventEmitter from 'events';
import { Readable } from 'stream';
import { type ChildProcess } from 'child_process';
import EventEmitter from 'node:events';
import { Readable } from 'node:stream';
import { type ChildProcess } from 'node:child_process';
import {
ShellExecutionService,
ShellOutputEvent,

View File

@@ -5,9 +5,9 @@
*/
import { getPty, PtyImplementation } from '../utils/getPty.js';
import { spawn as cpSpawn } from 'child_process';
import { TextDecoder } from 'util';
import os from 'os';
import { spawn as cpSpawn } from 'node:child_process';
import { TextDecoder } from 'node:util';
import os from 'node:os';
import { getCachedEncodingForBuffer } from '../utils/systemEncoding.js';
import { isBinary } from '../utils/textUtils.js';
import pkg from '@xterm/headless';