Skip to content

Add monad to HyperIndex V2#832

Closed
nikbhintade wants to merge 4 commits into
mainfrom
nb/add-monad-to-v2
Closed

Add monad to HyperIndex V2#832
nikbhintade wants to merge 4 commits into
mainfrom
nb/add-monad-to-v2

Conversation

@nikbhintade

@nikbhintade nikbhintade commented Nov 24, 2025

Copy link
Copy Markdown
Member

#831: The last PR was updating V3 instead of V2. This one updates HyperIndex V2.

Summary by CodeRabbit

  • New Features

    • Added ReScript language template support
    • Added support for Monad blockchain network
  • Updates

    • Default language selection changed to TypeScript during initialization
    • Replaced monad-testnet with Monad in supported blockchain networks

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Nov 24, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

This PR adds support for the Monad blockchain network, defaults language selection to TypeScript instead of interactive prompts, and introduces ReScript template configuration files. Network tiering is updated to classify Monad as Gold tier.

Changes

Cohort / File(s) Change Summary
Monad Network Support
codegenerator/cli/CommandLineHelp.md, codegenerator/cli/src/config_parsing/chain_helpers.rs
Adds Monad (143) as a new network enum variant with Gold-tier classification in threshold and HypersyncNetwork tier logic; replaces monad-testnet with monad in CLI help documentation.
Language Selection Defaults
codegenerator/cli/src/cli_args/interactive_init/mod.rs, codegenerator/cli/src/executor/init.rs
Removes interactive language prompts and defaults to Language::TypeScript in both modules; template extraction now uses fixed TypeScript language; error messages simplified to omit language details.
ReScript Templates
codegenerator/cli/templates/static/blank_template/rescript/rescript.json, codegenerator/cli/templates/static/blank_template/rescript/test/Test.res
Adds new ReScript project configuration file with CommonJS module system and standard dependencies; adds ReScript test module with imports for Mocha, Belt, and TestHelpers.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify that Monad being classified as Gold tier aligns with intended block confirmation thresholds
  • Confirm that hardcoding TypeScript in template extraction does not break EVM or Fuel template generation workflows
  • Check that ReScript template files are syntactically valid and properly integrated with the blank template structure

Possibly related PRs

Suggested reviewers

  • JonoPrest
  • DZakh
  • moose-code

Poem

🐰 With Monad now woven into the chain,
TypeScript flows like morning rain,
ReScript templates take their place,
No prompts slow our quickened pace!
A rabbit's code hops on, refined and true! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add monad to HyperIndex V2' directly matches the primary change in the PR, which adds support for the Monad blockchain network across multiple configuration and code files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch nb/add-monad-to-v2

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@nikbhintade nikbhintade self-assigned this Nov 24, 2025
@nikbhintade
nikbhintade requested a review from DZakh November 24, 2025 13:06

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
codegenerator/cli/src/executor/init.rs (1)

41-53: Template extraction now ignores requested language and forces TypeScript

Both Fuel and EVM Template init flows now call get_and_extract_template with &Language::TypeScript, regardless of init_config.language, and the error context no longer mentions language. This is fine if templates are intentionally TS‑only, but it means envio init ... --language rescript plus a template choice will still extract the TypeScript template.

If TS‑only templates are the goal, consider either:

  • Rejecting or warning on --language rescript when a template is selected, or
  • Clarifying in CLI help/docs that EVM/Fuel templates are currently TS‑only.

Otherwise, if ReScript templates are expected here, this call should probably respect init_config.language instead of forcing TypeScript.

Also applies to: 55-67

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0b2a34d and be5a2eb.

