From 776a4bde4e6409c27e14b4f74558125108146b2d Mon Sep 17 00:00:00 2001 From: crowlkats Date: Thu, 14 Nov 2024 21:39:03 +0100 Subject: [PATCH 1/7] feat: use deno_error crate --- Cargo.lock | 22 ++++++++++++++++++++++ Cargo.toml | 1 + src/emit.rs | 6 ++++-- src/transpiling/mod.rs | 23 +++++++++++++++-------- src/types.rs | 8 +++++--- 5 files changed, 47 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f4ffd6b..2585f4a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -227,6 +227,7 @@ name = "deno_ast" version = "0.43.3" dependencies = [ "base64", + "deno_error", "deno_media_type", "deno_terminal", "dprint-swc-ext", @@ -268,6 +269,27 @@ dependencies = [ "url", ] +[[package]] +name = "deno_error" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "699681a535fd39d1bfc359a8b5b6543042c215afcdf2c806b09ed14a19705039" +dependencies = [ + "deno_error_macro", + "libc", +] + +[[package]] +name = "deno_error_macro" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aef127cf133df1912efda783e7a26320808c1eb0fd768f5b31c9ff5fc0c3e7f9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + [[package]] name = "deno_media_type" version = "0.2.1" diff --git a/Cargo.toml b/Cargo.toml index b19c8bb..1dd2b9f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,6 +34,7 @@ visit = ["swc_ecma_visit", "swc_visit", "swc_visit_macros", "swc_macros_common"] base64 = { version = "0.21.6", optional = true } deno_media_type = "0.2.1" deno_terminal = "0.1.1" +deno_error = "0.2.0" dprint-swc-ext = "0.20.0" once_cell = "1.19.0" diff --git a/src/emit.rs b/src/emit.rs index ec37e6b..fded29c 100644 --- a/src/emit.rs +++ b/src/emit.rs @@ -59,12 +59,14 @@ pub struct EmittedSourceText { pub source_map: Option, } -#[derive(Debug, Error)] +#[derive(Debug, Error, deno_error::JsError)] pub enum EmitError { + #[class(inherit)] #[error(transparent)] - SwcEmit(std::io::Error), + SwcEmit(#[inherit] std::io::Error), #[error(transparent)] SourceMap(sourcemap::Error), + #[class(TYPE)] #[error(transparent)] SourceMapEncode(base64::EncodeSliceError), } diff --git a/src/transpiling/mod.rs b/src/transpiling/mod.rs index 765d3e1..3f1b0c3 100644 --- a/src/transpiling/mod.rs +++ b/src/transpiling/mod.rs @@ -39,6 +39,7 @@ use crate::ProgramRef; use crate::SourceMap; use std::cell::RefCell; +use deno_error::JsError; mod jsx_precompile; mod transforms; @@ -65,19 +66,23 @@ impl TranspileResult { } } -#[derive(Debug, Error)] +#[derive(Debug, Error, JsError)] pub enum TranspileError { + #[class(TYPE)] #[error("Can't use TranspileOptions::use_decorators_proposal and TranspileOptions::use_ts_decorators together.")] DecoratorOptionsConflict, /// Parse errors that prevent transpiling. + #[class(inherit)] #[error(transparent)] - ParseErrors(#[from] ParseDiagnosticsError), + ParseErrors(#[from] #[inherit] ParseDiagnosticsError), + #[class(inherit)] #[error(transparent)] - FoldProgram(#[from] FoldProgramError), + FoldProgram(#[from] #[inherit] FoldProgramError), #[error("{0}")] EmitDiagnostic(String), + #[class(inherit)] #[error(transparent)] - Emit(#[from] EmitError), + Emit(#[from] #[inherit] EmitError), } #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] @@ -632,12 +637,14 @@ impl crate::swc::common::errors::Emitter for DiagnosticCollector { } } -#[derive(Debug, Error)] +#[derive(Debug, Error, JsError)] pub enum FoldProgramError { + #[class(inherit)] #[error(transparent)] - ParseDiagnostics(#[from] ParseDiagnosticsError), + ParseDiagnostics(#[from] #[inherit] ParseDiagnosticsError), + #[class(inherit)] #[error(transparent)] - Swc(#[from] SwcFoldDiagnosticsError), + Swc(#[from] #[inherit] SwcFoldDiagnosticsError), } /// Low level function for transpiling a program. @@ -758,7 +765,7 @@ pub fn fold_program( Ok(result) } -#[derive(Debug)] +#[derive(Debug, JsError)] pub struct SwcFoldDiagnosticsError(Vec); impl std::error::Error for SwcFoldDiagnosticsError {} diff --git a/src/types.rs b/src/types.rs index f29a06a..b7d9187 100644 --- a/src/types.rs +++ b/src/types.rs @@ -2,7 +2,7 @@ use std::borrow::Cow; use std::fmt; - +use deno_error::JsError; use crate::diagnostics::Diagnostic; use crate::diagnostics::DiagnosticLevel; use crate::diagnostics::DiagnosticLocation; @@ -19,7 +19,8 @@ use crate::SourceRangedForSpanned; use crate::SourceTextInfo; /// Parsing diagnostic. -#[derive(Debug, Clone)] +#[derive(Debug, Clone, JsError)] +#[class(SYNTAX)] pub struct ParseDiagnostic { /// Specifier of the source the diagnostic occurred in. pub specifier: ModuleSpecifier, @@ -368,7 +369,8 @@ impl fmt::Display for ParseDiagnostic { } } -#[derive(Debug)] +#[derive(Debug, JsError)] +#[class(SYNTAX)] pub struct ParseDiagnosticsError(pub Vec); impl std::error::Error for ParseDiagnosticsError {} From b8656612d06165cffcb6ccd1a9c2bc74def3d61e Mon Sep 17 00:00:00 2001 From: crowlkats Date: Thu, 14 Nov 2024 21:40:17 +0100 Subject: [PATCH 2/7] add clippy::unnecessary_wraps --- src/transpiling/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/transpiling/mod.rs b/src/transpiling/mod.rs index 3f1b0c3..0afe85b 100644 --- a/src/transpiling/mod.rs +++ b/src/transpiling/mod.rs @@ -1,4 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +#![deny(clippy::unnecessary_wraps)] use std::borrow::Cow; use std::rc::Rc; From 5c0c6255c98319ef152a17ca43f801ea66a5f135 Mon Sep 17 00:00:00 2001 From: crowlkats Date: Thu, 14 Nov 2024 21:40:39 +0100 Subject: [PATCH 3/7] fmt --- src/transpiling/mod.rs | 32 ++++++++++++++++++++++++++------ src/types.rs | 6 +++--- 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/src/transpiling/mod.rs b/src/transpiling/mod.rs index 0afe85b..e9f39b1 100644 --- a/src/transpiling/mod.rs +++ b/src/transpiling/mod.rs @@ -39,8 +39,8 @@ use crate::ParsedSource; use crate::ProgramRef; use crate::SourceMap; -use std::cell::RefCell; use deno_error::JsError; +use std::cell::RefCell; mod jsx_precompile; mod transforms; @@ -75,15 +75,27 @@ pub enum TranspileError { /// Parse errors that prevent transpiling. #[class(inherit)] #[error(transparent)] - ParseErrors(#[from] #[inherit] ParseDiagnosticsError), + ParseErrors( + #[from] + #[inherit] + ParseDiagnosticsError, + ), #[class(inherit)] #[error(transparent)] - FoldProgram(#[from] #[inherit] FoldProgramError), + FoldProgram( + #[from] + #[inherit] + FoldProgramError, + ), #[error("{0}")] EmitDiagnostic(String), #[class(inherit)] #[error(transparent)] - Emit(#[from] #[inherit] EmitError), + Emit( + #[from] + #[inherit] + EmitError, + ), } #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] @@ -642,10 +654,18 @@ impl crate::swc::common::errors::Emitter for DiagnosticCollector { pub enum FoldProgramError { #[class(inherit)] #[error(transparent)] - ParseDiagnostics(#[from] #[inherit] ParseDiagnosticsError), + ParseDiagnostics( + #[from] + #[inherit] + ParseDiagnosticsError, + ), #[class(inherit)] #[error(transparent)] - Swc(#[from] #[inherit] SwcFoldDiagnosticsError), + Swc( + #[from] + #[inherit] + SwcFoldDiagnosticsError, + ), } /// Low level function for transpiling a program. diff --git a/src/types.rs b/src/types.rs index b7d9187..d2380e3 100644 --- a/src/types.rs +++ b/src/types.rs @@ -1,8 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -use std::borrow::Cow; -use std::fmt; -use deno_error::JsError; use crate::diagnostics::Diagnostic; use crate::diagnostics::DiagnosticLevel; use crate::diagnostics::DiagnosticLocation; @@ -17,6 +14,9 @@ use crate::ModuleSpecifier; use crate::SourceRange; use crate::SourceRangedForSpanned; use crate::SourceTextInfo; +use deno_error::JsError; +use std::borrow::Cow; +use std::fmt; /// Parsing diagnostic. #[derive(Debug, Clone, JsError)] From 44796458281cace90eb67b60ae8c55f8b1d7f682 Mon Sep 17 00:00:00 2001 From: crowlkats Date: Thu, 14 Nov 2024 21:40:56 +0100 Subject: [PATCH 4/7] clean --- src/lib.rs | 1 + src/transpiling/mod.rs | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index c045df9..f966134 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,6 +2,7 @@ #![deny(clippy::disallowed_methods)] #![deny(clippy::disallowed_types)] +#![deny(clippy::unnecessary_wraps)] #[cfg(feature = "cjs")] mod cjs_parse; diff --git a/src/transpiling/mod.rs b/src/transpiling/mod.rs index e9f39b1..7de38ab 100644 --- a/src/transpiling/mod.rs +++ b/src/transpiling/mod.rs @@ -1,5 +1,4 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -#![deny(clippy::unnecessary_wraps)] use std::borrow::Cow; use std::rc::Rc; From 886a7f8204c714ce542143c1cce1f8e53840e7fb Mon Sep 17 00:00:00 2001 From: crowlkats Date: Thu, 14 Nov 2024 21:48:40 +0100 Subject: [PATCH 5/7] fix --- src/emit.rs | 1 + src/transpiling/mod.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/emit.rs b/src/emit.rs index fded29c..49e99d9 100644 --- a/src/emit.rs +++ b/src/emit.rs @@ -64,6 +64,7 @@ pub enum EmitError { #[class(inherit)] #[error(transparent)] SwcEmit(#[inherit] std::io::Error), + #[class(TYPE)] #[error(transparent)] SourceMap(sourcemap::Error), #[class(TYPE)] diff --git a/src/transpiling/mod.rs b/src/transpiling/mod.rs index 7de38ab..e7d6050 100644 --- a/src/transpiling/mod.rs +++ b/src/transpiling/mod.rs @@ -86,6 +86,7 @@ pub enum TranspileError { #[inherit] FoldProgramError, ), + #[class(TYPE)] #[error("{0}")] EmitDiagnostic(String), #[class(inherit)] @@ -786,6 +787,7 @@ pub fn fold_program( } #[derive(Debug, JsError)] +#[class(SYNTAX)] pub struct SwcFoldDiagnosticsError(Vec); impl std::error::Error for SwcFoldDiagnosticsError {} From decb27d91ad2620d7f7c2988c09a68ca290265e3 Mon Sep 17 00:00:00 2001 From: crowlkats Date: Fri, 15 Nov 2024 02:14:33 +0100 Subject: [PATCH 6/7] fix --- .github/workflows/ci.yml | 114 +++++++++++++++++----------------- .github/workflows/release.yml | 2 +- Cargo.lock | 8 +-- Cargo.toml | 2 +- src/emit.rs | 6 +- src/transpiling/mod.rs | 36 +++-------- src/types.rs | 4 +- 7 files changed, 76 insertions(+), 96 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea17000..d4202f5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,57 +1,57 @@ -name: ci - -on: - pull_request: - branches: [main] - push: - branches: [main] - tags: - - '*' - workflow_dispatch: - -jobs: - rust: - name: deno_ast-ubuntu-latest-release - runs-on: ubuntu-latest - timeout-minutes: 30 - - env: - CARGO_INCREMENTAL: 0 - GH_ACTIONS: 1 - RUST_BACKTRACE: full - RUSTFLAGS: -D warnings - - steps: - - name: Clone repository - uses: actions/checkout@v4 - - - uses: denoland/setup-deno@v1 - - uses: dsherret/rust-toolchain-file@v1 - - - uses: Swatinem/rust-cache@v2 - with: - save-if: ${{ github.ref == 'refs/heads/main' }} - - - name: Format - run: | - cargo fmt --all -- --check - deno fmt --check - - - name: Lint - run: | - cargo clippy --all-targets --all-features --release - deno lint - - - name: Build - run: cargo build --all-targets --all-features --release - - name: Test - run: cargo test --all-targets --all-features --release - - - name: Publish - if: | - github.repository == 'denoland/deno_ast' && - startsWith(github.ref, 'refs/tags/') - env: - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - run: | - cargo publish +name: ci + +on: + pull_request: + branches: [main] + push: + branches: [main] + tags: + - "*" + workflow_dispatch: + +jobs: + rust: + name: deno_ast-ubuntu-latest-release + runs-on: ubuntu-latest + timeout-minutes: 30 + + env: + CARGO_INCREMENTAL: 0 + GH_ACTIONS: 1 + RUST_BACKTRACE: full + RUSTFLAGS: -D warnings + + steps: + - name: Clone repository + uses: actions/checkout@v4 + + - uses: denoland/setup-deno@v1 + - uses: dsherret/rust-toolchain-file@v1 + + - uses: Swatinem/rust-cache@v2 + with: + save-if: ${{ github.ref == 'refs/heads/main' }} + + - name: Format + run: | + cargo fmt --all -- --check + deno fmt --check + + - name: Lint + run: | + cargo clippy --all-targets --all-features --release + deno lint + + - name: Build + run: cargo build --all-targets --all-features --release + - name: Test + run: cargo test --all-targets --all-features --release + + - name: Publish + if: | + github.repository == 'denoland/deno_ast' && + startsWith(github.ref, 'refs/tags/') + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + run: | + cargo publish diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e355759..8c63f81 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: releaseKind: - description: 'Kind of release' + description: "Kind of release" type: choice options: - patch diff --git a/Cargo.lock b/Cargo.lock index 2585f4a..0c33e21 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -271,9 +271,9 @@ dependencies = [ [[package]] name = "deno_error" -version = "0.2.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "699681a535fd39d1bfc359a8b5b6543042c215afcdf2c806b09ed14a19705039" +checksum = "a7212b2c7eab654fa8856f7d0c5ad6c805f9e32982079735ca3a0fee1381e101" dependencies = [ "deno_error_macro", "libc", @@ -281,9 +281,9 @@ dependencies = [ [[package]] name = "deno_error_macro" -version = "0.2.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aef127cf133df1912efda783e7a26320808c1eb0fd768f5b31c9ff5fc0c3e7f9" +checksum = "23a3cd1a50eed6696671493663fa1d2542a487350527b133ef8db0765bc83334" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 1dd2b9f..069eb5c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,7 +34,7 @@ visit = ["swc_ecma_visit", "swc_visit", "swc_visit_macros", "swc_macros_common"] base64 = { version = "0.21.6", optional = true } deno_media_type = "0.2.1" deno_terminal = "0.1.1" -deno_error = "0.2.0" +deno_error = "0.4.0" dprint-swc-ext = "0.20.0" once_cell = "1.19.0" diff --git a/src/emit.rs b/src/emit.rs index 49e99d9..50352e1 100644 --- a/src/emit.rs +++ b/src/emit.rs @@ -63,11 +63,11 @@ pub struct EmittedSourceText { pub enum EmitError { #[class(inherit)] #[error(transparent)] - SwcEmit(#[inherit] std::io::Error), - #[class(TYPE)] + SwcEmit(std::io::Error), + #[class(type)] #[error(transparent)] SourceMap(sourcemap::Error), - #[class(TYPE)] + #[class(type)] #[error(transparent)] SourceMapEncode(base64::EncodeSliceError), } diff --git a/src/transpiling/mod.rs b/src/transpiling/mod.rs index e7d6050..8999784 100644 --- a/src/transpiling/mod.rs +++ b/src/transpiling/mod.rs @@ -68,34 +68,22 @@ impl TranspileResult { #[derive(Debug, Error, JsError)] pub enum TranspileError { - #[class(TYPE)] + #[class(type)] #[error("Can't use TranspileOptions::use_decorators_proposal and TranspileOptions::use_ts_decorators together.")] DecoratorOptionsConflict, /// Parse errors that prevent transpiling. #[class(inherit)] #[error(transparent)] - ParseErrors( - #[from] - #[inherit] - ParseDiagnosticsError, - ), + ParseErrors(#[from] ParseDiagnosticsError), #[class(inherit)] #[error(transparent)] - FoldProgram( - #[from] - #[inherit] - FoldProgramError, - ), - #[class(TYPE)] + FoldProgram(#[from] FoldProgramError), + #[class(type)] #[error("{0}")] EmitDiagnostic(String), #[class(inherit)] #[error(transparent)] - Emit( - #[from] - #[inherit] - EmitError, - ), + Emit(#[from] EmitError), } #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] @@ -654,18 +642,10 @@ impl crate::swc::common::errors::Emitter for DiagnosticCollector { pub enum FoldProgramError { #[class(inherit)] #[error(transparent)] - ParseDiagnostics( - #[from] - #[inherit] - ParseDiagnosticsError, - ), + ParseDiagnostics(#[from] ParseDiagnosticsError), #[class(inherit)] #[error(transparent)] - Swc( - #[from] - #[inherit] - SwcFoldDiagnosticsError, - ), + Swc(#[from] SwcFoldDiagnosticsError), } /// Low level function for transpiling a program. @@ -787,7 +767,7 @@ pub fn fold_program( } #[derive(Debug, JsError)] -#[class(SYNTAX)] +#[class(syntax)] pub struct SwcFoldDiagnosticsError(Vec); impl std::error::Error for SwcFoldDiagnosticsError {} diff --git a/src/types.rs b/src/types.rs index d2380e3..0cfb81a 100644 --- a/src/types.rs +++ b/src/types.rs @@ -20,7 +20,7 @@ use std::fmt; /// Parsing diagnostic. #[derive(Debug, Clone, JsError)] -#[class(SYNTAX)] +#[class(syntax)] pub struct ParseDiagnostic { /// Specifier of the source the diagnostic occurred in. pub specifier: ModuleSpecifier, @@ -370,7 +370,7 @@ impl fmt::Display for ParseDiagnostic { } #[derive(Debug, JsError)] -#[class(SYNTAX)] +#[class(syntax)] pub struct ParseDiagnosticsError(pub Vec); impl std::error::Error for ParseDiagnosticsError {} From 169a8edbf316e7604f20881279a7442abbb7863c Mon Sep 17 00:00:00 2001 From: crowlkats Date: Thu, 21 Nov 2024 16:29:17 +0100 Subject: [PATCH 7/7] update deno_error --- Cargo.lock | 64 +++++++++++++++++++++++++++--------------------------- Cargo.toml | 6 ++--- src/lib.rs | 2 ++ 3 files changed, 37 insertions(+), 35 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0c33e21..976c242 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -61,7 +61,7 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.72", + "syn 2.0.89", ] [[package]] @@ -72,7 +72,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.89", ] [[package]] @@ -271,9 +271,9 @@ dependencies = [ [[package]] name = "deno_error" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7212b2c7eab654fa8856f7d0c5ad6c805f9e32982079735ca3a0fee1381e101" +checksum = "77a4a933a7cdb395adbfaf418fc4a93f14416fdf61d660d0cd67eca57162552c" dependencies = [ "deno_error_macro", "libc", @@ -281,13 +281,13 @@ dependencies = [ [[package]] name = "deno_error_macro" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23a3cd1a50eed6696671493663fa1d2542a487350527b133ef8db0765bc83334" +checksum = "0480c64271ddab066186fe22a32e27cc87ab84e4a7779d060c5e4dc894f9c1fa" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.89", ] [[package]] @@ -303,9 +303,9 @@ dependencies = [ [[package]] name = "deno_terminal" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e6337d4e7f375f8b986409a76fbeecfa4bd8a1343e63355729ae4befa058eaf" +checksum = "daef12499e89ee99e51ad6000a91f600d3937fb028ad4918af76810c5bc9e0d5" dependencies = [ "once_cell", "termcolor", @@ -379,7 +379,7 @@ checksum = "32016f1242eb82af5474752d00fd8ebcd9004bd69b462b1c91de833972d08ed4" dependencies = [ "proc-macro2", "swc_macros_common", - "syn 2.0.72", + "syn 2.0.89", ] [[package]] @@ -474,7 +474,7 @@ dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.89", ] [[package]] @@ -643,7 +643,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.89", ] [[package]] @@ -673,9 +673,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "307e3004becf10f5a6e0d59d20f3cd28231b0e0827a96cd3e0ce6d14bc1e4bb3" dependencies = [ "unicode-ident", ] @@ -860,7 +860,7 @@ checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.89", ] [[package]] @@ -972,7 +972,7 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.72", + "syn 2.0.89", ] [[package]] @@ -1094,7 +1094,7 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.72", + "syn 2.0.89", ] [[package]] @@ -1143,7 +1143,7 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.72", + "syn 2.0.89", ] [[package]] @@ -1459,7 +1459,7 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.72", + "syn 2.0.89", ] [[package]] @@ -1590,7 +1590,7 @@ checksum = "63db0adcff29d220c3d151c5b25c0eabe7e32dd936212b84cdaa1392e3130497" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.89", ] [[package]] @@ -1626,7 +1626,7 @@ checksum = "f486687bfb7b5c560868f69ed2d458b880cebc9babebcb67e49f31b55c5bf847" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.89", ] [[package]] @@ -1637,7 +1637,7 @@ checksum = "ff9719b6085dd2824fd61938a881937be14b08f95e2d27c64c825a9f65e052ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.89", ] [[package]] @@ -1660,7 +1660,7 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.72", + "syn 2.0.89", ] [[package]] @@ -1676,9 +1676,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.72" +version = "2.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" +checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" dependencies = [ "proc-macro2", "quote", @@ -1711,22 +1711,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.63" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "c006c85c7651b3cf2ada4584faa36773bd07bac24acfb39f3c431b36d7e667aa" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.89", ] [[package]] @@ -1763,7 +1763,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.89", ] [[package]] @@ -2002,5 +2002,5 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.89", ] diff --git a/Cargo.toml b/Cargo.toml index 069eb5c..cee75b6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,8 +33,8 @@ visit = ["swc_ecma_visit", "swc_visit", "swc_visit_macros", "swc_macros_common"] [dependencies] base64 = { version = "0.21.6", optional = true } deno_media_type = "0.2.1" -deno_terminal = "0.1.1" -deno_error = "0.4.0" +deno_terminal = "0.2.0" +deno_error = "0.5.0" dprint-swc-ext = "0.20.0" once_cell = "1.19.0" @@ -77,7 +77,7 @@ swc_visit = { version = "=0.6.2", optional = true } swc_visit_macros = { version = "=0.5.13", optional = true } # just for error handling sourcemap = { version = "9.0.0", optional = true } -thiserror = "1.0.58" +thiserror = "2" [dev-dependencies] pretty_assertions = "1.3.0" diff --git a/src/lib.rs b/src/lib.rs index f966134..b572959 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,6 +3,8 @@ #![deny(clippy::disallowed_methods)] #![deny(clippy::disallowed_types)] #![deny(clippy::unnecessary_wraps)] +#![deny(clippy::print_stderr)] +#![deny(clippy::print_stdout)] #[cfg(feature = "cjs")] mod cjs_parse;