diff --git a/lib/main.js b/lib/main.js index 967107c9..529411ca 100644 --- a/lib/main.js +++ b/lib/main.js @@ -8,19 +8,14 @@ const version = packageJson.version // Array of tips to display randomly const TIPS = [ - '๐Ÿ” encrypt with Dotenvx: https://dotenvx.com', - '๐Ÿ” prevent committing .env to code: https://dotenvx.com/precommit', - '๐Ÿ” prevent building .env in docker: https://dotenvx.com/prebuild', - '๐Ÿค– agentic secret storage: https://dotenvx.com/as2', - 'โšก๏ธ secrets for agents: https://dotenvx.com/as2', - '๐Ÿ›ก๏ธ auth for agents: https://vestauth.com', - '๐Ÿ› ๏ธ run anywhere with `dotenvx run -- yourcommand`', - 'โš™๏ธ specify custom .env file path with { path: \'/custom/path/.env\' }', - 'โš™๏ธ enable debug logging with { debug: true }', - 'โš™๏ธ override existing env vars with { override: true }', - 'โš™๏ธ suppress all logs with { quiet: true }', - 'โš™๏ธ write to custom object with { processEnv: myObject }', - 'โš™๏ธ load multiple .env files with { path: [\'.env.local\', \'.env\'] }' + 'โ—ˆ encrypted .env [www.dotenvx.com]', + 'โ—ˆ secrets for agents [www.dotenvx.com]', + 'โŒ auth for agents [www.vestauth.com]', + 'โŒ˜ custom filepath { path: \'/custom/path/.env\' }', + 'โŒ˜ enable debugging { debug: true }', + 'โŒ˜ override existing { override: true }', + 'โŒ˜ suppress logs { quiet: true }', + 'โŒ˜ multiple files { path: [\'.env.local\', \'.env\'] }' ] // Get a random tip from the tips array @@ -128,15 +123,15 @@ function _parseVault (options) { } function _warn (message) { - console.error(`[dotenv@${version}][WARN] ${message}`) + console.error(`โš  ${message} ยท dotenv@${version}`) } function _debug (message) { - console.log(`[dotenv@${version}][DEBUG] ${message}`) + console.log(`โ”† ${message} ยท dotenv@${version}`) } function _log (message) { - console.log(`[dotenv@${version}] ${message}`) + console.log(`โ—‡ ${message} ยท dotenv@${version}`) } function _dotenvKey (options) { @@ -230,7 +225,7 @@ function _configVault (options) { const quiet = parseBoolean(process.env.DOTENV_CONFIG_QUIET || (options && options.quiet)) if (debug || !quiet) { - _log('Loading env from encrypted .env.vault') + _log('loading env from encrypted .env.vault') } const parsed = DotenvModule._parseVault(options) @@ -259,7 +254,7 @@ function configDotenv (options) { encoding = options.encoding } else { if (debug) { - _debug('No encoding is specified. UTF-8 is used by default') + _debug('no encoding is specified (UTF-8 is used by default)') } } @@ -287,7 +282,7 @@ function configDotenv (options) { DotenvModule.populate(parsedAll, parsed, options) } catch (e) { if (debug) { - _debug(`Failed to load ${path} ${e.message}`) + _debug(`failed to load ${path} ${e.message}`) } lastError = e } @@ -308,13 +303,13 @@ function configDotenv (options) { shortPaths.push(relative) } catch (e) { if (debug) { - _debug(`Failed to load ${filePath} ${e.message}`) + _debug(`failed to load ${filePath} ${e.message}`) } lastError = e } } - _log(`injecting env (${keysCount}) from ${shortPaths.join(',')} ${dim(`-- tip: ${_getRandomTip()}`)}`) + _log(`injecting env (${keysCount}) from ${shortPaths.join(',')} ${dim(`// tip: ${_getRandomTip()}`)}`) } if (lastError) { @@ -335,7 +330,7 @@ function config (options) { // dotenvKey exists but .env.vault file does not exist if (!vaultPath) { - _warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`) + _warn(`you set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}`) return DotenvModule.configDotenv(options) } diff --git a/tests/test-config.js b/tests/test-config.js index 3213962f..8b83cd64 100644 --- a/tests/test-config.js +++ b/tests/test-config.js @@ -329,19 +329,14 @@ t.test('displays random tips from the tips array', ct => { // Test that the tip contains one of our expected tip messages let foundExpectedTip = false const expectedTips = [ - '๐Ÿ” encrypt with Dotenvx: https://dotenvx.com', - '๐Ÿ” prevent committing .env to code: https://dotenvx.com/precommit', - '๐Ÿ” prevent building .env in docker: https://dotenvx.com/prebuild', - '๐Ÿค– agentic secret storage: https://dotenvx.com/as2', - 'โšก๏ธ secrets for agents: https://dotenvx.com/as2', - '๐Ÿ›ก๏ธ auth for agents: https://vestauth.com', - '๐Ÿ› ๏ธ run anywhere with `dotenvx run -- yourcommand`', - 'โš™๏ธ specify custom .env file path with { path: \'/custom/path/.env\' }', - 'โš™๏ธ enable debug logging with { debug: true }', - 'โš™๏ธ override existing env vars with { override: true }', - 'โš™๏ธ suppress all logs with { quiet: true }', - 'โš™๏ธ write to custom object with { processEnv: myObject }', - 'โš™๏ธ load multiple .env files with { path: [\'.env.local\', \'.env\'] }' + 'โ—ˆ encrypted .env [www.dotenvx.com]', + 'โ—ˆ secrets for agents [www.dotenvx.com]', + 'โŒ auth for agents [www.vestauth.com]', + 'โŒ˜ custom filepath { path: \'/custom/path/.env\' }', + 'โŒ˜ enable debugging { debug: true }', + 'โŒ˜ override existing { override: true }', + 'โŒ˜ suppress logs { quiet: true }', + 'โŒ˜ multiple files { path: [\'.env.local\', \'.env\'] }' ] for (const call of logStub.getCalls()) { @@ -390,19 +385,14 @@ t.test('displays random tips from the tips array with fallback for isTTY false', // Test that the tip contains one of our expected tip messages let foundExpectedTip = false const expectedTips = [ - '๐Ÿ” encrypt with Dotenvx: https://dotenvx.com', - '๐Ÿ” prevent committing .env to code: https://dotenvx.com/precommit', - '๐Ÿ” prevent building .env in docker: https://dotenvx.com/prebuild', - '๐Ÿค– agentic secret storage: https://dotenvx.com/as2', - 'โšก๏ธ secrets for agents: https://dotenvx.com/as2', - '๐Ÿ›ก๏ธ auth for agents: https://vestauth.com', - '๐Ÿ› ๏ธ run anywhere with `dotenvx run -- yourcommand`', - 'โš™๏ธ specify custom .env file path with { path: \'/custom/path/.env\' }', - 'โš™๏ธ enable debug logging with { debug: true }', - 'โš™๏ธ override existing env vars with { override: true }', - 'โš™๏ธ suppress all logs with { quiet: true }', - 'โš™๏ธ write to custom object with { processEnv: myObject }', - 'โš™๏ธ load multiple .env files with { path: [\'.env.local\', \'.env\'] }' + 'โ—ˆ encrypted .env [www.dotenvx.com]', + 'โ—ˆ secrets for agents [www.dotenvx.com]', + 'โŒ auth for agents [www.vestauth.com]', + 'โŒ˜ custom filepath { path: \'/custom/path/.env\' }', + 'โŒ˜ enable debugging { debug: true }', + 'โŒ˜ override existing { override: true }', + 'โŒ˜ suppress logs { quiet: true }', + 'โŒ˜ multiple files { path: [\'.env.local\', \'.env\'] }' ] for (const call of logStub.getCalls()) {