Skip to content

Commit

Permalink
refactor: rename zkstack crates with unique names for publishing (#3443)
Browse files Browse the repository at this point in the history
## What ❔

* [x] Rename `zkstack_cli` crates with unique names for publishing.
* [x] Set individual versions of the `zkstack_cli` workspace crates to
the common workspace version.

<!-- What are the changes this PR brings about? -->
<!-- Example: This PR adds a PR template to the repo. -->
<!-- (For bigger PRs adding more context is appreciated) -->

## Why ❔

To allow publishing to crates.io.

<!-- Why are these changes done? What goal do they contribute to? What
are the principles behind them? -->
<!-- Example: PR templates ensure PR reviewers, observers, and future
iterators are in context about the evolution of repos. -->

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [x] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [x] Tests for the changes have been added / updated.
- [x] Documentation comments have been added / updated.
- [x] Code has been formatted via `zkstack dev fmt` and `zkstack dev
lint`.
  • Loading branch information
antonbaliasnikov authored Jan 9, 2025
1 parent ecccdda commit d4bfdb8
Show file tree
Hide file tree
Showing 142 changed files with 446 additions and 429 deletions.
148 changes: 74 additions & 74 deletions zkstack_cli/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions zkstack_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ keywords = ["zk", "cryptography", "blockchain", "ZKStack", "ZKsync"]

[workspace.dependencies]
# Local dependencies
common = { path = "crates/common" }
config = { path = "crates/config" }
types = { path = "crates/types" }
git_version_macro = { path = "crates/git_version_macro" }
zkstack_cli_common = { path = "crates/common" }
zkstack_cli_config = { path = "crates/config" }
zkstack_cli_types = { path = "crates/types" }
zkstack_cli_git_version_macro = { path = "crates/git_version_macro" }

# ZkSync deps
zksync_config = { path = "../core/lib/config" }
Expand Down
8 changes: 4 additions & 4 deletions zkstack_cli/crates/common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "common"
version = "0.1.0"
name = "zkstack_cli_common"
version.workspace = true
edition.workspace = true
homepage.workspace = true
license.workspace = true
Expand All @@ -24,12 +24,12 @@ serde_yaml.workspace = true
sqlx.workspace = true
tokio.workspace = true
toml.workspace = true
types.workspace = true
zkstack_cli_types.workspace = true
url.workspace = true
xshell.workspace = true
thiserror.workspace = true
strum.workspace = true
git_version_macro.workspace = true
zkstack_cli_git_version_macro.workspace = true
async-trait.workspace = true
zksync_system_constants.workspace = true
zksync_types.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion zkstack_cli/crates/common/src/ethereum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use ethers::{
providers::Middleware,
types::{Address, TransactionRequest},
};
use types::TokenInfo;
use zkstack_cli_types::TokenInfo;

use crate::{logger, wallets::Wallet};

Expand Down
8 changes: 4 additions & 4 deletions zkstack_cli/crates/common/src/version.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const GIT_VERSION: &str = git_version_macro::build_git_revision!();
const GIT_BRANCH: &str = git_version_macro::build_git_branch!();
const GIT_SUBMODULES: &[(&str, &str)] = git_version_macro::build_git_submodules!();
const BUILD_TIMESTAMP: &str = git_version_macro::build_timestamp!();
const GIT_VERSION: &str = zkstack_cli_git_version_macro::build_git_revision!();
const GIT_BRANCH: &str = zkstack_cli_git_version_macro::build_git_branch!();
const GIT_SUBMODULES: &[(&str, &str)] = zkstack_cli_git_version_macro::build_git_submodules!();
const BUILD_TIMESTAMP: &str = zkstack_cli_git_version_macro::build_timestamp!();

/// Returns a multi-line version message that includes:
/// - provided crate version
Expand Down
2 changes: 1 addition & 1 deletion zkstack_cli/crates/common/src/wallets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use ethers::{
types::{Address, H256},
};
use serde::{Deserialize, Serialize};
use types::parse_h256;
use zkstack_cli_types::parse_h256;

#[derive(Serialize, Deserialize)]
struct WalletSerde {
Expand Down
8 changes: 4 additions & 4 deletions zkstack_cli/crates/config/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "config"
version = "0.1.0"
name = "zkstack_cli_config"
version.workspace = true
edition.workspace = true
homepage.workspace = true
license.workspace = true
Expand All @@ -13,15 +13,15 @@ keywords.workspace = true
[dependencies]
anyhow.workspace = true
clap.workspace = true
common.workspace = true
zkstack_cli_common.workspace = true
ethers.workspace = true
rand.workspace = true
serde.workspace = true
serde_json.workspace = true
serde_yaml.workspace = true
strum.workspace = true
thiserror.workspace = true
types.workspace = true
zkstack_cli_types.workspace = true
url.workspace = true
xshell.workspace = true

Expand Down
2 changes: 1 addition & 1 deletion zkstack_cli/crates/config/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use std::{
};

use serde::{Deserialize, Serialize, Serializer};
use types::{BaseToken, L1BatchCommitmentMode, L1Network, ProverMode, WalletCreation};
use xshell::Shell;
use zkstack_cli_types::{BaseToken, L1BatchCommitmentMode, L1Network, ProverMode, WalletCreation};
use zksync_basic_types::L2ChainId;
use zksync_config::configs::{GatewayChainConfig, GatewayConfig};

Expand Down
4 changes: 2 additions & 2 deletions zkstack_cli/crates/config/src/ecosystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ use std::{
path::{Path, PathBuf},
};

use common::{config::global_config, logger};
use serde::{Deserialize, Serialize, Serializer};
use thiserror::Error;
use types::{L1Network, ProverMode, WalletCreation};
use xshell::Shell;
use zkstack_cli_common::{config::global_config, logger};
use zkstack_cli_types::{L1Network, ProverMode, WalletCreation};
use zksync_basic_types::L2ChainId;

use crate::{
Expand Down
2 changes: 1 addition & 1 deletion zkstack_cli/crates/config/src/explorer_compose.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ use std::{
};

use anyhow::Context;
use common::{db, docker::adjust_localhost_for_docker};
use serde::{Deserialize, Serialize};
use url::Url;
use zkstack_cli_common::{db, docker::adjust_localhost_for_docker};

use crate::{
consts::{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// TODO(EVM-927): Note that the contents of this file are not useable without Gateway contracts.
use ethers::abi::Address;
use serde::{Deserialize, Serialize};
use types::ProverMode;
use zkstack_cli_types::ProverMode;
use zksync_basic_types::{H256, U256};
use zksync_config::GenesisConfig;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// TODO(EVM-927): Note that the contents of this file are not useable without Gateway contracts.
use ethers::types::Address;
use serde::{Deserialize, Serialize};
use types::L1BatchCommitmentMode;
use zkstack_cli_types::L1BatchCommitmentMode;
use zksync_basic_types::L2ChainId;

use crate::{traits::ZkStackConfig, ChainConfig};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use ethers::types::Address;
use rand::Rng;
use serde::{Deserialize, Serialize};
use types::L1BatchCommitmentMode;
use zkstack_cli_types::L1BatchCommitmentMode;
use zksync_basic_types::L2ChainId;

use crate::{traits::ZkStackConfig, ChainConfig, ContractsConfig};
Expand Down
2 changes: 1 addition & 1 deletion zkstack_cli/crates/config/src/general.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use std::path::{Path, PathBuf};

use anyhow::Context;
use common::yaml::merge_yaml;
use url::Url;
use xshell::Shell;
use zkstack_cli_common::yaml::merge_yaml;
use zksync_config::configs::object_store::ObjectStoreMode;
pub use zksync_config::configs::GeneralConfig;
use zksync_protobuf_config::{encode_yaml_repr, read_yaml_repr};
Expand Down
2 changes: 1 addition & 1 deletion zkstack_cli/crates/config/src/portal.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::path::{Path, PathBuf};

use serde::{Deserialize, Serialize};
use types::TokenInfo;
use xshell::Shell;
use zkstack_cli_types::TokenInfo;

use crate::{
consts::{
Expand Down
2 changes: 1 addition & 1 deletion zkstack_cli/crates/config/src/secrets.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::{path::Path, str::FromStr};

use anyhow::Context;
use common::db::DatabaseConfig;
use xshell::Shell;
use zkstack_cli_common::db::DatabaseConfig;
use zksync_basic_types::url::SensitiveUrl;
pub use zksync_config::configs::Secrets as SecretsConfig;
use zksync_protobuf_config::{encode_yaml_repr, read_yaml_repr};
Expand Down
Loading

0 comments on commit d4bfdb8

Please sign in to comment.