Skip to content

Releases: MrDave1999/dotenv.core

v2.0.1

30 Apr 20:43
Compare
Choose a tag to compare
  • Fixed problem with .env file not loading in ASP.NET / .NET Framework 4.7.2. (#67, #68)

v2.0.0

29 Mar 17:07
Compare
Choose a tag to compare

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 the EnvLoader class.
  • 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 the EnvLoader class.
  • 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 the EnvLoader 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 the EnvLoader class.
  • Added a new Env helper class to perform checks with the current environment. (#24, #25)
  • Added the HasValue method to the EnvReader class. (#26, #50)
  • Added checks to some methods in case the parameter is null. (#36, #37)
  • Added the SetEncoding(string) and AddEnvFile(string, string) method to the EnvLoader 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 the EnvLoader class.
  • 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 and EnvLoader.Load methods to IEnvironmentVariablesProvider.
  • Added a parameterized constructor to the EnvReader class so that it depends on the IEnvironmentVariablesProvider interface. (#48, #49)
  • The EnvVariableNotFoundException class was replaced by VariableNotSetException.
  • The name of the method IgnoreParserExceptions has been changed to IgnoreParserException.
  • Removed None option from ConcatKeysOptions enum.
  • Removed parameters: actualValue, currentLine from the parameterized constructor of the ParserException 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.

Other changes

v1.1.3

03 Jan 16:29
Compare
Choose a tag to compare
  • Fixed issue #11 so that the parser returns a line number that matches the line number of the .env file.

v1.1.2

31 Dec 19:13
Compare
Choose a tag to compare
  • 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

24 Dec 17:27
Compare
Choose a tag to compare
  • Fixed the problem that the delimiter can not appear more than once in the value of an key (issue #1).

v1.0.1

18 Dec 23:27
7987514
Compare
Choose a tag to compare
  • Added documentation file to the package.

v1.0.0

16 Dec 18:15
Compare
Choose a tag to compare
Changed branch from main to master