@dotenvx/dotenvx 1.65.1 → 1.65.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 +13 -1
- package/package.json +1 -1
- package/src/cli/actions/run.js +8 -1
- package/src/lib/extensions/ops.js +7 -4
- package/src/lib/helpers/cryptography/opsKeypair.js +14 -2
- package/src/lib/helpers/cryptography/opsKeypairSync.js +3 -2
- package/src/lib/helpers/keyResolution/keyValues.js +4 -1
- package/src/lib/helpers/keyResolution/keyValuesSync.js +6 -1
- package/src/lib/main.d.ts +8 -0
- package/src/lib/main.js +3 -1
- package/src/lib/services/run.js +15 -3
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/v1.65.
|
|
5
|
+
[Unreleased](https://github.com/dotenvx/dotenvx/compare/v1.65.3...main)
|
|
6
|
+
|
|
7
|
+
## [1.65.3](https://github.com/dotenvx/dotenvx/compare/v1.65.2...v1.65.3) (2026-05-13)
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
* Improve spinner message blinking with simpler `--no-spinner` flag passed to ops ([#814](https://github.com/dotenvx/dotenvx/pull/814))
|
|
12
|
+
|
|
13
|
+
## [1.65.2](https://github.com/dotenvx/dotenvx/compare/v1.65.1...v1.65.2) (2026-05-13)
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
* Improve spinner message coordination between `dotenvx` and `dotenvx-ops` ([#813](https://github.com/dotenvx/dotenvx/pull/813))
|
|
6
18
|
|
|
7
19
|
## [1.65.1](https://github.com/dotenvx/dotenvx/compare/v1.65.0...v1.65.1) (2026-05-13)
|
|
8
20
|
|
package/package.json
CHANGED
package/src/cli/actions/run.js
CHANGED
|
@@ -53,7 +53,14 @@ async function run () {
|
|
|
53
53
|
readableStrings,
|
|
54
54
|
readableFilepaths,
|
|
55
55
|
uniqueInjectedKeys
|
|
56
|
-
} = await new Run(envs, options.overload, process.env, options.envKeysFile, noOps
|
|
56
|
+
} = await new Run(envs, options.overload, process.env, options.envKeysFile, noOps, {
|
|
57
|
+
beforeOpsKeypair: () => {
|
|
58
|
+
if (spinner) spinner.start('retrieving')
|
|
59
|
+
},
|
|
60
|
+
afterOpsKeypair: () => {
|
|
61
|
+
if (spinner) spinner.start('injecting')
|
|
62
|
+
}
|
|
63
|
+
}).run()
|
|
57
64
|
|
|
58
65
|
for (const processedEnv of processedEnvs) {
|
|
59
66
|
if (processedEnv.type === 'envFile') {
|
|
@@ -32,13 +32,14 @@ class Ops {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
async keypair (publicKey) {
|
|
35
|
+
async keypair (publicKey, options = {}) {
|
|
36
36
|
if (this._isForcedOff()) return {}
|
|
37
37
|
|
|
38
38
|
const binary = await this._resolveBinary()
|
|
39
39
|
if (!binary) return {}
|
|
40
40
|
|
|
41
41
|
const args = ['keypair']
|
|
42
|
+
if (options.noSpinner) args.push('--no-spinner')
|
|
42
43
|
if (publicKey) args.push(publicKey)
|
|
43
44
|
|
|
44
45
|
try {
|
|
@@ -48,13 +49,14 @@ class Ops {
|
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
|
|
51
|
-
keypairSync (publicKey) {
|
|
52
|
+
keypairSync (publicKey, options = {}) {
|
|
52
53
|
if (this._isForcedOff()) return {}
|
|
53
54
|
|
|
54
55
|
const binary = this._resolveBinarySync()
|
|
55
56
|
if (!binary) return {}
|
|
56
57
|
|
|
57
58
|
const args = ['keypair']
|
|
59
|
+
if (options.noSpinner) args.push('--no-spinner')
|
|
58
60
|
if (publicKey) args.push(publicKey)
|
|
59
61
|
|
|
60
62
|
try {
|
|
@@ -106,9 +108,10 @@ class Ops {
|
|
|
106
108
|
|
|
107
109
|
_execInteractive (binary, args) {
|
|
108
110
|
return new Promise((resolve, reject) => {
|
|
109
|
-
const
|
|
111
|
+
const spawnOptions = {
|
|
110
112
|
stdio: ['inherit', 'pipe', 'inherit']
|
|
111
|
-
}
|
|
113
|
+
}
|
|
114
|
+
const subprocess = childProcess.spawn(binary, args, spawnOptions)
|
|
112
115
|
let stdout = ''
|
|
113
116
|
|
|
114
117
|
subprocess.stdout.on('data', (data) => {
|
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
const Ops = require('../../extensions/ops')
|
|
2
2
|
|
|
3
|
-
async function opsKeypair (existingPublicKey) {
|
|
4
|
-
|
|
3
|
+
async function opsKeypair (existingPublicKey, options = {}) {
|
|
4
|
+
if (options.beforeOpsKeypair) await options.beforeOpsKeypair()
|
|
5
|
+
|
|
6
|
+
let kp
|
|
7
|
+
try {
|
|
8
|
+
if (options.beforeOpsKeypair || options.afterOpsKeypair) {
|
|
9
|
+
kp = await new Ops().keypair(existingPublicKey, { noSpinner: true })
|
|
10
|
+
} else {
|
|
11
|
+
kp = await new Ops().keypair(existingPublicKey)
|
|
12
|
+
}
|
|
13
|
+
} finally {
|
|
14
|
+
if (options.afterOpsKeypair) await options.afterOpsKeypair()
|
|
15
|
+
}
|
|
16
|
+
|
|
5
17
|
const publicKey = kp.public_key
|
|
6
18
|
const privateKey = kp.private_key
|
|
7
19
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
const Ops = require('../../extensions/ops')
|
|
2
2
|
|
|
3
|
-
function opsKeypairSync (existingPublicKey) {
|
|
4
|
-
const
|
|
3
|
+
function opsKeypairSync (existingPublicKey, options = {}) {
|
|
4
|
+
const ops = new Ops()
|
|
5
|
+
const kp = Object.keys(options).length > 0 ? ops.keypairSync(existingPublicKey, options) : ops.keypairSync(existingPublicKey)
|
|
5
6
|
const publicKey = kp.public_key
|
|
6
7
|
const privateKey = kp.private_key
|
|
7
8
|
|
|
@@ -72,7 +72,10 @@ async function keyValues (filepath, opts = {}) {
|
|
|
72
72
|
|
|
73
73
|
// ops
|
|
74
74
|
if (!noOps && !privateKey && publicKey && publicKey.length > 0) {
|
|
75
|
-
const kp = await opsKeypair(publicKey
|
|
75
|
+
const kp = await opsKeypair(publicKey, {
|
|
76
|
+
beforeOpsKeypair: opts.beforeOpsKeypair,
|
|
77
|
+
afterOpsKeypair: opts.afterOpsKeypair
|
|
78
|
+
})
|
|
76
79
|
privateKey = kp.privateKey
|
|
77
80
|
}
|
|
78
81
|
|
|
@@ -72,7 +72,12 @@ function keyValuesSync (filepath, opts = {}) {
|
|
|
72
72
|
|
|
73
73
|
// ops
|
|
74
74
|
if (!noOps && !privateKey && publicKey && publicKey.length > 0) {
|
|
75
|
-
const
|
|
75
|
+
const opsOptions = {}
|
|
76
|
+
if (opts.noSpinner) {
|
|
77
|
+
opsOptions.noSpinner = true
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const kp = Object.keys(opsOptions).length > 0 ? opsKeypairSync(publicKey, opsOptions) : opsKeypairSync(publicKey)
|
|
76
81
|
privateKey = kp.privateKey
|
|
77
82
|
}
|
|
78
83
|
|
package/src/lib/main.d.ts
CHANGED
|
@@ -146,6 +146,14 @@ export interface DotenvConfigOptions {
|
|
|
146
146
|
|
|
147
147
|
quiet?: boolean;
|
|
148
148
|
|
|
149
|
+
/**
|
|
150
|
+
* Disable spinner output from child Dotenvx Ops commands.
|
|
151
|
+
*
|
|
152
|
+
* @default false
|
|
153
|
+
* @example require('@dotenvx/dotenvx').config({ noSpinner: true })
|
|
154
|
+
*/
|
|
155
|
+
noSpinner?: boolean;
|
|
156
|
+
|
|
149
157
|
logLevel?:
|
|
150
158
|
| 'error'
|
|
151
159
|
| 'warn'
|
package/src/lib/main.js
CHANGED
|
@@ -59,7 +59,9 @@ const config = function (options = {}) {
|
|
|
59
59
|
processedEnvs,
|
|
60
60
|
readableFilepaths,
|
|
61
61
|
uniqueInjectedKeys
|
|
62
|
-
} = new Run(envs, overload, processEnv, envKeysFile, noOps
|
|
62
|
+
} = new Run(envs, overload, processEnv, envKeysFile, noOps, {
|
|
63
|
+
noSpinner: options.noSpinner
|
|
64
|
+
}).runSync()
|
|
63
65
|
|
|
64
66
|
let lastError
|
|
65
67
|
/** @type {Record<string, string>} */
|
package/src/lib/services/run.js
CHANGED
|
@@ -17,12 +17,15 @@ const {
|
|
|
17
17
|
} = require('./../helpers/keyResolution')
|
|
18
18
|
|
|
19
19
|
class Run {
|
|
20
|
-
constructor (envs = [], overload = false, processEnv = process.env, envKeysFilepath = null, noOps = false) {
|
|
20
|
+
constructor (envs = [], overload = false, processEnv = process.env, envKeysFilepath = null, noOps = false, options = {}) {
|
|
21
21
|
this.envs = envs
|
|
22
22
|
this.overload = overload
|
|
23
23
|
this.processEnv = processEnv
|
|
24
24
|
this.envKeysFilepath = envKeysFilepath
|
|
25
25
|
this.noOps = noOps
|
|
26
|
+
this.noSpinner = options.noSpinner
|
|
27
|
+
this.beforeOpsKeypair = options.beforeOpsKeypair
|
|
28
|
+
this.afterOpsKeypair = options.afterOpsKeypair
|
|
26
29
|
|
|
27
30
|
this.processedEnvs = []
|
|
28
31
|
this.readableFilepaths = new Set()
|
|
@@ -134,7 +137,11 @@ class Run {
|
|
|
134
137
|
this.readableFilepaths.add(envFilepath)
|
|
135
138
|
|
|
136
139
|
const { privateKeyName } = keyNames(filepath)
|
|
137
|
-
const { privateKeyValue } = keyValuesSync(filepath, {
|
|
140
|
+
const { privateKeyValue } = keyValuesSync(filepath, {
|
|
141
|
+
keysFilepath: this.envKeysFilepath,
|
|
142
|
+
noOps: this.noOps,
|
|
143
|
+
noSpinner: this.noSpinner
|
|
144
|
+
})
|
|
138
145
|
|
|
139
146
|
const {
|
|
140
147
|
parsed,
|
|
@@ -179,7 +186,12 @@ class Run {
|
|
|
179
186
|
this.readableFilepaths.add(envFilepath)
|
|
180
187
|
|
|
181
188
|
const { privateKeyName } = keyNames(filepath)
|
|
182
|
-
const { privateKeyValue } = await keyValues(filepath, {
|
|
189
|
+
const { privateKeyValue } = await keyValues(filepath, {
|
|
190
|
+
keysFilepath: this.envKeysFilepath,
|
|
191
|
+
noOps: this.noOps,
|
|
192
|
+
beforeOpsKeypair: this.beforeOpsKeypair,
|
|
193
|
+
afterOpsKeypair: this.afterOpsKeypair
|
|
194
|
+
})
|
|
183
195
|
|
|
184
196
|
const {
|
|
185
197
|
parsed,
|