Conversation
WalkthroughAdds a static, deep-linkable Config Schema Reference page and integrates an automated generator script to produce it from JSON Schema during predeploy. Updates a guide to link to the new reference, adjusts the HyperIndex sidebar, and removes “Gnosis Traces” from HyperSync supported networks. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant NPM as predeploy script
participant Gen as generate-config-schema-doc.js
participant Schema as static/schemas/config.evm.json
participant Doc as docs/HyperIndex/Advanced/config-schema-reference.md
participant Site as Docs site
Dev->>NPM: yarn predeploy
NPM->>Gen: yarn generate-config-schema-doc
Gen->>Schema: Read JSON Schema
Gen->>Doc: Write Markdown reference
Site-->>Doc: Link via sidebar and guide
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15–20 minutes Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Actionable comments posted: 4
🔭 Outside diff range comments (1)
docs/HyperIndex/Guides/configuration-file.mdx (1)
184-185: Broken in-page link: “Interactive Schema Explorer” anchor no longer existsThe interactive viewer section was removed; this link will now be dead. Point it to the new reference.
Apply:
-See all possible options in the [Interactive Schema Explorer](#interactive-schema-explorer) or use IDE autocomplete for your help. +See all possible options in the [Config Schema Reference](../Advanced/config-schema-reference) or use IDE autocomplete for your help.
🧹 Nitpick comments (2)
scripts/generate-config-schema-doc.js (1)
27-58: Consider externalizing the example snippets for better maintainability.The hardcoded YAML examples could become outdated when the schema changes. Consider loading these from external YAML files or generating them from test fixtures to ensure they stay in sync with the actual schema.
package.json (1)
9-12: Consider generating the doc for local dev/build flows tooIf the generated doc isn’t checked in or needs to stay fresh locally, include generation in predev/prebuild. Otherwise devs may see stale/missing pages.
Example:
-"predev": "node ./scripts/update-endpoints.js", +"predev": "node ./scripts/update-endpoints.js && yarn generate-config-schema-doc", -"prebuild": "node ./scripts/update-endpoints.js", +"prebuild": "yarn update-endpoints && yarn update-cli-help && yarn update-evm-config-schema && yarn generate-config-schema-doc",Also consider LLM builds:
-"build-llm": "yarn consolidate-docs && npx docusaurus build --config docusaurus.config.llm.js", +"build-llm": "yarn consolidate-docs && yarn generate-config-schema-doc && npx docusaurus build --config docusaurus.config.llm.js", -"start-llm": "yarn consolidate-docs && npx docusaurus start --config docusaurus.config.llm.js" +"start-llm": "yarn consolidate-docs && yarn generate-config-schema-doc && npx docusaurus start --config docusaurus.config.llm.js"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
docs/HyperIndex/Advanced/config-schema-reference.md(1 hunks)docs/HyperIndex/Guides/configuration-file.mdx(1 hunks)docs/HyperSync/HyperRPC/hyperrpc-supported-networks.md(0 hunks)docs/HyperSync/hypersync-supported-networks.md(0 hunks)package.json(1 hunks)scripts/generate-config-schema-doc.js(1 hunks)sidebarsHyperIndex.js(1 hunks)
💤 Files with no reviewable changes (2)
- docs/HyperSync/HyperRPC/hyperrpc-supported-networks.md
- docs/HyperSync/hypersync-supported-networks.md
🧰 Additional context used
🪛 LanguageTool
docs/HyperIndex/Advanced/config-schema-reference.md
[grammar] ~266-~266: Ensure spelling is correct
Context: ... in the HyperIndex generated code. When ommitted, the event field will be used. Should b...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[style] ~266-~266: To form a complete sentence, be sure to include a subject.
Context: ...ommitted, the event field will be used. Should be unique per contract - `field_selecti...
(MISSING_IT_THERE)
[style] ~346-~346: To form a complete sentence, be sure to include a subject or ‘there’.
Context: ...string>)` – URL of the RPC endpoint. Can be a single URL or an array of URLs. If...
(MISSING_IT_THERE)
🔇 Additional comments (4)
package.json (1)
17-18: Good addition: generation script is hooked into predeployAdding generate-config-schema-doc and chaining it in predeploy after fetching the schema is correct and keeps the reference up to date at deploy time.
docs/HyperIndex/Guides/configuration-file.mdx (1)
357-357: Section rename looks good“Configuration Schema Reference” matches the new static, deep-linkable reference.
sidebarsHyperIndex.js (2)
101-102: Sidebar entry correctly added and positionedAdvanced/config-schema-reference matches the expected doc id from docs/HyperIndex/Advanced/config-schema-reference.md. Good placement between related topics.
99-104: Sidebar entries validated – no issues found
The referenced documentAdvanced/config-schema-reference.mdexists atdocs/HyperIndex/Advanced/config-schema-reference.mdand declaresid: config-schema-referenceas expected. No broken sidebar links detected.
|
|
||
| Properties: | ||
| - `event`: `string` – The human readable signature of an event 'eg. Transfer(address indexed from, address indexed to, uint256 value)' OR a reference to the name of an event in a json ABI file defined in your contract config. A provided signature will take precedence over what is defined in the json ABI | ||
| - `name`: `string | null` – Name of the event in the HyperIndex generated code. When ommitted, the event field will be used. Should be unique per contract |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Fix typo in generated documentation: "ommitted" should be "omitted".
This appears to be generated content. The typo should be fixed in the source schema or generator script.
🏁 Script executed:
#!/bin/bash
# Search for the source of the typo in the schema file
rg -A 2 -B 2 "ommitted" static/schemas/config.evm.jsonLength of output: 280
Fix typo in config schema description
Please update the source schema to correct “ommitted” → “omitted” so that generated docs reflect the fix.
Affected file:
static/schemas/config.evm.json"description": "Name of the event in the HyperIndex generated code. When ommitted, the event field will be used. Should be unique per contract", + "description": "Name of the event in the HyperIndex generated code. When omitted, the event field will be used. Should be unique per contract",
After applying the change, regenerate the documentation (e.g., rerun the schema‐to‐Markdown generator) to update docs/HyperIndex/Advanced/config-schema-reference.md.
📝 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.
| - `name`: `string | null` – Name of the event in the HyperIndex generated code. When ommitted, the event field will be used. Should be unique per contract | |
| - "description": "Name of the event in the HyperIndex generated code. When ommitted, the event field will be used. Should be unique per contract", | |
| + "description": "Name of the event in the HyperIndex generated code. When omitted, the event field will be used. Should be unique per contract", |
🧰 Tools
🪛 LanguageTool
[grammar] ~266-~266: Ensure spelling is correct
Context: ... in the HyperIndex generated code. When ommitted, the event field will be used. Should b...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[style] ~266-~266: To form a complete sentence, be sure to include a subject.
Context: ...ommitted, the event field will be used. Should be unique per contract - `field_selecti...
(MISSING_IT_THERE)
🤖 Prompt for AI Agents
In docs/HyperIndex/Advanced/config-schema-reference.md around line 266, the word
"ommitted" in the description should be corrected to "omitted"; edit the source
schema file static/schemas/config.evm.json to fix the typo in the corresponding
"description" field, then re-run the schema-to-Markdown documentation generator
to regenerate docs/HyperIndex/Advanced/config-schema-reference.md so the
corrected text appears in the generated docs.
| import JSONSchemaViewer from "@theme/JSONSchemaViewer"; | ||
|
|
||
| <JSONSchemaViewer schema={Schema} /> | ||
| - See the full, deep-linkable reference: [Config Schema Reference](/docs/HyperIndex/config-schema-reference) |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Prefer a relative doc link (or verify slug) to avoid broken routes
The link uses an absolute path that assumes a specific slug. If the generated page doesn’t set slug: /config-schema-reference (under the HyperIndex docs route), this may 404. Use a relative link to the doc id to decouple from slug.
Apply:
-- See the full, deep-linkable reference: [Config Schema Reference](/docs/HyperIndex/config-schema-reference)
+- See the full, deep-linkable reference: [Config Schema Reference](../Advanced/config-schema-reference)To verify current frontmatter, run:
🏁 Script executed:
#!/bin/bash
# Inspect frontmatter for id/slug of the generated page
fd -a 'config-schema-reference.md' docs | sed -n '1,1p'
echo "---- frontmatter ----"
fd -a 'config-schema-reference.md' docs | xargs -I{} awk 'NR==1,/^---$/{print} NR>1 && p==0{exit} /^---$/{p++}' {}
echo "---- id/slug lines ----"
fd -a 'config-schema-reference.md' docs | xargs rg -n '^(id|slug):'Length of output: 488
Update the doc link to prevent a 404
I confirmed that docs/HyperIndex/Advanced/config-schema-reference.md has slug: /config-schema-reference, so the current absolute link /docs/HyperIndex/config-schema-reference will 404. Prefer a relative link to the source file:
- See the full, deep-linkable reference: [Config Schema Reference](/docs/HyperIndex/config-schema-reference)
+ See the full, deep-linkable reference: [Config Schema Reference](../Advanced/config-schema-reference)📝 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.
| - See the full, deep-linkable reference: [Config Schema Reference](/docs/HyperIndex/config-schema-reference) | |
| - See the full, deep-linkable reference: [Config Schema Reference](../Advanced/config-schema-reference) |
🤖 Prompt for AI Agents
In docs/HyperIndex/Guides/configuration-file.mdx around line 361, the absolute
link /docs/HyperIndex/config-schema-reference will 404 because the actual
document slug is /config-schema-reference; update the link to a relative path
pointing to the source file (for example ../Advanced/config-schema-reference or
./../Advanced/config-schema-reference.md or the direct repo path
docs/HyperIndex/Advanced/config-schema-reference.md) so the link resolves
correctly to the config schema reference page.
| @@ -14,7 +14,8 @@ | |||
| "update-endpoints": "node ./scripts/update-endpoints.js", | |||
| "update-cli-help": "node ./scripts/update-cli-help.js", | |||
| "update-evm-config-schema": "curl https://raw.githubusercontent.com/enviodev/hyperindex/main/codegenerator/cli/npm/envio/evm.schema.json > ./static/schemas/config.evm.json", | |||
There was a problem hiding this comment.
🛠️ Refactor suggestion
Harden the schema fetch to avoid silent failures and ensure directory exists
curl without strict flags can write HTML error pages or empty files; mkdir safeguards the target path.
Apply:
-"update-evm-config-schema": "curl https://raw.githubusercontent.com/enviodev/hyperindex/main/codegenerator/cli/npm/envio/evm.schema.json > ./static/schemas/config.evm.json",
+"update-evm-config-schema": "mkdir -p ./static/schemas && curl -fsSL https://raw.githubusercontent.com/enviodev/hyperindex/main/codegenerator/cli/npm/envio/evm.schema.json -o ./static/schemas/config.evm.json && test -s ./static/schemas/config.evm.json",Optional hardening: pin to a specific commit SHA for reproducibility:
-https://raw.githubusercontent.com/enviodev/hyperindex/main/codegenerator/cli/npm/envio/evm.schema.json
+https://raw.githubusercontent.com/enviodev/hyperindex/<PINNED_COMMIT_SHA>/codegenerator/cli/npm/envio/evm.schema.json📝 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.
| "update-evm-config-schema": "curl https://raw.githubusercontent.com/enviodev/hyperindex/main/codegenerator/cli/npm/envio/evm.schema.json > ./static/schemas/config.evm.json", | |
| "update-evm-config-schema": "mkdir -p ./static/schemas && curl -fsSL https://raw.githubusercontent.com/enviodev/hyperindex/main/codegenerator/cli/npm/envio/evm.schema.json -o ./static/schemas/config.evm.json && test -s ./static/schemas/config.evm.json", |
🤖 Prompt for AI Agents
In package.json around line 16, the npm script that uses curl to fetch the
schema is brittle: it can create empty or HTML error files and assumes the
target directory exists; update the script to first create the static/schemas
directory (mkdir -p ./static/schemas) and run curl with strict flags to fail
loudly and write only on success (e.g. --fail --location --silent --show-error),
redirecting output to the file; optionally replace the GitHub branch URL with a
pinned commit SHA to ensure reproducible fetches.
| function main() { | ||
| if (!fs.existsSync(INPUT_SCHEMA_PATH)) { | ||
| console.error(`Schema not found at ${INPUT_SCHEMA_PATH}`); | ||
| process.exit(1); | ||
| } | ||
| const raw = fs.readFileSync(INPUT_SCHEMA_PATH, "utf8"); | ||
| const schema = JSON.parse(raw); | ||
| const md = generateMarkdown(schema); | ||
| ensureDirSync(OUTPUT_DOC_PATH); | ||
| fs.writeFileSync(OUTPUT_DOC_PATH, md, "utf8"); | ||
| console.log(`Wrote schema reference to ${OUTPUT_DOC_PATH}`); | ||
| } | ||
|
|
||
| main(); |
There was a problem hiding this comment.
Add error handling for JSON parsing and file operations.
The script lacks error handling for JSON parsing and file write operations, which could cause unhandled exceptions.
Apply this diff to add proper error handling:
function main() {
if (!fs.existsSync(INPUT_SCHEMA_PATH)) {
console.error(`Schema not found at ${INPUT_SCHEMA_PATH}`);
process.exit(1);
}
- const raw = fs.readFileSync(INPUT_SCHEMA_PATH, "utf8");
- const schema = JSON.parse(raw);
- const md = generateMarkdown(schema);
- ensureDirSync(OUTPUT_DOC_PATH);
- fs.writeFileSync(OUTPUT_DOC_PATH, md, "utf8");
- console.log(`Wrote schema reference to ${OUTPUT_DOC_PATH}`);
+ try {
+ const raw = fs.readFileSync(INPUT_SCHEMA_PATH, "utf8");
+ const schema = JSON.parse(raw);
+ const md = generateMarkdown(schema);
+ ensureDirSync(OUTPUT_DOC_PATH);
+ fs.writeFileSync(OUTPUT_DOC_PATH, md, "utf8");
+ console.log(`Wrote schema reference to ${OUTPUT_DOC_PATH}`);
+ } catch (error) {
+ console.error(`Error generating schema documentation: ${error.message}`);
+ process.exit(1);
+ }
}📝 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.
| function main() { | |
| if (!fs.existsSync(INPUT_SCHEMA_PATH)) { | |
| console.error(`Schema not found at ${INPUT_SCHEMA_PATH}`); | |
| process.exit(1); | |
| } | |
| const raw = fs.readFileSync(INPUT_SCHEMA_PATH, "utf8"); | |
| const schema = JSON.parse(raw); | |
| const md = generateMarkdown(schema); | |
| ensureDirSync(OUTPUT_DOC_PATH); | |
| fs.writeFileSync(OUTPUT_DOC_PATH, md, "utf8"); | |
| console.log(`Wrote schema reference to ${OUTPUT_DOC_PATH}`); | |
| } | |
| main(); | |
| function main() { | |
| if (!fs.existsSync(INPUT_SCHEMA_PATH)) { | |
| console.error(`Schema not found at ${INPUT_SCHEMA_PATH}`); | |
| process.exit(1); | |
| } | |
| try { | |
| const raw = fs.readFileSync(INPUT_SCHEMA_PATH, "utf8"); | |
| const schema = JSON.parse(raw); | |
| const md = generateMarkdown(schema); | |
| ensureDirSync(OUTPUT_DOC_PATH); | |
| fs.writeFileSync(OUTPUT_DOC_PATH, md, "utf8"); | |
| console.log(`Wrote schema reference to ${OUTPUT_DOC_PATH}`); | |
| } catch (error) { | |
| console.error(`Error generating schema documentation: ${error.message}`); | |
| process.exit(1); | |
| } | |
| } | |
| main(); |
🤖 Prompt for AI Agents
In scripts/generate-config-schema-doc.js around lines 351 to 364, the code
reads, parses, and writes files without error handling; wrap the file read,
JSON.parse, ensureDirSync and fs.writeFileSync calls in a try/catch block, catch
and log descriptive errors (including the caught error.message or error object)
to console.error, and call process.exit(1) on failure so the script exits
cleanly; keep the existing exists check but still guard against race conditions
by handling read/parse/write exceptions and ensure the success log only runs
when all operations complete without throwing.
moose-code
left a comment
There was a problem hiding this comment.
Nice! new config page looks good!
I've removed this, it's not linkable and it doesn't work with the llm docs, I've moved a document to the advanced section and added examples.
I suggest checking the preview to review
Summary by CodeRabbit
Documentation
Chores