chore(deps): update dependency @nestjs/config to v12 - #142
Open
renovate[bot] wants to merge 1 commit into
Open
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR contains the following updates:
2.3.1→12.0.0Release Notes
nestjs/config (@nestjs/config)
v12.0.0Compare Source
What's Changed
@nestjs/configis now a native ES module, environment validation is built on Standard Schema instead of Joi-specific code, and the major version is aligned with the Nest 12 release line (there is no5.x—4.0.4goes straight to12.0.0).ESM migration
The package is published as pure ESM (
"type": "module", compiled withNodeNext) behind a properexportsmap. The legacy rootindex.js/index.d.tsshims are gone, and deep imports into build internals are no longer resolvable — import from the package root.require(esm)— CommonJS still worksYou do not need to convert your app to ESM. Thanks to Node's
require(esm)support (Node 20.19+ / 22.12+), a CommonJS app can keep usingrequire('@nestjs/config')unchanged.Validation is now Standard Schema based
validationSchemaaccepts any schema implementing the Standard Schema spec — Zod (v3, v4, v4-mini), Valibot, ArkType, Joi 18+, and anything else that adopts it. There is no longer any Joi-specific code path in the module, and Joi is no longer implied as the validation library.Joi keeps working — it implements Standard Schema as of v18 — and the historical
abortEarly: false/allowUnknown: truedefaults are still applied automatically for Joi schemas, so existing Joi setups behave as before.Breaking:
validationOptionsshapeOptions are now the Standard Schema
Optionsobject, and library-specific settings move underlibraryOptions:The generic parameter changed accordingly:
ConfigModuleOptions<ValidationOptions extends StandardSchemaV1.Options>, andvalidationSchemais typed asStandardSchemaV1rather thanany— a schema that does not implement the spec is now a compile-time error instead of a runtime one.Breaking: validation error format
Issues are formatted by this package rather than by the schema library. Each issue is rendered as
path: messageand issues are newline-separated:Anything asserting on the old single-line Joi message string needs updating.
Object schemas no longer strip your environment
Schemas like Zod's
z.object()drop undeclared keys. Those variables are now merged back into the validated result, so unrelated variables stay reachable through bothprocess.envandConfigServiceinstead of disappearing after validation.Breaking: peer dependencies
@nestjs/commonis now^11.0.0 || ^12.0.0. Nest 10 is no longer supported — stay on@nestjs/config@4if you are still on Nest 10.Breaking:
lodashreplaced withes-toolkitThe
lodashruntime dependency is gone, replaced byes-toolkit. This is transparent unless you relied on the transitivelodashinstall.Breaking: stricter
ConfigService.get()inferenceThe explicit-type parameter on
get()/getOrThrow()is now constrained to the value at the given path (R extends PathValue<T, P>), fixing the long-standing bug where an unrelated type could be asserted for a key. Call sites that passed a type inconsistent with the config shape will now fail to compile — that mismatch was always a latent bug.New:
overrideValues from
.envfiles can now take precedence over pre-existingprocess.envvariables:Default remains
false— the existing "process.env wins" behavior.New: custom
parser.envfiles no longer have to be dotenv-formatted. Supply any function that turns aBufferinto an object — YAML, TOML, JSON, whatever:The parser is used both at bootstrap and for variable re-interpolation inside
ConfigService.Other changes
dotenv17.4.2,dotenv-expand13.ConditionalModuletimeout error message ("Bause" → "Because").v4.0.4Compare Source
6bc5737)f31ee98)v4.0.3Compare Source
What's Changed
Full Changelog: nestjs/config@4.0.2...4.0.3
v4.0.2Compare Source
f53f14e)v4.0.1Compare Source
79d82d6)99d8bca)v4.0.0Compare Source
Breaking changes
The order in which configuration variables are read by the
ConfigService#getmethod has been updated. The new order is:process.envobjectPreviously, validated environment variables and the
process.envobject were read first, preventing them from being overridden by internal configuration. With this update, internal configuration will now always take precedence over environment variables.Additionally, the
ignoreEnvVarsconfiguration option, which previously allowed disabling validation of theprocess.envobject, has been deprecated. Instead, use thevalidatePredefinedoption (set tofalseto disable validation of predefined environment variables). Predefined environment variables refer toprocess.envvariables that were set before the module was imported. For example, if you start your application withPORT=3000 node main.js, thePORTvariable is considered predefined. However, variables loaded by theConfigModulefrom a.envfile are not classified as predefined.A new
skipProcessEnvoption has also been introduced. This option allows you to prevent theConfigService#getmethod from accessing theprocess.envobject entirely, which can be helpful when you want to restrict the service from reading environment variables directly.Changelog
c2eaf04)1c20713)c53c63c)v3.3.0Compare Source
fdff9c1)7ab5a27)16ff146)77515e1)ebdb8c2)93ed4c3)29fabda)ec09f9d)6aad852)0375223)ba884de)1f12524)2329c84)c44bc35)ca6bff9)3bb4ad6)8570424)b9e1757)dd71c7e)5faf74a)d692263)2c14992)031e5ab)bc01b6c)b2bb9b2)b404072)89da7a5)5ac872b)1a537fd)ec36f5e)2f415ee)d455b3c)a3819dd)490b4b6)6d54ba9)ae48d1d)765d5f3)da6c822)5d4ab1f)42a84e0)ca7109b)57ecde3)dd53564)4b00669)7e0b960)a430907)40cfde7)806e4d5)cfa1156)0143522)a28244e)37204eb)79df90b)9a235ba)a7e6959)281cbf1)27cf52a)cfa9e58)0dee144)fd86a02)8fe704e)0688603)21eea18)0562f33)4118be2)ca65ecb)d9b8984)6aec346)2047b52)af010d2)0407334)31e937e)433c883)869fa9e)2252723)7eb3f55)abfc2de)e5cbe62)ddf88bf)700a88a)cc5db53)2ad59d5)a4f842c)5e7e143)215a503)6321a64)86a869a)7cf9306)ab9b5a1)457c232)784adb1)3cdc05c)6f0441f)b63402f)7e8e76d)8d9e2d1)ff13342)dc49a27)685565c)v3.2.3Compare Source
faa8f59)0045924)f039417)00febb5)b2ef5a8)81534ba)ea180e4)3b03bd9)112b556)295709b)17058a4)cf1fbc6)0f0176a)56497be)e31959c)ec9b67d)2b7858c)2bffa1a)628dd4a)38c5f04)3f1efcf)ac86947)41c68f5)8948ce8)bb338b8)bfa8fc4)84814cd)20dce4e)e0aa801)e400d73)b53e8e6)7542203)971bb0d)a5be017)63c18ce)bfb3346)91fa417)fab616f)0d1c2d0)e054a60)f08464a)bee9517)eeb5c99)18777c2)56e9c84)6720586)be876a5)6e765c2)7cb161d)b930445)f3d2e2e)5a1786d)cdd9ee0)4c6a836)e1890c1)b5fb022)d4d025f)41a76db)30a617b)a96b8e9)872f486)7f5d4fa)5062937)1ac2686)01e3879)db7683d)52ebd93)0db2573)8a9c9e7)542604b)v3.2.2Compare Source
bad1f9e)8b37dfb)ae7ec29)7f51f18)e61c459)8959809)ec6970f)674b9c1)ee9dabd)0827671)9f0c077)3122953)2624c41)6eace30)v3.2.1Compare Source
c3b6d5f)93e5f70)15dcdfa)cf8e3c5)e416a64)246bb77)7b37307)f95c1f9)6b68c92)6498d2b)7a7dc4d)d32180a)4dc9115)583bf5b)47f6d65)bcb5a07)855d313)bbac53a)0edfd8a)f7374a2)379d479)6c46193)c2c6fb4)9ade429)190fee7)9c0d299)a8edfdd)163cdf2)a30d96c)2d11e83)26b8d34)62dba33)ba89a55)97a6ef0)5f011e9)0087287)ef9090f)04205fd)504e24a)4d53abc)afc9d9c)21ece8e)f8b0143)45932f9)f7b682e)4663777)b6357a4)eb1c6be)9930dce)959a1a4)v3.2.0Compare Source
1af2431)78cd4f2)88b1d88)a4c9c02)62fe61f)8280932)924a6c3)1d28ef2)c1369f0)95daf99)f2cc17b)b1a528d)3aef7e3)30ad829)163a18e)80a18a3)4facfc9)c29501c)f3da5d0)76b60df)655a0a1)9b2914c)a6c24be)ee3fa0f)89f2751)e5a0acd)9318a5c)1bfe9c2)b0fd110)f64502c)c16a5db)dad6fe7)b59fbda)474b62a)d73b260)82cad8c)9c9c2de)c8d29ab)83c66ae)dce5376)5d93560)3eb9583)cfccd78)1e5aab1)5cdd128)16509c1)a8fa198)a6062b0)26e5bc2)ab40813)d37bd70)c83702f)f963bfc)6eafc46)4cb8b47)761ef89)0838552)ff20385)162749e)ae578c3)54093f1)13acabf)0a4608f)0343304)fdabba1)7b8f4e2)3146201)ea61df5)25efebb)7e3b87a)4db7511)3c7c289)ceedeb1)050731b)02af7c3)a8902a4)65ce899)cb506f2)df888a5)c80abde)1ce8874)d5eee9e)6cc0f21)25fdaa3)569e80d](https://redirect.github.com/nestjs/config/commiConfiguration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.