@dotenvx/dotenvx 2.3.2 → 2.3.4

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/v2.3.2...main)
5
+ [Unreleased](https://github.com/dotenvx/dotenvx/compare/v2.3.4...main)
6
+
7
+ ## [2.3.4](https://github.com/dotenvx/dotenvx/compare/v2.3.3...v2.3.4) (2026-07-09)
8
+
9
+ ### Removed
10
+
11
+ * Replace various deps with `@dotenvx/tooling` ([#879](https://github.com/dotenvx/dotenvx/pull/879))
12
+
13
+ ## [2.3.3](https://github.com/dotenvx/dotenvx/compare/v2.3.2...v2.3.3) (2026-07-09)
14
+
15
+ ### Removed
16
+
17
+ * Remove `dotenv` and `commander` for `@dotenvx/tooling` ([#878](https://github.com/dotenvx/dotenvx/pull/878))
6
18
 
7
19
  ## [2.3.2](https://github.com/dotenvx/dotenvx/compare/v2.3.1...v2.3.2) (2026-07-09)
8
20
 
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.3.2",
2
+ "version": "2.3.4",
3
3
  "name": "@dotenvx/dotenvx",
4
4
  "description": "a secure dotenv–from the creator of `dotenv`",
5
5
  "author": "@motdotla",
@@ -43,23 +43,9 @@
43
43
  },
44
44
  "funding": "https://dotenvx.com",
45
45
  "dependencies": {
46
- "@dotenvx/primitives": "^1.7.2",
47
- "commander": "^11.1.0",
48
- "conf": "^10.2.0",
49
- "dotenv": "^17.4.2",
50
- "enquirer": "^2.4.1",
51
- "env-paths": "^2.2.1",
52
- "execa": "^5.1.1",
53
- "fdir": "^6.2.0",
54
- "ignore": "^7.0.5",
55
- "object-treeify": "1.1.33",
56
- "open": "^8.4.2",
57
- "picomatch": "^4.0.4",
58
- "synckit": "0.11.13",
59
- "systeminformation": "^5.31.11",
60
- "undici": "^7.11.0",
61
- "which": "^6.0.1",
62
- "yocto-spinner": "^1.2.0"
46
+ "@dotenvx/primitives": "^1.8.1",
47
+ "@dotenvx/tooling": "^1.0.2",
48
+ "yocto-spinner": "^1.2.1"
63
49
  },
64
50
  "devDependencies": {
65
51
  "@yao-pkg/pkg": "^6.12.0",
@@ -1,4 +1,4 @@
1
- const treeify = require('object-treeify')
1
+ const { objectTreeify: treeify } = require('@dotenvx/tooling')
2
2
 
3
3
  const { logger } = require('./../../shared/logger')
4
4
 
@@ -1,5 +1,4 @@
1
1
  const executeDynamic = require('./../../lib/helpers/executeDynamic')
2
- const Session = require('./../../db/session')
3
2
 
4
3
  function configureArmorCommand (armor) {
5
4
  armor
@@ -12,77 +11,85 @@ function configureArmorCommand (armor) {
12
11
  return executeDynamic(armor, 'armor', [command, ...(args || [])])
13
12
  }
14
13
 
14
+ const Session = require('./../../db/session')
15
15
  const sesh = new Session()
16
16
  await sesh.notifyUpdate()
17
17
  this.help()
18
18
  })
19
19
 
20
20
  // dotenvx armor up
21
- const upAction = require('./../actions/armor/up')
22
21
  armor
23
22
  .command('up')
24
23
  .description('armor key')
25
24
  .option('-f, --env-file <path>', 'path to your env file')
26
25
  .option('--token <token>', 'set token')
27
26
  .option('--team <team>', 'team to armor private key for')
28
- .action(upAction)
27
+ .action(function (...args) {
28
+ return require('./../actions/armor/up').apply(this, args)
29
+ })
29
30
 
30
31
  // dotenvx armor down
31
- const downAction = require('./../actions/armor/down')
32
32
  armor
33
33
  .command('down')
34
34
  .description('dearmor key')
35
35
  .option('-f, --env-file <path>', 'path to your env file')
36
36
  .option('--token <token>', 'set token')
37
37
  .option('--team <team>', 'team to dearmor private key from')
38
- .action(downAction)
38
+ .action(function (...args) {
39
+ return require('./../actions/armor/down').apply(this, args)
40
+ })
39
41
 
40
42
  // dotenvx armor push
41
- const pushAction = require('./../actions/armor/push')
42
43
  armor
43
44
  .command('push')
44
45
  .description('push armored key (from .env.keys)')
45
46
  .option('-f, --env-file <path>', 'path to your env file')
46
47
  .option('--token <token>', 'set token')
47
48
  .option('--team <team>', 'team to push armored private key for')
48
- .action(pushAction)
49
+ .action(function (...args) {
50
+ return require('./../actions/armor/push').apply(this, args)
51
+ })
49
52
 
50
53
  // dotenvx armor pull
51
- const pullAction = require('./../actions/armor/pull')
52
54
  armor
53
55
  .command('pull')
54
56
  .description('pull armored key (into .env.keys)')
55
57
  .option('-f, --env-file <path>', 'path to your env file')
56
58
  .option('--token <token>', 'set token')
57
59
  .option('--team <team>', 'team to pull armored private key from')
58
- .action(pullAction)
60
+ .action(function (...args) {
61
+ return require('./../actions/armor/pull').apply(this, args)
62
+ })
59
63
 
60
64
  // dotenvx armor move
61
- const moveAction = require('./../actions/armor/move')
62
65
  armor
63
66
  .command('move')
64
67
  .description('move armored key (to other team)')
65
68
  .option('-f, --env-file <path>', 'path to your env file')
66
69
  .option('--token <token>', 'set token')
67
- .action(moveAction)
70
+ .action(function (...args) {
71
+ return require('./../actions/armor/move').apply(this, args)
72
+ })
68
73
 
69
74
  // dotenvx armor login
70
- const loginAction = require('./../actions/login')
71
75
  armor
72
76
  .command('login')
73
77
  .description('log in to Dotenvx Armor')
74
78
  .allowUnknownOption()
75
79
  .option('--hostname <hostname>', 'set Armor ⛨ hostname')
76
- .action(loginAction)
80
+ .action(function (...args) {
81
+ return require('./../actions/login').apply(this, args)
82
+ })
77
83
 
78
84
  // dotenvx armor logout
79
- const logoutAction = require('./../actions/logout')
80
85
  armor
81
86
  .command('logout')
82
87
  .description('log out of Dotenvx Armor')
83
88
  .allowUnknownOption()
84
89
  .option('--hostname <hostname>', 'set Armor ⛨ hostname')
85
- .action(logoutAction)
90
+ .action(function (...args) {
91
+ return require('./../actions/logout').apply(this, args)
92
+ })
86
93
 
87
94
  return armor
88
95
  }
@@ -1,4 +1,4 @@
1
- const { Command } = require('commander')
1
+ const { Command } = require('@dotenvx/tooling')
2
2
 
3
3
  const examples = require('./../examples')
4
4
  const executeExtension = require('../../lib/helpers/executeExtension')
@@ -5,21 +5,23 @@ function configureLockCommand (lock) {
5
5
  this.help()
6
6
  })
7
7
 
8
- const upAction = require('./../actions/lock/up')
9
8
  lock
10
9
  .command('up')
11
10
  .description('lock key in .env.keys')
12
11
  .option('-f, --env-file <path>', 'path to your env file')
13
12
  .option('-fk, --env-keys-file <path>', 'path to your .env.keys file', '.env.keys')
14
- .action(upAction)
13
+ .action(function (...args) {
14
+ return require('./../actions/lock/up').apply(this, args)
15
+ })
15
16
 
16
- const downAction = require('./../actions/lock/down')
17
17
  lock
18
18
  .command('down')
19
19
  .description('unlock key in .env.keys')
20
20
  .option('-f, --env-file <path>', 'path to your env file')
21
21
  .option('-fk, --env-keys-file <path>', 'path to your .env.keys file', '.env.keys')
22
- .action(downAction)
22
+ .action(function (...args) {
23
+ return require('./../actions/lock/down').apply(this, args)
24
+ })
23
25
 
24
26
  return lock
25
27
  }
@@ -5,37 +5,41 @@ function configureNativeCommand (native) {
5
5
  this.help()
6
6
  })
