@dotenvx/dotenvx 1.44.1 → 1.45.0

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.44.1...main)
5
+ [Unreleased](https://github.com/dotenvx/dotenvx/compare/v1.45.0...main)
6
+
7
+ ## 1.45.0
8
+
9
+ ### Added
10
+
11
+ * Add `logger.setName` and `logger.setVersion` for customization of logger ([#612](https://github.com/dotenvx/dotenvx/pull/612))
12
+
13
+ ## 1.44.2
14
+
15
+ ### Changed
16
+
17
+ * Clarify license is BSD-3.
6
18
 
7
19
  ## [1.44.1](https://github.com/dotenvx/dotenvx/compare/v1.44.0...v1.44.1)
8
20
 
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  BSD 3-Clause License
2
2
 
3
- Copyright (c) 2024, Dotenvx LLC
3
+ Copyright (c) 2024, Scott Motte
4
4
 
5
5
  Redistribution and use in source and binary forms, with or without
6
6
  modification, are permitted provided that the following conditions are met:
@@ -26,11 +26,3 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
26
  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
27
  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
28
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
-
30
- ---
31
-
32
- Dotenvx is an Open Source project licensed under the BSD 3-Clause above.
33
-
34
- Dotenvx Pro is source-available with a commercial-friendly license. You can find
35
- the full commercial license in `COMMERCIAL-LICENSE.txt`. See https://dotenvx.com
36
- for features and purchasing options.
package/README.md CHANGED
@@ -634,7 +634,7 @@ $ dotenvx encrypt
634
634
  ✔ encrypted (.env)
635
635
  ```
636
636
 
637
- ![encrypted .env](https://github.com/dotenvx/dotenvx/assets/3848/2a8c3dc5-cd8e-4a08-8a59-c24d0535c81a)
637
+ [![encrypted .env](https://github.com/user-attachments/assets/46dfe1a7-a027-4d80-9207-789eccc325dc)](https://dotenvx.com)
638
638
 
639
639
  > A `DOTENV_PUBLIC_KEY` (encryption key) and a `DOTENV_PRIVATE_KEY` (decryption key) are generated using the same public-key cryptography as [Bitcoin](https://en.bitcoin.it/wiki/Secp256k1).
640
640
 
@@ -2189,6 +2189,10 @@ Use dotenvx directly in code.
2189
2189
  // index.js
2190
2190
  require('@dotenvx/dotenvx').config({path: ['.env.local', '.env']})
2191
2191
 
2192
+ // esm
2193
+ // import dotenvx from "@dotenvx/dotenvx";
2194
+ // dotenvx.config({path: ['.env.local', '.env']});
2195
+
2192
2196
  console.log(`Hello ${process.env.HELLO}`)
2193
2197
  ```
2194
2198
 
@@ -2217,6 +2221,10 @@ Use dotenvx directly in code.
2217
2221
  // index.js
2218
2222
  require('@dotenvx/dotenvx').config({path: ['.env.local', '.env'], overload: true})
2219
2223
 
2224
+ // esm
2225
+ // import dotenvx from "@dotenvx/dotenvx";
2226
+ // dotenvx.config({path: ['.env.local', '.env'], overload: true});
2227
+
2220
2228
  console.log(`Hello ${process.env.HELLO}`)
2221
2229
  ```
2222
2230
 
@@ -2240,6 +2248,10 @@ Use dotenvx directly in code.
2240
2248
  // index.js
2241
2249
  require('@dotenvx/dotenvx').config({path: ['.env.missing', '.env'], strict: true})
2242
2250
 
2251
+ // esm
2252
+ // import dotenvx from "@dotenvx/dotenvx";
2253
+ // dotenvx.config({path: ['.env.missing', '.env'], strict: true});
2254
+
2243
2255
  console.log(`Hello ${process.env.HELLO}`)
2244
2256
  ```
2245
2257
 
@@ -2262,6 +2274,10 @@ Use dotenvx directly in code.
2262
2274
  // index.js
2263
2275
  require('@dotenvx/dotenvx').config({path: ['.env.missing', '.env'], ignore: ['MISSING_ENV_FILE']})
2264
2276
 
2277
+ // esm
2278
+ // import dotenvx from "@dotenvx/dotenvx";
2279
+ // dotenvx.config({path: ['.env.missing', '.env'], ignore: ['MISSING_ENV_FILE']});
2280
+
2265
2281
  console.log(`Hello ${process.env.HELLO}`)
2266
2282
  ```
2267
2283
 
@@ -2370,7 +2386,7 @@ Use dotenvx directly in code.
2370
2386
 
2371
2387
  > Dotenvx Pro is a commercial extension for [dotenvx](https://github.com/dotenvx/dotenvx).
2372
2388
 
2373
- *Secrets Management Done Right. Encrypted, Cloaked, Secrets as Code.*
2389
+ *Secrets Manager for Env Files.*
2374
2390
 
2375
2391
  * <details><summary>`pro keypair`</summary><br>
2376
2392
 
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.44.1",
2
+ "version": "1.45.0",
3
3
  "name": "@dotenvx/dotenvx",
4
4
  "description": "a better dotenv–from the creator of `dotenv`",
5
5
  "author": "@motdotla",
@@ -15,4 +15,4 @@ function findPrivateKey (envFilepath, envKeysFilepath = null) {
15
15
  return proKeypairs[privateKeyName] || keypairs[privateKeyName]
16
16
  }
17
17
 
18
- module.exports = findPrivateKey
18
+ module.exports = { findPrivateKey }
@@ -6,7 +6,7 @@ const TYPE_ENV_FILE = 'envFile'
6
6
 
7
7
  const Errors = require('./../helpers/errors')
8
8
  const guessPrivateKeyName = require('./../helpers/guessPrivateKeyName')
9
- const findPrivateKey = require('./../helpers/findPrivateKey')
9
+ const { findPrivateKey } = require('./../helpers/findPrivateKey')
10
10
  const decryptKeyValue = require('./../helpers/decryptKeyValue')
11
11
  const isEncrypted = require('./../helpers/isEncrypted')
12
12
  const dotenvParse = require('./../helpers/dotenvParse')
@@ -13,7 +13,7 @@ const dotenvParse = require('./../helpers/dotenvParse')
13
13
  const replace = require('./../helpers/replace')
14
14
  const detectEncoding = require('./../helpers/detectEncoding')
15
15
  const determineEnvs = require('./../helpers/determineEnvs')
16
- const findPrivateKey = require('./../helpers/findPrivateKey')
16
+ const { findPrivateKey } = require('./../helpers/findPrivateKey')
17
17
  const findPublicKey = require('./../helpers/findPublicKey')
18
18
  const keypair = require('./../helpers/keypair')
19
19
  const truncate = require('./../helpers/truncate')
@@ -14,7 +14,7 @@ const replace = require('./../helpers/replace')
14
14
  const append = require('./../helpers/append')
15
15
  const detectEncoding = require('./../helpers/detectEncoding')
16
16
  const determineEnvs = require('./../helpers/determineEnvs')
17
- const findPrivateKey = require('./../helpers/findPrivateKey')
17
+ const { findPrivateKey } = require('./../helpers/findPrivateKey')
18
18
  const decryptKeyValue = require('./../helpers/decryptKeyValue')
19
19
  const keypair = require('./../helpers/keypair')
20
20
 
@@ -11,7 +11,7 @@ const Errors = require('./../helpers/errors')
11
11
  const dotenvParse = require('./../helpers/dotenvParse')
12
12
  const parseEnvironmentFromDotenvKey = require('./../helpers/parseEnvironmentFromDotenvKey')
13
13
  const detectEncoding = require('./../helpers/detectEncoding')
14
- const findPrivateKey = require('./../helpers/findPrivateKey')
14
+ const { findPrivateKey } = require('./../helpers/findPrivateKey')
15
15
  const guessPrivateKeyName = require('./../helpers/guessPrivateKeyName')
16
16
  const determineEnvs = require('./../helpers/determineEnvs')
17
17
 
@@ -12,7 +12,7 @@ const replace = require('./../helpers/replace')
12
12
  const dotenvParse = require('./../helpers/dotenvParse')
13
13
  const detectEncoding = require('./../helpers/detectEncoding')
14
14
  const determineEnvs = require('./../helpers/determineEnvs')
15
- const findPrivateKey = require('./../helpers/findPrivateKey')
15
+ const { findPrivateKey } = require('./../helpers/findPrivateKey')
16
16
  const findPublicKey = require('./../helpers/findPublicKey')
17
17
  const keypair = require('./../helpers/keypair')
18
18
  const truncate = require('./../helpers/truncate')
@@ -22,6 +22,8 @@ const verbose = getColor('plum')
22
22
  const debug = getColor('plum')
23
23
 
24
24
  let currentLevel = levels.info // default log level
25
+ let currentName = 'dotenvx' // default logger name
26
+ let currentVersion = packageJson.version // default logger version
25
27
 
26
28
  function stderr (level, message) {
27
29
  const formattedMessage = formatMessage(level, message)
@@ -53,7 +55,7 @@ function formatMessage (level, message) {
53
55
  case 'success':
54
56
  return success(formattedMessage)
55
57
  case 'successv': // success with 'version'
56
- return successv(`[dotenvx@${packageJson.version}] ${formattedMessage}`)
58
+ return successv(`[${currentName}@${currentVersion}] ${formattedMessage}`)
57
59
  // info
58
60
  case 'info':
59
61
  return formattedMessage
@@ -93,6 +95,14 @@ const logger = {
93
95
  currentLevel = levels[level]
94
96
  logger.level = level
95
97
  }
98
+ },
99
+ setName: (name) => {
100
+ currentName = name
101
+ logger.name = name
102
+ },
103
+ setVersion: (version) => {
104
+ currentVersion = version
105
+ logger.version = version
96
106
  }
97
107
  }
98
108
 
@@ -113,9 +123,23 @@ function setLogLevel (options) {
113
123
  }
114
124
  }
115
125
 
126
+ function setLogName (options) {
127
+ const logName = options.logName
128
+ if (!logName) return
129
+ logger.setName(logName)
130
+ }
131
+
132
+ function setLogVersion (options) {
133
+ const logVersion = options.logVersion
134
+ if (!logVersion) return
135
+ logger.setVersion(logVersion)
136
+ }
137
+
116
138
  module.exports = {
117
139
  logger,
118
140
  getColor,
119
141
  setLogLevel,
142
+ setLogName,
143
+ setLogVersion,
120
144
  levels
121
145
  }