Skip to content

chore: made so cursor rules is downloaded on init#778

Merged
keenbeen32 merged 2 commits into
mainfrom
kv/subgraph-migration-mdc-downloaded-on-init
Oct 13, 2025
Merged

chore: made so cursor rules is downloaded on init#778
keenbeen32 merged 2 commits into
mainfrom
kv/subgraph-migration-mdc-downloaded-on-init

Conversation

@keenbeen32

@keenbeen32 keenbeen32 commented Oct 10, 2025

Copy link
Copy Markdown
Contributor

Updated subgraph-migration.mdc file to latest version and made so downloaded on init.

Summary by CodeRabbit

  • Documentation
    • Added a comprehensive, mandatory migration guide for subgraphs to Envio HyperIndex with step-by-step workflow.
    • Introduced a CRITICAL requirement to use the Effect API for all external calls, with guidance on batching, error handling, context usage, and caching.
    • Enforced exact filename/structure matching, prohibited TODOs in final steps, and added an expanded runtime testing checklist and a new environment-variable setup step.
    • Tightened validation, examples, and wording across migration instructions.

@coderabbitai

coderabbitai Bot commented Oct 10, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Updates add a standardized subgraph migration MDC to shared templates and tighten the repository-local migration MDC: stricter filename/structure requirements, mandatory Effect API usage for external calls, expanded environment-variable setup, and reinforced validation/checklist wording. Changes are documentation-only.

Changes

Cohort / File(s) Summary
Repo-local MDC update
.cursor/rules/subgraph-migration.mdc
Edited the existing migration guide: stricter wording requiring EXACT filenames and skeletons, expanded Runtime Testing Checklist, new CRITICAL section mandating the Effect API for external calls (batching, error handling, context.effect, caching), added Step 7 for environment-variable discovery and .env.example, guidance to place effects under src/effects/, reinforced contract-state fetching and field_selection examples, and tightened final verification (no TODOs).
Shared template MDC addition
codegenerator/cli/templates/static/shared/.cursor/rules/subgraph-migration.mdc
Added a comprehensive mandatory migration MDC for Envio HyperIndex covering stepwise migration workflow: schema/file refactors, dynamic contract registration, helper/effect implementation, progressive handler migration, repeated codegen/tsc/runtime testing, examples, YAML guidance, and extensive validation checklists.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • DZakh
  • DenhamPreen

Poem

In burrows of docs I tidy each line,
Filenames EXACTLY, every carrot in line.
Effects for the calls, no stray state to fetch,
Env seeds planted in a neat .env sketch.
Hop, test, and ship—this migration smells fine! 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The pull request title suggests that cursor rules will be downloaded on init, implying a code change, but the actual changes are documentation updates to the subgraph‐migration guide without implementing the described behavior, so the title does not accurately reflect the main change. Please update the title to clearly describe updating the subgraph‐migration documentation or include the implementation of downloading cursor rules on init if that behavior is intended, using concise and specific phrasing.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch kv/subgraph-migration-mdc-downloaded-on-init

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 04ece9e and 9eff9cf.