7
7
 
8
- const upAction = require('./../actions/keychain/up')
9
8
  native
10
9
  .command('up')
11
10
  .description('store key in OS secret store')
12
11
  .option('-f, --env-file <path>', 'path to your env file')
13
12
  .option('-fk, --env-keys-file <path>', 'path to your .env.keys file', '.env.keys')
14
- .action(upAction)
13
+ .action(function (...args) {
14
+ return require('./../actions/keychain/up').apply(this, args)
15
+ })
15
16
 
16
- const downAction = require('./../actions/keychain/down')
17
17
  native
18
18
  .command('down')
19
19
  .description('move key from OS secret store to .env.keys')
20
20
  .option('-f, --env-file <path>', 'path to your env file')
21
21
  .option('-fk, --env-keys-file <path>', 'path to your .env.keys file', '.env.keys')
22
- .action(downAction)
22
+ .action(function (...args) {
23
+ return require('./../actions/keychain/down').apply(this, args)
24
+ })
23
25
 
24
- const pushAction = require('./../actions/keychain/push')
25
26
  native
26
27
  .command('push')
27
28
  .description('push key to OS secret store from .env.keys')
28
29
  .option('-f, --env-file <path>', 'path to your env file')
29
30
  .option('-fk, --env-keys-file <path>', 'path to your .env.keys file', '.env.keys')
