Skip to content

Commit

Permalink
Merge branch 'master' into ca_file
Browse files Browse the repository at this point in the history
* master:
  v0.33.0
  fix: appended CRLF to end of trailer headers (denoland#3989)
  Clean up fmt flags and path handling (denoland#3988)
  Improvements to bundling. (denoland#3965)
  fix: Correctly determine a --cached-only error (denoland#3979)
  chore: share HTTP server between tests (denoland#3966)
  dont use env vars in multiple installer tests (denoland#3967)
  feat(node): add EventEmitter.errorMonitor (denoland#3960)
  fix(file_server): don't crash on "%" pathname (denoland#3953)
  update references to testing/mod.ts in manual (denoland#3973)
  • Loading branch information
geoFlux committed Feb 14, 2020
2 parents 746afc2 + 87c329c commit 1637f5e
Show file tree
Hide file tree
Showing 32 changed files with 468 additions and 272 deletions.
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions Releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,34 @@ https://github.com/denoland/deno/releases
We also have one-line install commands at
https://github.com/denoland/deno_install

### v0.33.0 / 2020.02.13

- feat(std/http): support trailer headers (#3938, #3989)
- feat(std/node): Add readlink, readlinkSync (#3926)
- feat(std/node): Event emitter node polyfill (#3944, #3959, #3960)
- feat(deno install): add --force flag and remove yes/no prompt (#3917)
- feat: Improve support for diagnostics from runtime compiler APIs (#3911)
- feat: `deno fmt -` formats stdin and print to stdout (#3920)
- feat: add std/signal (#3913)
- feat: make testing API built-in Deno.test() (#3865, #3930, #3973)
- fix(std/http): align serve and serveTLS APIs (#3881)
- fix(std/http/file_server): don't crash on "%" pathname (#3953)
- fix(std/path): Use non-capturing groups in globrex() (#3898)
- fix(deno types): don't panic when piped to head (#3910)
- fix(deno fmt): support top-level await (#3952)
- fix: Correctly determine a --cached-only error (#3979)
- fix: No longer require aligned buffer for shared queue (#3935)
- fix: Prevent providing --allow-env flag twice (#3906)
- fix: Remove unnecessary EOF check in Deno.toAsyncIterable (#3914)
- fix: WASM imports loaded HTTP (#3856)
- fix: better WebWorker API compatibility (#3828 )
- fix: deno fmt improvements (#3988)
- fix: make WebSocket.send() exclusive (#3885)
- refactor: Improve `deno bundle` by using System instead of AMD (#3965)
- refactor: Remove conditionals from installer (#3909)
- refactor: peg workers to a single thread (#3844, #3968, #3931, #3903, #3912,
#3907, #3904)

### v0.32.0 / 2020.02.03

- BREAKING CHANGE: Replace formatter for "deno fmt", use dprint (#3820, #3824,
Expand Down
10 changes: 5 additions & 5 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[package]
name = "deno"
version = "0.32.0"
version = "0.33.0"
license = "MIT"
authors = ["the Deno authors"]
edition = "2018"
Expand All @@ -19,12 +19,12 @@ name = "deno"
path = "main.rs"

[build-dependencies]
deno_core = { path = "../core", version = "0.32.0" }
deno_typescript = { path = "../deno_typescript", version = "0.32.0" }
deno_core = { path = "../core", version = "0.33.0" }
deno_typescript = { path = "../deno_typescript", version = "0.33.0" }

[dependencies]
deno_core = { path = "../core", version = "0.32.0" }
deno_typescript = { path = "../deno_typescript", version = "0.32.0" }
deno_core = { path = "../core", version = "0.33.0" }
deno_typescript = { path = "../deno_typescript", version = "0.33.0" }

ansi_term = "0.11.0"
atty = "0.2.13"
Expand Down
18 changes: 10 additions & 8 deletions cli/file_fetcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,18 +206,20 @@ impl SourceFileFetcher {
} else {
"".to_owned()
};
let err = if err_kind == ErrorKind::NotFound {
// Hack: Check error message for "--cached-only" because the kind
// conflicts with other errors.
let err = if err.to_string().contains("--cached-only") {
let msg = format!(
r#"Cannot resolve module "{}"{}"#,
r#"Cannot find module "{}"{} in cache, --cached-only is specified"#,
module_url, referrer_suffix
);
DenoError::new(ErrorKind::NotFound, msg).into()
} else if err_kind == ErrorKind::PermissionDenied {
} else if err_kind == ErrorKind::NotFound {
let msg = format!(
r#"Cannot find module "{}"{} in cache, --cached-only is specified"#,
r#"Cannot resolve module "{}"{}"#,
module_url, referrer_suffix
);
DenoError::new(ErrorKind::PermissionDenied, msg).into()
DenoError::new(ErrorKind::NotFound, msg).into()
} else {
err
};
Expand Down Expand Up @@ -428,9 +430,9 @@ impl SourceFileFetcher {
// We can't fetch remote file - bail out
return futures::future::err(
std::io::Error::new(
std::io::ErrorKind::PermissionDenied,
std::io::ErrorKind::NotFound,
format!(
"cannot find remote file '{}' in cache",
"Cannot find remote file '{}' in cache, --cached-only is specified",
module_url.to_string()
),
)
Expand Down Expand Up @@ -1451,7 +1453,7 @@ mod tests {
.await;
assert!(result.is_err());
let err = result.err().unwrap();
assert_eq!(err.kind(), ErrorKind::PermissionDenied);
assert_eq!(err.kind(), ErrorKind::NotFound);

// download and cache file
let result = fetcher_1
Expand Down
39 changes: 15 additions & 24 deletions cli/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ pub enum DenoSubcommand {
Fetch {
files: Vec<String>,
},
Format {
Fmt {
check: bool,
files: Option<Vec<PathBuf>>,
files: Vec<String>,
},
Help,
Info {
Expand Down Expand Up @@ -302,19 +302,13 @@ fn types_parse(flags: &mut DenoFlags, _matches: &clap::ArgMatches) {
}

fn fmt_parse(flags: &mut DenoFlags, matches: &clap::ArgMatches) {
let maybe_files = match matches.values_of("files") {
Some(f) => {
let files: Vec<PathBuf> = f.map(PathBuf::from).collect();
Some(files)
}
None => None,
let files = match matches.values_of("files") {
Some(f) => f.map(String::from).collect(),
None => vec![],
};

let check = matches.is_present("check");

flags.subcommand = DenoSubcommand::Format {
check,
files: maybe_files,
flags.subcommand = DenoSubcommand::Fmt {
check: matches.is_present("check"),
files,
}
}

Expand Down Expand Up @@ -543,7 +537,7 @@ The declaration file could be saved and used for typing information.",

fn fmt_subcommand<'a, 'b>() -> App<'a, 'b> {
SubCommand::with_name("fmt")
.about("Format files")
.about("Format source files")
.long_about(
"Auto-format JavaScript/TypeScript source code
Expand Down Expand Up @@ -1391,12 +1385,9 @@ mod tests {
assert_eq!(
r.unwrap(),
DenoFlags {
subcommand: DenoSubcommand::Format {
subcommand: DenoSubcommand::Fmt {
check: false,
files: Some(vec![
PathBuf::from("script_1.ts"),
PathBuf::from("script_2.ts")
])
files: vec!["script_1.ts".to_string(), "script_2.ts".to_string()]
},
..DenoFlags::default()
}
Expand All @@ -1406,9 +1397,9 @@ mod tests {
assert_eq!(
r.unwrap(),
DenoFlags {
subcommand: DenoSubcommand::Format {
subcommand: DenoSubcommand::Fmt {
check: true,
files: None
files: vec![],
},
..DenoFlags::default()
}
Expand All @@ -1418,9 +1409,9 @@ mod tests {
assert_eq!(
r.unwrap(),
DenoFlags {
subcommand: DenoSubcommand::Format {
subcommand: DenoSubcommand::Fmt {
check: false,
files: None
files: vec![],
},
..DenoFlags::default()
}
Expand Down
Loading

0 comments on commit 1637f5e

Please sign in to comment.