Skip to content

feat(ensrainbow): refine handling of env vars #367

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Byczong
Copy link

@Byczong Byczong commented Mar 12, 2025

#118

Refactor env vars, CLI args and configuration handling

This PR introduces a more standardized and modular approach to handling environment variables, command-line arguments, and configuration in ENSRainbow.

Changes

  • Removed old lib/env.ts file
  • Added new utility modules:
    • apps/ensrainbow/src/utils/config.ts - Central configuration constants
    • apps/ensrainbow/src/utils/parsing-utils.ts - Pure parsing functions
    • apps/ensrainbow/src/utils/env-utils.ts - Environment variable handling
    • apps/ensrainbow/src/utils/command-utils.ts - CLI argument handling
  • Modified files:
    • apps/ensrainbow/src/utils/logger.ts - Updated to use new config.ts, moved some code to the new utils files
    • apps/ensrainbow/src/cli.ts - Refactored to use the new argument resolution utilities
  • Added tests for the new modules

@Byczong Byczong requested a review from a team as a code owner March 12, 2025 13:44
Copy link

vercel bot commented Mar 12, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
admin.ensnode.io ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 17, 2025 0:01am
ensadmin-next ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 17, 2025 0:01am
ensnode.io ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 17, 2025 0:01am
ensrainbow.io ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 17, 2025 0:01am

logger.info(`Removing database directory at ${dataDir}...`);
await rm(dataDir, { recursive: true, force: true });
logger.info("Database directory removed successfully.");
if (dirExists) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one 👍

Copy link

changeset-bot bot commented May 17, 2025

⚠️ No Changeset found

Latest commit: a19cfb9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented May 17, 2025

@Byczong is attempting to deploy a commit to the NameHash Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ensrainbow ENSRainbow related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ENSRainbow: Refine handling of invalid ENV vars
2 participants