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
77 *
88 * @module WorkspaceFileSystem
99 */
10−import { open, realpath } from "node:fs/promises";
10+import * as NodeFSP from "node:fs/promises";
1111
1212 import type {
1313 ProjectReadFileInput,
@@ -89,8 +89,8 @@ export const make = Effect.gen(function* () { · 75 unmodified lines
8989 return yield* Effect.tryPromise({
9090 try: async () => {
9191 const [realWorkspaceRoot, realTargetPath] = await Promise.all([
92− realpath(input.cwd),
93− realpath(target.absolutePath),
92+ NodeFSP.realpath(input.cwd),
93+ NodeFSP.realpath(target.absolutePath),
9494 ]);
9595 const relativeRealPath = path.relative(realWorkspaceRoot, realTargetPath);
9696 if (
@@ -101,7 +101,7 @@ export const make = Effect.gen(function* () { · 4 unmodified lines
101101 throw new Error("Workspace file path resolves outside the project root.");
102102 }
103103
104− const handle = await open(realTargetPath, "r");
104+ const handle = await NodeFSP.open(realTargetPath, "r");
105105 try {
106106 const stat = await handle.stat();
107107 if (!stat.isFile()) {