Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): Update sourcemap to v8.0.0 #8771

Merged
merged 6 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 36 additions & 3 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion crates/swc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ regex = "1"
rustc-hash = "1.1.0"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
sourcemap = "6.4"
sourcemap = "8.0"
tracing = "0.1.37"
url = "2.4.0"

Expand Down
2 changes: 1 addition & 1 deletion crates/swc_cli_impl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ rayon = "1"
relative-path = "1.6.1"
serde = { version = "1", features = ["derive"] }
serde_json = { version = "1", features = ["unbounded_depth"] }
sourcemap = "6.4.1"
sourcemap = "8.0.0"
tracing = "0.1.37"
tracing-chrome = "0.5.0"
tracing-futures = "0.2.5"
Expand Down
2 changes: 1 addition & 1 deletion crates/swc_common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ rkyv = { version = "=0.7.42", optional = true, features = [
rustc-hash = "1.1.0"
serde = { version = "1.0.119", features = ["derive"] }
siphasher = "0.3.9"
sourcemap = { version = "6", optional = true }
sourcemap = { version = "8", optional = true }
termcolor = { version = "1.0", optional = true }
tracing = "0.1.37"
unicode-width = "0.1.4"
Expand Down
4 changes: 2 additions & 2 deletions crates/swc_common/src/source_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1258,7 +1258,7 @@ impl SourceMap {
}

if pos == BytePos(u32::MAX) {
builder.add_raw(lc.line, lc.col, 0, 0, Some(src_id), None);
builder.add_raw(lc.line, lc.col, 0, 0, Some(src_id), None, false);
continue;
}

Expand Down Expand Up @@ -1352,7 +1352,7 @@ impl SourceMap {
.or_else(|| config.name_for_bytepos(pos))
.map(|name| builder.add_name(name));

builder.add_raw(lc.line, lc.col, line, col, Some(src_id), name_idx);
builder.add_raw(lc.line, lc.col, line, col, Some(src_id), name_idx, false);
prev_dst_line = lc.line;
}

Expand Down
2 changes: 1 addition & 1 deletion crates/swc_compiler_base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ base64 = "0.21.0"
once_cell = "1"
pathdiff = "0.2.0"
serde = { version = "1.0.188", features = ["derive"] }
sourcemap = "6.4"
sourcemap = "8.0"

swc_atoms = { version = "0.6.5", path = "../swc_atoms" }
swc_common = { version = "0.33.20", path = "../swc_common", features = [
Expand Down
2 changes: 1 addition & 1 deletion crates/swc_config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ anyhow = "1"
indexmap = "2.0.0"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
sourcemap = { version = "6.4", optional = true }
sourcemap = { version = "8.0", optional = true }

swc_cached = { version = "0.3.19", path = "../swc_cached" }
swc_config_macro = { version = "0.1.3", path = "../swc_config_macro" }
Expand Down
14 changes: 10 additions & 4 deletions crates/swc_config/src/source_map.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::sync::Arc;

use anyhow::{bail, Context, Result};
use serde::{Deserialize, Serialize};
use sourcemap::{vlq::parse_vlq_segment, RawToken, SourceMap};
Expand All @@ -9,17 +11,19 @@ pub enum SourceMapContent {
#[serde(rename_all = "camelCase")]
Parsed {
#[serde(default)]
sources: Vec<String>,
sources: Vec<Arc<str>>,
#[serde(default)]
names: Vec<String>,
names: Vec<Arc<str>>,
#[serde(default)]
mappings: String,
#[serde(default)]
file: Option<String>,
range_mappings: String,
#[serde(default)]
file: Option<Arc<str>>,
#[serde(default)]
source_root: Option<String>,
#[serde(default)]
sources_content: Option<Vec<Option<String>>>,
sources_content: Option<Vec<Option<Arc<str>>>>,
},
}

Expand All @@ -33,6 +37,7 @@ impl SourceMapContent {
sources,
names,
mappings,
range_mappings: _,
file,
source_root,
sources_content,
Expand Down Expand Up @@ -99,6 +104,7 @@ impl SourceMapContent {
src_col,
src_id: src,
name_id: name,
is_range: false,
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/swc_ecma_codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ num-bigint = { version = "0.4", features = ["serde"] }
once_cell = "1.18.0"
rustc-hash = "1.1.0"
serde = "1.0.127"
sourcemap = "6.4"
sourcemap = "8.0"
tracing = "0.1.37"

swc_atoms = { version = "0.6.5", path = "../swc_atoms" }
Expand Down
2 changes: 1 addition & 1 deletion crates/swc_ecma_transforms/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ swc_ecma_visit = { version = "0.98.7", path = "../swc_ecma_vis

[dev-dependencies]
pretty_assertions = "1.3"
sourcemap = "6.4"
sourcemap = "8.0"
tempfile = "3"

swc_ecma_codegen = { version = "0.148.12", path = "../swc_ecma_codegen" }
Expand Down
2 changes: 1 addition & 1 deletion crates/swc_ecma_transforms_testing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ hex = "0.4.3"
serde = "1"
serde_json = "1"
sha2 = "0.10.8"
sourcemap = "6.4"
sourcemap = "8.0"
tempfile = "3.6.0"

swc_common = { version = "0.33.20", path = "../swc_common", features = [
Expand Down
Loading