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: add --allow-import flag #25469

Merged
merged 43 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
fbb40ad
feat: Add `--allow-imports` flag
bartlomieju Sep 5, 2024
8170f32
actually make it work for dynamic imports
bartlomieju Sep 5, 2024
9f947cc
merge in main
dsherret Sep 17, 2024
ef0ebc9
Merge branch 'main' into allow_imports
dsherret Sep 19, 2024
d040407
updates
dsherret Sep 19, 2024
ba90b1a
Merge branch 'main' into allow_imports
dsherret Sep 21, 2024
9d42419
Starting to use permissions container more
dsherret Sep 22, 2024
eaff962
Starting to use permissions container more
dsherret Sep 22, 2024
05a39e9
Saving for revert
dsherret Sep 22, 2024
f99c39c
Revert "Saving for revert"
dsherret Sep 22, 2024
282dab6
add permissions for check and cache. Allow reading from the file syst…
dsherret Sep 22, 2024
479d046
Start adding tests and fix it not working for run
dsherret Sep 22, 2024
2b58d88
fix up flags
dsherret Sep 22, 2024
b0c74e0
add 0.0.0.0
dsherret Sep 22, 2024
9e48c18
test jsr_host_from_url
dsherret Sep 22, 2024
240e2c0
add gist.githubusercontent.com
dsherret Sep 22, 2024
3f88938
update test because localhost is allowed by default (though maybe it …
dsherret Sep 22, 2024
43f4624
improve naming
dsherret Sep 22, 2024
4e6b5d2
Merge branch 'main' into allow_imports
dsherret Sep 23, 2024
5630383
Clippy
dsherret Sep 24, 2024
d90489f
Merge branch 'main' into allow_imports
dsherret Sep 24, 2024
b458c3d
Fixing up more tests
dsherret Sep 24, 2024
3927928
Merge branch 'main' into allow_imports
dsherret Sep 25, 2024
1787bf7
Checking in before revert
dsherret Sep 25, 2024
9e53639
Fix worker permissions and update expectations
dsherret Sep 25, 2024
b326096
finish
dsherret Sep 25, 2024
134718f
clippy
dsherret Sep 25, 2024
a232f95
Start removing localhost as allowed by default
dsherret Sep 25, 2024
abb5de4
Merge branch 'main' into allow_imports
dsherret Sep 25, 2024
f1282e5
fix run tests
dsherret Sep 25, 2024
9a164ec
fix lsp caching
dsherret Sep 25, 2024
1124b45
Update and fix more tests
dsherret Sep 25, 2024
2dca777
more test fixes
dsherret Sep 25, 2024
f0d1c05
more fixes
dsherret Sep 25, 2024
d315bf2
Do not load non-jsr remote modules in `deno publish`
dsherret Sep 25, 2024
02120ac
fix publish tests
dsherret Sep 25, 2024
65e1e96
add tests for doc
dsherret Sep 25, 2024
4facd74
fix remaining tests
dsherret Sep 25, 2024
f4b41c5
self review
dsherret Sep 25, 2024
41c63f2
improve help output
dsherret Sep 25, 2024
79b9992
fix check_specifiers test
dsherret Sep 26, 2024
d7e1744
review and update linux test
dsherret Sep 26, 2024
c66b814
fix failing windows test
dsherret Sep 26, 2024
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
fix failing windows test
  • Loading branch information
dsherret committed Sep 26, 2024
commit c66b814b264b8071e61e4945aac25d0c35200e4c
3 changes: 2 additions & 1 deletion cli/file_fetcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use deno_graph::source::LoaderChecksum;

use deno_runtime::deno_permissions::PermissionsContainer;
use deno_runtime::deno_web::BlobStore;
use deno_runtime::fs_util::specifier_to_file_path;
use log::debug;
use std::borrow::Cow;
use std::collections::HashMap;
Expand Down Expand Up @@ -135,7 +136,7 @@ impl MemoryFiles {

/// Fetch a source file from the local file system.
fn fetch_local(specifier: &ModuleSpecifier) -> Result<File, AnyError> {
let local = specifier.to_file_path().map_err(|_| {
let local = specifier_to_file_path(specifier).map_err(|_| {
uri_error(format!("Invalid file path.\n Specifier: {specifier}"))
})?;
// If it doesnt have a extension, we want to treat it as typescript by default
Expand Down
14 changes: 8 additions & 6 deletions tests/integration/run_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5137,21 +5137,23 @@ fn emit_failed_readonly_file_system() {
fn handle_invalid_path_error() {
let deno_cmd = util::deno_cmd_with_deno_dir(&util::new_deno_dir());
let output = deno_cmd.arg("run").arg("file://asdf").output().unwrap();
assert!(
String::from_utf8_lossy(&output.stderr).contains("Invalid file path.")
assert_contains!(
String::from_utf8_lossy(&output.stderr),
"Invalid file path."
);

let deno_cmd = util::deno_cmd_with_deno_dir(&util::new_deno_dir());
let output = deno_cmd.arg("run").arg("/a/b").output().unwrap();
assert!(String::from_utf8_lossy(&output.stderr).contains("Module not found"));
assert_contains!(String::from_utf8_lossy(&output.stderr), "Module not found");

let deno_cmd = util::deno_cmd_with_deno_dir(&util::new_deno_dir());
let output = deno_cmd.arg("run").arg("//a/b").output().unwrap();
assert!(
String::from_utf8_lossy(&output.stderr).contains("Invalid file path.")
assert_contains!(
String::from_utf8_lossy(&output.stderr),
"Invalid file path."
);

let deno_cmd = util::deno_cmd_with_deno_dir(&util::new_deno_dir());
let output = deno_cmd.arg("run").arg("///a/b").output().unwrap();
assert!(String::from_utf8_lossy(&output.stderr).contains("Module not found"));
assert_contains!(String::from_utf8_lossy(&output.stderr), "Module not found");
}