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

fix: dojoConfig manifest path for onchain-dash #344

Merged
merged 2 commits into from
Dec 9, 2024

Conversation

MartianGreed
Copy link
Collaborator

@MartianGreed MartianGreed commented Nov 28, 2024

Updates worlds version + update path for examples

Summary by CodeRabbit

  • New Features

    • Updated the entry point for the torii-bot project to simplify script execution.
    • Changed the source of the manifest in the Dojo configuration, enhancing development flexibility.
  • Bug Fixes

    • Adjusted import paths for dojoConfig in various components to ensure proper configuration access.
  • Chores

    • Removed the obsolete dojo.config.ts file to streamline the codebase.
    • Updated subproject references to the latest commits for improved stability and features.
    • Updated the CI workflow to use a newer version of the dojoup command for better performance.

Copy link

coderabbitai bot commented Nov 28, 2024

Walkthrough

The changes in this pull request primarily involve modifications to import paths and the restructuring of configuration files within various components of the project. Notably, the serve script in package.json for the torii-bot project has been updated to reflect a new output directory for compiled files. Additionally, several components in the example-vite-kitchen-sink have adjusted their import paths for dojoConfig, and a configuration file has been removed. Subproject commit references have also been updated in two separate directories.

Changes

File Path Change Summary
examples/example-nodejs-bot/package.json Updated serve script command from dist/node/torii-bot/src/index.js to dist/src/index.js.
examples/example-vite-kitchen-sink/dojoConfig.ts Changed import path for manifest from production to development manifest file.
examples/example-vite-kitchen-sink/src/components/caller-counter.tsx Updated import path for dojoConfig from @/dojo.config to @/../dojoConfig.
examples/example-vite-kitchen-sink/src/components/global-counter.tsx Updated import path for dojoConfig from @/dojo.config to @/../dojoConfig.
examples/example-vite-kitchen-sink/src/components/starknet-provider.tsx Reduced imports from @starknet-react/core and updated import path for dojoConfig.
examples/example-vite-kitchen-sink/src/components/theme-switch.tsx Updated import path for dojoConfig from @/dojo.config to @/../dojoConfig.
examples/example-vite-kitchen-sink/src/dojo.config.ts Deleted dojo.config.ts, which contained the dojoConfig setup.
worlds/dojo-starter Updated subproject commit reference from 1c184df3baaa... to d28df671590a....
worlds/onchain-dash Updated subproject commit reference from 48c4ef126ac9... to 25761aa87382....
.github/workflows/ci.yaml Updated dojoup command version from v1.0.0-rc.2 to v1.0.2.

Possibly related PRs

  • fix: create-dojo + update manifest path #338: The changes in the main PR involve updating the import path for the manifest in dojoConfig.ts, which is related to the restructuring of the project and may connect with the changes in the create-dojo functionality.
  • feat: build examples on ci #341: The CI workflow update to include a step for building examples may relate to the overall project structure and organization, which is also a focus in the main PR regarding the package.json changes.

Suggested reviewers

  • ponderingdemocritus

🐰 In the code, we hop and play,
Paths and imports change today.
With a tweak here and a fix there,
Our project shines with utmost care.
From dev to prod, we find our way,
Hooray for changes, hip-hip-hooray! 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 0a02ea4 and 1984d1f.

📒 Files selected for processing (1)
  • .github/workflows/ci.yaml (1 hunks)
🔇 Additional comments (1)
.github/workflows/ci.yaml (1)

23-23: LGTM! Verify compatibility with the build pipeline.

The update from v1.0.0-rc.2 to v1.0.2 is a positive change as it moves to a stable version. However, let's verify that this version is compatible with the subsequent build steps.

✅ Verification successful

Version update is safe to proceed

The verification shows that the codebase primarily uses sozo for build and migration commands without version-specific requirements. The dependencies are managed through workspace references and fixed versions (e.g., @dojoengine/recs: 2.0.13), which are independent of the dojoup version. The update from v1.0.0-rc.2 to v1.0.2 is a stable version bump that shouldn't impact the build pipeline compatibility.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify compatibility between dojoup v1.0.2 and the build pipeline

