Skip to content

Commit

Permalink
♻️ Code Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielePicco committed Nov 5, 2024
1 parent 20f7ffa commit afd4fca
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 40 deletions.
76 changes: 36 additions & 40 deletions cli/src/templates/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,50 +24,47 @@ codegen-units = 1

pub fn package_json(jest: bool) -> String {
if jest {
format!(
r#"{{
"scripts": {{
"lint:fix": "node_modules/.bin/prettier */*.js \"*/**/*{{.js,.ts}}\" -w",
"lint": "prettier */*.js \"*/**/*{{.js,.ts}}\" --check"
}},
"devDependencies": {{
r#"{
"scripts": {
"lint:fix": "node_modules/.bin/prettier */*.js \"*/**/*{.js,.ts}\" -w",
"lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
},
"devDependencies": {
"jest": "^29.0.3",
"prettier": "^2.6.2",
"@magicblock-labs/bolt-sdk": "latest"
}}
}}
}
}
"#
)
.to_string()
} else {
format!(
r#"{{
"scripts": {{
"lint:fix": "node_modules/.bin/prettier */*.js \"*/**/*{{.js,.ts}}\" -w",
"lint": "prettier */*.js \"*/**/*{{.js,.ts}}\" --check"
}},
"devDependencies": {{
r#"{
"scripts": {
"lint:fix": "node_modules/.bin/prettier */*.js \"*/**/*{.js,.ts}\" -w",
"lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
},
"devDependencies": {
"chai": "^4.3.4",
"mocha": "^9.0.3",
"prettier": "^2.6.2",
"@metaplex-foundation/beet": "^0.7.1",
"@metaplex-foundation/beet-solana": "^0.4.0",
"@magicblock-labs/bolt-sdk": "latest"
}}
}}
}
}
"#
)
.to_string()
}
}

pub fn ts_package_json(jest: bool) -> String {
if jest {
format!(
r#"{{
"scripts": {{
"lint:fix": "node_modules/.bin/prettier */*.js \"*/**/*{{.js,.ts}}\" -w",
"lint": "prettier */*.js \"*/**/*{{.js,.ts}}\" --check"
}},
"devDependencies": {{
r#"{
"scripts": {
"lint:fix": "node_modules/.bin/prettier */*.js \"*/**/*{.js,.ts}\" -w",
"lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
},
"devDependencies": {
"@types/bn.js": "^5.1.0",
"@types/jest": "^29.0.3",
"jest": "^29.0.3",
Expand All @@ -77,18 +74,17 @@ pub fn ts_package_json(jest: bool) -> String {
"@metaplex-foundation/beet": "^0.7.1",
"@metaplex-foundation/beet-solana": "^0.4.0",
"@magicblock-labs/bolt-sdk": "latest"
}}
}}
}
}
"#
)
.to_string()
} else {
format!(
r#"{{
"scripts": {{
"lint:fix": "node_modules/.bin/prettier */*.js \"*/**/*{{.js,.ts}}\" -w",
"lint": "prettier */*.js \"*/**/*{{.js,.ts}}\" --check"
}},
"devDependencies": {{
r#"{
"scripts": {
"lint:fix": "node_modules/.bin/prettier */*.js \"*/**/*{.js,.ts}\" -w",
"lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
},
"devDependencies": {
"chai": "^4.3.4",
"mocha": "^9.0.3",
"ts-mocha": "^10.0.0",
Expand All @@ -100,10 +96,10 @@ pub fn ts_package_json(jest: bool) -> String {
"@metaplex-foundation/beet": "^0.7.1",
"@metaplex-foundation/beet-solana": "^0.4.0",
"@magicblock-labs/bolt-sdk": "latest"
}}
}}
}
}
"#
)
.to_string()
}
}

Expand Down
1 change: 1 addition & 0 deletions programs/world/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(clippy::manual_unwrap_or_default)]
use anchor_lang::prelude::*;
use bolt_helpers_world_apply::apply_system;
use std::collections::BTreeSet;
Expand Down

0 comments on commit afd4fca

Please sign in to comment.