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

Update 6 #163

Merged
merged 26 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
7240474
fix: update snjs
ponderingdemocritus Mar 7, 2024
c497b03
v0.6.0-alpha.0
ponderingdemocritus Mar 7, 2024
e68462a
fix: imports
ponderingdemocritus Mar 7, 2024
52e598a
feat: adds in fee token ability
ponderingdemocritus Mar 8, 2024
e51cfa8
v0.6.1-alpha.0
ponderingdemocritus Mar 8, 2024
d7aee36
fix: lock
ponderingdemocritus Apr 1, 2024
f9625f3
fix: merge
ponderingdemocritus Apr 1, 2024
e1867ea
v0.6.1-alpha.1
ponderingdemocritus Apr 2, 2024
45a5435
fix: add limit to sync
ponderingdemocritus Apr 2, 2024
664a599
feat: package refinements, CI updates
ponderingdemocritus Apr 3, 2024
2be0fd6
feat: package refinements, CI updates
ponderingdemocritus Apr 3, 2024
ba6eccc
fix: relay
ponderingdemocritus Apr 3, 2024
4409b3d
fix: bump starter
ponderingdemocritus Apr 3, 2024
cba5ad1
v0.6.1-alpha.11
ponderingdemocritus Apr 3, 2024
99c6786
feat: wip updating examples
ponderingdemocritus Apr 3, 2024
c0ea7d9
fix: new torii event bugfix
ponderingdemocritus Apr 3, 2024
2cbe44f
fix: ci dojo version
ponderingdemocritus Apr 3, 2024
7b57ff6
fix: update examples to latest pacakges
ponderingdemocritus Apr 3, 2024
3f365de
fix: unused var in dep repo
ponderingdemocritus Apr 4, 2024
2797d53
fix: remove bunx
ponderingdemocritus Apr 4, 2024
59d629e
fix: dojo starter
ponderingdemocritus Apr 4, 2024
cc0decf
fix: dojo starter
ponderingdemocritus Apr 4, 2024
5358dbf
fix: build and dep issues
ponderingdemocritus Apr 4, 2024
3fddb60
docs: changelog
ponderingdemocritus Apr 4, 2024
74b463e
fix: protobuf
ponderingdemocritus Apr 4, 2024
09ea807
fix: delete ci
ponderingdemocritus Apr 4, 2024
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
11 changes: 8 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ on:
push:
branches: [main]
pull_request:
branches: [main]
branches: [opened, synchronize]

jobs:
prettier:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -20,12 +20,17 @@ jobs:
run: git submodule update --init --recursive

- run: curl -L https://install.dojoengine.org | bash
- run: /home/runner/.config/.dojo/bin/dojoup -v v0.5.1
- run: /home/runner/.config/.dojo/bin/dojoup -v v0.6.0-alpha.13
- run: |
cd examples/dojo-starter
/home/runner/.config/.dojo/bin/sozo build
/home/runner/.config/.dojo/bin/sozo test

- name: "Setup npm"
run: |
npm set @ponderingdemocritus:registry=https://npm.pkg.github.com/dojoengine
npm set "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}"

- name: Install Protobuf Compiler
run: sudo apt-get install -y protobuf-compiler

Expand Down
60 changes: 35 additions & 25 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,43 @@
name: Build and NPM Release

name: Publish
on:
push:
tags:
- "v*"
pull_request:
types: [closed]
branches:
- development
- main

jobs:
create-release:
publish:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest

steps:
- name: Extract version from tag
id: tag-version
run: |
echo "::set-output name=version::${GITHUB_REF#refs/tags/v}"
- name: "Checkout"
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Create GitHub Release
run: |
curl -s \
-X POST \
-H "Authorization: token $GIT_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/releases \
-d '{
"tag_name": "v${{ steps.tag-version.outputs.version }}",
"name": "Release v${{ steps.tag-version.outputs.version }}",
"body": "Release of version ${{ steps.tag-version.outputs.version }}",
"draft": false,
"prerelease": false
}'
- uses: pnpm/action-setup@v3
with:
version: 8

- name: Install dependencies
run: pnpm i

- name: Build dependencies
run: pnpm run build

- name: "Version and publish"
env:
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor}}@users.noreply.github.com"

if [ ${{ github.base_ref }} = development ]; then
npx lerna version --conventional-commits --conventional-prerelease --preid beta --yes
else
npx lerna version --conventional-commits --conventional-graduate --yes
fi

npx lerna publish from-git --yes
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

bun run prettier-check
pnpm run prettier-check
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@

All notable changes to Dojo.js will be documented in this file.

## 0.6.0 -0 3.04.2024

### Added

- Increased batch size of entity query
- Improved burner architecture
- Updated Starknet js
- Added relayUrl into ToriiClient ready for RTC
- Remove bun and replaced with pnpm everywhere

### Changed

### Removed

### Fixed

## 0.5.4 -0 1.02.2024

