From 826e42a5b5880c974ae019a7a21aade6a718062c Mon Sep 17 00:00:00 2001 From: David Sherret Date: Fri, 1 Nov 2024 12:27:00 -0400 Subject: fix: improved support for cjs and cts modules (#26558) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * cts support * better cjs/cts type checking * deno compile cjs/cts support * More efficient detect cjs (going towards stabilization) * Determination of whether .js, .ts, .jsx, or .tsx is cjs or esm is only done after loading * Support `import x = require(...);` Co-authored-by: Bartek IwaƄczuk --- resolvers/deno/fs.rs | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'resolvers/deno/fs.rs') diff --git a/resolvers/deno/fs.rs b/resolvers/deno/fs.rs index b08be3798..44495fa7c 100644 --- a/resolvers/deno/fs.rs +++ b/resolvers/deno/fs.rs @@ -15,13 +15,3 @@ pub trait DenoResolverFs { fn is_dir_sync(&self, path: &Path) -> bool; fn read_dir_sync(&self, dir_path: &Path) -> std::io::Result>; } - -pub(crate) struct DenoPkgJsonFsAdapter<'a, Fs: DenoResolverFs>(pub &'a Fs); - -impl<'a, Fs: DenoResolverFs> deno_package_json::fs::DenoPkgJsonFs - for DenoPkgJsonFsAdapter<'a, Fs> -{ - fn read_to_string_lossy(&self, path: &Path) -> std::io::Result { - self.0.read_to_string_lossy(path) - } -} -- cgit v1.2.3 From 617350e79c58b6e01984e3d7c7436d243d0e5cff Mon Sep 17 00:00:00 2001 From: David Sherret Date: Thu, 14 Nov 2024 15:24:25 -0500 Subject: refactor(resolver): move more resolution code into deno_resolver (#26873) Follow-up to cjs refactor. This moves most of the resolution code into the deno_resolver crate. Still pending is the npm resolution code. --- resolvers/deno/fs.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'resolvers/deno/fs.rs') diff --git a/resolvers/deno/fs.rs b/resolvers/deno/fs.rs index 44495fa7c..4929f4508 100644 --- a/resolvers/deno/fs.rs +++ b/resolvers/deno/fs.rs @@ -12,6 +12,7 @@ pub struct DirEntry { pub trait DenoResolverFs { fn read_to_string_lossy(&self, path: &Path) -> std::io::Result; fn realpath_sync(&self, path: &Path) -> std::io::Result; + fn exists_sync(&self, path: &Path) -> bool; fn is_dir_sync(&self, path: &Path) -> bool; fn read_dir_sync(&self, dir_path: &Path) -> std::io::Result>; } -- cgit v1.2.3