30
- .action(pushAction)
31
+ .action(function (...args) {
32
+ return require('./../actions/keychain/push').apply(this, args)
33
+ })
31
34
 
32
- const pullAction = require('./../actions/keychain/pull')
33
35
  native
34
36
  .command('pull')
35
37
  .description('pull key from OS secret store into .env.keys')
36
38
  .option('-f, --env-file <path>', 'path to your env file')
37
39
  .option('-fk, --env-keys-file <path>', 'path to your .env.keys file', '.env.keys')
38
- .action(pullAction)
40
+ .action(function (...args) {
41
+ return require('./../actions/keychain/pull').apply(this, args)
42
+ })
39
43
 
40
44
  return native
41
45
  }
@@ -1,14 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  /* c8 ignore start */
4
- const { Command } = require('commander')
4
+ const { Command } = require('@dotenvx/tooling')
5
5
  const program = new Command()
6
6
 
7
- const { setLogLevel, logger } = require('../shared/logger')
7
+ const { setLogLevel } = require('../shared/logger')
8
8
  const examples = require('./examples')
9
9
  const packageJson = require('./../lib/helpers/packageJson')
10
- const Errors = require('./../lib/helpers/errors')
11
- const getCommanderVersion = require('./../lib/helpers/getCommanderVersion')
12
10
  const executeDynamic = require('./../lib/helpers/executeDynamic')
13
11
  const removeDynamicHelpSection = require('./../lib/helpers/removeDynamicHelpSection')
14
12
  const removeOptionsHelpParts = require('./../lib/helpers/removeOptionsHelpParts')
@@ -23,14 +21,6 @@ function collectEnvs (type) {
23
21
  }
24
22
  }
25
23
 
26
- // surface hoisting problems
27
- const commanderVersion = getCommanderVersion()
28
- if (commanderVersion && parseInt(commanderVersion.split('.')[0], 10) >= 12) {
29
- const message = `dotenvx depends on commander@11.x.x but you are attempting to hoist commander@${commanderVersion}`
30
- const error = new Errors({ message }).dangerousDependencyHoist()
31
- logger.error(error.messageWithHelp)
32
- }
33
-
34
24
  // global log levels
35
25
  program
36
26
  .usage('run -- yourcommand')
package/src/db/device.js CHANGED
@@ -1,4 +1,4 @@
1
- const Conf = require('conf')
1
+ const { Conf } = require('@dotenvx/tooling')
2
2
  const { derive, keypair } = require('@dotenvx/primitives')
3
3
 
