-
-
Notifications
You must be signed in to change notification settings - Fork 113
feat: allow customizing schema combination #313
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
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
a88f593
Enable further refinement and transformation of the env by exposing a…
EskiMojo14 b96a966
delete bun.lockb (we have bun.lock now)
EskiMojo14 568ecbc
update next and nuxt packages
EskiMojo14 5c5881e
Add changeset
EskiMojo14 c1cc652
update docs
EskiMojo14 1c236cc
improve example of transforming, and demo issue with optional keys
EskiMojo14 08d2223
fix issue by making potentially undefined keys optional by default
EskiMojo14 6705f40
pass isServer to createFinalSchema
EskiMojo14 6127da7
add note re: DefaultCombinedSchema
EskiMojo14 e8c634b
Use optional chaining instead of ternary
EskiMojo14 e92c15b
make promise check a bit DRYer
EskiMojo14 4d7def6
simplify type util
EskiMojo14 df61ee8
use StandardSchemaDictionary instead of Record type
EskiMojo14 26532c3
make StandardSchemaDictionary generic instead of having attached Matc…
EskiMojo14 b828ba9
Merge branch 'main' into object-schema
juliusmarminge e3681d1
kewl
juliusmarminge 451ae67
kewl
juliusmarminge File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| --- | ||
| "@t3-oss/env-nextjs": minor | ||
| "@t3-oss/env-core": minor | ||
| "@t3-oss/env-nuxt": minor | ||
| --- | ||
|
|
||
| feat!: added ability to customise schema combination | ||
|
|
||
| Combination of schemas can now be customised using the `createFinalSchema` option. This allows further refinement or transformation of the environment variables. | ||
|
|
||
| For 99% of users, this is a non-breaking change. If you were relying on internal types, there's a type-only breaking change: | ||
|
|
||
| - `CreateEnv` now has the signature `CreateEnv<TFinalSchema, TExtends>`, instead of the previous `CreateEnv<TServer, TClient, TShared, TExtends>`. | ||
| - Previous behaviour can be achieved by using `DefaultCombinedSchema<TServer, TClient, TShared>` as the type for `TFinalSchema`. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
is this a user-breaking change?
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.
CreateEnv is exported, so technically yes - in practicality I doubt anyone was relying on it
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.
It's exported cause the other packages needs it. I should add some @internal jsdoc annotations to things