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

fix(turborepo): Parse turbo json with comments #5623

Merged
merged 1 commit into from
Jul 27, 2023
Merged
Changes from all 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
6 changes: 3 additions & 3 deletions crates/turborepo-lib/src/config/turbo.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::{
collections::{BTreeMap, HashMap, HashSet},
fs,
path::Path,
};

Expand Down Expand Up @@ -495,8 +494,9 @@ impl TurboJson {
/// Reads a `RawTurboJson` from the given path
/// and then converts it into `TurboJson`
fn read(path: &AbsoluteSystemPath) -> Result<TurboJson, Error> {
let contents = fs::read_to_string(path)?;
let turbo_json: RawTurboJSON = serde_json::from_str(&contents)?;
let contents = path.read()?;
let turbo_json: RawTurboJSON =
serde_json::from_reader(json_comments::StripComments::new(contents.as_slice()))?;

turbo_json.try_into()
}
Expand Down
Loading