Skip to content

Commit

Permalink
refactor: <🍔> move config to bin pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
towry committed Jul 31, 2024
1 parent 996f3ea commit d21aa1b
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
6 changes: 6 additions & 0 deletions npmpink-bin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,9 @@ anyhow = "1.0.86"
inquire = "0.7.5"
lazycell = "1.3.0"
regex = "1.10.5"
home = "0.5.9"
lazy_static = "1.5.0"
serde = { version = "1.0.203", features = ["derive"] }
serde_json = "1.0.119"
serde_test = "1.0.176"
thiserror = "1.0.61"
7 changes: 2 additions & 5 deletions npmpink-bin/src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
// https://github.com/clap-rs/clap/blob/master/examples/git-derive.rs
// https://docs.rs/clap/latest/clap/_derive/index.html#terminology
use crate::config::{appConfig, Config, HealthCheckError};
use anyhow::{bail, Result};
use clap::{Parser, Subcommand};
use npmpink_core::config::HealthCheckError;
use npmpink_core::ops::packages::{difference_packages, packages_from_source};
use npmpink_core::package::Package;
use npmpink_core::source::Source;
use npmpink_core::target::Target;
use npmpink_core::{
config::{appConfig, Config},
workspace::Workspace,
};
use npmpink_core::workspace::Workspace;
use npmpink_tui::shell::shell;
use std::cell::{RefCell, RefMut};
use std::path::PathBuf;
Expand Down
2 changes: 1 addition & 1 deletion npmpink-core/src/config.rs → npmpink-bin/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::source::Source;
use anyhow::Result;
#[allow(unused_imports)]
use home::home_dir as crate_home_dir;
use lazy_static::lazy_static;
use npmpink_core::source::Source;
use serde::{Deserialize, Serialize};
use std::fs;
use std::io::prelude::*;
Expand Down
1 change: 1 addition & 0 deletions npmpink-bin/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
mod cli;
mod config;
mod prompts;

use cli::*;
Expand Down
1 change: 0 additions & 1 deletion npmpink-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ edition = "2021"

[dependencies]
anyhow = "1.0.86"
home = "0.5.9"
ignore = "0.4.22"
lazy_static = "1.5.0"
lazycell = "1.3.0"
Expand Down
1 change: 0 additions & 1 deletion npmpink-core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
pub mod config;
pub mod lockfile;
pub mod ops;
pub mod package;
Expand Down

0 comments on commit d21aa1b

Please sign in to comment.