diff --git a/Cargo.lock b/Cargo.lock index 76652d1..daa499f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3490,7 +3490,6 @@ dependencies = [ name = "position" version = "0.1.11" dependencies = [ - "anchor-lang", "bolt-lang 0.1.11", ] @@ -5628,7 +5627,6 @@ dependencies = [ name = "system-apply-velocity" version = "0.1.11" dependencies = [ - "anchor-lang", "anchor-spl", "bolt-lang 0.1.11", "position", @@ -5660,7 +5658,6 @@ dependencies = [ name = "system-fly" version = "0.1.11" dependencies = [ - "anchor-lang", "bolt-lang 0.1.11", "position", ] @@ -5669,7 +5666,6 @@ dependencies = [ name = "system-simple-movement" version = "0.1.11" dependencies = [ - "anchor-lang", "bolt-lang 0.1.11", "bolt-types", "serde", @@ -6198,7 +6194,6 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" name = "velocity" version = "0.1.11" dependencies = [ - "anchor-lang", "bolt-lang 0.1.11", ] diff --git a/crates/bolt-cli/src/templates/program/constants.rs.template b/crates/bolt-cli/src/templates/program/constants.rs.template index fae4535..aca644d 100644 --- a/crates/bolt-cli/src/templates/program/constants.rs.template +++ b/crates/bolt-cli/src/templates/program/constants.rs.template @@ -1,4 +1,4 @@ -use anchor_lang::prelude::*; +use bolt_lang::prelude::*; #[constant] -pub const SEED: &str = "anchor"; +pub const SEED: &str = "bolt"; diff --git a/crates/bolt-cli/src/templates/program/error.rs.template b/crates/bolt-cli/src/templates/program/error.rs.template index c37199a..13b369b 100644 --- a/crates/bolt-cli/src/templates/program/error.rs.template +++ b/crates/bolt-cli/src/templates/program/error.rs.template @@ -1,4 +1,4 @@ -use anchor_lang::prelude::*; +use bolt_lang::prelude::*; #[error_code] pub enum ErrorCode { diff --git a/crates/bolt-cli/src/templates/program/instructions/initialize.rs.template b/crates/bolt-cli/src/templates/program/instructions/initialize.rs.template index bc0305f..9bd6c2f 100644 --- a/crates/bolt-cli/src/templates/program/instructions/initialize.rs.template +++ b/crates/bolt-cli/src/templates/program/instructions/initialize.rs.template @@ -1,4 +1,4 @@ -use anchor_lang::prelude::*; +use bolt_lang::prelude::*; #[derive(Accounts)] pub struct Initialize {} diff --git a/crates/bolt-cli/src/templates/program/multiple.lib.rs.template b/crates/bolt-cli/src/templates/program/multiple.lib.rs.template index 66359f6..a76fea4 100644 --- a/crates/bolt-cli/src/templates/program/multiple.lib.rs.template +++ b/crates/bolt-cli/src/templates/program/multiple.lib.rs.template @@ -3,7 +3,7 @@ pub mod error; pub mod instructions; pub mod state; -use anchor_lang::prelude::*; +use bolt_lang::prelude::*; pub use constants::*; pub use instructions::*; diff --git a/crates/bolt-cli/src/templates/program/single.lib.rs.template b/crates/bolt-cli/src/templates/program/single.lib.rs.template index 2707a57..c7a6f75 100644 --- a/crates/bolt-cli/src/templates/program/single.lib.rs.template +++ b/crates/bolt-cli/src/templates/program/single.lib.rs.template @@ -1,4 +1,4 @@ -use anchor_lang::prelude::*; +use bolt_lang::prelude::*; declare_id!("{program_id}"); diff --git a/crates/bolt-cli/src/templates/workspace/Cargo.serde.toml.template b/crates/bolt-cli/src/templates/workspace/Cargo.serde.toml.template index 1fa5200..ba1ca6f 100644 --- a/crates/bolt-cli/src/templates/workspace/Cargo.serde.toml.template +++ b/crates/bolt-cli/src/templates/workspace/Cargo.serde.toml.template @@ -14,13 +14,12 @@ no-idl = [] no-log-ix-name = [] cpi = ["no-entrypoint"] default = [] -idl-build = ["anchor-lang/idl-build"] -anchor-debug = ["anchor-lang/anchor-debug"] +idl-build = ["bolt-lang/idl-build"] +anchor-debug = ["bolt-lang/anchor-debug"] custom-heap = [] custom-panic = [] [dependencies] bolt-lang.workspace = true -anchor-lang.workspace = true -serde = {{ version = "1.0", features = ["derive"] }} \ No newline at end of file +serde = {{ version = "1.0", features = ["derive"] }} diff --git a/crates/bolt-cli/src/templates/workspace/Cargo.toml.template b/crates/bolt-cli/src/templates/workspace/Cargo.toml.template index 6572742..df7e76e 100644 --- a/crates/bolt-cli/src/templates/workspace/Cargo.toml.template +++ b/crates/bolt-cli/src/templates/workspace/Cargo.toml.template @@ -14,11 +14,10 @@ no-idl = [] no-log-ix-name = [] cpi = ["no-entrypoint"] default = [] -idl-build = ["anchor-lang/idl-build"] -anchor-debug = ["anchor-lang/anchor-debug"] +idl-build = ["bolt-lang/idl-build"] +anchor-debug = ["bolt-lang/anchor-debug"] custom-heap = [] custom-panic = [] [dependencies] bolt-lang.workspace = true -anchor-lang.workspace = true diff --git a/crates/bolt-cli/src/templates/workspace/mod.rs b/crates/bolt-cli/src/templates/workspace/mod.rs index 43368cb..e79370f 100644 --- a/crates/bolt-cli/src/templates/workspace/mod.rs +++ b/crates/bolt-cli/src/templates/workspace/mod.rs @@ -1,13 +1,8 @@ use crate::VERSION; use heck::ToSnakeCase; -pub const ANCHOR_VERSION: &str = anchor_cli::VERSION; pub fn workspace_manifest() -> String { - format!( - include_str!("workspace.toml.template"), - VERSION = VERSION, - ANCHOR_VERSION = ANCHOR_VERSION - ) + format!(include_str!("workspace.toml.template"), VERSION = VERSION) } pub fn package_json(jest: bool) -> String { diff --git a/crates/bolt-cli/src/templates/workspace/workspace.toml.template b/crates/bolt-cli/src/templates/workspace/workspace.toml.template index 811cc37..66c266b 100644 --- a/crates/bolt-cli/src/templates/workspace/workspace.toml.template +++ b/crates/bolt-cli/src/templates/workspace/workspace.toml.template @@ -8,7 +8,6 @@ resolver = "2" [workspace.dependencies] bolt-lang = "{VERSION}" -anchor-lang = "{ANCHOR_VERSION}" [profile.release] overflow-checks = true diff --git a/crates/bolt-lang/Cargo.toml b/crates/bolt-lang/Cargo.toml index 151ef84..05eb5dc 100644 --- a/crates/bolt-lang/Cargo.toml +++ b/crates/bolt-lang/Cargo.toml @@ -8,6 +8,10 @@ homepage = { workspace = true } license = { workspace = true } edition = { workspace = true } +[features] +anchor-debug = ["anchor-lang/anchor-debug"] +idl-build = ["anchor-lang/idl-build"] + [dependencies] anchor-lang = { workspace = true } diff --git a/crates/bolt-lang/src/lib.rs b/crates/bolt-lang/src/lib.rs index d747e35..e2dc05a 100644 --- a/crates/bolt-lang/src/lib.rs +++ b/crates/bolt-lang/src/lib.rs @@ -1,3 +1,6 @@ +pub mod prelude; + +pub use anchor_lang; pub use anchor_lang::error::ErrorCode::AccountDidNotDeserialize as AccountDidNotDeserializeErrorCode; pub use anchor_lang::prelude::*; pub use anchor_lang::{ diff --git a/crates/bolt-lang/src/prelude.rs b/crates/bolt-lang/src/prelude.rs new file mode 100644 index 0000000..eacd997 --- /dev/null +++ b/crates/bolt-lang/src/prelude.rs @@ -0,0 +1,2 @@ +pub use anchor_lang; +pub use anchor_lang::prelude::*; diff --git a/examples/component-position/Cargo.toml b/examples/component-position/Cargo.toml index 1bd480d..8a77a47 100644 --- a/examples/component-position/Cargo.toml +++ b/examples/component-position/Cargo.toml @@ -18,11 +18,10 @@ no-idl = [] no-log-ix-name = [] cpi = ["no-entrypoint"] default = [] -idl-build = ["anchor-lang/idl-build"] -anchor-debug = ["anchor-lang/anchor-debug"] +idl-build = ["bolt-lang/idl-build"] +anchor-debug = ["bolt-lang/anchor-debug"] custom-heap = [] custom-panic = [] [dependencies] -anchor-lang = { workspace = true } bolt-lang = { path = "../../crates/bolt-lang" } diff --git a/examples/component-velocity/Cargo.toml b/examples/component-velocity/Cargo.toml index 94c951d..62ccfd9 100644 --- a/examples/component-velocity/Cargo.toml +++ b/examples/component-velocity/Cargo.toml @@ -18,12 +18,11 @@ no-idl = [] no-log-ix-name = [] cpi = ["no-entrypoint"] default = [] -idl-build = ["anchor-lang/idl-build"] -anchor-debug = ["anchor-lang/anchor-debug"] +idl-build = ["bolt-lang/idl-build"] +anchor-debug = ["bolt-lang/anchor-debug"] custom-heap = [] custom-panic = [] [dependencies] -anchor-lang = { workspace = true } bolt-lang = { path = "../../crates/bolt-lang" } diff --git a/examples/system-apply-velocity/Cargo.toml b/examples/system-apply-velocity/Cargo.toml index 2b76b93..4dd49cc 100644 --- a/examples/system-apply-velocity/Cargo.toml +++ b/examples/system-apply-velocity/Cargo.toml @@ -18,13 +18,12 @@ no-idl = [] no-log-ix-name = [] cpi = ["no-entrypoint"] default = [] -idl-build = ["anchor-lang/idl-build"] -anchor-debug = ["anchor-lang/anchor-debug"] +idl-build = ["bolt-lang/idl-build"] +anchor-debug = ["bolt-lang/anchor-debug"] custom-heap = [] custom-panic = [] [dependencies] -anchor-lang = { workspace = true } anchor-spl = { workspace = true, features = ["metadata"]} bolt-lang = { path = "../../crates/bolt-lang" } velocity = { path = "../component-velocity", features = ["cpi"]} diff --git a/examples/system-fly/Cargo.toml b/examples/system-fly/Cargo.toml index 91ea6b2..3d5d8c7 100644 --- a/examples/system-fly/Cargo.toml +++ b/examples/system-fly/Cargo.toml @@ -18,13 +18,12 @@ no-idl = [] no-log-ix-name = [] cpi = ["no-entrypoint"] default = [] -idl-build = ["anchor-lang/idl-build"] -anchor-debug = ["anchor-lang/anchor-debug"] +idl-build = ["bolt-lang/idl-build"] +anchor-debug = ["bolt-lang/anchor-debug"] custom-heap = [] custom-panic = [] [dependencies] -anchor-lang = { workspace = true } bolt-lang = { path = "../../crates/bolt-lang" } position = { path = "../component-position", features = ["cpi"]} diff --git a/examples/system-simple-movement/Cargo.toml b/examples/system-simple-movement/Cargo.toml index 0735700..cdebf79 100644 --- a/examples/system-simple-movement/Cargo.toml +++ b/examples/system-simple-movement/Cargo.toml @@ -18,13 +18,12 @@ no-idl = [] no-log-ix-name = [] cpi = ["no-entrypoint"] default = [] -idl-build = ["anchor-lang/idl-build"] -anchor-debug = ["anchor-lang/anchor-debug"] +idl-build = ["bolt-lang/idl-build"] +anchor-debug = ["bolt-lang/anchor-debug"] custom-heap = [] custom-panic = [] [dependencies] -anchor-lang = { workspace = true } serde = { workspace = true } bolt-lang = { path = "../../crates/bolt-lang" } bolt-types = { version = "0.1.6", path = "../../crates/types" }