Releases: MrDave1999/dotenv.core
Releases · MrDave1999/dotenv.core
v2.1.0-alpha1
v2.0.1
v2.0.0
New features
- Added another type of error handling with the
EnvValidationResult
class. (#13, #18)- To use this feature you must use the
Load(out EnvValidationResult)
method of theEnvLoader
class.
- To use this feature you must use the
- Added support for .env file loads based on environment (development, test, staging, or production). (#14, #19)
- To use this feature you must use the
LoadEnv
method of theEnvLoader
class.
- To use this feature you must use the
- The parser and loader now throws an exception with all errors encountered instead of one at a time. (#16, #17, #18)
- Added the
SetEnvironmentName
method to theEnvLoader
class. (#22, #23) - Added support for loading .env files without modifying the environment. (#20, #21)
- To use this feature you must use the
AvoidModifyEnvironment
method of theEnvLoader
class.
- To use this feature you must use the
- Added a new
Env
helper class to perform checks with the current environment. (#24, #25) - Added the
HasValue
method to theEnvReader
class. (#26, #50) - Added checks to some methods in case the parameter is null. (#36, #37)
- Added the
SetEncoding(string)
andAddEnvFile(string, string)
method to theEnvLoader
class. (#38, #39) - Added the
EnvValidator
class that validates whether the keys required by the application exist in the current environment. (#42, #43) - Added a configuration method to indicate that a .env file is optional. (#44, #46)
- Added a configuration method to indicate that all .env files should be optional. (#45, #47)
- To use this feature you must use the
AllowAllEnvFilesOptional
method of theEnvLoader
class.
- To use this feature you must use the
- Added a configuration method to tell the loader to ignore parent directories. (#52, #54)
- Added a configuration method to set the environment variables provider. (#51, #53)
- Added a new format in the error messages. (#60, #63)
- Added support for embedding variables in the keys. (#62, #64)
Fixed bugs
- Fixed the problem with the
LoadEnv
method not maintaining .env files priority. (#31, #32) - Fixed the problem with the loader does not search for the .env file in parent directories when the path is absolute. (#55, #56)
- Fixed the problem that
DOTNET_ENV
is not set when the environment name is defined from the source code. (#61, #65)
API changes
Important changes in the current API:
- Changed the return value type of the
EnvParser.Parse
andEnvLoader.Load
methods toIEnvironmentVariablesProvider
. - Added a parameterized constructor to the
EnvReader
class so that it depends on theIEnvironmentVariablesProvider
interface. (#48, #49) - The
EnvVariableNotFoundException
class was replaced byVariableNotSetException
. - The name of the method
IgnoreParserExceptions
has been changed toIgnoreParserException
. - Removed
None
option fromConcatKeysOptions
enum. - Removed parameters:
actualValue
,currentLine
from the parameterized constructor of theParserException
class. - It is no longer possible to override the helper methods of the
EnvParser
class. (#40)
This new version follows the encapsulation principle: "The fewer implementation details the client knows, the fewer changes they will have to make".- The fields and methods that were protected were changed to private in the
EnvParser
class. - The parameterized constructor of the
EnvLoader
class was removed.
- The fields and methods that were protected were changed to private in the
Other changes
v1.1.3
v1.1.2
- Added support for interpolating variables (issue #3).
- Added an option to concatenate duplicate keys (issue #4).
- Added an option to ignore parser exceptions (issue #5).
- Added an option to change the character that represents a comment (issue #6).
- Added an option to change the delimiter of a key-value pair (issue #7).
- Added an option to disable the trim at the start and end of the value (issue #8).
- Added an option to disable the trim at the start and end of the key (issue #9).
v1.0.2
v1.0.1
- Added documentation file to the package.
v1.0.0
Changed branch from main to master