diff --git a/package-lock.json b/package-lock.json index 8982fbb..014124f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,8 @@ "dependencies": { "cheerio": "^1.0.0-rc.12", "crypto-js": "^4.1.1", - "form-data": "^4.0.0" + "form-data": "^4.0.0", + "node-fetch": "^3.3.2" }, "devDependencies": { "@types/crypto-js": "^4.1.1", @@ -2081,6 +2082,14 @@ "optional": true, "peer": true }, + "node_modules/data-uri-to-buffer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", + "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", + "engines": { + "node": ">= 12" + } + }, "node_modules/data-urls": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz", @@ -3129,6 +3138,28 @@ "reusify": "^1.0.4" } }, + "node_modules/fetch-blob": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", + "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "paypal", + "url": "https://paypal.me/jimmywarting" + } + ], + "dependencies": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + }, + "engines": { + "node": "^12.20 || >= 14.13" + } + }, "node_modules/file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", @@ -3210,6 +3241,17 @@ "node": ">= 6" } }, + "node_modules/formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "dependencies": { + "fetch-blob": "^3.1.2" + }, + "engines": { + "node": ">=12.20.0" + } + }, "node_modules/fs-extra": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", @@ -4407,6 +4449,41 @@ "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", "dev": true }, + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "engines": { + "node": ">=10.5.0" + } + }, + "node_modules/node-fetch": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -5907,6 +5984,14 @@ "node": ">=10" } }, + "node_modules/web-streams-polyfill": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", + "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==", + "engines": { + "node": ">= 8" + } + }, "node_modules/webidl-conversions": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", diff --git a/package.json b/package.json index f139986..4d6acc8 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "dependencies": { "cheerio": "^1.0.0-rc.12", "crypto-js": "^4.1.1", - "form-data": "^4.0.0" + "form-data": "^4.0.0", + "node-fetch": "^3.3.2" } } diff --git a/src/__test__/oof.test.ts b/src/__test__/oof.test.ts index 634d1c8..f17bde3 100644 --- a/src/__test__/oof.test.ts +++ b/src/__test__/oof.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from "vitest"; + describe('oof.ts', () => { it('should contain hello', () => { expect('hello').toContain('hello'); diff --git a/src/fetchers/standardFetch.ts b/src/fetchers/standardFetch.ts index 54ad91e..a4000eb 100644 --- a/src/fetchers/standardFetch.ts +++ b/src/fetchers/standardFetch.ts @@ -1,3 +1,5 @@ +import fetch from 'node-fetch'; + import { makeFullUrl } from '@/fetchers/common'; import { Fetcher } from '@/fetchers/types'; diff --git a/tsconfig.json b/tsconfig.json index d8fea61..d3fea2f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,7 +9,7 @@ "baseUrl": "src", "experimentalDecorators": true, "isolatedModules": false, - "types": ["vitest/globals"], + "skipLibCheck": true, "paths": { "@/*": ["./*"], "@entrypoint": ["./index.ts"] diff --git a/vite.config.js b/vite.config.js index 5217c56..d3f922b 100644 --- a/vite.config.js +++ b/vite.config.js @@ -6,12 +6,7 @@ const dts = require('vite-plugin-dts'); const main = path.resolve(__dirname, 'src/index.ts'); module.exports = defineConfig({ - plugins: [ - eslint(), - dts({ - include: [main], - }), - ], + plugins: [eslint(), dts({})], resolve: { alias: { '@': path.resolve(__dirname, './src'), @@ -23,11 +18,8 @@ module.exports = defineConfig({ lib: { entry: main, - name: 'providers', - fileName: 'providers', + name: 'index', + fileName: 'index', }, }, - test: { - globals: true, - }, });