Add monad to HyperIndex V2#832
Conversation
WalkthroughThis 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
codegenerator/cli/src/executor/init.rs (1)
41-53: Template extraction now ignores requested language and forces TypeScriptBoth Fuel and EVM
Templateinit flows now callget_and_extract_templatewith&Language::TypeScript, regardless ofinit_config.language, and the error context no longer mentions language. This is fine if templates are intentionally TS‑only, but it meansenvio init ... --language rescriptplus a template choice will still extract the TypeScript template.If TS‑only templates are the goal, consider either:
- Rejecting or warning on
--language rescriptwhen 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.languageinstead of forcing TypeScript.Also applies to: 55-67
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 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.mdcodegenerator/cli/src/cli_args/interactive_init/mod.rscodegenerator/cli/src/config_parsing/chain_helpers.rscodegenerator/cli/src/executor/init.rscodegenerator/cli/templates/static/blank_template/rescript/test/Test.rescodegenerator/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.rescodegenerator/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.rescodegenerator/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 consistentThe
blockchainpossible values now include bothmonadandmonad-testnetin 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 existThis is a reasonable minimal test entrypoint for the ReScript blank template; as long as
RescriptMochaandTestHelpersare available in the generated project, it should compile and run.It’s worth generating a new ReScript blank project and running
pnpm rescriptfollowed bypnpm mochato 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 behaviorUsing
Language::TypeScriptwheninit_args.languageisNoneremoves 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 initto silently choose TypeScript when-l/--languageis 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 sensibleThe
rescript.json(bsconfig) for the blank ReScript template has a reasonable project name, sources (srcandtestwith subdirs), CommonJS in‑source build, JSX v4,.res.jssuffix, and expectedbs-dependencies. It should work well as a scaffold.Please double‑check that:
- The generated project’s
package.jsonpulls ingenerated,envio, andrescript-schemacorrectly, and- Your build/test flow (
pnpm rescriptthenpnpm 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 consistentAdding
Monad = 143withHypersyncNetwork/NetworkWithExplorersubenum membership, including it in the DEFAULT_CONFIRMED_BLOCK_THRESHOLD group, and classifying bothMonadandMonadTestnetasGoldinHypersyncNetwork::get_tierall look coherent and preserve the enum’s alphabetical ordering constraints.Also applies to: 557-559, 617-617
#831: The last PR was updating V3 instead of V2. This one updates HyperIndex V2.
Summary by CodeRabbit
New Features
Updates
✏️ Tip: You can customize this high-level summary in your review settings.