-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: updated project structure for monorepo development
- Loading branch information
1 parent
3e0ce4e
commit 7319514
Showing
18 changed files
with
222 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[alias] | ||
xtask = "run --package xtask --bin xtask --" | ||
|
||
[env] | ||
CARGO_WORKSPACE_DIR = { value = "", relative = true } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,16 @@ | ||
[package] | ||
name = "gpt" | ||
description = "A CLI tool to generate and pretty-print code snippets from GPT3" | ||
repository = "https://github.com/guzmonne/gpt" | ||
license = "MIT" | ||
version = "0.1.0" | ||
edition = "2021" | ||
create-type = "bin" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
bat = "0.22.1" | ||
copypasta-ext = "0.4.4" | ||
reqwest = { version = "0.11.14", features = ["blocking"] } | ||
serde = { version = "1.0.152", features = ["derive"] } | ||
serde_json = "1.0.93" | ||
env_logger = "0.10.0" | ||
log = "0.4.17" | ||
chrono = "0.4.23" | ||
clap = { version = "4.1.8", features = ["derive"] } | ||
[workspace] | ||
members = ["xtask/", "lib/*", "crates/*"] | ||
|
||
[[bin]] | ||
name = "a" | ||
path = "src/main.rs" | ||
|
||
[[bin]] | ||
name = "v2" | ||
path = "v2/main.rs" | ||
|
||
[lib] | ||
name = "a" | ||
path = "src/lib.rs" | ||
[workspace.package] | ||
edition = "2021" | ||
license = "MIT" | ||
authors = ["Guzmán Monné"] | ||
|
||
[features] | ||
clipboard = [] | ||
[profile.dev] | ||
# Disabling debug info speeds up builds. | ||
debug = 0 | ||
|
||
default = ["clipboard"] | ||
[profile.release] | ||
incremental = true | ||
# Set this to 1 or 2 to get more useful backtraces in debugger. | ||
debug = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
[package] | ||
name = "gpt" | ||
version = "0.0.0" | ||
homepage = "https://github.com/cloudbridgeuy/a" | ||
description = "A CLI tool to interact with ChatGPT as a Software Engineer" | ||
autobins = false | ||
|
||
authors.workspace = true | ||
edition.workspace = true | ||
license.workspace = true | ||
|
||
[[bin]] | ||
name = "a" | ||
path = "src/main.rs" | ||
|
||
[lib] | ||
name = "a" | ||
path = "src/lib.rs" | ||
|
||
[dependencies] | ||
bat = "0.22.1" | ||
copypasta-ext = "0.4.4" | ||
reqwest = { version = "0.11.14", features = ["blocking"] } | ||
serde = { version = "1.0.152", features = ["derive"] } | ||
serde_json = "1.0.93" | ||
env_logger = "0.10.0" | ||
log = "0.4.17" | ||
chrono = "0.4.23" | ||
|
||
[features] | ||
clipboard = [] | ||
default = ["clipboard"] |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[package] | ||
name = "b" | ||
version = "0.0.0" | ||
homepage = "https://github.com/cloudbridgeuy/a" | ||
description = "A CLI tool to interact with ChatGPT as a Software Engineer" | ||
autobins = false | ||
|
||
authors.workspace = true | ||
edition.workspace = true | ||
license.workspace = true | ||
|
||
[[bin]] | ||
name = "b" | ||
path = "src/main.rs" | ||
|
||
[lib] | ||
name = "b" | ||
path = "src/lib.rs" | ||
|
||
[dependencies] | ||
clap = { version = "4.1.8", features = ["derive"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# /Lib | ||
|
||
> Crates in this directory are published to crates.io and **must obey** semver. | ||
_We currently don't have anything published. Yet._ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[package] | ||
name = "xtask" | ||
version = "0.1.0" | ||
publish = false | ||
license = "MIT" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
clap = { version = "4.1.8", features = ["derive"] } # a simple to use, efficient, and full-featured Command Line Argument Parser | ||
duct = "0.13.6" # a library for running child processes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
pub fn script(name: &str) { | ||
println!("Hello, {}!", name); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use clap::{Parser, Subcommand}; | ||
|
||
#[derive(Debug, Parser)] | ||
#[command(name="xtasks")] | ||
#[command(about="Run project tasks using rust instead of scripts")] | ||
pub struct App { | ||
#[command(subcommand)] | ||
pub command: Option<Commands>, | ||
} | ||
|
||
#[derive(Debug, Subcommand)] | ||
pub enum Commands { | ||
/// Runs one of the project binaries | ||
Run { | ||
/// Name of the binary to run. | ||
#[arg(short, long)] | ||
name: String, | ||
}, | ||
/// Builds one of the project binaries | ||
Build { | ||
/// Name of the binary to run. | ||
#[arg(short, long)] | ||
name: String, | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
//! See <https://github.com/matklad/cargo-xtask/> | ||
//! | ||
//! This binary defines various auxiliary build commands, which are not | ||
//! expressible with just `cargo`. | ||
//! | ||
//! The binary is integrated into the `cargo` command line by using an | ||
//! alias in `.cargo/config`. | ||
|
||
mod cli; | ||
mod run; | ||
mod build; | ||
|
||
use clap::Parser; | ||
|
||
fn main() -> Result<(), Box<dyn std::error::Error>> { | ||
let cli = cli::App::parse(); | ||
|
||
match &cli.command { | ||
Some(cli::Commands::Run { name }) => { | ||
run::script(name)?; | ||
return Ok(()); | ||
} | ||
Some(cli::Commands::Build { name }) => { | ||
build::script(name); | ||
return Ok(()); | ||
} | ||
None => { | ||
panic!("No command specified"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
use std::error::Error; | ||
use duct::cmd; | ||
|
||
pub fn script(name: &str) -> Result<(), Box<dyn Error>>{ | ||
cmd!("cargo", "run", "--bin", name).run()?; | ||
|
||
Ok(()) | ||
} |