📒 Files selected for processing (6)
  • codegenerator/cli/CommandLineHelp.md (1 hunks)
  • codegenerator/cli/src/cli_args/interactive_init/mod.rs (1 hunks)
  • codegenerator/cli/src/config_parsing/chain_helpers.rs (3 hunks)
  • codegenerator/cli/src/executor/init.rs (2 hunks)
  • codegenerator/cli/templates/static/blank_template/rescript/rescript.json (1 hunks)
  • codegenerator/cli/templates/static/blank_template/rescript/test/Test.res (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
codegenerator/cli/**

📄 CodeRabbit inference engine (.cursor/rules/navigation.mdc)

The Rust CLI lives in codegenerator/cli

Files:

  • codegenerator/cli/CommandLineHelp.md
  • codegenerator/cli/src/cli_args/interactive_init/mod.rs
  • codegenerator/cli/src/config_parsing/chain_helpers.rs
  • codegenerator/cli/src/executor/init.rs
  • codegenerator/cli/templates/static/blank_template/rescript/test/Test.res
  • codegenerator/cli/templates/static/blank_template/rescript/rescript.json
codegenerator/cli/templates/static/**/*.res

📄 CodeRabbit inference engine (.cursor/rules/navigation.mdc)

Static templates are raw ReScript files copied verbatim under codegenerator/cli/templates/static

Files:

  • codegenerator/cli/templates/static/blank_template/rescript/test/Test.res
**/*.res

📄 CodeRabbit inference engine (.cursor/rules/navigation.mdc)

Prefer reading ReScript .res modules directly

Files:

  • codegenerator/cli/templates/static/blank_template/rescript/test/Test.res
🧠 Learnings (6)
📚 Learning: 2025-10-21T16:31:22.127Z
Learnt from: CR
Repo: enviodev/hyperindex PR: 0
File: .cursor/rules/navigation.mdc:0-0
Timestamp: 2025-10-21T16:31:22.127Z
Learning: Applies to codegenerator/cli/src/lib.rs : CLI entry point is codegenerator/cli/src/lib.rs

Applied to files:

  • codegenerator/cli/src/cli_args/interactive_init/mod.rs
📚 Learning: 2025-10-21T16:31:22.127Z
Learnt from: CR
Repo: enviodev/hyperindex PR: 0
File: .cursor/rules/navigation.mdc:0-0
Timestamp: 2025-10-21T16:31:22.127Z
Learning: Applies to codegenerator/cli/** : The Rust CLI lives in codegenerator/cli

Applied to files:

  • codegenerator/cli/src/cli_args/interactive_init/mod.rs
📚 Learning: 2025-10-21T16:31:22.127Z
Learnt from: CR
Repo: enviodev/hyperindex PR: 0
File: .cursor/rules/navigation.mdc:0-0
Timestamp: 2025-10-21T16:31:22.127Z
Learning: Applies to codegenerator/cli/src/hbs_templating/codegen_templates.rs : hbs_templating/codegen_templates.rs feeds templates

Applied to files:

  • codegenerator/cli/src/executor/init.rs
📚 Learning: 2025-10-21T16:31:22.127Z
Learnt from: CR
Repo: enviodev/hyperindex PR: 0
File: .cursor/rules/navigation.mdc:0-0
Timestamp: 2025-10-21T16:31:22.127Z
Learning: Applies to codegenerator/cli/templates/static/**/*.res : Static templates are raw ReScript files copied verbatim under codegenerator/cli/templates/static

Applied to files:

  • codegenerator/cli/templates/static/blank_template/rescript/test/Test.res
  • codegenerator/cli/templates/static/blank_template/rescript/rescript.json
📚 Learning: 2025-10-21T16:31:22.127Z
Learnt from: CR
Repo: enviodev/hyperindex PR: 0
File: .cursor/rules/navigation.mdc:0-0
Timestamp: 2025-10-21T16:31:22.127Z
Learning: Applies to **/*.res : Prefer reading ReScript .res modules directly

Applied to files:

  • codegenerator/cli/templates/static/blank_template/rescript/test/Test.res
  • codegenerator/cli/templates/static/blank_template/rescript/rescript.json
📚 Learning: 2025-10-21T16:31:22.127Z
Learnt from: CR
Repo: enviodev/hyperindex PR: 0
File: .cursor/rules/navigation.mdc:0-0
Timestamp: 2025-10-21T16:31:22.127Z
Learning: Verify tests by running `pnpm rescript` then `pnpm mocha`; use `_only` to focus tests

Applied to files:

  • codegenerator/cli/templates/static/blank_template/rescript/test/Test.res
🧬 Code graph analysis (1)
codegenerator/cli/src/config_parsing/chain_helpers.rs (1)
codegenerator/cli/src/cli_args/interactive_init/evm_prompts.rs (1)
  • HypersyncNetwork (224-232)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build_and_test
🔇 Additional comments (5)
codegenerator/cli/CommandLineHelp.md (1)

109-109: Blockchain option list: Monad entries look consistent

The blockchain possible values now include both monad and monad-testnet in the expected kebab‑case and ordering; this matches the Network enum naming and looks good.

codegenerator/cli/templates/static/blank_template/rescript/test/Test.res (1)

1-3: ReScript blank test stub looks fine; just ensure dependencies exist

This is a reasonable minimal test entrypoint for the ReScript blank template; as long as RescriptMocha and TestHelpers are available in the generated project, it should compile and run.

It’s worth generating a new ReScript blank project and running pnpm rescript followed by pnpm mocha to confirm the scaffold builds and tests execute as expected. Based on learnings, this matches the usual verification flow.

codegenerator/cli/src/cli_args/interactive_init/mod.rs (1)

140-143: Defaulting missing language to TypeScript simplifies init behavior

Using Language::TypeScript when init_args.language is None removes the interactive language prompt and makes the default explicit, which should reduce friction in common cases.

Please confirm that this matches the intended UX (i.e., that it’s acceptable for envio init to silently choose TypeScript when -l/--language is omitted, and that docs/examples don’t still suggest an interactive language choice).

codegenerator/cli/templates/static/blank_template/rescript/rescript.json (1)

1-27: ReScript blank template config looks sensible

The rescript.json (bsconfig) for the blank ReScript template has a reasonable project name, sources (src and test with subdirs), CommonJS in‑source build, JSX v4, .res.js suffix, and expected bs-dependencies. It should work well as a scaffold.

Please double‑check that:

  • The generated project’s package.json pulls in generated, envio, and rescript-schema correctly, and
  • Your build/test flow (pnpm rescript then pnpm mocha) succeeds using this config on a freshly generated ReScript blank project.
codegenerator/cli/src/config_parsing/chain_helpers.rs (1)

260-265: Monad network wiring and tiering look internally consistent

Adding Monad = 143 with HypersyncNetwork/NetworkWithExplorer subenum membership, including it in the DEFAULT_CONFIRMED_BLOCK_THRESHOLD group, and classifying both Monad and MonadTestnet as Gold in HypersyncNetwork::get_tier all look coherent and preserve the enum’s alphabetical ordering constraints.

Also applies to: 557-559, 617-617

@DZakh DZakh closed this Nov 25, 2025
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.

2 participants