[codex] Enforce canonical Node namespace imports (#3238)
Co-authored-by: codex <[email protected]>
This commit is contained in:
1 parent
db27502aff
commit
2fa37ec183
71 files changed
+1205
-952
No files matched your search
@@ -7,7 +7,7 @@
|
||||
*
|
||||
* @module WorkspaceFileSystem
|
||||
*/
|
||||
import { open, realpath } from "node:fs/promises";
|
||||
import * as NodeFSP from "node:fs/promises";
|
||||
|
||||
import type {
|
||||
ProjectReadFileInput,
|
||||
@@ -89,8 +89,8 @@ export const make = Effect.gen(function* () {
|
||||
return yield* Effect.tryPromise({
|
||||
try: async () => {
|
||||
const [realWorkspaceRoot, realTargetPath] = await Promise.all([
|
||||
realpath(input.cwd),
|
||||
realpath(target.absolutePath),
|
||||
NodeFSP.realpath(input.cwd),
|
||||
NodeFSP.realpath(target.absolutePath),
|
||||
]);
|
||||
const relativeRealPath = path.relative(realWorkspaceRoot, realTargetPath);
|
||||
if (
|
||||
@@ -101,7 +101,7 @@ export const make = Effect.gen(function* () {
|
||||
throw new Error("Workspace file path resolves outside the project root.");
|
||||
}
|
||||
|
||||
const handle = await open(realTargetPath, "r");
|
||||
const handle = await NodeFSP.open(realTargetPath, "r");
|
||||
try {
|
||||
const stat = await handle.stat();
|
||||
if (!stat.isFile()) {
|
||||
|
||||
Reference in new issue
Block a user