@dotenvx/dotenvx 2.38.0 → 2.38.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/package.json +3 -3
- package/src/cli/actions/check.js +2 -1
- package/src/cli/actions/decrypt.js +3 -10
- package/src/cli/actions/encrypt.js +2 -1
- package/src/cli/actions/get.js +2 -5
- package/src/cli/actions/keypair.js +2 -5
- package/src/cli/actions/run.js +2 -3
- package/src/cli/actions/set.js +2 -1
- package/src/lib/decryptors/armor/index.js +4 -1
- package/src/lib/helpers/statusReporter.js +8 -0
- package/src/lib/providers/index.js +1 -0
- package/src/lib/transforms/set.js +3 -2
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.38.
|
|
5
|
+
[Unreleased](https://github.com/dotenvx/dotenvx/compare/v2.38.2...main)
|
|
6
|
+
|
|
7
|
+
## [2.38.2](https://github.com/dotenvx/dotenvx/compare/v2.38.1...v2.38.2) (2026-10-20)
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
* Fix SEA crash ([#1031](https://github.com/dotenvx/dotenvx/issues/1031))
|
|
12
|
+
|
|
13
|
+
## [2.38.1](https://github.com/dotenvx/dotenvx/compare/v2.38.0...v2.38.1) (2026-10-19)
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
* Surface Armor approval prompts to stderr ([#1030](https://github.com/dotenvx/dotenvx/pull/1030))
|
|
6
18
|
|
|
7
19
|
## [2.38.0](https://github.com/dotenvx/dotenvx/compare/v2.37.0...v2.38.0) (2026-10-16)
|
|
8
20
|
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.38.
|
|
2
|
+
"version": "2.38.2",
|
|
3
3
|
"name": "@dotenvx/dotenvx",
|
|
4
4
|
"description": "a secure dotenv–from the creator of `dotenv`",
|
|
5
5
|
"author": "@motdotla",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"funding": "https://dotenvx.com",
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@dotenvx/primitives": "^3.3.1",
|
|
57
|
-
"@dotenvx/providers": "^0.3.
|
|
58
|
-
"@dotenvx/tooling": "^1.0.
|
|
57
|
+
"@dotenvx/providers": "^0.3.11",
|
|
58
|
+
"@dotenvx/tooling": "^1.0.6",
|
|
59
59
|
"undici": "^6.28.1",
|
|
60
60
|
"write-file-atomic": "^5.0.1",
|
|
61
61
|
"yocto-spinner": "^1.2.1"
|
package/src/cli/actions/check.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const statusReporter = require('../../lib/helpers/statusReporter')
|
|
1
2
|
const { logger } = require('./../../shared/logger')
|
|
2
3
|
const catchAndLog = require('./../../lib/helpers/catchAndLog')
|
|
3
4
|
const createSpinner = require('../../lib/helpers/createSpinner')
|
|
@@ -28,7 +29,7 @@ async function check () {
|
|
|
28
29
|
const { processedEnvs, readableFilepaths, requiredFilepaths, validationError, schema, checked: checkedValues } = await prepareValidatedEnv({
|
|
29
30
|
envs: this.envs,
|
|
30
31
|
options,
|
|
31
|
-
onStatus:
|
|
32
|
+
onStatus: statusReporter(spinner)
|
|
32
33
|
})
|
|
33
34
|
checked.push(...readableFilepaths)
|
|
34
35
|
if (processedEnvs.some(row => row.type === 'env' && Object.keys(row.parsed || {}).length)) checked.push('--env')
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const statusReporter = require('../../lib/helpers/statusReporter')
|
|
1
2
|
const { publickeys, injectsummary } = require('@dotenvx/primitives')
|
|
2
3
|
const fsx = require('./../../lib/helpers/fsx')
|
|
3
4
|
const { logger } = require('./../../shared/logger')
|
|
@@ -34,11 +35,7 @@ async function decrypt () {
|
|
|
34
35
|
fk: options.envKeysFile,
|
|
35
36
|
noArmor,
|
|
36
37
|
noNative,
|
|
37
|
-
onStatus: (
|
|
38
|
-
if (spinner && text) {
|
|
39
|
-
spinner.text = text
|
|
40
|
-
}
|
|
41
|
-
}
|
|
38
|
+
onStatus: statusReporter(spinner)
|
|
42
39
|
})
|
|
43
40
|
|
|
44
41
|
if (spinner) spinner.stop()
|
|
@@ -74,11 +71,7 @@ async function decrypt () {
|
|
|
74
71
|
fk: options.envKeysFile,
|
|
75
72
|
noArmor,
|
|
76
73
|
noNative,
|
|
77
|
-
onStatus: (
|
|
78
|
-
if (spinner && text) {
|
|
79
|
-
spinner.text = text
|
|
80
|
-
}
|
|
81
|
-
}
|
|
74
|
+
onStatus: statusReporter(spinner)
|
|
82
75
|
})
|
|
83
76
|
|
|
84
77
|
for (const processedEnv of processedEnvs) {
|
|
@@ -5,6 +5,7 @@ const encryptTransform = require('./../../lib/transforms/encrypt')
|
|
|
5
5
|
|
|
6
6
|
const catchAndLog = require('../../lib/helpers/catchAndLog')
|
|
7
7
|
const createSpinner = require('../../lib/helpers/createSpinner')
|
|
8
|
+
const statusReporter = require('../../lib/helpers/statusReporter')
|
|
8
9
|
const keypair = require('../../lib/resolvers/keypair')
|
|
9
10
|
const { publickeys, injectsummary } = require('@dotenvx/primitives')
|
|
10
11
|
|
|
@@ -72,7 +73,7 @@ async function encryptAction () {
|
|
|
72
73
|
for (const row of processedEnvs) {
|
|
73
74
|
if (options.with !== undefined || options.quiet || row.error || row.keySources || !publickeys(row.envSrc || '').length) continue
|
|
74
75
|
try {
|
|
75
|
-
const resolved = await keypair({ ...options, envFile: [row.filepath], envKeysFile: fk, noArmor, noNative, no1Password, noBitwarden, includeProvider: true })
|
|
76
|
+
const resolved = await keypair({ ...options, envFile: [row.filepath], envKeysFile: fk, noArmor, noNative, no1Password, noBitwarden, includeProvider: true, onStatus: statusReporter(null) })
|
|
76
77
|
row.keySources = { [publickeys(row.envSrc)[0]]: resolved.provider }
|
|
77
78
|
} catch {}
|
|
78
79
|
}
|
package/src/cli/actions/get.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const statusReporter = require('../../lib/helpers/statusReporter')
|
|
1
2
|
const { logger } = require('./../../shared/logger')
|
|
2
3
|
|
|
3
4
|
const escape = require('./../../lib/helpers/escape')
|
|
@@ -43,11 +44,7 @@ async function get (key) {
|
|
|
43
44
|
noNative,
|
|
44
45
|
no1Password: options['1password'] === false || options.no1Password === true,
|
|
45
46
|
noBitwarden: options.bitwarden === false || options.noBitwarden === true,
|
|
46
|
-
onStatus: (
|
|
47
|
-
if (spinner && text) {
|
|
48
|
-
spinner.text = text
|
|
49
|
-
}
|
|
50
|
-
}
|
|
47
|
+
onStatus: statusReporter(spinner)
|
|
51
48
|
})
|
|
52
49
|
const parsed = filterKeys(resolved, options.includeKey, options.excludeKey)
|
|
53
50
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const statusReporter = require('../../lib/helpers/statusReporter')
|
|
1
2
|
const { logger } = require('./../../shared/logger')
|
|
2
3
|
|
|
3
4
|
const keypairResolver = require('./../../lib/resolvers/keypair')
|
|
@@ -29,11 +30,7 @@ async function keypair (key) {
|
|
|
29
30
|
no1Password: options['1password'] === false || options.no1Password === true,
|
|
30
31
|
token: options.token,
|
|
31
32
|
command: process.argv.slice(2),
|
|
32
|
-
onStatus: (
|
|
33
|
-
if (spinner && text) {
|
|
34
|
-
spinner.text = text
|
|
35
|
-
}
|
|
36
|
-
}
|
|
33
|
+
onStatus: statusReporter(spinner)
|
|
37
34
|
})
|
|
38
35
|
|
|
39
36
|
const results = key ? keypairs[key] : keypairs
|
package/src/cli/actions/run.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const statusReporter = require('../../lib/helpers/statusReporter')
|
|
1
2
|
const path = require('path')
|
|
2
3
|
const { injectsummary, publickeys } = require('@dotenvx/primitives')
|
|
3
4
|
const { logger } = require('./../../shared/logger')
|
|
@@ -106,9 +107,7 @@ async function run () {
|
|
|
106
107
|
processEnv: process.env,
|
|
107
108
|
requireEnvfile: false,
|
|
108
109
|
command: commandArgs,
|
|
109
|
-
onStatus: (
|
|
110
|
-
if (spinner && text) spinner.text = text
|
|
111
|
-
}
|
|
110
|
+
onStatus: statusReporter(spinner)
|
|
112
111
|
})
|
|
113
112
|
|
|
114
113
|
if (hasEnvfile || options.redact === true) {
|
package/src/cli/actions/set.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const statusReporter = require('../../lib/helpers/statusReporter')
|
|
1
2
|
const fsx = require('./../../lib/helpers/fsx')
|
|
2
3
|
const { logger } = require('./../../shared/logger')
|
|
3
4
|
|
|
@@ -64,7 +65,7 @@ async function set (key, value) {
|
|
|
64
65
|
let errorCount = 0
|
|
65
66
|
|
|
66
67
|
try {
|
|
67
|
-
const { keysSrc, processedEnvs, changedFilepaths, unchangedFilepaths } = await setTransform({ profile: options.profile, envs, key, value, fk, noArmor, token: options.token, noCreate, encrypt, noNative, no1Password, noBitwarden })
|
|
68
|
+
const { keysSrc, processedEnvs, changedFilepaths, unchangedFilepaths } = await setTransform({ profile: options.profile, envs, key, value, fk, noArmor, token: options.token, noCreate, encrypt, noNative, no1Password, noBitwarden, onStatus: statusReporter(spinner) })
|
|
68
69
|
|
|
69
70
|
if (keysSrc) {
|
|
70
71
|
await fsx.writeKeyFile(fk, keysSrc)
|
|
@@ -13,7 +13,10 @@ async function index (src, options = {}) {
|
|
|
13
13
|
hostname,
|
|
14
14
|
token,
|
|
15
15
|
devicePublicKey,
|
|
16
|
-
cliVersion: version
|
|
16
|
+
cliVersion: version,
|
|
17
|
+
onApprovalRequired: options.onStatus && (({ approvalUri, code }) => {
|
|
18
|
+
options.onStatus(`[${code}] open [${approvalUri}] to approve. Waiting for approval…`)
|
|
19
|
+
})
|
|
17
20
|
}).decrypt(src, { publicKey: options.publicKey, grantToken: options.grantToken })
|
|
18
21
|
}
|
|
19
22
|
|
|
@@ -28,6 +28,7 @@ function lookup (publicKey, options, sync) {
|
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
onArmorError (error) { armorError = error },
|
|
31
|
+
// Without CLI presentation, providers reports approval itself (including getSync).
|
|
31
32
|
onApprovalRequired: options.onStatus && (({ approvalUri, code }) => {
|
|
32
33
|
cleanup()
|
|
33
34
|
const display = armoredKeyDisplay(publicKey)
|
|
@@ -94,7 +94,7 @@ async function setTransform (options = {}) {
|
|
|
94
94
|
row.changed = true
|
|
95
95
|
}
|
|
96
96
|
} else {
|
|
97
|
-
//
|
|
97
|
+
// Compare plaintext before rewriting ciphertext; surface any provider approval.
|
|
98
98
|
const { parsed, keySources } = await getResolver({
|
|
99
99
|
includeKeySources: true,
|
|
100
100
|
key,
|
|
@@ -104,7 +104,8 @@ async function setTransform (options = {}) {
|
|
|
104
104
|
noArmor,
|
|
105
105
|
noNative,
|
|
106
106
|
no1Password: options.no1Password,
|
|
107
|
-
noBitwarden: options.noBitwarden
|
|
107
|
+
noBitwarden: options.noBitwarden,
|
|
108
|
+
onStatus: options.onStatus
|
|
108
109
|
})
|
|
109
110
|
|
|
110
111
|
row.keySources = row.keySources || keySources
|