From f90caa821c5a4acf28f7dec4071994ecf6f26e57 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Wed, 12 Apr 2023 15:13:32 +0200 Subject: refactor(ext/fs): abstract FS via FileSystem trait (#18599) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit abstracts out the specifics of the underlying system calls FS operations behind a new `FileSystem` and `File` trait in the `ext/fs` extension. This allows other embedders to re-use ext/fs, but substituting in a different FS backend. This is likely not the final form of these traits. Eventually they will be entirely `deno_core::Resource` agnostic, and will live in a seperate crate. --------- Co-authored-by: Bartek IwaƄczuk --- runtime/worker.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'runtime/worker.rs') diff --git a/runtime/worker.rs b/runtime/worker.rs index ea1e5e046..14abd12b5 100644 --- a/runtime/worker.rs +++ b/runtime/worker.rs @@ -30,6 +30,7 @@ use deno_core::RuntimeOptions; use deno_core::SharedArrayBufferStore; use deno_core::Snapshot; use deno_core::SourceMapGetter; +use deno_fs::StdFs; use deno_io::Stdio; use deno_kv::sqlite::SqliteDbHandler; use deno_node::RequireNpmResolver; @@ -264,7 +265,7 @@ impl MainWorker { deno_napi::deno_napi::init_ops::(), deno_http::deno_http::init_ops(), deno_io::deno_io::init_ops(Some(options.stdio)), - deno_fs::deno_fs::init_ops::(unstable), + deno_fs::deno_fs::init_ops::<_, PermissionsContainer>(unstable, StdFs), deno_node::deno_node::init_ops::( options.npm_resolver, ), -- cgit v1.2.3