@dotenvx/dotenvx 2.3.0 β 2.3.2
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 +13 -1
- package/README.md +87 -32
- package/package.json +2 -2
- package/src/cli/actions/set.js +1 -7
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,19 @@
|
|
|
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.3.
|
|
5
|
+
[Unreleased](https://github.com/dotenvx/dotenvx/compare/v2.3.2...main)
|
|
6
|
+
|
|
7
|
+
## [2.3.2](https://github.com/dotenvx/dotenvx/compare/v2.3.1...v2.3.2) (2026-07-09)
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
* Permit empty value for `set` ([#877](https://github.com/dotenvx/dotenvx/pull/877))
|
|
12
|
+
|
|
13
|
+
## [2.3.1](https://github.com/dotenvx/dotenvx/compare/v2.3.0...v2.3.1) (2026-07-08)
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
* Fix correct default valuation interpolation for empty strings by upgrading primitives package
|
|
6
18
|
|
|
7
19
|
## [2.3.0](https://github.com/dotenvx/dotenvx/compare/v2.2.2...v2.3.0) (2026-07-08)
|
|
8
20
|
|
package/README.md
CHANGED
|
@@ -122,7 +122,7 @@ Hello Dotenvx # with dotenvx
|
|
|
122
122
|
> :-D
|
|
123
123
|
```
|
|
124
124
|
|
|
125
|
-
see [
|
|
125
|
+
see [quickstart guides](https://dotenvx.com/docs/quickstart)
|
|
126
126
|
|
|
127
127
|
More examples
|
|
128
128
|
|
|
@@ -152,6 +152,59 @@ $ dotenvx run -- npx tsx index.ts
|
|
|
152
152
|
Hello Dotenvx
|
|
153
153
|
```
|
|
154
154
|
|
|
155
|
+
</details>
|
|
156
|
+
<details><summary>Astro π</summary><br>
|
|
157
|
+
|
|
158
|
+
Preface Astro scripts with `dotenvx run --` and read your env values in Astro.
|
|
159
|
+
|
|
160
|
+
```json
|
|
161
|
+
{
|
|
162
|
+
"scripts": {
|
|
163
|
+
"dev": "dotenvx run -- astro dev",
|
|
164
|
+
"build": "dotenvx run -- astro build",
|
|
165
|
+
"preview": "dotenvx run -- astro preview"
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
```astro
|
|
171
|
+
export async function GET() {
|
|
172
|
+
return new Response(
|
|
173
|
+
JSON.stringify({
|
|
174
|
+
HELLO: process.env.HELLO,
|
|
175
|
+
}),
|
|
176
|
+
{
|
|
177
|
+
status: 200,
|
|
178
|
+
headers: {
|
|
179
|
+
"Content-Type": "application/json",
|
|
180
|
+
},
|
|
181
|
+
}
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
see [astro guide](https://dotenvx.com/docs/secrets-in-astro)
|
|
187
|
+
|
|
188
|
+
</details>
|
|
189
|
+
<details><summary>Expo π§</summary><br>
|
|
190
|
+
|
|
191
|
+
Preface Expo scripts with `dotenvx run --`.
|
|
192
|
+
|
|
193
|
+
```json
|
|
194
|
+
{
|
|
195
|
+
"scripts": {
|
|
196
|
+
"start": "dotenvx run -- expo start",
|
|
197
|
+
"reset-project": "node ./scripts/reset-project.js",
|
|
198
|
+
"android": "dotenvx run -- expo start --android",
|
|
199
|
+
"ios": "dotenvx run -- expo start --ios",
|
|
200
|
+
"web": "dotenvx run -- expo start --web",
|
|
201
|
+
"lint": "expo lint"
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
see [expo guide](https://dotenvx.com/docs/secrets-in-expo)
|
|
207
|
+
|
|
155
208
|
</details>
|
|
156
209
|
<details><summary>Next.js β²</summary><br>
|
|
157
210
|
|
|
@@ -222,6 +275,20 @@ export default {
|
|
|
222
275
|
}
|
|
223
276
|
```
|
|
224
277
|
|
|
278
|
+
</details>
|
|
279
|
+
<details><summary>Bun π₯</summary><br>
|
|
280
|
+
|
|
281
|
+
```sh
|
|
282
|
+
$ echo "HELLO=Test" > .env.test
|
|
283
|
+
$ echo "console.log('Hello ' + process.env.HELLO)" > index.js
|
|
284
|
+
|
|
285
|
+
$ bun index.js
|
|
286
|
+
Hello undefined
|
|
287
|
+
|
|
288
|
+
$ dotenvx run -f .env.test -- bun index.js
|
|
289
|
+
Hello Test
|
|
290
|
+
```
|
|
291
|
+
|
|
225
292
|
</details>
|
|
226
293
|
<details><summary>Deno π¦</summary><br>
|
|
227
294
|
|
|
@@ -246,20 +313,6 @@ Hello Dotenvx
|
|
|
246
313
|
>
|
|
247
314
|
> Instead, use `dotenvx` as designed, by installing the cli as a binary - via curl, brew, etc.
|
|
248
315
|
|
|
249
|
-
</details>
|
|
250
|
-
<details><summary>Bun π₯</summary><br>
|
|
251
|
-
|
|
252
|
-
```sh
|
|
253
|
-
$ echo "HELLO=Test" > .env.test
|
|
254
|
-
$ echo "console.log('Hello ' + process.env.HELLO)" > index.js
|
|
255
|
-
|
|
256
|
-
$ bun index.js
|
|
257
|
-
Hello undefined
|
|
258
|
-
|
|
259
|
-
$ dotenvx run -f .env.test -- bun index.js
|
|
260
|
-
Hello Test
|
|
261
|
-
```
|
|
262
|
-
|
|
263
316
|
</details>
|
|
264
317
|
<details><summary>Python π</summary><br>
|
|
265
318
|
|
|
@@ -730,22 +783,6 @@ $ dotenvx encrypt
|
|
|
730
783
|
|
|
731
784
|
> A `DOTENV_PUBLIC_KEY` (encryption key) and a `DOTENV_PRIVATE_KEY` (decryption key) are generated using the same public-key cryptography as [Bitcoin](https://en.bitcoin.it/wiki/Secp256k1).
|
|
732
785
|
|
|
733
|
-
### Protect `.env.keys` from agents
|
|
734
|
-
|
|
735
|
-
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`.
|
|
736
|
-
|
|
737
|
-
```sh
|
|
738
|
-
$ chmod a-r .env.keys
|
|
739
|
-
|
|
740
|
-
$ dotenvx set HELLO World
|
|
741
|
-
β encrypted HELLO (.env)
|
|
742
|
-
|
|
743
|
-
$ dotenvx encrypt
|
|
744
|
-
β encrypted (.env)
|
|
745
|
-
```
|
|
746
|
-
|
|
747
|
-
Keep `.env.keys` unreadable by agents, while still letting them safely update encrypted values.
|
|
748
|
-
|
|
749
786
|
More examples
|
|
750
787
|
|
|
751
788
|
<details><summary>`.env`</summary><br>
|
|
@@ -843,6 +880,23 @@ $ dotenvx encrypt --stdout > .env.encrypted
|
|
|
843
880
|
>
|
|
844
881
|
> 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).
|
|
845
882
|
|
|
883
|
+
</details>
|
|
884
|
+
<details><summary>agents</summary><br>
|
|
885
|
+
|
|
886
|
+
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`.
|
|
887
|
+
|
|
888
|
+
```sh
|
|
889
|
+
$ chmod a-r .env.keys
|
|
890
|
+
|
|
891
|
+
$ dotenvx set HELLO World
|
|
892
|
+
β encrypted HELLO (.env)
|
|
893
|
+
|
|
894
|
+
$ dotenvx encrypt
|
|
895
|
+
β encrypted (.env)
|
|
896
|
+
```
|
|
897
|
+
|
|
898
|
+
Keep `.env.keys` unreadable by agents, while still letting them safely update encrypted values.
|
|
899
|
+
|
|
846
900
|
</details>
|
|
847
901
|
|
|
848
902
|
|
|
@@ -2942,7 +2996,8 @@ This is known as *Decryption at Access* and is written about in [the whitepaper]
|
|
|
2942
2996
|
* [PHP](https://dotenvx.com/docs/languages/php)
|
|
2943
2997
|
* [Rust](https://dotenvx.com/docs/languages/rust)
|
|
2944
2998
|
* [Frameworks](https://dotenvx.com/docs#frameworks)
|
|
2945
|
-
* [Astro](https://dotenvx.com/docs/
|
|
2999
|
+
* [Astro](https://dotenvx.com/docs/secrets-in-astro)
|
|
3000
|
+
* [Expo](https://dotenvx.com/docs/secrets-in-expo)
|
|
2946
3001
|
* [Express](https://dotenvx.com/docs/frameworks/express)
|
|
2947
3002
|
* [Next](https://dotenvx.com/docs/frameworks/next)
|
|
2948
3003
|
* [Remix](https://dotenvx.com/docs/frameworks/remix)
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.3.
|
|
2
|
+
"version": "2.3.2",
|
|
3
3
|
"name": "@dotenvx/dotenvx",
|
|
4
4
|
"description": "a secure dotenvβfrom the creator of `dotenv`",
|
|
5
5
|
"author": "@motdotla",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"funding": "https://dotenvx.com",
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@dotenvx/primitives": "^1.7.
|
|
46
|
+
"@dotenvx/primitives": "^1.7.2",
|
|
47
47
|
"commander": "^11.1.0",
|
|
48
48
|
"conf": "^10.2.0",
|
|
49
49
|
"dotenv": "^17.4.2",
|
package/src/cli/actions/set.js
CHANGED
|
@@ -21,7 +21,7 @@ async function set (key, value) {
|
|
|
21
21
|
settingSymbol = 'β'
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
if (
|
|
24
|
+
if (value === undefined || value === null) {
|
|
25
25
|
if (!process.stdin.isTTY) {
|
|
26
26
|
catchAndLog(new Errors({ key }).missingValue())
|
|
27
27
|
process.exit(1)
|
|
@@ -47,12 +47,6 @@ async function set (key, value) {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
if (value === '') {
|
|
51
|
-
catchAndLog(new Errors({ key }).missingValue())
|
|
52
|
-
process.exit(1)
|
|
53
|
-
return
|
|
54
|
-
}
|
|
55
|
-
|
|
56
50
|
const spinner = await createSpinner({ ...options, text: settingMessage })
|
|
57
51
|
const sesh = new Session()
|
|
58
52
|
|