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

Staging #228

Open
wants to merge 19 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
pull_request:
branches:
- main
- develop

jobs:
test:
Expand All @@ -23,7 +24,7 @@ jobs:

- name: Download Dojo release artifact
run: |
curl -L -o dojo-linux-x86_64.tar.gz https://github.com/dojoengine/dojo/releases/download/v1.0.8/dojo_v1.0.8_linux_amd64.tar.gz
curl -L -o dojo-linux-x86_64.tar.gz https://github.com/dojoengine/dojo/releases/download/v1.0.9/dojo_v1.0.9_linux_amd64.tar.gz
tar -xzf dojo-linux-x86_64.tar.gz
sudo mv sozo /usr/local/bin/

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
.idea/
*.DS_Store/
data
.env
.node_modules
3 changes: 3 additions & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ package-lock.json
*.njsproj
*.sln
*.sw?

.env
node_modules
6 changes: 6 additions & 0 deletions client/dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
. ~/.nvm/nvm.sh # Load nvm
nvm use 23
concurrently -n "CLIENT,ELIZA" -c "blue,green" \
"vite" \
"cd ../eliza-starter && pnpm rebuild && pnpm start"
Comment on lines +1 to +6
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Improve script robustness and portability.

The script has several areas for improvement:

  1. The nvm path is hardcoded
  2. No error handling for nvm or Node.js version
  3. Missing error handling for the concurrent processes

Consider this improved version:

 #!/bin/bash
-. ~/.nvm/nvm.sh  # Load nvm
+# Load nvm from common locations
+if [ -f "$HOME/.nvm/nvm.sh" ]; then
+  . "$HOME/.nvm/nvm.sh"
+elif [ -f "/usr/local/opt/nvm/nvm.sh" ]; then
+  . "/usr/local/opt/nvm/nvm.sh"
+else
+  echo "Error: nvm not found"
+  exit 1
+fi
+
+# Ensure correct Node.js version
+if ! nvm use 23; then
+  echo "Error: Failed to switch to Node.js 23"
+  exit 1
+fi
+
+# Run concurrent processes
 concurrently -n "CLIENT,ELIZA" -c "blue,green" \
   "vite" \
-  "cd ../eliza-starter && pnpm rebuild && pnpm start" 
+  "cd ../eliza-starter && pnpm rebuild && pnpm start" \
+  --kill-others --handle-input
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#!/bin/bash
. ~/.nvm/nvm.sh # Load nvm
nvm use 23
concurrently -n "CLIENT,ELIZA" -c "blue,green" \
"vite" \
"cd ../eliza-starter && pnpm rebuild && pnpm start"
#!/bin/bash
# Load nvm from common locations
if [ -f "$HOME/.nvm/nvm.sh" ]; then
. "$HOME/.nvm/nvm.sh"
elif [ -f "/usr/local/opt/nvm/nvm.sh" ]; then
. "/usr/local/opt/nvm/nvm.sh"
else
echo "Error: nvm not found"
exit 1
fi
# Ensure correct Node.js version
if ! nvm use 23; then
echo "Error: Failed to switch to Node.js 23"
exit 1
fi
# Run concurrent processes
concurrently -n "CLIENT,ELIZA" -c "blue,green" \
"vite" \
"cd ../eliza-starter && pnpm rebuild && pnpm start" \
--kill-others --handle-input
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 2-2: ShellCheck can't follow non-constant source. Use a directive to specify location.

(SC1090)

4 changes: 2 additions & 2 deletions client/dojoConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { createDojoConfig } from "@dojoengine/core";
export const dojoConfig = createDojoConfig({
manifest,
rpcUrl: "https://api.cartridge.gg/x/starknet/sepolia",
toriiUrl: "https://api.cartridge.gg/x/mancala-t/torii",
toriiUrl: "https://api.cartridge.gg/x/mancala-e/torii",
masterAddress:
"0x02A54eFf65D55a2E7D2fC7E23eF0F0e6030dB0313b16c8F0eaD0b4a83807f6d6",
"0x02A54eFf65D55a2e7D2fC7E23eF0F0e6030dB0313b16c8F0eaD0b4a83807f6d6",
masterPrivateKey:
"0x0396533b7a1182ef03da483eca82e9dd2b17bee9c7fec07ac6cbbeb8bfd573cb",
});
21 changes: 12 additions & 9 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "MIT",
"type": "module",
"scripts": {
"dev": "vite",
"dev": "bash dev.sh",
"build": "tsc && vite build",
"test": "vitest",
"test:ui": "vitest --ui",
Expand All @@ -14,24 +14,26 @@
},
"dependencies": {
"@apollo/client": "^3.11.4",
"@cartridge/connector": "^0.5.7",
"@cartridge/controller": "^0.5.7",
"@dojoengine/core": "1.0.4-alpha.3.1.2",
"@dojoengine/create-burner": "1.0.4-alpha.3.1.2",
"@dojoengine/react": "1.0.4-alpha.3.1.2",
"@cartridge/connector": "^0.5.5",
"@cartridge/controller": "^0.5.8",
"@dojoengine/core": "1.0.8",
"@dojoengine/create-burner": "1.0.8",
"@dojoengine/react": "1.0.8",
"@dojoengine/recs": "^2.0.13",
"@dojoengine/state": "1.0.4-alpha.3.1.2",
"@dojoengine/torii-client": "1.0.4-alpha.3.1.2",
"@dojoengine/utils": "1.0.4-alpha.3.1.2",
"@dojoengine/state": "1.0.8",
"@dojoengine/torii-client": "1.0.8",
"@dojoengine/utils": "1.0.8",
"@graphql-codegen/typescript": "^4.0.9",
"@graphql-codegen/typescript-operations": "^4.2.3",
"@graphql-codegen/typescript-react-apollo": "^4.3.0",
"@headlessui/react": "^2.2.0",
"@heroicons/react": "^2.1.5",
"@latticexyz/react": "^2.1.0",
"@latticexyz/utils": "^2.1.0",
"@material-tailwind/react": "^2.1.9",
"@radix-ui/react-accordion": "^1.2.0",
"@radix-ui/react-checkbox": "^1.1.2",
"@radix-ui/react-dialog": "^1.1.4",
"@radix-ui/react-label": "^2.1.0",
"@radix-ui/react-radio-group": "^1.2.0",
"@radix-ui/react-slot": "^1.1.0",
Expand All @@ -44,6 +46,7 @@
"axios": "^1.7.7",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"concurrently": "^9.1.2",
"ethers": "^5.7.2",
"framer-motion": "^11.3.24",
"graphql-request": "^6.1.0",
Expand Down
Loading
Loading