From eb0e8fd72eb3597e34d9dfed5302e5f2f1bfa368 Mon Sep 17 00:00:00 2001 From: Sampo Siltanen Date: Wed, 12 Jan 2022 13:01:02 +0200 Subject: [PATCH] Change axios to be a peer dependency The usage of axios in this repository is very basic, but its versioning is defined very tightly. This causes problems, because the interface IOptions uses AxiosInstance as its property, preventing the clients of this library from updating their axios version beyond the limits set in this library. Typescript compiler gives type error when giving higher version AxiosInstance for IOptions. By setting axios as a peer dependency, we would allow the clients of this library to install other versions of axios if they so choose. --- package-lock.json | 6 +++++- package.json | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index ee3fad3a1..eef8f9b45 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,6 @@ "version": "0.43.0", "license": "MIT", "dependencies": { - "axios": "^0.21.1", "axios-ntlm": "^1.2.0", "debug": "^4.3.2", "formidable": "^1.2.2", @@ -55,6 +54,9 @@ }, "engines": { "node": ">=12.0.0" + }, + "peerDependencies": { + "axios": "^0.21.1" } }, "node_modules/@babel/code-frame": { @@ -517,6 +519,7 @@ "version": "0.21.1", "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", + "peer": true, "dependencies": { "follow-redirects": "^1.10.0" } @@ -5306,6 +5309,7 @@ "version": "0.21.1", "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", + "peer": true, "requires": { "follow-redirects": "^1.10.0" } diff --git a/package.json b/package.json index 95e6203aa..b2cb2f890 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,6 @@ }, "author": "Vinay Pulim ", "dependencies": { - "axios": "^0.21.1", "axios-ntlm": "^1.2.0", "debug": "^4.3.2", "formidable": "^1.2.2", @@ -19,6 +18,9 @@ "whatwg-mimetype": "3.0.0", "xml-crypto": "^2.1.3" }, + "peerDependencies": { + "axios": "^0.21.1" + }, "repository": { "type": "git", "url": "https://github.com/vpulim/node-soap.git"