Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
mischnic committed Feb 7, 2025
1 parent 59f5845 commit 029c3e3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 18 deletions.
17 changes: 5 additions & 12 deletions turbopack/crates/turbopack-node/src/source_map/trace.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
use std::{borrow::Cow, fmt::Display};

use anyhow::Result;
use mime::APPLICATION_JSON;
use serde::{Deserialize, Serialize};
use serde_json::json;
use turbo_rcstr::RcStr;
use turbo_tasks::{ResolvedVc, Vc};
use turbo_tasks_fs::{rope::Rope, File};
use turbopack_core::{
asset::AssetContent,
source_map::{SourceMap, Token},
};
use turbopack_core::source_map::{SourceMap, Token};
use turbopack_ecmascript::magic_identifier::unmangle_identifiers;

/// An individual stack frame, as parsed by the stacktrace-parser npm module.
Expand Down Expand Up @@ -86,10 +79,10 @@ impl Display for StackFrame<'_> {
/// trace's token.
#[derive(Debug)]
pub struct SourceMapTrace {
map: SourceMap,
line: usize,
column: usize,
name: Option<RcStr>,
// map: SourceMap,
// line: usize,
// column: usize,
// name: Option<RcStr>,
}

/// The result of performing a source map trace.
Expand Down
2 changes: 1 addition & 1 deletion turbopack/crates/turbopack-node/src/transforms/postcss.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use turbopack_core::{
reference_type::{EntryReferenceSubType, InnerAssets, ReferenceType},
resolve::{find_context_file_or_package_key, options::ImportMapping, FindContextFileResult},
source::Source,
source_map::{GenerateSourceMap, OptionSourceMap, OptionStringifiedSourceMap},
source_map::{GenerateSourceMap, OptionStringifiedSourceMap},
source_transform::SourceTransform,
virtual_source::VirtualSource,
};
Expand Down
10 changes: 5 additions & 5 deletions turbopack/crates/turbopack-node/src/transforms/webpack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use turbo_tasks::{
trace::TraceRawVcs, Completion, NonLocalValue, OperationValue, OperationVc, ResolvedVc,
TaskInput, TryJoinIterExt, Value, ValueToString, Vc,
};
use turbo_tasks_bytes::{stream::SingleValue, Bytes};
use turbo_tasks_bytes::stream::SingleValue;
use turbo_tasks_env::ProcessEnv;
use turbo_tasks_fs::{
glob::Glob, json::parse_json_with_source_context, rope::Rope, DirectoryEntry, File,
Expand All @@ -33,7 +33,7 @@ use turbopack_core::{
resolve,
},
source::Source,
source_map::{GenerateSourceMap, OptionSourceMap, OptionStringifiedSourceMap, SourceMap},
source_map::{GenerateSourceMap, OptionStringifiedSourceMap},
source_transform::SourceTransform,
virtual_source::VirtualSource,
};
Expand Down Expand Up @@ -276,10 +276,10 @@ impl WebpackLoadersProcessedAsset {
// handle SourceMap
let source_map = if !transform.source_maps {
None
} else if let Some(source_map) = processed.map {
Some(Rope::from(source_map.into_owned()))
} else {
None
processed
.map
.map(|source_map| Rope::from(source_map.into_owned()))
};
let file = match processed.source {
Either::Left(str) => File::from(str),
Expand Down

0 comments on commit 029c3e3

Please sign in to comment.