From ceae1778f47bd23bd082de1b0beab1942d4f945d Mon Sep 17 00:00:00 2001 From: motdotla Date: Tue, 4 May 2021 17:53:09 -0700 Subject: [PATCH 1/4] Remove main interface for now - was never published --- types/index.d.ts | 7 ------- types/test.ts | 7 +------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/types/index.d.ts b/types/index.d.ts index 23f05f69..a83184cc 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -55,12 +55,5 @@ export interface DotenvConfigOutput { * */ export function config(options?: DotenvConfigOptions): DotenvConfigOutput; - -/** dotenv library interface */ -export interface DotEnv { - config: typeof config; - parse: typeof parse; -} - /** @deprecated since v7.0.0 Use config instead. */ export const load: typeof config; diff --git a/types/test.ts b/types/test.ts index 84b17601..bce09209 100644 --- a/types/test.ts +++ b/types/test.ts @@ -1,9 +1,4 @@ -import * as dotenv from "dotenv"; - -const { config, parse }: dotenv.DotEnv = { - config: dotenv.config, - parse: dotenv.parse -}; +import { config, parse } from "dotenv"; const env = config(); const dbUrl: string | null = From 8f04b9dd877fc76975f889006f8c0bf116c4cc78 Mon Sep 17 00:00:00 2001 From: motdotla Date: Tue, 4 May 2021 17:56:38 -0700 Subject: [PATCH 2/4] Fix failing tests from 12.16.0 and newer --- tests/test-config-cli.js | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/tests/test-config-cli.js b/tests/test-config-cli.js index c7ad3d02..88c43b99 100644 --- a/tests/test-config-cli.js +++ b/tests/test-config-cli.js @@ -27,24 +27,34 @@ t.plan(3) // dotenv/config enables preloading t.equal( - spawn([ - '-r', - '../config', - '-e', - 'console.log(process.env.BASIC)', - 'dotenv_config_encoding=utf8', - 'dotenv_config_path=./tests/.env' - ]), + spawn( + [ + '-r', + path.resolve(__dirname, '../config'), + '-e', + 'console.log(process.env.BASIC)', + 'dotenv_config_encoding=utf8', + 'dotenv_config_path=./tests/.env' + ] + ), 'basic\n' ) // dotenv/config supports configuration via environment variables t.equal( - spawn(['-r', '../config', '-e', 'console.log(process.env.BASIC)'], { - env: { - DOTENV_CONFIG_PATH: './tests/.env' + spawn( + [ + '-r', + path.resolve(__dirname, '../config'), + '-e', + 'console.log(process.env.BASIC)' + ], + { + env: { + DOTENV_CONFIG_PATH: './tests/.env' + } } - }), + ), 'basic\n' ) @@ -53,7 +63,7 @@ t.equal( spawn( [ '-r', - '../config', + path.resolve(__dirname, '../config'), '-e', 'console.log(process.env.BASIC)', 'dotenv_config_path=./tests/.env' From ad6646c9e6ed0592468dae25c61349991ec573df Mon Sep 17 00:00:00 2001 From: motdotla Date: Tue, 4 May 2021 18:00:39 -0700 Subject: [PATCH 3/4] Remove node 8 from ci --- .travis.yml | 1 - appveyor.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index c749c259..df4a087a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,6 @@ os: - windows node_js: - - "8" - "10" - "12" diff --git a/appveyor.yml b/appveyor.yml index 977b7d35..425ad85a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,7 +3,6 @@ # Test against these versions of Node.js. environment: matrix: - - nodejs_version: "8" - nodejs_version: "10" - nodejs_version: "12" From fd2d6fa9b90a4e1d6fcb9fe7b1fd6af48fed9ffa Mon Sep 17 00:00:00 2001 From: motdotla Date: Tue, 4 May 2021 18:15:45 -0700 Subject: [PATCH 4/4] Simplify path for readability --- tests/test-config-cli.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test-config-cli.js b/tests/test-config-cli.js index 88c43b99..5c9a8beb 100644 --- a/tests/test-config-cli.js +++ b/tests/test-config-cli.js @@ -30,7 +30,7 @@ t.equal( spawn( [ '-r', - path.resolve(__dirname, '../config'), + './config', '-e', 'console.log(process.env.BASIC)', 'dotenv_config_encoding=utf8', @@ -45,7 +45,7 @@ t.equal( spawn( [ '-r', - path.resolve(__dirname, '../config'), + './config', '-e', 'console.log(process.env.BASIC)' ], @@ -63,7 +63,7 @@ t.equal( spawn( [ '-r', - path.resolve(__dirname, '../config'), + './config', '-e', 'console.log(process.env.BASIC)', 'dotenv_config_path=./tests/.env'