0xTanzim / 0xTanzim/nextRush

feat(create-nextrush): scaffold environment configuration

Aperta
#51 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
TypeScript
Stelle
4
Fork
0
Merge medio
6m
PR unite (30g)
1

Descrizione

## Summary

Add first-class environment scaffolding to `create-nextrush` so generated projects start with a centralized and practical env setup.

## Why this matters

The current scaffolder already generates the application structure, but environment handling is still something developers have to assemble manually. A strong default env setup reduces setup mistakes and keeps configuration consistent across generated projects.

## Scope

Generate and wire up the following in scaffolded projects:

- `.env`
- `.env.example`
- `src/env.d.ts`
- `src/config/env.ts` (or equivalent centralized config module)

The generated app should read configuration from one place rather than accessing `process.env` across the codebase.

## Proposed defaults

### `.env`

```env
PORT=3000
HOST=0.0.0.0
NODE_ENV=development
```

### `.env.example`

```env
PORT=
HOST=
NODE_ENV=
```

### `src/config/env.ts`

Centralize env access and provide typed defaults where appropriate.

## Acceptance criteria

- A newly scaffolded project includes `.env` and `.env.example`
- The scaffold includes a typed env declaration file
- Application code uses a centralized env module instead of scattered `process.env` reads
- The generated project still works without extra manual setup

## Non-goals

- Do not add a framework config file just for env handling
- Do not introduce a heavy validation system unless it is clearly needed
- Do not make the default scaffold more complex than necessary

## Notes

This issue should stay focused on environment handling only. Tooling, Docker, CI, and editor configuration should be tracked in separate issues.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.