Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: re-exporting anchor-lang #114

Merged
merged 3 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions cli/src/templates/program/constants.rs.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use anchor_lang::prelude::*;
use bolt_lang::prelude::*;

#[constant]
pub const SEED: &str = "anchor";
pub const SEED: &str = "bolt";
2 changes: 1 addition & 1 deletion cli/src/templates/program/error.rs.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use anchor_lang::prelude::*;
use bolt_lang::prelude::*;

#[error_code]
pub enum ErrorCode {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use anchor_lang::prelude::*;
use bolt_lang::prelude::*;

#[derive(Accounts)]
pub struct Initialize {}
Expand Down
2 changes: 1 addition & 1 deletion cli/src/templates/program/multiple.lib.rs.template
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;
Expand Down
2 changes: 1 addition & 1 deletion cli/src/templates/program/single.lib.rs.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use anchor_lang::prelude::*;
use bolt_lang::prelude::*;

declare_id!("{program_id}");

Expand Down
7 changes: 3 additions & 4 deletions cli/src/templates/workspace/Cargo.serde.toml.template
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }}
serde = {{ version = "1.0", features = ["derive"] }}
5 changes: 2 additions & 3 deletions cli/src/templates/workspace/Cargo.toml.template
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 1 addition & 6 deletions cli/src/templates/workspace/mod.rs
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
1 change: 0 additions & 1 deletion cli/src/templates/workspace/workspace.toml.template
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ resolver = "2"

[workspace.dependencies]
bolt-lang = "{VERSION}"
anchor-lang = "{ANCHOR_VERSION}"

[profile.release]
overflow-checks = true
Expand Down
4 changes: 4 additions & 0 deletions crates/bolt-lang/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

Expand Down
3 changes: 3 additions & 0 deletions crates/bolt-lang/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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::{
Expand Down
2 changes: 2 additions & 0 deletions crates/bolt-lang/src/prelude.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pub use anchor_lang;
pub use anchor_lang::prelude::*;
5 changes: 2 additions & 3 deletions examples/component-position/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
5 changes: 2 additions & 3 deletions examples/component-velocity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }

5 changes: 2 additions & 3 deletions examples/system-apply-velocity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]}
Expand Down
5 changes: 2 additions & 3 deletions examples/system-fly/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]}

Expand Down
5 changes: 2 additions & 3 deletions examples/system-simple-movement/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Loading