📒 Files selected for processing (2)
  • .cursor/rules/subgraph-migration.mdc (9 hunks)
  • codegenerator/cli/templates/static/shared/.cursor/rules/subgraph-migration.mdc (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • codegenerator/cli/templates/static/shared/.cursor/rules/subgraph-migration.mdc
🧰 Additional context used
🧠 Learnings (19)
📚 Learning: 2025-08-11T08:42:57.311Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: codegenerator/cli/templates/static/shared/.cursor/rules/hyperindex.mdc:0-0
Timestamp: 2025-08-11T08:42:57.311Z
Learning: Always include HyperIndex documentation and the Uniswap v4 and Safe example indexers as context when working on the indexer

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-08-11T08:47:04.346Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: scenarios/fuel_test/.cursor/rules/hyperindex.mdc:0-0
Timestamp: 2025-08-11T08:47:04.346Z
Learning: Always load and reference HyperIndex docs and example indexers during development (docs.envio.dev HyperIndex, Uniswap v4 indexer, Safe indexer)

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-08-11T08:49:57.399Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: scenarios/test_codegen/.cursor/rules/hyperindex.mdc:0-0
Timestamp: 2025-08-11T08:49:57.399Z
Learning: Include HyperIndex documentation and example indexers (Uniswap v4 and Safe) in the context during development

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-09-04T14:42:53.500Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: .cursor/rules/subgraph-migration.mdc:0-0
Timestamp: 2025-09-04T14:42:53.500Z
Learning: After every code change, run runtime tests using `TUI_OFF=true pnpm dev` and watch for errors before proceeding

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-08-11T08:49:57.399Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: scenarios/test_codegen/.cursor/rules/hyperindex.mdc:0-0
Timestamp: 2025-08-11T08:49:57.399Z
Learning: Once compilation succeeds, run: TUI_OFF=true pnpm dev to check for runtime errors

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-08-11T08:47:04.346Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: scenarios/fuel_test/.cursor/rules/hyperindex.mdc:0-0
Timestamp: 2025-08-11T08:47:04.346Z
Learning: Once compilation is successful, run `TUI_OFF=true pnpm dev` to catch runtime errors

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-09-04T14:42:53.500Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: .cursor/rules/subgraph-migration.mdc:0-0
Timestamp: 2025-09-04T14:42:53.500Z
Learning: Applies to src/contract*.ts : Split handlers into contract-specific files (e.g., src/contract1.ts, src/contract2.ts, src/contract3.ts) as skeletons without business logic in Step 3

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-09-04T14:42:53.500Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: .cursor/rules/subgraph-migration.mdc:0-0
Timestamp: 2025-09-04T14:42:53.500Z
Learning: Applies to src/{utils,intervals}/*.ts : Create skeleton utility and interval files (utils/constants.ts, utils/helpers.ts, intervals/timeUpdates.ts) with TODOs referencing the original subgraph

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-09-04T14:42:53.500Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: .cursor/rules/subgraph-migration.mdc:0-0
Timestamp: 2025-09-04T14:42:53.500Z
Learning: Applies to src/EventHandlers.ts : Remove the original EventHandlers.ts file after moving handlers to contract-specific files

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-09-04T14:42:53.500Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: .cursor/rules/subgraph-migration.mdc:0-0
Timestamp: 2025-09-04T14:42:53.500Z
Learning: Applies to src/EventHandlers.ts : Clear boilerplate logic in EventHandlers.ts and replace handlers with empty skeletons with TODOs in Step 1

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-09-04T14:42:53.500Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: .cursor/rules/subgraph-migration.mdc:0-0
Timestamp: 2025-09-04T14:42:53.500Z
Learning: Applies to src/**/*.ts : Avoid hardcoded addresses/values; use constants from original subgraph (e.g., FACTORY_ADDRESS, ADDRESS_ZERO)

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-08-11T08:47:04.346Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: scenarios/fuel_test/.cursor/rules/hyperindex.mdc:0-0
Timestamp: 2025-08-11T08:47:04.346Z
Learning: Applies to scenarios/fuel_test/**/*.ts : With preload enabled (handlers run twice), all external calls (e.g., fetch) MUST be implemented via the Envio Effect API (experimental_createEffect and context.effect)

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-09-04T14:42:53.500Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: .cursor/rules/subgraph-migration.mdc:0-0
Timestamp: 2025-09-04T14:42:53.500Z
Learning: Applies to src/effects/*.ts : Place external/RPC call logic in Effect API modules (experimental_createEffect) under src/effects, with schemas and error handling

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-08-11T08:49:57.399Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: scenarios/test_codegen/.cursor/rules/hyperindex.mdc:0-0
Timestamp: 2025-08-11T08:49:57.399Z
Learning: Applies to scenarios/test_codegen/**/*.ts : For any external call (e.g., fetch), wrap it in an Effect via experimental_createEffect and consume via context.effect

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-09-04T14:42:53.500Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: .cursor/rules/subgraph-migration.mdc:0-0
Timestamp: 2025-09-04T14:42:53.500Z
Learning: Applies to src/**/*.ts : Call external/RPC operations via context.effect(effectFn, input) within handlers; avoid direct RPC calls and .bind() patterns

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-08-11T08:42:57.311Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: codegenerator/cli/templates/static/shared/.cursor/rules/hyperindex.mdc:0-0
Timestamp: 2025-08-11T08:42:57.311Z
Learning: Applies to codegenerator/cli/templates/static/shared/**/*.ts : All external calls must be made via the Envio Effect API when preload optimisations are enabled

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-08-11T08:42:57.311Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: codegenerator/cli/templates/static/shared/.cursor/rules/hyperindex.mdc:0-0
Timestamp: 2025-08-11T08:42:57.311Z
Learning: Applies to codegenerator/cli/templates/static/shared/**/*.ts : Use `context.effect` to consume effects from handlers rather than calling external services directly

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-08-11T08:49:57.399Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: scenarios/test_codegen/.cursor/rules/hyperindex.mdc:0-0
Timestamp: 2025-08-11T08:49:57.399Z
Learning: Applies to scenarios/test_codegen/**/*.ts : After changing any TypeScript files, run: pnpm tsc --noEmit to ensure successful compilation

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-08-11T08:42:57.311Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: codegenerator/cli/templates/static/shared/.cursor/rules/hyperindex.mdc:0-0
Timestamp: 2025-08-11T08:42:57.311Z
Learning: Applies to codegenerator/cli/templates/static/shared/**/*.ts : After any change to TypeScript files, run `pnpm tsc --noEmit` to ensure successful compilation

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
⏰ 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

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.

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
.cursor/rules/subgraph-migration.mdc (4)

248-252: Missing backtick and punctuation in @derivedFrom sentence

Close the inline code and fix punctuation for clarity.

Apply this diff:

-**Envio requires explicit relationship definitions** via `@derivedFrom
-- **But the arrays are virtual** - they exist only in the API, not in handlers
+**Envio requires explicit relationship definitions** via `@derivedFrom`
+- **But the arrays are virtual** — they exist only in the API, not in handlers

603-606: Incorrect TypeScript types and methods for BigDecimal example

BigInt (capitalized) is not a TS type (use bigint). divDecimal and BigDecimal.fromString mirror TheGraph/AssemblyScript, not Envio TS BigDecimal usage.

Replace with a TS-accurate example. For instance:

-export function convertEthToDecimal(eth: BigInt): BigDecimal {
-  // Only depends on constants and BigDecimal math - no entity or handler dependencies
-  return eth.divDecimal(BigDecimal.fromString('1000000000000000000'));
-}
+import { BigDecimal } from 'generated';
+const WEI_IN_ETH = new BigDecimal('1000000000000000000');
+export function convertEthToDecimal(wei: bigint): BigDecimal {
+  // Convert bigint to BigDecimal, then divide
+  return new BigDecimal(wei.toString()).div(WEI_IN_ETH);
+}

Please also align other BigDecimal usages to TS methods (e.g., div, multipliedBy, depending on the re-export). Based on learnings


1156-1180: Effect output schema mismatches returned value; null union likely incorrect

The example sets output: S.union([S.string, null]) yet returns something.json() (an object). Use an object schema or return a string, and use S.null() (or the correct null schema) instead of null.

Apply one of:

-    output: S.union([S.string, null]),
+    output: S.union([S.object({ $$$: S.unknown }), S.null()]),
@@
-    return something.json();
+    return await something.json();

Or if returning text:

-    output: S.union([S.string, null]),
+    output: S.union([S.string, S.null()]),
@@
-    return something.json();
+    return await something.text();

Also consider adding a brief note on error status handling (non-2xx). Based on learnings


53-56: Update Node.js version requirement
Replace the “Node.js v20 only (no higher or lower versions)” bullet with “Node.js v22 or newer (tested on v22.x)” to match current HyperIndex prerequisites.

♻️ Duplicate comments (3)
codegenerator/cli/templates/static/shared/.cursor/rules/subgraph-migration.mdc (3)

241-245: Repeat: Standardize where vs getWhere API

Please mirror the chosen API consistently here as well.

Also applies to: 861-865, 1812-1816


1156-1180: Repeat: Effect schema/return mismatch and null union

Same issue as the root MDC; please apply the same fix here to keep examples correct.


603-606: Repeat: BigDecimal example uses incorrect TS types/methods

Same correction applies here; align to TS BigDecimal usage and bigint.

🧹 Nitpick comments (3)
.cursor/rules/subgraph-migration.mdc (2)

241-245: Inconsistent query API: where vs getWhere

Examples alternate between context.Entity.where... and context.Entity.getWhere.... Standardize on the correct API name used by the current Envio version to avoid confusion.

Would you confirm the correct helper and update all examples to match? If helpful, I can submit a unified snippet once you confirm the API. Based on learnings

Also applies to: 861-865, 1812-1816


1071-1075: BigDecimal source ambiguity (generated vs external dependency)

Doc says to install bignumber.js but later imports BigDecimal from generated. Clarify the single source of truth to prevent confusion.

  • If generated re-exports the BigDecimal type, remove the install step.
  • If not, standardize imports on the chosen library and update examples accordingly. Based on learnings

Also applies to: 1586-1591

codegenerator/cli/templates/static/shared/.cursor/rules/subgraph-migration.mdc (1)

1-1882: Add CI step to verify subgraph-migration.mdc sync

  • In CI, run:
    diff -u ".cursor/rules/subgraph-migration.mdc" "codegenerator/cli/templates/static/shared/.cursor/rules/subgraph-migration.mdc"
  • Consolidate to a single source of truth for this MDC template to avoid duplication drift.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 85577d3 and 04ece9e.

📒 Files selected for processing (2)
  • .cursor/rules/subgraph-migration.mdc (9 hunks)
  • codegenerator/cli/templates/static/shared/.cursor/rules/subgraph-migration.mdc (1 hunks)
🧰 Additional context used
🧠 Learnings (19)
📚 Learning: 2025-08-11T08:42:57.311Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: codegenerator/cli/templates/static/shared/.cursor/rules/hyperindex.mdc:0-0
Timestamp: 2025-08-11T08:42:57.311Z
Learning: Always include HyperIndex documentation and the Uniswap v4 and Safe example indexers as context when working on the indexer

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-08-11T08:47:04.346Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: scenarios/fuel_test/.cursor/rules/hyperindex.mdc:0-0
Timestamp: 2025-08-11T08:47:04.346Z
Learning: Always load and reference HyperIndex docs and example indexers during development (docs.envio.dev HyperIndex, Uniswap v4 indexer, Safe indexer)

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-08-11T08:49:57.399Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: scenarios/test_codegen/.cursor/rules/hyperindex.mdc:0-0
Timestamp: 2025-08-11T08:49:57.399Z
Learning: Include HyperIndex documentation and example indexers (Uniswap v4 and Safe) in the context during development

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-09-04T14:42:53.500Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: .cursor/rules/subgraph-migration.mdc:0-0
Timestamp: 2025-09-04T14:42:53.500Z
Learning: After every code change, run runtime tests using `TUI_OFF=true pnpm dev` and watch for errors before proceeding

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-08-11T08:49:57.399Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: scenarios/test_codegen/.cursor/rules/hyperindex.mdc:0-0
Timestamp: 2025-08-11T08:49:57.399Z
Learning: Once compilation succeeds, run: TUI_OFF=true pnpm dev to check for runtime errors

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-08-11T08:47:04.346Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: scenarios/fuel_test/.cursor/rules/hyperindex.mdc:0-0
Timestamp: 2025-08-11T08:47:04.346Z
Learning: Once compilation is successful, run `TUI_OFF=true pnpm dev` to catch runtime errors

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-09-04T14:42:53.500Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: .cursor/rules/subgraph-migration.mdc:0-0
Timestamp: 2025-09-04T14:42:53.500Z
Learning: Applies to src/contract*.ts : Split handlers into contract-specific files (e.g., src/contract1.ts, src/contract2.ts, src/contract3.ts) as skeletons without business logic in Step 3

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-09-04T14:42:53.500Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: .cursor/rules/subgraph-migration.mdc:0-0
Timestamp: 2025-09-04T14:42:53.500Z
Learning: Applies to src/{utils,intervals}/*.ts : Create skeleton utility and interval files (utils/constants.ts, utils/helpers.ts, intervals/timeUpdates.ts) with TODOs referencing the original subgraph

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-09-04T14:42:53.500Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: .cursor/rules/subgraph-migration.mdc:0-0
Timestamp: 2025-09-04T14:42:53.500Z
Learning: Applies to src/EventHandlers.ts : Remove the original EventHandlers.ts file after moving handlers to contract-specific files

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-09-04T14:42:53.500Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: .cursor/rules/subgraph-migration.mdc:0-0
Timestamp: 2025-09-04T14:42:53.500Z
Learning: Applies to src/EventHandlers.ts : Clear boilerplate logic in EventHandlers.ts and replace handlers with empty skeletons with TODOs in Step 1

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-09-04T14:42:53.500Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: .cursor/rules/subgraph-migration.mdc:0-0
Timestamp: 2025-09-04T14:42:53.500Z
Learning: Applies to src/**/*.ts : Avoid hardcoded addresses/values; use constants from original subgraph (e.g., FACTORY_ADDRESS, ADDRESS_ZERO)

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-08-11T08:47:04.346Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: scenarios/fuel_test/.cursor/rules/hyperindex.mdc:0-0
Timestamp: 2025-08-11T08:47:04.346Z
Learning: Applies to scenarios/fuel_test/**/*.ts : With preload enabled (handlers run twice), all external calls (e.g., fetch) MUST be implemented via the Envio Effect API (experimental_createEffect and context.effect)

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-09-04T14:42:53.500Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: .cursor/rules/subgraph-migration.mdc:0-0
Timestamp: 2025-09-04T14:42:53.500Z
Learning: Applies to src/effects/*.ts : Place external/RPC call logic in Effect API modules (experimental_createEffect) under src/effects, with schemas and error handling

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-08-11T08:49:57.399Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: scenarios/test_codegen/.cursor/rules/hyperindex.mdc:0-0
Timestamp: 2025-08-11T08:49:57.399Z
Learning: Applies to scenarios/test_codegen/**/*.ts : For any external call (e.g., fetch), wrap it in an Effect via experimental_createEffect and consume via context.effect

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-09-04T14:42:53.500Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: .cursor/rules/subgraph-migration.mdc:0-0
Timestamp: 2025-09-04T14:42:53.500Z
Learning: Applies to src/**/*.ts : Call external/RPC operations via context.effect(effectFn, input) within handlers; avoid direct RPC calls and .bind() patterns

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-08-11T08:42:57.311Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: codegenerator/cli/templates/static/shared/.cursor/rules/hyperindex.mdc:0-0
Timestamp: 2025-08-11T08:42:57.311Z
Learning: Applies to codegenerator/cli/templates/static/shared/**/*.ts : All external calls must be made via the Envio Effect API when preload optimisations are enabled

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-08-11T08:42:57.311Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: codegenerator/cli/templates/static/shared/.cursor/rules/hyperindex.mdc:0-0
Timestamp: 2025-08-11T08:42:57.311Z
Learning: Applies to codegenerator/cli/templates/static/shared/**/*.ts : Use `context.effect` to consume effects from handlers rather than calling external services directly

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-08-11T08:49:57.399Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: scenarios/test_codegen/.cursor/rules/hyperindex.mdc:0-0
Timestamp: 2025-08-11T08:49:57.399Z
Learning: Applies to scenarios/test_codegen/**/*.ts : After changing any TypeScript files, run: pnpm tsc --noEmit to ensure successful compilation

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
📚 Learning: 2025-08-11T08:42:57.311Z
Learnt from: CR
PR: enviodev/hyperindex#0
File: codegenerator/cli/templates/static/shared/.cursor/rules/hyperindex.mdc:0-0
Timestamp: 2025-08-11T08:42:57.311Z
Learning: Applies to codegenerator/cli/templates/static/shared/**/*.ts : After any change to TypeScript files, run `pnpm tsc --noEmit` to ensure successful compilation

Applied to files:

  • .cursor/rules/subgraph-migration.mdc
⏰ 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 (2)
.cursor/rules/subgraph-migration.mdc (1)

908-929: Step 7 addition is excellent

Enumerating env vars and documenting .env.example will prevent runtime misconfigurations. LGTM.

Based on learnings

codegenerator/cli/templates/static/shared/.cursor/rules/subgraph-migration.mdc (1)

908-929: Approve Step 7 in the template copy as well

Great addition; ensures new projects document envs from day one.

- [ ] **Stop the background process** after confirming it runs without errors
- [ ] **Only proceed to the next step** after confirming the indexer runs without errors

**Common Runtime Errors to Watch For:**s

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.

⚠️ Potential issue | 🟡 Minor

Typo in heading

Remove the trailing "s" after the bolded heading.

Apply this diff:

-**Common Runtime Errors to Watch For:**s
+**Common Runtime Errors to Watch For:**
📝 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
**Common Runtime Errors to Watch For:**s
**Common Runtime Errors to Watch For:**
🤖 Prompt for AI Agents
In .cursor/rules/subgraph-migration.mdc at line 88, the bolded heading "**Common
Runtime Errors to Watch For:**s" contains a stray trailing "s"; remove that
extra character so the heading reads "**Common Runtime Errors to Watch For:**".
Make the change in-place on that line only.

@keenbeen32 keenbeen32 force-pushed the kv/subgraph-migration-mdc-downloaded-on-init branch from 04ece9e to 9eff9cf Compare October 13, 2025 08:36
@JonoPrest

Copy link
Copy Markdown
Collaborator

Cool @keenbeen32 👍🏼 I'm not fully familiar with the project but all good with these changes.

Are these llm docs written in this repo or do they come from docs somewhere? Might be worth setting up a pipeline so that it gets updated here when anything changes if thats the case.

@keenbeen32

Copy link
Copy Markdown
Contributor Author

@JonoPrest Thanks that's a good point. At the moment I'm just copying them across to whatever new migration I'm doing's repo, then updating them as I migrate and copying the updated version back. It's really not an ideal system though😂 Will look into setting something better up, shot for the thought!

@keenbeen32

Copy link
Copy Markdown
Contributor Author

@JonoPrest Also do you mind approving the changes if you're happy to so I can complete the merge🙏

@JonoPrest

Copy link
Copy Markdown
Collaborator

@JonoPrest Also do you mind approving the changes if you're happy to so I can complete the merge🙏

Sorry I thought I had 👍🏼

@keenbeen32 keenbeen32 merged commit d5950c2 into main Oct 13, 2025
2 checks passed
@keenbeen32 keenbeen32 deleted the kv/subgraph-migration-mdc-downloaded-on-init branch October 13, 2025 12:25
@coderabbitai coderabbitai Bot mentioned this pull request Nov 3, 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