# Check if sozo commands are referenced with specific version requirements
rg -A 2 "sozo (build|test)" 

# Look for any version constraints or dependencies in configuration files
fd -e toml -e json -H "manifest|config|package" --exec cat {} \; | rg -i "dojo|sozo|katana"

Length of output: 8241


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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 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.

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: 1

🧹 Outside diff range and nitpick comments (2)
examples/example-vite-kitchen-sink/dojoConfig.ts (1)

Line range hint 3-7: Consider adding a comment explaining the manifest choice

Since this is an example project using a development manifest, it would be helpful to add a brief comment explaining why this specific manifest is used and what it contains.

+// Using development manifest for example setup
 import manifest from "../../worlds/onchain-dash/manifest_dev.json";

 export const dojoConfig = createDojoConfig({
     manifest,
 });
examples/example-nodejs-bot/package.json (1)

35-35: LGTM! Consider updating documentation

The simplified output path is cleaner and more maintainable. This change aligns well with standard Node.js project structures.

Consider updating any related documentation or README files that might reference the old build output path.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between f52a83e and 0a02ea4.

📒 Files selected for processing (9)
  • examples/example-nodejs-bot/package.json (1 hunks)
  • examples/example-vite-kitchen-sink/dojoConfig.ts (1 hunks)
  • examples/example-vite-kitchen-sink/src/components/caller-counter.tsx (1 hunks)
  • examples/example-vite-kitchen-sink/src/components/global-counter.tsx (1 hunks)
  • examples/example-vite-kitchen-sink/src/components/starknet-provider.tsx (1 hunks)
  • examples/example-vite-kitchen-sink/src/components/theme-switch.tsx (1 hunks)
  • examples/example-vite-kitchen-sink/src/dojo.config.ts (0 hunks)
  • worlds/dojo-starter (1 hunks)
  • worlds/onchain-dash (1 hunks)
💤 Files with no reviewable changes (1)
  • examples/example-vite-kitchen-sink/src/dojo.config.ts
✅ Files skipped from review due to trivial changes (5)
  • examples/example-vite-kitchen-sink/src/components/caller-counter.tsx
  • examples/example-vite-kitchen-sink/src/components/global-counter.tsx
  • examples/example-vite-kitchen-sink/src/components/theme-switch.tsx
  • worlds/dojo-starter
  • worlds/onchain-dash
🔇 Additional comments (4)
examples/example-nodejs-bot/package.json (1)

35-35: Verify TypeScript output directory configuration

The serve script now uses a simplified output path dist/src/index.js. Please ensure this aligns with the TypeScript configuration.

✅ Verification successful

TypeScript configuration aligns with the serve script path

The TypeScript configuration is correctly set with "outDir": "dist" and includes "./src/**/*" in its sources, which perfectly aligns with the serve script's path dist/src/index.js. The source files structure also confirms this with src/index.ts that will compile to the expected location.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check TypeScript configuration for output directory settings

# Look for tsconfig.json and its outDir setting
fd tsconfig.json --exec cat {} | jq -r 'select(.compilerOptions.outDir != null) | .compilerOptions.outDir'

# Verify the existence of the new output path
fd index.js -p dist/src/ || echo "Warning: Output path not found"

Length of output: 363


Script:

#!/bin/bash
# Let's first check the content of tsconfig.json directly
cat examples/example-nodejs-bot/tsconfig.json

# Also check if there are any TypeScript files that might indicate the source structure
fd -e ts . examples/example-nodejs-bot/

Length of output: 1143

examples/example-vite-kitchen-sink/src/components/starknet-provider.tsx (3)

4-4: Verify wallet connectivity requirements

The removal of argent and braavos imports from @starknet-react/core suggests that these wallet connectors are no longer needed. Please confirm that CartridgeConnector is sufficient for your authentication needs.

✅ Verification successful

Removal of wallet connectors is intentional and correct

