diff --git a/notNeededPackages.json b/notNeededPackages.json index 659b87da95..359c65c9fa 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -756,6 +756,12 @@ "sourceRepoURL": "https://github.com/sindresorhus/dot-prop", "asOfVersion": "5.0.0" }, + { + "libraryName": "dotenv", + "typingsPackageName": "dotenv", + "sourceRepoURL": "https://github.com/motdotla/dotenv", + "asOfVersion": "8.2.0" + }, { "libraryName": "dva", "typingsPackageName": "dva", diff --git a/types/dotenv-safe/index.d.ts b/types/dotenv-safe/index.d.ts index 39c17ebea5..bf09cb3ffb 100644 --- a/types/dotenv-safe/index.d.ts +++ b/types/dotenv-safe/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/rolodato/dotenv-safe // Definitions by: Stan Goldmann // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 import env = require("dotenv") diff --git a/types/dotenv-safe/package.json b/types/dotenv-safe/package.json new file mode 100644 index 0000000000..25e5e56785 --- /dev/null +++ b/types/dotenv-safe/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "dotenv": "^8.2.0" + } +} diff --git a/types/dotenv/dotenv-tests.ts b/types/dotenv/dotenv-tests.ts deleted file mode 100644 index 9e57d1546f..0000000000 --- a/types/dotenv/dotenv-tests.ts +++ /dev/null @@ -1,18 +0,0 @@ -import dotenv = require("dotenv"); - -const env = dotenv.config(); -const dbUrl: string | null = env.error || !env.parsed ? null : env.parsed["BASIC"]; - -dotenv.config({ - path: ".env-example", - encoding: "utf8", - debug: true -}); - -const parsed = dotenv.parse("NODE_ENV=production\nDB_HOST=a.b.c"); -const dbHost: string = parsed["DB_HOST"]; - -const parsedFromBuffer = dotenv.parse(new Buffer("JUSTICE=league\n"), { - debug: true -}); -const justice: string = parsedFromBuffer["JUSTICE"]; diff --git a/types/dotenv/index.d.ts b/types/dotenv/index.d.ts deleted file mode 100644 index 30b346b0bd..0000000000 --- a/types/dotenv/index.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -// Type definitions for dotenv 6.1 -// Project: https://github.com/motdotla/dotenv -// Definitions by: Jussi Kinnula -// Borek Bernard -// Eric Naeseth -// Max Beatty -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -export interface DotenvParseOptions { - /** - * You may turn on logging to help debug why certain keys or values are not being set as you expect. - */ - debug?: boolean; -} - -export interface DotenvParseOutput { - [name: string]: string; -} - -/** - * Parses a string or buffer in the .env file format into an object. - * - * @param src - contents to be parsed - * @param options - additional options - * @returns an object with keys and values based on `src` - */ -export function parse( - src: string | Buffer, - options?: DotenvParseOptions -): DotenvParseOutput; - -export interface DotenvConfigOptions { - /** - * You may specify a custom path if your file containing environment variables is located elsewhere. - */ - path?: string; - - /** - * You may specify the encoding of your file containing environment variables. - */ - encoding?: string; - - /** - * You may turn on logging to help debug why certain keys or values are not being set as you expect. - */ - debug?: boolean; -} - -export interface DotenvConfigOutput { - error?: Error; - parsed?: DotenvParseOutput; -} - -/** - * Loads `.env` file contents into {@link https://nodejs.org/api/process.html#process_process_env | `process.env`}. - * Example: 'KEY=value' becomes { parsed: { KEY: 'value' } } - * - * @param options - controls behavior - * @returns an object with a `parsed` key if successful or `error` key if an error occurred - * - */ -export function config(options?: DotenvConfigOptions): DotenvConfigOutput; -/** @deprecated since v7.0.0 Use config instead. */ -export const load: typeof config; diff --git a/types/dotenv/tsconfig.json b/types/dotenv/tsconfig.json deleted file mode 100644 index 5c51b4d698..0000000000 --- a/types/dotenv/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "dotenv-tests.ts" - ] -} \ No newline at end of file diff --git a/types/dotenv/tslint.json b/types/dotenv/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/dotenv/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" } diff --git a/types/dotenv/v2/dotenv-tests.ts b/types/dotenv/v2/dotenv-tests.ts deleted file mode 100644 index f609dd4745..0000000000 --- a/types/dotenv/v2/dotenv-tests.ts +++ /dev/null @@ -1,26 +0,0 @@ -import dotenv = require('dotenv'); - -// typically, result will be an Object -const env = dotenv.config({ - silent: true -}); -const dbUrl: string | null = !env ? null : env['DATABASE_URL']; - -// ... but it might also be `false` -const result = dotenv.config({ - path: '.non-existing-env' -}); - -dotenv.config({ - path: '.env' -}); - -dotenv.config({ - encoding: 'utf8' -}); - -const parsed = dotenv.parse("ENVIRONMENT=production\nDEBUG=no\n"); -const debug: string = parsed['DEBUG']; - -const parsedFromBuffer = dotenv.parse(new Buffer("JUSTICE=league\n")); -const justice: string = parsedFromBuffer['JUSTICE']; diff --git a/types/dotenv/v2/index.d.ts b/types/dotenv/v2/index.d.ts deleted file mode 100644 index 276052e481..0000000000 --- a/types/dotenv/v2/index.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -// Type definitions for dotenv 2.0 -// Project: https://github.com/motdotla/dotenv -// Definitions by: Jussi Kinnula , Borek Bernard , Eric Naeseth -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -/** - * Parses a string or buffer in the .env file format into an object. - */ -export function parse(src: string | Buffer): {[name: string]: string}; - -/** - * Loads `.env` into `process.env`. - * - * @return Object Object with the parsed keys and values, e.g., 'KEY=value' becomes { KEY: 'value' } - */ -export function config(options?: DotenvOptions): {[name: string]: string} | false; - -export interface DotenvOptions { - /** - * Dotenv outputs a warning to your console if missing a .env file. Suppress this warning using silent. - * - * @default false - */ - silent?: boolean; - - /** - * You can specify a custom path if your file containing environment variables is named or located differently. - * - * @default '.env' - */ - path?: string; - - /** - * You may specify the encoding of your file containing environment variables using this option. - * - * @default 'utf8' - */ - encoding?: string; -} diff --git a/types/dotenv/v2/tsconfig.json b/types/dotenv/v2/tsconfig.json deleted file mode 100644 index facb307571..0000000000 --- a/types/dotenv/v2/tsconfig.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../../", - "typeRoots": [ - "../../" - ], - "paths": { - "dotenv": [ - "dotenv/v2" - ] - }, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "dotenv-tests.ts" - ] -} \ No newline at end of file diff --git a/types/dotenv/v2/tslint.json b/types/dotenv/v2/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/dotenv/v2/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" } diff --git a/types/oracledb/package.json b/types/oracledb/package.json new file mode 100644 index 0000000000..25e5e56785 --- /dev/null +++ b/types/oracledb/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "dotenv": "^8.2.0" + } +}