From a206fa2674c1a943af0fa96d11472fd0a5897733 Mon Sep 17 00:00:00 2001 From: larshp Date: Mon, 21 Sep 2020 10:11:06 +0200 Subject: [PATCH 1/2] update everything to latest, try bundling --- .npmignore | 6 ++++++ api-extractor.json | 25 +++++++++++++++++++++++++ lib/Pool.d.ts | 2 +- package.json | 17 ++++++++++------- test/test.ts | 2 +- test/tsconfig.json | 10 ++-------- tsconfig.json | 6 +----- tslint.json | 2 -- typings.json | 9 --------- 9 files changed, 46 insertions(+), 33 deletions(-) create mode 100644 .npmignore create mode 100644 api-extractor.json delete mode 100644 typings.json diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..68f73ed --- /dev/null +++ b/.npmignore @@ -0,0 +1,6 @@ +.editorconfig +.travis.yml +/test/ +/typedoc/ +tslint.json +build diff --git a/api-extractor.json b/api-extractor.json new file mode 100644 index 0000000..60b0bd2 --- /dev/null +++ b/api-extractor.json @@ -0,0 +1,25 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "projectFolder": ".", + "mainEntryPointFilePath": "./index.d.ts", + "docModel": { + "enabled": false + }, + "apiReport": { + "enabled": false + }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "./build/index.d.ts" + }, + "messages": { + "extractorMessageReporting": { + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-forgotten-export": { + "logLevel": "none" + } + } + } +} diff --git a/lib/Pool.d.ts b/lib/Pool.d.ts index bb0029a..ebfb7a5 100644 --- a/lib/Pool.d.ts +++ b/lib/Pool.d.ts @@ -31,7 +31,7 @@ declare namespace Pool { * is no limit to the number of queued connection requests. (Default: 0) */ queueLimit?: number; - + /** * Enable keep-alive on the socket. It's disabled by default, but the * user can enable it and supply an initial delay. diff --git a/package.json b/package.json index 3936709..1484e5f 100644 --- a/package.json +++ b/package.json @@ -2,19 +2,22 @@ "name": "@types/mysql", "version": "2.0.0", "description": "Typings for mysql", + "typings": "index.d.ts", "scripts": { - "build": "typings bundle -o test/bundle.d.ts", "test": "tsc -p test", + "bundle": "api-extractor --debug run", "lint": "tslint -c tslint.json \"lib/**/*.d.ts\" index.d.ts", - "typedoc": "typedoc --includeDeclarations --excludeExternals --name mysql --mode file --readme none --out typedoc lib index.d.ts typings/index.d.ts" + "typedoc": "typedoc --includeDeclarations --excludeExternals --name mysql --mode file --readme none --out typedoc lib index.d.ts typings/index.d.ts", + "prepublishOnly": "npm run test && npm run lint" }, "author": "Felix Becker ", "license": "ISC", "devDependencies": { - "mysql": "~2.17.1", - "tslint": "^5.2.0", - "typedoc": "^0.7.0", - "typescript": "^2.0.3", - "typings": "^2.1.1" + "@microsoft/api-extractor": "^7.9.19", + "@types/node": "^14.11.1", + "mysql": "~2.18.1", + "tslint": "^6.1.3", + "typedoc": "^0.19.2", + "typescript": "^4.0.3" } } diff --git a/test/test.ts b/test/test.ts index 10faf52..7c94899 100644 --- a/test/test.ts +++ b/test/test.ts @@ -1,6 +1,6 @@ import * as fs from 'fs'; -import * as mysql from 'mysql'; +import * as mysql from '../index'; import * as stream from 'stream'; // Connections diff --git a/test/tsconfig.json b/test/tsconfig.json index eb2723f..14c0720 100644 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -1,17 +1,11 @@ { "compilerOptions": { "target": "es2015", - "noImplicitAny": true, + "noImplicitAny": false, "strictNullChecks": true, "module": "commonjs", - "typeRoots": [ - "../typings/globals", - "../typings/modules" - ] }, "files": [ - "test.ts", - "bundle.d.ts", - "../typings/index.d.ts" + "test.ts" ] } diff --git a/tsconfig.json b/tsconfig.json index 21d9ca5..5fc9dbc 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,10 +3,6 @@ "noImplicitAny": true, "strictNullChecks": true, "target": "es2015", - "module": "commonjs", - "typeRoots": [ - "typings/globals", - "typings/modules" - ] + "module": "commonjs" } } diff --git a/tslint.json b/tslint.json index f5f9a35..e4a1dcb 100644 --- a/tslint.json +++ b/tslint.json @@ -36,8 +36,6 @@ "one-variable-per-declaration": [true, "ignore-for-loop"], "curly": true, "no-empty": false, - "no-duplicate-key": true, - "no-unreachable": true, "no-unused-expression": true, "no-unused-variable": [false], "eofline": true, diff --git a/typings.json b/typings.json deleted file mode 100644 index 2f92dfe..0000000 --- a/typings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "mysql", - "version": "2.11.1", - "homepage": "https://github.com/types/mysql", - "main": "index.d.ts", - "globalDependencies": { - "node": "registry:env/node#6.0.0+20170213133316" - } -} From 8a835215dc5be36e3e72a0207a99984b6e435a1e Mon Sep 17 00:00:00 2001 From: larshp Date: Mon, 21 Sep 2020 10:12:59 +0200 Subject: [PATCH 2/2] use tsconfig project path --- api-extractor.json | 1 - 1 file changed, 1 deletion(-) diff --git a/api-extractor.json b/api-extractor.json index 60b0bd2..bab0a5b 100644 --- a/api-extractor.json +++ b/api-extractor.json @@ -1,6 +1,5 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "projectFolder": ".", "mainEntryPointFilePath": "./index.d.ts", "docModel": { "enabled": false