4
4
  const encryptDeviceValue = require('./../lib/helpers/encryptDeviceValue')
package/src/db/session.js CHANGED
@@ -1,8 +1,6 @@
1
1
  const fs = require('fs')
2
2
  const path = require('path')
3
- const Conf = require('conf')
4
- const dotenv = require('dotenv')
5
- const envPaths = require('env-paths')
3
+ const { Conf, dotenv, envPaths } = require('@dotenvx/tooling')
6
4
 
7
5
  const jsonToEnv = require('./../lib/helpers/jsonToEnv')
8
6
  const packageJson = require('./../lib/helpers/packageJson')
@@ -148,9 +146,9 @@ class Session {
148
146
  }
149
147
 
150
148
  async systemInformation () {
151
- const si = require('systeminformation')
152
- const system = await si.system()
153
- const osInfo = await si.osInfo()
149
+ const { systeminformation } = require('@dotenvx/tooling')
150
+ const system = await systeminformation.system()
151
+ const osInfo = await systeminformation.osInfo()
154
152
 
155
153
  return {
156
154
  system_uuid: system.uuid,
@@ -4,7 +4,6 @@ const ISSUE_BY_CODE = {
4
4
  COMMAND_EXITED_WITH_CODE: 'https://github.com/dotenvx/dotenvx/issues/new',
5
5
  COMMAND_SUBSTITUTION_FAILED: 'https://github.com/dotenvx/dotenvx/issues/532',
6
6
  DECRYPTION_FAILED: 'https://github.com/dotenvx/dotenvx/issues/757',
7
- DANGEROUS_DEPENDENCY_HOIST: 'https://github.com/dotenvx/dotenvx/issues/622',
8
7
  INVALID_COLOR: 'must be 256 colors',
9
8
  INVALID_CONVENTION: 'https://github.com/dotenvx/dotenvx/issues/761',
10
9
  INVALID_PASSPHRASE: 'try again with the correct passphrase',
@@ -98,18 +97,6 @@ class Errors {
98
97
  return e
99
98
  }
100
99
 
101
- dangerousDependencyHoist () {
102
- const code = 'DANGEROUS_DEPENDENCY_HOIST'
103
- const message = `[${code}] your environment has hoisted an incompatible version of a dotenvx dependency: ${this.message}`
104
- const help = `fix: [${ISSUE_BY_CODE[code]}]`
105
-
106
- const e = new Error(message)
107
- e.code = code
108
- e.help = help
109
- e.messageWithHelp = `${message}. ${help}`
110
- return e
111
- }
112
-
113
100
  invalidColor () {
114
101
  const code = 'INVALID_COLOR'
115
102
  const message = `[${code}] Invalid color ${this.color}`
@@ -1,4 +1,4 @@
1
- const execa = require('execa')
1
+ const { execa } = require('@dotenvx/tooling')
2
2
  /* c8 ignore start */
3
3
  const pkgArgs = process.pkg ? { PKG_EXECPATH: '' } : {}
4
4
  /* c8 ignore stop */
@@ -1,5 +1,5 @@
1
1
  const path = require('path')
2
- const which = require('which')
2
+ const { which } = require('@dotenvx/tooling')
3
3
  const execute = require('./../../lib/helpers/execute')
4
4
  const { logger } = require('./../../shared/logger')
5
5
  const Errors = require('./errors')
@@ -1,4 +1,4 @@
1
- const { request } = require('undici')
1
+ const { request } = require('@dotenvx/tooling')
2
2
 
3
3
  async function http (url, opts = {}) {
4
4
  return await request(url, opts)
@@ -1,6 +1,6 @@
1
1
  const path = require('path')
2
2
  const fs = require('fs')
3
- const execa = require('execa')
3
+ const { execa } = require('@dotenvx/tooling')
4
4
  const { scan } = require('@dotenvx/primitives')
5
5
  const canonicalEnvFilename = require('./canonicalEnvFilename')
6
6
  const environment = require('../conventions/environment')
@@ -1,4 +1,4 @@
1
- const open = require('open')
1
+ const { open } = require('@dotenvx/tooling')
2
2
 
3
3
  async function openUrl (url) {
4
4
  return await open(url, { wait: false })
@@ -1,4 +1,4 @@
1
- const Enquirer = require('enquirer')
1
+ const { Enquirer } = require('@dotenvx/tooling')
2
2
 
3
3
  const enquirer = new Enquirer()
4
4
 
@@ -4,7 +4,7 @@ const armorProvider = require('./armor/index')
4
4
  const keychainProvider = require('./keychain/index')
5
5
 
6
6
  function syncArmorProvider (publicKeyHex) {
7
- const { createSyncFn } = require('synckit')
7
+ const { createSyncFn } = require('@dotenvx/tooling')
8
8
  const runProviderSync = createSyncFn(require.resolve('./worker.js'))
9
9
  return runProviderSync(require.resolve('./armor/index'), publicKeyHex)
10
10
  }
@@ -1,4 +1,4 @@
1
- const { runAsWorker } = require('synckit')
1
+ const { runAsWorker } = require('@dotenvx/tooling')
2
2
 
3
3
  runAsWorker(async (providerPath, publicKeyHex) => {
4
4
  const provider = require(providerPath)
@@ -1,6 +1,6 @@
1
- const { fdir: Fdir } = require('fdir')
1
+ const { Fdir } = require('@dotenvx/tooling')
2
2
  const path = require('path')
3
- const picomatch = require('picomatch')
3
+ const { match } = require('@dotenvx/primitives')
4
4
 
5
5
  function patternsFor (value) {
6
6
  if (!Array.isArray(value)) {
@@ -25,8 +25,8 @@ function ls (options = {}) {
25
25
  const excludeEnvFile = options.excludeEnvFile || []
26
26
  const excludePatterns = excludePatternsFor(excludeEnvFile)
27
27
  const excludes = excludePatterns.length > 0 ? ignore.concat(excludePatterns) : ignore
28
- const exclude = picomatch(excludes, { dot: true })
29
- const include = picomatch(patternsFor(envFile), {
28
+ const exclude = match(excludes, { dot: true })
29
+ const include = match(patternsFor(envFile), {
30
30
  dot: true,
31
31
  ignore: excludes
32
32
  })
@@ -1,6 +1,6 @@
1
- const { fdir: Fdir } = require('fdir')
1
+ const { Fdir } = require('@dotenvx/tooling')
2
2
  const path = require('path')
3
- const picomatch = require('picomatch')
3
+ const { match } = require('@dotenvx/primitives')
4
4
  const fsx = require('./../helpers/fsx')
5
5
 
6
6
  const patterns = [
@@ -33,7 +33,7 @@ class Doctor {
33
33
  '**/coverage/**',
34
34
  '**/.next/**'
35
35
  ]
36
- this.exclude = picomatch(this.ignore)
36
+ this.exclude = match(this.ignore)
37
37
  }
38
38
 
39
39
  run () {
@@ -1,7 +1,7 @@
1
1
  /* istanbul ignore file */
2
2
  const fsx = require('./../helpers/fsx')
3
3
  const path = require('path')
4
- const ignore = require('ignore')
4
+ const { ignore } = require('@dotenvx/tooling')
5
5
 
6
6
  const ls = require('../resolvers/ls')
7
7
  const Errors = require('../helpers/errors')
@@ -1,7 +1,7 @@
1
1
  /* istanbul ignore file */
2
2
  const fsx = require('./../helpers/fsx')
3
3
  const path = require('path')
4
- const ignore = require('ignore')
4
+ const { ignore } = require('@dotenvx/tooling')
5
5
 
6
6
  const ls = require('../resolvers/ls')
7
7
  const { sealed } = require('@dotenvx/primitives')
@@ -1,10 +0,0 @@
1
- const fs = require('fs')
2
- const path = require('path')
3
-
4
- function getCommanderVersion () {
5
- const commanderMain = require.resolve('commander')
6
- const pkgPath = path.join(commanderMain, '..', 'package.json')
7
- return JSON.parse(fs.readFileSync(pkgPath, 'utf8')).version
8
- }
9
-
10
- module.exports = getCommanderVersion