dotenv icon indicating copy to clipboard operation
dotenv copied to clipboard

Public APIs refactor with top-level dotenv constant

Open pulyaevskiy opened this issue 9 years ago • 5 comments

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!

pulyaevskiy avatar Feb 02 '16 19:02 pulyaevskiy

Friendly reminder @mockturtl

pulyaevskiy avatar Feb 18 '16 23:02 pulyaevskiy

@pulyaevskiy Thanks for your patience, again. I've been tied up with other things.

Looking over it now.

mockturtl avatar Feb 21 '16 18:02 mockturtl

Note to self: @Deprecated, @deprecated

mockturtl avatar Feb 21 '16 19:02 mockturtl

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.

mockturtl avatar Feb 21 '16 20:02 mockturtl

I think it's probably better to imitate the Map interface here and spell it containsKey. 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?

pulyaevskiy avatar Feb 22 '16 20:02 pulyaevskiy