dotenv
dotenv copied to clipboard
Public APIs refactor with top-level dotenv constant
This ended up being a bit more than I expected. Addresses #13 .
- Added top-level dotenv constant to avoid namespace collisions;
- Declared previous APIs deprecated;
- Updated tests, documentation and examples.
Additionally:
- Implemented "integration" tests (loading env from files) ( #9 )
- Replaced stderr output with private library logger, to give users control over output of this library.
- New API does not provide write access to the env map for better encapsulation.
This is a big change, however existing APIs should still work (I added a test case for this).
If this gets merged it should probably go in 0.2.0
with deprecation notice for old APIs to be removed in 0.3.0
.
I can submit separate PR for removing old APIs.
Please let me know your thoughts!
Friendly reminder @mockturtl
@pulyaevskiy Thanks for your patience, again. I've been tied up with other things.
Looking over it now.
Note to self: @Deprecated, @deprecated
New API does not provide write access to the env map for better encapsulation.
I agree this is a good idea. I really want to keep the top-level getter spelled env
, though.
See #15.
I think it's probably better to imitate the
Map
interface here and spell itcontainsKey
. Thoughts?
It makes sense to me. I'll change it.
Re: sdk constraint.
Looks like it's only in pubspec.lock
file, probably result of pub upgrade
. I think guidelines recommend to "gitignore" lock file for libraries (here). Should I just remove the whole file from git tracking and add it to .gitignore
?