@dotenvx/dotenvx
Advanced tools
Comparing version 0.15.4 to 0.16.0
{ | ||
"version": "0.15.4", | ||
"version": "0.16.0", | ||
"name": "@dotenvx/dotenvx", | ||
@@ -24,3 +24,5 @@ "description": "a better dotenv–from the creator of `dotenv`", | ||
"standard:fix": "standard --fix", | ||
"test": "jest --verbose" | ||
"test": "tap 'tests/**/*.test.js' --100", | ||
"prerelease": "npm test", | ||
"release": "standard-version" | ||
}, | ||
@@ -34,6 +36,8 @@ "funding": "Have you seen dotenvx.com? run anywhere, cross-platform, and encrypted envs.", | ||
"conf": "^10.2.0", | ||
"dotenv": "^16.4.2", | ||
"dotenv-expand": "^11.0.3", | ||
"dotenv": "^16.4.4", | ||
"dotenv-expand": "^11.0.6", | ||
"execa": "^5.1.1", | ||
"glob": "^10.3.10", | ||
"ignore": "^5.3.0", | ||
"object-treeify": "1.1.33", | ||
"open": "^8.4.2", | ||
@@ -47,12 +51,10 @@ "ora": "^5.4.1", | ||
"devDependencies": { | ||
"jest": "^29.7.0", | ||
"jest-mock-process": "^2.0.0", | ||
"capture-console": "^1.0.2", | ||
"pkg": "^5.8.1", | ||
"standard": "^17.1.0" | ||
"proxyquire": "^2.1.3", | ||
"sinon": "^14.0.1", | ||
"standard": "^17.1.0", | ||
"standard-version": "^9.5.0", | ||
"tap": "^16.3.0" | ||
}, | ||
"standard": { | ||
"env": [ | ||
"jest" | ||
] | ||
}, | ||
"publishConfig": { | ||
@@ -59,0 +61,0 @@ "access": "public" |
const fs = require('fs') | ||
const path = require('path') | ||
const ignore = require('ignore') | ||
const logger = require('./../../shared/logger') | ||
const helpers = require('./../helpers') | ||
const Precommit = require('./../../lib/services/precommit') | ||
function precommit () { | ||
@@ -13,2 +15,5 @@ const options = this.opts() | ||
const precommit = new Precommit(options) | ||
precommit.run() | ||
// 0. handle the --install flag | ||
@@ -15,0 +20,0 @@ if (options.install) { |
@@ -17,3 +17,4 @@ const fs = require('fs') | ||
if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) { | ||
const filepath = helpers.resolvePath('.env.vault') | ||
const envVaultFilepath = options.envVaultFile // .env.vault | ||
const filepath = helpers.resolvePath(envVaultFilepath) | ||
@@ -60,3 +61,3 @@ if (!fs.existsSync(filepath)) { | ||
logger.successv(`injecting env (${result.injected.size}) from encrypted .env.vault`) | ||
logger.successv(`injecting env (${result.injected.size}) from encrypted ${envVaultFilepath}`) | ||
} catch (e) { | ||
@@ -63,0 +64,0 @@ logger.error(e) |
@@ -59,2 +59,3 @@ #!/usr/bin/env node | ||
.option('-f, --env-file <paths...>', 'path(s) to your env file(s)', '.env') | ||
.option('-fv, --env-vault-file <path>', 'path to your .env.vault file', '.env.vault') | ||
.option('-o, --overload', 'override existing env variables') | ||
@@ -100,2 +101,9 @@ .action(require('./actions/run')) | ||
// dotenvx ls | ||
program.command('ls') | ||
.description('print all .env files in a tree structure') | ||
.argument('[directory]', 'directory to list .env files from', '.') | ||
.option('-f, --env-file <filenames...>', 'path(s) to your env file(s)', '.env*') | ||
.action(require('./actions/ls')) | ||
// dotenvx hub | ||
@@ -102,0 +110,0 @@ program.addCommand(require('./commands/hub')) |
@@ -5,2 +5,5 @@ const logger = require('./../shared/logger') | ||
// services | ||
const Ls = require('./services/ls') | ||
const config = function (options) { | ||
@@ -60,5 +63,3 @@ return dotenv.config(options) | ||
for (const key in parsed) { | ||
if (Object.prototype.hasOwnProperty.call(expanded, key)) { | ||
result[key] = expanded[key] | ||
} | ||
result[key] = expanded[key] | ||
} | ||
@@ -109,2 +110,6 @@ | ||
const ls = function (directory, envFile) { | ||
return new Ls(directory, envFile).run() | ||
} | ||
module.exports = { | ||
@@ -116,3 +121,4 @@ config, | ||
parseExpand, | ||
inject | ||
inject, | ||
ls | ||
} |
@@ -86,4 +86,2 @@ const winston = require('winston') | ||
return formattedMessage | ||
default: // handle uncaught | ||
return formattedMessage | ||
} | ||
@@ -90,0 +88,0 @@ }) |
75682
29
1669
17
7
22
+ Addedglob@^10.3.10
+ Addedobject-treeify@1.1.33
+ Added@isaacs/cliui@8.0.2(transitive)
+ Added@pkgjs/parseargs@0.11.0(transitive)
+ Addedansi-regex@6.1.0(transitive)
+ Addedansi-styles@6.2.1(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@2.0.1(transitive)
+ Addedeastasianwidth@0.2.0(transitive)
+ Addedemoji-regex@9.2.2(transitive)
+ Addedforeground-child@3.3.0(transitive)
+ Addedglob@10.4.5(transitive)
+ Addedjackspeak@3.4.3(transitive)
+ Addedlru-cache@10.4.3(transitive)
+ Addedminimatch@9.0.5(transitive)
+ Addedminipass@7.1.2(transitive)
+ Addedobject-treeify@1.1.33(transitive)
+ Addedpackage-json-from-dist@1.0.1(transitive)
+ Addedpath-scurry@1.11.1(transitive)
+ Addedstring-width@5.1.2(transitive)
+ Addedstrip-ansi@7.1.0(transitive)
+ Addedwrap-ansi@8.1.0(transitive)
Updateddotenv@^16.4.4
Updateddotenv-expand@^11.0.6