diff --git a/.npmignore b/.npmignore
index 83aa0123..40bbf272 100644
--- a/.npmignore
+++ b/.npmignore
@@ -2,6 +2,7 @@
examples/
flow-typed/
tests/
+types/
.editorconfig
.flowconfig
.npmignore
diff --git a/appveyor.yml b/appveyor.yml
index 31869a51..330c11c0 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -11,8 +11,6 @@ environment:
install:
# Get the latest stable version of Node 0.STABLE.latest
- ps: Install-Product node $env:nodejs_version
- # Typical npm stuff.
- - npm i -g npm@latest
- npm install
# Post-install test scripts.
diff --git a/types/index.d.ts b/lib/main.d.ts
similarity index 94%
rename from types/index.d.ts
rename to lib/main.d.ts
index 6a9a49b7..d673117a 100644
--- a/types/index.d.ts
+++ b/lib/main.d.ts
@@ -55,5 +55,3 @@ export interface DotenvConfigOutput {
*
*/
export function config(options?: DotenvConfigOptions): DotenvConfigOutput;
-/** @deprecated since v7.0.0 Use config instead. */
-export const load: typeof config;
diff --git a/package-lock.json b/package-lock.json
index 4ade7614..47ed6120 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -5,6 +5,7 @@
"requires": true,
"packages": {
"": {
+ "name": "dotenv",
"version": "11.0.0",
"license": "BSD-2-Clause",
"devDependencies": {
@@ -14,7 +15,8 @@
"standard": "^13.1.0",
"standard-markdown": "^5.1.0",
"standard-version": "^7.0.0",
- "tap": "^14.7.0"
+ "tap": "^14.7.0",
+ "typescript": "^4.5.4"
},
"engines": {
"node": ">=12"
@@ -2371,19 +2373,6 @@
"node": ">=0.10.0"
}
},
- "node_modules/dtslint/node_modules/typescript": {
- "version": "3.7.0-dev.20191015",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.0-dev.20191015.tgz",
- "integrity": "sha512-Cpfj1n4pEUVKL+jtS0mkZodJffyMmf3Wk/UjyZMGX4fsjK5KBPJf3NUlyXij8I8p1E2CAomdS5NPFrAR+z8pKw==",
- "dev": true,
- "bin": {
- "tsc": "bin/tsc",
- "tsserver": "bin/tsserver"
- },
- "engines": {
- "node": ">=4.2.0"
- }
- },
"node_modules/ecc-jsbn": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz",
@@ -9312,6 +9301,19 @@
"node": ">=6"
}
},
+ "node_modules/tap/node_modules/typescript": {
+ "version": "3.9.10",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz",
+ "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==",
+ "dev": true,
+ "bin": {
+ "tsc": "bin/tsc",
+ "tsserver": "bin/tsserver"
+ },
+ "engines": {
+ "node": ">=4.2.0"
+ }
+ },
"node_modules/tap/node_modules/which": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.1.tgz",
@@ -9836,9 +9838,9 @@
}
},
"node_modules/typescript": {
- "version": "3.6.4",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.4.tgz",
- "integrity": "sha512-unoCll1+l+YK4i4F8f22TaNVPRHcD9PA3yCuZ8g5e0qGqlVlJ/8FSateOLLSagn+Yg5+ZwuPkL8LFUc0Jcvksg==",
+ "version": "4.5.4",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz",
+ "integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==",
"dev": true,
"bin": {
"tsc": "bin/tsc",
@@ -12240,12 +12242,6 @@
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
"integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=",
"dev": true
- },
- "typescript": {
- "version": "3.7.0-dev.20191015",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.0-dev.20191015.tgz",
- "integrity": "sha512-Cpfj1n4pEUVKL+jtS0mkZodJffyMmf3Wk/UjyZMGX4fsjK5KBPJf3NUlyXij8I8p1E2CAomdS5NPFrAR+z8pKw==",
- "dev": true
}
}
},
@@ -17686,6 +17682,12 @@
"bundled": true,
"dev": true
},
+ "typescript": {
+ "version": "3.9.10",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz",
+ "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==",
+ "dev": true
+ },
"which": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.1.tgz",
@@ -18134,9 +18136,9 @@
}
},
"typescript": {
- "version": "3.6.4",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.4.tgz",
- "integrity": "sha512-unoCll1+l+YK4i4F8f22TaNVPRHcD9PA3yCuZ8g5e0qGqlVlJ/8FSateOLLSagn+Yg5+ZwuPkL8LFUc0Jcvksg==",
+ "version": "4.5.4",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz",
+ "integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==",
"dev": true
},
"uglify-js": {
diff --git a/package.json b/package.json
index 10bf58fe..a0427f0b 100644
--- a/package.json
+++ b/package.json
@@ -3,18 +3,18 @@
"version": "11.0.0",
"description": "Loads environment variables from .env file",
"main": "lib/main.js",
+ "types": "lib/main.d.ts",
"exports": {
".": "./lib/main.js",
"./config": "./config.js",
"./config.js": "./config.js",
"./package.json": "./package.json"
},
- "types": "types/index.d.ts",
"scripts": {
- "dtslint": "dtslint types",
+ "dts-check": "tsc --project types/tsconfig.json",
"lint": "standard",
"postlint": "standard-markdown",
- "pretest": "npm run lint && npm run dtslint",
+ "pretest": "npm run lint && npm run dts-check",
"test": "tap tests/*.js --100",
"prerelease": "npm test",
"release": "standard-version"
@@ -41,7 +41,8 @@
"standard": "^13.1.0",
"standard-markdown": "^5.1.0",
"standard-version": "^7.0.0",
- "tap": "^14.7.0"
+ "tap": "^14.7.0",
+ "typescript": "^4.5.4"
},
"dependencies": {},
"engines": {
diff --git a/types/tsconfig.json b/types/tsconfig.json
index 012b05dd..21dc5284 100644
--- a/types/tsconfig.json
+++ b/types/tsconfig.json
@@ -2,14 +2,11 @@
"compilerOptions": {
"module": "commonjs",
"lib": ["es6"],
- "noImplicitAny": true,
- "noImplicitThis": true,
- "strictNullChecks": true,
- "strictFunctionTypes": true,
+ "strict": true,
"noEmit": true,
- "baseUrl": ".",
"paths": {
- "dotenv": ["."]
+ "dotenv": ["../lib/main.d.ts"]
}
- }
+ },
+ "include": ["./test.ts", "../main.d.ts"]
}
diff --git a/types/tslint.json b/types/tslint.json
deleted file mode 100644
index c634f996..00000000
--- a/types/tslint.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "extends": "dtslint/dtslint.json",
- "rules": {
- "strict-export-declare-modifiers": false
- }
-}