Skip to content
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

feat: generic types support #64

Merged
merged 2 commits into from
Mar 15, 2023
Merged

feat: generic types support #64

merged 2 commits into from
Mar 15, 2023

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Mar 14, 2023

  • Refactor: Enabled strict type checks and CI tests

Support <T, MT> generics for all exported types. User config defined with InputConfig<MyConfig, MyMeta> can leverage built-in type hints for meta and environments.

New createDefineConfig and DefineConfig are also exposed for making it easier for frameworks exposing their defineXConfig type utils:

const defineMyConfig = createDefineConfig<MyConfig, MyMeta>();

@pi0 pi0 requested a review from danielroe March 14, 2023 16:16
@codecov
Copy link

codecov bot commented Mar 14, 2023

Codecov Report

Merging #64 (40a921e) into main (9df0498) will increase coverage by 0.88%.
The diff coverage is 96.44%.

@@            Coverage Diff             @@
##             main      #64      +/-   ##
==========================================
+ Coverage   87.35%   88.23%   +0.88%     
==========================================
  Files           3        4       +1     
  Lines         506      561      +55     
  Branches       64       64              
==========================================
+ Hits          442      495      +53     
- Misses         64       66       +2     
Impacted Files Coverage Δ
src/dotenv.ts 77.55% <50.00%> (ø)
src/loader.ts 89.76% <98.14%> (-1.55%) ⬇️
src/types.ts 98.14% <98.14%> (ø)
src/index.ts 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@pi0 pi0 changed the title feat: generate types support feat: generic types support Mar 14, 2023
@pi0 pi0 merged commit 9aeba88 into main Mar 15, 2023
@danielroe danielroe deleted the feat/generic-types branch April 17, 2023 12:13
@rijkvanzanten rijkvanzanten mentioned this pull request May 16, 2023
1 task
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.

2 participants