fix: resolve multiple registry issues#2
Merged
Conversation
- Fix index.js: read chain.json instead of metadata.json (critical bug) - Fix _TEMPLATE categories to use uppercase (DEFI, GAMING) matching CI rules - Fix validate script to be self-contained (was pointing to sibling repo) - Add validate-all.js for standalone local validation - Upgrade publish.yml actions to v4 for consistency - Add enrichment output files to .gitignore - Deduplicate validation logic in validate-pr.yml CI workflow - Add TypeScript type definitions (types.d.ts) - Add JSON Schema for chain.json (chain.schema.json) - Fix enrichment script idempotency for logoUri Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
muhammetselimfe
added a commit
that referenced
this pull request
Mar 29, 2026
- Fix stale metadata.json reference in error message (index.js) - Save url-warnings.json before exit(1) so report step always has data - Update CONTRIBUTING.md category examples to uppercase matching validators - Remove dead code expression in validate-all.js Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes multiple issues found during a code review of the registry:
Critical
index.jswas readingmetadata.jsonbut all chain data useschain.json—loadChain()andgetAllChains()were always returningnull/[]Bug Fixes
npm run validate: was pointing to../L1Beat-backend/...(broken cross-repo ref); now uses a self-containedscripts/validate-all.js_TEMPLATE/chain.jsonused mixed-case (DeFi,Gaming) but CI enforces uppercase → changed toDEFI,GAMINGenrich-registry.jswould overwrite manually-set emptylogoUrion re-runs; now distinguishesundefined(never checked) from''(checked, nothing found)publish.ymlactions from v3 → v4 to matchvalidate-pr.yml.gitignore:enrichment-report.json,enrichment-errors.log,validation-report.mdImprovements
validate-pr.ymlwas re-running all URL/RPC checks (~100 lines of duplicated code). Now earlier steps save warnings to JSON files, and the report step reads those.types.d.ts) for NPM package consumerschain.schema.json) as a formal data contract referenceType of Change
Chain Information
N/A — this PR modifies tooling/infrastructure, not chain data.
Checklist
Human Review Checklist
index.jschange: Verifychain.jsonis the correct filename across alldata/*/folders (it is —metadata.jsondoesn't exist anywhere)chain.schema.json: UsesadditionalProperties: false— if new fields are ever added tochain.jsonwithout updating the schema, schema-based validation would reject them. The schema is currently a reference only (not enforced in CI), but worth knowing.validate-all.jsline 209:${'='.join ? '=' : '━'.repeat(40)}is a quirky expression ('='.joinis always undefined in JS, so it always falls through to'━'.repeat(40)). Works, but reads oddly.enrich-registry.jsidempotency: The condition!chain.nativeToken.logoUri && chain.nativeToken.logoUri !== ''relies on JS falsy semantics —undefined/nullpass through,''does not. Confirm this matches intended behavior.url-warnings.json, etc.) degrades gracefully if a step is skipped (load_warningscatchesFileNotFoundError), but this can only be fully validated by running the actual workflow.Additional Notes
validate-all.jsscript treats emptynativeTokenfields and nullevmChainIdas warnings (not errors), matching CI behavior for existing chain data. ~100 chains have these pre-existing data gaps.Link to Devin session: https://app.devin.ai/sessions/06e9152c9b9f48c29c93dfa6ceb9c5f9
Requested by: @muhammetselimfe