diff --git a/Cargo.lock b/Cargo.lock index bec2ec12cc..854d8310bf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1584,9 +1584,9 @@ dependencies = [ [[package]] name = "deno_graph" -version = "0.82.2" +version = "0.82.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9328b62ffc7e806f1c92fd7a22e4ff3046fcb53f2d46e3e1297482b2c4c2bb9d" +checksum = "938ed2efa1dd9fdcceeebc169b2b7910506b8dacc992cfdcffd84aa6a3eb8db0" dependencies = [ "anyhow", "async-trait", @@ -8119,9 +8119,9 @@ dependencies = [ [[package]] name = "webpki-root-certs" -version = "0.26.5" +version = "0.26.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d93b773107ba49bc84dd3b241e019c702d886fd5c457defe2ea8b1123a5dcd" +checksum = "e8c6dfa3ac045bc517de14c7b1384298de1dbd229d38e08e169d9ae8c170937c" dependencies = [ "rustls-pki-types", ] diff --git a/cli/Cargo.toml b/cli/Cargo.toml index ec2243a818..ede5cc15cd 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -68,7 +68,7 @@ deno_cache_dir = { workspace = true } deno_config = { version = "=0.35.0", features = ["workspace", "sync"] } deno_core = { workspace = true, features = ["include_js_files_for_snapshotting"] } deno_doc = { version = "0.148.0", features = ["html", "syntect"] } -deno_graph = { version = "=0.82.2" } +deno_graph = { version = "=0.82.3" } deno_lint = { version = "=0.67.0", features = ["docs"] } deno_lockfile.workspace = true deno_npm = "=0.25.2" diff --git a/cli/args/flags.rs b/cli/args/flags.rs index 10fa07bed2..74ccb512f3 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -1,5 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +use std::borrow::Cow; use std::collections::HashSet; use std::env; use std::ffi::OsString; @@ -44,6 +45,7 @@ use crate::args::resolve_no_prompt; use crate::util::fs::canonicalize_path; use super::flags_net; +use super::jsr_url; #[derive(Clone, Debug, Default, Eq, PartialEq)] pub enum ConfigFlag { @@ -639,6 +641,7 @@ pub struct PermissionFlags { pub allow_write: Option>, pub deny_write: Option>, pub no_prompt: bool, + pub allow_import: Option>, } impl PermissionFlags { @@ -658,9 +661,10 @@ impl PermissionFlags { || self.deny_sys.is_some() || self.allow_write.is_some() || self.deny_write.is_some() + || self.allow_import.is_some() } - pub fn to_options(&self) -> PermissionsOptions { + pub fn to_options(&self, cli_arg_urls: &[Cow]) -> PermissionsOptions { fn handle_allow( allow_all: bool, value: Option, @@ -673,6 +677,41 @@ impl PermissionFlags { } } + fn handle_imports( + cli_arg_urls: &[Cow], + imports: Option>, + ) -> Option> { + if imports.is_some() { + return imports; + } + + let builtin_allowed_import_hosts = [ + "deno.land:443", + "esm.sh:443", + "jsr.io:443", + "raw.githubusercontent.com:443", + "gist.githubusercontent.com:443", + ]; + + let mut imports = + Vec::with_capacity(builtin_allowed_import_hosts.len() + 1); + imports + .extend(builtin_allowed_import_hosts.iter().map(|s| s.to_string())); + + // also add the JSR_URL env var + if let Some(jsr_host) = allow_import_host_from_url(jsr_url()) { + imports.push(jsr_host); + } + // include the cli arg urls + for url in cli_arg_urls { + if let Some(host) = allow_import_host_from_url(url) { + imports.push(host); + } + } + + Some(imports) + } + PermissionsOptions { allow_all: self.allow_all, allow_env: handle_allow(self.allow_all, self.allow_env.clone()), @@ -689,11 +728,33 @@ impl PermissionFlags { deny_sys: self.deny_sys.clone(), allow_write: handle_allow(self.allow_all, self.allow_write.clone()), deny_write: self.deny_write.clone(), + allow_import: handle_imports( + cli_arg_urls, + handle_allow(self.allow_all, self.allow_import.clone()), + ), prompt: !resolve_no_prompt(self), } } } +/// Gets the --allow-import host from the provided url +fn allow_import_host_from_url(url: &Url) -> Option { + let host = url.host()?; + if let Some(port) = url.port() { + Some(format!("{}:{}", host, port)) + } else { + use deno_core::url::Host::*; + match host { + Domain(domain) if domain == "jsr.io" && url.scheme() == "https" => None, + _ => match url.scheme() { + "https" => Some(format!("{}:443", host)), + "http" => Some(format!("{}:80", host)), + _ => None, + }, + } + } +} + fn join_paths(allowlist: &[String], d: &str) -> String { allowlist .iter() @@ -881,6 +942,17 @@ impl Flags { _ => {} } + match &self.permissions.allow_import { + Some(allowlist) if allowlist.is_empty() => { + args.push("--allow-import".to_string()); + } + Some(allowlist) => { + let s = format!("--allow-import={}", allowlist.join(",")); + args.push(s); + } + _ => {} + } + args } @@ -991,6 +1063,7 @@ impl Flags { self.permissions.allow_write = None; self.permissions.allow_sys = None; self.permissions.allow_ffi = None; + self.permissions.allow_import = None; } pub fn resolve_watch_exclude_set( @@ -1707,6 +1780,7 @@ Future runs of this module will trigger no downloads or compilation unless --rel ) .arg(frozen_lockfile_arg()) .arg(allow_scripts_arg()) + .arg(allow_import_arg()) }) } @@ -1766,6 +1840,7 @@ Unless --reload is specified, this command will not re-download already cached d .required_unless_present("help") .value_hint(ValueHint::FilePath), ) + .arg(allow_import_arg()) } ) } @@ -1994,6 +2069,7 @@ Show documentation for runtime built-ins: .arg(no_lock_arg()) .arg(no_npm_arg()) .arg(no_remote_arg()) + .arg(allow_import_arg()) .arg( Arg::new("json") .long("json") @@ -2358,6 +2434,7 @@ The following information is shown: .help("UNSTABLE: Outputs the information in JSON format") .action(ArgAction::SetTrue), )) + .arg(allow_import_arg()) } fn install_subcommand() -> Command { @@ -3151,47 +3228,44 @@ fn permission_args(app: Command, requires: Option<&'static str>) -> Command { .after_help(cstr!(r#"Permission options: Docs: https://docs.deno.com/go/permissions - -A, --allow-all Allow all permissions. - --no-prompt Always throw if required permission wasn't passed. - Can also be set via the DENO_NO_PROMPT environment variable. - -R, --allow-read[=<...] Allow file system read access. Optionally specify allowed paths. - --allow-read | --allow-read="/etc,/var/log.txt" - -W, --allow-write[=<...] Allow file system write access. Optionally specify allowed paths. - --allow-write | --allow-write="/etc,/var/log.txt" - -N, --allow-net[=<...] Allow network access. Optionally specify allowed IP addresses and host names, with ports as necessary. - --allow-net | --allow-net="localhost:8080,deno.land" - -E, --allow-env[=<...] Allow access to environment variables. Optionally specify accessible environment variables. - --allow-env | --allow-env="PORT,HOME,PATH" - -S, --allow-sys[=<...] Allow access to OS information. Optionally allow specific APIs by function name. - --allow-sys | --allow-sys="systemMemoryInfo,osRelease" - --allow-run[=<...] Allow running subprocesses. Optionally specify allowed runnable program names. - --allow-run | --allow-run="whoami,ps" - --allow-ffi[=<...] (Unstable) Allow loading dynamic libraries. Optionally specify allowed directories or files. - --allow-ffi | --allow-ffi="./libfoo.so" - --deny-read[=<...] Deny file system read access. Optionally specify denied paths. - --deny-read | --deny-read="/etc,/var/log.txt" - --deny-write[=<...] Deny file system write access. Optionally specify denied paths. - --deny-write | --deny-write="/etc,/var/log.txt" - --deny-net[=<...] Deny network access. Optionally specify defined IP addresses and host names, with ports as necessary. - --deny-net | --deny-net="localhost:8080,deno.land" - --deny-env[=<...] Deny access to environment variables. Optionally specify inacessible environment variables. - --deny-env | --deny-env="PORT,HOME,PATH" - -S, --deny-sys[=<...] Deny access to OS information. Optionally deny specific APIs by function name. - --deny-sys | --deny-sys="systemMemoryInfo,osRelease" - --deny-run[=<...] Deny running subprocesses. Optionally specify denied runnable program names. - --deny-run | --deny-run="whoami,ps" - --deny-ffi[=<...] (Unstable) Deny loading dynamic libraries. Optionally specify denied directories or files. - --deny-ffi | --deny-ffi="./libfoo.so" + -A, --allow-all Allow all permissions. + --no-prompt Always throw if required permission wasn't passed. + Can also be set via the DENO_NO_PROMPT environment variable. + -R, --allow-read[=<...] Allow file system read access. Optionally specify allowed paths. + --allow-read | --allow-read="/etc,/var/log.txt" + -W, --allow-write[=<...] Allow file system write access. Optionally specify allowed paths. + --allow-write | --allow-write="/etc,/var/log.txt" + -I, --allow-import[=<...] Allow importing from remote hosts. Optionally specify allowed IP addresses and host names, with ports as necessary. + Default value: deno.land:443,jsr.io:443,esm.sh:443,raw.githubusercontent.com:443,user.githubusercontent.com:443 + --allow-import | --allow-import="example.com,github.com" + -N, --allow-net[=<...] Allow network access. Optionally specify allowed IP addresses and host names, with ports as necessary. + --allow-net | --allow-net="localhost:8080,deno.land" + -E, --allow-env[=<...] Allow access to environment variables. Optionally specify accessible environment variables. + --allow-env | --allow-env="PORT,HOME,PATH" + -S, --allow-sys[=<...] Allow access to OS information. Optionally allow specific APIs by function name. + --allow-sys | --allow-sys="systemMemoryInfo,osRelease" + --allow-run[=<...] Allow running subprocesses. Optionally specify allowed runnable program names. + --allow-run | --allow-run="whoami,ps" + --allow-ffi[=<...] (Unstable) Allow loading dynamic libraries. Optionally specify allowed directories or files. + --allow-ffi | --allow-ffi="./libfoo.so" + --deny-read[=<...] Deny file system read access. Optionally specify denied paths. + --deny-read | --deny-read="/etc,/var/log.txt" + --deny-write[=<...] Deny file system write access. Optionally specify denied paths. + --deny-write | --deny-write="/etc,/var/log.txt" + --deny-net[=<...] Deny network access. Optionally specify defined IP addresses and host names, with ports as necessary. + --deny-net | --deny-net="localhost:8080,deno.land" + --deny-env[=<...] Deny access to environment variables. Optionally specify inacessible environment variables. + --deny-env | --deny-env="PORT,HOME,PATH" + -S, --deny-sys[=<...] Deny access to OS information. Optionally deny specific APIs by function name. + --deny-sys | --deny-sys="systemMemoryInfo,osRelease" + --deny-run[=<...] Deny running subprocesses. Optionally specify denied runnable program names. + --deny-run | --deny-run="whoami,ps" + --deny-ffi[=<...] (Unstable) Deny loading dynamic libraries. Optionally specify denied directories or files. + --deny-ffi | --deny-ffi="./libfoo.so" "#)) .arg( { - let mut arg = Arg::new("allow-all") - .short('A') - .long("allow-all") - .action(ArgAction::SetTrue) - .help("Allow all permissions") - .hide(true) - ; + let mut arg = allow_all_arg().hide(true); if let Some(requires) = requires { arg = arg.requires(requires) } @@ -3200,7 +3274,7 @@ fn permission_args(app: Command, requires: Option<&'static str>) -> Command { ) .arg( { - let mut arg = Arg::new("allow-read") + let mut arg = Arg::new("allow-read") .long("allow-read") .short('R') .num_args(0..) @@ -3218,7 +3292,7 @@ fn permission_args(app: Command, requires: Option<&'static str>) -> Command { ) .arg( { - let mut arg = Arg::new("deny-read") + let mut arg = Arg::new("deny-read") .long("deny-read") .num_args(0..) .action(ArgAction::Append) @@ -3235,7 +3309,7 @@ fn permission_args(app: Command, requires: Option<&'static str>) -> Command { ) .arg( { - let mut arg = Arg::new("allow-write") + let mut arg = Arg::new("allow-write") .long("allow-write") .short('W') .num_args(0..) @@ -3253,7 +3327,7 @@ fn permission_args(app: Command, requires: Option<&'static str>) -> Command { ) .arg( { - let mut arg = Arg::new("deny-write") + let mut arg = Arg::new("deny-write") .long("deny-write") .num_args(0..) .action(ArgAction::Append) @@ -3270,7 +3344,7 @@ fn permission_args(app: Command, requires: Option<&'static str>) -> Command { ) .arg( { - let mut arg = Arg::new("allow-net") + let mut arg = Arg::new("allow-net") .long("allow-net") .short('N') .num_args(0..) @@ -3289,7 +3363,7 @@ fn permission_args(app: Command, requires: Option<&'static str>) -> Command { ) .arg( { - let mut arg = Arg::new("deny-net") + let mut arg = Arg::new("deny-net") .long("deny-net") .num_args(0..) .use_value_delimiter(true) @@ -3383,7 +3457,7 @@ fn permission_args(app: Command, requires: Option<&'static str>) -> Command { ) .arg( { - let mut arg = Arg::new("deny-sys") + let mut arg = Arg::new("deny-sys") .long("deny-sys") .num_args(0..) .use_value_delimiter(true) @@ -3418,7 +3492,7 @@ fn permission_args(app: Command, requires: Option<&'static str>) -> Command { ) .arg( { - let mut arg = Arg::new("deny-run") + let mut arg = Arg::new("deny-run") .long("deny-run") .num_args(0..) .use_value_delimiter(true) @@ -3509,6 +3583,26 @@ fn permission_args(app: Command, requires: Option<&'static str>) -> Command { arg } ) + .arg( + { + let mut arg = allow_import_arg().hide(true); + if let Some(requires) = requires { + // allow this for install --global + if requires != "global" { + arg = arg.requires(requires) + } + } + arg + } + ) +} + +fn allow_all_arg() -> Arg { + Arg::new("allow-all") + .short('A') + .long("allow-all") + .action(ArgAction::SetTrue) + .help("Allow all permissions") } fn runtime_args( @@ -3537,6 +3631,20 @@ fn runtime_args( .arg(strace_ops_arg()) } +fn allow_import_arg() -> Arg { + Arg::new("allow-import") + .long("allow-import") + .short('I') + .num_args(0..) + .use_value_delimiter(true) + .require_equals(true) + .value_name("IP_OR_HOSTNAME") + .help(cstr!( + "Allow importing from remote hosts. Optionally specify allowed IP addresses and host names, with ports as necessary. Default value: deno.land:443,jsr.io:443,esm.sh:443,raw.githubusercontent.com:443,user.githubusercontent.com:443" + )) + .value_parser(flags_net::validator) +} + fn inspect_args(app: Command) -> Command { app .arg( @@ -4174,6 +4282,7 @@ fn cache_parse( unstable_args_parse(flags, matches, UnstableArgsConfig::ResolutionOnly); frozen_lockfile_arg_parse(flags, matches); allow_scripts_arg_parse(flags, matches)?; + allow_import_parse(flags, matches); let files = matches.remove_many::("file").unwrap().collect(); flags.subcommand = DenoSubcommand::Cache(CacheFlags { files }); Ok(()) @@ -4195,6 +4304,7 @@ fn check_parse( doc: matches.get_flag("doc"), doc_only: matches.get_flag("doc-only"), }); + allow_import_parse(flags, matches); Ok(()) } @@ -4320,6 +4430,7 @@ fn doc_parse( no_lock_arg_parse(flags, matches); no_npm_arg_parse(flags, matches); no_remote_arg_parse(flags, matches); + allow_import_parse(flags, matches); let source_files_val = matches.remove_many::("source_file"); let source_files = if let Some(val) = source_files_val { @@ -4460,6 +4571,7 @@ fn info_parse( lock_args_parse(flags, matches); no_remote_arg_parse(flags, matches); no_npm_arg_parse(flags, matches); + allow_import_parse(flags, matches); let json = matches.get_flag("json"); flags.subcommand = DenoSubcommand::Info(InfoFlags { file: matches.remove_one::("file"), @@ -4495,6 +4607,7 @@ fn install_parse( force, }), }); + return Ok(()); } @@ -5175,13 +5288,22 @@ fn permission_args_parse( } if matches.get_flag("allow-hrtime") || matches.get_flag("deny-hrtime") { - log::warn!("⚠️ Warning: `allow-hrtime` and `deny-hrtime` have been removed in Deno 2, as high resolution time is now always allowed."); + // use eprintln instead of log::warn because logging hasn't been initialized yet + #[allow(clippy::print_stderr)] + { + eprintln!( + "{} `allow-hrtime` and `deny-hrtime` have been removed in Deno 2, as high resolution time is now always allowed", + deno_runtime::colors::yellow("Warning") + ); + } } if matches.get_flag("allow-all") { flags.allow_all(); } + allow_import_parse(flags, matches); + if matches.get_flag("no-prompt") { flags.permissions.no_prompt = true; } @@ -5189,6 +5311,13 @@ fn permission_args_parse( Ok(()) } +fn allow_import_parse(flags: &mut Flags, matches: &mut ArgMatches) { + if let Some(imports_wl) = matches.remove_many::("allow-import") { + let imports_allowlist = flags_net::parse(imports_wl.collect()).unwrap(); + flags.permissions.allow_import = Some(imports_allowlist); + } +} + fn unsafely_ignore_certificate_errors_parse( flags: &mut Flags, matches: &mut ArgMatches, @@ -6215,7 +6344,7 @@ mod tests { #[test] fn short_permission_flags() { - let r = flags_from_vec(svec!["deno", "run", "-RNESW", "gist.ts"]); + let r = flags_from_vec(svec!["deno", "run", "-RNESWI", "gist.ts"]); assert_eq!( r.unwrap(), Flags { @@ -6226,6 +6355,7 @@ mod tests { allow_read: Some(vec![]), allow_write: Some(vec![]), allow_env: Some(vec![]), + allow_import: Some(vec![]), allow_net: Some(vec![]), allow_sys: Some(vec![]), ..Default::default() @@ -10777,7 +10907,7 @@ mod tests { } ); // just make sure this doesn't panic - let _ = flags.permissions.to_options(); + let _ = flags.permissions.to_options(&[]); } #[test] @@ -10852,4 +10982,27 @@ mod tests { Usage: deno repl [OPTIONS] [-- [ARGS]...]\n" ) } + + #[test] + fn test_allow_import_host_from_url() { + fn parse(text: &str) -> Option { + allow_import_host_from_url(&Url::parse(text).unwrap()) + } + + assert_eq!(parse("https://jsr.io"), None); + assert_eq!( + parse("http://127.0.0.1:4250"), + Some("127.0.0.1:4250".to_string()) + ); + assert_eq!(parse("http://jsr.io"), Some("jsr.io:80".to_string())); + assert_eq!( + parse("https://example.com"), + Some("example.com:443".to_string()) + ); + assert_eq!( + parse("http://example.com"), + Some("example.com:80".to_string()) + ); + assert_eq!(parse("file:///example.com"), None); + } } diff --git a/cli/args/mod.rs b/cli/args/mod.rs index 1c92777ae3..80b9afb24a 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -769,6 +769,7 @@ pub struct CliOptions { // application need not concern itself with, so keep these private flags: Arc, initial_cwd: PathBuf, + main_module_cell: std::sync::OnceLock>, maybe_node_modules_folder: Option, npmrc: Arc, maybe_lockfile: Option>, @@ -825,6 +826,7 @@ impl CliOptions { npmrc, maybe_node_modules_folder, overrides: Default::default(), + main_module_cell: std::sync::OnceLock::new(), start_dir, deno_dir_provider, }) @@ -1105,40 +1107,43 @@ impl CliOptions { self.flags.env_file.as_ref() } - pub fn resolve_main_module(&self) -> Result { - let main_module = match &self.flags.subcommand { - DenoSubcommand::Compile(compile_flags) => { - resolve_url_or_path(&compile_flags.source_file, self.initial_cwd())? - } - DenoSubcommand::Eval(_) => { - resolve_url_or_path("./$deno$eval.ts", self.initial_cwd())? - } - DenoSubcommand::Repl(_) => { - resolve_url_or_path("./$deno$repl.ts", self.initial_cwd())? - } - DenoSubcommand::Run(run_flags) => { - if run_flags.is_stdin() { - std::env::current_dir() - .context("Unable to get CWD") - .and_then(|cwd| { - resolve_url_or_path("./$deno$stdin.ts", &cwd) - .map_err(AnyError::from) - })? - } else if NpmPackageReqReference::from_str(&run_flags.script).is_ok() { - ModuleSpecifier::parse(&run_flags.script)? - } else { - resolve_url_or_path(&run_flags.script, self.initial_cwd())? - } - } - DenoSubcommand::Serve(run_flags) => { - resolve_url_or_path(&run_flags.script, self.initial_cwd())? - } - _ => { - bail!("No main module.") - } - }; + pub fn resolve_main_module(&self) -> Result<&ModuleSpecifier, AnyError> { + self + .main_module_cell + .get_or_init(|| { + let main_module = match &self.flags.subcommand { + DenoSubcommand::Compile(compile_flags) => { + resolve_url_or_path(&compile_flags.source_file, self.initial_cwd())? + } + DenoSubcommand::Eval(_) => { + resolve_url_or_path("./$deno$eval.ts", self.initial_cwd())? + } + DenoSubcommand::Repl(_) => { + resolve_url_or_path("./$deno$repl.ts", self.initial_cwd())? + } + DenoSubcommand::Run(run_flags) => { + if run_flags.is_stdin() { + resolve_url_or_path("./$deno$stdin.ts", self.initial_cwd())? + } else if NpmPackageReqReference::from_str(&run_flags.script) + .is_ok() + { + ModuleSpecifier::parse(&run_flags.script)? + } else { + resolve_url_or_path(&run_flags.script, self.initial_cwd())? + } + } + DenoSubcommand::Serve(run_flags) => { + resolve_url_or_path(&run_flags.script, self.initial_cwd())? + } + _ => { + bail!("No main module.") + } + }; - Ok(main_module) + Ok(main_module) + }) + .as_ref() + .map_err(|err| deno_core::anyhow::anyhow!("{}", err)) } pub fn resolve_file_header_overrides( @@ -1159,7 +1164,7 @@ impl CliOptions { (maybe_main_specifier, maybe_content_type) { HashMap::from([( - main_specifier, + main_specifier.clone(), HashMap::from([("content-type".to_string(), content_type.to_string())]), )]) } else { @@ -1480,7 +1485,34 @@ impl CliOptions { } pub fn permissions_options(&self) -> PermissionsOptions { - self.flags.permissions.to_options() + fn files_to_urls(files: &[String]) -> Vec> { + files + .iter() + .filter_map(|f| Url::parse(f).ok().map(Cow::Owned)) + .collect() + } + + // get a list of urls to imply for --allow-import + let cli_arg_urls = self + .resolve_main_module() + .ok() + .map(|url| vec![Cow::Borrowed(url)]) + .or_else(|| match &self.flags.subcommand { + DenoSubcommand::Cache(cache_flags) => { + Some(files_to_urls(&cache_flags.files)) + } + DenoSubcommand::Check(check_flags) => { + Some(files_to_urls(&check_flags.files)) + } + DenoSubcommand::Install(InstallFlags { + kind: InstallKind::Global(flags), + }) => Url::parse(&flags.module_url) + .ok() + .map(|url| vec![Cow::Owned(url)]), + _ => None, + }) + .unwrap_or_default(); + self.flags.permissions.to_options(&cli_arg_urls) } pub fn reload_flag(&self) -> bool { diff --git a/cli/cache/mod.rs b/cli/cache/mod.rs index a95c350866..2d88137165 100644 --- a/cli/cache/mod.rs +++ b/cli/cache/mod.rs @@ -1,10 +1,11 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +use crate::args::jsr_url; use crate::args::CacheSetting; use crate::errors::get_error_class_name; use crate::file_fetcher::FetchNoFollowOptions; use crate::file_fetcher::FetchOptions; -use crate::file_fetcher::FetchPermissionsOption; +use crate::file_fetcher::FetchPermissionsOptionRef; use crate::file_fetcher::FileFetcher; use crate::file_fetcher::FileOrRedirect; use crate::npm::CliNpmResolver; @@ -19,6 +20,7 @@ use deno_graph::source::CacheInfo; use deno_graph::source::LoadFuture; use deno_graph::source::LoadResponse; use deno_graph::source::Loader; +use deno_runtime::deno_permissions::PermissionsContainer; use std::collections::HashMap; use std::path::Path; use std::path::PathBuf; @@ -104,6 +106,13 @@ pub type LocalLspHttpCache = deno_cache_dir::LocalLspHttpCache; pub use deno_cache_dir::HttpCache; +pub struct FetchCacherOptions { + pub file_header_overrides: HashMap>, + pub permissions: PermissionsContainer, + /// If we're publishing for `deno publish`. + pub is_deno_publish: bool, +} + /// A "wrapper" for the FileFetcher and DiskCache for the Deno CLI that provides /// a concise interface to the DENO_DIR when building module graphs. pub struct FetchCacher { @@ -112,26 +121,27 @@ pub struct FetchCacher { global_http_cache: Arc, npm_resolver: Arc, module_info_cache: Arc, - permissions: FetchPermissionsOption, + permissions: PermissionsContainer, cache_info_enabled: bool, + is_deno_publish: bool, } impl FetchCacher { pub fn new( file_fetcher: Arc, - file_header_overrides: HashMap>, global_http_cache: Arc, npm_resolver: Arc, module_info_cache: Arc, - permissions: FetchPermissionsOption, + options: FetchCacherOptions, ) -> Self { Self { file_fetcher, - file_header_overrides, global_http_cache, npm_resolver, module_info_cache, - permissions, + file_header_overrides: options.file_header_overrides, + permissions: options.permissions, + is_deno_publish: options.is_deno_publish, cache_info_enabled: false, } } @@ -208,10 +218,24 @@ impl Loader for FetchCacher { } } + if self.is_deno_publish + && matches!(specifier.scheme(), "http" | "https") + && !specifier.as_str().starts_with(jsr_url().as_str()) + { + // mark non-JSR remote modules as external so we don't need --allow-import + // permissions as these will error out later when publishing + return Box::pin(futures::future::ready(Ok(Some( + LoadResponse::External { + specifier: specifier.clone(), + }, + )))); + } + let file_fetcher = self.file_fetcher.clone(); let file_header_overrides = self.file_header_overrides.clone(); let permissions = self.permissions.clone(); let specifier = specifier.clone(); + let is_statically_analyzable = !options.was_dynamic_root; async move { let maybe_cache_setting = match options.cache_setting { @@ -230,7 +254,11 @@ impl Loader for FetchCacher { .fetch_no_follow_with_options(FetchNoFollowOptions { fetch_options: FetchOptions { specifier: &specifier, - permissions: permissions.as_ref(), + permissions: if is_statically_analyzable { + FetchPermissionsOptionRef::StaticContainer(&permissions) + } else { + FetchPermissionsOptionRef::DynamicContainer(&permissions) + }, maybe_accept: None, maybe_cache_setting: maybe_cache_setting.as_ref(), }, diff --git a/cli/factory.rs b/cli/factory.rs index 0f49546d07..8aea635d2d 100644 --- a/cli/factory.rs +++ b/cli/factory.rs @@ -185,6 +185,7 @@ struct CliFactoryServices { node_resolver: Deferred>, npm_resolver: Deferred>, permission_desc_parser: Deferred>, + root_permissions_container: Deferred, sloppy_imports_resolver: Deferred>>, text_only_progress_bar: Deferred, type_checker: Deferred>, @@ -626,6 +627,7 @@ impl CliFactory { self.maybe_file_watcher_reporter().clone(), self.file_fetcher()?.clone(), self.global_http_cache()?.clone(), + self.root_permissions_container()?.clone(), ))) }) .await @@ -659,6 +661,7 @@ impl CliFactory { Ok(Arc::new(MainModuleGraphContainer::new( self.cli_options()?.clone(), self.module_load_preparer().await?.clone(), + self.root_permissions_container()?.clone(), ))) }) .await @@ -755,15 +758,20 @@ impl CliFactory { )) } - pub fn create_permissions_container( + pub fn root_permissions_container( &self, - ) -> Result { - let desc_parser = self.permission_desc_parser()?.clone(); - let permissions = Permissions::from_options( - desc_parser.as_ref(), - &self.cli_options()?.permissions_options(), - )?; - Ok(PermissionsContainer::new(desc_parser, permissions)) + ) -> Result<&PermissionsContainer, AnyError> { + self + .services + .root_permissions_container + .get_or_try_init(|| { + let desc_parser = self.permission_desc_parser()?.clone(); + let permissions = Permissions::from_options( + desc_parser.as_ref(), + &self.cli_options()?.permissions_options(), + )?; + Ok(PermissionsContainer::new(desc_parser, permissions)) + }) } pub async fn create_cli_main_worker_factory( @@ -816,6 +824,7 @@ impl CliFactory { npm_resolver.clone(), self.permission_desc_parser()?.clone(), self.root_cert_store_provider().clone(), + self.root_permissions_container()?.clone(), StorageKeyResolver::from_options(cli_options), cli_options.sub_command().clone(), self.create_cli_main_worker_options()?, diff --git a/cli/file_fetcher.rs b/cli/file_fetcher.rs index 2f4b0b3dc5..ca11449393 100644 --- a/cli/file_fetcher.rs +++ b/cli/file_fetcher.rs @@ -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; @@ -135,7 +136,7 @@ impl MemoryFiles { /// Fetch a source file from the local file system. fn fetch_local(specifier: &ModuleSpecifier) -> Result { - 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 @@ -173,30 +174,8 @@ fn get_validated_scheme( #[derive(Debug, Copy, Clone)] pub enum FetchPermissionsOptionRef<'a> { AllowAll, - Container(&'a PermissionsContainer), -} - -#[derive(Debug, Clone)] -pub enum FetchPermissionsOption { - AllowAll, - Container(PermissionsContainer), -} - -impl FetchPermissionsOption { - pub fn as_ref(&self) -> FetchPermissionsOptionRef { - match self { - FetchPermissionsOption::AllowAll => FetchPermissionsOptionRef::AllowAll, - FetchPermissionsOption::Container(container) => { - FetchPermissionsOptionRef::Container(container) - } - } - } -} - -impl From for FetchPermissionsOption { - fn from(value: PermissionsContainer) -> Self { - Self::Container(value) - } + DynamicContainer(&'a PermissionsContainer), + StaticContainer(&'a PermissionsContainer), } pub struct FetchOptions<'a> { @@ -564,7 +543,6 @@ impl FileFetcher { } /// Fetch a source file and asynchronously return it. - #[allow(dead_code)] // todo(25469): undo when merging #[inline(always)] pub async fn fetch( &self, @@ -572,7 +550,10 @@ impl FileFetcher { permissions: &PermissionsContainer, ) -> Result { self - .fetch_inner(specifier, FetchPermissionsOptionRef::Container(permissions)) + .fetch_inner( + specifier, + FetchPermissionsOptionRef::StaticContainer(permissions), + ) .await } @@ -647,8 +628,17 @@ impl FileFetcher { FetchPermissionsOptionRef::AllowAll => { // allow } - FetchPermissionsOptionRef::Container(permissions) => { - permissions.check_specifier(specifier)?; + FetchPermissionsOptionRef::StaticContainer(permissions) => { + permissions.check_specifier( + specifier, + deno_runtime::deno_permissions::CheckSpecifierKind::Static, + )?; + } + FetchPermissionsOptionRef::DynamicContainer(permissions) => { + permissions.check_specifier( + specifier, + deno_runtime::deno_permissions::CheckSpecifierKind::Dynamic, + )?; } } if let Some(file) = self.memory_files.get(specifier) { diff --git a/cli/graph_container.rs b/cli/graph_container.rs index 211b278e08..c463d71a6a 100644 --- a/cli/graph_container.rs +++ b/cli/graph_container.rs @@ -9,9 +9,9 @@ use deno_core::error::AnyError; use deno_core::parking_lot::RwLock; use deno_graph::ModuleGraph; use deno_runtime::colors; +use deno_runtime::deno_permissions::PermissionsContainer; use crate::args::CliOptions; -use crate::file_fetcher::FetchPermissionsOption; use crate::module_loader::ModuleLoadPreparer; use crate::util::fs::collect_specifiers; use crate::util::path::is_script_ext; @@ -45,12 +45,14 @@ pub struct MainModuleGraphContainer { inner: Arc>>, cli_options: Arc, module_load_preparer: Arc, + root_permissions: PermissionsContainer, } impl MainModuleGraphContainer { pub fn new( cli_options: Arc, module_load_preparer: Arc, + root_permissions: PermissionsContainer, ) -> Self { Self { update_queue: Default::default(), @@ -59,6 +61,7 @@ impl MainModuleGraphContainer { )))), cli_options, module_load_preparer, + root_permissions, } } @@ -76,7 +79,7 @@ impl MainModuleGraphContainer { specifiers, false, self.cli_options.ts_type_lib_window(), - FetchPermissionsOption::AllowAll, + self.root_permissions.clone(), ext_overwrite, ) .await?; diff --git a/cli/graph_util.rs b/cli/graph_util.rs index 1add83eb99..d8f7ae749c 100644 --- a/cli/graph_util.rs +++ b/cli/graph_util.rs @@ -11,7 +11,6 @@ use crate::cache::ModuleInfoCache; use crate::cache::ParsedSourceCache; use crate::colors; use crate::errors::get_error_class_name; -use crate::file_fetcher::FetchPermissionsOption; use crate::file_fetcher::FileFetcher; use crate::npm::CliNpmResolver; use crate::resolver::CliGraphResolver; @@ -41,6 +40,7 @@ use deno_graph::ResolutionError; use deno_graph::SpecifierError; use deno_runtime::deno_fs::FileSystem; use deno_runtime::deno_node; +use deno_runtime::deno_permissions::PermissionsContainer; use deno_runtime::fs_util::specifier_to_file_path; use deno_semver::jsr::JsrDepPackageReq; use deno_semver::package::PackageNv; @@ -249,6 +249,19 @@ impl ModuleGraphCreator { package_configs: &[JsrPackageConfig], build_fast_check_graph: bool, ) -> Result { + fn graph_has_external_remote(graph: &ModuleGraph) -> bool { + // Earlier on, we marked external non-JSR modules as external. + // If the graph contains any of those, it would cause type checking + // to crash, so since publishing is going to fail anyway, skip type + // checking. + graph.modules().any(|module| match module { + deno_graph::Module::External(external_module) => { + matches!(external_module.specifier.scheme(), "http" | "https") + } + _ => false, + }) + } + let mut roots = Vec::new(); for package_config in package_configs { roots.extend(package_config.config_file.resolve_export_value_urls()?); @@ -262,9 +275,12 @@ impl ModuleGraphCreator { }) .await?; self.graph_valid(&graph)?; - if self.options.type_check_mode().is_true() { + if self.options.type_check_mode().is_true() + && !graph_has_external_remote(&graph) + { self.type_check_graph(graph.clone()).await?; } + if build_fast_check_graph { let fast_check_workspace_members = package_configs .iter() @@ -279,6 +295,7 @@ impl ModuleGraphCreator { }, )?; } + Ok(graph) } @@ -370,6 +387,7 @@ pub struct ModuleGraphBuilder { maybe_file_watcher_reporter: Option, file_fetcher: Arc, global_http_cache: Arc, + root_permissions_container: PermissionsContainer, } impl ModuleGraphBuilder { @@ -386,6 +404,7 @@ impl ModuleGraphBuilder { maybe_file_watcher_reporter: Option, file_fetcher: Arc, global_http_cache: Arc, + root_permissions_container: PermissionsContainer, ) -> Self { Self { options, @@ -399,6 +418,7 @@ impl ModuleGraphBuilder { maybe_file_watcher_reporter, file_fetcher, global_http_cache, + root_permissions_container, } } @@ -670,20 +690,26 @@ impl ModuleGraphBuilder { /// Creates the default loader used for creating a graph. pub fn create_graph_loader(&self) -> cache::FetchCacher { - self.create_fetch_cacher(FetchPermissionsOption::AllowAll) + self.create_fetch_cacher(self.root_permissions_container.clone()) } pub fn create_fetch_cacher( &self, - permissions: FetchPermissionsOption, + permissions: PermissionsContainer, ) -> cache::FetchCacher { cache::FetchCacher::new( self.file_fetcher.clone(), - self.options.resolve_file_header_overrides(), self.global_http_cache.clone(), self.npm_resolver.clone(), self.module_info_cache.clone(), - permissions, + cache::FetchCacherOptions { + file_header_overrides: self.options.resolve_file_header_overrides(), + permissions, + is_deno_publish: matches!( + self.options.sub_command(), + crate::args::DenoSubcommand::Publish { .. } + ), + }, ) } diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs index 85daa4e289..aed4b47efc 100644 --- a/cli/lsp/language_server.rs +++ b/cli/lsp/language_server.rs @@ -3614,6 +3614,11 @@ impl Inner { }), // bit of a hack to force the lsp to cache the @types/node package type_check_mode: crate::args::TypeCheckMode::Local, + permissions: crate::args::PermissionFlags { + // allow remote import permissions in the lsp for now + allow_import: Some(vec![]), + ..Default::default() + }, ..Default::default() }), initial_cwd, diff --git a/cli/module_loader.rs b/cli/module_loader.rs index a81c5a0aa8..f4e219bea1 100644 --- a/cli/module_loader.rs +++ b/cli/module_loader.rs @@ -104,7 +104,7 @@ impl ModuleLoadPreparer { roots: &[ModuleSpecifier], is_dynamic: bool, lib: TsTypeLib, - permissions: crate::file_fetcher::FetchPermissionsOption, + permissions: PermissionsContainer, ext_overwrite: Option<&String>, ) -> Result<(), AnyError> { log::debug!("Preparing module load."); @@ -252,13 +252,15 @@ impl CliModuleLoaderFactory { &self, graph_container: TGraphContainer, lib: TsTypeLib, - root_permissions: PermissionsContainer, - dynamic_permissions: PermissionsContainer, + is_worker: bool, + parent_permissions: PermissionsContainer, + permissions: PermissionsContainer, ) -> ModuleLoaderAndSourceMapGetter { let loader = Rc::new(CliModuleLoader(Rc::new(CliModuleLoaderInner { lib, - root_permissions, - dynamic_permissions, + is_worker, + parent_permissions, + permissions, graph_container, emitter: self.shared.emitter.clone(), parsed_source_cache: self.shared.parsed_source_cache.clone(), @@ -274,20 +276,20 @@ impl ModuleLoaderFactory for CliModuleLoaderFactory { fn create_for_main( &self, root_permissions: PermissionsContainer, - dynamic_permissions: PermissionsContainer, ) -> ModuleLoaderAndSourceMapGetter { self.create_with_lib( (*self.shared.main_module_graph_container).clone(), self.shared.lib_window, + /* is worker */ false, + root_permissions.clone(), root_permissions, - dynamic_permissions, ) } fn create_for_worker( &self, - root_permissions: PermissionsContainer, - dynamic_permissions: PermissionsContainer, + parent_permissions: PermissionsContainer, + permissions: PermissionsContainer, ) -> ModuleLoaderAndSourceMapGetter { self.create_with_lib( // create a fresh module graph for the worker @@ -295,21 +297,21 @@ impl ModuleLoaderFactory for CliModuleLoaderFactory { self.shared.graph_kind, ))), self.shared.lib_worker, - root_permissions, - dynamic_permissions, + /* is worker */ true, + parent_permissions, + permissions, ) } } struct CliModuleLoaderInner { lib: TsTypeLib, + is_worker: bool, /// The initial set of permissions used to resolve the static imports in the /// worker. These are "allow all" for main worker, and parent thread /// permissions for Web Worker. - root_permissions: PermissionsContainer, - /// Permissions used to resolve dynamic imports, these get passed as - /// "root permissions" for Web Worker. - dynamic_permissions: PermissionsContainer, + parent_permissions: PermissionsContainer, + permissions: PermissionsContainer, shared: Arc, emitter: Arc, parsed_source_cache: Arc, @@ -769,11 +771,12 @@ impl ModuleLoader } } - let root_permissions = if is_dynamic { - inner.dynamic_permissions.clone() + let permissions = if is_dynamic { + inner.permissions.clone() } else { - inner.root_permissions.clone() + inner.parent_permissions.clone() }; + let is_dynamic = is_dynamic || inner.is_worker; // consider workers as dynamic for permissions let lib = inner.lib; let mut update_permit = graph_container.acquire_update_permit().await; let graph = update_permit.graph_mut(); @@ -783,7 +786,7 @@ impl ModuleLoader &[specifier], is_dynamic, lib, - root_permissions.into(), + permissions, None, ) .await?; diff --git a/cli/standalone/mod.rs b/cli/standalone/mod.rs index bab2667347..c501d2d6bc 100644 --- a/cli/standalone/mod.rs +++ b/cli/standalone/mod.rs @@ -130,8 +130,6 @@ struct SharedModuleLoaderState { #[derive(Clone)] struct EmbeddedModuleLoader { shared: Arc, - root_permissions: PermissionsContainer, - dynamic_permissions: PermissionsContainer, } pub const MODULE_NOT_FOUND: &str = "Module not found"; @@ -402,28 +400,23 @@ struct StandaloneModuleLoaderFactory { impl ModuleLoaderFactory for StandaloneModuleLoaderFactory { fn create_for_main( &self, - root_permissions: PermissionsContainer, - dynamic_permissions: PermissionsContainer, + _root_permissions: PermissionsContainer, ) -> ModuleLoaderAndSourceMapGetter { ModuleLoaderAndSourceMapGetter { module_loader: Rc::new(EmbeddedModuleLoader { shared: self.shared.clone(), - root_permissions, - dynamic_permissions, }), } } fn create_for_worker( &self, - root_permissions: PermissionsContainer, - dynamic_permissions: PermissionsContainer, + _parent_permissions: PermissionsContainer, + _permissions: PermissionsContainer, ) -> ModuleLoaderAndSourceMapGetter { ModuleLoaderAndSourceMapGetter { module_loader: Rc::new(EmbeddedModuleLoader { shared: self.shared.clone(), - root_permissions, - dynamic_permissions, }), } } @@ -664,7 +657,8 @@ pub async fn run( }; let permissions = { - let mut permissions = metadata.permissions.to_options(); + let mut permissions = + metadata.permissions.to_options(/* cli_arg_urls */ &[]); // if running with an npm vfs, grant read access to it if let Some(vfs_root) = maybe_vfs_root { match &mut permissions.allow_read { @@ -713,6 +707,7 @@ pub async fn run( npm_resolver, permission_desc_parser, root_cert_store_provider, + permissions, StorageKeyResolver::empty(), crate::args::DenoSubcommand::Run(Default::default()), CliMainWorkerOptions { @@ -752,7 +747,7 @@ pub async fn run( deno_core::JsRuntime::init_platform(None, true); let mut worker = worker_factory - .create_main_worker(WorkerExecutionMode::Run, main_module, permissions) + .create_main_worker(WorkerExecutionMode::Run, main_module) .await?; let exit_code = worker.run().await?; diff --git a/cli/tools/check.rs b/cli/tools/check.rs index c22afbb9a7..7edb392d48 100644 --- a/cli/tools/check.rs +++ b/cli/tools/check.rs @@ -51,6 +51,7 @@ pub async fn check( let specifiers_for_typecheck = if check_flags.doc || check_flags.doc_only { let file_fetcher = factory.file_fetcher()?; + let root_permissions = factory.root_permissions_container()?; let mut specifiers_for_typecheck = if check_flags.doc { specifiers.clone() @@ -59,7 +60,7 @@ pub async fn check( }; for s in specifiers { - let file = file_fetcher.fetch_bypass_permissions(&s).await?; + let file = file_fetcher.fetch(&s, root_permissions).await?; let snippet_files = extract::extract_snippet_files(file)?; for snippet_file in snippet_files { specifiers_for_typecheck.push(snippet_file.specifier.clone()); diff --git a/cli/tools/compile.rs b/cli/tools/compile.rs index b9620cfded..c1f98bc08a 100644 --- a/cli/tools/compile.rs +++ b/cli/tools/compile.rs @@ -135,7 +135,7 @@ pub async fn compile( file, eszip, root_dir_url, - &module_specifier, + module_specifier, &compile_flags, cli_options, ) diff --git a/cli/tools/info.rs b/cli/tools/info.rs index d78b83cbe3..174785631e 100644 --- a/cli/tools/info.rs +++ b/cli/tools/info.rs @@ -644,8 +644,21 @@ impl<'a> GraphDisplayContext<'a> { ModuleError::InvalidTypeAssertion { .. } => { self.build_error_msg(specifier, "(invalid import attribute)") } - ModuleError::LoadingErr(_, _, _) => { - self.build_error_msg(specifier, "(loading error)") + ModuleError::LoadingErr(_, _, err) => { + use deno_graph::ModuleLoadError::*; + let message = match err { + HttpsChecksumIntegrity(_) => "(checksum integrity error)", + Decode(_) => "(loading decode error)", + Loader(err) => match deno_core::error::get_custom_error_class(err) { + Some("NotCapable") => "(not capable, requires --allow-import)", + _ => "(loading error)", + }, + Jsr(_) => "(loading error)", + NodeUnknownBuiltinModule(_) => "(unknown node built-in error)", + Npm(_) => "(npm loading error)", + TooManyRedirects => "(too many redirects error)", + }; + self.build_error_msg(specifier, message.as_ref()) } ModuleError::ParseErr(_, _) => { self.build_error_msg(specifier, "(parsing error)") diff --git a/cli/tools/registry/diagnostics.rs b/cli/tools/registry/diagnostics.rs index c53a39683e..733a78ddac 100644 --- a/cli/tools/registry/diagnostics.rs +++ b/cli/tools/registry/diagnostics.rs @@ -3,7 +3,6 @@ use std::borrow::Cow; use std::path::PathBuf; use std::sync::Arc; -use std::sync::Mutex; use deno_ast::diagnostics::Diagnostic; use deno_ast::diagnostics::DiagnosticLevel; @@ -21,6 +20,7 @@ use deno_ast::SourceRanged; use deno_ast::SourceTextInfo; use deno_core::anyhow::anyhow; use deno_core::error::AnyError; +use deno_core::parking_lot::Mutex; use deno_core::url::Url; use deno_graph::FastCheckDiagnostic; use deno_semver::Version; @@ -36,7 +36,7 @@ impl PublishDiagnosticsCollector { pub fn print_and_error(&self) -> Result<(), AnyError> { let mut errors = 0; let mut has_slow_types_errors = false; - let mut diagnostics = self.diagnostics.lock().unwrap().take(); + let mut diagnostics = self.diagnostics.lock().take(); diagnostics.sort_by_cached_key(|d| d.sorting_key()); @@ -75,8 +75,16 @@ impl PublishDiagnosticsCollector { } } + pub fn has_error(&self) -> bool { + self + .diagnostics + .lock() + .iter() + .any(|d| matches!(d.level(), DiagnosticLevel::Error)) + } + pub fn push(&self, diagnostic: PublishDiagnostic) { - self.diagnostics.lock().unwrap().push(diagnostic); + self.diagnostics.lock().push(diagnostic); } } diff --git a/cli/tools/registry/mod.rs b/cli/tools/registry/mod.rs index fbdcd9e779..941514b045 100644 --- a/cli/tools/registry/mod.rs +++ b/cli/tools/registry/mod.rs @@ -341,13 +341,11 @@ impl PublishPreparer { bail!("Exiting due to DENO_INTERNAL_FAST_CHECK_OVERWRITE") } else { log::info!("Checking for slow types in the public API..."); - let mut any_pkg_had_diagnostics = false; for package in package_configs { let export_urls = package.config_file.resolve_export_value_urls()?; let diagnostics = collect_no_slow_type_diagnostics(&graph, &export_urls); if !diagnostics.is_empty() { - any_pkg_had_diagnostics = true; for diagnostic in diagnostics { diagnostics_collector .push(PublishDiagnostic::FastCheck(diagnostic)); @@ -355,7 +353,9 @@ impl PublishPreparer { } } - if any_pkg_had_diagnostics { + // skip type checking the slow type graph if there are any errors because + // errors like remote modules existing will cause type checking to crash + if diagnostics_collector.has_error() { Ok(Arc::new(graph)) } else { // fast check passed, type check the output as a temporary measure diff --git a/cli/tools/registry/pm/cache_deps.rs b/cli/tools/registry/pm/cache_deps.rs index a598170557..7d1773b343 100644 --- a/cli/tools/registry/pm/cache_deps.rs +++ b/cli/tools/registry/pm/cache_deps.rs @@ -16,6 +16,7 @@ pub async fn cache_top_level_deps( ) -> Result<(), AnyError> { let npm_resolver = factory.npm_resolver().await?; let cli_options = factory.cli_options()?; + let root_permissions = factory.root_permissions_container()?; if let Some(npm_resolver) = npm_resolver.as_managed() { if !npm_resolver.ensure_top_level_package_json_install().await? { if let Some(lockfile) = cli_options.maybe_lockfile() { @@ -106,7 +107,7 @@ pub async fn cache_top_level_deps( &roots, false, deno_config::deno_json::TsTypeLib::DenoWorker, - crate::file_fetcher::FetchPermissionsOption::AllowAll, + root_permissions.clone(), None, ) .await?; diff --git a/cli/tools/repl/mod.rs b/cli/tools/repl/mod.rs index 24bc8e30a5..a303046879 100644 --- a/cli/tools/repl/mod.rs +++ b/cli/tools/repl/mod.rs @@ -162,7 +162,7 @@ pub async fn run( let factory = CliFactory::from_flags(flags); let cli_options = factory.cli_options()?; let main_module = cli_options.resolve_main_module()?; - let permissions = factory.create_permissions_container()?; + let permissions = factory.root_permissions_container()?; let npm_resolver = factory.npm_resolver().await?.clone(); let resolver = factory.resolver().await?.clone(); let file_fetcher = factory.file_fetcher()?; @@ -177,7 +177,7 @@ pub async fn run( .create_custom_worker( WorkerExecutionMode::Repl, main_module.clone(), - permissions, + permissions.clone(), vec![crate::ops::testing::deno_test::init_ops(test_event_sender)], Default::default(), ) @@ -189,7 +189,7 @@ pub async fn run( npm_resolver, resolver, worker, - main_module, + main_module.clone(), test_event_receiver, ) .await?; diff --git a/cli/tools/run/mod.rs b/cli/tools/run/mod.rs index 2006444904..152e2650bd 100644 --- a/cli/tools/run/mod.rs +++ b/cli/tools/run/mod.rs @@ -60,10 +60,9 @@ pub async fn run_script( maybe_npm_install(&factory).await?; - let permissions = factory.create_permissions_container()?; let worker_factory = factory.create_cli_main_worker_factory().await?; let mut worker = worker_factory - .create_main_worker(mode, main_module, permissions) + .create_main_worker(mode, main_module.clone()) .await?; let exit_code = worker.run().await?; @@ -79,7 +78,6 @@ pub async fn run_from_stdin(flags: Arc) -> Result { let file_fetcher = factory.file_fetcher()?; let worker_factory = factory.create_cli_main_worker_factory().await?; - let permissions = factory.create_permissions_container()?; let mut source = Vec::new(); std::io::stdin().read_to_end(&mut source)?; // Save a fake file into file fetcher cache @@ -91,7 +89,7 @@ pub async fn run_from_stdin(flags: Arc) -> Result { }); let mut worker = worker_factory - .create_main_worker(WorkerExecutionMode::Run, main_module, permissions) + .create_main_worker(WorkerExecutionMode::Run, main_module.clone()) .await?; let exit_code = worker.run().await?; Ok(exit_code) @@ -125,11 +123,10 @@ async fn run_with_watch( let _ = watcher_communicator.watch_paths(cli_options.watch_paths()); - let permissions = factory.create_permissions_container()?; let mut worker = factory .create_cli_main_worker_factory() .await? - .create_main_worker(mode, main_module, permissions) + .create_main_worker(mode, main_module.clone()) .await?; if watch_flags.hmr { @@ -173,10 +170,9 @@ pub async fn eval_command( source: source_code.into_bytes().into(), }); - let permissions = factory.create_permissions_container()?; let worker_factory = factory.create_cli_main_worker_factory().await?; let mut worker = worker_factory - .create_main_worker(WorkerExecutionMode::Eval, main_module, permissions) + .create_main_worker(WorkerExecutionMode::Eval, main_module.clone()) .await?; let exit_code = worker.run().await?; Ok(exit_code) diff --git a/cli/tools/serve.rs b/cli/tools/serve.rs index 2f553cf1ed..4ce1cad6f2 100644 --- a/cli/tools/serve.rs +++ b/cli/tools/serve.rs @@ -5,7 +5,6 @@ use std::sync::Arc; use deno_core::error::AnyError; use deno_core::futures::TryFutureExt; use deno_core::ModuleSpecifier; -use deno_runtime::deno_permissions::PermissionsContainer; use super::run::check_permission_before_script; use super::run::maybe_npm_install; @@ -44,13 +43,11 @@ pub async fn serve( maybe_npm_install(&factory).await?; - let permissions = factory.create_permissions_container()?; let worker_factory = factory.create_cli_main_worker_factory().await?; do_serve( worker_factory, - main_module, - permissions, + main_module.clone(), serve_flags.worker_count, false, ) @@ -60,7 +57,6 @@ pub async fn serve( async fn do_serve( worker_factory: CliMainWorkerFactory, main_module: ModuleSpecifier, - permissions: PermissionsContainer, worker_count: Option, hmr: bool, ) -> Result { @@ -71,7 +67,6 @@ async fn do_serve( worker_count, }, main_module.clone(), - permissions.clone(), ) .await?; let worker_count = match worker_count { @@ -87,15 +82,13 @@ async fn do_serve( for i in 0..extra_workers { let worker_factory = worker_factory.clone(); let main_module = main_module.clone(); - let permissions = permissions.clone(); let (tx, rx) = tokio::sync::oneshot::channel(); channels.push(rx); std::thread::Builder::new() .name(format!("serve-worker-{i}")) .spawn(move || { deno_runtime::tokio_util::create_and_run_current_thread(async move { - let result = - run_worker(i, worker_factory, main_module, permissions, hmr).await; + let result = run_worker(i, worker_factory, main_module, hmr).await; let _ = tx.send(result); }); })?; @@ -124,7 +117,6 @@ async fn run_worker( worker_count: usize, worker_factory: CliMainWorkerFactory, main_module: ModuleSpecifier, - permissions: PermissionsContainer, hmr: bool, ) -> Result { let mut worker = worker_factory @@ -134,7 +126,6 @@ async fn run_worker( worker_count: Some(worker_count), }, main_module, - permissions, ) .await?; if hmr { @@ -171,11 +162,9 @@ async fn serve_with_watch( maybe_npm_install(&factory).await?; let _ = watcher_communicator.watch_paths(cli_options.watch_paths()); - - let permissions = factory.create_permissions_container()?; let worker_factory = factory.create_cli_main_worker_factory().await?; - do_serve(worker_factory, main_module, permissions, worker_count, hmr) + do_serve(worker_factory, main_module.clone(), worker_count, hmr) .await?; Ok(()) diff --git a/cli/worker.rs b/cli/worker.rs index 6176398d54..861419f1ec 100644 --- a/cli/worker.rs +++ b/cli/worker.rs @@ -62,13 +62,12 @@ pub trait ModuleLoaderFactory: Send + Sync { fn create_for_main( &self, root_permissions: PermissionsContainer, - dynamic_permissions: PermissionsContainer, ) -> ModuleLoaderAndSourceMapGetter; fn create_for_worker( &self, - root_permissions: PermissionsContainer, - dynamic_permissions: PermissionsContainer, + parent_permissions: PermissionsContainer, + permissions: PermissionsContainer, ) -> ModuleLoaderAndSourceMapGetter; } @@ -136,6 +135,7 @@ struct SharedWorkerState { npm_resolver: Arc, permission_desc_parser: Arc, root_cert_store_provider: Arc, + root_permissions: PermissionsContainer, shared_array_buffer_store: SharedArrayBufferStore, storage_key_resolver: StorageKeyResolver, options: CliMainWorkerOptions, @@ -432,6 +432,7 @@ impl CliMainWorkerFactory { npm_resolver: Arc, permission_parser: Arc, root_cert_store_provider: Arc, + root_permissions: PermissionsContainer, storage_key_resolver: StorageKeyResolver, subcommand: DenoSubcommand, options: CliMainWorkerOptions, @@ -452,6 +453,7 @@ impl CliMainWorkerFactory { npm_resolver, permission_desc_parser: permission_parser, root_cert_store_provider, + root_permissions, shared_array_buffer_store: Default::default(), storage_key_resolver, options, @@ -464,13 +466,12 @@ impl CliMainWorkerFactory { &self, mode: WorkerExecutionMode, main_module: ModuleSpecifier, - permissions: PermissionsContainer, ) -> Result { self .create_custom_worker( mode, main_module, - permissions, + self.shared.root_permissions.clone(), vec![], Default::default(), ) @@ -530,13 +531,9 @@ impl CliMainWorkerFactory { (main_module, is_cjs) }; - let ModuleLoaderAndSourceMapGetter { module_loader } = - shared.module_loader_factory.create_for_main( - PermissionsContainer::allow_all( - self.shared.permission_desc_parser.clone(), - ), - permissions.clone(), - ); + let ModuleLoaderAndSourceMapGetter { module_loader } = shared + .module_loader_factory + .create_for_main(permissions.clone()); let maybe_inspector_server = shared.maybe_inspector_server.clone(); let create_web_worker_cb = diff --git a/runtime/permissions.rs b/runtime/permissions.rs index a28ba35b14..9b2737b4fc 100644 --- a/runtime/permissions.rs +++ b/runtime/permissions.rs @@ -12,6 +12,7 @@ use deno_permissions::AllowRunDescriptorParseResult; use deno_permissions::DenyRunDescriptor; use deno_permissions::EnvDescriptor; use deno_permissions::FfiDescriptor; +use deno_permissions::ImportDescriptor; use deno_permissions::NetDescriptor; use deno_permissions::PathQueryDescriptor; use deno_permissions::ReadDescriptor; @@ -75,6 +76,13 @@ impl deno_permissions::PermissionDescriptorParser NetDescriptor::parse(text) } + fn parse_import_descriptor( + &self, + text: &str, + ) -> Result { + ImportDescriptor::parse(text) + } + fn parse_env_descriptor( &self, text: &str, diff --git a/runtime/permissions/lib.rs b/runtime/permissions/lib.rs index c7ef864dbc..5d8e76125e 100644 --- a/runtime/permissions/lib.rs +++ b/runtime/permissions/lib.rs @@ -14,7 +14,6 @@ use deno_core::serde::Deserializer; use deno_core::serde::Serialize; use deno_core::serde_json; use deno_core::unsync::sync::AtomicFlag; -use deno_core::url; use deno_core::url::Url; use deno_core::ModuleSpecifier; use deno_terminal::colors; @@ -950,6 +949,15 @@ impl NetDescriptor { Ok(NetDescriptor(host, port)) } + + pub fn from_url(url: &Url) -> Result { + let host = url + .host_str() + .ok_or_else(|| type_error(format!("Missing host in url: '{}'", url)))?; + let host = Host::parse(host)?; + let port = url.port_or_known_default(); + Ok(NetDescriptor(host, port)) + } } impl fmt::Display for NetDescriptor { @@ -966,6 +974,73 @@ impl fmt::Display for NetDescriptor { } } +#[derive(Clone, Eq, PartialEq, Hash, Debug)] +pub struct ImportDescriptor(NetDescriptor); + +impl QueryDescriptor for ImportDescriptor { + type AllowDesc = ImportDescriptor; + type DenyDesc = ImportDescriptor; + + fn flag_name() -> &'static str { + "import" + } + + fn display_name(&self) -> Cow { + self.0.display_name() + } + + fn from_allow(allow: &Self::AllowDesc) -> Self { + Self(NetDescriptor::from_allow(&allow.0)) + } + + fn as_allow(&self) -> Option { + self.0.as_allow().map(ImportDescriptor) + } + + fn as_deny(&self) -> Self::DenyDesc { + Self(self.0.as_deny()) + } + + fn check_in_permission( + &self, + perm: &mut UnaryPermission, + api_name: Option<&str>, + ) -> Result<(), AnyError> { + skip_check_if_is_permission_fully_granted!(perm); + perm.check_desc(Some(self), false, api_name) + } + + fn matches_allow(&self, other: &Self::AllowDesc) -> bool { + self.0.matches_allow(&other.0) + } + + fn matches_deny(&self, other: &Self::DenyDesc) -> bool { + self.0.matches_deny(&other.0) + } + + fn revokes(&self, other: &Self::AllowDesc) -> bool { + self.0.revokes(&other.0) + } + + fn stronger_than_deny(&self, other: &Self::DenyDesc) -> bool { + self.0.stronger_than_deny(&other.0) + } + + fn overlaps_deny(&self, other: &Self::DenyDesc) -> bool { + self.0.overlaps_deny(&other.0) + } +} + +impl ImportDescriptor { + pub fn parse(specifier: &str) -> Result { + Ok(ImportDescriptor(NetDescriptor::parse(specifier)?)) + } + + pub fn from_url(url: &Url) -> Result { + Ok(ImportDescriptor(NetDescriptor::from_url(url)?)) + } +} + #[derive(Clone, Eq, PartialEq, Hash, Debug)] pub struct EnvDescriptor(EnvVarName); @@ -1519,19 +1594,35 @@ impl UnaryPermission { self.check_desc(Some(host), false, api_name) } - pub fn check_url( + pub fn check_all(&mut self) -> Result<(), AnyError> { + skip_check_if_is_permission_fully_granted!(self); + self.check_desc(None, false, None) + } +} + +impl UnaryPermission { + pub fn query(&self, host: Option<&ImportDescriptor>) -> PermissionState { + self.query_desc(host, AllowPartial::TreatAsPartialGranted) + } + + pub fn request( &mut self, - url: &url::Url, + host: Option<&ImportDescriptor>, + ) -> PermissionState { + self.request_desc(host) + } + + pub fn revoke(&mut self, host: Option<&ImportDescriptor>) -> PermissionState { + self.revoke_desc(host) + } + + pub fn check( + &mut self, + host: &ImportDescriptor, api_name: Option<&str>, ) -> Result<(), AnyError> { skip_check_if_is_permission_fully_granted!(self); - let host = url - .host_str() - .ok_or_else(|| type_error(format!("Missing host in url: '{}'", url)))?; - let host = Host::parse(host)?; - let port = url.port_or_known_default(); - let descriptor = NetDescriptor(host, port); - self.check_desc(Some(&descriptor), false, api_name) + self.check_desc(Some(host), false, api_name) } pub fn check_all(&mut self) -> Result<(), AnyError> { @@ -1700,6 +1791,7 @@ pub struct Permissions { pub sys: UnaryPermission, pub run: UnaryPermission, pub ffi: UnaryPermission, + pub import: UnaryPermission, pub all: UnitPermission, } @@ -1720,6 +1812,7 @@ pub struct PermissionsOptions { pub deny_sys: Option>, pub allow_write: Option>, pub deny_write: Option>, + pub allow_import: Option>, pub prompt: bool, } @@ -1888,6 +1981,13 @@ impl Permissions { })?, opts.prompt, )?, + import: Permissions::new_unary( + parse_maybe_vec(opts.allow_import.as_deref(), |item| { + parser.parse_import_descriptor(item) + })?, + None, + opts.prompt, + )?, all: Permissions::new_all(opts.allow_all), }) } @@ -1902,6 +2002,7 @@ impl Permissions { sys: UnaryPermission::allow_all(), run: UnaryPermission::allow_all(), ffi: UnaryPermission::allow_all(), + import: UnaryPermission::allow_all(), all: Permissions::new_all(true), } } @@ -1925,35 +2026,10 @@ impl Permissions { sys: Permissions::new_unary(None, None, prompt).unwrap(), run: Permissions::new_unary(None, None, prompt).unwrap(), ffi: Permissions::new_unary(None, None, prompt).unwrap(), + import: Permissions::new_unary(None, None, prompt).unwrap(), all: Permissions::new_all(false), } } - - /// A helper function that determines if the module specifier is a local or - /// remote, and performs a read or net check for the specifier. - pub fn check_specifier( - &mut self, - specifier: &ModuleSpecifier, - ) -> Result<(), AnyError> { - match specifier.scheme() { - "file" => match specifier_to_file_path(specifier) { - Ok(path) => self.read.check( - &PathQueryDescriptor { - requested: path.to_string_lossy().into_owned(), - resolved: path, - } - .into_read(), - Some("import()"), - ), - Err(_) => Err(uri_error(format!( - "Invalid file path.\n Specifier: {specifier}" - ))), - }, - "data" => Ok(()), - "blob" => Ok(()), - _ => self.net.check_url(specifier, Some("import()")), - } - } } /// Attempts to convert a specifier to a file path. By default, uses the Url @@ -2002,6 +2078,12 @@ pub fn specifier_to_file_path( } } +#[derive(Debug, Clone, Copy, Eq, PartialEq)] +pub enum CheckSpecifierKind { + Static, + Dynamic, +} + /// Wrapper struct for `Permissions` that can be shared across threads. /// /// We need a way to have internal mutability for permissions as they might get @@ -2039,8 +2121,43 @@ impl PermissionsContainer { pub fn check_specifier( &self, specifier: &ModuleSpecifier, + kind: CheckSpecifierKind, ) -> Result<(), AnyError> { - self.inner.lock().check_specifier(specifier) + let mut inner = self.inner.lock(); + match specifier.scheme() { + "file" => { + if inner.read.is_allow_all() || kind == CheckSpecifierKind::Static { + return Ok(()); + } + + match specifier_to_file_path(specifier) { + Ok(path) => inner.read.check( + &PathQueryDescriptor { + requested: path.to_string_lossy().into_owned(), + resolved: path, + } + .into_read(), + Some("import()"), + ), + Err(_) => Err(uri_error(format!( + "Invalid file path.\n Specifier: {specifier}" + ))), + } + } + "data" => Ok(()), + "blob" => Ok(()), + _ => { + if inner.import.is_allow_all() { + return Ok(()); // avoid allocation below + } + + let desc = self + .descriptor_parser + .parse_import_descriptor_from_url(specifier)?; + inner.import.check(&desc, Some("import()"))?; + Ok(()) + } + } } #[must_use = "the resolved return value to mitigate time-of-check to time-of-use issues"] @@ -2375,7 +2492,12 @@ impl PermissionsContainer { url: &Url, api_name: &str, ) -> Result<(), AnyError> { - self.inner.lock().net.check_url(url, Some(api_name)) + let mut inner = self.inner.lock(); + if inner.net.is_allow_all() { + return Ok(()); + } + let desc = self.descriptor_parser.parse_net_descriptor_from_url(url)?; + inner.net.check(&desc, Some(api_name)) } #[inline(always)] @@ -2589,6 +2711,7 @@ pub struct ChildPermissionsArg { env: ChildUnaryPermissionArg, net: ChildUnaryPermissionArg, ffi: ChildUnaryPermissionArg, + import: ChildUnaryPermissionArg, read: ChildUnaryPermissionArg, run: ChildUnaryPermissionArg, sys: ChildUnaryPermissionArg, @@ -2601,6 +2724,7 @@ impl ChildPermissionsArg { env: ChildUnaryPermissionArg::Inherit, net: ChildUnaryPermissionArg::Inherit, ffi: ChildUnaryPermissionArg::Inherit, + import: ChildUnaryPermissionArg::Inherit, read: ChildUnaryPermissionArg::Inherit, run: ChildUnaryPermissionArg::Inherit, sys: ChildUnaryPermissionArg::Inherit, @@ -2613,6 +2737,7 @@ impl ChildPermissionsArg { env: ChildUnaryPermissionArg::NotGranted, net: ChildUnaryPermissionArg::NotGranted, ffi: ChildUnaryPermissionArg::NotGranted, + import: ChildUnaryPermissionArg::NotGranted, read: ChildUnaryPermissionArg::NotGranted, run: ChildUnaryPermissionArg::NotGranted, sys: ChildUnaryPermissionArg::NotGranted, @@ -2677,6 +2802,11 @@ impl<'de> Deserialize<'de> for ChildPermissionsArg { child_permissions_arg.ffi = arg.map_err(|e| { de::Error::custom(format!("(deno.permissions.ffi) {e}")) })?; + } else if key == "import" { + let arg = serde_json::from_value::(value); + child_permissions_arg.import = arg.map_err(|e| { + de::Error::custom(format!("(deno.permissions.import) {e}")) + })?; } else if key == "read" { let arg = serde_json::from_value::(value); child_permissions_arg.read = arg.map_err(|e| { @@ -2726,6 +2856,25 @@ pub trait PermissionDescriptorParser: Debug + Send + Sync { fn parse_net_descriptor(&self, text: &str) -> Result; + fn parse_net_descriptor_from_url( + &self, + url: &Url, + ) -> Result { + NetDescriptor::from_url(url) + } + + fn parse_import_descriptor( + &self, + text: &str, + ) -> Result; + + fn parse_import_descriptor_from_url( + &self, + url: &Url, + ) -> Result { + ImportDescriptor::from_url(url) + } + fn parse_env_descriptor(&self, text: &str) -> Result; @@ -2785,6 +2934,7 @@ pub fn create_child_permissions( &child_permissions_arg.read, &child_permissions_arg.write, &child_permissions_arg.net, + &child_permissions_arg.import, &child_permissions_arg.env, &child_permissions_arg.sys, &child_permissions_arg.run, @@ -2808,6 +2958,11 @@ pub fn create_child_permissions( .create_child_permissions(child_permissions_arg.write, |text| { Ok(Some(parser.parse_write_descriptor(text)?)) })?; + worker_perms.import = main_perms + .import + .create_child_permissions(child_permissions_arg.import, |text| { + Ok(Some(parser.parse_import_descriptor(text)?)) + })?; worker_perms.net = main_perms .net .create_child_permissions(child_permissions_arg.net, |text| { @@ -2897,6 +3052,13 @@ mod tests { NetDescriptor::parse(text) } + fn parse_import_descriptor( + &self, + text: &str, + ) -> Result { + ImportDescriptor::parse(text) + } + fn parse_env_descriptor( &self, text: &str, @@ -3153,8 +3315,9 @@ mod tests { #[test] fn test_check_net_url() { - let mut perms = Permissions::from_options( - &TestPermissionDescriptorParser, + let parser = TestPermissionDescriptorParser; + let perms = Permissions::from_options( + &parser, &PermissionsOptions { allow_net: Some(svec![ "localhost", @@ -3168,6 +3331,7 @@ mod tests { }, ) .unwrap(); + let mut perms = PermissionsContainer::new(Arc::new(parser), perms); let url_tests = vec![ // Any protocol + port for localhost should be ok, since we don't specify @@ -3209,8 +3373,8 @@ mod tests { ]; for (url_str, is_ok) in url_tests { - let u = url::Url::parse(url_str).unwrap(); - assert_eq!(is_ok, perms.net.check_url(&u, None).is_ok(), "{}", u); + let u = Url::parse(url_str).unwrap(); + assert_eq!(is_ok, perms.check_net_url(&u, "api()").is_ok(), "{}", u); } } @@ -3222,48 +3386,78 @@ mod tests { } else { svec!["/a"] }; - let mut perms = Permissions::from_options( - &TestPermissionDescriptorParser, + let parser = TestPermissionDescriptorParser; + let perms = Permissions::from_options( + &parser, &PermissionsOptions { allow_read: Some(read_allowlist), - allow_net: Some(svec!["localhost"]), + allow_import: Some(svec!["localhost"]), ..Default::default() }, ) .unwrap(); + let perms = PermissionsContainer::new(Arc::new(parser), perms); let mut fixtures = vec![ ( ModuleSpecifier::parse("http://localhost:4545/mod.ts").unwrap(), + CheckSpecifierKind::Static, + true, + ), + ( + ModuleSpecifier::parse("http://localhost:4545/mod.ts").unwrap(), + CheckSpecifierKind::Dynamic, true, ), ( ModuleSpecifier::parse("http://deno.land/x/mod.ts").unwrap(), + CheckSpecifierKind::Dynamic, false, ), ( ModuleSpecifier::parse("data:text/plain,Hello%2C%20Deno!").unwrap(), + CheckSpecifierKind::Dynamic, true, ), ]; if cfg!(target_os = "windows") { - fixtures - .push((ModuleSpecifier::parse("file:///C:/a/mod.ts").unwrap(), true)); + fixtures.push(( + ModuleSpecifier::parse("file:///C:/a/mod.ts").unwrap(), + CheckSpecifierKind::Dynamic, + true, + )); fixtures.push(( ModuleSpecifier::parse("file:///C:/b/mod.ts").unwrap(), + CheckSpecifierKind::Static, + true, + )); + fixtures.push(( + ModuleSpecifier::parse("file:///C:/b/mod.ts").unwrap(), + CheckSpecifierKind::Dynamic, false, )); } else { - fixtures - .push((ModuleSpecifier::parse("file:///a/mod.ts").unwrap(), true)); - fixtures - .push((ModuleSpecifier::parse("file:///b/mod.ts").unwrap(), false)); + fixtures.push(( + ModuleSpecifier::parse("file:///a/mod.ts").unwrap(), + CheckSpecifierKind::Dynamic, + true, + )); + fixtures.push(( + ModuleSpecifier::parse("file:///b/mod.ts").unwrap(), + CheckSpecifierKind::Static, + true, + )); + fixtures.push(( + ModuleSpecifier::parse("file:///b/mod.ts").unwrap(), + CheckSpecifierKind::Dynamic, + false, + )); } - for (specifier, expected) in fixtures { + for (specifier, kind, expected) in fixtures { assert_eq!( - perms.check_specifier(&specifier).is_ok(), + perms.check_specifier(&specifier, kind).is_ok(), expected, "{}", specifier, @@ -3271,24 +3465,6 @@ mod tests { } } - #[test] - fn check_invalid_specifiers() { - set_prompter(Box::new(TestPrompter)); - let mut perms = Permissions::allow_all(); - - let mut test_cases = vec![]; - - test_cases.push("file://dir"); - test_cases.push("file://asdf/"); - test_cases.push("file://remotehost/"); - - for url in test_cases { - assert!(perms - .check_specifier(&ModuleSpecifier::parse(url).unwrap()) - .is_err()); - } - } - #[test] fn test_query() { set_prompter(Box::new(TestPrompter)); @@ -3885,6 +4061,7 @@ mod tests { env: ChildUnaryPermissionArg::Inherit, net: ChildUnaryPermissionArg::Inherit, ffi: ChildUnaryPermissionArg::Inherit, + import: ChildUnaryPermissionArg::Inherit, read: ChildUnaryPermissionArg::Inherit, run: ChildUnaryPermissionArg::Inherit, sys: ChildUnaryPermissionArg::Inherit, @@ -3897,6 +4074,7 @@ mod tests { env: ChildUnaryPermissionArg::NotGranted, net: ChildUnaryPermissionArg::NotGranted, ffi: ChildUnaryPermissionArg::NotGranted, + import: ChildUnaryPermissionArg::NotGranted, read: ChildUnaryPermissionArg::NotGranted, run: ChildUnaryPermissionArg::NotGranted, sys: ChildUnaryPermissionArg::NotGranted, @@ -3930,6 +4108,7 @@ mod tests { "env": true, "net": true, "ffi": true, + "import": true, "read": true, "run": true, "sys": true, @@ -3940,6 +4119,7 @@ mod tests { env: ChildUnaryPermissionArg::Granted, net: ChildUnaryPermissionArg::Granted, ffi: ChildUnaryPermissionArg::Granted, + import: ChildUnaryPermissionArg::Granted, read: ChildUnaryPermissionArg::Granted, run: ChildUnaryPermissionArg::Granted, sys: ChildUnaryPermissionArg::Granted, @@ -3951,6 +4131,7 @@ mod tests { "env": false, "net": false, "ffi": false, + "import": false, "read": false, "run": false, "sys": false, @@ -3961,6 +4142,7 @@ mod tests { env: ChildUnaryPermissionArg::NotGranted, net: ChildUnaryPermissionArg::NotGranted, ffi: ChildUnaryPermissionArg::NotGranted, + import: ChildUnaryPermissionArg::NotGranted, read: ChildUnaryPermissionArg::NotGranted, run: ChildUnaryPermissionArg::NotGranted, sys: ChildUnaryPermissionArg::NotGranted, @@ -3972,6 +4154,7 @@ mod tests { "env": ["foo", "bar"], "net": ["foo", "bar:8000"], "ffi": ["foo", "file:///bar/baz"], + "import": ["example.com"], "read": ["foo", "file:///bar/baz"], "run": ["foo", "file:///bar/baz", "./qux"], "sys": ["hostname", "osRelease"], @@ -3985,6 +4168,7 @@ mod tests { "foo", "file:///bar/baz" ]), + import: ChildUnaryPermissionArg::GrantedList(svec!["example.com"]), read: ChildUnaryPermissionArg::GrantedList(svec![ "foo", "file:///bar/baz" diff --git a/tests/integration/cache_tests.rs b/tests/integration/cache_tests.rs index 9c6f1f7f18..d9fb8e38e5 100644 --- a/tests/integration/cache_tests.rs +++ b/tests/integration/cache_tests.rs @@ -18,7 +18,7 @@ fn xdg_cache_home_dir() { .env_clear() .env("XDG_CACHE_HOME", &xdg_cache_home) .args( - "cache --reload --no-check http://localhost:4548/subdir/redirects/a.ts", + "cache --allow-import --reload --no-check http://localhost:4548/subdir/redirects/a.ts", ) .run() .skip_output_check() diff --git a/tests/integration/check_tests.rs b/tests/integration/check_tests.rs index 121dcb837c..f30828a665 100644 --- a/tests/integration/check_tests.rs +++ b/tests/integration/check_tests.rs @@ -9,14 +9,14 @@ use util::TestContext; use util::TestContextBuilder; itest!(check_all { - args: "check --quiet --all check/all/check_all.ts", + args: "check --allow-import --quiet --all check/all/check_all.ts", output: "check/all/check_all.out", http_server: true, exit_code: 1, }); itest!(check_all_local { - args: "check --quiet check/all/check_all.ts", + args: "check --allow-import --quiet check/all/check_all.ts", output_str: Some(""), http_server: true, }); @@ -227,6 +227,7 @@ fn ts_no_recheck_on_redirect() { let test_context = TestContext::default(); let check_command = test_context.new_command().args_vec([ "run", + "--allow-import", "--check", "run/017_import_redirect.ts", ]); diff --git a/tests/integration/compile_tests.rs b/tests/integration/compile_tests.rs index 215b956fdd..0a5916f6f7 100644 --- a/tests/integration/compile_tests.rs +++ b/tests/integration/compile_tests.rs @@ -539,6 +539,7 @@ fn check_local_by_default() { .new_command() .args_vec([ "compile", + "--allow-import", "--output", &exe.to_string_lossy(), "./compile/check_local_by_default.ts", @@ -561,6 +562,7 @@ fn check_local_by_default2() { .new_command() .args_vec([ "compile", + "--allow-import", "--output", &exe.to_string_lossy(), "./compile/check_local_by_default2.ts" diff --git a/tests/integration/coverage_tests.rs b/tests/integration/coverage_tests.rs index 9509ddcb78..ab18ef76d3 100644 --- a/tests/integration/coverage_tests.rs +++ b/tests/integration/coverage_tests.rs @@ -456,6 +456,7 @@ fn no_http_coverage_data() { .new_command() .args_vec(vec![ "test".to_string(), + "--allow-import".to_string(), "--quiet".to_string(), "--no-check".to_string(), format!("--coverage={}", tempdir), diff --git a/tests/integration/install_tests.rs b/tests/integration/install_tests.rs index 2c7725443c..4dfd00146d 100644 --- a/tests/integration/install_tests.rs +++ b/tests/integration/install_tests.rs @@ -294,7 +294,7 @@ fn check_local_by_default() { let script_path_str = script_path.to_string_lossy().to_string(); context .new_command() - .args_vec(["install", "-g", script_path_str.as_str()]) + .args_vec(["install", "-g", "--allow-import", script_path_str.as_str()]) .envs([ ("HOME", temp_dir_str.as_str()), ("USERPROFILE", temp_dir_str.as_str()), @@ -318,7 +318,7 @@ fn check_local_by_default2() { let script_path_str = script_path.to_string_lossy().to_string(); context .new_command() - .args_vec(["install", "-g", script_path_str.as_str()]) + .args_vec(["install", "-g", "--allow-import", script_path_str.as_str()]) .envs([ ("HOME", temp_dir_str.as_str()), ("NO_COLOR", "1"), diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs index a0368d8d1f..539e3cc7e2 100644 --- a/tests/integration/lsp_tests.rs +++ b/tests/integration/lsp_tests.rs @@ -890,7 +890,7 @@ fn lsp_format_vendor_path() { // put this dependency in the global cache context .new_command() - .args("cache http://localhost:4545/run/002_hello.ts") + .args("cache --allow-import http://localhost:4545/run/002_hello.ts") .run() .skip_output_check(); diff --git a/tests/integration/run_tests.rs b/tests/integration/run_tests.rs index 6b0901e267..1e1d6ed61b 100644 --- a/tests/integration/run_tests.rs +++ b/tests/integration/run_tests.rs @@ -73,7 +73,7 @@ itest!(_005_more_imports { }); itest!(_006_url_imports { - args: "run --quiet --reload run/006_url_imports.ts", + args: "run --quiet --reload --allow-import run/006_url_imports.ts", output: "run/006_url_imports.ts.out", http_server: true, }); @@ -105,24 +105,25 @@ itest!(_016_double_await { }); itest!(_017_import_redirect { - args: "run --quiet --reload run/017_import_redirect.ts", + args: "run --quiet --allow-import --reload run/017_import_redirect.ts", output: "run/017_import_redirect.ts.out", }); itest!(_017_import_redirect_check { - args: "run --quiet --reload --check run/017_import_redirect.ts", + args: + "run --quiet --allow-import --reload --check run/017_import_redirect.ts", output: "run/017_import_redirect.ts.out", }); itest!(_017_import_redirect_vendor_dir { args: - "run --quiet --reload --vendor --check $TESTDATA/run/017_import_redirect.ts", + "run --quiet --allow-import --reload --vendor --check $TESTDATA/run/017_import_redirect.ts", output: "run/017_import_redirect.ts.out", temp_cwd: true, }); itest!(_017_import_redirect_info { - args: "info --quiet --reload run/017_import_redirect.ts", + args: "info --quiet --allow-import --reload run/017_import_redirect.ts", output: "run/017_import_redirect_info.out", }); @@ -132,7 +133,7 @@ itest!(_018_async_catch { }); itest!(_019_media_types { - args: "run --reload run/019_media_types.ts", + args: "run --reload --allow-import run/019_media_types.ts", output: "run/019_media_types.ts.out", http_server: true, }); @@ -154,14 +155,14 @@ itest!(_025_reload_js_type_error { }); itest!(_027_redirect_typescript { - args: "run --quiet --reload run/027_redirect_typescript.ts", + args: "run --quiet --reload --allow-import run/027_redirect_typescript.ts", output: "run/027_redirect_typescript.ts.out", http_server: true, }); itest!(_027_redirect_typescript_vendor_dir { args: - "run --quiet --reload --vendor $TESTDATA/run/027_redirect_typescript.ts", + "run --quiet --reload --vendor --allow-import $TESTDATA/run/027_redirect_typescript.ts", output: "run/027_redirect_typescript.ts.out", http_server: true, temp_cwd: true, @@ -175,14 +176,14 @@ itest!(_028_args { itest!(_033_import_map_remote { args: - "run --quiet --reload --import-map=http://127.0.0.1:4545/import_maps/import_map_remote.json import_maps/test_remote.ts", + "run --quiet --reload --allow-import --import-map=http://127.0.0.1:4545/import_maps/import_map_remote.json import_maps/test_remote.ts", output: "run/033_import_map_remote.out", http_server: true, }); itest!(_033_import_map_vendor_dir_remote { args: - "run --quiet --reload --import-map=http://127.0.0.1:4545/import_maps/import_map_remote.json --vendor $TESTDATA/import_maps/test_remote.ts", + "run --quiet --reload --allow-import --import-map=http://127.0.0.1:4545/import_maps/import_map_remote.json --vendor $TESTDATA/import_maps/test_remote.ts", output: "run/033_import_map_remote.out", http_server: true, temp_cwd: true, @@ -190,7 +191,7 @@ itest!(_033_import_map_vendor_dir_remote { itest!(_033_import_map_data_uri { args: - "run --quiet --reload --import-map=data:application/json;charset=utf-8;base64,ewogICJpbXBvcnRzIjogewogICAgInRlc3Rfc2VydmVyLyI6ICJodHRwOi8vbG9jYWxob3N0OjQ1NDUvIgogIH0KfQ== run/import_maps/test_data.ts", + "run --quiet --reload --allow-import --import-map=data:application/json;charset=utf-8;base64,ewogICJpbXBvcnRzIjogewogICAgInRlc3Rfc2VydmVyLyI6ICJodHRwOi8vbG9jYWxob3N0OjQ1NDUvIgogIH0KfQ== run/import_maps/test_data.ts", output: "run/import_maps/test_data.ts.out", http_server: true, }); @@ -201,7 +202,7 @@ itest!(onload { }); itest!(_035_cached_only_flag { - args: "run --reload --check --cached-only http://127.0.0.1:4545/run/019_media_types.ts", + args: "run --reload --check --allow-import --cached-only http://127.0.0.1:4545/run/019_media_types.ts", output: "run/035_cached_only_flag.out", exit_code: 1, http_server: true, @@ -237,14 +238,14 @@ itest!(_047_jsx { }); itest!(_048_media_types_jsx { - args: "run --reload run/048_media_types_jsx.ts", + args: "run --reload --allow-import run/048_media_types_jsx.ts", output: "run/048_media_types_jsx.ts.out", http_server: true, }); itest!(_052_no_remote_flag { args: - "run --reload --check --no-remote http://127.0.0.1:4545/run/019_media_types.ts", + "run --reload --check --allow-import --no-remote http://127.0.0.1:4545/run/019_media_types.ts", output: "run/052_no_remote_flag.out", exit_code: 1, http_server: true, @@ -467,7 +468,7 @@ itest!(dynamic_import_already_rejected { }); itest!(dynamic_import_concurrent_non_statically_analyzable { - args: "run --allow-read --allow-net --quiet run/dynamic_import_concurrent_non_statically_analyzable/main.ts", + args: "run --allow-import --allow-read --allow-net --quiet run/dynamic_import_concurrent_non_statically_analyzable/main.ts", output: "run/dynamic_import_concurrent_non_statically_analyzable/main.out", http_server: true, }); @@ -802,7 +803,7 @@ itest!(private_field_presence_no_check { itest!(lock_write_fetch { args: - "run --quiet --allow-read --allow-write --allow-env --allow-run run/lock_write_fetch/main.ts", + "run --quiet --allow-import --allow-read --allow-write --allow-env --allow-run run/lock_write_fetch/main.ts", output: "run/lock_write_fetch/main.out", http_server: true, exit_code: 0, @@ -810,26 +811,27 @@ itest!(lock_write_fetch { itest!(lock_check_ok { args: - "run --quiet --lock=run/lock_check_ok.json http://127.0.0.1:4545/run/003_relative_import.ts", + "run --quiet --allow-import --lock=run/lock_check_ok.json http://127.0.0.1:4545/run/003_relative_import.ts", output: "run/003_relative_import.ts.out", http_server: true, }); itest!(lock_check_ok2 { - args: "run --lock=run/lock_check_ok2.json run/019_media_types.ts", + args: + "run --allow-import --lock=run/lock_check_ok2.json run/019_media_types.ts", output: "run/019_media_types.ts.out", http_server: true, }); itest!(lock_v2_check_ok { args: - "run --quiet --lock=run/lock_v2_check_ok.json http://127.0.0.1:4545/run/003_relative_import.ts", + "run --allow-import --quiet --lock=run/lock_v2_check_ok.json http://127.0.0.1:4545/run/003_relative_import.ts", output: "run/003_relative_import.ts.out", http_server: true, }); itest!(lock_v2_check_ok2 { - args: "run --lock=run/lock_v2_check_ok2.json run/019_media_types.ts", + args: "run --allow-import --lock=run/lock_v2_check_ok2.json run/019_media_types.ts", output: "run/019_media_types.ts.out", http_server: true, }); @@ -849,7 +851,7 @@ fn lock_redirects() { ); context .new_command() - .args("run main.ts") + .args("run --allow-import main.ts") .run() .skip_output_check(); let initial_lockfile_text = r#"{ @@ -865,7 +867,7 @@ fn lock_redirects() { assert_eq!(temp_dir.read_to_string("deno.lock"), initial_lockfile_text); context .new_command() - .args("run main.ts") + .args("run --allow-import main.ts") .run() .assert_matches_text("Hello World\n"); assert_eq!(temp_dir.read_to_string("deno.lock"), initial_lockfile_text); @@ -892,7 +894,7 @@ fn lock_redirects() { // it should use the echo script instead context .new_command() - .args("run main.ts Hi there") + .args("run --allow-import main.ts Hi there") .run() .assert_matches_text(concat!( "Download http://localhost:4545/echo.ts\n", @@ -1260,7 +1262,7 @@ itest!(config_types { itest!(config_types_remote { http_server: true, - args: "run --reload --quiet --check=all --config run/config_types/remote.tsconfig.json run/config_types/main.ts", + args: "run --allow-import --reload --quiet --check=all --config run/config_types/remote.tsconfig.json run/config_types/main.ts", output: "run/config_types/main.out", }); @@ -1365,9 +1367,10 @@ itest!(error_015_dynamic_import_permissions { http_server: true, }); -// We have an allow-net flag but not allow-read, it should still result in error. +// We have an allow-import flag but not allow-read, it should still result in error. itest!(error_016_dynamic_import_permissions2 { - args: "run --reload --allow-net run/error_016_dynamic_import_permissions2.js", + args: + "run --reload --allow-import run/error_016_dynamic_import_permissions2.js", output: "run/error_016_dynamic_import_permissions2.out", exit_code: 1, http_server: true, @@ -1428,7 +1431,7 @@ itest!(error_025_tab_indent { }); itest!(error_026_remote_import_error { - args: "run run/error_026_remote_import_error.ts", + args: "run --allow-import run/error_026_remote_import_error.ts", output: "run/error_026_remote_import_error.ts.out", exit_code: 1, http_server: true, @@ -1471,18 +1474,18 @@ itest!(error_type_definitions { }); itest!(error_local_static_import_from_remote_ts { - args: "run --reload http://localhost:4545/run/error_local_static_import_from_remote.ts", - exit_code: 1, - http_server: true, - output: "run/error_local_static_import_from_remote.ts.out", - }); + args: "run --allow-import --reload http://localhost:4545/run/error_local_static_import_from_remote.ts", + exit_code: 1, + http_server: true, + output: "run/error_local_static_import_from_remote.ts.out", +}); itest!(error_local_static_import_from_remote_js { - args: "run --reload http://localhost:4545/run/error_local_static_import_from_remote.js", - exit_code: 1, - http_server: true, - output: "run/error_local_static_import_from_remote.js.out", - }); + args: "run --allow-import --reload http://localhost:4545/run/error_local_static_import_from_remote.js", + exit_code: 1, + http_server: true, + output: "run/error_local_static_import_from_remote.js.out", +}); itest!(exit_error42 { exit_code: 42, @@ -1531,7 +1534,7 @@ itest!(finalization_registry { }); itest!(https_import { - args: "run --quiet --reload --cert tls/RootCA.pem run/https_import.ts", + args: "run --allow-import --quiet --reload --cert tls/RootCA.pem run/https_import.ts", output: "run/https_import.ts.out", http_server: true, }); @@ -1542,18 +1545,18 @@ itest!(if_main { }); itest!(import_meta { - args: "run --quiet --reload --import-map=run/import_meta/importmap.json run/import_meta/main.ts", + args: "run --allow-import --quiet --reload --import-map=run/import_meta/importmap.json run/import_meta/main.ts", output: "run/import_meta/main.out", http_server: true, }); itest!(main_module { - args: "run --quiet --reload run/main_module/main.ts", + args: "run --quiet --reload run/main_module/main.ts", output: "run/main_module/main.out", }); itest!(no_check { - args: "run --quiet --reload --no-check run/006_url_imports.ts", + args: "run --allow-import --quiet --reload --no-check run/006_url_imports.ts", output: "run/006_url_imports.ts.out", http_server: true, }); @@ -1569,14 +1572,15 @@ itest!(decorators_tc39_proposal { }); itest!(check_remote { - args: "run --quiet --reload --check=all run/no_check_remote.ts", + args: + "run --quiet --allow-import --reload --check=all run/no_check_remote.ts", output: "run/no_check_remote.ts.disabled.out", exit_code: 1, http_server: true, }); itest!(no_check_remote { - args: "run --quiet --reload --no-check=remote run/no_check_remote.ts", + args: "run --allow-import --quiet --reload --no-check=remote run/no_check_remote.ts", output: "run/no_check_remote.ts.enabled.out", http_server: true, }); @@ -1603,13 +1607,15 @@ itest!(type_definitions_for_export { }); itest!(type_directives_01 { - args: "run --reload --check=all -L debug run/type_directives_01.ts", + args: + "run --allow-import --reload --check=all -L debug run/type_directives_01.ts", output: "run/type_directives_01.ts.out", http_server: true, }); itest!(type_directives_02 { - args: "run --reload --check=all -L debug run/type_directives_02.ts", + args: + "run --allow-import --reload --check=all -L debug run/type_directives_02.ts", output: "run/type_directives_02.ts.out", }); @@ -1629,13 +1635,13 @@ fn type_directives_js_main() { } itest!(type_directives_redirect { - args: "run --reload --check run/type_directives_redirect.ts", + args: "run --allow-import --reload --check run/type_directives_redirect.ts", output: "run/type_directives_redirect.ts.out", http_server: true, }); itest!(type_headers_deno_types { - args: "run --reload --check run/type_headers_deno_types.ts", + args: "run --allow-import --reload --check run/type_headers_deno_types.ts", output: "run/type_headers_deno_types.ts.out", http_server: true, }); @@ -1839,20 +1845,20 @@ itest!(unstable_kv_enabled { }); itest!(import_compression { - args: "run --quiet --reload --allow-net run/import_compression/main.ts", + args: "run --allow-import --quiet --reload --allow-net run/import_compression/main.ts", output: "run/import_compression/main.out", http_server: true, }); itest!(disallow_http_from_https_js { - args: "run --quiet --reload --cert tls/RootCA.pem https://localhost:5545/run/disallow_http_from_https.js", + args: "run --allow-import --quiet --reload --cert tls/RootCA.pem https://localhost:5545/run/disallow_http_from_https.js", output: "run/disallow_http_from_https_js.out", http_server: true, exit_code: 1, }); itest!(disallow_http_from_https_ts { - args: "run --quiet --reload --cert tls/RootCA.pem https://localhost:5545/run/disallow_http_from_https.ts", + args: "run --allow-import --quiet --reload --cert tls/RootCA.pem https://localhost:5545/run/disallow_http_from_https.ts", output: "run/disallow_http_from_https_ts.out", http_server: true, exit_code: 1, @@ -1904,7 +1910,7 @@ itest!(es_private_fields { }); itest!(ts_import_from_js { - args: "run --quiet --reload run/ts_import_from_js/main.js", + args: "run --allow-import --quiet --reload run/ts_import_from_js/main.js", output: "run/ts_import_from_js/main.out", http_server: true, }); @@ -1915,100 +1921,101 @@ itest!(jsx_import_from_ts { }); itest!(jsx_import_source_pragma { - args: "run --reload run/jsx_import_source_pragma.tsx", + args: "run --reload --allow-import run/jsx_import_source_pragma.tsx", output: "run/jsx_import_source.out", http_server: true, }); itest!(jsx_import_source_pragma_with_config { args: - "run --reload --config jsx/deno-jsx.jsonc --no-lock run/jsx_import_source_pragma.tsx", + "run --reload --allow-import --config jsx/deno-jsx.jsonc --no-lock run/jsx_import_source_pragma.tsx", output: "run/jsx_import_source.out", http_server: true, }); itest!(jsx_import_source_pragma_with_dev_config { args: - "run --reload --config jsx/deno-jsxdev.jsonc --no-lock run/jsx_import_source_pragma.tsx", + "run --reload --allow-import --config jsx/deno-jsxdev.jsonc --no-lock run/jsx_import_source_pragma.tsx", output: "run/jsx_import_source_dev.out", http_server: true, }); itest!(jsx_import_source_no_pragma { args: - "run --reload --config jsx/deno-jsx.jsonc --no-lock run/jsx_import_source_no_pragma.tsx", + "run --allow-import --reload --config jsx/deno-jsx.jsonc --no-lock run/jsx_import_source_no_pragma.tsx", output: "run/jsx_import_source.out", http_server: true, }); itest!(jsx_import_source_no_pragma_dev { - args: "run --reload --config jsx/deno-jsxdev.jsonc --no-lock run/jsx_import_source_no_pragma.tsx", + args: "run --allow-import --reload --config jsx/deno-jsxdev.jsonc --no-lock run/jsx_import_source_no_pragma.tsx", output: "run/jsx_import_source_dev.out", http_server: true, }); itest!(jsx_import_source_pragma_import_map { - args: "run --reload --import-map jsx/import-map.json run/jsx_import_source_pragma_import_map.tsx", + args: "run --allow-import --reload --import-map jsx/import-map.json run/jsx_import_source_pragma_import_map.tsx", output: "run/jsx_import_source_import_map.out", http_server: true, }); itest!(jsx_import_source_pragma_import_map_dev { - args: "run --reload --import-map jsx/import-map.json --config jsx/deno-jsxdev-import-map.jsonc run/jsx_import_source_pragma_import_map.tsx", + args: "run --allow-import --reload --import-map jsx/import-map.json --config jsx/deno-jsxdev-import-map.jsonc run/jsx_import_source_pragma_import_map.tsx", output: "run/jsx_import_source_import_map_dev.out", http_server: true, }); itest!(jsx_import_source_precompile_import_map { - args: "run --reload --check --import-map jsx/import-map.json --no-lock --config jsx/deno-jsx-precompile.jsonc run/jsx_precompile/no_pragma.tsx", + args: "run --allow-import --reload --check --import-map jsx/import-map.json --no-lock --config jsx/deno-jsx-precompile.jsonc run/jsx_precompile/no_pragma.tsx", output: "run/jsx_precompile/no_pragma.out", http_server: true, }); itest!(jsx_import_source_precompile_import_map_skip_element { - args: "run --reload --check --import-map jsx/import-map.json --no-lock --config jsx/deno-jsx-precompile-skip.jsonc run/jsx_precompile/skip.tsx", + args: "run --allow-import --reload --check --import-map jsx/import-map.json --no-lock --config jsx/deno-jsx-precompile-skip.jsonc run/jsx_precompile/skip.tsx", output: "run/jsx_precompile/skip.out", http_server: true, }); itest!(jsx_import_source_import_map { - args: "run --reload --import-map jsx/import-map.json --no-lock --config jsx/deno-jsx-import-map.jsonc run/jsx_import_source_no_pragma.tsx", + args: "run --allow-import --reload --import-map jsx/import-map.json --no-lock --config jsx/deno-jsx-import-map.jsonc run/jsx_import_source_no_pragma.tsx", output: "run/jsx_import_source_import_map.out", http_server: true, }); itest!(jsx_import_source_import_map_dev { - args: "run --reload --import-map jsx/import-map.json --no-lock --config jsx/deno-jsxdev-import-map.jsonc run/jsx_import_source_no_pragma.tsx", + args: "run --allow-import --reload --import-map jsx/import-map.json --no-lock --config jsx/deno-jsxdev-import-map.jsonc run/jsx_import_source_no_pragma.tsx", output: "run/jsx_import_source_import_map_dev.out", http_server: true, }); itest!(jsx_import_source_import_map_scoped { - args: "run --reload --import-map jsx/import-map-scoped.json --no-lock --config jsx/deno-jsx-import-map.jsonc subdir/jsx_import_source_no_pragma.tsx", + args: "run --allow-import --reload --import-map jsx/import-map-scoped.json --no-lock --config jsx/deno-jsx-import-map.jsonc subdir/jsx_import_source_no_pragma.tsx", output: "run/jsx_import_source_import_map.out", http_server: true, }); itest!(jsx_import_source_import_map_scoped_dev { - args: "run --reload --import-map jsx/import-map-scoped.json --no-lock --config jsx/deno-jsxdev-import-map.jsonc subdir/jsx_import_source_no_pragma.tsx", + args: "run --allow-import --reload --import-map jsx/import-map-scoped.json --no-lock --config jsx/deno-jsxdev-import-map.jsonc subdir/jsx_import_source_no_pragma.tsx", output: "run/jsx_import_source_import_map_dev.out", http_server: true, }); itest!(jsx_import_source_pragma_no_check { - args: "run --reload --no-check run/jsx_import_source_pragma.tsx", + args: + "run --allow-import --reload --no-check run/jsx_import_source_pragma.tsx", output: "run/jsx_import_source.out", http_server: true, }); itest!(jsx_import_source_pragma_with_config_no_check { - args: "run --reload --config jsx/deno-jsx.jsonc --no-lock --no-check run/jsx_import_source_pragma.tsx", + args: "run --allow-import --reload --config jsx/deno-jsx.jsonc --no-lock --no-check run/jsx_import_source_pragma.tsx", output: "run/jsx_import_source.out", http_server: true, }); itest!(jsx_import_source_pragma_with_config_vendor_dir { - args: "run --reload --config jsx/deno-jsx.jsonc --no-lock --vendor $TESTDATA/run/jsx_import_source_pragma.tsx", + args: "run --allow-import --reload --config jsx/deno-jsx.jsonc --no-lock --vendor $TESTDATA/run/jsx_import_source_pragma.tsx", output: "run/jsx_import_source.out", http_server: true, temp_cwd: true, @@ -2017,19 +2024,19 @@ itest!(jsx_import_source_pragma_with_config_vendor_dir { itest!(jsx_import_source_no_pragma_no_check { args: - "run --reload --config jsx/deno-jsx.jsonc --no-lock --no-check run/jsx_import_source_no_pragma.tsx", + "run --allow-import --reload --config jsx/deno-jsx.jsonc --no-lock --no-check run/jsx_import_source_no_pragma.tsx", output: "run/jsx_import_source.out", http_server: true, }); itest!(jsx_import_source_pragma_import_map_no_check { - args: "run --reload --import-map jsx/import-map.json --no-check run/jsx_import_source_pragma_import_map.tsx", + args: "run --allow-import --reload --import-map jsx/import-map.json --no-check run/jsx_import_source_pragma_import_map.tsx", output: "run/jsx_import_source_import_map.out", http_server: true, }); itest!(jsx_import_source_import_map_no_check { - args: "run --reload --import-map jsx/import-map.json --no-lock --config jsx/deno-jsx-import-map.jsonc --no-check run/jsx_import_source_no_pragma.tsx", + args: "run --allow-import --reload --import-map jsx/import-map.json --no-lock --config jsx/deno-jsx-import-map.jsonc --no-check run/jsx_import_source_no_pragma.tsx", output: "run/jsx_import_source_import_map.out", http_server: true, }); @@ -2093,7 +2100,7 @@ itest!(import_data_url_import_relative { }); itest!(import_data_url_imports { - args: "run --quiet --reload run/import_data_url_imports.ts", + args: "run --allow-import --quiet --reload run/import_data_url_imports.ts", output: "run/import_data_url_imports.ts.out", http_server: true, }); @@ -2127,7 +2134,7 @@ itest!(import_blob_url_import_relative { itest!(import_blob_url_imports { args: - "run --quiet --reload --allow-net=localhost:4545 run/import_blob_url_imports.ts", + "run --allow-import --quiet --reload --allow-net=localhost:4545 run/import_blob_url_imports.ts", output: "run/import_blob_url_imports.ts.out", http_server: true, }); @@ -2143,13 +2150,13 @@ itest!(import_blob_url { }); itest!(import_file_with_colon { - args: "run --quiet --reload run/import_file_with_colon.ts", + args: "run --allow-import --quiet --reload run/import_file_with_colon.ts", output: "run/import_file_with_colon.ts.out", http_server: true, }); itest!(import_extensionless { - args: "run --quiet --reload run/import_extensionless.ts", + args: "run --allow-import --quiet --reload run/import_extensionless.ts", output: "run/import_extensionless.ts.out", http_server: true, }); @@ -2195,7 +2202,7 @@ itest!(inline_js_source_map_2_with_inline_contents { // was not commented out. The source line is remapped using source contents that // from the module graph. itest!(inline_js_source_map_with_contents_from_graph { - args: "run --quiet run/inline_js_source_map_with_contents_from_graph.js", + args: "run --allow-import --quiet run/inline_js_source_map_with_contents_from_graph.js", output: "run/inline_js_source_map_with_contents_from_graph.js.out", exit_code: 1, http_server: true, @@ -3031,14 +3038,14 @@ mod permissions { }); itest!(dynamic_import_permissions_remote_remote { - args: "run --quiet --reload --allow-net=localhost:4545 dynamic_import/permissions_remote_remote.ts", + args: "run --quiet --reload --allow-import=localhost:4545 dynamic_import/permissions_remote_remote.ts", output: "dynamic_import/permissions_remote_remote.ts.out", http_server: true, exit_code: 1, }); itest!(dynamic_import_permissions_data_remote { - args: "run --quiet --reload --allow-net=localhost:4545 dynamic_import/permissions_data_remote.ts", + args: "run --quiet --reload --allow-import=localhost:4545 dynamic_import/permissions_data_remote.ts", output: "dynamic_import/permissions_data_remote.ts.out", http_server: true, exit_code: 1, @@ -3329,7 +3336,7 @@ itest!(no_config_auto_discovery_for_local_script { }); itest!(config_not_auto_discovered_for_remote_script { - args: "run --quiet http://127.0.0.1:4545/run/with_config/server_side_work.ts", + args: "run --allow-import --quiet http://127.0.0.1:4545/run/with_config/server_side_work.ts", output_str: Some("ok\n"), http_server: true, }); @@ -3468,6 +3475,7 @@ fn check_local_then_remote() { let output = util::deno_cmd_with_deno_dir(&deno_dir) .current_dir(util::testdata_path()) .arg("run") + .arg("--allow-import") .arg("--check") .arg("run/remote_type_error/main.ts") .spawn() @@ -3478,6 +3486,7 @@ fn check_local_then_remote() { let output = util::deno_cmd_with_deno_dir(&deno_dir) .current_dir(util::testdata_path()) .arg("run") + .arg("--allow-import") .arg("--check=all") .arg("run/remote_type_error/main.ts") .env("NO_COLOR", "1") @@ -3655,6 +3664,7 @@ fn cache_test() { .env("DENO_DIR", deno_dir.path()) .current_dir(util::testdata_path()) .arg("cache") + .arg("--allow-import=localhost:4545") .arg("--check=all") .arg("-L") .arg("debug") @@ -3670,6 +3680,7 @@ fn cache_test() { .env("NO_COLOR", "1") .current_dir(util::testdata_path()) .arg("run") + .arg("--allow-import=localhost:4545") .arg(module_url.to_string()) .output() .expect("Failed to spawn script"); @@ -3819,6 +3830,7 @@ fn basic_auth_tokens() { let output = util::deno_cmd() .current_dir(util::root_path()) .arg("run") + .arg("--allow-import") .arg("http://127.0.0.1:4554/run/001_hello.js") .piped_output() .spawn() @@ -3840,6 +3852,7 @@ fn basic_auth_tokens() { let output = util::deno_cmd() .current_dir(util::root_path()) .arg("run") + .arg("--allow-import") .arg("http://127.0.0.1:4554/run/001_hello.js") .env("DENO_AUTH_TOKENS", "testuser123:testpassabc@127.0.0.1:4554") .piped_output() @@ -4404,7 +4417,7 @@ async fn websocket_server_idletimeout() { } itest!(no_lock_flag { - args: "run --no-lock run/no_lock_flag/main.ts", + args: "run --allow-import --no-lock run/no_lock_flag/main.ts", output: "run/no_lock_flag/main.out", http_server: true, exit_code: 0, @@ -4563,7 +4576,9 @@ pub fn vendor_dir_config_file() { console.log(returnsHi());"#, ); - let deno_run_cmd = test_context.new_command().args("run --quiet main.ts"); + let deno_run_cmd = test_context + .new_command() + .args("run --allow-import --quiet main.ts"); deno_run_cmd.run().assert_matches_text("Hi\n"); assert!(vendor_dir.exists()); @@ -4574,13 +4589,15 @@ console.log(returnsHi());"#, assert!(!vendor_dir.exists()); test_context .new_command() - .args("cache --quiet --vendor main.ts") + .args("cache --allow-import --quiet --vendor main.ts") .run(); assert!(vendor_dir.exists()); rm_vendor_dir(); temp_dir.write("deno.json", r#"{ "vendor": true }"#); - let cache_command = test_context.new_command().args("cache --quiet main.ts"); + let cache_command = test_context + .new_command() + .args("cache --allow-import --quiet main.ts"); cache_command.run(); assert!(vendor_dir.exists()); @@ -4608,7 +4625,7 @@ console.log(returnsHi());"#, test_context .new_command() // http_localhost_4545/subdir/#capitals_c75d7/main.js - .args("cache http://localhost:4545/subdir/CAPITALS/main.js") + .args("cache --allow-import http://localhost:4545/subdir/CAPITALS/main.js") .run() .skip_output_check(); assert_eq!( @@ -4625,7 +4642,7 @@ console.log(returnsHi());"#, test_context .new_command() // todo(dsherret): seems wrong that we don't auto-discover the config file to get the vendor directory for this - .args("run --vendor http://localhost:4545/subdir/CAPITALS/hello_there.ts") + .args("run --allow-import --vendor http://localhost:4545/subdir/CAPITALS/hello_there.ts") .run() .assert_matches_text("hello there\n"); @@ -5120,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"); } diff --git a/tests/integration/watcher_tests.rs b/tests/integration/watcher_tests.rs index 56686cd14a..122353bba9 100644 --- a/tests/integration/watcher_tests.rs +++ b/tests/integration/watcher_tests.rs @@ -1399,6 +1399,7 @@ async fn run_watch_reload_once() { let mut child = util::deno_cmd() .current_dir(t.path()) .arg("run") + .arg("--allow-import") .arg("--watch") .arg("--reload") .arg(&file_to_watch) diff --git a/tests/specs/bench/check_local_by_default/__test__.jsonc b/tests/specs/bench/check_local_by_default/__test__.jsonc index 76dd80b7bd..42dbe57d31 100644 --- a/tests/specs/bench/check_local_by_default/__test__.jsonc +++ b/tests/specs/bench/check_local_by_default/__test__.jsonc @@ -1,4 +1,4 @@ { - "args": "bench --quiet check_local_by_default.ts", + "args": "bench --allow-import --quiet check_local_by_default.ts", "output": "check_local_by_default.out" } diff --git a/tests/specs/bench/check_local_by_default2/__test__.jsonc b/tests/specs/bench/check_local_by_default2/__test__.jsonc index 5f2366d1e1..7f4ca0e392 100644 --- a/tests/specs/bench/check_local_by_default2/__test__.jsonc +++ b/tests/specs/bench/check_local_by_default2/__test__.jsonc @@ -1,5 +1,5 @@ { - "args": "bench --quiet check_local_by_default2.ts", + "args": "bench --allow-import --quiet check_local_by_default2.ts", "output": "check_local_by_default2.out", "exitCode": 1 } diff --git a/tests/specs/cache/check_local_by_default/__test__.jsonc b/tests/specs/cache/check_local_by_default/__test__.jsonc index e6d0829fd5..e3ce115d87 100644 --- a/tests/specs/cache/check_local_by_default/__test__.jsonc +++ b/tests/specs/cache/check_local_by_default/__test__.jsonc @@ -1,4 +1,4 @@ { - "args": "cache --quiet check_local_by_default.ts", + "args": "cache --quiet --allow-import check_local_by_default.ts", "output": "check_local_by_default.out" } diff --git a/tests/specs/cache/check_local_by_default2/__test__.jsonc b/tests/specs/cache/check_local_by_default2/__test__.jsonc index a9e70dcd94..36bcd6ee6f 100644 --- a/tests/specs/cache/check_local_by_default2/__test__.jsonc +++ b/tests/specs/cache/check_local_by_default2/__test__.jsonc @@ -1,4 +1,4 @@ { - "args": "cache --quiet check_local_by_default2.ts", + "args": "cache --quiet --allow-import check_local_by_default2.ts", "output": "check_local_by_default2.out" } diff --git a/tests/specs/cache/fetch_multiple/__test__.jsonc b/tests/specs/cache/fetch_multiple/__test__.jsonc index a5cf411131..934b65499c 100644 --- a/tests/specs/cache/fetch_multiple/__test__.jsonc +++ b/tests/specs/cache/fetch_multiple/__test__.jsonc @@ -1,4 +1,4 @@ { - "args": "cache --reload --check=all test.ts other.ts", + "args": "cache --reload --allow-import --check=all test.ts other.ts", "output": "fetch_multiple.out" } diff --git a/tests/specs/cache/globbing/__test__.jsonc b/tests/specs/cache/globbing/__test__.jsonc index 9bf210bb41..2dfb49ffbd 100644 --- a/tests/specs/cache/globbing/__test__.jsonc +++ b/tests/specs/cache/globbing/__test__.jsonc @@ -1,5 +1,5 @@ { - "args": "cache *.ts", + "args": "cache --allow-import *.ts", "output": "Download http://localhost:4545/echo.ts\n", "exitCode": 0 } diff --git a/tests/specs/cache/redirect/__test__.jsonc b/tests/specs/cache/redirect/__test__.jsonc index 251bc61749..6c0ab3c9fe 100644 --- a/tests/specs/cache/redirect/__test__.jsonc +++ b/tests/specs/cache/redirect/__test__.jsonc @@ -1,4 +1,4 @@ { - "args": "cache --reload --check=all http://localhost:4548/subdir/redirects/a.ts", + "args": "cache --reload --allow-import --check=all http://localhost:4548/subdir/redirects/a.ts", "output": "redirect_cache.out" } diff --git a/tests/specs/cert/cafile_ts_fetch/__test__.jsonc b/tests/specs/cert/cafile_ts_fetch/__test__.jsonc index 8ace23f25a..35573839c8 100644 --- a/tests/specs/cert/cafile_ts_fetch/__test__.jsonc +++ b/tests/specs/cert/cafile_ts_fetch/__test__.jsonc @@ -1,6 +1,6 @@ { "steps": [{ - "args": "run --quiet --reload --allow-net --cert RootCA.pem cafile_ts_fetch.ts", + "args": "run --quiet --reload --allow-net --allow-import --cert RootCA.pem cafile_ts_fetch.ts", "flaky": true, "output": "cafile_ts_fetch.ts.out" }, { @@ -8,11 +8,11 @@ "flaky": true, "output": "cafile_ts_fetch.ts.out" }, { - "args": "info --quiet --cert RootCA.pem https://localhost:5545/cert/cafile_info.ts", + "args": "info --quiet --allow-import --cert RootCA.pem https://localhost:5545/cert/cafile_info.ts", "flaky": true, "output": "cafile_info.ts.out" }, { - "args": "cache --quiet --cert RootCA.pem http://localhost:4545/cert/cafile_url_imports.ts", + "args": "cache --quiet --allow-import --cert RootCA.pem http://localhost:4545/cert/cafile_url_imports.ts", "flaky": true, "output": "" }] diff --git a/tests/specs/cert/cafile_url_imports/__test__.jsonc b/tests/specs/cert/cafile_url_imports/__test__.jsonc index f52bb7068b..4375f60273 100644 --- a/tests/specs/cert/cafile_url_imports/__test__.jsonc +++ b/tests/specs/cert/cafile_url_imports/__test__.jsonc @@ -1,5 +1,5 @@ { - "args": "run --quiet --reload --cert RootCA.pem cafile_url_imports.ts", + "args": "run --quiet --reload --allow-import --cert RootCA.pem cafile_url_imports.ts", "flaky": true, "output": "cafile_url_imports.ts.out" } diff --git a/tests/specs/cert/cafile_url_imports_unsafe_ssl/__test__.jsonc b/tests/specs/cert/cafile_url_imports_unsafe_ssl/__test__.jsonc index 526649aa15..67df193b6e 100644 --- a/tests/specs/cert/cafile_url_imports_unsafe_ssl/__test__.jsonc +++ b/tests/specs/cert/cafile_url_imports_unsafe_ssl/__test__.jsonc @@ -1,5 +1,5 @@ { - "args": "run --quiet --reload --unsafely-ignore-certificate-errors=localhost cafile_url_imports.ts", + "args": "run --quiet --allow-import --reload --unsafely-ignore-certificate-errors=localhost cafile_url_imports.ts", "flaky": true, "output": "cafile_url_imports_unsafe_ssl.ts.out" } diff --git a/tests/specs/cert/localhost_unsafe_ssl/__test__.jsonc b/tests/specs/cert/localhost_unsafe_ssl/__test__.jsonc index 90ca827dcb..f0c1895f4e 100644 --- a/tests/specs/cert/localhost_unsafe_ssl/__test__.jsonc +++ b/tests/specs/cert/localhost_unsafe_ssl/__test__.jsonc @@ -1,5 +1,5 @@ { - "args": "run --quiet --reload --allow-net --unsafely-ignore-certificate-errors=deno.land cafile_url_imports.ts", + "args": "run --quiet --reload --allow-import --allow-net --unsafely-ignore-certificate-errors=deno.land cafile_url_imports.ts", "output": "localhost_unsafe_ssl.ts.out", "exitCode": 1 } diff --git a/tests/specs/check/jsx_import_source_types/__test__.jsonc b/tests/specs/check/jsx_import_source_types/__test__.jsonc index 4cd2aa4235..18ff8cd079 100644 --- a/tests/specs/check/jsx_import_source_types/__test__.jsonc +++ b/tests/specs/check/jsx_import_source_types/__test__.jsonc @@ -1,4 +1,4 @@ { - "args": "check --all main.tsx", + "args": "check --allow-import --all main.tsx", "output": "main.out" } diff --git a/tests/specs/check/jsx_import_source_types_config/__test__.jsonc b/tests/specs/check/jsx_import_source_types_config/__test__.jsonc index 4cd2aa4235..18ff8cd079 100644 --- a/tests/specs/check/jsx_import_source_types_config/__test__.jsonc +++ b/tests/specs/check/jsx_import_source_types_config/__test__.jsonc @@ -1,4 +1,4 @@ { - "args": "check --all main.tsx", + "args": "check --allow-import --all main.tsx", "output": "main.out" } diff --git a/tests/specs/check/remote_missing_override/__test__.jsonc b/tests/specs/check/remote_missing_override/__test__.jsonc index db79e37373..9eb58dcc5d 100644 --- a/tests/specs/check/remote_missing_override/__test__.jsonc +++ b/tests/specs/check/remote_missing_override/__test__.jsonc @@ -1,4 +1,4 @@ { - "args": "check --all main.ts", + "args": "check --allow-import --all main.ts", "output": "Download [WILDLINE]\nCheck [WILDLINE]\n" } diff --git a/tests/specs/compile/repetitive_unstable_flag/__test__.jsonc b/tests/specs/compile/repetitive_unstable_flag/__test__.jsonc index 00d38bee6e..3f6ea62e50 100644 --- a/tests/specs/compile/repetitive_unstable_flag/__test__.jsonc +++ b/tests/specs/compile/repetitive_unstable_flag/__test__.jsonc @@ -1,4 +1,5 @@ { + "tempDir": true, "steps": [ { "args": "compile --unstable-kv -A --output out main.ts", diff --git a/tests/specs/doc/types_header/__test__.jsonc b/tests/specs/doc/types_header/__test__.jsonc index 586fca28b9..2fa4c33810 100644 --- a/tests/specs/doc/types_header/__test__.jsonc +++ b/tests/specs/doc/types_header/__test__.jsonc @@ -1,4 +1,4 @@ { - "args": "doc --reload types_header.ts", + "args": "doc --allow-import --reload types_header.ts", "output": "types_header.out" } diff --git a/tests/specs/doc/types_header_direct/__test__.jsonc b/tests/specs/doc/types_header_direct/__test__.jsonc index 1dc5b80693..25418655ab 100644 --- a/tests/specs/doc/types_header_direct/__test__.jsonc +++ b/tests/specs/doc/types_header_direct/__test__.jsonc @@ -1,4 +1,4 @@ { - "args": "doc --reload http://127.0.0.1:4545/xTypeScriptTypes.js", + "args": "doc --allow-import --reload http://127.0.0.1:4545/xTypeScriptTypes.js", "output": "types_header.out" } diff --git a/tests/specs/info_tests/_054_info_local_imports/005_more_imports.ts b/tests/specs/info/_054_info_local_imports/005_more_imports.ts similarity index 100% rename from tests/specs/info_tests/_054_info_local_imports/005_more_imports.ts rename to tests/specs/info/_054_info_local_imports/005_more_imports.ts diff --git a/tests/specs/info_tests/_054_info_local_imports/054_info_local_imports.out b/tests/specs/info/_054_info_local_imports/054_info_local_imports.out similarity index 100% rename from tests/specs/info_tests/_054_info_local_imports/054_info_local_imports.out rename to tests/specs/info/_054_info_local_imports/054_info_local_imports.out diff --git a/tests/specs/info_tests/_054_info_local_imports/__test__.jsonc b/tests/specs/info/_054_info_local_imports/__test__.jsonc similarity index 100% rename from tests/specs/info_tests/_054_info_local_imports/__test__.jsonc rename to tests/specs/info/_054_info_local_imports/__test__.jsonc diff --git a/tests/specs/info_tests/_054_info_local_imports/mod1.ts b/tests/specs/info/_054_info_local_imports/mod1.ts similarity index 100% rename from tests/specs/info_tests/_054_info_local_imports/mod1.ts rename to tests/specs/info/_054_info_local_imports/mod1.ts diff --git a/tests/specs/info_tests/_054_info_local_imports/mod2.ts b/tests/specs/info/_054_info_local_imports/mod2.ts similarity index 100% rename from tests/specs/info_tests/_054_info_local_imports/mod2.ts rename to tests/specs/info/_054_info_local_imports/mod2.ts diff --git a/tests/specs/info_tests/_054_info_local_imports/print_hello.ts b/tests/specs/info/_054_info_local_imports/print_hello.ts similarity index 100% rename from tests/specs/info_tests/_054_info_local_imports/print_hello.ts rename to tests/specs/info/_054_info_local_imports/print_hello.ts diff --git a/tests/specs/info_tests/_054_info_local_imports/subdir2/dynamic_import.ts b/tests/specs/info/_054_info_local_imports/subdir2/dynamic_import.ts similarity index 100% rename from tests/specs/info_tests/_054_info_local_imports/subdir2/dynamic_import.ts rename to tests/specs/info/_054_info_local_imports/subdir2/dynamic_import.ts diff --git a/tests/specs/info_tests/_054_info_local_imports/subdir2/mod2.ts b/tests/specs/info/_054_info_local_imports/subdir2/mod2.ts similarity index 100% rename from tests/specs/info_tests/_054_info_local_imports/subdir2/mod2.ts rename to tests/specs/info/_054_info_local_imports/subdir2/mod2.ts diff --git a/tests/specs/info_tests/data_null_error/__test__.jsonc b/tests/specs/info/data_null_error/__test__.jsonc similarity index 100% rename from tests/specs/info_tests/data_null_error/__test__.jsonc rename to tests/specs/info/data_null_error/__test__.jsonc diff --git a/tests/specs/info_tests/data_null_error/data_null_error/data_null_error.out b/tests/specs/info/data_null_error/data_null_error/data_null_error.out similarity index 100% rename from tests/specs/info_tests/data_null_error/data_null_error/data_null_error.out rename to tests/specs/info/data_null_error/data_null_error/data_null_error.out diff --git a/tests/specs/info_tests/data_null_error/data_null_error/mod.ts b/tests/specs/info/data_null_error/data_null_error/mod.ts similarity index 100% rename from tests/specs/info_tests/data_null_error/data_null_error/mod.ts rename to tests/specs/info/data_null_error/data_null_error/mod.ts diff --git a/tests/specs/info_tests/data_null_error/data_null_error/types.d.ts b/tests/specs/info/data_null_error/data_null_error/types.d.ts similarity index 100% rename from tests/specs/info_tests/data_null_error/data_null_error/types.d.ts rename to tests/specs/info/data_null_error/data_null_error/types.d.ts diff --git a/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/__test__.jsonc b/tests/specs/info/dynamic_imports_tmpl_lit/__test__.jsonc similarity index 100% rename from tests/specs/info_tests/info_dynamic_imports_tmpl_lit/__test__.jsonc rename to tests/specs/info/dynamic_imports_tmpl_lit/__test__.jsonc diff --git a/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/main.info.out b/tests/specs/info/dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/main.info.out similarity index 100% rename from tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/main.info.out rename to tests/specs/info/dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/main.info.out diff --git a/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/main.js b/tests/specs/info/dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/main.js similarity index 100% rename from tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/main.js rename to tests/specs/info/dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/main.js diff --git a/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/other/data.json b/tests/specs/info/dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/other/data.json similarity index 100% rename from tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/other/data.json rename to tests/specs/info/dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/other/data.json diff --git a/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/other/sub/data2.json b/tests/specs/info/dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/other/sub/data2.json similarity index 100% rename from tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/other/sub/data2.json rename to tests/specs/info/dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/other/sub/data2.json diff --git a/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/sub/a.js b/tests/specs/info/dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/sub/a.js similarity index 100% rename from tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/sub/a.js rename to tests/specs/info/dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/sub/a.js diff --git a/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/sub/b.ts b/tests/specs/info/dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/sub/b.ts similarity index 100% rename from tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/sub/b.ts rename to tests/specs/info/dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/sub/b.ts diff --git a/tests/specs/info_tests/info_flag/041_info_flag.out b/tests/specs/info/flag/041_info_flag.out similarity index 100% rename from tests/specs/info_tests/info_flag/041_info_flag.out rename to tests/specs/info/flag/041_info_flag.out diff --git a/tests/specs/info_tests/info_flag/__test__.jsonc b/tests/specs/info/flag/__test__.jsonc similarity index 100% rename from tests/specs/info_tests/info_flag/__test__.jsonc rename to tests/specs/info/flag/__test__.jsonc diff --git a/tests/specs/info_tests/info_flag_location/041_info_flag_location.out b/tests/specs/info/flag_location/041_info_flag_location.out similarity index 100% rename from tests/specs/info_tests/info_flag_location/041_info_flag_location.out rename to tests/specs/info/flag_location/041_info_flag_location.out diff --git a/tests/specs/info_tests/info_flag_location/__test__.jsonc b/tests/specs/info/flag_location/__test__.jsonc similarity index 100% rename from tests/specs/info_tests/info_flag_location/__test__.jsonc rename to tests/specs/info/flag_location/__test__.jsonc diff --git a/tests/specs/info_tests/info_flag_script_jsx/049_info_flag_script_jsx.out b/tests/specs/info/flag_script_jsx/049_info_flag_script_jsx.out similarity index 100% rename from tests/specs/info_tests/info_flag_script_jsx/049_info_flag_script_jsx.out rename to tests/specs/info/flag_script_jsx/049_info_flag_script_jsx.out diff --git a/tests/specs/info/flag_script_jsx/__test__.jsonc b/tests/specs/info/flag_script_jsx/__test__.jsonc new file mode 100644 index 0000000000..6b6cdc4e12 --- /dev/null +++ b/tests/specs/info/flag_script_jsx/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "info --allow-import http://127.0.0.1:4545/run/048_media_types_jsx.ts", + "output": "049_info_flag_script_jsx.out" +} diff --git a/tests/specs/info_tests/info_import_map/__test__.jsonc b/tests/specs/info/import_map/__test__.jsonc similarity index 100% rename from tests/specs/info_tests/info_import_map/__test__.jsonc rename to tests/specs/info/import_map/__test__.jsonc diff --git a/tests/specs/info_tests/info_import_map/deno.json b/tests/specs/info/import_map/deno.json similarity index 100% rename from tests/specs/info_tests/info_import_map/deno.json rename to tests/specs/info/import_map/deno.json diff --git a/tests/specs/info_tests/info_import_map/deno.lock b/tests/specs/info/import_map/deno.lock similarity index 100% rename from tests/specs/info_tests/info_import_map/deno.lock rename to tests/specs/info/import_map/deno.lock diff --git a/tests/specs/info_tests/info_import_map/main.tsx b/tests/specs/info/import_map/main.tsx similarity index 100% rename from tests/specs/info_tests/info_import_map/main.tsx rename to tests/specs/info/import_map/main.tsx diff --git a/tests/specs/info_tests/info_import_map/with_import_map.out b/tests/specs/info/import_map/with_import_map.out similarity index 100% rename from tests/specs/info_tests/info_import_map/with_import_map.out rename to tests/specs/info/import_map/with_import_map.out diff --git a/tests/specs/info_tests/info_json/__test__.jsonc b/tests/specs/info/json/__test__.jsonc similarity index 100% rename from tests/specs/info_tests/info_json/__test__.jsonc rename to tests/specs/info/json/__test__.jsonc diff --git a/tests/specs/info_tests/info_json/info_json.out b/tests/specs/info/json/info_json.out similarity index 100% rename from tests/specs/info_tests/info_json/info_json.out rename to tests/specs/info/json/info_json.out diff --git a/tests/specs/info_tests/info_json_deps_order/076_info_json_deps_order.out b/tests/specs/info/json_deps_order/076_info_json_deps_order.out similarity index 100% rename from tests/specs/info_tests/info_json_deps_order/076_info_json_deps_order.out rename to tests/specs/info/json_deps_order/076_info_json_deps_order.out diff --git a/tests/specs/info_tests/info_json_deps_order/076_info_json_deps_order.ts b/tests/specs/info/json_deps_order/076_info_json_deps_order.ts similarity index 100% rename from tests/specs/info_tests/info_json_deps_order/076_info_json_deps_order.ts rename to tests/specs/info/json_deps_order/076_info_json_deps_order.ts diff --git a/tests/specs/info_tests/info_json_deps_order/__test__.jsonc b/tests/specs/info/json_deps_order/__test__.jsonc similarity index 100% rename from tests/specs/info_tests/info_json_deps_order/__test__.jsonc rename to tests/specs/info/json_deps_order/__test__.jsonc diff --git a/tests/specs/info_tests/info_json_deps_order/recursive_imports/A.ts b/tests/specs/info/json_deps_order/recursive_imports/A.ts similarity index 100% rename from tests/specs/info_tests/info_json_deps_order/recursive_imports/A.ts rename to tests/specs/info/json_deps_order/recursive_imports/A.ts diff --git a/tests/specs/info_tests/info_json_deps_order/recursive_imports/B.ts b/tests/specs/info/json_deps_order/recursive_imports/B.ts similarity index 100% rename from tests/specs/info_tests/info_json_deps_order/recursive_imports/B.ts rename to tests/specs/info/json_deps_order/recursive_imports/B.ts diff --git a/tests/specs/info_tests/info_json_deps_order/recursive_imports/C.ts b/tests/specs/info/json_deps_order/recursive_imports/C.ts similarity index 100% rename from tests/specs/info_tests/info_json_deps_order/recursive_imports/C.ts rename to tests/specs/info/json_deps_order/recursive_imports/C.ts diff --git a/tests/specs/info_tests/info_json_deps_order/recursive_imports/common.ts b/tests/specs/info/json_deps_order/recursive_imports/common.ts similarity index 100% rename from tests/specs/info_tests/info_json_deps_order/recursive_imports/common.ts rename to tests/specs/info/json_deps_order/recursive_imports/common.ts diff --git a/tests/specs/info_tests/json_file/__test__.jsonc b/tests/specs/info/json_file/__test__.jsonc similarity index 100% rename from tests/specs/info_tests/json_file/__test__.jsonc rename to tests/specs/info/json_file/__test__.jsonc diff --git a/tests/specs/info_tests/json_file/json_output/main.out b/tests/specs/info/json_file/json_output/main.out similarity index 100% rename from tests/specs/info_tests/json_file/json_output/main.out rename to tests/specs/info/json_file/json_output/main.out diff --git a/tests/specs/info_tests/json_file/json_output/main.ts b/tests/specs/info/json_file/json_output/main.ts similarity index 100% rename from tests/specs/info_tests/json_file/json_output/main.ts rename to tests/specs/info/json_file/json_output/main.ts diff --git a/tests/specs/info_tests/json_file/mod1.ts b/tests/specs/info/json_file/mod1.ts similarity index 100% rename from tests/specs/info_tests/json_file/mod1.ts rename to tests/specs/info/json_file/mod1.ts diff --git a/tests/specs/info_tests/json_file/mod2.ts b/tests/specs/info/json_file/mod2.ts similarity index 100% rename from tests/specs/info_tests/json_file/mod2.ts rename to tests/specs/info/json_file/mod2.ts diff --git a/tests/specs/info_tests/json_file/print_hello.ts b/tests/specs/info/json_file/print_hello.ts similarity index 100% rename from tests/specs/info_tests/json_file/print_hello.ts rename to tests/specs/info/json_file/print_hello.ts diff --git a/tests/specs/info_tests/json_file/subdir2/dynamic_import.ts b/tests/specs/info/json_file/subdir2/dynamic_import.ts similarity index 100% rename from tests/specs/info_tests/json_file/subdir2/dynamic_import.ts rename to tests/specs/info/json_file/subdir2/dynamic_import.ts diff --git a/tests/specs/info_tests/json_file/subdir2/mod2.ts b/tests/specs/info/json_file/subdir2/mod2.ts similarity index 100% rename from tests/specs/info_tests/json_file/subdir2/mod2.ts rename to tests/specs/info/json_file/subdir2/mod2.ts diff --git a/tests/specs/info_tests/info_json_location/__test__.jsonc b/tests/specs/info/json_location/__test__.jsonc similarity index 100% rename from tests/specs/info_tests/info_json_location/__test__.jsonc rename to tests/specs/info/json_location/__test__.jsonc diff --git a/tests/specs/info_tests/info_json_location/info_json_location.out b/tests/specs/info/json_location/info_json_location.out similarity index 100% rename from tests/specs/info_tests/info_json_location/info_json_location.out rename to tests/specs/info/json_location/info_json_location.out diff --git a/tests/specs/info_tests/info_missing_module/__test__.jsonc b/tests/specs/info/missing_module/__test__.jsonc similarity index 100% rename from tests/specs/info_tests/info_missing_module/__test__.jsonc rename to tests/specs/info/missing_module/__test__.jsonc diff --git a/tests/specs/info_tests/info_missing_module/error_009_missing_js_module.js b/tests/specs/info/missing_module/error_009_missing_js_module.js similarity index 100% rename from tests/specs/info_tests/info_missing_module/error_009_missing_js_module.js rename to tests/specs/info/missing_module/error_009_missing_js_module.js diff --git a/tests/specs/info_tests/info_missing_module/info_missing_module.out b/tests/specs/info/missing_module/info_missing_module.out similarity index 100% rename from tests/specs/info_tests/info_missing_module/info_missing_module.out rename to tests/specs/info/missing_module/info_missing_module.out diff --git a/tests/specs/info/multiple_imports/__test__.jsonc b/tests/specs/info/multiple_imports/__test__.jsonc new file mode 100644 index 0000000000..32d72bcb3a --- /dev/null +++ b/tests/specs/info/multiple_imports/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "info --allow-import http://127.0.0.1:4545/run/019_media_types.ts", + "output": "multiple_imports.out" +} diff --git a/tests/specs/info_tests/multiple_imports/multiple_imports.out b/tests/specs/info/multiple_imports/multiple_imports.out similarity index 100% rename from tests/specs/info_tests/multiple_imports/multiple_imports.out rename to tests/specs/info/multiple_imports/multiple_imports.out diff --git a/tests/specs/info/multiple_redirects/__test__.jsonc b/tests/specs/info/multiple_redirects/__test__.jsonc index 0e1808e0a9..205d21c130 100644 --- a/tests/specs/info/multiple_redirects/__test__.jsonc +++ b/tests/specs/info/multiple_redirects/__test__.jsonc @@ -1,4 +1,4 @@ { - "args": "info --json main.ts", + "args": "info --allow-import --json main.ts", "output": "main.out" } diff --git a/tests/specs/info_tests/info_recursive_modules/__test__.jsonc b/tests/specs/info/recursive_modules/__test__.jsonc similarity index 100% rename from tests/specs/info_tests/info_recursive_modules/__test__.jsonc rename to tests/specs/info/recursive_modules/__test__.jsonc diff --git a/tests/specs/info_tests/info_recursive_modules/info_recursive_imports_test.out b/tests/specs/info/recursive_modules/info_recursive_imports_test.out similarity index 100% rename from tests/specs/info_tests/info_recursive_modules/info_recursive_imports_test.out rename to tests/specs/info/recursive_modules/info_recursive_imports_test.out diff --git a/tests/specs/info_tests/info_recursive_modules/info_recursive_imports_test.ts b/tests/specs/info/recursive_modules/info_recursive_imports_test.ts similarity index 100% rename from tests/specs/info_tests/info_recursive_modules/info_recursive_imports_test.ts rename to tests/specs/info/recursive_modules/info_recursive_imports_test.ts diff --git a/tests/specs/info_tests/info_recursive_modules/recursive_imports/A.ts b/tests/specs/info/recursive_modules/recursive_imports/A.ts similarity index 100% rename from tests/specs/info_tests/info_recursive_modules/recursive_imports/A.ts rename to tests/specs/info/recursive_modules/recursive_imports/A.ts diff --git a/tests/specs/info_tests/info_recursive_modules/recursive_imports/B.ts b/tests/specs/info/recursive_modules/recursive_imports/B.ts similarity index 100% rename from tests/specs/info_tests/info_recursive_modules/recursive_imports/B.ts rename to tests/specs/info/recursive_modules/recursive_imports/B.ts diff --git a/tests/specs/info_tests/info_recursive_modules/recursive_imports/C.ts b/tests/specs/info/recursive_modules/recursive_imports/C.ts similarity index 100% rename from tests/specs/info_tests/info_recursive_modules/recursive_imports/C.ts rename to tests/specs/info/recursive_modules/recursive_imports/C.ts diff --git a/tests/specs/info_tests/info_recursive_modules/recursive_imports/common.ts b/tests/specs/info/recursive_modules/recursive_imports/common.ts similarity index 100% rename from tests/specs/info_tests/info_recursive_modules/recursive_imports/common.ts rename to tests/specs/info/recursive_modules/recursive_imports/common.ts diff --git a/tests/specs/info_tests/info_type_import/__test__.jsonc b/tests/specs/info/type_import/__test__.jsonc similarity index 100% rename from tests/specs/info_tests/info_type_import/__test__.jsonc rename to tests/specs/info/type_import/__test__.jsonc diff --git a/tests/specs/info_tests/info_type_import/info_type_import.out b/tests/specs/info/type_import/info_type_import.out similarity index 100% rename from tests/specs/info_tests/info_type_import/info_type_import.out rename to tests/specs/info/type_import/info_type_import.out diff --git a/tests/specs/info_tests/info_type_import/info_type_import.ts b/tests/specs/info/type_import/info_type_import.ts similarity index 100% rename from tests/specs/info_tests/info_type_import/info_type_import.ts rename to tests/specs/info/type_import/info_type_import.ts diff --git a/tests/specs/info_tests/info_type_import/type_and_code.ts b/tests/specs/info/type_import/type_and_code.ts similarity index 100% rename from tests/specs/info_tests/info_type_import/type_and_code.ts rename to tests/specs/info/type_import/type_and_code.ts diff --git a/tests/specs/info/types_header_direct/__test__.jsonc b/tests/specs/info/types_header_direct/__test__.jsonc new file mode 100644 index 0000000000..df0c1e5733 --- /dev/null +++ b/tests/specs/info/types_header_direct/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "info --allow-import --reload type_directives_01.ts", + "output": "types_header.out" +} diff --git a/tests/specs/info_tests/types_header_direct/type_directives_01.ts b/tests/specs/info/types_header_direct/type_directives_01.ts similarity index 100% rename from tests/specs/info_tests/types_header_direct/type_directives_01.ts rename to tests/specs/info/types_header_direct/type_directives_01.ts diff --git a/tests/specs/info_tests/types_header_direct/types_header.out b/tests/specs/info/types_header_direct/types_header.out similarity index 100% rename from tests/specs/info_tests/types_header_direct/types_header.out rename to tests/specs/info/types_header_direct/types_header.out diff --git a/tests/specs/info_tests/with_config_override/__test__.jsonc b/tests/specs/info/with_config_override/__test__.jsonc similarity index 100% rename from tests/specs/info_tests/with_config_override/__test__.jsonc rename to tests/specs/info/with_config_override/__test__.jsonc diff --git a/tests/specs/info_tests/with_config_override/with_config/deno-override.json b/tests/specs/info/with_config_override/with_config/deno-override.json similarity index 100% rename from tests/specs/info_tests/with_config_override/with_config/deno-override.json rename to tests/specs/info/with_config_override/with_config/deno-override.json diff --git a/tests/specs/info_tests/with_config_override/with_config/deno.json b/tests/specs/info/with_config_override/with_config/deno.json similarity index 100% rename from tests/specs/info_tests/with_config_override/with_config/deno.json rename to tests/specs/info/with_config_override/with_config/deno.json diff --git a/tests/specs/info_tests/with_config_override/with_config/import_map.json b/tests/specs/info/with_config_override/with_config/import_map.json similarity index 100% rename from tests/specs/info_tests/with_config_override/with_config/import_map.json rename to tests/specs/info/with_config_override/with_config/import_map.json diff --git a/tests/specs/info_tests/with_config_override/with_config/test.ts b/tests/specs/info/with_config_override/with_config/test.ts similarity index 100% rename from tests/specs/info_tests/with_config_override/with_config/test.ts rename to tests/specs/info/with_config_override/with_config/test.ts diff --git a/tests/specs/info_tests/with_config_override/with_config/with_config.out b/tests/specs/info/with_config_override/with_config/with_config.out similarity index 100% rename from tests/specs/info_tests/with_config_override/with_config/with_config.out rename to tests/specs/info/with_config_override/with_config/with_config.out diff --git a/tests/specs/info_tests/info_flag_script_jsx/__test__.jsonc b/tests/specs/info_tests/info_flag_script_jsx/__test__.jsonc deleted file mode 100644 index b8dc305aea..0000000000 --- a/tests/specs/info_tests/info_flag_script_jsx/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "args": "info http://127.0.0.1:4545/run/048_media_types_jsx.ts", - "output": "049_info_flag_script_jsx.out" -} diff --git a/tests/specs/info_tests/multiple_imports/__test__.jsonc b/tests/specs/info_tests/multiple_imports/__test__.jsonc deleted file mode 100644 index b110b2d4c6..0000000000 --- a/tests/specs/info_tests/multiple_imports/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "args": "info http://127.0.0.1:4545/run/019_media_types.ts", - "output": "multiple_imports.out" -} diff --git a/tests/specs/info_tests/types_header_direct/__test__.jsonc b/tests/specs/info_tests/types_header_direct/__test__.jsonc deleted file mode 100644 index 7f9b462efa..0000000000 --- a/tests/specs/info_tests/types_header_direct/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "args": "info --reload type_directives_01.ts", - "output": "types_header.out" -} diff --git a/tests/specs/install/future_install_local_deno/__test__.jsonc b/tests/specs/install/future_install_local_deno/__test__.jsonc index bbfee2d9de..d257fbc1ff 100644 --- a/tests/specs/install/future_install_local_deno/__test__.jsonc +++ b/tests/specs/install/future_install_local_deno/__test__.jsonc @@ -2,12 +2,12 @@ "tempDir": true, "steps": [ { - "args": "install", + "args": "install --allow-import", "output": "install.out" }, { // ensure deps are actually cached - "args": "run --cached-only main.js", + "args": "run --cached-only --allow-import main.js", "output": "" }, { diff --git a/tests/specs/lockfile/adding_redirect/__test__.jsonc b/tests/specs/lockfile/adding_redirect/__test__.jsonc index d53beedbd4..75933a6b4e 100644 --- a/tests/specs/lockfile/adding_redirect/__test__.jsonc +++ b/tests/specs/lockfile/adding_redirect/__test__.jsonc @@ -1,13 +1,13 @@ { "tempDir": true, "steps": [{ - "args": "run 1.ts", + "args": "run --allow-import 1.ts", "output": "[WILDCARD]" }, { "args": "task --quiet cat deno.lock", "output": "lock01.out" }, { - "args": "run 2.ts", + "args": "run --allow-import 2.ts", "output": "[WILDCARD]" }, { "args": "task --quiet cat deno.lock", diff --git a/tests/specs/lockfile/auto_discover_lockfile/__test__.jsonc b/tests/specs/lockfile/auto_discover_lockfile/__test__.jsonc index 50213381ad..27f6d97871 100644 --- a/tests/specs/lockfile/auto_discover_lockfile/__test__.jsonc +++ b/tests/specs/lockfile/auto_discover_lockfile/__test__.jsonc @@ -1,5 +1,5 @@ { - "args": "run main.ts", + "args": "run --allow-import main.ts", "output": "main.out", "exitCode": 10 } diff --git a/tests/specs/lockfile/config_file_lock_boolean/__test__.jsonc b/tests/specs/lockfile/config_file_lock_boolean/__test__.jsonc index 65679a1c81..651ed113dc 100644 --- a/tests/specs/lockfile/config_file_lock_boolean/__test__.jsonc +++ b/tests/specs/lockfile/config_file_lock_boolean/__test__.jsonc @@ -1,12 +1,12 @@ { "tests": { "true": { - "args": "run --config=true.json main.ts", + "args": "run --allow-import --config=true.json main.ts", "output": "true.main.out", "exitCode": 10 }, "false": { - "args": "run --config=false.json main.ts", + "args": "run --allow-import --config=false.json main.ts", "output": "false.main.out" } } diff --git a/tests/specs/lockfile/config_file_lock_path/__test__.jsonc b/tests/specs/lockfile/config_file_lock_path/__test__.jsonc index defb113b38..5c901e709e 100644 --- a/tests/specs/lockfile/config_file_lock_path/__test__.jsonc +++ b/tests/specs/lockfile/config_file_lock_path/__test__.jsonc @@ -1,12 +1,12 @@ { "tests": { "error_bad_checksum": { - "args": "run --config=config_file_lock_path.json http://localhost:4545/run/019_media_types.ts", + "args": "run --allow-import --config=config_file_lock_path.json http://localhost:4545/run/019_media_types.ts", "output": "config_file_lock_path.out", "exitCode": 10 }, "lock_flag_override": { - "args": "run --lock=run/lock_check_ok2.json --config=config_file_lock_path.json http://localhost:4545/run/019_media_types.ts", + "args": "run --allow-import --lock=run/lock_check_ok2.json --config=config_file_lock_path.json http://localhost:4545/run/019_media_types.ts", "output": "019_media_types.ts.out" } } diff --git a/tests/specs/lockfile/frozen_lockfile/__test__.jsonc b/tests/specs/lockfile/frozen_lockfile/__test__.jsonc index 36a1fc71ef..8179052e19 100644 --- a/tests/specs/lockfile/frozen_lockfile/__test__.jsonc +++ b/tests/specs/lockfile/frozen_lockfile/__test__.jsonc @@ -180,7 +180,7 @@ "output": "[WILDCARD]" }, { - "args": "run --frozen --allow-net http-dynamic.ts", + "args": "run --frozen --allow-import http-dynamic.ts", "output": "frozen_new_dep_dynamic_http.out", "exitCode": 1 } diff --git a/tests/specs/lockfile/no_declaration_files/__test__.jsonc b/tests/specs/lockfile/no_declaration_files/__test__.jsonc index 3238416b0d..3c82828253 100644 --- a/tests/specs/lockfile/no_declaration_files/__test__.jsonc +++ b/tests/specs/lockfile/no_declaration_files/__test__.jsonc @@ -1,7 +1,7 @@ { "tempDir": true, "steps": [{ - "args": "cache --lock --frozen=false main.ts", + "args": "cache --allow-import --lock --frozen=false main.ts", "output": "main.cache.out" }, { "args": [ diff --git a/tests/specs/lockfile/no_lock/__test__.jsonc b/tests/specs/lockfile/no_lock/__test__.jsonc index 75821ac64c..d8172a7ca7 100644 --- a/tests/specs/lockfile/no_lock/__test__.jsonc +++ b/tests/specs/lockfile/no_lock/__test__.jsonc @@ -1,39 +1,39 @@ { "tests": { "info": { - "args": "info main.ts", + "args": "info --allow-import main.ts", "output": "fail.out", "exitCode": 10 }, "info_no_lock": { - "args": "info --no-lock main.ts", + "args": "info --allow-import --no-lock main.ts", "output": "info.nolock.out" }, "bench": { - "args": "bench", + "args": "bench --allow-import", "output": "fail.out", "exitCode": 10 }, "bench_no_lock": { - "args": "bench --no-lock", + "args": "bench --allow-import --no-lock", "output": "bench.nolock.out" }, "doc": { - "args": "doc main.ts", + "args": "doc --allow-import main.ts", "exitCode": 10, "output": "fail.out" }, "doc_no_lock": { - "args": "doc --no-lock main.ts", + "args": "doc --allow-import --no-lock main.ts", "output": "doc.nolock.out" }, "test": { - "args": "test", + "args": "test --allow-import", "exitCode": 10, "output": "fail.out" }, "test_no_lock": { - "args": "test --no-lock", + "args": "test --allow-import --no-lock", "output": "test.nolock.out" } } diff --git a/tests/specs/node_compat_tests/node_process_beforeexit_exit_events_emitted_without_listeners/__test__.jsonc b/tests/specs/node/node_process_beforeexit_exit_events_emitted_without_listeners/__test__.jsonc similarity index 100% rename from tests/specs/node_compat_tests/node_process_beforeexit_exit_events_emitted_without_listeners/__test__.jsonc rename to tests/specs/node/node_process_beforeexit_exit_events_emitted_without_listeners/__test__.jsonc diff --git a/tests/specs/node_compat_tests/node_process_beforeexit_exit_events_emitted_without_listeners/process_beforeexit_exit_events.out b/tests/specs/node/node_process_beforeexit_exit_events_emitted_without_listeners/process_beforeexit_exit_events.out similarity index 100% rename from tests/specs/node_compat_tests/node_process_beforeexit_exit_events_emitted_without_listeners/process_beforeexit_exit_events.out rename to tests/specs/node/node_process_beforeexit_exit_events_emitted_without_listeners/process_beforeexit_exit_events.out diff --git a/tests/specs/node_compat_tests/node_process_beforeexit_exit_events_emitted_without_listeners/process_beforeexit_exit_events.ts b/tests/specs/node/node_process_beforeexit_exit_events_emitted_without_listeners/process_beforeexit_exit_events.ts similarity index 100% rename from tests/specs/node_compat_tests/node_process_beforeexit_exit_events_emitted_without_listeners/process_beforeexit_exit_events.ts rename to tests/specs/node/node_process_beforeexit_exit_events_emitted_without_listeners/process_beforeexit_exit_events.ts diff --git a/tests/specs/node_compat_tests/node_test_module/__test__.jsonc b/tests/specs/node/node_test_module/__test__.jsonc similarity index 100% rename from tests/specs/node_compat_tests/node_test_module/__test__.jsonc rename to tests/specs/node/node_test_module/__test__.jsonc diff --git a/tests/specs/node_compat_tests/node_test_module/test.js b/tests/specs/node/node_test_module/test.js similarity index 100% rename from tests/specs/node_compat_tests/node_test_module/test.js rename to tests/specs/node/node_test_module/test.js diff --git a/tests/specs/node_compat_tests/node_test_module/test.out b/tests/specs/node/node_test_module/test.out similarity index 100% rename from tests/specs/node_compat_tests/node_test_module/test.out rename to tests/specs/node/node_test_module/test.out diff --git a/tests/specs/node_compat_tests/node_test_module_no_sanitizers/__test__.jsonc b/tests/specs/node/node_test_module_no_sanitizers/__test__.jsonc similarity index 100% rename from tests/specs/node_compat_tests/node_test_module_no_sanitizers/__test__.jsonc rename to tests/specs/node/node_test_module_no_sanitizers/__test__.jsonc diff --git a/tests/specs/node_compat_tests/node_test_module_no_sanitizers/test_no_sanitizers/cat.ts b/tests/specs/node/node_test_module_no_sanitizers/test_no_sanitizers/cat.ts similarity index 100% rename from tests/specs/node_compat_tests/node_test_module_no_sanitizers/test_no_sanitizers/cat.ts rename to tests/specs/node/node_test_module_no_sanitizers/test_no_sanitizers/cat.ts diff --git a/tests/specs/node_compat_tests/node_test_module_no_sanitizers/test_no_sanitizers/test.js b/tests/specs/node/node_test_module_no_sanitizers/test_no_sanitizers/test.js similarity index 100% rename from tests/specs/node_compat_tests/node_test_module_no_sanitizers/test_no_sanitizers/test.js rename to tests/specs/node/node_test_module_no_sanitizers/test_no_sanitizers/test.js diff --git a/tests/specs/node_compat_tests/node_test_module_no_sanitizers/test_no_sanitizers/test.out b/tests/specs/node/node_test_module_no_sanitizers/test_no_sanitizers/test.out similarity index 100% rename from tests/specs/node_compat_tests/node_test_module_no_sanitizers/test_no_sanitizers/test.out rename to tests/specs/node/node_test_module_no_sanitizers/test_no_sanitizers/test.out diff --git a/tests/specs/node_compat_tests/node_test_module_no_sanitizers/test_no_sanitizers/welcome.ts b/tests/specs/node/node_test_module_no_sanitizers/test_no_sanitizers/welcome.ts similarity index 100% rename from tests/specs/node_compat_tests/node_test_module_no_sanitizers/test_no_sanitizers/welcome.ts rename to tests/specs/node/node_test_module_no_sanitizers/test_no_sanitizers/welcome.ts diff --git a/tests/specs/node_compat_tests/web_node_events_dispatched_in_correct_order/__test__.jsonc b/tests/specs/node/web_node_events_dispatched_in_correct_order/__test__.jsonc similarity index 100% rename from tests/specs/node_compat_tests/web_node_events_dispatched_in_correct_order/__test__.jsonc rename to tests/specs/node/web_node_events_dispatched_in_correct_order/__test__.jsonc diff --git a/tests/specs/node_compat_tests/web_node_events_dispatched_in_correct_order/events_order.out b/tests/specs/node/web_node_events_dispatched_in_correct_order/events_order.out similarity index 100% rename from tests/specs/node_compat_tests/web_node_events_dispatched_in_correct_order/events_order.out rename to tests/specs/node/web_node_events_dispatched_in_correct_order/events_order.out diff --git a/tests/specs/node_compat_tests/web_node_events_dispatched_in_correct_order/events_order.ts b/tests/specs/node/web_node_events_dispatched_in_correct_order/events_order.ts similarity index 100% rename from tests/specs/node_compat_tests/web_node_events_dispatched_in_correct_order/events_order.ts rename to tests/specs/node/web_node_events_dispatched_in_correct_order/events_order.ts diff --git a/tests/specs/npm_tests/builtin_module_module/__test__.jsonc b/tests/specs/npm/builtin_module_module/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/builtin_module_module/__test__.jsonc rename to tests/specs/npm/builtin_module_module/__test__.jsonc diff --git a/tests/specs/npm_tests/builtin_module_module/builtin_module_module/main.js b/tests/specs/npm/builtin_module_module/builtin_module_module/main.js similarity index 100% rename from tests/specs/npm_tests/builtin_module_module/builtin_module_module/main.js rename to tests/specs/npm/builtin_module_module/builtin_module_module/main.js diff --git a/tests/specs/npm_tests/builtin_module_module/builtin_module_module/main.out b/tests/specs/npm/builtin_module_module/builtin_module_module/main.out similarity index 100% rename from tests/specs/npm_tests/builtin_module_module/builtin_module_module/main.out rename to tests/specs/npm/builtin_module_module/builtin_module_module/main.out diff --git a/tests/specs/npm_tests/cached_only/__test__.jsonc b/tests/specs/npm/cached_only/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/cached_only/__test__.jsonc rename to tests/specs/npm/cached_only/__test__.jsonc diff --git a/tests/specs/npm_tests/cached_only/cached_only/main.out b/tests/specs/npm/cached_only/cached_only/main.out similarity index 66% rename from tests/specs/npm_tests/cached_only/cached_only/main.out rename to tests/specs/npm/cached_only/cached_only/main.out index 31113eef3a..0d0cdad094 100644 --- a/tests/specs/npm_tests/cached_only/cached_only/main.out +++ b/tests/specs/npm/cached_only/cached_only/main.out @@ -1,2 +1,2 @@ error: Error getting response at http://localhost:4260/chalk for package "chalk": An npm specifier not found in cache: "chalk", --cached-only is specified. - at file:///[WILDCARD]/specs/npm_tests/cached_only/cached_only/main.ts:1:19 + at file:///[WILDCARD]/main.ts:1:19 diff --git a/tests/specs/npm_tests/cached_only/cached_only/main.ts b/tests/specs/npm/cached_only/cached_only/main.ts similarity index 100% rename from tests/specs/npm_tests/cached_only/cached_only/main.ts rename to tests/specs/npm/cached_only/cached_only/main.ts diff --git a/tests/specs/npm_tests/check_all/__test__.jsonc b/tests/specs/npm/check_all/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/check_all/__test__.jsonc rename to tests/specs/npm/check_all/__test__.jsonc diff --git a/tests/specs/npm_tests/check_all/check_errors/main.ts b/tests/specs/npm/check_all/check_errors/main.ts similarity index 100% rename from tests/specs/npm_tests/check_all/check_errors/main.ts rename to tests/specs/npm/check_all/check_errors/main.ts diff --git a/tests/specs/npm_tests/check_all/check_errors/main_all.out b/tests/specs/npm/check_all/check_errors/main_all.out similarity index 100% rename from tests/specs/npm_tests/check_all/check_errors/main_all.out rename to tests/specs/npm/check_all/check_errors/main_all.out diff --git a/tests/specs/npm_tests/check_all/check_errors/main_local.out b/tests/specs/npm/check_all/check_errors/main_local.out similarity index 100% rename from tests/specs/npm_tests/check_all/check_errors/main_local.out rename to tests/specs/npm/check_all/check_errors/main_local.out diff --git a/tests/specs/npm_tests/check_local/__test__.jsonc b/tests/specs/npm/check_local/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/check_local/__test__.jsonc rename to tests/specs/npm/check_local/__test__.jsonc diff --git a/tests/specs/npm_tests/check_local/check_errors/main.ts b/tests/specs/npm/check_local/check_errors/main.ts similarity index 100% rename from tests/specs/npm_tests/check_local/check_errors/main.ts rename to tests/specs/npm/check_local/check_errors/main.ts diff --git a/tests/specs/npm_tests/check_local/check_errors/main_all.out b/tests/specs/npm/check_local/check_errors/main_all.out similarity index 100% rename from tests/specs/npm_tests/check_local/check_errors/main_all.out rename to tests/specs/npm/check_local/check_errors/main_all.out diff --git a/tests/specs/npm_tests/check_local/check_errors/main_local.out b/tests/specs/npm/check_local/check_errors/main_local.out similarity index 100% rename from tests/specs/npm_tests/check_local/check_errors/main_local.out rename to tests/specs/npm/check_local/check_errors/main_local.out diff --git a/tests/specs/npm_tests/check_package_file_dts_dmts_dcts/__test__.jsonc b/tests/specs/npm/check_package_file_dts_dmts_dcts/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/check_package_file_dts_dmts_dcts/__test__.jsonc rename to tests/specs/npm/check_package_file_dts_dmts_dcts/__test__.jsonc diff --git a/tests/specs/npm_tests/check_package_file_dts_dmts_dcts/file_dts_dmts_dcts/main.out b/tests/specs/npm/check_package_file_dts_dmts_dcts/file_dts_dmts_dcts/main.out similarity index 100% rename from tests/specs/npm_tests/check_package_file_dts_dmts_dcts/file_dts_dmts_dcts/main.out rename to tests/specs/npm/check_package_file_dts_dmts_dcts/file_dts_dmts_dcts/main.out diff --git a/tests/specs/npm_tests/check_package_file_dts_dmts_dcts/file_dts_dmts_dcts/main.ts b/tests/specs/npm/check_package_file_dts_dmts_dcts/file_dts_dmts_dcts/main.ts similarity index 100% rename from tests/specs/npm_tests/check_package_file_dts_dmts_dcts/file_dts_dmts_dcts/main.ts rename to tests/specs/npm/check_package_file_dts_dmts_dcts/file_dts_dmts_dcts/main.ts diff --git a/tests/specs/npm_tests/child_process_fork_test/__test__.jsonc b/tests/specs/npm/child_process_fork_test/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/child_process_fork_test/__test__.jsonc rename to tests/specs/npm/child_process_fork_test/__test__.jsonc diff --git a/tests/specs/npm_tests/child_process_fork_test/child_process_fork_test/main.out b/tests/specs/npm/child_process_fork_test/child_process_fork_test/main.out similarity index 100% rename from tests/specs/npm_tests/child_process_fork_test/child_process_fork_test/main.out rename to tests/specs/npm/child_process_fork_test/child_process_fork_test/main.out diff --git a/tests/specs/npm_tests/child_process_fork_test/child_process_fork_test/main.ts b/tests/specs/npm/child_process_fork_test/child_process_fork_test/main.ts similarity index 100% rename from tests/specs/npm_tests/child_process_fork_test/child_process_fork_test/main.ts rename to tests/specs/npm/child_process_fork_test/child_process_fork_test/main.ts diff --git a/tests/specs/npm_tests/cjs_invalid_name_exports/__test__.jsonc b/tests/specs/npm/cjs_invalid_name_exports/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/cjs_invalid_name_exports/__test__.jsonc rename to tests/specs/npm/cjs_invalid_name_exports/__test__.jsonc diff --git a/tests/specs/npm_tests/cjs_invalid_name_exports/cjs-invalid-name-exports/main.out b/tests/specs/npm/cjs_invalid_name_exports/cjs-invalid-name-exports/main.out similarity index 100% rename from tests/specs/npm_tests/cjs_invalid_name_exports/cjs-invalid-name-exports/main.out rename to tests/specs/npm/cjs_invalid_name_exports/cjs-invalid-name-exports/main.out diff --git a/tests/specs/npm_tests/cjs_invalid_name_exports/cjs-invalid-name-exports/main.ts b/tests/specs/npm/cjs_invalid_name_exports/cjs-invalid-name-exports/main.ts similarity index 100% rename from tests/specs/npm_tests/cjs_invalid_name_exports/cjs-invalid-name-exports/main.ts rename to tests/specs/npm/cjs_invalid_name_exports/cjs-invalid-name-exports/main.ts diff --git a/tests/specs/npm_tests/cjs_local_global_decls/__test__.jsonc b/tests/specs/npm/cjs_local_global_decls/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/cjs_local_global_decls/__test__.jsonc rename to tests/specs/npm/cjs_local_global_decls/__test__.jsonc diff --git a/tests/specs/npm_tests/cjs_local_global_decls/cjs_local_global_decls/main.out b/tests/specs/npm/cjs_local_global_decls/cjs_local_global_decls/main.out similarity index 100% rename from tests/specs/npm_tests/cjs_local_global_decls/cjs_local_global_decls/main.out rename to tests/specs/npm/cjs_local_global_decls/cjs_local_global_decls/main.out diff --git a/tests/specs/npm_tests/cjs_local_global_decls/cjs_local_global_decls/main.ts b/tests/specs/npm/cjs_local_global_decls/cjs_local_global_decls/main.ts similarity index 100% rename from tests/specs/npm_tests/cjs_local_global_decls/cjs_local_global_decls/main.ts rename to tests/specs/npm/cjs_local_global_decls/cjs_local_global_decls/main.ts diff --git a/tests/specs/npm_tests/cjs_module_export_assignment/__test__.jsonc b/tests/specs/npm/cjs_module_export_assignment/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/cjs_module_export_assignment/__test__.jsonc rename to tests/specs/npm/cjs_module_export_assignment/__test__.jsonc diff --git a/tests/specs/npm_tests/cjs_module_export_assignment/cjs_module_export_assignment/main.out b/tests/specs/npm/cjs_module_export_assignment/cjs_module_export_assignment/main.out similarity index 100% rename from tests/specs/npm_tests/cjs_module_export_assignment/cjs_module_export_assignment/main.out rename to tests/specs/npm/cjs_module_export_assignment/cjs_module_export_assignment/main.out diff --git a/tests/specs/npm_tests/cjs_module_export_assignment/cjs_module_export_assignment/main.ts b/tests/specs/npm/cjs_module_export_assignment/cjs_module_export_assignment/main.ts similarity index 100% rename from tests/specs/npm_tests/cjs_module_export_assignment/cjs_module_export_assignment/main.ts rename to tests/specs/npm/cjs_module_export_assignment/cjs_module_export_assignment/main.ts diff --git a/tests/specs/npm_tests/cjs_module_export_assignment_number/__test__.jsonc b/tests/specs/npm/cjs_module_export_assignment_number/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/cjs_module_export_assignment_number/__test__.jsonc rename to tests/specs/npm/cjs_module_export_assignment_number/__test__.jsonc diff --git a/tests/specs/npm_tests/cjs_module_export_assignment_number/cjs_module_export_assignment_number/main.out b/tests/specs/npm/cjs_module_export_assignment_number/cjs_module_export_assignment_number/main.out similarity index 100% rename from tests/specs/npm_tests/cjs_module_export_assignment_number/cjs_module_export_assignment_number/main.out rename to tests/specs/npm/cjs_module_export_assignment_number/cjs_module_export_assignment_number/main.out diff --git a/tests/specs/npm_tests/cjs_module_export_assignment_number/cjs_module_export_assignment_number/main.ts b/tests/specs/npm/cjs_module_export_assignment_number/cjs_module_export_assignment_number/main.ts similarity index 100% rename from tests/specs/npm_tests/cjs_module_export_assignment_number/cjs_module_export_assignment_number/main.ts rename to tests/specs/npm/cjs_module_export_assignment_number/cjs_module_export_assignment_number/main.ts diff --git a/tests/specs/npm_tests/cjs_pkg_imports/__test__.jsonc b/tests/specs/npm/cjs_pkg_imports/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/cjs_pkg_imports/__test__.jsonc rename to tests/specs/npm/cjs_pkg_imports/__test__.jsonc diff --git a/tests/specs/npm_tests/cjs_pkg_imports/cjs_pkg_imports/main.out b/tests/specs/npm/cjs_pkg_imports/cjs_pkg_imports/main.out similarity index 100% rename from tests/specs/npm_tests/cjs_pkg_imports/cjs_pkg_imports/main.out rename to tests/specs/npm/cjs_pkg_imports/cjs_pkg_imports/main.out diff --git a/tests/specs/npm_tests/cjs_pkg_imports/cjs_pkg_imports/main.ts b/tests/specs/npm/cjs_pkg_imports/cjs_pkg_imports/main.ts similarity index 100% rename from tests/specs/npm_tests/cjs_pkg_imports/cjs_pkg_imports/main.ts rename to tests/specs/npm/cjs_pkg_imports/cjs_pkg_imports/main.ts diff --git a/tests/specs/npm_tests/cjs_reexport_collision/__test__.jsonc b/tests/specs/npm/cjs_reexport_collision/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/cjs_reexport_collision/__test__.jsonc rename to tests/specs/npm/cjs_reexport_collision/__test__.jsonc diff --git a/tests/specs/npm_tests/cjs_reexport_collision/cjs_reexport_collision/main.out b/tests/specs/npm/cjs_reexport_collision/cjs_reexport_collision/main.out similarity index 100% rename from tests/specs/npm_tests/cjs_reexport_collision/cjs_reexport_collision/main.out rename to tests/specs/npm/cjs_reexport_collision/cjs_reexport_collision/main.out diff --git a/tests/specs/npm_tests/cjs_reexport_collision/cjs_reexport_collision/main.ts b/tests/specs/npm/cjs_reexport_collision/cjs_reexport_collision/main.ts similarity index 100% rename from tests/specs/npm_tests/cjs_reexport_collision/cjs_reexport_collision/main.ts rename to tests/specs/npm/cjs_reexport_collision/cjs_reexport_collision/main.ts diff --git a/tests/specs/npm_tests/cjs_require_esm/__test__.jsonc b/tests/specs/npm/cjs_require_esm/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/cjs_require_esm/__test__.jsonc rename to tests/specs/npm/cjs_require_esm/__test__.jsonc diff --git a/tests/specs/npm_tests/cjs_require_esm/cjs_require_esm/main.out b/tests/specs/npm/cjs_require_esm/cjs_require_esm/main.out similarity index 100% rename from tests/specs/npm_tests/cjs_require_esm/cjs_require_esm/main.out rename to tests/specs/npm/cjs_require_esm/cjs_require_esm/main.out diff --git a/tests/specs/npm_tests/cjs_require_esm/cjs_require_esm/main.ts b/tests/specs/npm/cjs_require_esm/cjs_require_esm/main.ts similarity index 100% rename from tests/specs/npm_tests/cjs_require_esm/cjs_require_esm/main.ts rename to tests/specs/npm/cjs_require_esm/cjs_require_esm/main.ts diff --git a/tests/specs/npm_tests/cjs_require_esm_mjs/__test__.jsonc b/tests/specs/npm/cjs_require_esm_mjs/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/cjs_require_esm_mjs/__test__.jsonc rename to tests/specs/npm/cjs_require_esm_mjs/__test__.jsonc diff --git a/tests/specs/npm_tests/cjs_require_esm_mjs/cjs_require_esm_mjs/main.out b/tests/specs/npm/cjs_require_esm_mjs/cjs_require_esm_mjs/main.out similarity index 100% rename from tests/specs/npm_tests/cjs_require_esm_mjs/cjs_require_esm_mjs/main.out rename to tests/specs/npm/cjs_require_esm_mjs/cjs_require_esm_mjs/main.out diff --git a/tests/specs/npm_tests/cjs_require_esm_mjs/cjs_require_esm_mjs/main.ts b/tests/specs/npm/cjs_require_esm_mjs/cjs_require_esm_mjs/main.ts similarity index 100% rename from tests/specs/npm_tests/cjs_require_esm_mjs/cjs_require_esm_mjs/main.ts rename to tests/specs/npm/cjs_require_esm_mjs/cjs_require_esm_mjs/main.ts diff --git a/tests/specs/npm_tests/cjs_sub_path/__test__.jsonc b/tests/specs/npm/cjs_sub_path/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/cjs_sub_path/__test__.jsonc rename to tests/specs/npm/cjs_sub_path/__test__.jsonc diff --git a/tests/specs/npm_tests/cjs_sub_path/cjs_sub_path/main.js b/tests/specs/npm/cjs_sub_path/cjs_sub_path/main.js similarity index 100% rename from tests/specs/npm_tests/cjs_sub_path/cjs_sub_path/main.js rename to tests/specs/npm/cjs_sub_path/cjs_sub_path/main.js diff --git a/tests/specs/npm_tests/cjs_sub_path/cjs_sub_path/main.out b/tests/specs/npm/cjs_sub_path/cjs_sub_path/main.out similarity index 100% rename from tests/specs/npm_tests/cjs_sub_path/cjs_sub_path/main.out rename to tests/specs/npm/cjs_sub_path/cjs_sub_path/main.out diff --git a/tests/specs/npm_tests/cjs_this_in_exports/__test__.jsonc b/tests/specs/npm/cjs_this_in_exports/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/cjs_this_in_exports/__test__.jsonc rename to tests/specs/npm/cjs_this_in_exports/__test__.jsonc diff --git a/tests/specs/npm_tests/cjs_this_in_exports/cjs_this_in_exports/main.js b/tests/specs/npm/cjs_this_in_exports/cjs_this_in_exports/main.js similarity index 100% rename from tests/specs/npm_tests/cjs_this_in_exports/cjs_this_in_exports/main.js rename to tests/specs/npm/cjs_this_in_exports/cjs_this_in_exports/main.js diff --git a/tests/specs/npm_tests/cjs_this_in_exports/cjs_this_in_exports/main.out b/tests/specs/npm/cjs_this_in_exports/cjs_this_in_exports/main.out similarity index 63% rename from tests/specs/npm_tests/cjs_this_in_exports/cjs_this_in_exports/main.out rename to tests/specs/npm/cjs_this_in_exports/cjs_this_in_exports/main.out index 9517015ae5..88c18dbe4e 100644 --- a/tests/specs/npm_tests/cjs_this_in_exports/cjs_this_in_exports/main.out +++ b/tests/specs/npm/cjs_this_in_exports/cjs_this_in_exports/main.out @@ -2,4 +2,4 @@ 1 error: Uncaught (in promise) TypeError: this.otherMethod is not a function at getValue (file://[WILDCARD]/@denotest/cjs-this-in-exports/1.0.0/index.js:3:17) - at file://[WILDCARD]/specs/npm_tests/cjs_this_in_exports/cjs_this_in_exports/main.js:11:1 + at file://[WILDCARD]/main.js:11:1 diff --git a/tests/specs/npm_tests/cjs_with_deps/__test__.jsonc b/tests/specs/npm/cjs_with_deps/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/cjs_with_deps/__test__.jsonc rename to tests/specs/npm/cjs_with_deps/__test__.jsonc diff --git a/tests/specs/npm_tests/cjs_with_deps/cjs_with_deps/main.js b/tests/specs/npm/cjs_with_deps/cjs_with_deps/main.js similarity index 100% rename from tests/specs/npm_tests/cjs_with_deps/cjs_with_deps/main.js rename to tests/specs/npm/cjs_with_deps/cjs_with_deps/main.js diff --git a/tests/specs/npm_tests/cjs_with_deps/cjs_with_deps/main.out b/tests/specs/npm/cjs_with_deps/cjs_with_deps/main.out similarity index 100% rename from tests/specs/npm_tests/cjs_with_deps/cjs_with_deps/main.out rename to tests/specs/npm/cjs_with_deps/cjs_with_deps/main.out diff --git a/tests/specs/npm_tests/cjs_with_deps/cjs_with_deps/main_info.out b/tests/specs/npm/cjs_with_deps/cjs_with_deps/main_info.out similarity index 100% rename from tests/specs/npm_tests/cjs_with_deps/cjs_with_deps/main_info.out rename to tests/specs/npm/cjs_with_deps/cjs_with_deps/main_info.out diff --git a/tests/specs/npm_tests/cjs_with_deps/cjs_with_deps/main_info_json.out b/tests/specs/npm/cjs_with_deps/cjs_with_deps/main_info_json.out similarity index 100% rename from tests/specs/npm_tests/cjs_with_deps/cjs_with_deps/main_info_json.out rename to tests/specs/npm/cjs_with_deps/cjs_with_deps/main_info_json.out diff --git a/tests/specs/npm_tests/cjs_with_deps/cjs_with_deps/main_node_modules.out b/tests/specs/npm/cjs_with_deps/cjs_with_deps/main_node_modules.out similarity index 100% rename from tests/specs/npm_tests/cjs_with_deps/cjs_with_deps/main_node_modules.out rename to tests/specs/npm/cjs_with_deps/cjs_with_deps/main_node_modules.out diff --git a/tests/specs/npm_tests/compare_globals/__test__.jsonc b/tests/specs/npm/compare_globals/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/compare_globals/__test__.jsonc rename to tests/specs/npm/compare_globals/__test__.jsonc diff --git a/tests/specs/npm_tests/compare_globals/compare_globals/main.out b/tests/specs/npm/compare_globals/compare_globals/main.out similarity index 100% rename from tests/specs/npm_tests/compare_globals/compare_globals/main.out rename to tests/specs/npm/compare_globals/compare_globals/main.out diff --git a/tests/specs/npm_tests/compare_globals/compare_globals/main.ts b/tests/specs/npm/compare_globals/compare_globals/main.ts similarity index 100% rename from tests/specs/npm_tests/compare_globals/compare_globals/main.ts rename to tests/specs/npm/compare_globals/compare_globals/main.ts diff --git a/tests/specs/npm_tests/create_require/__test__.jsonc b/tests/specs/npm/create_require/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/create_require/__test__.jsonc rename to tests/specs/npm/create_require/__test__.jsonc diff --git a/tests/specs/npm_tests/create_require/create_require/main.out b/tests/specs/npm/create_require/create_require/main.out similarity index 100% rename from tests/specs/npm_tests/create_require/create_require/main.out rename to tests/specs/npm/create_require/create_require/main.out diff --git a/tests/specs/npm_tests/create_require/create_require/main.ts b/tests/specs/npm/create_require/create_require/main.ts similarity index 100% rename from tests/specs/npm_tests/create_require/create_require/main.ts rename to tests/specs/npm/create_require/create_require/main.ts diff --git a/tests/specs/npm_tests/deno_cache/__test__.jsonc b/tests/specs/npm/deno_cache/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/deno_cache/__test__.jsonc rename to tests/specs/npm/deno_cache/__test__.jsonc diff --git a/tests/specs/npm_tests/deno_cache/deno_cache.out b/tests/specs/npm/deno_cache/deno_cache.out similarity index 100% rename from tests/specs/npm_tests/deno_cache/deno_cache.out rename to tests/specs/npm/deno_cache/deno_cache.out diff --git a/tests/specs/npm_tests/deno_run_bin_cjs/__test__.jsonc b/tests/specs/npm/deno_run_bin_cjs/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/deno_run_bin_cjs/__test__.jsonc rename to tests/specs/npm/deno_run_bin_cjs/__test__.jsonc diff --git a/tests/specs/npm_tests/deno_run_bin_cjs/deno_run_cjs.out b/tests/specs/npm/deno_run_bin_cjs/deno_run_cjs.out similarity index 100% rename from tests/specs/npm_tests/deno_run_bin_cjs/deno_run_cjs.out rename to tests/specs/npm/deno_run_bin_cjs/deno_run_cjs.out diff --git a/tests/specs/npm_tests/deno_run_bin_cjs_no_bin_entrypoint/__test__.jsonc b/tests/specs/npm/deno_run_bin_cjs_no_bin_entrypoint/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/deno_run_bin_cjs_no_bin_entrypoint/__test__.jsonc rename to tests/specs/npm/deno_run_bin_cjs_no_bin_entrypoint/__test__.jsonc diff --git a/tests/specs/npm_tests/deno_run_bin_cjs_no_bin_entrypoint/deno_run_cjs.out b/tests/specs/npm/deno_run_bin_cjs_no_bin_entrypoint/deno_run_cjs.out similarity index 100% rename from tests/specs/npm_tests/deno_run_bin_cjs_no_bin_entrypoint/deno_run_cjs.out rename to tests/specs/npm/deno_run_bin_cjs_no_bin_entrypoint/deno_run_cjs.out diff --git a/tests/specs/npm_tests/deno_run_bin_esm/__test__.jsonc b/tests/specs/npm/deno_run_bin_esm/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/deno_run_bin_esm/__test__.jsonc rename to tests/specs/npm/deno_run_bin_esm/__test__.jsonc diff --git a/tests/specs/npm_tests/deno_run_bin_esm/deno_run_esm.out b/tests/specs/npm/deno_run_bin_esm/deno_run_esm.out similarity index 100% rename from tests/specs/npm_tests/deno_run_bin_esm/deno_run_esm.out rename to tests/specs/npm/deno_run_bin_esm/deno_run_esm.out diff --git a/tests/specs/npm_tests/deno_run_bin_esm_no_bin_entrypoint/__test__.jsonc b/tests/specs/npm/deno_run_bin_esm_no_bin_entrypoint/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/deno_run_bin_esm_no_bin_entrypoint/__test__.jsonc rename to tests/specs/npm/deno_run_bin_esm_no_bin_entrypoint/__test__.jsonc diff --git a/tests/specs/npm_tests/deno_run_bin_esm_no_bin_entrypoint/deno_run_esm.out b/tests/specs/npm/deno_run_bin_esm_no_bin_entrypoint/deno_run_esm.out similarity index 100% rename from tests/specs/npm_tests/deno_run_bin_esm_no_bin_entrypoint/deno_run_esm.out rename to tests/specs/npm/deno_run_bin_esm_no_bin_entrypoint/deno_run_esm.out diff --git a/tests/specs/npm_tests/deno_run_bin_no_ext/__test__.jsonc b/tests/specs/npm/deno_run_bin_no_ext/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/deno_run_bin_no_ext/__test__.jsonc rename to tests/specs/npm/deno_run_bin_no_ext/__test__.jsonc diff --git a/tests/specs/npm_tests/deno_run_bin_no_ext/deno_run_no_ext.out b/tests/specs/npm/deno_run_bin_no_ext/deno_run_no_ext.out similarity index 100% rename from tests/specs/npm_tests/deno_run_bin_no_ext/deno_run_no_ext.out rename to tests/specs/npm/deno_run_bin_no_ext/deno_run_no_ext.out diff --git a/tests/specs/npm_tests/deno_run_bin_special_chars/__test__.jsonc b/tests/specs/npm/deno_run_bin_special_chars/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/deno_run_bin_special_chars/__test__.jsonc rename to tests/specs/npm/deno_run_bin_special_chars/__test__.jsonc diff --git a/tests/specs/npm_tests/deno_run_bin_special_chars/deno_run_special_chars_in_bin_name.out b/tests/specs/npm/deno_run_bin_special_chars/deno_run_special_chars_in_bin_name.out similarity index 100% rename from tests/specs/npm_tests/deno_run_bin_special_chars/deno_run_special_chars_in_bin_name.out rename to tests/specs/npm/deno_run_bin_special_chars/deno_run_special_chars_in_bin_name.out diff --git a/tests/specs/npm_tests/deno_run_cowsay/__test__.jsonc b/tests/specs/npm/deno_run_cowsay/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/deno_run_cowsay/__test__.jsonc rename to tests/specs/npm/deno_run_cowsay/__test__.jsonc diff --git a/tests/specs/npm_tests/deno_run_cowsay/deno_run_cowsay.out b/tests/specs/npm/deno_run_cowsay/deno_run_cowsay.out similarity index 100% rename from tests/specs/npm_tests/deno_run_cowsay/deno_run_cowsay.out rename to tests/specs/npm/deno_run_cowsay/deno_run_cowsay.out diff --git a/tests/specs/npm_tests/deno_run_cowsay_explicit/__test__.jsonc b/tests/specs/npm/deno_run_cowsay_explicit/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/deno_run_cowsay_explicit/__test__.jsonc rename to tests/specs/npm/deno_run_cowsay_explicit/__test__.jsonc diff --git a/tests/specs/npm_tests/deno_run_cowsay_explicit/deno_run_cowsay.out b/tests/specs/npm/deno_run_cowsay_explicit/deno_run_cowsay.out similarity index 100% rename from tests/specs/npm_tests/deno_run_cowsay_explicit/deno_run_cowsay.out rename to tests/specs/npm/deno_run_cowsay_explicit/deno_run_cowsay.out diff --git a/tests/specs/npm_tests/deno_run_cowsay_with_node_modules_dir/__test__.jsonc b/tests/specs/npm/deno_run_cowsay_with_node_modules_dir/__test__.jsonc similarity index 91% rename from tests/specs/npm_tests/deno_run_cowsay_with_node_modules_dir/__test__.jsonc rename to tests/specs/npm/deno_run_cowsay_with_node_modules_dir/__test__.jsonc index 8671ed1fea..d2c95f0728 100644 --- a/tests/specs/npm_tests/deno_run_cowsay_with_node_modules_dir/__test__.jsonc +++ b/tests/specs/npm/deno_run_cowsay_with_node_modules_dir/__test__.jsonc @@ -1,4 +1,5 @@ { + "tempDir": true, "args": "run -A --quiet --node-modules-dir npm:cowsay@1.5.0 Hello", "output": "deno_run_cowsay.out", "envs": { diff --git a/tests/specs/npm_tests/deno_run_cowsay_with_node_modules_dir/deno_run_cowsay.out b/tests/specs/npm/deno_run_cowsay_with_node_modules_dir/deno_run_cowsay.out similarity index 100% rename from tests/specs/npm_tests/deno_run_cowsay_with_node_modules_dir/deno_run_cowsay.out rename to tests/specs/npm/deno_run_cowsay_with_node_modules_dir/deno_run_cowsay.out diff --git a/tests/specs/npm_tests/deno_run_cowthink/__test__.jsonc b/tests/specs/npm/deno_run_cowthink/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/deno_run_cowthink/__test__.jsonc rename to tests/specs/npm/deno_run_cowthink/__test__.jsonc diff --git a/tests/specs/npm_tests/deno_run_cowthink/deno_run_cowthink.out b/tests/specs/npm/deno_run_cowthink/deno_run_cowthink.out similarity index 100% rename from tests/specs/npm_tests/deno_run_cowthink/deno_run_cowthink.out rename to tests/specs/npm/deno_run_cowthink/deno_run_cowthink.out diff --git a/tests/specs/npm_tests/deno_run_no_bin_entrypoint/__test__.jsonc b/tests/specs/npm/deno_run_no_bin_entrypoint/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/deno_run_no_bin_entrypoint/__test__.jsonc rename to tests/specs/npm/deno_run_no_bin_entrypoint/__test__.jsonc diff --git a/tests/specs/npm_tests/deno_run_no_bin_entrypoint/deno_run_no_bin_entrypoint.out b/tests/specs/npm/deno_run_no_bin_entrypoint/deno_run_no_bin_entrypoint.out similarity index 100% rename from tests/specs/npm_tests/deno_run_no_bin_entrypoint/deno_run_no_bin_entrypoint.out rename to tests/specs/npm/deno_run_no_bin_entrypoint/deno_run_no_bin_entrypoint.out diff --git a/tests/specs/npm_tests/deno_run_no_bin_entrypoint_non_existent_subpath/__test__.jsonc b/tests/specs/npm/deno_run_no_bin_entrypoint_non_existent_subpath/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/deno_run_no_bin_entrypoint_non_existent_subpath/__test__.jsonc rename to tests/specs/npm/deno_run_no_bin_entrypoint_non_existent_subpath/__test__.jsonc diff --git a/tests/specs/npm_tests/deno_run_no_bin_entrypoint_non_existent_subpath/deno_run_no_bin_entrypoint_non_existent_subpath.out b/tests/specs/npm/deno_run_no_bin_entrypoint_non_existent_subpath/deno_run_no_bin_entrypoint_non_existent_subpath.out similarity index 100% rename from tests/specs/npm_tests/deno_run_no_bin_entrypoint_non_existent_subpath/deno_run_no_bin_entrypoint_non_existent_subpath.out rename to tests/specs/npm/deno_run_no_bin_entrypoint_non_existent_subpath/deno_run_no_bin_entrypoint_non_existent_subpath.out diff --git a/tests/specs/npm_tests/deno_run_non_existent/__test__.jsonc b/tests/specs/npm/deno_run_non_existent/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/deno_run_non_existent/__test__.jsonc rename to tests/specs/npm/deno_run_non_existent/__test__.jsonc diff --git a/tests/specs/npm_tests/deno_run_non_existent/deno_run_non_existent.out b/tests/specs/npm/deno_run_non_existent/deno_run_non_existent.out similarity index 100% rename from tests/specs/npm_tests/deno_run_non_existent/deno_run_non_existent.out rename to tests/specs/npm/deno_run_non_existent/deno_run_non_existent.out diff --git a/tests/specs/npm_tests/different_nested_dep_node_modules_dir_false/__test__.jsonc b/tests/specs/npm/different_nested_dep_node_modules_dir_false/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/different_nested_dep_node_modules_dir_false/__test__.jsonc rename to tests/specs/npm/different_nested_dep_node_modules_dir_false/__test__.jsonc diff --git a/tests/specs/npm_tests/different_nested_dep_node_modules_dir_false/different_nested_dep/main.js b/tests/specs/npm/different_nested_dep_node_modules_dir_false/different_nested_dep/main.js similarity index 100% rename from tests/specs/npm_tests/different_nested_dep_node_modules_dir_false/different_nested_dep/main.js rename to tests/specs/npm/different_nested_dep_node_modules_dir_false/different_nested_dep/main.js diff --git a/tests/specs/npm_tests/different_nested_dep_node_modules_dir_false/different_nested_dep/main.out b/tests/specs/npm/different_nested_dep_node_modules_dir_false/different_nested_dep/main.out similarity index 100% rename from tests/specs/npm_tests/different_nested_dep_node_modules_dir_false/different_nested_dep/main.out rename to tests/specs/npm/different_nested_dep_node_modules_dir_false/different_nested_dep/main.out diff --git a/tests/specs/npm_tests/different_nested_dep_node_modules_dir_false/different_nested_dep/package.json b/tests/specs/npm/different_nested_dep_node_modules_dir_false/different_nested_dep/package.json similarity index 100% rename from tests/specs/npm_tests/different_nested_dep_node_modules_dir_false/different_nested_dep/package.json rename to tests/specs/npm/different_nested_dep_node_modules_dir_false/different_nested_dep/package.json diff --git a/tests/specs/npm_tests/different_nested_dep_node_modules_dir_true/__test__.jsonc b/tests/specs/npm/different_nested_dep_node_modules_dir_true/__test__.jsonc similarity index 92% rename from tests/specs/npm_tests/different_nested_dep_node_modules_dir_true/__test__.jsonc rename to tests/specs/npm/different_nested_dep_node_modules_dir_true/__test__.jsonc index 0533a992bf..a5c40cdd95 100644 --- a/tests/specs/npm_tests/different_nested_dep_node_modules_dir_true/__test__.jsonc +++ b/tests/specs/npm/different_nested_dep_node_modules_dir_true/__test__.jsonc @@ -1,4 +1,5 @@ { + "tempDir": true, "args": "run --no-lock --quiet --node-modules-dir=auto different_nested_dep/main.js", "output": "different_nested_dep/main.out", "envs": { diff --git a/tests/specs/npm_tests/different_nested_dep_node_modules_dir_true/different_nested_dep/main.js b/tests/specs/npm/different_nested_dep_node_modules_dir_true/different_nested_dep/main.js similarity index 100% rename from tests/specs/npm_tests/different_nested_dep_node_modules_dir_true/different_nested_dep/main.js rename to tests/specs/npm/different_nested_dep_node_modules_dir_true/different_nested_dep/main.js diff --git a/tests/specs/npm_tests/different_nested_dep_node_modules_dir_true/different_nested_dep/main.out b/tests/specs/npm/different_nested_dep_node_modules_dir_true/different_nested_dep/main.out similarity index 100% rename from tests/specs/npm_tests/different_nested_dep_node_modules_dir_true/different_nested_dep/main.out rename to tests/specs/npm/different_nested_dep_node_modules_dir_true/different_nested_dep/main.out diff --git a/tests/specs/npm_tests/different_nested_dep_node_modules_dir_true/different_nested_dep/package.json b/tests/specs/npm/different_nested_dep_node_modules_dir_true/different_nested_dep/package.json similarity index 100% rename from tests/specs/npm_tests/different_nested_dep_node_modules_dir_true/different_nested_dep/package.json rename to tests/specs/npm/different_nested_dep_node_modules_dir_true/different_nested_dep/package.json diff --git a/tests/specs/npm_tests/directory_import_folder_index_js/__test__.jsonc b/tests/specs/npm/directory_import_folder_index_js/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/directory_import_folder_index_js/__test__.jsonc rename to tests/specs/npm/directory_import_folder_index_js/__test__.jsonc diff --git a/tests/specs/npm_tests/directory_import_folder_index_js/directory_import/folder_index_js.out b/tests/specs/npm/directory_import_folder_index_js/directory_import/folder_index_js.out similarity index 100% rename from tests/specs/npm_tests/directory_import_folder_index_js/directory_import/folder_index_js.out rename to tests/specs/npm/directory_import_folder_index_js/directory_import/folder_index_js.out diff --git a/tests/specs/npm_tests/directory_import_folder_index_js/directory_import/folder_index_js.ts b/tests/specs/npm/directory_import_folder_index_js/directory_import/folder_index_js.ts similarity index 100% rename from tests/specs/npm_tests/directory_import_folder_index_js/directory_import/folder_index_js.ts rename to tests/specs/npm/directory_import_folder_index_js/directory_import/folder_index_js.ts diff --git a/tests/specs/npm_tests/directory_import_folder_index_js/directory_import/folder_no_index.out b/tests/specs/npm/directory_import_folder_index_js/directory_import/folder_no_index.out similarity index 100% rename from tests/specs/npm_tests/directory_import_folder_index_js/directory_import/folder_no_index.out rename to tests/specs/npm/directory_import_folder_index_js/directory_import/folder_no_index.out diff --git a/tests/specs/npm_tests/directory_import_folder_index_js/directory_import/folder_no_index.ts b/tests/specs/npm/directory_import_folder_index_js/directory_import/folder_no_index.ts similarity index 100% rename from tests/specs/npm_tests/directory_import_folder_index_js/directory_import/folder_no_index.ts rename to tests/specs/npm/directory_import_folder_index_js/directory_import/folder_no_index.ts diff --git a/tests/specs/npm_tests/directory_import_folder_no_index/__test__.jsonc b/tests/specs/npm/directory_import_folder_no_index/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/directory_import_folder_no_index/__test__.jsonc rename to tests/specs/npm/directory_import_folder_no_index/__test__.jsonc diff --git a/tests/specs/npm_tests/directory_import_folder_no_index/directory_import/folder_index_js.out b/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_index_js.out similarity index 100% rename from tests/specs/npm_tests/directory_import_folder_no_index/directory_import/folder_index_js.out rename to tests/specs/npm/directory_import_folder_no_index/directory_import/folder_index_js.out diff --git a/tests/specs/npm_tests/directory_import_folder_no_index/directory_import/folder_index_js.ts b/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_index_js.ts similarity index 100% rename from tests/specs/npm_tests/directory_import_folder_no_index/directory_import/folder_index_js.ts rename to tests/specs/npm/directory_import_folder_no_index/directory_import/folder_index_js.ts diff --git a/tests/specs/npm_tests/directory_import_folder_no_index/directory_import/folder_no_index.out b/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_no_index.out similarity index 100% rename from tests/specs/npm_tests/directory_import_folder_no_index/directory_import/folder_no_index.out rename to tests/specs/npm/directory_import_folder_no_index/directory_import/folder_no_index.out diff --git a/tests/specs/npm_tests/directory_import_folder_no_index/directory_import/folder_no_index.ts b/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_no_index.ts similarity index 100% rename from tests/specs/npm_tests/directory_import_folder_no_index/directory_import/folder_no_index.ts rename to tests/specs/npm/directory_import_folder_no_index/directory_import/folder_no_index.ts diff --git a/tests/specs/npm_tests/dual_cjs_esm/__test__.jsonc b/tests/specs/npm/dual_cjs_esm/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/dual_cjs_esm/__test__.jsonc rename to tests/specs/npm/dual_cjs_esm/__test__.jsonc diff --git a/tests/specs/npm_tests/dual_cjs_esm/dual_cjs_esm/main.out b/tests/specs/npm/dual_cjs_esm/dual_cjs_esm/main.out similarity index 100% rename from tests/specs/npm_tests/dual_cjs_esm/dual_cjs_esm/main.out rename to tests/specs/npm/dual_cjs_esm/dual_cjs_esm/main.out diff --git a/tests/specs/npm_tests/dual_cjs_esm/dual_cjs_esm/main.ts b/tests/specs/npm/dual_cjs_esm/dual_cjs_esm/main.ts similarity index 100% rename from tests/specs/npm_tests/dual_cjs_esm/dual_cjs_esm/main.ts rename to tests/specs/npm/dual_cjs_esm/dual_cjs_esm/main.ts diff --git a/tests/specs/npm_tests/dynamic_import_deno_ts_from_npm/__test__.jsonc b/tests/specs/npm/dynamic_import_deno_ts_from_npm/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/dynamic_import_deno_ts_from_npm/__test__.jsonc rename to tests/specs/npm/dynamic_import_deno_ts_from_npm/__test__.jsonc diff --git a/tests/specs/npm_tests/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/add.ts b/tests/specs/npm/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/add.ts similarity index 100% rename from tests/specs/npm_tests/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/add.ts rename to tests/specs/npm/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/add.ts diff --git a/tests/specs/npm_tests/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/main.out b/tests/specs/npm/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/main.out similarity index 100% rename from tests/specs/npm_tests/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/main.out rename to tests/specs/npm/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/main.out diff --git a/tests/specs/npm_tests/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/main.ts b/tests/specs/npm/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/main.ts similarity index 100% rename from tests/specs/npm_tests/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/main.ts rename to tests/specs/npm/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/main.ts diff --git a/tests/specs/npm_tests/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/subtract.mts b/tests/specs/npm/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/subtract.mts similarity index 100% rename from tests/specs/npm_tests/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/subtract.mts rename to tests/specs/npm/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/subtract.mts diff --git a/tests/specs/npm_tests/dynamic_import_invalid_package_name/__test__.jsonc b/tests/specs/npm/dynamic_import_invalid_package_name/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/dynamic_import_invalid_package_name/__test__.jsonc rename to tests/specs/npm/dynamic_import_invalid_package_name/__test__.jsonc diff --git a/tests/specs/npm_tests/dynamic_import_invalid_package_name/dynamic_import_invalid_package_name/main.out b/tests/specs/npm/dynamic_import_invalid_package_name/dynamic_import_invalid_package_name/main.out similarity index 100% rename from tests/specs/npm_tests/dynamic_import_invalid_package_name/dynamic_import_invalid_package_name/main.out rename to tests/specs/npm/dynamic_import_invalid_package_name/dynamic_import_invalid_package_name/main.out diff --git a/tests/specs/npm_tests/dynamic_import_invalid_package_name/dynamic_import_invalid_package_name/main.ts b/tests/specs/npm/dynamic_import_invalid_package_name/dynamic_import_invalid_package_name/main.ts similarity index 100% rename from tests/specs/npm_tests/dynamic_import_invalid_package_name/dynamic_import_invalid_package_name/main.ts rename to tests/specs/npm/dynamic_import_invalid_package_name/dynamic_import_invalid_package_name/main.ts diff --git a/tests/specs/npm_tests/dynamic_import_json/__test__.jsonc b/tests/specs/npm/dynamic_import_json/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/dynamic_import_json/__test__.jsonc rename to tests/specs/npm/dynamic_import_json/__test__.jsonc diff --git a/tests/specs/npm_tests/dynamic_import_json/import_json/main.js b/tests/specs/npm/dynamic_import_json/import_json/main.js similarity index 100% rename from tests/specs/npm_tests/dynamic_import_json/import_json/main.js rename to tests/specs/npm/dynamic_import_json/import_json/main.js diff --git a/tests/specs/npm_tests/dynamic_import_json/import_json/main.out b/tests/specs/npm/dynamic_import_json/import_json/main.out similarity index 100% rename from tests/specs/npm_tests/dynamic_import_json/import_json/main.out rename to tests/specs/npm/dynamic_import_json/import_json/main.out diff --git a/tests/specs/npm_tests/dynamic_import_reload_same_package/__test__.jsonc b/tests/specs/npm/dynamic_import_reload_same_package/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/dynamic_import_reload_same_package/__test__.jsonc rename to tests/specs/npm/dynamic_import_reload_same_package/__test__.jsonc diff --git a/tests/specs/npm_tests/dynamic_import_reload_same_package/dynamic_import_reload_same_package/main.out b/tests/specs/npm/dynamic_import_reload_same_package/dynamic_import_reload_same_package/main.out similarity index 100% rename from tests/specs/npm_tests/dynamic_import_reload_same_package/dynamic_import_reload_same_package/main.out rename to tests/specs/npm/dynamic_import_reload_same_package/dynamic_import_reload_same_package/main.out diff --git a/tests/specs/npm_tests/dynamic_import_reload_same_package/dynamic_import_reload_same_package/main.ts b/tests/specs/npm/dynamic_import_reload_same_package/dynamic_import_reload_same_package/main.ts similarity index 100% rename from tests/specs/npm_tests/dynamic_import_reload_same_package/dynamic_import_reload_same_package/main.ts rename to tests/specs/npm/dynamic_import_reload_same_package/dynamic_import_reload_same_package/main.ts diff --git a/tests/specs/npm_tests/dynamic_import_reload_same_package/dynamic_import_reload_same_package/other.ts b/tests/specs/npm/dynamic_import_reload_same_package/dynamic_import_reload_same_package/other.ts similarity index 100% rename from tests/specs/npm_tests/dynamic_import_reload_same_package/dynamic_import_reload_same_package/other.ts rename to tests/specs/npm/dynamic_import_reload_same_package/dynamic_import_reload_same_package/other.ts diff --git a/tests/specs/npm_tests/env_var_re_export_dev/__test__.jsonc b/tests/specs/npm/env_var_re_export_dev/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/env_var_re_export_dev/__test__.jsonc rename to tests/specs/npm/env_var_re_export_dev/__test__.jsonc diff --git a/tests/specs/npm_tests/env_var_re_export_dev/env_var_re_export/main.js b/tests/specs/npm/env_var_re_export_dev/env_var_re_export/main.js similarity index 100% rename from tests/specs/npm_tests/env_var_re_export_dev/env_var_re_export/main.js rename to tests/specs/npm/env_var_re_export_dev/env_var_re_export/main.js diff --git a/tests/specs/npm_tests/env_var_re_export_prod/__test__.jsonc b/tests/specs/npm/env_var_re_export_prod/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/env_var_re_export_prod/__test__.jsonc rename to tests/specs/npm/env_var_re_export_prod/__test__.jsonc diff --git a/tests/specs/npm_tests/env_var_re_export_prod/env_var_re_export/main.js b/tests/specs/npm/env_var_re_export_prod/env_var_re_export/main.js similarity index 100% rename from tests/specs/npm_tests/env_var_re_export_prod/env_var_re_export/main.js rename to tests/specs/npm/env_var_re_export_prod/env_var_re_export/main.js diff --git a/tests/specs/npm_tests/error_version_after_subpath/__test__.jsonc b/tests/specs/npm/error_version_after_subpath/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/error_version_after_subpath/__test__.jsonc rename to tests/specs/npm/error_version_after_subpath/__test__.jsonc diff --git a/tests/specs/npm_tests/error_version_after_subpath/error_version_after_subpath/main.js b/tests/specs/npm/error_version_after_subpath/error_version_after_subpath/main.js similarity index 100% rename from tests/specs/npm_tests/error_version_after_subpath/error_version_after_subpath/main.js rename to tests/specs/npm/error_version_after_subpath/error_version_after_subpath/main.js diff --git a/tests/specs/npm_tests/error_version_after_subpath/error_version_after_subpath/main.out b/tests/specs/npm/error_version_after_subpath/error_version_after_subpath/main.out similarity index 100% rename from tests/specs/npm_tests/error_version_after_subpath/error_version_after_subpath/main.out rename to tests/specs/npm/error_version_after_subpath/error_version_after_subpath/main.out diff --git a/tests/specs/npm_tests/import_json/__test__.jsonc b/tests/specs/npm/import_json/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/import_json/__test__.jsonc rename to tests/specs/npm/import_json/__test__.jsonc diff --git a/tests/specs/npm_tests/import_json/import_json/main.js b/tests/specs/npm/import_json/import_json/main.js similarity index 100% rename from tests/specs/npm_tests/import_json/import_json/main.js rename to tests/specs/npm/import_json/import_json/main.js diff --git a/tests/specs/npm_tests/import_json/import_json/main.out b/tests/specs/npm/import_json/import_json/main.out similarity index 100% rename from tests/specs/npm_tests/import_json/import_json/main.out rename to tests/specs/npm/import_json/import_json/main.out diff --git a/tests/specs/npm_tests/import_map/__test__.jsonc b/tests/specs/npm/import_map/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/import_map/__test__.jsonc rename to tests/specs/npm/import_map/__test__.jsonc diff --git a/tests/specs/npm_tests/import_map/import_map/import_map.json b/tests/specs/npm/import_map/import_map/import_map.json similarity index 100% rename from tests/specs/npm_tests/import_map/import_map/import_map.json rename to tests/specs/npm/import_map/import_map/import_map.json diff --git a/tests/specs/npm_tests/import_map/import_map/main.js b/tests/specs/npm/import_map/import_map/main.js similarity index 100% rename from tests/specs/npm_tests/import_map/import_map/main.js rename to tests/specs/npm/import_map/import_map/main.js diff --git a/tests/specs/npm_tests/import_map/import_map/main.out b/tests/specs/npm/import_map/import_map/main.out similarity index 100% rename from tests/specs/npm_tests/import_map/import_map/main.out rename to tests/specs/npm/import_map/import_map/main.out diff --git a/tests/specs/npm_tests/imports_package_json/__test__.jsonc b/tests/specs/npm/imports_package_json/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/imports_package_json/__test__.jsonc rename to tests/specs/npm/imports_package_json/__test__.jsonc diff --git a/tests/specs/npm_tests/imports_package_json/imports_package_json/import_not_defined.js b/tests/specs/npm/imports_package_json/imports_package_json/import_not_defined.js similarity index 100% rename from tests/specs/npm_tests/imports_package_json/imports_package_json/import_not_defined.js rename to tests/specs/npm/imports_package_json/imports_package_json/import_not_defined.js diff --git a/tests/specs/npm_tests/imports_package_json/imports_package_json/import_not_defined.out b/tests/specs/npm/imports_package_json/imports_package_json/import_not_defined.out similarity index 100% rename from tests/specs/npm_tests/imports_package_json/imports_package_json/import_not_defined.out rename to tests/specs/npm/imports_package_json/imports_package_json/import_not_defined.out diff --git a/tests/specs/npm_tests/imports_package_json/imports_package_json/main.js b/tests/specs/npm/imports_package_json/imports_package_json/main.js similarity index 100% rename from tests/specs/npm_tests/imports_package_json/imports_package_json/main.js rename to tests/specs/npm/imports_package_json/imports_package_json/main.js diff --git a/tests/specs/npm_tests/imports_package_json/imports_package_json/main.out b/tests/specs/npm/imports_package_json/imports_package_json/main.out similarity index 100% rename from tests/specs/npm_tests/imports_package_json/imports_package_json/main.out rename to tests/specs/npm/imports_package_json/imports_package_json/main.out diff --git a/tests/specs/npm_tests/imports_package_json/imports_package_json/package.json b/tests/specs/npm/imports_package_json/imports_package_json/package.json similarity index 100% rename from tests/specs/npm_tests/imports_package_json/imports_package_json/package.json rename to tests/specs/npm/imports_package_json/imports_package_json/package.json diff --git a/tests/specs/npm_tests/imports_package_json/imports_package_json/sub_path_import_not_defined.js b/tests/specs/npm/imports_package_json/imports_package_json/sub_path_import_not_defined.js similarity index 100% rename from tests/specs/npm_tests/imports_package_json/imports_package_json/sub_path_import_not_defined.js rename to tests/specs/npm/imports_package_json/imports_package_json/sub_path_import_not_defined.js diff --git a/tests/specs/npm_tests/imports_package_json/imports_package_json/sub_path_import_not_defined.out b/tests/specs/npm/imports_package_json/imports_package_json/sub_path_import_not_defined.out similarity index 100% rename from tests/specs/npm_tests/imports_package_json/imports_package_json/sub_path_import_not_defined.out rename to tests/specs/npm/imports_package_json/imports_package_json/sub_path_import_not_defined.out diff --git a/tests/specs/npm_tests/imports_package_json_import_not_defined/__test__.jsonc b/tests/specs/npm/imports_package_json_import_not_defined/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/imports_package_json_import_not_defined/__test__.jsonc rename to tests/specs/npm/imports_package_json_import_not_defined/__test__.jsonc diff --git a/tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/import_not_defined.js b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/import_not_defined.js similarity index 100% rename from tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/import_not_defined.js rename to tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/import_not_defined.js diff --git a/tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/import_not_defined.out b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/import_not_defined.out similarity index 100% rename from tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/import_not_defined.out rename to tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/import_not_defined.out diff --git a/tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/main.js b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/main.js similarity index 100% rename from tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/main.js rename to tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/main.js diff --git a/tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/main.out b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/main.out similarity index 100% rename from tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/main.out rename to tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/main.out diff --git a/tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/package.json b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/package.json similarity index 100% rename from tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/package.json rename to tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/package.json diff --git a/tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.js b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.js similarity index 100% rename from tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.js rename to tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.js diff --git a/tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.out b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.out similarity index 100% rename from tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.out rename to tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.out diff --git a/tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/__test__.jsonc b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/__test__.jsonc rename to tests/specs/npm/imports_package_json_sub_path_import_not_defined/__test__.jsonc diff --git a/tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.js b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.js similarity index 100% rename from tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.js rename to tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.js diff --git a/tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.out b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.out similarity index 100% rename from tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.out rename to tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.out diff --git a/tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/main.js b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/main.js similarity index 100% rename from tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/main.js rename to tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/main.js diff --git a/tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/main.out b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/main.out similarity index 100% rename from tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/main.out rename to tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/main.out diff --git a/tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/package.json b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/package.json similarity index 100% rename from tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/package.json rename to tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/package.json diff --git a/tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.js b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.js similarity index 100% rename from tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.js rename to tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.js diff --git a/tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.out b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.out similarity index 100% rename from tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.out rename to tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.out diff --git a/tests/specs/npm_tests/info_chalk_display/__test__.jsonc b/tests/specs/npm/info_chalk_display/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/info_chalk_display/__test__.jsonc rename to tests/specs/npm/info_chalk_display/__test__.jsonc diff --git a/tests/specs/npm_tests/info_chalk_display/cjs_with_deps/main.js b/tests/specs/npm/info_chalk_display/cjs_with_deps/main.js similarity index 100% rename from tests/specs/npm_tests/info_chalk_display/cjs_with_deps/main.js rename to tests/specs/npm/info_chalk_display/cjs_with_deps/main.js diff --git a/tests/specs/npm_tests/info_chalk_display/cjs_with_deps/main.out b/tests/specs/npm/info_chalk_display/cjs_with_deps/main.out similarity index 100% rename from tests/specs/npm_tests/info_chalk_display/cjs_with_deps/main.out rename to tests/specs/npm/info_chalk_display/cjs_with_deps/main.out diff --git a/tests/specs/npm_tests/info_chalk_display/cjs_with_deps/main_info.out b/tests/specs/npm/info_chalk_display/cjs_with_deps/main_info.out similarity index 100% rename from tests/specs/npm_tests/info_chalk_display/cjs_with_deps/main_info.out rename to tests/specs/npm/info_chalk_display/cjs_with_deps/main_info.out diff --git a/tests/specs/npm_tests/info_chalk_display/cjs_with_deps/main_info_json.out b/tests/specs/npm/info_chalk_display/cjs_with_deps/main_info_json.out similarity index 100% rename from tests/specs/npm_tests/info_chalk_display/cjs_with_deps/main_info_json.out rename to tests/specs/npm/info_chalk_display/cjs_with_deps/main_info_json.out diff --git a/tests/specs/npm_tests/info_chalk_display/cjs_with_deps/main_node_modules.out b/tests/specs/npm/info_chalk_display/cjs_with_deps/main_node_modules.out similarity index 100% rename from tests/specs/npm_tests/info_chalk_display/cjs_with_deps/main_node_modules.out rename to tests/specs/npm/info_chalk_display/cjs_with_deps/main_node_modules.out diff --git a/tests/specs/npm_tests/info_chalk_display_node_modules_dir/__test__.jsonc b/tests/specs/npm/info_chalk_display_node_modules_dir/__test__.jsonc similarity index 92% rename from tests/specs/npm_tests/info_chalk_display_node_modules_dir/__test__.jsonc rename to tests/specs/npm/info_chalk_display_node_modules_dir/__test__.jsonc index 5dd35f5a4a..1e6ef8284a 100644 --- a/tests/specs/npm_tests/info_chalk_display_node_modules_dir/__test__.jsonc +++ b/tests/specs/npm/info_chalk_display_node_modules_dir/__test__.jsonc @@ -1,4 +1,5 @@ { + "tempDir": true, "args": "info --quiet --node-modules-dir cjs_with_deps/main.js", "output": "cjs_with_deps/main_info.out", "exitCode": 0, diff --git a/tests/specs/npm_tests/info_chalk_display_node_modules_dir/cjs_with_deps/main.js b/tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main.js similarity index 100% rename from tests/specs/npm_tests/info_chalk_display_node_modules_dir/cjs_with_deps/main.js rename to tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main.js diff --git a/tests/specs/npm_tests/info_chalk_display_node_modules_dir/cjs_with_deps/main.out b/tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main.out similarity index 100% rename from tests/specs/npm_tests/info_chalk_display_node_modules_dir/cjs_with_deps/main.out rename to tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main.out diff --git a/tests/specs/npm_tests/info_chalk_display_node_modules_dir/cjs_with_deps/main_info.out b/tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main_info.out similarity index 100% rename from tests/specs/npm_tests/info_chalk_display_node_modules_dir/cjs_with_deps/main_info.out rename to tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main_info.out diff --git a/tests/specs/npm_tests/info_chalk_display_node_modules_dir/cjs_with_deps/main_info_json.out b/tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main_info_json.out similarity index 100% rename from tests/specs/npm_tests/info_chalk_display_node_modules_dir/cjs_with_deps/main_info_json.out rename to tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main_info_json.out diff --git a/tests/specs/npm_tests/info_chalk_display_node_modules_dir/cjs_with_deps/main_node_modules.out b/tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main_node_modules.out similarity index 100% rename from tests/specs/npm_tests/info_chalk_display_node_modules_dir/cjs_with_deps/main_node_modules.out rename to tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main_node_modules.out diff --git a/tests/specs/npm_tests/info_chalk_json/__test__.jsonc b/tests/specs/npm/info_chalk_json/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/info_chalk_json/__test__.jsonc rename to tests/specs/npm/info_chalk_json/__test__.jsonc diff --git a/tests/specs/npm_tests/info_chalk_json/cjs_with_deps/main.js b/tests/specs/npm/info_chalk_json/cjs_with_deps/main.js similarity index 100% rename from tests/specs/npm_tests/info_chalk_json/cjs_with_deps/main.js rename to tests/specs/npm/info_chalk_json/cjs_with_deps/main.js diff --git a/tests/specs/npm_tests/info_chalk_json/cjs_with_deps/main.out b/tests/specs/npm/info_chalk_json/cjs_with_deps/main.out similarity index 100% rename from tests/specs/npm_tests/info_chalk_json/cjs_with_deps/main.out rename to tests/specs/npm/info_chalk_json/cjs_with_deps/main.out diff --git a/tests/specs/npm_tests/info_chalk_json/cjs_with_deps/main_info.out b/tests/specs/npm/info_chalk_json/cjs_with_deps/main_info.out similarity index 100% rename from tests/specs/npm_tests/info_chalk_json/cjs_with_deps/main_info.out rename to tests/specs/npm/info_chalk_json/cjs_with_deps/main_info.out diff --git a/tests/specs/npm_tests/info_chalk_json/cjs_with_deps/main_info_json.out b/tests/specs/npm/info_chalk_json/cjs_with_deps/main_info_json.out similarity index 100% rename from tests/specs/npm_tests/info_chalk_json/cjs_with_deps/main_info_json.out rename to tests/specs/npm/info_chalk_json/cjs_with_deps/main_info_json.out diff --git a/tests/specs/npm_tests/info_chalk_json/cjs_with_deps/main_node_modules.out b/tests/specs/npm/info_chalk_json/cjs_with_deps/main_node_modules.out similarity index 100% rename from tests/specs/npm_tests/info_chalk_json/cjs_with_deps/main_node_modules.out rename to tests/specs/npm/info_chalk_json/cjs_with_deps/main_node_modules.out diff --git a/tests/specs/npm_tests/info_chalk_json_node_modules_dir/__test__.jsonc b/tests/specs/npm/info_chalk_json_node_modules_dir/__test__.jsonc similarity index 92% rename from tests/specs/npm_tests/info_chalk_json_node_modules_dir/__test__.jsonc rename to tests/specs/npm/info_chalk_json_node_modules_dir/__test__.jsonc index 1b34f48137..37b510488e 100644 --- a/tests/specs/npm_tests/info_chalk_json_node_modules_dir/__test__.jsonc +++ b/tests/specs/npm/info_chalk_json_node_modules_dir/__test__.jsonc @@ -1,4 +1,5 @@ { + "tempDir": true, "args": "info --quiet --node-modules-dir --json cjs_with_deps/main.js", "output": "cjs_with_deps/main_info_json.out", "exitCode": 0, diff --git a/tests/specs/npm_tests/info_chalk_json_node_modules_dir/cjs_with_deps/main.js b/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main.js similarity index 100% rename from tests/specs/npm_tests/info_chalk_json_node_modules_dir/cjs_with_deps/main.js rename to tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main.js diff --git a/tests/specs/npm_tests/info_chalk_json_node_modules_dir/cjs_with_deps/main.out b/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main.out similarity index 100% rename from tests/specs/npm_tests/info_chalk_json_node_modules_dir/cjs_with_deps/main.out rename to tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main.out diff --git a/tests/specs/npm_tests/info_chalk_json_node_modules_dir/cjs_with_deps/main_info.out b/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main_info.out similarity index 100% rename from tests/specs/npm_tests/info_chalk_json_node_modules_dir/cjs_with_deps/main_info.out rename to tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main_info.out diff --git a/tests/specs/npm_tests/info_chalk_json_node_modules_dir/cjs_with_deps/main_info_json.out b/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main_info_json.out similarity index 100% rename from tests/specs/npm_tests/info_chalk_json_node_modules_dir/cjs_with_deps/main_info_json.out rename to tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main_info_json.out diff --git a/tests/specs/npm_tests/info_chalk_json_node_modules_dir/cjs_with_deps/main_node_modules.out b/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main_node_modules.out similarity index 100% rename from tests/specs/npm_tests/info_chalk_json_node_modules_dir/cjs_with_deps/main_node_modules.out rename to tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main_node_modules.out diff --git a/tests/specs/npm_tests/info_cli_chalk_display/__test__.jsonc b/tests/specs/npm/info_cli_chalk_display/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/info_cli_chalk_display/__test__.jsonc rename to tests/specs/npm/info_cli_chalk_display/__test__.jsonc diff --git a/tests/specs/npm_tests/info_cli_chalk_display/info/chalk.out b/tests/specs/npm/info_cli_chalk_display/info/chalk.out similarity index 100% rename from tests/specs/npm_tests/info_cli_chalk_display/info/chalk.out rename to tests/specs/npm/info_cli_chalk_display/info/chalk.out diff --git a/tests/specs/npm_tests/info_cli_chalk_display/info/chalk_json.out b/tests/specs/npm/info_cli_chalk_display/info/chalk_json.out similarity index 100% rename from tests/specs/npm_tests/info_cli_chalk_display/info/chalk_json.out rename to tests/specs/npm/info_cli_chalk_display/info/chalk_json.out diff --git a/tests/specs/npm_tests/info_cli_chalk_json/__test__.jsonc b/tests/specs/npm/info_cli_chalk_json/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/info_cli_chalk_json/__test__.jsonc rename to tests/specs/npm/info_cli_chalk_json/__test__.jsonc diff --git a/tests/specs/npm_tests/info_cli_chalk_json/info/chalk.out b/tests/specs/npm/info_cli_chalk_json/info/chalk.out similarity index 100% rename from tests/specs/npm_tests/info_cli_chalk_json/info/chalk.out rename to tests/specs/npm/info_cli_chalk_json/info/chalk.out diff --git a/tests/specs/npm_tests/info_cli_chalk_json/info/chalk_json.out b/tests/specs/npm/info_cli_chalk_json/info/chalk_json.out similarity index 100% rename from tests/specs/npm_tests/info_cli_chalk_json/info/chalk_json.out rename to tests/specs/npm/info_cli_chalk_json/info/chalk_json.out diff --git a/tests/specs/npm_tests/info_peer_deps/__test__.jsonc b/tests/specs/npm/info_peer_deps/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/info_peer_deps/__test__.jsonc rename to tests/specs/npm/info_peer_deps/__test__.jsonc diff --git a/tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main.out b/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main.out similarity index 100% rename from tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main.out rename to tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main.out diff --git a/tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main.ts b/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main.ts similarity index 100% rename from tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main.ts rename to tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main.ts diff --git a/tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main_info.out b/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_info.out similarity index 100% rename from tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main_info.out rename to tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_info.out diff --git a/tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main_info_json.out b/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_info_json.out similarity index 100% rename from tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main_info_json.out rename to tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_info_json.out diff --git a/tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main_node_modules.out b/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_node_modules.out similarity index 100% rename from tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main_node_modules.out rename to tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_node_modules.out diff --git a/tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main_node_modules_reload.out b/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_node_modules_reload.out similarity index 100% rename from tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main_node_modules_reload.out rename to tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_node_modules_reload.out diff --git a/tests/specs/npm_tests/info_peer_deps_json/__test__.jsonc b/tests/specs/npm/info_peer_deps_json/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/info_peer_deps_json/__test__.jsonc rename to tests/specs/npm/info_peer_deps_json/__test__.jsonc diff --git a/tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main.out b/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main.out similarity index 100% rename from tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main.out rename to tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main.out diff --git a/tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main.ts b/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main.ts similarity index 100% rename from tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main.ts rename to tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main.ts diff --git a/tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main_info.out b/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_info.out similarity index 100% rename from tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main_info.out rename to tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_info.out diff --git a/tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main_info_json.out b/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_info_json.out similarity index 100% rename from tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main_info_json.out rename to tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_info_json.out diff --git a/tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules.out b/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules.out similarity index 100% rename from tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules.out rename to tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules.out diff --git a/tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules_reload.out b/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules_reload.out similarity index 100% rename from tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules_reload.out rename to tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules_reload.out diff --git a/tests/specs/npm_tests/mixed_case_package_name_global_dir/__test__.jsonc b/tests/specs/npm/mixed_case_package_name_global_dir/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/mixed_case_package_name_global_dir/__test__.jsonc rename to tests/specs/npm/mixed_case_package_name_global_dir/__test__.jsonc diff --git a/tests/specs/npm_tests/mixed_case_package_name_global_dir/mixed_case_package_name/global.out b/tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/global.out similarity index 100% rename from tests/specs/npm_tests/mixed_case_package_name_global_dir/mixed_case_package_name/global.out rename to tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/global.out diff --git a/tests/specs/npm_tests/mixed_case_package_name_global_dir/mixed_case_package_name/global.ts b/tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/global.ts similarity index 100% rename from tests/specs/npm_tests/mixed_case_package_name_global_dir/mixed_case_package_name/global.ts rename to tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/global.ts diff --git a/tests/specs/npm_tests/mixed_case_package_name_global_dir/mixed_case_package_name/local.out b/tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/local.out similarity index 100% rename from tests/specs/npm_tests/mixed_case_package_name_global_dir/mixed_case_package_name/local.out rename to tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/local.out diff --git a/tests/specs/npm_tests/mixed_case_package_name_global_dir/mixed_case_package_name/local.ts b/tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/local.ts similarity index 100% rename from tests/specs/npm_tests/mixed_case_package_name_global_dir/mixed_case_package_name/local.ts rename to tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/local.ts diff --git a/tests/specs/npm_tests/mixed_case_package_name_local_dir/__test__.jsonc b/tests/specs/npm/mixed_case_package_name_local_dir/__test__.jsonc similarity index 92% rename from tests/specs/npm_tests/mixed_case_package_name_local_dir/__test__.jsonc rename to tests/specs/npm/mixed_case_package_name_local_dir/__test__.jsonc index 0778cb5624..1f568e2861 100644 --- a/tests/specs/npm_tests/mixed_case_package_name_local_dir/__test__.jsonc +++ b/tests/specs/npm/mixed_case_package_name_local_dir/__test__.jsonc @@ -1,4 +1,5 @@ { + "tempDir": true, "args": "run --node-modules-dir=auto -A mixed_case_package_name/local.ts", "output": "mixed_case_package_name/local.out", "exitCode": 0, diff --git a/tests/specs/npm_tests/mixed_case_package_name_local_dir/mixed_case_package_name/global.out b/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/global.out similarity index 100% rename from tests/specs/npm_tests/mixed_case_package_name_local_dir/mixed_case_package_name/global.out rename to tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/global.out diff --git a/tests/specs/npm_tests/mixed_case_package_name_local_dir/mixed_case_package_name/global.ts b/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/global.ts similarity index 100% rename from tests/specs/npm_tests/mixed_case_package_name_local_dir/mixed_case_package_name/global.ts rename to tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/global.ts diff --git a/tests/specs/npm_tests/mixed_case_package_name_local_dir/mixed_case_package_name/local.out b/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/local.out similarity index 100% rename from tests/specs/npm_tests/mixed_case_package_name_local_dir/mixed_case_package_name/local.out rename to tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/local.out diff --git a/tests/specs/npm_tests/mixed_case_package_name_local_dir/mixed_case_package_name/local.ts b/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/local.ts similarity index 100% rename from tests/specs/npm_tests/mixed_case_package_name_local_dir/mixed_case_package_name/local.ts rename to tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/local.ts diff --git a/tests/specs/npm_tests/node_modules_deno_node_modules/__test__.jsonc b/tests/specs/npm/node_modules_deno_node_modules/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/node_modules_deno_node_modules/__test__.jsonc rename to tests/specs/npm/node_modules_deno_node_modules/__test__.jsonc diff --git a/tests/specs/npm_tests/node_modules_deno_node_modules/node_modules_deno_node_modules/main.out b/tests/specs/npm/node_modules_deno_node_modules/node_modules_deno_node_modules/main.out similarity index 100% rename from tests/specs/npm_tests/node_modules_deno_node_modules/node_modules_deno_node_modules/main.out rename to tests/specs/npm/node_modules_deno_node_modules/node_modules_deno_node_modules/main.out diff --git a/tests/specs/npm_tests/node_modules_deno_node_modules/node_modules_deno_node_modules/main.ts b/tests/specs/npm/node_modules_deno_node_modules/node_modules_deno_node_modules/main.ts similarity index 100% rename from tests/specs/npm_tests/node_modules_deno_node_modules/node_modules_deno_node_modules/main.ts rename to tests/specs/npm/node_modules_deno_node_modules/node_modules_deno_node_modules/main.ts diff --git a/tests/specs/npm_tests/node_modules_deno_node_modules_local/__test__.jsonc b/tests/specs/npm/node_modules_deno_node_modules_local/__test__.jsonc similarity index 92% rename from tests/specs/npm_tests/node_modules_deno_node_modules_local/__test__.jsonc rename to tests/specs/npm/node_modules_deno_node_modules_local/__test__.jsonc index a1e67b32ba..caa34f67cb 100644 --- a/tests/specs/npm_tests/node_modules_deno_node_modules_local/__test__.jsonc +++ b/tests/specs/npm/node_modules_deno_node_modules_local/__test__.jsonc @@ -1,4 +1,5 @@ { + "tempDir": true, "args": "run --quiet --node-modules-dir node_modules_deno_node_modules/main.ts", "output": "node_modules_deno_node_modules/main.out", "exitCode": 0, diff --git a/tests/specs/npm_tests/node_modules_deno_node_modules_local/node_modules_deno_node_modules/main.out b/tests/specs/npm/node_modules_deno_node_modules_local/node_modules_deno_node_modules/main.out similarity index 100% rename from tests/specs/npm_tests/node_modules_deno_node_modules_local/node_modules_deno_node_modules/main.out rename to tests/specs/npm/node_modules_deno_node_modules_local/node_modules_deno_node_modules/main.out diff --git a/tests/specs/npm_tests/node_modules_deno_node_modules_local/node_modules_deno_node_modules/main.ts b/tests/specs/npm/node_modules_deno_node_modules_local/node_modules_deno_node_modules/main.ts similarity index 100% rename from tests/specs/npm_tests/node_modules_deno_node_modules_local/node_modules_deno_node_modules/main.ts rename to tests/specs/npm/node_modules_deno_node_modules_local/node_modules_deno_node_modules/main.ts diff --git a/tests/specs/npm_tests/node_modules_dir_require_added_node_modules_folder/__test__.jsonc b/tests/specs/npm/node_modules_dir_require_added_node_modules_folder/__test__.jsonc similarity index 92% rename from tests/specs/npm_tests/node_modules_dir_require_added_node_modules_folder/__test__.jsonc rename to tests/specs/npm/node_modules_dir_require_added_node_modules_folder/__test__.jsonc index 5813bb3f21..c20c929248 100644 --- a/tests/specs/npm_tests/node_modules_dir_require_added_node_modules_folder/__test__.jsonc +++ b/tests/specs/npm/node_modules_dir_require_added_node_modules_folder/__test__.jsonc @@ -1,4 +1,5 @@ { + "tempDir": true, "args": "run --node-modules-dir=auto -A --quiet require_added_nm_folder/main.js", "output": "require_added_nm_folder/main.out", "envs": { diff --git a/tests/specs/npm_tests/node_modules_dir_require_added_node_modules_folder/require_added_nm_folder/main.js b/tests/specs/npm/node_modules_dir_require_added_node_modules_folder/require_added_nm_folder/main.js similarity index 100% rename from tests/specs/npm_tests/node_modules_dir_require_added_node_modules_folder/require_added_nm_folder/main.js rename to tests/specs/npm/node_modules_dir_require_added_node_modules_folder/require_added_nm_folder/main.js diff --git a/tests/specs/npm_tests/node_modules_dir_require_added_node_modules_folder/require_added_nm_folder/main.out b/tests/specs/npm/node_modules_dir_require_added_node_modules_folder/require_added_nm_folder/main.out similarity index 100% rename from tests/specs/npm_tests/node_modules_dir_require_added_node_modules_folder/require_added_nm_folder/main.out rename to tests/specs/npm/node_modules_dir_require_added_node_modules_folder/require_added_nm_folder/main.out diff --git a/tests/specs/npm_tests/node_modules_dir_require_main_entry/__test__.jsonc b/tests/specs/npm/node_modules_dir_require_main_entry/__test__.jsonc similarity index 91% rename from tests/specs/npm_tests/node_modules_dir_require_main_entry/__test__.jsonc rename to tests/specs/npm/node_modules_dir_require_main_entry/__test__.jsonc index 45936f1de2..1a0dfba321 100644 --- a/tests/specs/npm_tests/node_modules_dir_require_main_entry/__test__.jsonc +++ b/tests/specs/npm/node_modules_dir_require_main_entry/__test__.jsonc @@ -1,4 +1,5 @@ { + "tempDir": true, "args": "run --node-modules-dir -A --quiet require_main/main.js", "output": "require_main/main.out", "envs": { diff --git a/tests/specs/npm_tests/node_modules_dir_require_main_entry/require_main/main.js b/tests/specs/npm/node_modules_dir_require_main_entry/require_main/main.js similarity index 100% rename from tests/specs/npm_tests/node_modules_dir_require_main_entry/require_main/main.js rename to tests/specs/npm/node_modules_dir_require_main_entry/require_main/main.js diff --git a/tests/specs/npm_tests/node_modules_dir_require_main_entry/require_main/main.out b/tests/specs/npm/node_modules_dir_require_main_entry/require_main/main.out similarity index 100% rename from tests/specs/npm_tests/node_modules_dir_require_main_entry/require_main/main.out rename to tests/specs/npm/node_modules_dir_require_main_entry/require_main/main.out diff --git a/tests/specs/npm_tests/node_modules_dir_with_deps/__test__.jsonc b/tests/specs/npm/node_modules_dir_with_deps/__test__.jsonc similarity index 92% rename from tests/specs/npm_tests/node_modules_dir_with_deps/__test__.jsonc rename to tests/specs/npm/node_modules_dir_with_deps/__test__.jsonc index ae79e8a472..75488e1b5d 100644 --- a/tests/specs/npm_tests/node_modules_dir_with_deps/__test__.jsonc +++ b/tests/specs/npm/node_modules_dir_with_deps/__test__.jsonc @@ -1,4 +1,5 @@ { + "tempDir": true, "args": "run --allow-read --allow-env --node-modules-dir=auto cjs_with_deps/main.js", "output": "cjs_with_deps/main_node_modules.out", "envs": { diff --git a/tests/specs/npm_tests/node_modules_dir_with_deps/cjs_with_deps/main.js b/tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main.js similarity index 100% rename from tests/specs/npm_tests/node_modules_dir_with_deps/cjs_with_deps/main.js rename to tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main.js diff --git a/tests/specs/npm_tests/node_modules_dir_with_deps/cjs_with_deps/main.out b/tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main.out similarity index 100% rename from tests/specs/npm_tests/node_modules_dir_with_deps/cjs_with_deps/main.out rename to tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main.out diff --git a/tests/specs/npm_tests/node_modules_dir_with_deps/cjs_with_deps/main_info.out b/tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main_info.out similarity index 100% rename from tests/specs/npm_tests/node_modules_dir_with_deps/cjs_with_deps/main_info.out rename to tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main_info.out diff --git a/tests/specs/npm_tests/node_modules_dir_with_deps/cjs_with_deps/main_info_json.out b/tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main_info_json.out similarity index 100% rename from tests/specs/npm_tests/node_modules_dir_with_deps/cjs_with_deps/main_info_json.out rename to tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main_info_json.out diff --git a/tests/specs/npm_tests/node_modules_dir_with_deps/cjs_with_deps/main_node_modules.out b/tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main_node_modules.out similarity index 100% rename from tests/specs/npm_tests/node_modules_dir_with_deps/cjs_with_deps/main_node_modules.out rename to tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main_node_modules.out diff --git a/tests/specs/npm_tests/node_modules_dir_yargs/__test__.jsonc b/tests/specs/npm/node_modules_dir_yargs/__test__.jsonc similarity index 91% rename from tests/specs/npm_tests/node_modules_dir_yargs/__test__.jsonc rename to tests/specs/npm/node_modules_dir_yargs/__test__.jsonc index 8aa139a51d..df28ea7eff 100644 --- a/tests/specs/npm_tests/node_modules_dir_yargs/__test__.jsonc +++ b/tests/specs/npm/node_modules_dir_yargs/__test__.jsonc @@ -1,4 +1,5 @@ { + "tempDir": true, "args": "run --allow-read --allow-env --node-modules-dir=auto cjs_yargs/main.js", "output": "cjs_yargs/main.out", "envs": { diff --git a/tests/specs/npm_tests/node_modules_dir_yargs/cjs_yargs/main.js b/tests/specs/npm/node_modules_dir_yargs/cjs_yargs/main.js similarity index 100% rename from tests/specs/npm_tests/node_modules_dir_yargs/cjs_yargs/main.js rename to tests/specs/npm/node_modules_dir_yargs/cjs_yargs/main.js diff --git a/tests/specs/npm_tests/node_modules_dir_yargs/cjs_yargs/main.out b/tests/specs/npm/node_modules_dir_yargs/cjs_yargs/main.out similarity index 100% rename from tests/specs/npm_tests/node_modules_dir_yargs/cjs_yargs/main.out rename to tests/specs/npm/node_modules_dir_yargs/cjs_yargs/main.out diff --git a/tests/specs/npm_tests/non_existent_dep/__test__.jsonc b/tests/specs/npm/non_existent_dep/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/non_existent_dep/__test__.jsonc rename to tests/specs/npm/non_existent_dep/__test__.jsonc diff --git a/tests/specs/npm_tests/non_existent_dep_version/__test__.jsonc b/tests/specs/npm/non_existent_dep_version/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/non_existent_dep_version/__test__.jsonc rename to tests/specs/npm/non_existent_dep_version/__test__.jsonc diff --git a/tests/specs/npm_tests/nonexistent_file/__test__.jsonc b/tests/specs/npm/nonexistent_file/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/nonexistent_file/__test__.jsonc rename to tests/specs/npm/nonexistent_file/__test__.jsonc diff --git a/tests/specs/npm_tests/nonexistent_file/nonexistent_file/main.js b/tests/specs/npm/nonexistent_file/nonexistent_file/main.js similarity index 100% rename from tests/specs/npm_tests/nonexistent_file/nonexistent_file/main.js rename to tests/specs/npm/nonexistent_file/nonexistent_file/main.js diff --git a/tests/specs/npm_tests/nonexistent_file/nonexistent_file/main.out b/tests/specs/npm/nonexistent_file/nonexistent_file/main.out similarity index 100% rename from tests/specs/npm_tests/nonexistent_file/nonexistent_file/main.out rename to tests/specs/npm/nonexistent_file/nonexistent_file/main.out diff --git a/tests/specs/npm_tests/nonexistent_file_node_modules_dir/__test__.jsonc b/tests/specs/npm/nonexistent_file_node_modules_dir/__test__.jsonc similarity index 92% rename from tests/specs/npm_tests/nonexistent_file_node_modules_dir/__test__.jsonc rename to tests/specs/npm/nonexistent_file_node_modules_dir/__test__.jsonc index 28da47300b..66595558f1 100644 --- a/tests/specs/npm_tests/nonexistent_file_node_modules_dir/__test__.jsonc +++ b/tests/specs/npm/nonexistent_file_node_modules_dir/__test__.jsonc @@ -1,4 +1,5 @@ { + "tempDir": true, "args": "run -A --quiet --node-modules-dir nonexistent_file/main.js", "output": "nonexistent_file/main.out", "envs": { diff --git a/tests/specs/npm_tests/nonexistent_file_node_modules_dir/nonexistent_file/main.js b/tests/specs/npm/nonexistent_file_node_modules_dir/nonexistent_file/main.js similarity index 100% rename from tests/specs/npm_tests/nonexistent_file_node_modules_dir/nonexistent_file/main.js rename to tests/specs/npm/nonexistent_file_node_modules_dir/nonexistent_file/main.js diff --git a/tests/specs/npm_tests/nonexistent_file_node_modules_dir/nonexistent_file/main.out b/tests/specs/npm/nonexistent_file_node_modules_dir/nonexistent_file/main.out similarity index 100% rename from tests/specs/npm_tests/nonexistent_file_node_modules_dir/nonexistent_file/main.out rename to tests/specs/npm/nonexistent_file_node_modules_dir/nonexistent_file/main.out diff --git a/tests/specs/npm_tests/permissions_outside_package/__test__.jsonc b/tests/specs/npm/permissions_outside_package/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/permissions_outside_package/__test__.jsonc rename to tests/specs/npm/permissions_outside_package/__test__.jsonc diff --git a/tests/specs/npm_tests/permissions_outside_package/permissions_outside_package/foo/config.js b/tests/specs/npm/permissions_outside_package/permissions_outside_package/foo/config.js similarity index 100% rename from tests/specs/npm_tests/permissions_outside_package/permissions_outside_package/foo/config.js rename to tests/specs/npm/permissions_outside_package/permissions_outside_package/foo/config.js diff --git a/tests/specs/npm_tests/permissions_outside_package/permissions_outside_package/foo/package.json b/tests/specs/npm/permissions_outside_package/permissions_outside_package/foo/package.json similarity index 100% rename from tests/specs/npm_tests/permissions_outside_package/permissions_outside_package/foo/package.json rename to tests/specs/npm/permissions_outside_package/permissions_outside_package/foo/package.json diff --git a/tests/specs/npm_tests/permissions_outside_package/permissions_outside_package/main.out b/tests/specs/npm/permissions_outside_package/permissions_outside_package/main.out similarity index 100% rename from tests/specs/npm_tests/permissions_outside_package/permissions_outside_package/main.out rename to tests/specs/npm/permissions_outside_package/permissions_outside_package/main.out diff --git a/tests/specs/npm_tests/permissions_outside_package/permissions_outside_package/main.ts b/tests/specs/npm/permissions_outside_package/permissions_outside_package/main.ts similarity index 100% rename from tests/specs/npm_tests/permissions_outside_package/permissions_outside_package/main.ts rename to tests/specs/npm/permissions_outside_package/permissions_outside_package/main.ts diff --git a/tests/specs/npm_tests/remote_npm_specifier/__test__.jsonc b/tests/specs/npm/remote_npm_specifier/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/remote_npm_specifier/__test__.jsonc rename to tests/specs/npm/remote_npm_specifier/__test__.jsonc diff --git a/tests/specs/npm_tests/remote_npm_specifier/remote_npm_specifier/main.out b/tests/specs/npm/remote_npm_specifier/remote_npm_specifier/main.out similarity index 100% rename from tests/specs/npm_tests/remote_npm_specifier/remote_npm_specifier/main.out rename to tests/specs/npm/remote_npm_specifier/remote_npm_specifier/main.out diff --git a/tests/specs/npm_tests/remote_npm_specifier/remote_npm_specifier/main.ts b/tests/specs/npm/remote_npm_specifier/remote_npm_specifier/main.ts similarity index 100% rename from tests/specs/npm_tests/remote_npm_specifier/remote_npm_specifier/main.ts rename to tests/specs/npm/remote_npm_specifier/remote_npm_specifier/main.ts diff --git a/tests/specs/npm_tests/remote_npm_specifier/remote_npm_specifier/remote.ts b/tests/specs/npm/remote_npm_specifier/remote_npm_specifier/remote.ts similarity index 100% rename from tests/specs/npm_tests/remote_npm_specifier/remote_npm_specifier/remote.ts rename to tests/specs/npm/remote_npm_specifier/remote_npm_specifier/remote.ts diff --git a/tests/specs/npm_tests/require_esm/__test__.jsonc b/tests/specs/npm/require_esm/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/require_esm/__test__.jsonc rename to tests/specs/npm/require_esm/__test__.jsonc diff --git a/tests/specs/npm_tests/require_esm/require_esm/esm.js b/tests/specs/npm/require_esm/require_esm/esm.js similarity index 100% rename from tests/specs/npm_tests/require_esm/require_esm/esm.js rename to tests/specs/npm/require_esm/require_esm/esm.js diff --git a/tests/specs/npm_tests/require_esm/require_esm/main.out b/tests/specs/npm/require_esm/require_esm/main.out similarity index 100% rename from tests/specs/npm_tests/require_esm/require_esm/main.out rename to tests/specs/npm/require_esm/require_esm/main.out diff --git a/tests/specs/npm_tests/require_esm/require_esm/main.ts b/tests/specs/npm/require_esm/require_esm/main.ts similarity index 100% rename from tests/specs/npm_tests/require_esm/require_esm/main.ts rename to tests/specs/npm/require_esm/require_esm/main.ts diff --git a/tests/specs/npm_tests/require_json/__test__.jsonc b/tests/specs/npm/require_json/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/require_json/__test__.jsonc rename to tests/specs/npm/require_json/__test__.jsonc diff --git a/tests/specs/npm_tests/require_json/require_json/main.js b/tests/specs/npm/require_json/require_json/main.js similarity index 100% rename from tests/specs/npm_tests/require_json/require_json/main.js rename to tests/specs/npm/require_json/require_json/main.js diff --git a/tests/specs/npm_tests/require_json/require_json/main.out b/tests/specs/npm/require_json/require_json/main.out similarity index 100% rename from tests/specs/npm_tests/require_json/require_json/main.out rename to tests/specs/npm/require_json/require_json/main.out diff --git a/tests/specs/npm_tests/reserved_word_exports/__test__.jsonc b/tests/specs/npm/reserved_word_exports/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/reserved_word_exports/__test__.jsonc rename to tests/specs/npm/reserved_word_exports/__test__.jsonc diff --git a/tests/specs/npm_tests/reserved_word_exports/reserved_word_exports/main.out b/tests/specs/npm/reserved_word_exports/reserved_word_exports/main.out similarity index 100% rename from tests/specs/npm_tests/reserved_word_exports/reserved_word_exports/main.out rename to tests/specs/npm/reserved_word_exports/reserved_word_exports/main.out diff --git a/tests/specs/npm_tests/reserved_word_exports/reserved_word_exports/main.ts b/tests/specs/npm/reserved_word_exports/reserved_word_exports/main.ts similarity index 100% rename from tests/specs/npm_tests/reserved_word_exports/reserved_word_exports/main.ts rename to tests/specs/npm/reserved_word_exports/reserved_word_exports/main.ts diff --git a/tests/specs/npm_tests/run_existing_npm_package_with_subpath/__test__.jsonc b/tests/specs/npm/run_existing_npm_package_with_subpath/__test__.jsonc similarity index 92% rename from tests/specs/npm_tests/run_existing_npm_package_with_subpath/__test__.jsonc rename to tests/specs/npm/run_existing_npm_package_with_subpath/__test__.jsonc index bc76b00be5..bb02973c4d 100644 --- a/tests/specs/npm_tests/run_existing_npm_package_with_subpath/__test__.jsonc +++ b/tests/specs/npm/run_existing_npm_package_with_subpath/__test__.jsonc @@ -1,4 +1,5 @@ { + "tempDir": true, "args": "run --allow-read --node-modules-dir=auto npm:@denotest/bin/cli-esm dev --help", "output": "run_existing_npm_package_with_subpath/main.out", "envs": { diff --git a/tests/specs/npm_tests/run_existing_npm_package_with_subpath/run_existing_npm_package_with_subpath/main.out b/tests/specs/npm/run_existing_npm_package_with_subpath/run_existing_npm_package_with_subpath/main.out similarity index 100% rename from tests/specs/npm_tests/run_existing_npm_package_with_subpath/run_existing_npm_package_with_subpath/main.out rename to tests/specs/npm/run_existing_npm_package_with_subpath/run_existing_npm_package_with_subpath/main.out diff --git a/tests/specs/npm_tests/run_existing_npm_package_with_subpath/run_existing_npm_package_with_subpath/package.json b/tests/specs/npm/run_existing_npm_package_with_subpath/run_existing_npm_package_with_subpath/package.json similarity index 100% rename from tests/specs/npm_tests/run_existing_npm_package_with_subpath/run_existing_npm_package_with_subpath/package.json rename to tests/specs/npm/run_existing_npm_package_with_subpath/run_existing_npm_package_with_subpath/package.json diff --git a/tests/specs/npm_tests/sub_paths/__test__.jsonc b/tests/specs/npm/sub_paths/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/sub_paths/__test__.jsonc rename to tests/specs/npm/sub_paths/__test__.jsonc diff --git a/tests/specs/npm_tests/sub_paths/sub_paths/main.jsx b/tests/specs/npm/sub_paths/sub_paths/main.jsx similarity index 100% rename from tests/specs/npm_tests/sub_paths/sub_paths/main.jsx rename to tests/specs/npm/sub_paths/sub_paths/main.jsx diff --git a/tests/specs/npm_tests/sub_paths/sub_paths/main.out b/tests/specs/npm/sub_paths/sub_paths/main.out similarity index 100% rename from tests/specs/npm_tests/sub_paths/sub_paths/main.out rename to tests/specs/npm/sub_paths/sub_paths/main.out diff --git a/tests/specs/npm_tests/tarball_with_global_header/__test__.jsonc b/tests/specs/npm/tarball_with_global_header/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/tarball_with_global_header/__test__.jsonc rename to tests/specs/npm/tarball_with_global_header/__test__.jsonc diff --git a/tests/specs/npm_tests/tarball_with_global_header/tarball_with_global_header/main.js b/tests/specs/npm/tarball_with_global_header/tarball_with_global_header/main.js similarity index 100% rename from tests/specs/npm_tests/tarball_with_global_header/tarball_with_global_header/main.js rename to tests/specs/npm/tarball_with_global_header/tarball_with_global_header/main.js diff --git a/tests/specs/npm_tests/tarball_with_global_header/tarball_with_global_header/main.out b/tests/specs/npm/tarball_with_global_header/tarball_with_global_header/main.out similarity index 100% rename from tests/specs/npm_tests/tarball_with_global_header/tarball_with_global_header/main.out rename to tests/specs/npm/tarball_with_global_header/tarball_with_global_header/main.out diff --git a/tests/specs/npm_tests/translate_cjs_to_esm/__test__.jsonc b/tests/specs/npm/translate_cjs_to_esm/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/translate_cjs_to_esm/__test__.jsonc rename to tests/specs/npm/translate_cjs_to_esm/__test__.jsonc diff --git a/tests/specs/npm_tests/translate_cjs_to_esm/translate_cjs_to_esm/main.js b/tests/specs/npm/translate_cjs_to_esm/translate_cjs_to_esm/main.js similarity index 100% rename from tests/specs/npm_tests/translate_cjs_to_esm/translate_cjs_to_esm/main.js rename to tests/specs/npm/translate_cjs_to_esm/translate_cjs_to_esm/main.js diff --git a/tests/specs/npm_tests/translate_cjs_to_esm/translate_cjs_to_esm/main.out b/tests/specs/npm/translate_cjs_to_esm/translate_cjs_to_esm/main.out similarity index 100% rename from tests/specs/npm_tests/translate_cjs_to_esm/translate_cjs_to_esm/main.out rename to tests/specs/npm/translate_cjs_to_esm/translate_cjs_to_esm/main.out diff --git a/tests/specs/npm_tests/types_ambient_module/__test__.jsonc b/tests/specs/npm/types_ambient_module/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/types_ambient_module/__test__.jsonc rename to tests/specs/npm/types_ambient_module/__test__.jsonc diff --git a/tests/specs/npm_tests/types_ambient_module/types_ambient_module/import_map.json b/tests/specs/npm/types_ambient_module/types_ambient_module/import_map.json similarity index 100% rename from tests/specs/npm_tests/types_ambient_module/types_ambient_module/import_map.json rename to tests/specs/npm/types_ambient_module/types_ambient_module/import_map.json diff --git a/tests/specs/npm_tests/types_ambient_module/types_ambient_module/main.out b/tests/specs/npm/types_ambient_module/types_ambient_module/main.out similarity index 100% rename from tests/specs/npm_tests/types_ambient_module/types_ambient_module/main.out rename to tests/specs/npm/types_ambient_module/types_ambient_module/main.out diff --git a/tests/specs/npm_tests/types_ambient_module/types_ambient_module/main.ts b/tests/specs/npm/types_ambient_module/types_ambient_module/main.ts similarity index 100% rename from tests/specs/npm_tests/types_ambient_module/types_ambient_module/main.ts rename to tests/specs/npm/types_ambient_module/types_ambient_module/main.ts diff --git a/tests/specs/npm_tests/types_ambient_module/types_ambient_module/main_import_map.out b/tests/specs/npm/types_ambient_module/types_ambient_module/main_import_map.out similarity index 100% rename from tests/specs/npm_tests/types_ambient_module/types_ambient_module/main_import_map.out rename to tests/specs/npm/types_ambient_module/types_ambient_module/main_import_map.out diff --git a/tests/specs/npm_tests/types_ambient_module/types_ambient_module/main_import_map.ts b/tests/specs/npm/types_ambient_module/types_ambient_module/main_import_map.ts similarity index 100% rename from tests/specs/npm_tests/types_ambient_module/types_ambient_module/main_import_map.ts rename to tests/specs/npm/types_ambient_module/types_ambient_module/main_import_map.ts diff --git a/tests/specs/npm_tests/types_ambient_module_import_map/__test__.jsonc b/tests/specs/npm/types_ambient_module_import_map/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/types_ambient_module_import_map/__test__.jsonc rename to tests/specs/npm/types_ambient_module_import_map/__test__.jsonc diff --git a/tests/specs/npm_tests/types_ambient_module_import_map/types_ambient_module/import_map.json b/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/import_map.json similarity index 100% rename from tests/specs/npm_tests/types_ambient_module_import_map/types_ambient_module/import_map.json rename to tests/specs/npm/types_ambient_module_import_map/types_ambient_module/import_map.json diff --git a/tests/specs/npm_tests/types_ambient_module_import_map/types_ambient_module/main.out b/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main.out similarity index 100% rename from tests/specs/npm_tests/types_ambient_module_import_map/types_ambient_module/main.out rename to tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main.out diff --git a/tests/specs/npm_tests/types_ambient_module_import_map/types_ambient_module/main.ts b/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main.ts similarity index 100% rename from tests/specs/npm_tests/types_ambient_module_import_map/types_ambient_module/main.ts rename to tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main.ts diff --git a/tests/specs/npm_tests/types_ambient_module_import_map/types_ambient_module/main_import_map.out b/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main_import_map.out similarity index 100% rename from tests/specs/npm_tests/types_ambient_module_import_map/types_ambient_module/main_import_map.out rename to tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main_import_map.out diff --git a/tests/specs/npm_tests/types_ambient_module_import_map/types_ambient_module/main_import_map.ts b/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main_import_map.ts similarity index 100% rename from tests/specs/npm_tests/types_ambient_module_import_map/types_ambient_module/main_import_map.ts rename to tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main_import_map.ts diff --git a/tests/specs/npm_tests/types_d_ext/__test__.jsonc b/tests/specs/npm/types_d_ext/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/types_d_ext/__test__.jsonc rename to tests/specs/npm/types_d_ext/__test__.jsonc diff --git a/tests/specs/npm_tests/types_d_ext/d_ext/main.out b/tests/specs/npm/types_d_ext/d_ext/main.out similarity index 100% rename from tests/specs/npm_tests/types_d_ext/d_ext/main.out rename to tests/specs/npm/types_d_ext/d_ext/main.out diff --git a/tests/specs/npm_tests/types_d_ext/d_ext/main.ts b/tests/specs/npm/types_d_ext/d_ext/main.ts similarity index 100% rename from tests/specs/npm_tests/types_d_ext/d_ext/main.ts rename to tests/specs/npm/types_d_ext/d_ext/main.ts diff --git a/tests/specs/npm_tests/types_entry_value_not_exists/__test__.jsonc b/tests/specs/npm/types_entry_value_not_exists/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/types_entry_value_not_exists/__test__.jsonc rename to tests/specs/npm/types_entry_value_not_exists/__test__.jsonc diff --git a/tests/specs/npm_tests/types_entry_value_not_exists/types_entry_value_not_exists/main.out b/tests/specs/npm/types_entry_value_not_exists/types_entry_value_not_exists/main.out similarity index 100% rename from tests/specs/npm_tests/types_entry_value_not_exists/types_entry_value_not_exists/main.out rename to tests/specs/npm/types_entry_value_not_exists/types_entry_value_not_exists/main.out diff --git a/tests/specs/npm_tests/types_entry_value_not_exists/types_entry_value_not_exists/main.ts b/tests/specs/npm/types_entry_value_not_exists/types_entry_value_not_exists/main.ts similarity index 100% rename from tests/specs/npm_tests/types_entry_value_not_exists/types_entry_value_not_exists/main.ts rename to tests/specs/npm/types_entry_value_not_exists/types_entry_value_not_exists/main.ts diff --git a/tests/specs/npm_tests/types_exports_import_types/__test__.jsonc b/tests/specs/npm/types_exports_import_types/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/types_exports_import_types/__test__.jsonc rename to tests/specs/npm/types_exports_import_types/__test__.jsonc diff --git a/tests/specs/npm_tests/types_exports_import_types/types_exports_import_types/main.out b/tests/specs/npm/types_exports_import_types/types_exports_import_types/main.out similarity index 100% rename from tests/specs/npm_tests/types_exports_import_types/types_exports_import_types/main.out rename to tests/specs/npm/types_exports_import_types/types_exports_import_types/main.out diff --git a/tests/specs/npm_tests/types_exports_import_types/types_exports_import_types/main.ts b/tests/specs/npm/types_exports_import_types/types_exports_import_types/main.ts similarity index 100% rename from tests/specs/npm_tests/types_exports_import_types/types_exports_import_types/main.ts rename to tests/specs/npm/types_exports_import_types/types_exports_import_types/main.ts diff --git a/tests/specs/npm_tests/types_no_types_entry/__test__.jsonc b/tests/specs/npm/types_no_types_entry/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/types_no_types_entry/__test__.jsonc rename to tests/specs/npm/types_no_types_entry/__test__.jsonc diff --git a/tests/specs/npm_tests/types_no_types_entry/types_no_types_entry/main.out b/tests/specs/npm/types_no_types_entry/types_no_types_entry/main.out similarity index 100% rename from tests/specs/npm_tests/types_no_types_entry/types_no_types_entry/main.out rename to tests/specs/npm/types_no_types_entry/types_no_types_entry/main.out diff --git a/tests/specs/npm_tests/types_no_types_entry/types_no_types_entry/main.ts b/tests/specs/npm/types_no_types_entry/types_no_types_entry/main.ts similarity index 100% rename from tests/specs/npm_tests/types_no_types_entry/types_no_types_entry/main.ts rename to tests/specs/npm/types_no_types_entry/types_no_types_entry/main.ts diff --git a/tests/specs/npm_tests/typescript_file_in_package/__test__.jsonc b/tests/specs/npm/typescript_file_in_package/__test__.jsonc similarity index 100% rename from tests/specs/npm_tests/typescript_file_in_package/__test__.jsonc rename to tests/specs/npm/typescript_file_in_package/__test__.jsonc diff --git a/tests/specs/npm_tests/typescript_file_in_package/typescript_file_in_package/main.out b/tests/specs/npm/typescript_file_in_package/typescript_file_in_package/main.out similarity index 100% rename from tests/specs/npm_tests/typescript_file_in_package/typescript_file_in_package/main.out rename to tests/specs/npm/typescript_file_in_package/typescript_file_in_package/main.out diff --git a/tests/specs/npm_tests/typescript_file_in_package/typescript_file_in_package/main.ts b/tests/specs/npm/typescript_file_in_package/typescript_file_in_package/main.ts similarity index 100% rename from tests/specs/npm_tests/typescript_file_in_package/typescript_file_in_package/main.ts rename to tests/specs/npm/typescript_file_in_package/typescript_file_in_package/main.ts diff --git a/tests/specs/permission/allow_import/__test__.jsonc b/tests/specs/permission/allow_import/__test__.jsonc new file mode 100644 index 0000000000..21a3cb7b59 --- /dev/null +++ b/tests/specs/permission/allow_import/__test__.jsonc @@ -0,0 +1,52 @@ +{ + "tests": { + "info": { + "args": "info main.ts", + "output": "info.out" + }, + "cache": { + "args": "cache main.ts", + "output": "cache.out", + "exitCode": 1 + }, + "check": { + "args": "check main.ts", + "output": "check.out", + "exitCode": 1 + }, + "compile": { + "args": "compile main.ts", + "output": "compile.out", + "exitCode": 1 + }, + "doc": { + "args": "doc doc.ts", + "output": "doc.out", + "exitCode": 0 + }, + "doc_allowed": { + "args": "doc --allow-import doc.ts", + "output": "doc_allowed.out", + "exitCode": 0 + }, + "run": { + "args": "run main.ts", + "output": "run.out", + "exitCode": 1 + }, + "serve": { + "args": "serve main.ts", + "output": "serve.out", + "exitCode": 1 + }, + "builtin_host": { + "args": "run --quiet builtin_host.ts", + "output": "3\n" + }, + "builtin_host_replaced": { + "args": "run --quiet --allow-import=other.host builtin_host.ts", + "output": "[WILDCARD]Requires import access[WILDCARD]", + "exitCode": 1 + } + } +} diff --git a/tests/specs/permission/allow_import/builtin_host.ts b/tests/specs/permission/allow_import/builtin_host.ts new file mode 100644 index 0000000000..a3ca2df76a --- /dev/null +++ b/tests/specs/permission/allow_import/builtin_host.ts @@ -0,0 +1,4 @@ +// this is the JSR url for the test server +import { add } from "http://127.0.0.1:4250/@denotest/add/1.0.0/mod.ts"; + +console.log(add(1, 2)); diff --git a/tests/specs/permission/allow_import/cache.out b/tests/specs/permission/allow_import/cache.out new file mode 100644 index 0000000000..da40ede3a8 --- /dev/null +++ b/tests/specs/permission/allow_import/cache.out @@ -0,0 +1,2 @@ +error: Requires import access to "example.com:443", run again with the --allow-import flag + at file:///[WILDLINE]/main.ts:1:8 diff --git a/tests/specs/permission/allow_import/check.out b/tests/specs/permission/allow_import/check.out new file mode 100644 index 0000000000..da40ede3a8 --- /dev/null +++ b/tests/specs/permission/allow_import/check.out @@ -0,0 +1,2 @@ +error: Requires import access to "example.com:443", run again with the --allow-import flag + at file:///[WILDLINE]/main.ts:1:8 diff --git a/tests/specs/permission/allow_import/compile.out b/tests/specs/permission/allow_import/compile.out new file mode 100644 index 0000000000..da40ede3a8 --- /dev/null +++ b/tests/specs/permission/allow_import/compile.out @@ -0,0 +1,2 @@ +error: Requires import access to "example.com:443", run again with the --allow-import flag + at file:///[WILDLINE]/main.ts:1:8 diff --git a/tests/specs/permission/allow_import/doc.out b/tests/specs/permission/allow_import/doc.out new file mode 100644 index 0000000000..bc748d7260 --- /dev/null +++ b/tests/specs/permission/allow_import/doc.out @@ -0,0 +1,6 @@ +[# todo(dsherret): we should probably at least show a warning here] +Defined in file:///[WILDLINE]/doc.ts:3:1 + +class Test + + diff --git a/tests/specs/permission/allow_import/doc.ts b/tests/specs/permission/allow_import/doc.ts new file mode 100644 index 0000000000..622506c9bf --- /dev/null +++ b/tests/specs/permission/allow_import/doc.ts @@ -0,0 +1,3 @@ +export * from "http://localhost:4545/add.ts"; + +export class Test {} diff --git a/tests/specs/permission/allow_import/doc_allowed.out b/tests/specs/permission/allow_import/doc_allowed.out new file mode 100644 index 0000000000..61886be383 --- /dev/null +++ b/tests/specs/permission/allow_import/doc_allowed.out @@ -0,0 +1,10 @@ +Download http://localhost:4545/add.ts +Defined in http://localhost:4545/add.ts:1:1 + +function add(a: number, b: number): number + +Defined in file:///[WILDLINE]/doc.ts:3:1 + +class Test + + diff --git a/tests/specs/permission/allow_import/info.out b/tests/specs/permission/allow_import/info.out new file mode 100644 index 0000000000..2e364ff278 --- /dev/null +++ b/tests/specs/permission/allow_import/info.out @@ -0,0 +1,7 @@ +local: [WILDLINE]main.ts +type: TypeScript +dependencies: 0 unique +size: [WILDLINE] + +file:///[WILDLINE]/main.ts ([WILDLINE]) +└── https://example.com/malicious_string (not capable, requires --allow-import) diff --git a/tests/specs/permission/allow_import/main.ts b/tests/specs/permission/allow_import/main.ts new file mode 100644 index 0000000000..8dfed682e4 --- /dev/null +++ b/tests/specs/permission/allow_import/main.ts @@ -0,0 +1 @@ +import "https://example.com/malicious_string"; diff --git a/tests/specs/permission/allow_import/run.out b/tests/specs/permission/allow_import/run.out new file mode 100644 index 0000000000..da40ede3a8 --- /dev/null +++ b/tests/specs/permission/allow_import/run.out @@ -0,0 +1,2 @@ +error: Requires import access to "example.com:443", run again with the --allow-import flag + at file:///[WILDLINE]/main.ts:1:8 diff --git a/tests/specs/permission/allow_import/serve.out b/tests/specs/permission/allow_import/serve.out new file mode 100644 index 0000000000..da40ede3a8 --- /dev/null +++ b/tests/specs/permission/allow_import/serve.out @@ -0,0 +1,2 @@ +error: Requires import access to "example.com:443", run again with the --allow-import flag + at file:///[WILDLINE]/main.ts:1:8 diff --git a/tests/specs/permission/allow_import_jsx/__test__.jsonc b/tests/specs/permission/allow_import_jsx/__test__.jsonc new file mode 100644 index 0000000000..cb80deb72c --- /dev/null +++ b/tests/specs/permission/allow_import_jsx/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run main.tsx", + "output": "main.out", + "exitCode": 1 +} diff --git a/tests/specs/permission/allow_import_jsx/deno.jsonc b/tests/specs/permission/allow_import_jsx/deno.jsonc new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/permission/allow_import_jsx/deno.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/permission/allow_import_jsx/main.out b/tests/specs/permission/allow_import_jsx/main.out new file mode 100644 index 0000000000..fda79f89d2 --- /dev/null +++ b/tests/specs/permission/allow_import_jsx/main.out @@ -0,0 +1,3 @@ +[# do not allow exfiltrating data via the deno.json] +error: Requires import access to "localhost:4545", run again with the --allow-import flag + at file:///[WILDLINE]/main.tsx:1:1 diff --git a/tests/specs/permission/allow_import_jsx/main.tsx b/tests/specs/permission/allow_import_jsx/main.tsx new file mode 100644 index 0000000000..f03d10c5b0 --- /dev/null +++ b/tests/specs/permission/allow_import_jsx/main.tsx @@ -0,0 +1,3 @@ +export function Component() { + return
Hi
; +} diff --git a/tests/specs/permission/allow_import_main_module/__test__.jsonc b/tests/specs/permission/allow_import_main_module/__test__.jsonc new file mode 100644 index 0000000000..c0a92bfc31 --- /dev/null +++ b/tests/specs/permission/allow_import_main_module/__test__.jsonc @@ -0,0 +1,17 @@ +{ + // won't need --allow-import because it's implied from the main module + "tests": { + "run": { + "args": "run http://localhost:4545/run/002_hello.ts", + "output": "Download http://localhost:4545/run/002_hello.ts\nHello World\n" + }, + "cache": { + "args": "cache http://localhost:4545/run/002_hello.ts", + "output": "Download http://localhost:4545/run/002_hello.ts\n" + }, + "check": { + "args": "check http://localhost:4545/run/002_hello.ts", + "output": "Download http://localhost:4545/run/002_hello.ts\nCheck http://localhost:4545/run/002_hello.ts\n" + } + } +} diff --git a/tests/specs/permission/allow_import_not_on_redirect/__test__.jsonc b/tests/specs/permission/allow_import_not_on_redirect/__test__.jsonc new file mode 100644 index 0000000000..b05d0c0cbd --- /dev/null +++ b/tests/specs/permission/allow_import_not_on_redirect/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --allow-import=localhost:4547 --quiet --reload main.js", + "output": "main.out", + "exitCode": 1 +} diff --git a/tests/specs/permission/allow_import_not_on_redirect/main.js b/tests/specs/permission/allow_import_not_on_redirect/main.js new file mode 100644 index 0000000000..226a6b622c --- /dev/null +++ b/tests/specs/permission/allow_import_not_on_redirect/main.js @@ -0,0 +1,2 @@ +import { value } from "http://localhost:4547/redirects/redirect3.js"; +console.log(value); diff --git a/tests/specs/permission/allow_import_not_on_redirect/main.out b/tests/specs/permission/allow_import_not_on_redirect/main.out new file mode 100644 index 0000000000..3cab01e14c --- /dev/null +++ b/tests/specs/permission/allow_import_not_on_redirect/main.out @@ -0,0 +1,2 @@ +error: Requires import access to "localhost:4545", run again with the --allow-import flag + at file:///[WILDLINE]/main.js:1:23 diff --git a/tests/specs/publish/banned_triple_slash_directives/publish.out b/tests/specs/publish/banned_triple_slash_directives/publish.out index f1827538ae..ab5db6f6e1 100644 --- a/tests/specs/publish/banned_triple_slash_directives/publish.out +++ b/tests/specs/publish/banned_triple_slash_directives/publish.out @@ -1,6 +1,5 @@ Check file:///[WILDLINE]/mod.ts Checking for slow types in the public API... -Check file:///[WILDLINE]/mod.ts error[banned-triple-slash-directives]: triple slash directives that modify globals are not allowed --> [WILDLINE]mod.ts:1:1 | diff --git a/tests/specs/publish/invalid_import/invalid_import.out b/tests/specs/publish/invalid_import/invalid_import.out index 929fc72cd3..6914dc51e0 100644 --- a/tests/specs/publish/invalid_import/invalid_import.out +++ b/tests/specs/publish/invalid_import/invalid_import.out @@ -1,10 +1,7 @@ -Download http://localhost:4545/welcome.ts -Download http://localhost:4545/echo.ts +[# notice that the remote module is not downloaded here. This is so we do not need to add an --allow-import permission here] Download http://localhost:4260/chalk Download http://localhost:4260/chalk/chalk-5.0.1.tgz -Check file:///[WILDCARD]/mod.ts Checking for slow types in the public API... -Check file://[WILDCARD]mod.ts error[invalid-external-import]: invalid import to a non-JSR 'http' specifier --> [WILDCARD]mod.ts:1:8 | diff --git a/tests/specs/publish/invalid_import_esm_sh_suggestion/invalid_import_esm_sh_suggestion.out b/tests/specs/publish/invalid_import_esm_sh_suggestion/invalid_import_esm_sh_suggestion.out index a7235cbf16..b0a544df89 100644 --- a/tests/specs/publish/invalid_import_esm_sh_suggestion/invalid_import_esm_sh_suggestion.out +++ b/tests/specs/publish/invalid_import_esm_sh_suggestion/invalid_import_esm_sh_suggestion.out @@ -1,7 +1,4 @@ -[WILDCARD] -Check file:///[WILDCARD]/mod.ts Checking for slow types in the public API... -Check file:///[WILDCARD]mod.ts error[invalid-external-import]: invalid import to a non-JSR 'http' specifier --> [WILDCARD]mod.ts:1:8 | diff --git a/tests/specs/publish/missing_constraint/publish.out b/tests/specs/publish/missing_constraint/publish.out index 601035b059..d9fb6408fb 100644 --- a/tests/specs/publish/missing_constraint/publish.out +++ b/tests/specs/publish/missing_constraint/publish.out @@ -1,6 +1,22 @@ -[WILDCARD] -Checking for slow types in the public API... +[UNORDERED_START] +Download http://127.0.0.1:4250/@denotest/add/meta.json +Download http://127.0.0.1:4250/@denotest/deps/meta.json +Download http://localhost:4260/@denotest/esm-basic +Download http://127.0.0.1:4250/@denotest/add/1.0.0_meta.json +Download http://127.0.0.1:4250/@denotest/deps/1.0.0_meta.json +Download http://127.0.0.1:4250/@denotest/module-graph/meta.json +Download http://127.0.0.1:4250/@denotest/no-module-graph/meta.json +Download http://127.0.0.1:4250/@denotest/module-graph/1.4.0_meta.json +Download http://127.0.0.1:4250/@denotest/no-module-graph/0.1.1_meta.json +Download http://127.0.0.1:4250/@denotest/no-module-graph/0.1.1/mod.ts +Download http://127.0.0.1:4250/@denotest/no-module-graph/0.1.1/TestClass.ts +Download http://127.0.0.1:4250/@denotest/add/1.0.0/mod.ts +Download http://127.0.0.1:4250/@denotest/deps/1.0.0/mod.ts +Download http://127.0.0.1:4250/@denotest/module-graph/1.4.0/other.ts +Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz +[UNORDERED_END] Check file:///[WILDLINE]/mod.ts +Checking for slow types in the public API... error[missing-constraint]: specifier 'jsr:@denotest/add' is missing a version constraint --> [WILDLINE]mod.ts:[WILDLINE] | diff --git a/tests/specs/publish/missing_constraint_jsx_import_source/mod.out b/tests/specs/publish/missing_constraint_jsx_import_source/mod.out index d1da06be81..fa06d8c389 100644 --- a/tests/specs/publish/missing_constraint_jsx_import_source/mod.out +++ b/tests/specs/publish/missing_constraint_jsx_import_source/mod.out @@ -1,6 +1,13 @@ -[WILDCARD] +[UNORDERED_START] +Download http://localhost:4260/preact +Download http://localhost:4260/preact-render-to-string +Download http://localhost:4260/pretty-format +Download http://localhost:4260/preact-render-to-string/preact-render-to-string-6.4.0.tgz +Download http://localhost:4260/preact/preact-10.19.6.tgz +Download http://localhost:4260/pretty-format/pretty-format-3.8.0.tgz +[UNORDERED_END] +Check file:///[WILDLINE]/mod.ts Checking for slow types in the public API... -Check file:///[WILDCARD]/mod.ts error[missing-constraint]: specifier 'npm:preact/jsx-runtime' is missing a version constraint --> [WILDLINE] = hint: specify a version constraint for the specifier diff --git a/tests/specs/publish/prefer_fast_check_graph/main.out b/tests/specs/publish/prefer_fast_check_graph/main.out index 64296206f0..dd7d052c92 100644 --- a/tests/specs/publish/prefer_fast_check_graph/main.out +++ b/tests/specs/publish/prefer_fast_check_graph/main.out @@ -1,7 +1,4 @@ -[WILDCARD] -Check [WILDLINE]/tests/specs/publish/prefer_fast_check_graph/mod.ts Checking for slow types in the public API... -Check [WILDLINE]/tests/specs/publish/prefer_fast_check_graph/mod.ts error[invalid-external-import]: invalid import to a non-JSR 'https' specifier --> [WILDLINE]deps.ts:1:15 | diff --git a/tests/specs/run/redirect_javascript/__test__.jsonc b/tests/specs/run/redirect_javascript/__test__.jsonc index 1fd0b4cb12..d999a67f91 100644 --- a/tests/specs/run/redirect_javascript/__test__.jsonc +++ b/tests/specs/run/redirect_javascript/__test__.jsonc @@ -1,4 +1,4 @@ { - "args": "run --quiet --reload main.js", + "args": "run --allow-import --quiet --reload main.js", "output": "main.out" } diff --git a/tests/specs/test/check_local_by_default/__test__.jsonc b/tests/specs/test/check_local_by_default/__test__.jsonc index 602250082b..138d007adb 100644 --- a/tests/specs/test/check_local_by_default/__test__.jsonc +++ b/tests/specs/test/check_local_by_default/__test__.jsonc @@ -1,4 +1,4 @@ { - "args": "test --quiet main.ts", + "args": "test --allow-import --quiet main.ts", "output": "main.out" } diff --git a/tests/specs/test/check_local_by_default2/__test__.jsonc b/tests/specs/test/check_local_by_default2/__test__.jsonc index 59774f938a..79068d63f0 100644 --- a/tests/specs/test/check_local_by_default2/__test__.jsonc +++ b/tests/specs/test/check_local_by_default2/__test__.jsonc @@ -1,5 +1,5 @@ { - "args": "test --quiet main.ts", + "args": "test --allow-import --quiet main.ts", "output": "main.out", "exitCode": 1 } diff --git a/tests/specs/worker/error_worker_permissions_remote/__test__.jsonc b/tests/specs/worker/error_worker_permissions_remote/__test__.jsonc index 06a439fd47..d40e31a49f 100644 --- a/tests/specs/worker/error_worker_permissions_remote/__test__.jsonc +++ b/tests/specs/worker/error_worker_permissions_remote/__test__.jsonc @@ -1,5 +1,5 @@ { - "args": "run --reload error_worker_permissions_remote.ts", + "args": "run --reload --allow-import=other.host error_worker_permissions_remote.ts", "output": "error_worker_permissions_remote.ts.out", "exitCode": 1 } diff --git a/tests/specs/worker/error_worker_permissions_remote/error_worker_permissions_remote.ts.out b/tests/specs/worker/error_worker_permissions_remote/error_worker_permissions_remote.ts.out index afecff0a88..8019bb46d1 100644 --- a/tests/specs/worker/error_worker_permissions_remote/error_worker_permissions_remote.ts.out +++ b/tests/specs/worker/error_worker_permissions_remote/error_worker_permissions_remote.ts.out @@ -1,2 +1,2 @@ -error: Uncaught (in worker "") Requires net access to "localhost:4545", run again with the --allow-net flag +error: Uncaught (in worker "") Requires import access to "localhost:4545", run again with the --allow-import flag [WILDCARD] diff --git a/tests/specs/worker/worker_permissions_blob_remote/permissions_blob_remote.ts.out b/tests/specs/worker/worker_permissions_blob_remote/permissions_blob_remote.ts.out index 6dc4f0f5fa..67b817d6df 100644 --- a/tests/specs/worker/worker_permissions_blob_remote/permissions_blob_remote.ts.out +++ b/tests/specs/worker/worker_permissions_blob_remote/permissions_blob_remote.ts.out @@ -1,4 +1,4 @@ -error: Uncaught (in worker "") Requires net access to "example.com:443", run again with the --allow-net flag +error: Uncaught (in worker "") Requires import access to "example.com:443", run again with the --allow-import flag at blob:null/[WILDCARD]:1:8 error: Uncaught (in promise) Error: Unhandled error in child worker. at Worker.#pollControl[WILDCARD] diff --git a/tests/specs/worker/worker_permissions_data_remote/permissions_data_remote.ts.out b/tests/specs/worker/worker_permissions_data_remote/permissions_data_remote.ts.out index e7af110bb5..0f5a994345 100644 --- a/tests/specs/worker/worker_permissions_data_remote/permissions_data_remote.ts.out +++ b/tests/specs/worker/worker_permissions_data_remote/permissions_data_remote.ts.out @@ -1,4 +1,4 @@ -error: Uncaught (in worker "") Requires net access to "example.com:443", run again with the --allow-net flag +error: Uncaught (in worker "") Requires import access to "example.com:443", run again with the --allow-import flag at data:application/javascript;base64,aW1wb3J0ICJodHRwczovL2V4YW1wbGUuY29tL3NvbWUvZmlsZS50cyI7:1:8 error: Uncaught (in promise) Error: Unhandled error in child worker. at Worker.#pollControl[WILDCARD] diff --git a/tests/specs/worker/worker_permissions_dynamic_remote/__test__.jsonc b/tests/specs/worker/worker_permissions_dynamic_remote/__test__.jsonc index 8343b17f69..498d9d5079 100644 --- a/tests/specs/worker/worker_permissions_dynamic_remote/__test__.jsonc +++ b/tests/specs/worker/worker_permissions_dynamic_remote/__test__.jsonc @@ -1,5 +1,5 @@ { - "args": "run --quiet --reload --allow-net --unstable-worker-options ../../../testdata/workers/permissions_dynamic_remote.ts", - "output": "../../../testdata/workers/permissions_dynamic_remote.ts.out", + "args": "run --quiet --reload --allow-import --unstable-worker-options permissions_dynamic_remote.ts", + "output": "permissions_dynamic_remote.ts.out", "exitCode": 1 } diff --git a/tests/testdata/workers/permissions_dynamic_remote.ts b/tests/specs/worker/worker_permissions_dynamic_remote/permissions_dynamic_remote.ts similarity index 64% rename from tests/testdata/workers/permissions_dynamic_remote.ts rename to tests/specs/worker/worker_permissions_dynamic_remote/permissions_dynamic_remote.ts index 54a361bc00..5f0fdf7a17 100644 --- a/tests/testdata/workers/permissions_dynamic_remote.ts +++ b/tests/specs/worker/worker_permissions_dynamic_remote/permissions_dynamic_remote.ts @@ -4,7 +4,8 @@ new Worker( type: "module", deno: { permissions: { - net: false, + // dynamic_remote.ts will import from example.com + import: false, }, }, }, diff --git a/tests/testdata/workers/permissions_dynamic_remote.ts.out b/tests/specs/worker/worker_permissions_dynamic_remote/permissions_dynamic_remote.ts.out similarity index 80% rename from tests/testdata/workers/permissions_dynamic_remote.ts.out rename to tests/specs/worker/worker_permissions_dynamic_remote/permissions_dynamic_remote.ts.out index 4fb2c2234f..fa4232efd0 100644 --- a/tests/testdata/workers/permissions_dynamic_remote.ts.out +++ b/tests/specs/worker/worker_permissions_dynamic_remote/permissions_dynamic_remote.ts.out @@ -1,4 +1,4 @@ -error: Uncaught (in worker "") (in promise) TypeError: Requires net access to "example.com:443", run again with the --allow-net flag +error: Uncaught (in worker "") (in promise) TypeError: Requires import access to "example.com:443", run again with the --allow-import flag await import("" + "https://example.com/some/file.ts"); ^ at async http://localhost:4545/workers/dynamic_remote.ts:2:1 diff --git a/tests/specs/worker/worker_permissions_remote_remote/__test__.jsonc b/tests/specs/worker/worker_permissions_remote_remote/__test__.jsonc index 8cf7001586..00fd2a6e4c 100644 --- a/tests/specs/worker/worker_permissions_remote_remote/__test__.jsonc +++ b/tests/specs/worker/worker_permissions_remote_remote/__test__.jsonc @@ -1,5 +1,5 @@ { - "args": "run --quiet --reload --allow-net=localhost:4545 ../../../testdata/workers/permissions_remote_remote.ts", + "args": "run --quiet --reload --allow-import=localhost:4545 permissions_remote_remote.ts", "output": "permissions_remote_remote.ts.out", "exitCode": 1 } diff --git a/tests/testdata/workers/permissions_remote_remote.ts b/tests/specs/worker/worker_permissions_remote_remote/permissions_remote_remote.ts similarity index 100% rename from tests/testdata/workers/permissions_remote_remote.ts rename to tests/specs/worker/worker_permissions_remote_remote/permissions_remote_remote.ts diff --git a/tests/specs/worker/worker_permissions_remote_remote/permissions_remote_remote.ts.out b/tests/specs/worker/worker_permissions_remote_remote/permissions_remote_remote.ts.out index e5bdfc2dc1..423120bb0c 100644 --- a/tests/specs/worker/worker_permissions_remote_remote/permissions_remote_remote.ts.out +++ b/tests/specs/worker/worker_permissions_remote_remote/permissions_remote_remote.ts.out @@ -1,4 +1,4 @@ -error: Uncaught (in worker "") Requires net access to "example.com:443", run again with the --allow-net flag +error: Uncaught (in worker "") Requires import access to "example.com:443", run again with the --allow-import flag at http://localhost:4545/[WILDCARD]/static_remote.ts:2:8 error: Uncaught (in promise) Error: Unhandled error in child worker. at Worker.#pollControl [WILDCARD] diff --git a/tests/testdata/add.ts b/tests/testdata/add.ts new file mode 100644 index 0000000000..8d9b8a22a1 --- /dev/null +++ b/tests/testdata/add.ts @@ -0,0 +1,3 @@ +export function add(a: number, b: number): number { + return a + b; +} diff --git a/tests/testdata/dynamic_import/permissions_blob_local.ts b/tests/testdata/dynamic_import/permissions_blob_local.ts index 9ef4158ce9..865c1777a9 100644 --- a/tests/testdata/dynamic_import/permissions_blob_local.ts +++ b/tests/testdata/dynamic_import/permissions_blob_local.ts @@ -1,4 +1,4 @@ -// This file doesn't really exist, but it doesn't matter, a "PermissionsDenied" error should be thrown. +// This file doesn't really exist, but it doesn't matter, a "NotCapable" error should be thrown. const code = `import "file:///${ Deno.build.os == "windows" ? "C:/" : "" }local_file.ts";`; diff --git a/tests/testdata/dynamic_import/permissions_blob_remote.ts b/tests/testdata/dynamic_import/permissions_blob_remote.ts index 1e2c8c21a4..569b1f84c5 100644 --- a/tests/testdata/dynamic_import/permissions_blob_remote.ts +++ b/tests/testdata/dynamic_import/permissions_blob_remote.ts @@ -1,4 +1,3 @@ -// This file doesn't really exist, but it doesn't matter, a "PermissionsDenied" error should be thrown. const code = `import "https://example.com/some/file.ts";`; const blob = new Blob([code]); await import(URL.createObjectURL(blob)); diff --git a/tests/testdata/dynamic_import/permissions_blob_remote.ts.out b/tests/testdata/dynamic_import/permissions_blob_remote.ts.out index f436a5eb84..20b6839e4c 100644 --- a/tests/testdata/dynamic_import/permissions_blob_remote.ts.out +++ b/tests/testdata/dynamic_import/permissions_blob_remote.ts.out @@ -1,5 +1,5 @@ -error: Uncaught (in promise) TypeError: Requires net access to "example.com:443", run again with the --allow-net flag +error: Uncaught (in promise) TypeError: Requires import access to "example.com:443", run again with the --allow-import flag at blob:null/[WILDCARD]:1:8 await import(URL.createObjectURL(blob)); ^ - at async file:///[WILDCARD]/dynamic_import/permissions_blob_remote.ts:4:1 + at async file:///[WILDCARD]/dynamic_import/permissions_blob_remote.ts:3:1 diff --git a/tests/testdata/dynamic_import/permissions_data_local.ts b/tests/testdata/dynamic_import/permissions_data_local.ts index be4fc1c346..01bff7d7a2 100644 --- a/tests/testdata/dynamic_import/permissions_data_local.ts +++ b/tests/testdata/dynamic_import/permissions_data_local.ts @@ -1,4 +1,4 @@ -// This file doesn't really exist, but it doesn't matter, a "PermissionsDenied" error should be thrown. +// This file doesn't really exist, but it doesn't matter, a "NotCapable" error should be thrown. const code = `import "file:///${ Deno.build.os == "windows" ? "C:/" : "" }local_file.ts";`; diff --git a/tests/testdata/dynamic_import/permissions_data_remote.ts.out b/tests/testdata/dynamic_import/permissions_data_remote.ts.out index 00248e2778..67c8512050 100644 --- a/tests/testdata/dynamic_import/permissions_data_remote.ts.out +++ b/tests/testdata/dynamic_import/permissions_data_remote.ts.out @@ -1,4 +1,4 @@ -error: Uncaught (in promise) TypeError: Requires net access to "example.com:443", run again with the --allow-net flag +error: Uncaught (in promise) TypeError: Requires import access to "example.com:443", run again with the --allow-import flag at data:application/javascript;base64,aW1wb3J0ICJodHRwczovL2V4YW1wbGUuY29tL3NvbWUvZmlsZS50cyI7:1:8 await import(`data:application/javascript;base64,${btoa(code)}`); ^ diff --git a/tests/testdata/dynamic_import/permissions_remote_remote.ts.out b/tests/testdata/dynamic_import/permissions_remote_remote.ts.out index 0e8b0fc1f1..2676d7551f 100644 --- a/tests/testdata/dynamic_import/permissions_remote_remote.ts.out +++ b/tests/testdata/dynamic_import/permissions_remote_remote.ts.out @@ -1,4 +1,4 @@ -error: Uncaught (in promise) TypeError: Requires net access to "example.com:443", run again with the --allow-net flag +error: Uncaught (in promise) TypeError: Requires import access to "example.com:443", run again with the --allow-import flag at http://localhost:4545/dynamic_import/static_remote.ts:2:8 await import( ^ diff --git a/tests/testdata/run/error_015_dynamic_import_permissions.js b/tests/testdata/run/error_015_dynamic_import_permissions.js index 47961cf63b..bdf423b59c 100644 --- a/tests/testdata/run/error_015_dynamic_import_permissions.js +++ b/tests/testdata/run/error_015_dynamic_import_permissions.js @@ -1,3 +1,3 @@ (async () => { - await import("" + "http://localhost:4545/subdir/mod4.js"); + await import("" + "http://example.com/subdir/mod4.js"); })(); diff --git a/tests/testdata/run/error_015_dynamic_import_permissions.out b/tests/testdata/run/error_015_dynamic_import_permissions.out index 87ce43e9cd..15c26b4251 100644 --- a/tests/testdata/run/error_015_dynamic_import_permissions.out +++ b/tests/testdata/run/error_015_dynamic_import_permissions.out @@ -1,4 +1,4 @@ -error: Uncaught (in promise) TypeError: Requires net access to "localhost:4545", run again with the --allow-net flag - await import("" + "http://localhost:4545/subdir/mod4.js"); +error: Uncaught (in promise) TypeError: Requires import access to "example.com:80", run again with the --allow-import flag + await import("" + "http://example.com/subdir/mod4.js"); ^ at async file://[WILDCARD]/error_015_dynamic_import_permissions.js:2:3 diff --git a/tests/testdata/run/lock_write_fetch/main.ts b/tests/testdata/run/lock_write_fetch/main.ts index 4ce6313119..d8a50a9aa6 100644 --- a/tests/testdata/run/lock_write_fetch/main.ts +++ b/tests/testdata/run/lock_write_fetch/main.ts @@ -9,6 +9,7 @@ const fetchProc = await new Deno.Command(Deno.execPath(), { stderr: "null", args: [ "cache", + "--allow-import", "--reload", "--lock=lock_write_fetch.json", "--cert=tls/RootCA.pem", @@ -23,6 +24,7 @@ const fetchCheckProc = await new Deno.Command(Deno.execPath(), { stderr: "null", args: [ "cache", + "--allow-import", "--lock=lock_write_fetch.json", "--cert=tls/RootCA.pem", "run/https_import.ts", @@ -38,6 +40,7 @@ const runProc = await new Deno.Command(Deno.execPath(), { stderr: "null", args: [ "run", + "--allow-import", "--lock=lock_write_fetch.json", "--allow-read", "--cert=tls/RootCA.pem", diff --git a/tests/testdata/run/type_directives_01.ts b/tests/testdata/run/type_directives_01.ts index 71305824c7..2129d90b4a 100644 --- a/tests/testdata/run/type_directives_01.ts +++ b/tests/testdata/run/type_directives_01.ts @@ -1,3 +1,3 @@ -import * as foo from "http://127.0.0.1:4545/xTypeScriptTypes.js"; +import * as foo from "http://localhost:4545/xTypeScriptTypes.js"; console.log(foo.foo); diff --git a/tests/testdata/run/type_directives_01.ts.out b/tests/testdata/run/type_directives_01.ts.out index 77ed3ae264..466218a965 100644 --- a/tests/testdata/run/type_directives_01.ts.out +++ b/tests/testdata/run/type_directives_01.ts.out @@ -1,3 +1,3 @@ [WILDCARD] -DEBUG TS - host.getSourceFile("http://127.0.0.1:4545/xTypeScriptTypes.d.ts", Latest) +DEBUG TS - host.getSourceFile("http://localhost:4545/xTypeScriptTypes.d.ts", Latest) [WILDCARD] \ No newline at end of file diff --git a/tests/testdata/run/type_headers_deno_types.ts b/tests/testdata/run/type_headers_deno_types.ts index 9670f68cd2..197ac1801d 100644 --- a/tests/testdata/run/type_headers_deno_types.ts +++ b/tests/testdata/run/type_headers_deno_types.ts @@ -12,7 +12,7 @@ * header. */ -// @deno-types="http://127.0.0.1:4545/run/type_headers_deno_types.foo.d.ts" -import { foo } from "http://127.0.0.1:4545/run/type_headers_deno_types.foo.js"; +// @deno-types="http://localhost:4545/run/type_headers_deno_types.foo.d.ts" +import { foo } from "http://localhost:4545/run/type_headers_deno_types.foo.js"; foo("hello"); diff --git a/tests/testdata/workers/static_remote.ts b/tests/testdata/workers/static_remote.ts index 2d6e820fd6..6bb64eccdb 100644 --- a/tests/testdata/workers/static_remote.ts +++ b/tests/testdata/workers/static_remote.ts @@ -1,2 +1,2 @@ -// This file doesn't really exist, but it doesn't matter, a "PermissionsDenied" error should be thrown. +// This file doesn't really exist, but it doesn't matter, a "NotCapable" error should be thrown. import "https://example.com/some/file.ts";