@dotenvx/dotenvx 1.47.5 → 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 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/v1.47.5...main)
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))
6
12
 
7
13
  ## 1.47.5
8
14
 
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.47.5",
2
+ "version": "1.47.6",
3
3
  "name": "@dotenvx/dotenvx",
4
4
  "description": "a better dotenv–from the creator of `dotenv`",
5
5
  "author": "@motdotla",
@@ -35,20 +35,35 @@ class Radar {
35
35
  }
36
36
 
37
37
  _radarNpm () {
38
- const projectRoot = path.resolve(process.cwd())
39
- // eslint-disable-next-line no-eval
40
- const npmPath = eval('require').resolve('@dotenvx/dotenvx-radar', { paths: [projectRoot] }) // necessary for webpack builds
41
- // eslint-disable-next-line no-eval
42
- return eval('require')(npmPath) // necessary for webpack builds
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: (payload) => {
49
- const encoded = this.encode(payload)
59
+ observe: (encoded) => {
50
60
  try {
51
- childProcess.execSync(`dotenvx-radar observe ${encoded}`, { stdio: 'ignore' })
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
  }