diff --git a/Cargo.lock b/Cargo.lock index a40007073..8c3dd3c41 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -669,6 +669,24 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +[[package]] +name = "elko" +version = "0.1.4" +dependencies = [ + "anyhow", + "cargo_metadata", + "clap", + "colored", + "etc", + "semver", + "serde", + "thiserror", + "toml", + "tracing", + "wasm-opt", + "zinkc", +] + [[package]] name = "elliptic-curve" version = "0.13.6" @@ -2403,18 +2421,10 @@ name = "zinkup" version = "0.1.4" dependencies = [ "anyhow", - "cargo_metadata", "clap", "color-eyre", - "colored", - "etc", - "semver", - "serde", - "thiserror", - "toml", - "tracing", + "elko", "tracing-subscriber", - "wasm-opt", "zinkc", ] diff --git a/Cargo.toml b/Cargo.toml index f7f8654c0..78b79e6a1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,25 +1,61 @@ -[workspace.package] -version = "0.1.4" -authors = ["clearloop"] -edition = "2021" -license = "GPL-3.0-only" -homepage = "https://github.com/clearloop/zink" -repository = "https://github.com/clearloop/zink.git" +[package] +name = "zinkup" +description = "Zink toolchain" +documentation = "https://docs.rs/zinkup" +version.workspace = true +authors.workspace = true +edition.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true + +[[bin]] +name = "zinkc" +required-features = [ "zinkc" ] + +[[bin]] +name = "elko" +required-features = [ "elko" ] + +[dependencies] +anyhow.workspace = true +clap = { workspace = true, features = [ "derive" ] } +color-eyre.workspace = true +tracing-subscriber = { workspace = true, features = [ "env-filter" ] } + +elko = { workspace = true, optional = true } +zinkc = { workspace = true, optional = true } + +[features] +default = [ "elko", "zinkc" ] +elko = [ "dep:elko" ] +zinkc = [ "dep:zinkc" ] + +# Workspace manifest +# ------------------ [workspace] members = [ - "cli", "codegen", "codegen/abi", "codegen/opcodes", "compiler", - "utils/*", + "utils/conta", + "utils/elko", "zink", "zink/codegen", "zint" ] resolver = "2" +[workspace.package] +version = "0.1.4" +authors = ["clearloop"] +edition = "2021" +license = "GPL-3.0-only" +homepage = "https://github.com/clearloop/zink" +repository = "https://github.com/clearloop/zink.git" + [workspace.dependencies] anyhow = "1.0.71" cargo_metadata = "0.15.4" @@ -53,9 +89,10 @@ wasmparser = "0.107.0" wat = "1.0.75" # Local Dependencies. +elko = { path = "utils/elko", version = "=0.1.4" } +opcodes = { package = "evm-opcodes", path = "codegen/opcodes", version = "=0.0.3", features = ["data"] } zabi = { path = "codegen/abi", version = "=0.1.4" } zinkup = { path = "cli", version = "=0.1.4" } -opcodes = { package = "evm-opcodes", path = "codegen/opcodes", version = "=0.0.3", features = ["data"] } zingen = { path = "codegen", version = "=0.1.4" } zinkc = { path = "compiler", version = "=0.1.4" } zink = { path = "zink", version = "=0.1.4" } diff --git a/Conta.toml b/Conta.toml index 8fa2b928f..4064273c0 100644 --- a/Conta.toml +++ b/Conta.toml @@ -4,5 +4,6 @@ packages = [ "zinkc", "zink-codegen", "zink", + "elko", "zinkup" ] diff --git a/cli/Cargo.toml b/cli/Cargo.toml deleted file mode 100644 index 8245688b4..000000000 --- a/cli/Cargo.toml +++ /dev/null @@ -1,41 +0,0 @@ -[package] -name = "zinkup" -description = "Zink toolchain" -documentation = "https://docs.rs/zinkup" -version.workspace = true -authors.workspace = true -edition.workspace = true -license.workspace = true -homepage.workspace = true -repository.workspace = true - -[[bin]] -path = "bin/elko.rs" -name = "elko" -required-features = ["elko"] - -[[bin]] -path = "bin/zinkc.rs" -name = "zinkc" -required-features = ["zinkc"] - -[dependencies] -anyhow.workspace = true -cargo_metadata = { workspace = true, optional = true } -clap = { workspace = true, features = ["derive"] } -color-eyre.workspace = true -colored = { workspace = true, optional = true } -etc = { workspace = true, optional = true } -semver = { workspace = true, optional = true } -serde = { workspace = true, optional = true, features = [ "derive" ] } -thiserror = { workspace = true, optional = true } -toml = { workspace = true, optional = true } -tracing.workspace = true -tracing-subscriber = { workspace = true, features = ["std", "env-filter"] } -wasm-opt = { workspace = true, optional = true } -zinkc = { workspace = true, optional = true } - -[features] -default = ["elko", "zinkc"] -elko = [ "cargo_metadata", "colored", "etc", "semver", "serde", "thiserror", "toml", "wasm-opt", "zinkc" ] -zinkc = [ "dep:zinkc" ] diff --git a/cli/README.md b/cli/README.md deleted file mode 100644 index 48717daf6..000000000 --- a/cli/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# `zinkup` - -The zink components are gathered here, you can install all of the -components directly with: - -```bash -cargo install zinkup -``` - -For installing only specified binaries: - -```bash -cargo install zinkup --features elko,zinkc -``` - -Available binaries: - -| Name | Description | -| ------- | ----------------------- | -| `elko` | Zink\'s package manager | -| `zinkc` | The zink compiler | - -## LICENSE - -GPL-3.0 diff --git a/cli/bin/elko.rs b/src/bin/elko.rs similarity index 100% rename from cli/bin/elko.rs rename to src/bin/elko.rs diff --git a/cli/bin/zinkc.rs b/src/bin/zinkc.rs similarity index 100% rename from cli/bin/zinkc.rs rename to src/bin/zinkc.rs diff --git a/cli/src/compile.rs b/src/compile.rs similarity index 100% rename from cli/src/compile.rs rename to src/compile.rs diff --git a/cli/src/lib.rs b/src/lib.rs similarity index 89% rename from cli/src/lib.rs rename to src/lib.rs index 3c9925479..ecdc45fef 100644 --- a/cli/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,4 @@ -//! Zink command line tool -#![deny(missing_docs)] +//! Zink toolchain. use anyhow::Error; use clap::Parser; @@ -7,17 +6,12 @@ use color_eyre::{eyre::eyre, Result}; pub use commands::*; use tracing_subscriber::filter::EnvFilter; -mod build; mod compile; -mod new; -pub mod utils; - mod commands { - #[cfg(feature = "elko")] - pub use crate::{build::Build, new::New}; - #[cfg(feature = "zinkc")] pub use crate::compile::Compile; + #[cfg(feature = "elko")] + pub use elko::{Build, New}; } /// Shared application interface. diff --git a/utils/elko/Cargo.toml b/utils/elko/Cargo.toml new file mode 100644 index 000000000..40b3c139d --- /dev/null +++ b/utils/elko/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "elko" +version.workspace = true +authors.workspace = true +edition.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true + +[dependencies] +anyhow.workspace = true +clap = { workspace = true, features = [ "derive" ] } +cargo_metadata.workspace = true +colored.workspace = true +etc.workspace = true +semver.workspace = true +serde = { workspace = true, features = [ "derive" ] } +thiserror.workspace = true +toml.workspace = true +tracing.workspace = true +wasm-opt.workspace = true +zinkc.workspace = true diff --git a/cli/src/build.rs b/utils/elko/src/build.rs similarity index 98% rename from cli/src/build.rs rename to utils/elko/src/build.rs index 4e81cb3d3..4017f3e9d 100644 --- a/cli/src/build.rs +++ b/utils/elko/src/build.rs @@ -1,5 +1,4 @@ //! Command `Build`. -#![cfg(feature = "elko")] use crate::utils::{Profile, WasmBuilder}; use anyhow::{anyhow, Result}; use clap::Parser; diff --git a/utils/elko/src/lib.rs b/utils/elko/src/lib.rs new file mode 100644 index 000000000..ae8dbeb14 --- /dev/null +++ b/utils/elko/src/lib.rs @@ -0,0 +1,7 @@ +//! Zink package manager. + +mod build; +mod new; +pub mod utils; + +pub use self::{build::Build, new::New}; diff --git a/cli/src/new.rs b/utils/elko/src/new.rs similarity index 98% rename from cli/src/new.rs rename to utils/elko/src/new.rs index c16d801e3..bdbf4c23b 100644 --- a/cli/src/new.rs +++ b/utils/elko/src/new.rs @@ -1,6 +1,4 @@ //! Command `New` -#![cfg(feature = "elko")] - use crate::utils::Manifest; use anyhow::{anyhow, Result}; use clap::Parser; diff --git a/cli/src/utils/manifest.rs b/utils/elko/src/utils/manifest.rs similarity index 100% rename from cli/src/utils/manifest.rs rename to utils/elko/src/utils/manifest.rs diff --git a/cli/src/utils/mod.rs b/utils/elko/src/utils/mod.rs similarity index 96% rename from cli/src/utils/mod.rs rename to utils/elko/src/utils/mod.rs index ef66c6bac..a270e8c3f 100644 --- a/cli/src/utils/mod.rs +++ b/utils/elko/src/utils/mod.rs @@ -1,5 +1,4 @@ //! CLI Utils -#![cfg(feature = "elko")] pub use self::{ manifest::Manifest, diff --git a/cli/src/utils/result.rs b/utils/elko/src/utils/result.rs similarity index 100% rename from cli/src/utils/result.rs rename to utils/elko/src/utils/result.rs diff --git a/cli/src/utils/wasm.rs b/utils/elko/src/utils/wasm.rs similarity index 100% rename from cli/src/utils/wasm.rs rename to utils/elko/src/utils/wasm.rs