### Added
Expand Down
2 changes: 1 addition & 1 deletion examples/node/torii-bot/dojoConfig.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import manifest from "../../dojo-starter/target/dev/manifest.json" assert { type: "json" };
import manifest from "../../dojo-starter/manifests/deployments/KATANA.json" assert { type: "json" };

import { createDojoConfig } from "@dojoengine/core";

Expand Down
2 changes: 1 addition & 1 deletion examples/node/torii-bot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"bun-types": "latest"
},
"dependencies": {
"@dojoengine/core": "^0.5.0",
"@dojoengine/core": "workspace:*",
"@pinecone-database/pinecone": "^1.1.2",
"@sapphire/decorators": "^6.0.2",
"@sapphire/framework": "^4.6.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/react/react-app/dojoConfig.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import manifest from "../../dojo-starter/target/dev/manifest.json";
import manifest from "../../dojo-starter/manifests/deployments/KATANA.json";
import { createDojoConfig } from "@dojoengine/core";

export const dojoConfig = createDojoConfig({
Expand Down
14 changes: 7 additions & 7 deletions examples/react/react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
"create-components": "npx @dojoengine/core ../../dojo-starter/target/dev/manifest.json src/dojo/generated/contractComponents.ts http://localhost:5050 0x28f5999ae62fec17c09c52a800e244961dba05251f5aaf923afabd9c9804d1a"
},
"dependencies": {
"@dojoengine/core": "^0.5.0",
"@dojoengine/create-burner": "^0.5.0",
"@dojoengine/torii-client": "^0.5.0",
"@dojoengine/utils": "^0.5.0",
"@dojoengine/react": "^0.5.0",
"@dojoengine/state": "^0.5.0",
"@dojoengine/core": "workspace:*",
"@dojoengine/create-burner": "workspace:*",
"@dojoengine/torii-client": "workspace:*",
"@dojoengine/utils": "workspace:*",
"@dojoengine/react": "workspace:*",
"@dojoengine/state": "workspace:*",
"@dojoengine/recs": "0.1.35",
"@latticexyz/react": "^2.0.0-next.11",
"@latticexyz/utils": "^2.0.0-next.11",
Expand All @@ -29,7 +29,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rxjs": "^7.8.1",
"starknet": "5.25.0",
"starknet": "^6.1.5",
"vite-plugin-top-level-await": "^1.3.1",
"vite-plugin-wasm": "^3.2.2"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/react/react-app/src/dojo/DojoContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ export const DojoProvider = ({
get,
select,
clear,
count,
account: account ? account : masterAccount,
isDeploying,
count,
copyToClipboard,
applyFromClipboard,
},
Expand Down
6 changes: 6 additions & 0 deletions examples/react/react-app/src/dojo/createSystemCalls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ export function createSystemCalls(
account,
});

console.log(
await account.waitForTransaction(transaction_hash, {
retryInterval: 100,
})
);

setComponentsFromEvents(
contractComponents,
getEvents(
Expand Down
8 changes: 6 additions & 2 deletions examples/react/react-app/src/dojo/generated/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { createSystemCalls } from "../createSystemCalls";
import { defineContractComponents } from "./contractComponents";
import { world } from "./world";
import { setupWorld } from "./generated";
import { Account } from "starknet";
import { Account, ProviderOptions } from "starknet";
import { BurnerManager } from "@dojoengine/create-burner";

export type SetupResult = Awaited<ReturnType<typeof setup>>;
Expand All @@ -16,6 +16,7 @@ export async function setup({ ...config }: DojoConfig) {
const toriiClient = await torii.createClient([], {
rpcUrl: config.rpcUrl,
toriiUrl: config.toriiUrl,
relayUrl: "",
worldAddress: config.manifest.world.address || "",
});

Expand All @@ -37,12 +38,15 @@ export async function setup({ ...config }: DojoConfig) {
// create burner manager
const burnerManager = new BurnerManager({
masterAccount: new Account(
dojoProvider.provider,
{
nodeUrl: config.rpcUrl,
},
config.masterAddress,
config.masterPrivateKey
),
accountClassHash: config.accountClassHash,
rpcProvider: dojoProvider.provider,
feeTokenAddress: config.feeTokenAddress,
});

try {
Expand Down
2 changes: 1 addition & 1 deletion examples/react/react-phaser-example/dojoConfig.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import manifest from "../../dojo-starter/target/dev/manifest.json";
import manifest from "../../dojo-starter/manifests/deployments/KATANA.json";
import { createDojoConfig } from "@dojoengine/core";

export const dojoConfig = createDojoConfig({
Expand Down
14 changes: 7 additions & 7 deletions examples/react/react-phaser-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
"components": "npx @dojoengine/core ../../dojo-starter/target/dev/manifest.json src/dojo/generated/contractComponents.ts http://localhost:5050 0x28f5999ae62fec17c09c52a800e244961dba05251f5aaf923afabd9c9804d1a"
},
"dependencies": {
"@dojoengine/core": "^0.5.0",
"@dojoengine/create-burner": "^0.5.0",
"@dojoengine/react": "^0.5.0",
"@dojoengine/core": "workspace:*",
"@dojoengine/create-burner": "workspace:*",
"@dojoengine/torii-client": "workspace:*",
"@dojoengine/utils": "workspace:*",
"@dojoengine/react": "workspace:*",
"@dojoengine/state": "workspace:*",
"@dojoengine/recs": "0.1.35",
"@dojoengine/state": "^0.5.0",
"@dojoengine/torii-client": "^0.5.0",
"@dojoengine/torii-wasm": "^0.5.0",
"@dojoengine/utils": "^0.5.0",
"@latticexyz/phaserx": "^2.0.0-next.14",
"@latticexyz/utils": "^2.0.0-next.14",
"@radix-ui/react-slot": "^1.0.2",
Expand All @@ -36,7 +36,7 @@
"react-dom": "^18.2.0",
"rxjs": "^7.8.1",
"simplex-noise": "^4.0.1",
"starknet": "5.25.0",
"starknet": "^6.1.5",
"styled-components": "^6.0.7",
"tailwind-merge": "^2.0.0",
"tailwindcss-animate": "^1.0.7",
Expand Down
11 changes: 6 additions & 5 deletions examples/react/react-phaser-example/src/dojo/createBurner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ export const createBurner = async ({ ...config }: DojoConfig) => {

const burnerManager = new BurnerManager({
masterAccount: new Account(
rpcProvider,
{
nodeUrl: config.rpcUrl,
},
config.masterAddress,
config.masterPrivateKey,
"1"
config.masterPrivateKey
),
accountClassHash: config.accountClassHash,
rpcProvider,
rpcProvider: rpcProvider,
feeTokenAddress: config.feeTokenAddress,
});

try {
await burnerManager.init();
if (burnerManager.list().length === 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export async function setup({ ...config }: DojoConfig) {
const toriiClient = await torii.createClient([], {
rpcUrl: config.rpcUrl,
toriiUrl: config.toriiUrl,
relayUrl: config.relayUrl,
worldAddress: config.manifest.world.address || "",
});

Expand Down
2 changes: 1 addition & 1 deletion examples/react/react-pwa-app/dojoConfig.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import manifest from "../../dojo-starter/target/dev/manifest.json";
import manifest from "../../dojo-starter/manifests/deployments/KATANA.json";
import { createDojoConfig } from "@dojoengine/core";

export const dojoConfig = createDojoConfig({
Expand Down
14 changes: 7 additions & 7 deletions examples/react/react-pwa-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
"generate-pwa-assets": "pwa-assets-generator"
},
"dependencies": {
"@dojoengine/core": "^0.5.0",
"@dojoengine/create-burner": "^0.5.0",
"@dojoengine/react": "^0.5.0",
"@dojoengine/core": "workspace:*",
"@dojoengine/create-burner": "workspace:*",
"@dojoengine/torii-client": "workspace:*",
"@dojoengine/utils": "workspace:*",
"@dojoengine/react": "workspace:*",
"@dojoengine/state": "workspace:*",
"@dojoengine/recs": "0.1.35",
"@dojoengine/state": "^0.5.0",
"@dojoengine/torii-client": "^0.5.0",
"@dojoengine/utils": "^0.5.0",
"@latticexyz/react": "^2.0.0-next.11",
"@latticexyz/utils": "^2.0.0-next.11",
"@vite-pwa/assets-generator": "^0.2.4",
Expand All @@ -31,7 +31,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rxjs": "^7.8.1",
"starknet": "5.25.0",
"starknet": "^6.1.5",
"vite-plugin-top-level-await": "^1.3.1",
"vite-plugin-wasm": "^3.2.2"
},
Expand Down
6 changes: 5 additions & 1 deletion examples/react/react-pwa-app/src/dojo/generated/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export async function setup({ ...config }: DojoConfig) {
const toriiClient = await torii.createClient([], {
rpcUrl: config.rpcUrl,
toriiUrl: config.toriiUrl,
relayUrl: config.relayUrl,
worldAddress: config.manifest.world.address || "",
});

Expand All @@ -37,12 +38,15 @@ export async function setup({ ...config }: DojoConfig) {
// create burner manager
const burnerManager = new BurnerManager({
masterAccount: new Account(
dojoProvider.provider,
{
nodeUrl: config.rpcUrl,
},
config.masterAddress,
config.masterPrivateKey
),
accountClassHash: config.accountClassHash,
rpcProvider: dojoProvider.provider,
feeTokenAddress: config.feeTokenAddress,
});

try {
Expand Down
2 changes: 1 addition & 1 deletion examples/react/react-threejs/dojoConfig.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import manifest from "../../dojo-starter/target/dev/manifest.json";
import manifest from "../../dojo-starter/manifests/deployments/KATANA.json";
import { createDojoConfig } from "@dojoengine/core";

export const dojoConfig = createDojoConfig({
Expand Down
Loading
Loading