@dotenvx/dotenvx 1.38.3 β 1.38.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 +13 -1
- package/README.md +19 -1
- package/package.json +1 -1
- package/src/lib/config.d.ts +1 -0
- package/src/lib/helpers/replace.js +9 -0
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.38.
|
|
5
|
+
[Unreleased](https://github.com/dotenvx/dotenvx/compare/v1.38.5...main)
|
|
6
|
+
|
|
7
|
+
## [1.38.5](https://github.com/dotenvx/dotenvx/compare/v1.38.4...v1.38.5)
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
* π Add `config.d.ts` file to fix type error when loading `dotenvx/dotenvx/config` with dynamic import ([#547](https://github.com/dotenvx/dotenvx/pull/547))
|
|
12
|
+
|
|
13
|
+
## [1.38.4](https://github.com/dotenvx/dotenvx/compare/v1.38.3...v1.38.4)
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
* π Fix blank line disappearing after encrypting empty value ([#542](https://github.com/dotenvx/dotenvx/pull/542))
|
|
6
18
|
|
|
7
19
|
## [1.38.3](https://github.com/dotenvx/dotenvx/compare/v1.38.2...v1.38.3)
|
|
8
20
|
|
package/README.md
CHANGED
|
@@ -741,6 +741,10 @@ More examples
|
|
|
741
741
|
> Become a `dotenvx` power user.
|
|
742
742
|
>
|
|
743
743
|
|
|
744
|
+
### CLI π
|
|
745
|
+
|
|
746
|
+
Advanced CLI commands.
|
|
747
|
+
|
|
744
748
|
* <details><summary>`run` - Variable Expansion</summary><br>
|
|
745
749
|
|
|
746
750
|
Reference and expand variables already on your machine for use in your .env file.
|
|
@@ -1875,6 +1879,8 @@ More examples
|
|
|
1875
1879
|
|
|
1876
1880
|
### Extensions π
|
|
1877
1881
|
|
|
1882
|
+
CLI extensions.
|
|
1883
|
+
|
|
1878
1884
|
* <details><summary>`ext genexample`</summary><br>
|
|
1879
1885
|
|
|
1880
1886
|
In one command, generate a `.env.example` file from your current `.env` file contents.
|
|
@@ -2006,7 +2012,9 @@ More examples
|
|
|
2006
2012
|
|
|
2007
2013
|
</details>
|
|
2008
2014
|
|
|
2009
|
-
###
|
|
2015
|
+
### Library π¦
|
|
2016
|
+
|
|
2017
|
+
Use dotenvx directly in code.
|
|
2010
2018
|
|
|
2011
2019
|
* <details><summary>`config()`</summary><br>
|
|
2012
2020
|
|
|
@@ -2228,6 +2236,16 @@ More examples
|
|
|
2228
2236
|
|
|
2229
2237
|
</details>
|
|
2230
2238
|
|
|
2239
|
+
## Whitepaper
|
|
2240
|
+
|
|
2241
|
+
> **Dotenvx: Reducing Secrets Risk with Cryptographic Separation**
|
|
2242
|
+
>
|
|
2243
|
+
> Abstract. An ideal secrets solution would not only centralize secrets but also contain the fallout of a breach. While secrets managers offer centralized storage and distribution, their design creates a large blast radius, risking exposure of thousands or even millions of secrets. We propose a solution that reduces the blast radius by splitting secrets management into two distinct components: an encrypted secrets file and a separate decryption key.
|
|
2244
|
+
>
|
|
2245
|
+
> ...
|
|
2246
|
+
>
|
|
2247
|
+
> [Read the whitepaper](https://dotenvx.com/dotenvx.pdf)
|
|
2248
|
+
|
|
2231
2249
|
|
|
2232
2250
|
|
|
2233
2251
|
## Guides
|
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -20,6 +20,15 @@ function replace (src, key, replaceValue) {
|
|
|
20
20
|
let enforceEndOfLine = ''
|
|
21
21
|
if (escapedOriginalValue === '') {
|
|
22
22
|
enforceEndOfLine = '$' // EMPTY scenario
|
|
23
|
+
|
|
24
|
+
// if empty quote and consecutive newlines
|
|
25
|
+
const newlineMatch = src.match(new RegExp(`${key}\\s*=\\s*\n\n`, 'm')) // match any consecutive newline scenario for a blank value
|
|
26
|
+
if (quote === '' && newlineMatch) {
|
|
27
|
+
const newlineCount = (newlineMatch[0].match(/\n/g)).length - 1
|
|
28
|
+
for (let i = 0; i < newlineCount; i++) {
|
|
29
|
+
newPart += '\n' // re-append the extra newline to preserve user's format choice
|
|
30
|
+
}
|
|
31
|
+
}
|
|
23
32
|
}
|
|
24
33
|
|
|
25
34
|
const currentPart = new RegExp(
|