From 3b220c64f615a4e18346e8a1c07ad7b1aae9fcc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sun, 6 Jun 2021 18:42:12 +0200 Subject: chore: upgrade crates (#10867) * deno_doc - 0.5.0 * deno_lint - 0.6.0 * dprint-plugin-typescript - 0.46.0 * dprint-plugin-markdown - 0.8.0 * dprint-plugin-json - 0.12.0 * swc_bundler - 0.37.4 * swc_ecmascript - 0.36.0 --- cli/Cargo.toml | 16 ++++++++-------- cli/ast.rs | 3 +++ cli/tools/fmt.rs | 7 +++++-- 3 files changed, 16 insertions(+), 10 deletions(-) (limited to 'cli') diff --git a/cli/Cargo.toml b/cli/Cargo.toml index c669a7047..67c7401b2 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -42,8 +42,8 @@ winres = "0.1.11" [dependencies] deno_core = { path = "../core", version = "0.88.1" } -deno_doc = "0.4.0" -deno_lint = "0.5.0" +deno_doc = "0.5.0" +deno_lint = "0.6.0" deno_runtime = { path = "../runtime", version = "0.15.1" } atty = "0.2.14" @@ -52,9 +52,9 @@ byteorder = "1.4.3" clap = "2.33.3" data-url = "0.1.0" dissimilar = "1.0.2" -dprint-plugin-json = "0.10.2" -dprint-plugin-markdown = "0.7.1" -dprint-plugin-typescript = "0.45.0" +dprint-plugin-json = "0.12.0" +dprint-plugin-markdown = "0.8.0" +dprint-plugin-typescript = "0.46.0" encoding_rs = "0.8.28" env_logger = "0.8.3" fancy-regex = "0.5.0" @@ -78,9 +78,9 @@ semver-parser = "0.10.2" serde = { version = "1.0.125", features = ["derive"] } shell-escape = "0.1.5" sourcemap = "6.0.1" -swc_bundler = "0.34.0" -swc_common = { version = "0.10.18", features = ["sourcemap"] } -swc_ecmascript = { version = "0.33.0", features = ["codegen", "dep_graph", "parser", "proposal", "react", "transforms", "typescript", "visit"] } +swc_bundler = "0.37.4" +swc_common = { version = "0.10.20", features = ["sourcemap"] } +swc_ecmascript = { version = "0.36.0", features = ["codegen", "dep_graph", "parser", "proposal", "react", "transforms", "typescript", "visit"] } tempfile = "3.2.0" termcolor = "1.1.2" text-size = "1.1.0" diff --git a/cli/ast.rs b/cli/ast.rs index 636dc1881..f5e8802e6 100644 --- a/cli/ast.rs +++ b/cli/ast.rs @@ -273,6 +273,9 @@ fn strip_config_from_emit_options( } }, use_define_for_class_fields: true, + // TODO(bartlomieju): this could be changed to `false` to provide `export {}` + // in Typescript files without manual changes + no_empty_export: true, } } diff --git a/cli/tools/fmt.rs b/cli/tools/fmt.rs index 869403f07..ac9af0292 100644 --- a/cli/tools/fmt.rs +++ b/cli/tools/fmt.rs @@ -101,7 +101,7 @@ fn format_markdown( dprint_plugin_markdown::format_text( &file_text, &md_config, - Box::new(move |tag, text, line_width| { + move |tag, text, line_width| { let tag = tag.to_lowercase(); if matches!( tag.as_str(), @@ -140,8 +140,9 @@ fn format_markdown( } else { Ok(text.to_string()) } - }), + }, ) + .map_err(|e| e.to_string()) } /// Formats JSON and JSONC using the rules provided by .deno() @@ -150,6 +151,7 @@ fn format_markdown( fn format_json(file_text: &str) -> Result { let json_config = get_json_config(); dprint_plugin_json::format_text(&file_text, &json_config) + .map_err(|e| e.to_string()) } /// Formats a single TS, TSX, JS, JSX, JSONC, JSON, or MD file. @@ -165,6 +167,7 @@ pub fn format_file( format_json(&file_text) } else { dprint_plugin_typescript::format_text(&file_path, &file_text, &config) + .map_err(|e| e.to_string()) } } -- cgit v1.2.3