Skip to content

Create envDefaults.ts - #43

Open
mspandey wants to merge 2 commits into
ZarrarPeshimam:mainfrom
mspandey:patch-1
Open

Create envDefaults.ts#43
mspandey wants to merge 2 commits into
ZarrarPeshimam:mainfrom
mspandey:patch-1

Conversation

@mspandey

Copy link
Copy Markdown

Pull Request

Description

This PR enhances the environment bootstrap workflow in RepoStart by automatically replacing common placeholder or empty environment variable values with sensible local development defaults when generating a .env file from .env.example.

Summary of Changes:

  • Defaults Utility (src/utils/envDefaults.ts): Added a parsing engine that recognizes common database and service variables (MONGO_URI, DATABASE_URL, REDIS_URL) and detects empty or well-defined placeholders (YOUR_MONGODB_URI, <your_database_url>, your_redis_url, etc.).
  • Runner Integration (src/runners/EnvBootstrap.ts): Updated the bootstrap flow to process .env contents right after generation without overriding valid user-provided configuration or unrelated secrets (JWT_SECRET).
  • Testing: Added comprehensive tests covering empty inputs, explicit placeholders, and existing user credentials.

Related Issue

Closes #32


Type of Change

  • Bug Fix
  • New Feature
  • Documentation
  • UI/UX Improvement
  • Refactoring

Testing & Verification

  • Testing Coverage: Verified with sample .env.example configurations containing empty fields, placeholder tokens, and valid connection strings.
  • Verification Check: Confirmed that connection variables are correctly populated with local URIs, format is preserved, and unrelated environment secrets remain completely untouched.

Copilot AI lite review requested due to automatic review settings August 19, 2026 17:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Add bootstrapEnv function to read and write .env files with defaults
@mspandey

Copy link
Copy Markdown
Author

sorry I by mistake raised 2 same pr for one issue pls look into this pr

@ZarrarPeshimam

ZarrarPeshimam commented Aug 27, 2026

Copy link
Copy Markdown
Owner

@mspandey,
I reviewed ur PR,
while testing I faced this issue in compiling
image
Plz fix this and push updated changes

also if possible provide ss/video of running the implementation of this feature, it makes reviewing easier

@ZarrarPeshimam

ZarrarPeshimam commented Aug 28, 2026

Copy link
Copy Markdown
Owner

@mspandey, plz replay within 24 hrs with any update on progress or atleast respond so I know u got the feedback.

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.

[Feature]: Generate Local Development Defaults for Placeholder Env Variables

3 participants