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..8d93295 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,12 +8,8 @@ "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", "@types/jest": "^29.5.5", "@types/ramda": "^0.29.5", "@typescript-eslint/eslint-plugin": "^6.7.4", @@ -1211,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", @@ -3675,15 +3665,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 +4543,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 +5791,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", @@ -6901,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", @@ -8644,15 +8576,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 +9252,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 +10122,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..a06f375 100644 --- a/package.json +++ b/package.json @@ -33,12 +33,9 @@ "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", "@types/jest": "^29.5.5", "@types/ramda": "^0.29.5", "@typescript-eslint/eslint-plugin": "^6.7.4", 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}`)