WIP install command

This commit is contained in:
SkyfallWasTaken 2024-07-29 15:43:52 +01:00
parent 32845b9006
commit f59bb4def4
9 changed files with 44 additions and 11 deletions

View file

@ -1,6 +1,6 @@
[package]
name = "dinopkg-package-json"
version = "0.1.0"
version = "0.2.0"
edition = "2021"
[dependencies]

View file

@ -8,12 +8,12 @@ mod util;
#[serde_as]
#[skip_serializing_none]
#[derive(Serialize, Deserialize)]
#[derive(Serialize, Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct PackageJson {
pub name: String,
pub version: String,
pub author: Option<String>,
pub author: Option<AuthorObjOrString>,
#[serde(default = "default_as_false")]
#[serde(skip_serializing_if = "is_false")]
pub private: bool,
@ -28,6 +28,13 @@ pub struct PackageJson {
pub dev_dependencies: Option<Dependencies>,
}
#[derive(Serialize, Deserialize, Debug)]
#[serde(untagged)]
pub enum AuthorObjOrString {
Author { name: String, url: Option<String> },
String(String),
}
// serde :/
#[allow(clippy::trivially_copy_pass_by_ref)]
#[inline(always)]