@dotenvx/dotenvx 1.30.1 β†’ 1.31.1

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,20 @@
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.30.1...main)
5
+ [Unreleased](https://github.com/dotenvx/dotenvx/compare/v1.31.1...main)
6
+
7
+ ## [1.31.1](https://github.com/dotenvx/dotenvx/compare/v1.31.0...v1.31.1)
8
+
9
+ ### Changed
10
+
11
+ * 🐞 fix encryption of values containing explicit `\n` newlines ([#495](https://github.com/dotenvx/dotenvx/pull/495))
12
+
13
+ ## [1.31.0](https://github.com/dotenvx/dotenvx/compare/v1.30.1...v1.31.0)
14
+
15
+ ### Added
16
+
17
+ * expose `main.set` function ([#492](https://github.com/dotenvx/dotenvx/pull/492))
18
+ * add missing types for `main.config` ([#491](https://github.com/dotenvx/dotenvx/pull/491))
6
19
 
7
20
  ## [1.30.1](https://github.com/dotenvx/dotenvx/compare/v1.30.0...v1.30.1)
8
21
 
package/README.md CHANGED
@@ -80,7 +80,7 @@ tar -xzf dotenvx.tar.gz
80
80
  </details>
81
81
 
82
82
 
83
- <details><summary>or with windows 🟦🟩πŸŸ₯🟨</summary><br>
83
+ <details><summary>or with windows πŸͺŸ</summary><br>
84
84
 
85
85
  ```sh
86
86
  winget install dotenvx
@@ -2081,6 +2081,17 @@ More examples
2081
2081
  Hello World
2082
2082
  ```
2083
2083
  </details>
2084
+ * <details><summary>`set(KEY, value)`</summary><br>
2085
+
2086
+ Programatically set an environment variable.
2087
+
2088
+ ```js
2089
+ // index.js
2090
+ const dotenvx = require('@dotenvx/dotenvx')
2091
+ dotenvx.set('HELLO', 'World', { path: '.env' })
2092
+ ```
2093
+
2094
+ </details>
2084
2095
 
2085
2096
  &nbsp;
2086
2097
 
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.30.1",
2
+ "version": "1.31.1",
3
3
  "name": "@dotenvx/dotenvx",
4
4
  "description": "a better dotenv–from the creator of `dotenv`",
5
5
  "author": "@motdotla",
@@ -28,7 +28,6 @@
28
28
  "standard:fix": "standard --fix",
29
29
  "test": "tap run --allow-empty-coverage --disable-coverage --timeout=60000",
30
30
  "test-coverage": "tap run --show-full-coverage --timeout=60000",
31
- "test-single": "tap run --coverage-report=none tests/cli/actions/decrypt.test.js",
32
31
  "testshell": "bash shellspec",
33
32
  "prerelease": "npm test && npm run testshell",
34
33
  "release": "standard-version"
@@ -53,7 +52,7 @@
53
52
  "sinon": "^14.0.1",
54
53
  "standard": "^17.1.0",
55
54
  "standard-version": "^9.5.0",
56
- "tap": "^19.2.0"
55
+ "tap": "^21.0.1"
57
56
  },
58
57
  "publishConfig": {
59
58
  "access": "public",
@@ -0,0 +1,33 @@
1
+ const path = require('path')
2
+
3
+ const conventions = require('./conventions')
4
+ const dotenvOptionPaths = require('./dotenvOptionPaths')
5
+ const DeprecationNotice = require('./deprecationNotice')
6
+
7
+ function buildEnvs (options, DOTENV_KEY = undefined) {
8
+ // build envs using user set option.path
9
+ const optionPaths = dotenvOptionPaths(options) // [ '.env' ]
10
+
11
+ let envs = []
12
+ if (options.convention) { // handle shorthand conventions
13
+ envs = conventions(options.convention).concat(envs)
14
+ }
15
+
16
+ new DeprecationNotice({ DOTENV_KEY }).dotenvKey() // DEPRECATION NOTICE
17
+
18
+ for (const optionPath of optionPaths) {
19
+ // if DOTENV_KEY is set then assume we are checking envVaultFile
20
+ if (DOTENV_KEY) {
21
+ envs.push({
22
+ type: 'envVaultFile',
23
+ value: path.join(path.dirname(optionPath), '.env.vault')
24
+ })
25
+ } else {
26
+ envs.push({ type: 'envFile', value: optionPath })
27
+ }
28
+ }
29
+
30
+ return envs
31
+ }
32
+
33
+ module.exports = buildEnvs
@@ -0,0 +1,43 @@
1
+ // historical dotenv.parse - https://github.com/motdotla/dotenv)
2
+ const LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg
3
+
4
+ function dotenvParse (src, skipExpandForDoubleQuotes = false) {
5
+ const obj = {}
6
+
7
+ // Convert buffer to string
8
+ let lines = src.toString()
9
+
10
+ // Convert line breaks to same format
11
+ lines = lines.replace(/\r\n?/mg, '\n')
12
+
13
+ let match
14
+ while ((match = LINE.exec(lines)) != null) {
15
+ const key = match[1]
16
+
17
+ // Default undefined or null to empty string
18
+ let value = (match[2] || '')
19
+
20
+ // Remove whitespace
21
+ value = value.trim()
22
+
23
+ // Check if double quoted
24
+ const maybeQuote = value[0]
25
+
26
+ // Remove surrounding quotes
27
+ value = value.replace(/^(['"`])([\s\S]*)\1$/mg, '$2')
28
+
29
+ // Expand newlines if double quoted
30
+ if (maybeQuote === '"' && !skipExpandForDoubleQuotes) {
31
+ value = value.replace(/\\n/g, '\n') // newline
32
+ value = value.replace(/\\r/g, '\r') // carriage return
33
+ value = value.replace(/\\t/g, '\t') // tabs
34
+ }
35
+
36
+ // Add to object
37
+ obj[key] = value
38
+ }
39
+
40
+ return obj
41
+ }
42
+
43
+ module.exports = dotenvParse
@@ -1,4 +1,3 @@
1
- const fsx = require('./fsx')
2
1
  const path = require('path')
3
2
  const childProcess = require('child_process')
4
3
  const { logger } = require('../../shared/logger')
@@ -27,7 +26,29 @@ function executeDynamic (program, command, rawArgs) {
27
26
  // logger.warn(`[INSTALLATION_NEEDED] install dotenvx-${command} to use [dotenvx ${command}] commands πŸ†`)
28
27
  // logger.help('? see installation instructions [https://github.com/dotenvx/dotenvx-pro]')
29
28
 
30
- const pro = fsx.readFileX(path.join(__dirname, './../../cli/pro.txt'))
29
+ const pro = `_______________________________________________________________
30
+ | |
31
+ | coming soon! (for small business) |
32
+ | |
33
+ | | | | | |
34
+ | __| | ___ | |_ ___ _ ____ ____ __ _ __ _ __ ___ |
35
+ | / _\` |/ _ \\| __/ _ \\ '_ \\ \\ / /\\ \\/ / | '_ \\| '__/ _ \\ |
36
+ | | (_| | (_) | || __/ | | \\ V / > < | |_) | | | (_) | |
37
+ | \\__,_|\\___/ \\__\\___|_| |_|\\_/ /_/\\_\\ | .__/|_| \\___/ |
38
+ | | | |
39
+ | |_| |
40
+ | ## learn more on github πŸ™ |
41
+ | |
42
+ | >> https://github.com/dotenvx/dotenvx/issues/259 |
43
+ | |
44
+ | ## subscribe on github to be notified πŸ“£ |
45
+ | |
46
+ | >> https://github.com/dotenvx/dotenvx/issues/259 |
47
+ | |
48
+ | ----------------------------------------------------------- |
49
+ | - thank you for using dotenvx! - @motdotla |
50
+ |_____________________________________________________________|`
51
+
31
52
  console.log(pro)
32
53
  } else {
33
54
  logger.info(`error: unknown command '${command}'`)
@@ -1,10 +1,9 @@
1
- const dotenv = require('dotenv')
2
-
1
+ const dotenvParse = require('./dotenvParse')
3
2
  const isEncrypted = require('./isEncrypted')
4
3
  const isPublicKey = require('./isPublicKey')
5
4
 
6
5
  function isFullyEncrypted (src) {
7
- const parsed = dotenv.parse(src)
6
+ const parsed = dotenvParse(src)
8
7
 
9
8
  for (const [key, value] of Object.entries(parsed)) {
10
9
  const result = isEncrypted(value) || isPublicKey(key, value)
@@ -1,6 +1,5 @@
1
- const dotenv = require('dotenv')
2
-
3
1
  const quotes = require('./quotes')
2
+ const dotenvParse = require('./dotenvParse')
4
3
  const escapeForRegex = require('./escapeForRegex')
5
4
  const escapeDollarSigns = require('./escapeDollarSigns')
6
5
 
@@ -8,7 +7,7 @@ function replace (src, key, replaceValue) {
8
7
  let output
9
8
  let newPart = ''
10
9
 
11
- const parsed = dotenv.parse(src)
10
+ const parsed = dotenvParse(src, true) // skip expanding \n
12
11
  const _quotes = quotes(src)
13
12
  if (Object.prototype.hasOwnProperty.call(parsed, key)) {
14
13
  const quote = _quotes[key]
@@ -1,10 +1,10 @@
1
1
  const fsx = require('./fsx')
2
2
  const path = require('path')
3
- const dotenv = require('dotenv')
4
3
 
5
4
  const PUBLIC_KEY_SCHEMA = 'DOTENV_PUBLIC_KEY'
6
5
  const PRIVATE_KEY_SCHEMA = 'DOTENV_PRIVATE_KEY'
7
6
 
7
+ const dotenvParse = require('./dotenvParse')
8
8
  const guessPrivateKeyName = require('./guessPrivateKeyName')
9
9
 
10
10
  function searchProcessEnv (privateKeyName) {
@@ -21,7 +21,7 @@ function searchKeysFile (privateKeyName, envFilepath, envKeysFilepath = null) {
21
21
 
22
22
  if (fsx.existsSync(keysFilepath)) {
23
23
  const keysSrc = fsx.readFileX(keysFilepath)
24
- const keysParsed = dotenv.parse(keysSrc)
24
+ const keysParsed = dotenvParse(keysSrc)
25
25
 
26
26
  if (keysParsed[privateKeyName] && keysParsed[privateKeyName].length > 0) {
27
27
  return keysParsed[privateKeyName]
@@ -35,7 +35,7 @@ function invertForPrivateKeyName (envFilepath) {
35
35
  }
36
36
 
37
37
  const envSrc = fsx.readFileX(envFilepath)
38
- const envParsed = dotenv.parse(envSrc)
38
+ const envParsed = dotenvParse(envSrc)
39
39
 
40
40
  let publicKeyName
41
41
  for (const keyName of Object.keys(envParsed)) {
@@ -1,5 +1,5 @@
1
1
  const fsx = require('./fsx')
2
- const dotenv = require('dotenv')
2
+ const dotenvParse = require('./dotenvParse')
3
3
 
4
4
  const guessPublicKeyName = require('./guessPublicKeyName')
5
5
 
@@ -12,7 +12,7 @@ function searchProcessEnv (publicKeyName) {
12
12
  function searchEnvFile (publicKeyName, envFilepath) {
13
13
  if (fsx.existsSync(envFilepath)) {
14
14
  const keysSrc = fsx.readFileX(envFilepath)
15
- const keysParsed = dotenv.parse(keysSrc)
15
+ const keysParsed = dotenvParse(keysSrc)
16
16
 
17
17
  if (keysParsed[publicKeyName] && keysParsed[publicKeyName].length > 0) {
18
18
  return keysParsed[publicKeyName]
package/src/lib/main.d.ts CHANGED
@@ -41,7 +41,7 @@ export interface DotenvParseOutput {
41
41
  *
42
42
  * @see https://dotenvx.com/docs
43
43
  * @param src - contents to be parsed. example: `'DB_HOST=localhost'`
44
- * @param options - additional options. example: `{ prcoessEnv: {}, privateKey: '<privateKey>', overload: false }`
44
+ * @param options - additional options. example: `{ processEnv: {}, privateKey: '<privateKey>', overload: false }`
45
45
  * @returns an object with keys and values based on `src`. example: `{ DB_HOST : 'localhost' }`
46
46
  */
47
47
  export function parse<T extends DotenvParseOutput = DotenvParseOutput>(
@@ -82,6 +82,21 @@ export interface DotenvConfigOptions {
82
82
  */
83
83
  override?: boolean;
84
84
 
85
+ /**
86
+ * Throw immediately if an error is encountered - like a missing .env file.
87
+ * @default false
88
+ * @example require('@dotenvx/dotenvx').config({ strict: true })
89
+ */
90
+ strict?: boolean;
91
+
92
+ /**
93
+ * Suppress specific errors like MISSING_ENV_FILE. The error keys can be found
94
+ * in src/lib/helpers/errors.js
95
+ * @default []
96
+ * @example require('@dotenvx/dotenvx').config({ ignore: ['MISSING_ENV_FILE'] })
97
+ */
98
+ ignore?: string[];
99
+
85
100
  /**
86
101
  * Specify an object to write your secrets to. Defaults to process.env environment variables.
87
102
  *
@@ -90,6 +105,13 @@ export interface DotenvConfigOptions {
90
105
  */
91
106
  processEnv?: DotenvPopulateInput;
92
107
 
108
+ /**
109
+ * Customize the path to your .env.keys file. This is useful with monorepos.
110
+ * @default []
111
+ * @example require('@dotenvx/dotenvx').config({ envKeysFile: '../../.env.keys'} })
112
+ */
113
+ envKeysFile?: string;
114
+
93
115
  /**
94
116
  * Pass the DOTENV_KEY directly to config options. Defaults to looking for process.env.DOTENV_KEY environment variable. Note this only applies to decrypting .env.vault files. If passed as null or undefined, or not passed at all, dotenv falls back to its traditional job of parsing a .env file.
95
117
  *
@@ -158,6 +180,59 @@ export interface DotenvPopulateInput {
158
180
  */
159
181
  export function config(options?: DotenvConfigOptions): DotenvConfigOutput;
160
182
 
183
+ export interface SetOptions {
184
+ /**
185
+ * Specify a custom path if your file containing environment variables is located elsewhere.
186
+ * Can also be an array of strings, specifying multiple paths.
187
+ *
188
+ * @default require('path').resolve(process.cwd(), '.env')
189
+ * @example require('@dotenvx/dotenvx').set(key, value, { path: '/custom/path/to/.env' })
190
+ * @example require('@dotenvx/dotenvx').set(key, value, { path: ['/path/to/first.env', '/path/to/second.env'] })
191
+ */
192
+ path?: string | string[] | URL;
193
+
194
+ /**
195
+ * Customize the path to your .env.keys file. This is useful with monorepos.
196
+ * @default []
197
+ * @example require('@dotenvx/dotenvx').config(key, value, { envKeysFile: '../../.env.keys'} })
198
+ */
199
+ envKeysFile?: string;
200
+
201
+ /**
202
+ * Set a .env convention (available conventions: 'nextjs')
203
+ */
204
+ convention?: string;
205
+ }
206
+
207
+ export type SetOutput = {
208
+ key: string;
209
+ value: string;
210
+ filepath: string;
211
+ envFilepath: string;
212
+ envSrc: string;
213
+ changed: boolean;
214
+ encryptedValue?: string;
215
+ publicKey?: string;
216
+ privateKey?: string;
217
+ privateKeyAdded?: boolean;
218
+ privateKeyName?: string;
219
+ error?: Error;
220
+ };
221
+
222
+ /**
223
+ * Set a single environment variable.
224
+ *
225
+ * @see https://dotenvx.com/docs
226
+ * @param key - KEY
227
+ * @param value - value
228
+ * @param options - additional options. example: `{ encrypt: false }`
229
+ */
230
+ export function set(
231
+ key: string,
232
+ value: string,
233
+ options?: SetOptions
234
+ ): SetOutput;
235
+
161
236
  /**
162
237
  * List all env files in the current working directory
163
238
  *
package/src/lib/main.js CHANGED
@@ -8,14 +8,13 @@ const { getColor, bold } = require('./../shared/colors')
8
8
  // services
9
9
  const Ls = require('./services/ls')
10
10
  const Run = require('./services/run')
11
+ const Sets = require('./services/sets')
11
12
  const Keypair = require('./services/keypair')
12
13
  const Genexample = require('./services/genexample')
13
14
 
14
15
  // helpers
15
- const conventions = require('./helpers/conventions')
16
- const dotenvOptionPaths = require('./helpers/dotenvOptionPaths')
16
+ const buildEnvs = require('./helpers/buildEnvs')
17
17
  const Parse = require('./helpers/parse')
18
- const DeprecationNotice = require('./helpers/deprecationNotice')
19
18
 
20
19
  /** @type {import('./main').config} */
21
20
  const config = function (options = {}) {
@@ -45,30 +44,8 @@ const config = function (options = {}) {
45
44
 
46
45
  if (options) setLogLevel(options)
47
46
 
48
- // build envs using user set option.path
49
- const optionPaths = dotenvOptionPaths(options) // [ '.env' ]
50
-
51
47
  try {
52
- let envs = []
53
- // handle shorthand conventions - like --convention=nextjs
54
- if (options.convention) {
55
- envs = conventions(options.convention).concat(envs)
56
- }
57
-
58
- new DeprecationNotice({ DOTENV_KEY }).dotenvKey() // DEPRECATION NOTICE
59
-
60
- for (const optionPath of optionPaths) {
61
- // if DOTENV_KEY is set then assume we are checking envVaultFile
62
- if (DOTENV_KEY) {
63
- envs.push({
64
- type: 'envVaultFile',
65
- value: path.join(path.dirname(optionPath), '.env.vault')
66
- })
67
- } else {
68
- envs.push({ type: 'envFile', value: optionPath })
69
- }
70
- }
71
-
48
+ const envs = buildEnvs(options, DOTENV_KEY)
72
49
  const {
73
50
  processedEnvs,
74
51
  readableFilepaths,
@@ -182,6 +159,25 @@ const parse = function (src, options = {}) {
182
159
  return parsed
183
160
  }
184
161
 
162
+ /* @type {import('./main').set} */
163
+ const set = function (key, value, options = {}) {
164
+ // encrypt
165
+ let encrypt = true
166
+ if (options.plain) {
167
+ encrypt = false
168
+ } else if (options.encrypt === false) {
169
+ encrypt = false
170
+ }
171
+
172
+ // envKeysFile
173
+ const envKeysFile = options.envKeysFile
174
+
175
+ // envs
176
+ const envs = buildEnvs(options)
177
+
178
+ return new Sets(key, value, envs, encrypt, envKeysFile).run()
179
+ }
180
+
185
181
  /** @type {import('./main').ls} */
186
182
  const ls = function (directory, envFile, excludeEnvFile) {
187
183
  return new Ls(directory, envFile, excludeEnvFile).run()
@@ -207,6 +203,7 @@ module.exports = {
207
203
  config,
208
204
  parse,
209
205
  // actions related
206
+ set,
210
207
  ls,
211
208
  keypair,
212
209
  genexample,
@@ -1,6 +1,5 @@
1
1
  const fsx = require('./../helpers/fsx')
2
2
  const path = require('path')
3
- const dotenv = require('dotenv')
4
3
  const picomatch = require('picomatch')
5
4
 
6
5
  const TYPE_ENV_FILE = 'envFile'
@@ -10,6 +9,7 @@ const guessPrivateKeyName = require('./../helpers/guessPrivateKeyName')
10
9
  const findPrivateKey = require('./../helpers/findPrivateKey')
11
10
  const decryptKeyValue = require('./../helpers/decryptKeyValue')
12
11
  const isEncrypted = require('./../helpers/isEncrypted')
12
+ 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')
@@ -63,7 +63,7 @@ class Decrypt {
63
63
  try {
64
64
  const encoding = this._detectEncoding(filepath)
65
65
  let envSrc = fsx.readFileX(filepath, { encoding })
66
- const envParsed = dotenv.parse(envSrc)
66
+ const envParsed = dotenvParse(envSrc)
67
67
 
68
68
  const privateKey = findPrivateKey(envFilepath, this.envKeysFilepath)
69
69
  const privateKeyName = guessPrivateKeyName(envFilepath)
@@ -1,6 +1,5 @@
1
1
  const fsx = require('./../helpers/fsx')
2
2
  const path = require('path')
3
- const dotenv = require('dotenv')
4
3
  const picomatch = require('picomatch')
5
4
 
6
5
  const TYPE_ENV_FILE = 'envFile'
@@ -10,6 +9,7 @@ const guessPrivateKeyName = require('./../helpers/guessPrivateKeyName')
10
9
  const guessPublicKeyName = require('./../helpers/guessPublicKeyName')
11
10
  const encryptValue = require('./../helpers/encryptValue')
12
11
  const isEncrypted = require('./../helpers/isEncrypted')
12
+ 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')
@@ -69,7 +69,7 @@ class Encrypt {
69
69
  try {
70
70
  const encoding = this._detectEncoding(filepath)
71
71
  let envSrc = fsx.readFileX(filepath, { encoding })
72
- const envParsed = dotenv.parse(envSrc)
72
+ const envParsed = dotenvParse(envSrc)
73
73
 
74
74
  let publicKey
75
75
  let privateKey
@@ -173,6 +173,7 @@ class Encrypt {
173
173
  row.keys.push(key) // track key(s)
174
174
 
175
175
  const encryptedValue = encryptValue(value, publicKey)
176
+
176
177
  // once newSrc is built write it out
177
178
  envSrc = replace(envSrc, key, encryptedValue)
178
179
 
@@ -1,10 +1,10 @@
1
1
  const fsx = require('./../helpers/fsx')
2
2
  const path = require('path')
3
- const dotenv = require('dotenv')
4
3
 
5
4
  const Errors = require('../helpers/errors')
6
5
  const findEnvFiles = require('../helpers/findEnvFiles')
7
6
  const replace = require('../helpers/replace')
7
+ const dotenvParse = require('../helpers/dotenvParse')
8
8
 
9
9
  class Genexample {
10
10
  constructor (directory = '.', envFile) {
@@ -47,7 +47,7 @@ class Genexample {
47
47
 
48
48
  // get the original src
49
49
  let src = fsx.readFileX(filepath)
50
- const parsed = dotenv.parse(src)
50
+ const parsed = dotenvParse(src)
51
51
  for (const key in parsed) {
52
52
  // used later
53
53
  keys.add(key)
@@ -72,7 +72,7 @@ class Genexample {
72
72
  // it already exists (which means the user might have it modified a way in which they prefer, so replace exampleSrc with their existing .env.example)
73
73
  exampleSrc = fsx.readFileX(this.exampleFilepath)
74
74
 
75
- const parsed = dotenv.parse(exampleSrc)
75
+ const parsed = dotenvParse(exampleSrc)
76
76
  for (const key of [...keys]) {
77
77
  if (key in parsed) {
78
78
  preExisted[key] = parsed[key]
@@ -1,6 +1,5 @@
1
1
  const fsx = require('./../helpers/fsx')
2
2
  const path = require('path')
3
- const dotenv = require('dotenv')
4
3
 
5
4
  const TYPE_ENV = 'env'
6
5
  const TYPE_ENV_FILE = 'envFile'
@@ -9,6 +8,7 @@ const TYPE_ENV_VAULT_FILE = 'envVaultFile'
9
8
  const decrypt = require('./../helpers/decrypt')
10
9
  const Parse = require('./../helpers/parse')
11
10
  const Errors = require('./../helpers/errors')
11
+ const dotenvParse = require('./../helpers/dotenvParse')
12
12
  const parseEnvironmentFromDotenvKey = require('./../helpers/parseEnvironmentFromDotenvKey')
13
13
  const detectEncoding = require('./../helpers/detectEncoding')
14
14
  const findPrivateKey = require('./../helpers/findPrivateKey')
@@ -196,7 +196,7 @@ class Run {
196
196
  // { "DOTENV_VAULT_DEVELOPMENT": "<ciphertext>" }
197
197
  _parsedVault (filepath) {
198
198
  const src = fsx.readFileX(filepath)
199
- return dotenv.parse(src)
199
+ return dotenvParse(src)
200
200
  }
201
201
 
202
202
  _decrypted (dotenvKey, parsedVault) {
@@ -1,6 +1,5 @@
1
1
  const fsx = require('./../helpers/fsx')
2
2
  const path = require('path')
3
- const dotenv = require('dotenv')
4
3
 
5
4
  const TYPE_ENV_FILE = 'envFile'
6
5
 
@@ -10,6 +9,7 @@ const guessPublicKeyName = require('./../helpers/guessPublicKeyName')
10
9
  const encryptValue = require('./../helpers/encryptValue')
11
10
  const decryptKeyValue = require('./../helpers/decryptKeyValue')
12
11
  const replace = require('./../helpers/replace')
12
+ const dotenvParse = require('./../helpers/dotenvParse')
13
13
  const detectEncoding = require('./../helpers/detectEncoding')
14
14
  const determineEnvs = require('./../helpers/determineEnvs')
15
15
  const findPrivateKey = require('./../helpers/findPrivateKey')
@@ -66,7 +66,7 @@ class Sets {
66
66
  try {
67
67
  const encoding = this._detectEncoding(filepath)
68
68
  let envSrc = fsx.readFileX(filepath, { encoding })
69
- const envParsed = dotenv.parse(envSrc)
69
+ const envParsed = dotenvParse(envSrc)
70
70
  row.originalValue = envParsed[row.key] || null
71
71
  const wasPlainText = !isEncrypted(row.originalValue)
72
72
  this.readableFilepaths.add(envFilepath)
package/src/cli/pro.txt DELETED
@@ -1,22 +0,0 @@
1
- _______________________________________________________________
2
- | |
3
- | coming soon! (for small business) |
4
- | |
5
- | | | | | |
6
- | __| | ___ | |_ ___ _ ____ ____ __ _ __ _ __ ___ |
7
- | / _` |/ _ \| __/ _ \ '_ \ \ / /\ \/ / | '_ \| '__/ _ \ |
8
- | | (_| | (_) | || __/ | | \ V / > < | |_) | | | (_) | |
9
- | \__,_|\___/ \__\___|_| |_|\_/ /_/\_\ | .__/|_| \___/ |
10
- | | | |
11
- | |_| |
12
- | ## learn more on github πŸ™ |
13
- | |
14
- | >> https://github.com/dotenvx/dotenvx/issues/259 |
15
- | |
16
- | ## subscribe on github to be notified πŸ“£ |
17
- | |
18
- | >> https://github.com/dotenvx/dotenvx/issues/259 |
19
- | |
20
- | ----------------------------------------------------------- |
21
- | - thank you for using dotenvx! - @motdotla |
22
- |_____________________________________________________________|