Skip to content
This repository was archived by the owner on Sep 17, 2023. It is now read-only.

Commit 72e3349

Browse files
committed
refactor: rename struct
1 parent 4b140fc commit 72e3349

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/io.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub struct TypeScriptProjectReference {
3131
}
3232

3333
#[derive(Serialize)]
34-
pub struct TypeScriptProjectReferences {
34+
pub struct TypeScriptParentProjectReferences {
3535
pub files: Vec<String>,
3636
pub references: Vec<TypeScriptProjectReference>,
3737
}
@@ -85,7 +85,7 @@ pub fn write_tsconfig<P: AsRef<Path>>(
8585

8686
pub fn write_project_references<P: AsRef<Path>>(
8787
path: P,
88-
references: &TypeScriptProjectReferences,
88+
references: &TypeScriptParentProjectReferences,
8989
) -> Result<(), Box<dyn Error>> {
9090
let file = File::create(&path)?;
9191
let mut writer = BufWriter::new(file);

src/link.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use serde_json::{json, Value};
99
use crate::io::{
1010
get_internal_package_manifest_files, read_internal_package_manifests, read_lerna_manifest,
1111
read_tsconfig, write_project_references, write_tsconfig, PackageManifest,
12-
TypeScriptProjectReference, TypeScriptProjectReferences,
12+
TypeScriptParentProjectReferences, TypeScriptProjectReference,
1313
};
1414

1515
// Returns a path to an internal package relative to the monorepo root.
@@ -47,12 +47,12 @@ fn key_children_by_parent(
4747
accumulator
4848
}
4949

50-
// Serialize the TypeScript project references
51-
fn create_project_references(children: &mut Vec<String>) -> TypeScriptProjectReferences {
50+
// Serialize the TypeScript project references.
51+
fn create_project_references(children: &mut Vec<String>) -> TypeScriptParentProjectReferences {
5252
// Sort the TypeScript project references for deterministic file contents.
5353
// This minimizes diffs since the tsconfig.json files are stored in version control.
5454
children.sort_unstable();
55-
TypeScriptProjectReferences {
55+
TypeScriptParentProjectReferences {
5656
files: [].to_vec(),
5757
references: children
5858
.iter()
@@ -78,6 +78,7 @@ fn link_children_packages(
7878
.fold(HashMap::new(), key_children_by_parent)
7979
.iter_mut()
8080
.map(|(directory, children)| {
81+
// TODO: implement --check
8182
write_project_references(
8283
opts.root.join(directory).join("tsconfig.json"),
8384
&create_project_references(children),

0 commit comments

Comments
 (0)