Skip to content

Commit

Permalink
chore: merge pull request #22 from websublime/feature/pretty-json-pnpm
Browse files Browse the repository at this point in the history
feat: changes pretty json and remove root package for pnpm
  • Loading branch information
miguelramos authored Jul 24, 2024
2 parents de301e8 + 95b7424 commit b2d3d73
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion 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 Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "workspace-node-tools"
version = "1.0.10"
version = "1.0.11"
edition = "2021"
description = "Node workspace version tools"
repository = "https://github.com/websublime/workspace-node-tools"
Expand Down
4 changes: 2 additions & 2 deletions src/changes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ pub fn add_change(change: &Change, cwd: Option<String>) -> bool {
let changes_file = File::create(changes_path).unwrap();
let changes_writer = BufWriter::new(changes_file);

serde_json::to_writer(changes_writer, &changes).unwrap();
serde_json::to_writer_pretty(changes_writer, &changes).unwrap();

return true;
}
Expand Down Expand Up @@ -242,7 +242,7 @@ pub fn remove_change(branch_name: String, cwd: Option<String>) -> bool {
let changes_file = File::create(changes_path).unwrap();
let changes_writer = BufWriter::new(changes_file);

serde_json::to_writer(changes_writer, &changes).unwrap();
serde_json::to_writer_pretty(changes_writer, &changes).unwrap();

return true;
}
Expand Down
3 changes: 2 additions & 1 deletion src/packages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ pub fn get_packages(cwd: Option<String>) -> Vec<PackageInfo> {
changed_files: vec![],
}
})
.filter(|pkg| !pkg.root)
.collect::<Vec<PackageInfo>>()
}
Some(PackageManager::Yarn) | Some(PackageManager::Npm) => {
Expand Down Expand Up @@ -503,7 +504,7 @@ mod tests {

let packages = get_packages(project_root);

assert_eq!(packages.len(), 3);
assert_eq!(packages.len(), 2);
remove_dir_all(&monorepo_dir)?;
Ok(())
}
Expand Down

0 comments on commit b2d3d73

Please sign in to comment.