From 913e2875c1c31d5ffbc9c0c9ed0e8c63f6143024 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 30 Mar 2023 03:20:31 +0200 Subject: refactor(ext/node): add NodeEnv::Fs associated type (#18484) This commit adds associated type to "NodeEnv" trait, called "Fs". The "Fs" type has a trait bound on "NodeFs", which specifies APIs required for all ops and resolution APIs to function. A "RealFs" implementation of "NodeFs" is exported from the "deno_node" crate, that provides a default implementation for the trait. All code in "deno_node" extension was changed to use the "NodeFs" trait to handle file system operations, instead of relying on APIs from the standard library. --- runtime/lib.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime/lib.rs') diff --git a/runtime/lib.rs b/runtime/lib.rs index 57108aa7e..994e043fd 100644 --- a/runtime/lib.rs +++ b/runtime/lib.rs @@ -40,4 +40,5 @@ pub use worker_bootstrap::BootstrapOptions; pub struct RuntimeNodeEnv; impl deno_node::NodeEnv for RuntimeNodeEnv { type P = permissions::PermissionsContainer; + type Fs = deno_node::RealFs; } -- cgit v1.2.3