Skip to content

Commit

Permalink
v0.3.0: Refactor rename crates (#14)
Browse files Browse the repository at this point in the history
* refactor: Renames

mpm -> libmpm
mpm-cli -> mpm

* feat: adds a changelog

* feat: Version bump to 0.3.0
  • Loading branch information
dilawar authored Jan 4, 2024
1 parent 74dcc4a commit 2e0e6ea
Show file tree
Hide file tree
Showing 24 changed files with 62 additions and 128 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.3.0] - 2024-01-04

- Refactor: renamed mpm to libmpm and mpm-cli to mpm

## [0.2.0] - 2024-01-04

- Initial release
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[workspace]
resolver = "2"
members = ["mpm", "mpm-cli"]
exclude = ["*.png"]
members = ["libmpm", "mpm"]
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ahead in functionality.
## Basic Usage

```rust
use mpm::{managers, Package, PackageManager, Operation};
use libmpm::{managers, Package, PackageManager, Operation};

fn main() {
let brew = managers::HomeBrew; // no constructor is called because it's a unit struct
Expand Down Expand Up @@ -49,7 +49,7 @@ fn main() {
## Advanced usage
```rust

use mpm::{managers, verify::Verify, Cmd, Commands, PackageManager};
use libmpm::{managers, verify::Verify, Cmd, Commands, PackageManager};

fn main() {
// creating a verified instance (package manager known to be in path/installed)
Expand All @@ -69,7 +69,7 @@ fn main() {
// fully customize commands with the general purpose `consolidated_args` fn
// this example is impractical, but it shows how you can mix custom commands with default ones
// default command is retrieved for `List` and default flags for `Install`
let cmds = mpm::consolidate_args(
let cmds = libmpm::consolidate_args(
verified.get_cmds(Cmd::List),
&["anything"],
verified.get_flags(Cmd::Install),
Expand Down
21 changes: 21 additions & 0 deletions libmpm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "libmpm"
version = "0.3.0"
edition = "2021"
license = "AGPL-3.0"

[features]
default = ["verify"]
verify = []
choco = []
brew = []
apt = []
dnf = []
yum = ["dnf"]


[dependencies]

[[test]]
name = "basic"
required-features = ["verify", "choco", "brew", "apt", "dnf", "yum"]
File renamed without changes.
1 change: 0 additions & 1 deletion mpm/src/lib.rs → libmpm/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![doc = include_str!("libdoc.md")]
use std::{
borrow::Cow,
error::Error,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions mpm/tests/basic.rs → libmpm/tests/basic.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use mpm::verify::Verify;
use mpm::*;
use libmpm::verify::Verify;
use libmpm::*;

#[cfg(feature = "brew")]
#[cfg(not(target_os = "windows"))]
Expand Down
26 changes: 0 additions & 26 deletions mpm-cli/Cargo.toml

This file was deleted.

File renamed without changes.
29 changes: 14 additions & 15 deletions mpm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
[package]
name = "mpm"
version = "0.2.0"
version = "0.3.0"
edition = "2021"
license = "AGPL-3.0"

[features]
default = ["verify"]
verify = []
choco = []
brew = []
apt = []
dnf = []
yum = ["dnf"]


[dependencies]

[[test]]
name = "basic"
required-features = ["verify", "choco", "brew", "apt", "dnf", "yum"]
anyhow = "1.0.75"
clap = { version = "4.4.6", features = ["derive"] }
colored = "2.0.4"
strum = { version = "0.25.0", features = ["derive"] }
tabled = { version = "0.14.0", features = ["color"] }
libmpm = { path = "../libmpm", features = [
"verify",
"brew",
"choco",
"apt",
"dnf",
"yum",
] }
75 changes: 0 additions & 75 deletions mpm/src/libdoc.md

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion mpm-cli/src/utils.rs → mpm/src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use anyhow::{bail, Context, Result};
use manager::Manager;
use mpm::{verify::DynVerified, Operation};
use libmpm::{verify::DynVerified, Operation};
use parser::{Cli, Commands};
use strum::IntoEnumIterator;

Expand Down
2 changes: 1 addition & 1 deletion mpm-cli/src/utils/manager.rs → mpm/src/utils/manager.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::fmt::Display;

use clap::ValueEnum;
use mpm::{
use libmpm::{
managers::{AdvancedPackageTool, Chocolatey, DandifiedYUM, Homebrew, YellowdogUpdaterModified},
verify::{DynVerified, Verify},
};
Expand Down
2 changes: 1 addition & 1 deletion mpm-cli/src/utils/parser.rs → mpm/src/utils/parser.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::Manager;
use clap::{Parser, Subcommand};
use mpm::Package;
use libmpm::Package;

#[derive(Parser)]
#[command(
Expand Down
2 changes: 1 addition & 1 deletion mpm-cli/src/utils/print.rs → mpm/src/utils/print.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::Manager;
use anyhow::Error;
use colored::{ColoredString, Colorize};
use mpm::Package;
use libmpm::Package;
use strum::{EnumCount, IntoEnumIterator};
use tabled::{
settings::{object::Rows, themes::Colorization, Color, Style},
Expand Down

0 comments on commit 2e0e6ea

Please sign in to comment.