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

Commit 67993d7

Browse files
authored
Merge pull request #156 from typescript-tools/beta
feat: add subcommand to lint depenendency versions for consistent values
2 parents 2087c19 + 2967add commit 67993d7

15 files changed

+418
-149
lines changed

Cargo.lock

Lines changed: 110 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "rust_typescript_tools"
2+
name = "typescript_tools"
33
version = "0.0.0-semantically-released"
44
edition = "2021"
55

@@ -8,9 +8,11 @@ name = "monorepo"
88
path = "src/main.rs"
99

1010
[dependencies]
11+
anyhow = "1.0"
1112
askama = "0.11"
1213
clap = { version = "3.1.8", features = ["cargo", "derive"] }
1314
globwalk = "0.8.1"
15+
pariter = "0.5.1"
1416
pathdiff = "0.2.1"
1517
serde = { version = "1.0", features = ["derive"] }
1618
serde_json = { version = "1.0", features = ["preserve_order"] }

src/configuration_file.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
use std::error::Error;
21
use std::path::{Path, PathBuf};
32

3+
use anyhow::Result;
4+
45
/// Configuration file for some component of the monorepo.
56
pub trait ConfigurationFile<T> {
67
/// Basename of the configuration file.
78
const FILENAME: &'static str;
89

910
/// Create an instance of this configuration file by reading
1011
/// the specified file from this directory on disk.
11-
fn from_directory<P>(monorepo_root: P, directory: P) -> Result<T, Box<dyn Error>>
12+
fn from_directory<P>(monorepo_root: P, directory: P) -> Result<T>
1213
where
1314
P: AsRef<Path>;
1415

@@ -20,5 +21,5 @@ pub trait ConfigurationFile<T> {
2021
fn path(&self) -> PathBuf;
2122

2223
/// Write this configuration file to disk.
23-
fn write(&self) -> Result<(), Box<dyn Error>>;
24+
fn write(&self) -> Result<()>;
2425
}

src/io.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
use std::error::Error;
21
use std::fs::File;
32
use std::io::{BufWriter, Write};
43
use std::path::Path;
54

5+
use anyhow::Result;
6+
67
use serde::{Deserialize, Serialize};
78

89
#[derive(Serialize, Deserialize, Debug, PartialEq)]
@@ -19,7 +20,7 @@ pub struct TypescriptParentProjectReference {
1920
pub fn write_project_references<P: AsRef<Path>>(
2021
path: P,
2122
references: &TypescriptParentProjectReference,
22-
) -> Result<(), Box<dyn Error>> {
23+
) -> Result<()> {
2324
let file = File::create(&path)?;
2425
let mut writer = BufWriter::new(file);
2526
serde_json::to_writer_pretty(&mut writer, references)?;

src/lib.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#![forbid(unsafe_code)]
2+
3+
mod configuration_file;
4+
mod io;
5+
mod monorepo_manifest;
6+
mod package_manifest;
7+
mod typescript_config;
8+
9+
pub mod link;
10+
pub mod lint;
11+
pub mod make_depend;
12+
pub mod opts;
13+
pub mod pin;
14+
pub mod query;

0 commit comments

Comments
 (0)