From 30b0f73b2c1e5b2a9a4469575fde2ad551fa221b Mon Sep 17 00:00:00 2001 From: Austin Cawley-Edwards Date: Thu, 22 Nov 2018 08:25:21 -0500 Subject: [PATCH] fix: add typings to package.json files (#230) --- dist/chai-http.d.ts | 61 --------------------------------------------- package-lock.json | 37 --------------------------- package.json | 6 ++--- 3 files changed, 3 insertions(+), 101 deletions(-) delete mode 100644 dist/chai-http.d.ts diff --git a/dist/chai-http.d.ts b/dist/chai-http.d.ts deleted file mode 100644 index c1fb8b3..0000000 --- a/dist/chai-http.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -// Definitions by: Wim Looman -// Liam Jones -// Federico Caselli -// Bas Luksenburg -// Austin Cawley-Edwards -// TypeScript Version: 3.0 -/// -import * as request from 'superagent'; - -// Merge namespace with global chai -declare global { - namespace Chai { - interface ChaiStatic { - request: ChaiHttpRequest; - } - - interface ChaiHttpRequest { - (server: any): ChaiHttp.Agent; - - agent(server: any): ChaiHttp.Agent; - - addPromises(promiseConstructor: PromiseConstructorLike): void; - } - - interface Assertion { - redirectTo(location: string): Assertion; - - param(key: string, value?: string): Assertion; - - cookie(key: string, value?: string): Assertion; - - status(code: number): Assertion; - - statusCode(code: number): Assertion; - - header(key: string, value?: string | RegExp): Assertion; - - headers: Assertion; - json: Assertion; - text: Assertion; - html: Assertion; - redirect: Assertion; - } - - interface TypeComparison { - ip: Assertion; - } - } - - namespace ChaiHttp { - interface Response extends request.Response {} - interface Agent extends request.SuperAgentStatic { - keepOpen(): Agent; - close(callback?: (err: any) => void): Agent; - } - } -} - -declare function chaiHttp(chai: any, utils: any): void; - -export = chaiHttp; diff --git a/package-lock.json b/package-lock.json index 4adde12..cac584b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1012,18 +1012,6 @@ "request": "^2.79.0" } }, - "cpr": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/cpr/-/cpr-3.0.1.tgz", - "integrity": "sha1-uaVQOLfNgaNcF7l2GJW9hJau8eU=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.5", - "minimist": "^1.2.0", - "mkdirp": "~0.5.1", - "rimraf": "^2.5.4" - } - }, "create-ecdh": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.0.tgz", @@ -4191,31 +4179,6 @@ "align-text": "^0.1.1" } }, - "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", - "dev": true, - "requires": { - "glob": "^7.0.5" - }, - "dependencies": { - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - } - } - }, "ripemd160": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.1.tgz", diff --git a/package.json b/package.json index 7a816db..52d01a9 100644 --- a/package.json +++ b/package.json @@ -22,9 +22,11 @@ "files": [ "dist/chai-http.js", "lib/*.js", - "index.js" + "index.js", + "types/index.d.ts" ], "main": "./index", + "types": "./types/index.d.ts", "repository": { "type": "git", "url": "git@github.com:chaijs/chai-http.git" @@ -34,7 +36,6 @@ "prebuild:js": "rm -rf dist", "build:js": "simplifyify lib/http.js --outfile dist/chai-http.js --bundle --minify --debug --standalone chaiHttp", "build:ts": "cd types && tsc", - "postbuild:ts": "cpr types/index.d.ts dist/chai-http.d.ts --overwrite", "build:readme": "rm -rf README.md && node ./support/readme", "start": "npm-run-all --parallel watch server", "watch": "npm run build:js -- --watch", @@ -60,7 +61,6 @@ "devDependencies": { "chai": "4", "coveralls": "^3.0.0", - "cpr": "^3.0.1", "dox": "^0.9.0", "es6-shim": "^0.35.1", "http-server": "^0.10.0",