@dotenvx/dotenvx 1.47.4 → 1.47.6
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 +1 -3
- package/src/lib/main.js +1 -3
- package/src/lib/services/radar.js +23 -8
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.47.
|
|
5
|
+
[Unreleased](https://github.com/dotenvx/dotenvx/compare/v1.47.6...main)
|
|
6
|
+
|
|
7
|
+
## 1.47.6
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
* Make Radar call non-blocking ([#642](https://github.com/dotenvx/dotenvx/pull/642))
|
|
12
|
+
|
|
13
|
+
## 1.47.5
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
* Add resilient handling of any Radar failures ([#639](https://github.com/dotenvx/dotenvx/pull/639))
|
|
6
18
|
|
|
7
19
|
## 1.47.4
|
|
8
20
|
|
package/package.json
CHANGED
package/src/cli/actions/run.js
CHANGED
|
@@ -41,8 +41,6 @@ async function run () {
|
|
|
41
41
|
|
|
42
42
|
new DeprecationNotice().dotenvKey() // DEPRECATION NOTICE
|
|
43
43
|
|
|
44
|
-
const radar = new Radar()
|
|
45
|
-
|
|
46
44
|
const {
|
|
47
45
|
processedEnvs,
|
|
48
46
|
readableStrings,
|
|
@@ -50,7 +48,7 @@ async function run () {
|
|
|
50
48
|
uniqueInjectedKeys
|
|
51
49
|
} = new Run(envs, options.overload, process.env.DOTENV_KEY, process.env, options.envKeysFile).run()
|
|
52
50
|
|
|
53
|
-
|
|
51
|
+
try { new Radar().observe({ processedEnvs }) } catch {}
|
|
54
52
|
|
|
55
53
|
for (const processedEnv of processedEnvs) {
|
|
56
54
|
if (processedEnv.type === 'envVaultFile') {
|
package/src/lib/main.js
CHANGED
|
@@ -22,8 +22,6 @@ const isIgnoringDotenvKeys = require('./helpers/isIgnoringDotenvKeys')
|
|
|
22
22
|
|
|
23
23
|
/** @type {import('./main').config} */
|
|
24
24
|
const config = function (options = {}) {
|
|
25
|
-
const radar = new Radar()
|
|
26
|
-
|
|
27
25
|
// allow user to set processEnv to write to
|
|
28
26
|
let processEnv = process.env
|
|
29
27
|
if (options && options.processEnv != null) {
|
|
@@ -62,7 +60,7 @@ const config = function (options = {}) {
|
|
|
62
60
|
uniqueInjectedKeys
|
|
63
61
|
} = new Run(envs, overload, DOTENV_KEY, processEnv, envKeysFile).run()
|
|
64
62
|
|
|
65
|
-
|
|
63
|
+
try { new Radar().observe({ processedEnvs }) } catch {}
|
|
66
64
|
|
|
67
65
|
let lastError
|
|
68
66
|
/** @type {Record<string, string>} */
|
|
@@ -35,20 +35,35 @@ class Radar {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
_radarNpm () {
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
const fallbackBin = path.resolve(process.cwd(), 'node_modules/.bin/dotenvx-radar')
|
|
39
|
+
childProcess.execSync(`${fallbackBin} help`, { stdio: ['pipe', 'pipe', 'ignore'] })
|
|
40
|
+
return {
|
|
41
|
+
observe: (encoded) => {
|
|
42
|
+
try {
|
|
43
|
+
const subprocess = childProcess.spawn(fallbackBin, ['observe', encoded], {
|
|
44
|
+
stdio: 'ignore',
|
|
45
|
+
detached: true
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
subprocess.unref() // let it run independently
|
|
49
|
+
} catch (e) {
|
|
50
|
+
// noop
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
43
54
|
}
|
|
44
55
|
|
|
45
56
|
_radarCli () {
|
|
46
57
|
childProcess.execSync('dotenvx-radar help', { stdio: ['pipe', 'pipe', 'ignore'] })
|
|
47
58
|
return {
|
|
48
|
-
observe: (
|
|
49
|
-
const encoded = this.encode(payload)
|
|
59
|
+
observe: (encoded) => {
|
|
50
60
|
try {
|
|
51
|
-
childProcess.
|
|
61
|
+
const subprocess = childProcess.spawn('dotenvx-radar', ['observe', encoded], {
|
|
62
|
+
stdio: 'ignore',
|
|
63
|
+
detached: true
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
subprocess.unref() // let it run independently
|
|
52
67
|
} catch (e) {
|
|
53
68
|
// noop
|
|
54
69
|
}
|