Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(unstable): optional deno_modules directory #19977

Merged
merged 42 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
928ed74
Second round on remote_modules directory
dsherret Jul 21, 2023
bb8cc89
More work.
dsherret Jul 24, 2023
4585d96
Add.
dsherret Jul 25, 2023
2b600f3
Merge branch 'main' into remote_modules_dir_2
dsherret Jul 28, 2023
51a9e52
Updates.
dsherret Jul 28, 2023
43670b7
Moving to separate implementations
dsherret Jul 28, 2023
ff30a39
Fix errors
dsherret Jul 28, 2023
8290e4e
More work.
dsherret Jul 28, 2023
7e49f8c
Improvements
dsherret Jul 28, 2023
2e2da3d
More fixes.
dsherret Jul 28, 2023
04a7029
Revert testing code
dsherret Jul 28, 2023
a9995f2
Update.
dsherret Jul 28, 2023
cc8189b
Slight improvement
dsherret Jul 28, 2023
90120de
chore: upgrade to dprint 0.40 internally
dsherret Jul 31, 2023
8a5ee81
Merge branch 'chore_dprint_0_40' into remote_modules_dir_2
dsherret Jul 31, 2023
b7fa3ee
lsp - Update cache location when changing setting in config
dsherret Jul 31, 2023
8eeba1e
Add extension when hashing the filename.
dsherret Jul 31, 2023
fa242d2
Merge branch 'main' into remote_modules_dir_2
dsherret Jul 31, 2023
3be7ba9
Use fs trait, but going to revert this because no point.
dsherret Jul 31, 2023
175d433
Revert "Use fs trait, but going to revert this because no point."
dsherret Jul 31, 2023
4c0dc2a
Add some tests
dsherret Jul 31, 2023
1d37d6f
Another test
dsherret Jul 31, 2023
3af6829
Implement --remote-modules-dir
dsherret Jul 31, 2023
ccef11c
More tests
dsherret Jul 31, 2023
e760bfe
Fix slash slash issue
dsherret Jul 31, 2023
2dc81f5
Update deprecated comment for `get_global_cache_location`
dsherret Aug 1, 2023
83ecf49
Don't keep content-type header if not necessary
dsherret Aug 1, 2023
46d4419
Rename to deno_modules based on feedback. I don't like this name though.
dsherret Aug 1, 2023
75175f0
Merge branch 'main' into remote_modules_dir_2
dsherret Aug 1, 2023
03614de
Forgot to check these in.
dsherret Aug 1, 2023
3842fe3
Remove ensure_dir calls by improving atomic_write_file
dsherret Aug 1, 2023
f171ed1
Update.
dsherret Aug 1, 2023
bc31ea8
Remove .gitignore
dsherret Aug 1, 2023
1a11305
Add lsp test.
dsherret Aug 1, 2023
27a6517
Flatten structure more
dsherret Aug 1, 2023
11e5660
chore: fix windows clippy errors
dsherret Aug 1, 2023
358a3fd
Merge branch 'chore_fix_windows_clippy_lints' into remote_modules_dir_2
dsherret Aug 1, 2023
8433cac
Lint.
dsherret Aug 1, 2023
804ed61
Fix release errors probably
dsherret Aug 1, 2023
793e622
Fix failing test
dsherret Aug 1, 2023
27c623c
Merge branch 'main' into remote_modules_dir_2
dsherret Aug 2, 2023
711205f
Add comment explaining why deno_modules is not canonicalized
dsherret Aug 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Lint.
  • Loading branch information
dsherret committed Aug 1, 2023
commit 8433cace73aa7a5930526ea31c1dd8482a515a7d
7 changes: 3 additions & 4 deletions cli/args/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1206,10 +1206,9 @@ fn resolve_deno_modules_folder(
) -> Option<PathBuf> {
let use_deno_modules_dir = flags
.deno_modules_dir
.or_else(|| maybe_config_file.and_then(|c| c.deno_modules_dir()));
if use_deno_modules_dir == Some(false) {
None
} else if use_deno_modules_dir.is_none() {
.or_else(|| maybe_config_file.and_then(|c| c.deno_modules_dir()))
.unwrap_or(false);
if !use_deno_modules_dir {
None
} else if let Some(config_path) = maybe_config_file
.as_ref()
Expand Down
4 changes: 2 additions & 2 deletions cli/cache/http_cache/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ impl LocalHttpCache {

let local_file_path = self.get_cache_filepath(url, &metadata.headers)?;
// if we're here, then this will be set
atomic_write_file(&local_file_path, &cached_bytes, CACHE_PERM)?;
atomic_write_file(&local_file_path, cached_bytes, CACHE_PERM)?;
}
self.manifest.insert_data(
url_to_local_sub_path(url, &metadata.headers)?,
Expand Down Expand Up @@ -653,7 +653,7 @@ mod test {
local_cache_path
.join("deno.land")
.join("main.js")
.write(&content);
.write(content);

// now we should be able to read this file because it's directly mappable to a url
let url = Url::parse("https://deno.land/main.js").unwrap();
Expand Down
2 changes: 1 addition & 1 deletion cli/util/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub fn atomic_write_file<T: AsRef<[u8]>>(
{
if write_err.kind() == ErrorKind::NotFound {
let parent_dir_path = file_path.parent().unwrap();
match std::fs::create_dir_all(&parent_dir_path) {
match std::fs::create_dir_all(parent_dir_path) {
Ok(()) => {
return atomic_write_file_raw(
&temp_file_path,
Expand Down
Loading