@dotenvx/dotenvx 2.17.2 → 2.17.3

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/v2.17.2...main)
5
+ [Unreleased](https://github.com/dotenvx/dotenvx/compare/v2.17.3...main)
6
+
7
+ ## [2.17.3](https://github.com/dotenvx/dotenvx/compare/v2.17.2...v2.17.3) (2026-07-23)
8
+
9
+ ### Changed
10
+
11
+ * Exempt `.env.example` in subdirectories from precommit ([#920](https://github.com/dotenvx/dotenvx/pull/920))
6
12
 
7
13
  ## [2.17.2](https://github.com/dotenvx/dotenvx/compare/v2.17.1...v2.17.2) (2026-07-22)
8
14
 
package/README.md CHANGED
@@ -955,24 +955,6 @@ $ dotenvx encrypt --stdout > .env.encrypted
955
955
  > If your organization's compliance department requires [NIST approved curves](https://csrc.nist.gov/projects/elliptic-curve-cryptography) or other curves like `curve25519`, please reach out at [security@dotenvx.com](mailto:security@dotenvx.com).
956
956
 
957
957
  </details>
958
- <details><summary>agents</summary><br>
959
-
960
- After encryption, `DOTENV_PUBLIC_KEY` lives in your encrypted `.env` file. This means agents and automation can keep running `dotenvx set` and `dotenvx encrypt` without reading `.env.keys`.
961
-
962
- ```sh
963
- $ chmod a-r .env.keys
964
-
965
- $ dotenvx set HELLO World
966
- ◈ encrypted HELLO (.env)
967
-
968
- $ dotenvx encrypt
969
- ◈ encrypted (.env)
970
- ```
971
-
972
- Keep `.env.keys` unreadable by agents, while still letting them safely update encrypted values.
973
-
974
- </details>
975
-
976
958
  &nbsp;
977
959
 
978
960
  ## Advanced
@@ -2021,8 +2003,6 @@ $ dotenvx set HELLO World
2021
2003
  set HELLO with encryption (.env)
2022
2004
  ```
2023
2005
 
2024
- Works with unreadable `.env.keys` when `.env` already contains `DOTENV_PUBLIC_KEY`.
2025
-
2026
2006
  </details>
2027
2007
  <details><summary>`set KEY value -f`</summary><br>
2028
2008
 
@@ -2134,8 +2114,6 @@ $ dotenvx encrypt
2134
2114
  ⮕ next run [DOTENV_PRIVATE_KEY='122...0b8' dotenvx run -- yourcommand] to test decryption locally
2135
2115
  ```
2136
2116
 
2137
- Works with unreadable `.env.keys` when `.env` already contains `DOTENV_PUBLIC_KEY`.
2138
-
2139
2117
  </details>
2140
2118
  <details><summary>`encrypt -f`</summary><br>
2141
2119
 
@@ -2601,6 +2579,27 @@ Use `-f` and `-fk` to validate a specific env file and keys file. The command ex
2601
2579
  $ dotenvx validate -f .env.production -fk .env.keys
2602
2580
  ```
2603
2581
 
2582
+ </details>
2583
+ <details><summary>`validate --ignore`</summary><br>
2584
+
2585
+ Ignore specific validation error codes.
2586
+
2587
+ ```sh
2588
+ $ dotenvx validate --ignore=MISSING_ENV_EXAMPLE
2589
+ ```
2590
+
2591
+ Ignore multiple error codes by separating them with spaces.
2592
+
2593
+ ```sh
2594
+ $ dotenvx validate --ignore=MISSING_ENV_FILE MISSING_ENV_EXAMPLE
2595
+ ```
2596
+
2597
+ You can also set `DOTENV_CONFIG_IGNORE`. Its value is a comma-separated list.
2598
+
2599
+ ```sh
2600
+ $ DOTENV_CONFIG_IGNORE=MISSING_ENV_FILE,OTHER dotenvx validate
2601
+ ```
2602
+
2604
2603
  </details>
2605
2604
  <details><summary>`genexample`</summary><br>
2606
2605
 
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.17.2",
2
+ "version": "2.17.3",
3
3
  "name": "@dotenvx/dotenvx",
4
4
  "description": "a secure dotenv–from the creator of `dotenv`",
5
5
  "author": "@motdotla",
@@ -54,12 +54,13 @@ class Precommit {
54
54
  count += 1
55
55
 
56
56
  const file = path.join(this.directory, _file) // to handle when directory argument passed
57
+ const filename = path.basename(file) // exemptions match on filename, so they apply at any depth
57
58
 
58
59
  // check if file is going to be committed
59
60
  if (this._isFileToBeCommitted(file)) {
60
61
  // check if that file is being ignored
61
62
  if (ig.ignores(file)) {
62
- if (file === '.env.example' || file === '.env.x') {
63
+ if (filename === '.env.example' || filename === '.env.x') {
63
64
  const warning = new Errors({
64
65
  message: `${file} ignored (should not be)`,
65
66
  help: `fix: [dotenvx gitignore --pattern !${file}]`
@@ -67,7 +68,7 @@ class Precommit {
67
68
  warnings.push(warning)
68
69
  }
69
70
  } else {
70
- if (file !== '.env.example' && file !== '.env.x') {
71
+ if (filename !== '.env.example' && filename !== '.env.x') {
71
72
  const src = fsx.readFileXSync(file)
72
73
  const encrypted = sealed(src)
73
74