History

[codex] Enforce canonical Node namespace imports (#3238)

Julius Marminge committed 4 months ago

Commit 2fa37ec1 parent db2750271 files · +1205 −952Browse files

Showing the changes to apps/server/src/workspace/WorkspaceFileSystem.ts (1 of 71 files). Show all

Unified · Split

apps/server/src/workspace/WorkspaceFileSystem.ts+4−4
@@ -7,7 +7,7 @@ · 6 unmodified lines
7 *7 *
8 * @module WorkspaceFileSystem8 * @module WorkspaceFileSystem
9 */9 */
10import { open, realpath } from "node:fs/promises";10import * as NodeFSP from "node:fs/promises";
11 11
12import type {12import type {
13 ProjectReadFileInput,13 ProjectReadFileInput,
@@ -89,8 +89,8 @@ export const make = Effect.gen(function* () { · 75 unmodified lines
89 return yield* Effect.tryPromise({89 return yield* Effect.tryPromise({
90 try: async () => {90 try: async () => {
91 const [realWorkspaceRoot, realTargetPath] = await Promise.all([91 const [realWorkspaceRoot, realTargetPath] = await Promise.all([
92 realpath(input.cwd),92 NodeFSP.realpath(input.cwd),
93 realpath(target.absolutePath),93 NodeFSP.realpath(target.absolutePath),
94 ]);94 ]);
95 const relativeRealPath = path.relative(realWorkspaceRoot, realTargetPath);95 const relativeRealPath = path.relative(realWorkspaceRoot, realTargetPath);
96 if (96 if (
@@ -101,7 +101,7 @@ export const make = Effect.gen(function* () { · 4 unmodified lines
101 throw new Error("Workspace file path resolves outside the project root.");101 throw new Error("Workspace file path resolves outside the project root.");
102 }102 }
103 103
104 const handle = await open(realTargetPath, "r");104 const handle = await NodeFSP.open(realTargetPath, "r");
105 try {105 try {
106 const stat = await handle.stat();106 const stat = await handle.stat();
107 if (!stat.isFile()) {107 if (!stat.isFile()) {