-
Notifications
You must be signed in to change notification settings - Fork 0
Enhance validation API and support Node.js 18 #1
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
Changes from all commits
dc1967b
2349cc9
995b3c8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,58 @@ | ||||||||||
| # Post-Roadmap Notes | ||||||||||
|
|
||||||||||
| This file is intentionally retired from active planning. | ||||||||||
|
|
||||||||||
| Use [ROADMAP.md](/Users/joshmclain/code/ts-env-validator/ROADMAP.md) as the only roadmap and release-planning source of truth. | ||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The link to
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replace absolute local path with relative path. The path Proposed fix-Use [ROADMAP.md](/Users/joshmclain/code/ts-env-validator/ROADMAP.md) as the only roadmap and release-planning source of truth.
+Use [ROADMAP.md](./ROADMAP.md) as the only roadmap and release-planning source of truth.📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
|
|
||||||||||
| ### Testing Utilities | ||||||||||
|
|
||||||||||
| Future helpers: | ||||||||||
|
|
||||||||||
| - mock env generator | ||||||||||
| - test schema validation | ||||||||||
| - snapshot env configs | ||||||||||
|
|
||||||||||
| ## Ecosystem Plan | ||||||||||
|
|
||||||||||
| Split into modular packages: | ||||||||||
|
|
||||||||||
| - `ts-env-validator` (core) | ||||||||||
| - `@ts-env-validator/cli` | ||||||||||
| - `@ts-env-validator/next` | ||||||||||
| - `@ts-env-validator/vite` | ||||||||||
| - `@ts-env-validator/github-action` | ||||||||||
| - `@ts-env-validator/docs` | ||||||||||
|
|
||||||||||
| ## High Impact Features (Priority) | ||||||||||
|
|
||||||||||
| If limited time, prioritize: | ||||||||||
|
|
||||||||||
| - `.env.example` generation | ||||||||||
| - CLI (`check`, `generate-example`) | ||||||||||
| - Next.js adapter | ||||||||||
| - secret-aware validation | ||||||||||
| - documentation generation | ||||||||||
|
|
||||||||||
| ## Success Metrics | ||||||||||
|
|
||||||||||
| - npm downloads growth | ||||||||||
| - GitHub stars | ||||||||||
| - usage in real projects | ||||||||||
| - adoption in CI pipelines | ||||||||||
| - developer feedback | ||||||||||
|
|
||||||||||
| ## Long-Term Vision | ||||||||||
|
|
||||||||||
| Position the library as: | ||||||||||
|
|
||||||||||
| > The standard way to define and validate configuration in TypeScript applications | ||||||||||
|
|
||||||||||
| ## Guiding Principle | ||||||||||
|
|
||||||||||
| Do not just add validators. | ||||||||||
|
|
||||||||||
| Build: | ||||||||||
|
|
||||||||||
| - a system | ||||||||||
| - a workflow | ||||||||||
| - a developer habit | ||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,121 +1,96 @@ | ||
| # ts-env-validator — Roadmap | ||
|
|
||
| ## 🎯 Vision | ||
| `ROADMAP.md` is the single source of truth for planned releases. | ||
|
|
||
| A lightweight, TypeScript-first environment variable validator that: | ||
| - Validates at runtime | ||
| - Infers types at compile time | ||
| - Provides excellent developer experience | ||
| - Works across Node, Next.js, and serverless environments | ||
| ## Vision | ||
|
|
||
| --- | ||
| Build a lightweight, TypeScript-first environment validator that: | ||
|
|
||
| ## 🚀 Milestones | ||
| - validates at runtime | ||
| - infers types at compile time | ||
| - stays small and framework-agnostic | ||
| - gives helpful startup failures instead of late runtime surprises | ||
|
|
||
| ### v0.1.0 — MVP (Initial Release) | ||
| ## Shipped | ||
|
|
||
| #### Core Features | ||
| ### v0.1.0 — Core MVP | ||
|
|
||
| - `createEnv(schema, options?)` | ||
| - Validators: | ||
| - `string()` | ||
| - `number()` | ||
| - `boolean()` | ||
| - `enumOf([...])` | ||
| - `url()` | ||
|
|
||
| #### Modifiers | ||
|
|
||
| - `.optional()` | ||
| - `.default(value)` | ||
| - `.describe(text)` | ||
|
|
||
| #### Behavior | ||
|
|
||
| - Reads from `process.env` | ||
| - Supports custom env object | ||
| - Coerces types (string → number/boolean/etc.) | ||
| - Collects ALL errors before throwing | ||
| - Strong TypeScript inference | ||
|
|
||
| #### DX Features | ||
|
|
||
| - Clean error formatting | ||
| - Helpful error messages | ||
| - Zero config usage | ||
|
|
||
| --- | ||
| - validators: `string()`, `number()`, `boolean()`, `enumOf([...])`, `url()` | ||
| - modifiers: `.optional()`, `.default(value)`, `.describe(text)` | ||
| - aggregated error reporting | ||
| - custom env source support | ||
|
|
||
| ### v0.2.0 — Extended Types | ||
|
|
||
| Completed: | ||
|
|
||
| - `integer()` | ||
| - `float()` | ||
| - `json()` | ||
| - `json<T>()` | ||
| - `array(separator?)` | ||
|
|
||
| --- | ||
| ## Next | ||
|
|
||
| ### v0.3.0 — Extensibility (Next) | ||
| ### v0.3.0 — Extensibility Foundation | ||
|
|
||
| - Custom validator API | ||
| - `.transform(fn)` | ||
| - `.refine(fn)` | ||
| Goal: let users create first-class custom validators without expanding the validation model yet. | ||
|
|
||
| --- | ||
| - public `createValidator({ expected, parse })` API | ||
| - public validator and parser result types | ||
| - custom validators work with `createEnv` | ||
| - custom validators support `.optional()`, `.default()`, and `.describe()` | ||
| - thrown parser errors are normalized into validation failures | ||
|
|
||
| ### v0.4.0 — Ecosystem Enhancements | ||
| Explicitly deferred: | ||
|
|
||
| - dotenv helper | ||
| - `.env.example` validator CLI | ||
| - Next.js helpers (server/client env separation) | ||
| - `.transform(fn)` | ||
| - `.refine(fn)` | ||
| - constraint-style modifiers like `.min()` and `.max()` | ||
|
|
||
| --- | ||
| ## Provisional | ||
|
|
||
| ### v1.0.0 — Stable Release | ||
| ### v0.4.0 — Validation Constraints | ||
|
|
||
| - Finalized API | ||
| - Performance optimizations | ||
| - Full documentation | ||
| - Community feedback incorporated | ||
| Potential focus: | ||
|
|
||
| --- | ||
| - string and number constraints | ||
| - `.transform(fn)` | ||
| - `.refine(fn, message?)` | ||
| - more composable validator pipelines | ||
|
|
||
| ### v0.5.0 — Tooling | ||
|
|
||
| ## 🧠 Design Principles | ||
| Potential focus: | ||
|
|
||
| - Minimal API surface | ||
| - Strong typing by default | ||
| - Fail fast at runtime | ||
| - Clear, readable errors | ||
| - Framework agnostic | ||
| - No unnecessary dependencies | ||
| - dotenv helper | ||
| - `.env.example` generation or validation | ||
| - schema-driven docs or CLI support | ||
|
|
||
| --- | ||
| ### v0.6.0 — Framework DX | ||
|
|
||
| ## ❌ Explicit Non-Goals (v1) | ||
| Potential focus: | ||
|
|
||
| - Nested schemas | ||
| - Async validation | ||
| - Framework-specific wrappers | ||
| - Over-engineered abstractions | ||
| - Next.js helpers for server and client separation | ||
| - prefix enforcement for client-safe env keys | ||
| - framework-specific docs, not core package coupling | ||
|
|
||
| --- | ||
| ### v1.0.0 — Stable Release | ||
|
|
||
| ## 📦 Release Strategy | ||
| - stable public API | ||
| - polished docs | ||
| - performance review | ||
| - community feedback incorporated | ||
|
|
||
| | Version | Focus | | ||
| |--------|------| | ||
| | 0.1.0 | Core functionality | | ||
| | 0.2.0 | More types | | ||
| | 0.3.0 | Extensibility | | ||
| | 1.0.0 | Stability | | ||
| ## Design Principles | ||
|
|
||
| --- | ||
| - minimal API surface | ||
| - strong typing by default | ||
| - readable errors | ||
| - sync, startup-time validation | ||
| - composable internals without overengineering | ||
|
|
||
| ## 📈 Success Metrics | ||
| ## Non-Goals | ||
|
|
||
| - Easy adoption in new projects | ||
| - Clean TypeScript inference | ||
| - Positive developer feedback | ||
| - GitHub stars / npm downloads | ||
| - nested schemas | ||
| - async validation | ||
| - framework-specific wrappers in the core package | ||
| - broad transform pipelines before the base validator contract is stable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Use a repository-relative link instead of a local filesystem path to ROADMAP.md.
This absolute path will only work on your machine and will be broken for other contributors and on GitHub. Please switch to a repo-relative link like
[ROADMAP.md](./ROADMAP.md)so it resolves correctly for everyone.