The codebase has been intentionally migrated to use CartridgeConnector exclusively, as evidenced by:

  • The StarknetConfig component is properly configured with only CartridgeConnector
  • The package.json shows @cartridge/connector as a dependency
  • The only remaining references to argent/braavos are in comments and documentation, not in functional code
  • The README acknowledges this change by mentioning that argent & braavos wallets require manual setup if needed
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if there are any remaining references to argent or braavos wallets
# that might be affected by this change
rg -i "argent|braavos" --type tsx --type ts

Length of output: 73


Script:

#!/bin/bash
# Check for any references to argent or braavos wallets in all files
# Using ripgrep without file type restrictions to ensure we catch all occurrences
rg -i "argent|braavos"

# Also check the package.json for any wallet-related dependencies
cat examples/example-vite-kitchen-sink/package.json

# Look for any StarknetConfig usage to understand the wallet configuration
rg "StarknetConfig" -A 5 -B 5

Length of output: 5059


6-6: Verify dojoConfig accessibility

The import path for dojoConfig has been changed to use a parent directory reference (@/../dojoConfig). Let's verify this configuration file exists and is properly referenced.

✅ Verification successful

Import path is valid and consistent with project structure

The dojoConfig import path @/../dojoConfig is valid and properly referenced. The file exists at examples/example-vite-kitchen-sink/dojoConfig.ts and is being used consistently across multiple components in the same project. The @ alias appears to be a valid path alias in the Vite project, and the relative path navigation to the config file is working as intended.

  • The config file is properly structured and exports the dojoConfig object
  • Multiple components in the same project use identical import paths
  • The config is actively used in the StarknetProvider component for contract configurations
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if dojoConfig exists in the expected location and
# find all files that depend on this configuration
echo "Checking for dojoConfig file..."
fd dojoConfig

echo "Checking for all imports of dojoConfig..."
rg -l "from.*dojoConfig" --type tsx --type ts

Length of output: 750


Script:

#!/bin/bash
# Let's try a different approach to find imports
echo "Checking for imports of dojoConfig..."
rg "from.*dojoConfig"

# Also check the specific file content
echo -e "\nChecking the specific file content..."
cat examples/example-vite-kitchen-sink/src/components/starknet-provider.tsx

# And verify the relative path resolution
echo -e "\nChecking dojoConfig content in the example..."
cat examples/example-vite-kitchen-sink/dojoConfig.ts

Length of output: 3658


Line range hint 9-27: Verify contract address references

The CartridgeConnector policies are using contract addresses from dojoConfig.manifest. Since this PR involves path changes, we should ensure these contract references are still valid.

@@ -1,6 +1,6 @@
import { createDojoConfig } from "@dojoengine/core";

import manifest from "../../worlds/onchain-dash/manifests/release/deployment/manifest.json";
import manifest from "../../worlds/onchain-dash/manifest_dev.json";
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Path inconsistency detected in manifest import

The manifest path in examples/example-vite-kitchen-sink/dojoConfig.ts is inconsistent with other examples:

  • All other examples use ../../worlds/dojo-starter/manifest_dev.json
  • This file uniquely uses ../../worlds/onchain-dash/manifest_dev.json which doesn't exist
  • The path should be aligned with the standard pattern used across all other example projects
🔗 Analysis chain

Verify the manifest path exists and is consistent

The change from release manifest to development manifest makes sense for an example project, but let's verify the path exists and is consistent with other examples.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify manifest path existence and consistency across examples

# Check if the new manifest path exists
echo "Checking if manifest_dev.json exists:"
ls -l worlds/onchain-dash/manifest_dev.json

# Check for similar manifest usage patterns in other examples
echo "\nChecking manifest usage patterns in other examples:"
rg -l "manifest.*\.json" examples/

Length of output: 904


Script:

#!/bin/bash
# Let's check the manifest paths used in other example dojoConfig files
echo "Checking manifest paths in other example dojoConfig files:"
rg "manifest.*\.json" examples/*/dojoConfig.ts

Length of output: 1840

@MartianGreed MartianGreed merged commit 73040f8 into main Dec 9, 2024
2 of 3 checks passed
@MartianGreed MartianGreed deleted the fix/examples-update branch December 9, 2024 14:35
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