kerimdzhanov / dotenv-flow

Loads environment variables from .env.[development|test|production][.local] files for Node.js® projects.
MIT License
862 stars 35 forks source link

feat(dotenv): upgrade dotenv to v16.0.0 #54

Closed aymericbouzy closed 1 year ago

aymericbouzy commented 2 years ago

In particular, multiline support has been added in v15.0.0

https://github.com/motdotla/dotenv#multiline-values

aymericbouzy commented 2 years ago

@kerimdzhanov this is my first time contributing: please suggest any improvement I can make to my PR to get it merged 🙏

bartvanandel commented 2 years ago

Better still: change from having dotenv as a dependency to having it as a peerDependency, and any compatible version:

  [...],
  "peerDependencies": {
    "dotenv": ">=8.0.0"
  }

This way we (the end users) have control over which version of dotenv we're using.

kerimdzhanov commented 1 year ago

Hi @aymericbouzy,

Thanks for sending the PR. Before updating the only dependency we need to make sure that it's backward compatible or update the way dotenv-flow uses it (in particular the dotenv's .parse() method and signature). I am not sure yet what are the changes since dotenv v8.0.0 tbh 😬.

kerimdzhanov commented 1 year ago

Hi @bartvanandel,

I am not sure if all the versions of "dotenv" are fully compatible with "dotenv-flow" given that we use its "kinda internal API" methods.

Moreover, I am even more unsure if it's going to be compatible in the future, so I believe maintaining and updating it appropriately as a direct dependency is more reliable.

piotr-cz commented 1 year ago

@kerimdzhanov I'm pretty sure that dotenv v15 is 100% backward compatible with v8

I'm using an override https://github.com/kerimdzhanov/dotenv-flow/issues/58#issuecomment-1641583996 in package.json to force dotenv-flow to use v15 on production.

You can release dotenv-flow with a major version v4 with latest dependencies

kerimdzhanov commented 1 year ago

Hi @piotr-cz,

Thanks for confirming! Yeah, it seems that they're backward compatible while using one of the latest versions of Node.js. But since "dotenv" dropped the older Node.js versions' support in some major version bumps, I am going to add some new features and release them as v4.x first, then I'll release v5.x with the dotenv updates, so new features would be available for users who can't upgrade Node.js versions for some reason.

kerimdzhanov commented 1 year ago

Well, I hope nobody's mind if we just drop Node.js prior to v12 in v4.