Skip to content

chore: bump dojo.c + fix node worker #447

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

Merged
merged 1 commit into from
Jun 5, 2025
Merged

chore: bump dojo.c + fix node worker #447

merged 1 commit into from
Jun 5, 2025

Conversation

MartianGreed
Copy link
Collaborator

@MartianGreed MartianGreed commented Jun 5, 2025

Closes #

Introduced changes

Checklist

  • Linked relevant issue
  • Updated relevant documentation
  • Added relevant tests
  • Add a dedicated CI job for new examples
  • Performed self-review of the code

Summary by CodeRabbit

  • Chores

    • Updated multiple packages to include a patch-level version bump and internal dependency updates.
    • Adjusted Node.js script to use an experimental flag for TypeScript transforms.
    • Simplified TypeScript configuration by removing an unused compiler option.
  • Style

    • Improved formatting and consistency in TypeScript model files.
  • Bug Fixes

    • Included a fix related to Node.js worker setup.

Copy link

coderabbitai bot commented Jun 5, 2025

Walkthrough

This update introduces a changeset for patch-level version bumps across multiple @dojoengine packages, updates the dojo.c subproject commit, and applies minor refactoring and formatting improvements in the example Node worker project. No changes were made to exported or public interfaces, and no functional logic was altered.

Changes

File(s) Change Summary
.changeset/pretty-waves-listen.md Added a changeset recording patch version bumps for multiple @dojoengine packages.
packages/torii-wasm/dojo.c Updated subproject commit reference for dojo.c.
examples/example-node-worker/main.ts Refactored imports, adjusted websocket assignment, and changed signer initialization method.
examples/example-node-worker/package.json Modified "node" script to include --experimental-transform-types flag.
examples/example-node-worker/src/typescript/models.gen.ts Reformatted code for consistent style; no logic or interface changes.
examples/example-node-worker/tsconfig.json Removed "allowImportingTsExtensions": true compiler option.

Sequence Diagram(s)

No sequence diagram is generated since the changes are limited to version bumps, formatting, and minor refactoring without affecting control flow or introducing new features.

Possibly related PRs

  • feat: Torii upgrade #303: Updates the Torii library and dependencies, similar to this PR's subproject and version bumps for Torii-related packages.
  • chore: bump upgrade to dojo 1.3 #422: Introduces changesets for version bumps across multiple @dojoengine packages, directly related to this PR's chore updates.
  • fix: wasm build issues #256: Updates the torii-wasm subproject commit and addresses wasm build issues, closely related to this PR's changes to torii-wasm.

Poem

A gentle hop, a tidy sweep,
Versions bumped and changes neat.
Imports trimmed, the code aligned,
Worker scripts now redefined.
With every patch, the garden grows—
A rabbit’s joy in tidy rows! 🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@MartianGreed MartianGreed marked this pull request as ready for review June 5, 2025 13:38
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (3)
.changeset/pretty-waves-listen.md (1)

15-15: Refine the changeset summary for clarity.

The summary "chore: bump dojo.c + fix node worker" is generic. Consider specifying the updated dojo.c commit hash and a concise description of the Node worker fix to improve traceability.

examples/example-node-worker/package.json (1)

8-8: Ensure Node flag compatibility and clean up script.
The --experimental-transform-types flag is experimental (Node 20+)—verify your CI and deployment environments support it or consider using a stable loader like ts-node/esm. Also remove the trailing space after main.ts to avoid shell parsing issues.

examples/example-node-worker/main.ts (1)

18-23: Avoid @ts-ignore by augmenting global types.
Suppressing TS errors for global.Websocket can be replaced by a .d.ts declaration (e.g. declare global { var Websocket: typeof ws.w3cwebsocket }) to improve type safety.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 586caf7 and a5ba1b1.

