-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updates burners, updates phaser example
- Loading branch information
1 parent
c932062
commit 7853b8a
Showing
24 changed files
with
542 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,60 @@ | ||
{ | ||
"name": "react-phaser-example", | ||
"private": true, | ||
"version": "0.1.0", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "tsc && vite build", | ||
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0", | ||
"preview": "vite preview", | ||
"codegen": "graphql-codegen", | ||
"components": "npx @dojoengine/core ../dojo-starter/target/dev/manifest.json src/dojo/contractComponents.ts http://localhost:5050 0x534692277764b04cfc469858891b825c799d1da550d2509fdd5be2f32abdaa0" | ||
}, | ||
"dependencies": { | ||
"@dojoengine/core": "link:dojo-packages/packages/core", | ||
"@dojoengine/create-burner": "link:dojo-packages/packages/create-burner", | ||
"@dojoengine/torii-client": "link:dojo-packages/packages/torii-client", | ||
"@dojoengine/utils": "link:dojo-packages/packages/utils", | ||
"@dojoengine/react": "link:dojo-packages/packages/react", | ||
"@dojoengine/recs": "0.1.35", | ||
"@latticexyz/utils": "^2.0.0-next.11", | ||
"@latticexyz/phaserx": "^2.0.0-next.11", | ||
"ethers": "^5.7.2", | ||
"events": "^3.3.0", | ||
"graphql": "^16.7.1", | ||
"graphql-request": "^6.1.0", | ||
"mobx": "^6.9.0", | ||
"phaser": "3.60.0-beta.14", | ||
"proxy-deep": "^3.1.1", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"rxjs": "^7.8.1", | ||
"simplex-noise": "^4.0.1", | ||
"starknet": "^5.19.5", | ||
"styled-components": "^6.0.7", | ||
"zustand": "^4.4.1", | ||
"vite-plugin-top-level-await": "^1.3.1", | ||
"vite-plugin-wasm": "^3.2.2" | ||
}, | ||
"devDependencies": { | ||
"@graphql-codegen/cli": "^5.0.0", | ||
"@graphql-codegen/typescript": "^4.0.1", | ||
"@graphql-codegen/typescript-graphql-request": "^5.0.0", | ||
"@graphql-codegen/typescript-operations": "^4.0.1", | ||
"@types/node": "^20.4.8", | ||
"@types/react": "^18.0.37", | ||
"@types/react-dom": "^18.0.11", | ||
"@typescript-eslint/eslint-plugin": "^5.59.0", | ||
"@typescript-eslint/parser": "^5.59.0", | ||
"@vitejs/plugin-react": "^4.0.0", | ||
"eslint": "^8.38.0", | ||
"eslint-plugin-react-hooks": "^4.6.0", | ||
"eslint-plugin-react-refresh": "^0.3.4", | ||
"typescript": "^5.0.2", | ||
"vite": "^4.3.9" | ||
} | ||
"name": "react-phaser-example", | ||
"private": true, | ||
"version": "0.1.0", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "tsc && vite build", | ||
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0", | ||
"preview": "vite preview", | ||
"codegen": "graphql-codegen", | ||
"components": "npx @dojoengine/core ../dojo-starter/target/dev/manifest.json src/dojo/contractComponents.ts http://localhost:5050 0x534692277764b04cfc469858891b825c799d1da550d2509fdd5be2f32abdaa0" | ||
}, | ||
"dependencies": { | ||
"@dojoengine/core": "link:dojo-packages/packages/core", | ||
"@dojoengine/create-burner": "link:dojo-packages/packages/create-burner", | ||
"@dojoengine/torii-client": "link:dojo-packages/packages/torii-client", | ||
"@dojoengine/utils": "link:dojo-packages/packages/utils", | ||
"@dojoengine/react": "link:dojo-packages/packages/react", | ||
"@dojoengine/recs": "0.1.35", | ||
"@latticexyz/utils": "^2.0.0-next.11", | ||
"@latticexyz/phaserx": "^2.0.0-next.11", | ||
"ethers": "^5.7.2", | ||
"events": "^3.3.0", | ||
"graphql": "^16.7.1", | ||
"graphql-request": "^6.1.0", | ||
"mobx": "^6.9.0", | ||
"phaser": "3.60.0-beta.14", | ||
"proxy-deep": "^3.1.1", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"rxjs": "^7.8.1", | ||
"simplex-noise": "^4.0.1", | ||
"starknet": "^5.19.5", | ||
"styled-components": "^6.0.7", | ||
"zustand": "^4.4.1", | ||
"vite-plugin-top-level-await": "^1.3.1", | ||
"vite-plugin-wasm": "^3.2.2" | ||
}, | ||
"devDependencies": { | ||
"@graphql-codegen/cli": "^5.0.0", | ||
"@graphql-codegen/typescript": "^4.0.1", | ||
"@graphql-codegen/typescript-graphql-request": "^5.0.0", | ||
"@graphql-codegen/typescript-operations": "^4.0.1", | ||
"@types/node": "^20.4.8", | ||
"@types/react": "^18.0.37", | ||
"@types/react-dom": "^18.0.11", | ||
"@typescript-eslint/eslint-plugin": "^5.59.0", | ||
"@typescript-eslint/parser": "^5.59.0", | ||
"@vitejs/plugin-react": "^4.0.0", | ||
"autoprefixer": "^10.4.16", | ||
"eslint": "^8.38.0", | ||
"eslint-plugin-react-hooks": "^4.6.0", | ||
"eslint-plugin-react-refresh": "^0.3.4", | ||
"postcss": "^8.4.31", | ||
"tailwindcss": "^3.3.5", | ||
"typescript": "^5.0.2", | ||
"vite": "^4.3.9" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export default { | ||
plugins: { | ||
tailwindcss: {}, | ||
autoprefixer: {}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { NetworkLayer } from "../dojo/createNetworkLayer"; | ||
import { PhaserLayer } from "../phaser"; | ||
import { store } from "../store/store"; | ||
import { useBurnerManager } from "@dojoengine/create-burner"; | ||
|
||
export type UIStore = ReturnType<typeof useDojo>; | ||
|
||
export const useDojo = () => { | ||
const { networkLayer, phaserLayer } = store(); | ||
|
||
if (phaserLayer === null || networkLayer === null) { | ||
throw new Error("Store not initialized"); | ||
} | ||
|
||
const { account, get, create, select, list, isDeploying, clear } = | ||
useBurnerManager({ | ||
burnerManager: networkLayer.account, | ||
}); | ||
|
||
return { | ||
networkLayer: networkLayer as NetworkLayer, | ||
phaserLayer: phaserLayer as PhaserLayer, | ||
account: { | ||
account: account ? account : networkLayer.account.masterAccount, | ||
get, | ||
create, | ||
select, | ||
list, | ||
clear, | ||
isDeploying, | ||
}, | ||
systemCalls: networkLayer.systemCalls, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import ReactDOM from 'react-dom/client'; | ||
import App from './App.tsx'; | ||
import ReactDOM from "react-dom/client"; | ||
import App from "./App.tsx"; | ||
import "./index.css"; | ||
|
||
const rootElement = document.getElementById("root"); | ||
if (!rootElement) throw new Error("React root not found"); | ||
const root = ReactDOM.createRoot(rootElement); | ||
|
||
root.render(<App />); | ||
root.render(<App />); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,4 +29,4 @@ export function mapSystem(layer: PhaserLayer) { | |
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.