idl: Rename crate name to `anchor-lang-idl` (#2908)

This commit is contained in:
acheron 2024-04-15 13:56:53 +02:00 committed by GitHub
parent 257b560109
commit f74ea64ca6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
19 changed files with 36 additions and 36 deletions

28
Cargo.lock generated
View File

@ -170,7 +170,7 @@ dependencies = [
name = "anchor-attribute-program"
version = "0.29.0"
dependencies = [
"anchor-idl",
"anchor-lang-idl",
"anchor-syn",
"anyhow",
"bs58 0.5.0",
@ -186,8 +186,8 @@ name = "anchor-cli"
version = "0.29.0"
dependencies = [
"anchor-client",
"anchor-idl",
"anchor-lang",
"anchor-lang-idl",
"anyhow",
"base64 0.21.7",
"bincode",
@ -263,17 +263,6 @@ dependencies = [
"syn 1.0.109",
]
[[package]]
name = "anchor-idl"
version = "0.1.0"
dependencies = [
"anchor-syn",
"anyhow",
"regex",
"serde",
"serde_json",
]
[[package]]
name = "anchor-lang"
version = "0.29.0"
@ -287,7 +276,7 @@ dependencies = [
"anchor-derive-accounts",
"anchor-derive-serde",
"anchor-derive-space",
"anchor-idl",
"anchor-lang-idl",
"arrayref",
"base64 0.21.7",
"bincode",
@ -298,6 +287,17 @@ dependencies = [
"thiserror",
]
[[package]]
name = "anchor-lang-idl"
version = "0.1.0"
dependencies = [
"anchor-syn",
"anyhow",
"regex",
"serde",
"serde_json",
]
[[package]]
name = "anchor-spl"
version = "0.29.0"

View File

@ -17,7 +17,7 @@ dev = []
[dependencies]
anchor-client = { path = "../client", version = "0.29.0" }
anchor-idl = { path = "../idl", features = ["build"], version = "0.1.0" }
anchor-lang-idl = { path = "../idl", features = ["build"], version = "0.1.0" }
anchor-lang = { path = "../lang", version = "0.29.0" }
anyhow = "1.0.32"
base64 = "0.21"

View File

@ -1,6 +1,6 @@
use crate::is_hidden;
use anchor_client::Cluster;
use anchor_idl::types::Idl;
use anchor_lang_idl::types::Idl;
use anyhow::{anyhow, bail, Context, Error, Result};
use clap::{Parser, ValueEnum};
use dirs::home_dir;

View File

@ -6,9 +6,9 @@ use crate::config::{
DEFAULT_LEDGER_PATH, SHUTDOWN_WAIT, STARTUP_WAIT,
};
use anchor_client::Cluster;
use anchor_idl::types::{Idl, IdlArrayLen, IdlDefinedFields, IdlType, IdlTypeDefTy};
use anchor_lang::idl::{IdlAccount, IdlInstruction, ERASED_AUTHORITY};
use anchor_lang::{AccountDeserialize, AnchorDeserialize, AnchorSerialize};
use anchor_lang_idl::types::{Idl, IdlArrayLen, IdlDefinedFields, IdlType, IdlTypeDefTy};
use anyhow::{anyhow, Context, Result};
use checks::{check_anchor_version, check_overflow};
use clap::Parser;
@ -2609,7 +2609,7 @@ fn idl_build(
.path
}
};
let idl = anchor_idl::build::build_idl(
let idl = anchor_lang_idl::build::build_idl(
program_path,
cfg.features.resolution,
cfg.features.skip_lint || skip_lint,
@ -2655,7 +2655,7 @@ in `{path}`."#
));
}
anchor_idl::build::build_idl(
anchor_lang_idl::build::build_idl(
std::env::current_dir()?,
cfg.features.resolution,
cfg.features.skip_lint || skip_lint,

View File

@ -2,7 +2,7 @@ use crate::{
config::ProgramWorkspace, create_files, override_or_create_files, solidity_template, Files,
VERSION,
};
use anchor_idl::types::Idl;
use anchor_lang_idl::types::Idl;
use anyhow::Result;
use clap::{Parser, ValueEnum};
use heck::{ToLowerCamelCase, ToPascalCase, ToSnakeCase};

View File

@ -1,5 +1,5 @@
[package]
name = "anchor-idl"
name = "anchor-lang-idl"
version = "0.1.0"
authors = ["Anchor Maintainers <accounts@200ms.io>"]
repository = "https://github.com/coral-xyz/anchor"

View File

@ -33,7 +33,7 @@ idl-build = [
"anchor-attribute-program/idl-build",
"anchor-derive-accounts/idl-build",
"anchor-derive-serde/idl-build",
"anchor-idl/build",
"anchor-lang-idl/build",
]
init-if-needed = ["anchor-derive-accounts/init-if-needed"]
interface-instructions = ["anchor-attribute-program/interface-instructions"]
@ -49,8 +49,8 @@ anchor-derive-accounts = { path = "./derive/accounts", version = "0.29.0" }
anchor-derive-serde = { path = "./derive/serde", version = "0.29.0" }
anchor-derive-space = { path = "./derive/space", version = "0.29.0" }
# `anchor-idl` should only be included with `idl-build` feature
anchor-idl = { path = "../idl", version = "0.1.0", optional = true }
# `anchor-lang-idl` should only be included with `idl-build` feature
anchor-lang-idl = { path = "../idl", version = "0.1.0", optional = true }
arrayref = "0.3"
base64 = "0.21"

View File

@ -17,7 +17,7 @@ idl-build = ["anchor-syn/idl-build"]
interface-instructions = ["anchor-syn/interface-instructions"]
[dependencies]
anchor-idl = { path = "../../../idl", version = "0.1.0" }
anchor-lang-idl = { path = "../../../idl", version = "0.1.0" }
anchor-syn = { path = "../../syn", version = "0.29.0" }
anyhow = "1"
bs58 = "0.5"

View File

@ -1,4 +1,4 @@
use anchor_idl::types::{
use anchor_lang_idl::types::{
Idl, IdlArrayLen, IdlDefinedFields, IdlField, IdlGenericArg, IdlRepr, IdlSerialization,
IdlType, IdlTypeDef, IdlTypeDefGeneric, IdlTypeDefTy,
};

View File

@ -1,7 +1,7 @@
mod common;
mod mods;
use anchor_idl::types::Idl;
use anchor_lang_idl::types::Idl;
use anyhow::anyhow;
use quote::{quote, ToTokens};
use syn::parse::{Parse, ParseStream};

View File

@ -1,4 +1,4 @@
use anchor_idl::types::{Idl, IdlSerialization};
use anchor_lang_idl::types::{Idl, IdlSerialization};
use quote::{format_ident, quote};
use super::common::{convert_idl_type_def_to_ts, gen_discriminator, get_canonical_program_id};

View File

@ -1,4 +1,4 @@
use anchor_idl::types::Idl;
use anchor_lang_idl::types::Idl;
use quote::quote;
use super::common::gen_accounts_common;

View File

@ -1,4 +1,4 @@
use anchor_idl::types::{Idl, IdlType};
use anchor_lang_idl::types::{Idl, IdlType};
use quote::{format_ident, quote, ToTokens};
use super::common::convert_idl_type_to_str;

View File

@ -1,4 +1,4 @@
use anchor_idl::types::Idl;
use anchor_lang_idl::types::Idl;
use heck::CamelCase;
use quote::{format_ident, quote};

View File

@ -1,4 +1,4 @@
use anchor_idl::types::Idl;
use anchor_lang_idl::types::Idl;
use quote::{format_ident, quote};
use super::common::{convert_idl_type_def_to_ts, gen_discriminator};

View File

@ -1,4 +1,4 @@
use anchor_idl::types::{Idl, IdlInstructionAccountItem};
use anchor_lang_idl::types::{Idl, IdlInstructionAccountItem};
use anchor_syn::{
codegen::accounts::{__client_accounts, __cpi_client_accounts},
parser::accounts,

View File

@ -1,4 +1,4 @@
use anchor_idl::types::Idl;
use anchor_lang_idl::types::Idl;
use quote::quote;
use super::common::convert_idl_type_def_to_ts;

View File

@ -1,4 +1,4 @@
use anchor_idl::types::Idl;
use anchor_lang_idl::types::Idl;
use quote::{format_ident, quote};
use super::common::gen_discriminator;

View File

@ -80,4 +80,4 @@ impl IdlAccount {
}
#[cfg(feature = "idl-build")]
pub use anchor_idl::{build::IdlBuild, *};
pub use anchor_lang_idl::{build::IdlBuild, *};