From 3499e84f268c6e08518f94638c5a95b6743fe34f Mon Sep 17 00:00:00 2001 From: Alex Chesters <10558792+AlexChesters@users.noreply.github.com> Date: Tue, 5 Aug 2025 09:35:15 +0000 Subject: [PATCH 1/2] remove isomorphic fetch --- .devcontainer/Dockerfile | 4 ++ Makefile | 3 ++ package-lock.json | 98 ---------------------------------------- package.json | 4 +- src/utils/fetch-data.ts | 2 - 5 files changed, 8 insertions(+), 103 deletions(-) create mode 100644 Makefile diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 5c2d37d..23b5ff8 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -19,3 +19,7 @@ RUN echo "alias gco='git checkout'" >> /root/.bashrc RUN echo "alias gs='git status'" >> /root/.bashrc RUN echo "alias ga='git add .'" >> /root/.bashrc RUN echo "alias gc='git commit'" >> /root/.bashrc + +# install nodejs +RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - +RUN apt-get install -y nodejs diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f93c9be --- /dev/null +++ b/Makefile @@ -0,0 +1,3 @@ +.PHONY: ssh +ssh: + docker exec -w /workspaces/ukpd -it vscode-devcontainer_ukpd bash diff --git a/package-lock.json b/package-lock.json index 81001ba..812be07 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,9 +8,6 @@ "name": "ukpd", "version": "6.0.0", "license": "MIT", - "dependencies": { - "isomorphic-fetch": "^3.0.0" - }, "devDependencies": { "@types/chai": "^4.3.6", "@types/isomorphic-fetch": "0.0.37", @@ -3675,15 +3672,6 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, - "node_modules/isomorphic-fetch": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-3.0.0.tgz", - "integrity": "sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA==", - "dependencies": { - "node-fetch": "^2.6.1", - "whatwg-fetch": "^3.4.1" - } - }, "node_modules/istanbul-lib-coverage": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", @@ -4562,44 +4550,6 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, - "node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/node-fetch/node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" - }, - "node_modules/node-fetch/node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" - }, - "node_modules/node-fetch/node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, "node_modules/node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -5848,11 +5798,6 @@ "makeerror": "1.0.12" } }, - "node_modules/whatwg-fetch": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.1.tgz", - "integrity": "sha512-IEmN/ZfmMw6G1hgZpVd0LuZXOQDisrMOZrzYd5x3RAK4bMPlJohKUZWZ9t/QsTvH0dV9TbPDcc2OSuIDcihnHA==" - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -8644,15 +8589,6 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, - "isomorphic-fetch": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-3.0.0.tgz", - "integrity": "sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA==", - "requires": { - "node-fetch": "^2.6.1", - "whatwg-fetch": "^3.4.1" - } - }, "istanbul-lib-coverage": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", @@ -9329,35 +9265,6 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, - "node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "requires": { - "whatwg-url": "^5.0.0" - }, - "dependencies": { - "tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" - }, - "webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" - }, - "whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - } - } - }, "node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -10228,11 +10135,6 @@ "makeerror": "1.0.12" } }, - "whatwg-fetch": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.1.tgz", - "integrity": "sha512-IEmN/ZfmMw6G1hgZpVd0LuZXOQDisrMOZrzYd5x3RAK4bMPlJohKUZWZ9t/QsTvH0dV9TbPDcc2OSuIDcihnHA==" - }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/package.json b/package.json index 68b660c..2eef388 100644 --- a/package.json +++ b/package.json @@ -33,9 +33,7 @@ "url": "https://github.com/AlexChesters/ukpd/issues" }, "homepage": "https://github.com/AlexChesters/ukpd#readme", - "dependencies": { - "isomorphic-fetch": "^3.0.0" - }, + "dependencies": {}, "devDependencies": { "@types/chai": "^4.3.6", "@types/isomorphic-fetch": "0.0.37", diff --git a/src/utils/fetch-data.ts b/src/utils/fetch-data.ts index 3b9e0fc..78349c8 100644 --- a/src/utils/fetch-data.ts +++ b/src/utils/fetch-data.ts @@ -1,5 +1,3 @@ -import * as fetch from 'isomorphic-fetch' - // eslint-disable-next-line @typescript-eslint/no-explicit-any export default async (endpoint: string): Promise => { const response = await fetch(`https://data.police.uk/api${endpoint}`) From 51fd6dc86fbf48b975bf1e853976b66c84aa3a39 Mon Sep 17 00:00:00 2001 From: Alex Chesters <10558792+AlexChesters@users.noreply.github.com> Date: Tue, 5 Aug 2025 09:36:10 +0000 Subject: [PATCH 2/2] remove unneeded type --- package-lock.json | 13 ------------- package.json | 1 - 2 files changed, 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index 812be07..8d93295 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,6 @@ "license": "MIT", "devDependencies": { "@types/chai": "^4.3.6", - "@types/isomorphic-fetch": "0.0.37", "@types/jest": "^29.5.5", "@types/ramda": "^0.29.5", "@typescript-eslint/eslint-plugin": "^6.7.4", @@ -1208,12 +1207,6 @@ "@types/node": "*" } }, - "node_modules/@types/isomorphic-fetch": { - "version": "0.0.37", - "resolved": "https://registry.npmjs.org/@types/isomorphic-fetch/-/isomorphic-fetch-0.0.37.tgz", - "integrity": "sha512-+27HulrbyFpcalE4Agl+KHfGi4Qkcdmxv/ISi+DmUs5NECAFxRHeuZaLJj6DBfDRle6yxCOqLHJrfyVy9y5x9w==", - "dev": true - }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", @@ -6846,12 +6839,6 @@ "@types/node": "*" } }, - "@types/isomorphic-fetch": { - "version": "0.0.37", - "resolved": "https://registry.npmjs.org/@types/isomorphic-fetch/-/isomorphic-fetch-0.0.37.tgz", - "integrity": "sha512-+27HulrbyFpcalE4Agl+KHfGi4Qkcdmxv/ISi+DmUs5NECAFxRHeuZaLJj6DBfDRle6yxCOqLHJrfyVy9y5x9w==", - "dev": true - }, "@types/istanbul-lib-coverage": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", diff --git a/package.json b/package.json index 2eef388..a06f375 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,6 @@ "dependencies": {}, "devDependencies": { "@types/chai": "^4.3.6", - "@types/isomorphic-fetch": "0.0.37", "@types/jest": "^29.5.5", "@types/ramda": "^0.29.5", "@typescript-eslint/eslint-plugin": "^6.7.4",