@dotenvx/dotenvx 1.35.0 → 1.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,7 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
- [Unreleased](https://github.com/dotenvx/dotenvx/compare/v1.35.0...main)
5
+ [Unreleased](https://github.com/dotenvx/dotenvx/compare/v1.36.0...main)
6
+
7
+ ## [1.36.0](https://github.com/dotenvx/dotenvx/compare/v1.35.0...v1.36.0)
8
+
9
+ ### Changed
10
+
11
+ * `--strict` flag respects (doesn't throw) anything in `--ignore` flag ([#527](https://github.com/dotenvx/dotenvx/pull/527))
6
12
 
7
13
  ## [1.35.0](https://github.com/dotenvx/dotenvx/compare/v1.34.0...v1.35.0)
8
14
 
package/README.md CHANGED
@@ -6,6 +6,8 @@
6
6
  * multi-environment
7
7
  * encrypted envs
8
8
 
9
+ [Read the whitepaper](https://dotenvx.com/dotenvx.pdf)
10
+
9
11
   
10
12
 
11
13
 
@@ -524,6 +526,8 @@ More examples
524
526
  Hello local
525
527
  ```
526
528
 
529
+ Note subsequent files do NOT override pre-existing variables defined in previous files or env. This follows historic principle. For example, above `local` wins – from the first file.
530
+
527
531
  </details>
528
532
 
529
533
  * <details><summary>`--overload` flag</summary><br>
@@ -538,6 +542,8 @@ More examples
538
542
  Hello World
539
543
  ```
540
544
 
545
+ Note that with `--overload` subsequent files DO override pre-existing variables defined in previous files.
546
+
541
547
  * <details><summary>`--verbose` flag</summary><br>
542
548
 
543
549
  ```sh
@@ -798,6 +804,8 @@ More examples
798
804
  Hello local
799
805
  ```
800
806
 
807
+ Note subsequent files do NOT override pre-existing variables defined in previous files or env. This follows historic principle. For example, above `local` wins – from the first file.
808
+
801
809
  </details>
802
810
  * <details><summary>`run --env HELLO=String`</summary><br>
803
811
 
@@ -827,6 +835,8 @@ More examples
827
835
  Hello World
828
836
  ```
829
837
 
838
+ Note that with `--overload` subsequent files DO override pre-existing variables defined in previous files.
839
+
830
840
  </details>
831
841
  * <details><summary>`DOTENV_PRIVATE_KEY=key run`</summary><br>
832
842
 
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.35.0",
2
+ "version": "1.36.0",
3
3
  "name": "@dotenvx/dotenvx",
4
4
  "description": "a better dotenv–from the creator of `dotenv`",
5
5
  "author": "@motdotla",
@@ -62,13 +62,13 @@ async function run () {
62
62
  }
63
63
 
64
64
  for (const error of processedEnv.errors || []) {
65
- if (options.strict) throw error // throw immediately if strict
66
-
67
65
  if (ignore.includes(error.code)) {
68
66
  logger.verbose(`ignored: ${error.message}`)
69
67
  continue // ignore error
70
68
  }
71
69
 
70
+ if (options.strict) throw error // throw if strict and not ignored
71
+
72
72
  if (error.code === 'MISSING_ENV_FILE') {
73
73
  if (!options.convention) { // do not output error for conventions (too noisy)
74
74
  console.error(error.message)
package/src/lib/main.js CHANGED
@@ -69,12 +69,13 @@ const config = function (options = {}) {
69
69
  }
70
70
 
71
71
  for (const error of processedEnv.errors || []) {
72
- if (strict) throw error // throw immediately if strict
73
-
74
72
  if (ignore.includes(error.code)) {
73
+ logger.verbose(`ignored: ${error.message}`)
75
74
  continue // ignore error
76
75
  }
77
76
 
77
+ if (strict) throw error // throw if strict and not ignored
78
+
78
79
  lastError = error // surface later in { error }
79
80
 
80
81
  if (error.code === 'MISSING_ENV_FILE') {
@@ -244,12 +245,12 @@ const get = function (key, options = {}) {
244
245
  const { parsed, errors } = new Get(key, envs, options.overload, process.env.DOTENV_KEY, options.all, options.envKeysFile).run()
245
246
 
246
247
  for (const error of errors || []) {
247
- if (options.strict) throw error // throw immediately if strict
248
-
249
248
  if (ignore.includes(error.code)) {
250
249
  continue // ignore error
251
250
  }
252
251
 
252
+ if (options.strict) throw error // throw immediately if strict
253
+
253
254
  console.error(error.message)
254
255
  if (error.help) {
255
256
  console.error(error.help)