This repository was archived by the owner on Mar 11, 2026. It is now read-only.
Refactor: Modernize Configuration Management and Script Generation#63
Merged
Conversation
b7dfe5a to
7bb9bac
Compare
- Convert generate-chain-yamls.js and generate-compose.js to TypeScript - Add ES module support with "type": "module" in package.json - Replace CommonJS require/exports with ES module imports - Use tsx runner for TypeScript script execution - Consolidate handler templates into unified data-driven partial
- Move tsx to devDependencies where it belongs - Add Zod for runtime configuration validation - Create centralized config module with type-safe schemas - Refactor scripts to use new config module instead of direct file/env access - Validate chain configurations at load time to catch errors early
- Convert handler configuration from single `topic` property to `topics` array to allow handlers to listen for multiple event topics. - Update templates to iterate over topics array.
7bb9bac to
d8ba10f
Compare
Wizdave97
approved these changes
Jun 12, 2025
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR completes a comprehensive refactoring of the indexer package's configuration management and build scripts, introducing type safety, schema validation, and template-based generation using Handlebars.
Changes
1. Handlebars Template Integration for Docker Compose
generate-compose.tsto use Handlebars templates instead of string concatenationgenerate-chain-yamls.tsimplementation2. Centralized Configuration System
src/configs/index.tsas the single source of truth for configuration managementgetEnv(),getConfigs(), andgetValidChains()3. TypeScript Migration
.js→.ts)__dirnameresolution usingimport.meta.url4. Enhanced Type Safety
ConfigObjectandConfigurationtypes derived from Zod schemasEnvironmenttype for better environment handlingDependencies Added
zod@^3.25.32- Runtime schema validationhandlebars@^4.7.8- Template engine