@dotenvx/dotenvx 1.47.3 → 1.47.5

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,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.3...main)
5
+ [Unreleased](https://github.com/dotenvx/dotenvx/compare/v1.47.5...main)
6
+
7
+ ## 1.47.5
8
+
9
+ ### Changed
10
+
11
+ * Add resilient handling of any Radar failures ([#639](https://github.com/dotenvx/dotenvx/pull/639))
12
+
13
+ ## 1.47.4
14
+
15
+ ### Changed
16
+
17
+ * Smarter require of non-installed libs like [`dotenvx-radar`](https://dotenvx.com/radar) ([#638](https://github.com/dotenvx/dotenvx/pull/638))
6
18
 
7
19
  ## 1.47.3
8
20
 
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.47.3",
2
+ "version": "1.47.5",
3
3
  "name": "@dotenvx/dotenvx",
4
4
  "description": "a better dotenv–from the creator of `dotenv`",
5
5
  "author": "@motdotla",
@@ -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
- radar.observe(processedEnvs)
51
+ try { new Radar().observe({ processedEnvs }) } catch {}
54
52
 
55
53
  for (const processedEnv of processedEnvs) {
56
54
  if (processedEnv.type === 'envVaultFile') {
@@ -15,9 +15,10 @@ class ProKeypair {
15
15
  try {
16
16
  // if installed as sibling module
17
17
  const projectRoot = path.resolve(process.cwd())
18
- const dotenvxProPath = require.resolve('@dotenvx/dotenvx-pro', { paths: [projectRoot] })
19
- const { keypair } = require(dotenvxProPath)
20
-
18
+ // eslint-disable-next-line no-eval
19
+ const dotenvxProPath = eval('require').resolve('@dotenvx/dotenvx-pro', { paths: [projectRoot] }) // necessary for webpack builds
20
+ // eslint-disable-next-line no-eval
21
+ const { keypair } = eval('require')(dotenvxProPath) // necessary for webpack builds
21
22
  result = keypair(this.envFilepath)
22
23
  } catch (_e) {
23
24
  try {
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
- radar.observe(processedEnvs)
63
+ try { new Radar().observe({ processedEnvs }) } catch {}
66
64
 
67
65
  let lastError
68
66
  /** @type {Record<string, string>} */
@@ -36,8 +36,10 @@ class Radar {
36
36
 
37
37
  _radarNpm () {
38
38
  const projectRoot = path.resolve(process.cwd())
39
- const npmPath = require.resolve('@dotenvx/dotenvx-radar', { paths: [projectRoot] })
40
- return require(npmPath)
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
41
43
  }
42
44
 
43
45
  _radarCli () {