From 9e4224c29f62b016851a84ec463df8b53bcbb787 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Tue, 15 Nov 2022 13:32:25 +0100 Subject: [PATCH] chore: migrate to `ofetch` --- package.json | 2 +- pnpm-lock.yaml | 38 ++++++++++--------------------- src/drivers/cloudflare-kv-http.ts | 2 +- src/drivers/github.ts | 2 +- src/drivers/http.ts | 2 +- test/server.test.ts | 2 +- 6 files changed, 17 insertions(+), 31 deletions(-) diff --git a/package.json b/package.json index d20cc073..8d9216dd 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "listhen": "^1.0.0", "mkdir": "^0.0.2", "mri": "^1.2.0", - "ohmyfetch": "^0.4.21", + "ofetch": "^1.0.0", "ufo": "^1.0.0", "ws": "^8.11.0" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5cf8dd48..686e78df 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -26,7 +26,7 @@ specifiers: monaco-editor: ^0.34.1 mri: ^1.2.0 msw: ^0.48.2 - ohmyfetch: ^0.4.21 + ofetch: ^1.0.0 types-cloudflare-worker: ^1.2.0 typescript: ^4.8.4 ufo: ^1.0.0 @@ -45,7 +45,7 @@ dependencies: listhen: 1.0.0 mkdir: 0.0.2 mri: 1.2.0 - ohmyfetch: 0.4.21 + ofetch: 1.0.0 ufo: 1.0.0 ws: 8.11.0 @@ -1144,13 +1144,6 @@ packages: semver: 7.3.8 dev: true - /busboy/1.6.0: - resolution: {integrity: sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==} - engines: {node: '>=10.16.0'} - dependencies: - streamsearch: 1.1.0 - dev: false - /c12/0.2.13: resolution: {integrity: sha512-wJL0/knDbqM/3moLb+8Xd+w3JdkggkIIhiNBkxZ1mWlskKC/vajb85wM3UPg/D9nK6RbI1NgaVTg6AeXBVbknA==} dependencies: @@ -4142,6 +4135,11 @@ packages: /node-fetch-native/0.1.8: resolution: {integrity: sha512-ZNaury9r0NxaT2oL65GvdGDy+5PlSaHTovT6JV5tOW07k1TQmgC0olZETa4C9KZg0+6zBr99ctTYa3Utqj9P/Q==} + dev: true + + /node-fetch-native/1.0.1: + resolution: {integrity: sha512-VzW+TAk2wE4X9maiKMlT+GsPU4OMmR1U9CrHSmd3DFLn2IcZ9VJ6M6BBugGfYUnPCLSYxXdZy17M0BEJyhUTwg==} + dev: false /node-fetch/2.6.7: resolution: {integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==} @@ -4223,13 +4221,12 @@ packages: es-abstract: 1.20.1 dev: true - /ohmyfetch/0.4.21: - resolution: {integrity: sha512-VG7f/JRvqvBOYvL0tHyEIEG7XHWm7OqIfAs6/HqwWwDfjiJ1g0huIpe5sFEmyb+7hpFa1EGNH2aERWR72tlClw==} + /ofetch/1.0.0: + resolution: {integrity: sha512-d40aof8czZFSQKJa4+F7Ch3UC5D631cK1TTUoK+iNEut9NoiCL+u0vykl/puYVUS2df4tIQl5upQcolIcEzQjQ==} dependencies: destr: 1.2.1 - node-fetch-native: 0.1.8 - ufo: 0.8.6 - undici: 5.12.0 + node-fetch-native: 1.0.1 + ufo: 1.0.0 dev: false /once/1.4.0: @@ -4854,11 +4851,6 @@ packages: engines: {node: '>= 0.8'} dev: true - /streamsearch/1.1.0: - resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} - engines: {node: '>=10.0.0'} - dev: false - /strict-event-emitter/0.2.7: resolution: {integrity: sha512-TavbHJ87WD2tDbKI7bTrmc6U4J4Qjh8E9fVvFkIFw2gCu34Wxstn2Yas0+4D78FJN8DOTEzxiT+udBdraRk4UQ==} dependencies: @@ -5153,6 +5145,7 @@ packages: /ufo/0.8.6: resolution: {integrity: sha512-fk6CmUgwKCfX79EzcDQQpSCMxrHstvbLswFChHS0Vump+kFkw7nJBfTZoC1j0bOGoY9I7R3n2DGek5ajbcYnOw==} + dev: true /ufo/1.0.0: resolution: {integrity: sha512-DRty0ZBNlJ2R59y4mEupJRKLbkLQsc4qtxjpQv78AwEDuBkaUogMc2LkeqW3HddFlw6NwnXYfdThEZOiNgkmmQ==} @@ -5206,13 +5199,6 @@ packages: resolution: {integrity: sha512-BQFnUDuAQ4Yf/cYY5LNrK9NCJFKriaRbD9uR1fTeXnBeoa97W0i41qkZfGO9pSo8I5KzjAcSY2XYtdf0oKd7KQ==} dev: true - /undici/5.12.0: - resolution: {integrity: sha512-zMLamCG62PGjd9HHMpo05bSLvvwWOZgGeiWlN/vlqu3+lRo3elxktVGEyLMX+IO7c2eflLjcW74AlkhEZm15mg==} - engines: {node: '>=12.18'} - dependencies: - busboy: 1.6.0 - dev: false - /unified/9.2.2: resolution: {integrity: sha512-Sg7j110mtefBD+qunSLO1lqOEKdrwBFBrR6Qd8f4uwkhWNlbkaqwHse6e7QvD3AP/MNoJdEDLaf8OxYyoWgorQ==} dependencies: diff --git a/src/drivers/cloudflare-kv-http.ts b/src/drivers/cloudflare-kv-http.ts index 13f0da97..9e5181ae 100644 --- a/src/drivers/cloudflare-kv-http.ts +++ b/src/drivers/cloudflare-kv-http.ts @@ -1,4 +1,4 @@ -import { $fetch } from 'ohmyfetch' +import { $fetch } from 'ofetch' import { defineDriver } from './utils' const LOG_TAG = '[unstorage] [cloudflare-http] ' diff --git a/src/drivers/github.ts b/src/drivers/github.ts index 35b1e7a9..aa98b095 100644 --- a/src/drivers/github.ts +++ b/src/drivers/github.ts @@ -1,5 +1,5 @@ import { defineDriver } from './utils' -import { $fetch } from 'ohmyfetch' +import { $fetch } from 'ofetch' import { withTrailingSlash, joinURL } from 'ufo' export interface GithubOptions { diff --git a/src/drivers/http.ts b/src/drivers/http.ts index 6d23920b..4d5477ef 100644 --- a/src/drivers/http.ts +++ b/src/drivers/http.ts @@ -1,6 +1,6 @@ import { defineDriver } from './utils' import { stringify } from './utils' -import { $fetch } from 'ohmyfetch' +import { $fetch } from 'ofetch' import { joinURL } from 'ufo' export interface HTTPOptions { diff --git a/test/server.test.ts b/test/server.test.ts index 8b52254f..75c5c618 100644 --- a/test/server.test.ts +++ b/test/server.test.ts @@ -1,6 +1,6 @@ import { describe, it, expect } from "vitest"; import { listen } from "listhen"; -import { $fetch } from "ohmyfetch"; +import { $fetch } from "ofetch"; import { createStorage } from "../src"; import { createStorageServer } from "../src/server";