📒 Files selected for processing (6)
  • .changeset/pretty-waves-listen.md (1 hunks)
  • examples/example-node-worker/main.ts (3 hunks)
  • examples/example-node-worker/package.json (1 hunks)
  • examples/example-node-worker/src/typescript/models.gen.ts (1 hunks)
  • examples/example-node-worker/tsconfig.json (1 hunks)
  • packages/torii-wasm/dojo.c (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
examples/example-node-worker/src/typescript/models.gen.ts (1)
packages/sdk/src/internal/types.ts (1)
  • SchemaType (51-71)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: build
  • GitHub Check: check
🔇 Additional comments (15)
.changeset/pretty-waves-listen.md (1)

2-12:

✅ Verification successful

Verify package list completeness.

Ensure that the patch bump in this changeset covers exactly the packages whose versions were updated. Confirm that no package is omitted or unintentionally included.


🏁 Script executed:

#!/bin/bash
# Verify version bumps in package.json for the listed packages
for pkg in torii-wasm core create-burner create-dojo predeployed-connector react sdk state torii-client utils utils-wasm; do
  pkg_file=$(fd -e json "\"name\": \"@dojoengine/$pkg\"" .)
  echo "Checking $pkg_file"
  grep -n '"version":' "$pkg_file"
done

Length of output: 3013


Additional check for package manifests—listing all @dojoengine/* entries and their versions:


🏁 Script executed:

#!/bin/bash
# Find every package.json with a @dojoengine package name and show its version
echo "Scanning for @dojoengine packages in package.json files..."
for file in $(rg -l '"name": "@dojoengine/' -g '*/package.json'); do
  echo "File: $file"
  grep -n '"name": "@dojoengine/' "$file"
  grep -n '"version":' "$file"
  echo
done

Length of output: 328


Let's locate every @dojoengine package manifest and list its version to ensure the changeset is complete:


🏁 Script executed:

#!/bin/bash
echo "Scanning all package.json files for @dojoengine packages..."
find . -type f -name package.json | while read file; do
  if grep -q '"name": "@dojoengine/' "$file"; then
    echo "File: $file"
    grep -n '"name": "@dojoengine/' "$file"
    grep -n '"version":' "$file"
    echo
  fi
done

Length of output: 5910


Changeset package list verified.

All 11 @dojoengine/* packages in packages/ have a matching patch bump in .changeset/pretty-waves-listen.md, and no additional or missing packages were found. No further action needed.

packages/torii-wasm/dojo.c (1)

1-1:

✅ Verification successful

Verify the updated subproject commit hash
Ensure the new commit d7a863401b44ae9cb03c574efbaf2cd77d661ec3 actually exists in the dojo.c repository and that the submodule pointer has been updated correctly.


🏁 Script executed:

#!/bin/bash
# Verify the referenced commit exists in the dojo.c remote repository
git ls-remote https://github.com/dojoengine/dojo.c.git \
  | grep d7a863401b44ae9cb03c574efbaf2cd77d661ec3

Length of output: 265


🏁 Script executed:

#!/bin/bash
# Check the submodule commit pointer for dojo.c in the current branch
git ls-tree HEAD packages/torii-wasm/dojo.c

Length of output: 127


Submodule commit hash verified
The new commit d7a863401b44ae9cb03c574efbaf2cd77d661ec3 exists in the dojo.c remote repository and the submodule pointer in packages/torii-wasm/dojo.c is correctly set to that commit.

examples/example-node-worker/tsconfig.json (1)

14-14: Confirm removal of allowImportingTsExtensions.
Dropping this option requires that .ts imports resolve correctly under --experimental-transform-types. Validate all module imports succeed in the example environment.

examples/example-node-worker/main.ts (2)

8-8: Use type-only import for StandardizedQueryResult.
This ensures it’s elided at runtime and avoids unnecessary module loading.


40-42: Verify SigningKey constructor adoption.
Replacing SigningKey.fromSecretScalar with new SigningKey(env.SECRET_KEY) matches the updated API. Ensure this yields identical key derivation and consider adding error handling for invalid secrets.

examples/example-node-worker/src/typescript/models.gen.ts (10)

3-8: Approve starknet imports.
The addition of type BigNumberish alongside CairoCustomEnum, CairoOption, and CairoOptionVariant imports is correct and supports typed numeric fields.


11-34: Approve generated model interfaces.
The interfaces for DirectionsAvailable, DirectionsAvailableValue, Moves, and MovesValue accurately reflect the schema definitions.


36-42: Approve Position and Vec2 interfaces.
The Position and Vec2 interfaces align with the underlying model structure.


54-56: Auto-generated PositionValue interface matches the schema; no manual changes needed.


58-62: The Vec2 interface is correct and requires no adjustments.


65-68: The Moved interface aligns with the model definition.


71-73: The MovedValue interface is correctly generated.


75-79: Direction enum and related types look consistent with the schema.


81-85: SchemaType extension properly includes all namespace entries.


96-107: The schema constant entries mirror the interfaces; only the PositionCount and PositionCountValue typos need correction as flagged above.

Also applies to: 108-117, 118-123, 124-128, 129-132, 133-136, 137-139, 140-142, 143-146, 147-155, 156-163

Comment on lines 49 to 51
export interface PositionCountValue {
positition: Array<[BigNumberish, BigNumberish]>;
positition: Array<[BigNumberish, BigNumberish]>;
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Typo in PositionCountValue property name.
The field positition is misspelled; it should be position for consistency.

--- a/examples/example-node-worker/src/typescript/models.gen.ts
+++ b/examples/example-node-worker/src/typescript/models.gen.ts
@@ -49,3 +49,3 @@ export interface PositionCountValue {
-    positition: Array<[BigNumberish, BigNumberish]>;
+    position: Array<[BigNumberish, BigNumberish]>;
 }
📝 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
export interface PositionCountValue {
positition: Array<[BigNumberish, BigNumberish]>;
positition: Array<[BigNumberish, BigNumberish]>;
}
export interface PositionCountValue {
position: Array<[BigNumberish, BigNumberish]>;
}
🤖 Prompt for AI Agents
In examples/example-node-worker/src/typescript/models.gen.ts at lines 49 to 51,
the property name `positition` in the `PositionCountValue` interface is
misspelled. Rename the property from `positition` to `position` to correct the
typo and maintain consistency.

Comment on lines 43 to 46
export interface PositionCount {
identity: string;
positition: Array<[BigNumberish, BigNumberish]>;
identity: string;
positition: Array<[BigNumberish, BigNumberish]>;
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Typo in PositionCount property name.
The interface declares positition but should be position to match usage (m.position) and the schema.

--- a/examples/example-node-worker/src/typescript/models.gen.ts
+++ b/examples/example-node-worker/src/typescript/models.gen.ts
@@ -43,3 +43,3 @@ export interface PositionCount {
     identity: string;
-    positition: Array<[BigNumberish, BigNumberish]>;
+    position: Array<[BigNumberish, BigNumberish]>;
 }
📝 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
export interface PositionCount {
identity: string;
positition: Array<[BigNumberish, BigNumberish]>;
identity: string;
positition: Array<[BigNumberish, BigNumberish]>;
}
export interface PositionCount {
identity: string;
position: Array<[BigNumberish, BigNumberish]>;
}
🤖 Prompt for AI Agents
In examples/example-node-worker/src/typescript/models.gen.ts around lines 43 to
46, the interface PositionCount has a typo in the property name 'positition'.
Rename this property to 'position' to match the expected usage and schema
consistency.

@MartianGreed MartianGreed merged commit e08880e into main Jun 5, 2025
6 checks passed
@MartianGreed MartianGreed deleted the fix/node-worker branch June 5, 2025 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant