diff --git a/.changeset/config.json b/.changeset/config.json index 6e24af1..f2a9edc 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -3,7 +3,7 @@ "changelog": [ "@changesets/changelog-github", { - "repo": "un-ts/fetch-api" + "repo": "un-ts/x-fetch" } ], "commit": false, diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a5143dd..c00777f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,8 +33,8 @@ jobs: with: publish: yarn release version: yarn changeset version - commit: 'chore: release fetch-api' - title: 'chore: release fetch-api' + commit: 'chore: release x-fetch' + title: 'chore: release x-fetch' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/README.md b/README.md index 01b6391..ac4e377 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# fetch-api +# x-fetch -[![GitHub Actions](https://github.com/un-ts/fetch-api/workflows/CI/badge.svg)](https://github.com/un-ts/fetch-api/actions/workflows/ci.yml) -[![Codecov](https://img.shields.io/codecov/c/github/un-ts/fetch-api.svg)](https://codecov.io/gh/un-ts/fetch-api) -[![type-coverage](https://img.shields.io/badge/dynamic/json.svg?label=type-coverage&prefix=%E2%89%A5&suffix=%&query=$.typeCoverage.atLeast&uri=https%3A%2F%2Fraw.githubusercontent.com%2Fun-ts%2Ffetch-api%2Fmain%2Fpackage.json)](https://github.com/plantain-00/type-coverage) -[![npm](https://img.shields.io/npm/v/fetch-api.svg)](https://www.npmjs.com/package/fetch-api) -[![GitHub Release](https://img.shields.io/github/release/un-ts/fetch-api)](https://github.com/un-ts/fetch-api/releases) +[![GitHub Actions](https://github.com/un-ts/x-fetch/workflows/CI/badge.svg)](https://github.com/un-ts/x-fetch/actions/workflows/ci.yml) +[![Codecov](https://img.shields.io/codecov/c/github/un-ts/x-fetch.svg)](https://codecov.io/gh/un-ts/x-fetch) +[![type-coverage](https://img.shields.io/badge/dynamic/json.svg?label=type-coverage&prefix=%E2%89%A5&suffix=%&query=$.typeCoverage.atLeast&uri=https%3A%2F%2Fraw.githubusercontent.com%2Fun-ts%2Fx-fetch%2Fmain%2Fpackage.json)](https://github.com/plantain-00/type-coverage) +[![npm](https://img.shields.io/npm/v/x-fetch.svg)](https://www.npmjs.com/package/x-fetch) +[![GitHub Release](https://img.shields.io/github/release/un-ts/x-fetch)](https://github.com/un-ts/x-fetch/releases) [![Conventional Commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org) [![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com) @@ -30,19 +30,19 @@ A simple but elegant `fetch` API wrapper, use `fetch` like a charm ```sh # pnpm -pnpm add fetch-api +pnpm add x-fetch # yarn -yarn add fetch-api +yarn add x-fetch # npm -npm i fetch-api +npm i x-fetch ``` ### API ```ts -import { ApiMethod, createFetchApi, fetchApi, interceptors } from 'fetch-api' +import { ApiMethod, createFetchApi, fetchApi, interceptors } from 'x-fetch' // plain url, GET method await fetchApi('url') diff --git a/docs/index.html b/docs/index.html index caaecf6..bb3eccf 100644 --- a/docs/index.html +++ b/docs/index.html @@ -10,7 +10,7 @@ name="viewport" content="width=device-width, initial-scale=1.0" /> - fetch-api + x-fetch
diff --git a/package.json b/package.json index d45e2dc..10e70fc 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { - "name": "fetch-api", + "name": "x-fetch", "version": "0.1.0", "type": "module", "description": "A simple but elegant `fetch` API wrapper, use `fetch` like a charm", - "repository": "git+https://github.com/un-ts/fetch-api.git", + "repository": "git+https://github.com/un-ts/x-fetch.git", "author": "JounQin (https://www.1stG.me) ", "funding": "https://opencollective.com/unts", "license": "MIT", diff --git a/test/basic.spec.ts b/test/basic.spec.ts index 79d923c..cfb18dc 100644 --- a/test/basic.spec.ts +++ b/test/basic.spec.ts @@ -1,4 +1,4 @@ -import { type ApiInterceptor, fetchApi, interceptors } from 'fetch-api' +import { type ApiInterceptor, fetchApi, interceptors } from 'x-fetch' test('it should just work', async () => { expect( diff --git a/vercel.json b/vercel.json index 14f9d3f..6b870f7 100644 --- a/vercel.json +++ b/vercel.json @@ -1,7 +1,8 @@ { "version": 2, "alias": [ - "ifetch.vercel.app" + "ifetch.vercel.app", + "xfetch.vercel.app" ], "github": { "silent": true diff --git a/vitest.config.ts b/vitest.config.ts index 94ce767..2e85994 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -9,7 +9,7 @@ export default defineConfig({ ], resolve: { alias: { - 'fetch-api': './src/index.ts', + 'x-fetch': './src/index.ts', }, }, test: { diff --git a/yarn.lock b/yarn.lock index d851c04..6f1cbf4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9479,45 +9479,6 @@ __metadata: languageName: node linkType: hard -"fetch-api@workspace:.": - version: 0.0.0-use.local - resolution: "fetch-api@workspace:." - dependencies: - "@1stg/app-config": "npm:^9.0.0" - "@1stg/lib-config": "npm:^12.0.0" - "@changesets/changelog-github": "npm:^0.4.8" - "@changesets/cli": "npm:^2.26.2" - "@mdx-js/rollup": "npm:^3.0.0" - "@pkgr/rollup": "npm:^4.1.3" - "@size-limit/preset-small-lib": "npm:^10.0.2" - "@types/mdx": "npm:^2.0.9" - "@types/node": "npm:^20.8.10" - "@types/react": "npm:^18.2.36" - "@types/react-dom": "npm:^18.2.14" - "@vitejs/plugin-react-swc": "npm:^3.4.1" - "@vitest/coverage-istanbul": "npm:^0.34.6" - commitlint: "npm:^18.2.0" - eslint: "npm:^8.53.0" - github-markdown-css: "npm:^5.4.0" - lint-staged: "npm:^13.3.0" - npm-run-all: "npm:^4.1.5" - react: "npm:^18.2.0" - react-dom: "npm:^18.2.0" - react-router-dom: "npm:^6.18.0" - rehype-slug: "npm:^6.0.0" - remark-gfm: "npm:^4.0.0" - simple-git-hooks: "npm:^2.9.0" - size-limit: "npm:^10.0.2" - stylelint: "npm:^15.11.0" - tslib: "npm:^2.6.2" - type-coverage: "npm:^2.27.0" - typescript: "npm:^5.2.2" - unplugin-auto-import: "npm:^0.16.7" - vite: "npm:^4.5.0" - vitest: "npm:^0.34.6" - languageName: unknown - linkType: soft - "figures@npm:^1.3.5": version: 1.7.0 resolution: "figures@npm:1.7.0" @@ -21475,6 +21436,45 @@ __metadata: languageName: node linkType: hard +"x-fetch@workspace:.": + version: 0.0.0-use.local + resolution: "x-fetch@workspace:." + dependencies: + "@1stg/app-config": "npm:^9.0.0" + "@1stg/lib-config": "npm:^12.0.0" + "@changesets/changelog-github": "npm:^0.4.8" + "@changesets/cli": "npm:^2.26.2" + "@mdx-js/rollup": "npm:^3.0.0" + "@pkgr/rollup": "npm:^4.1.3" + "@size-limit/preset-small-lib": "npm:^10.0.2" + "@types/mdx": "npm:^2.0.9" + "@types/node": "npm:^20.8.10" + "@types/react": "npm:^18.2.36" + "@types/react-dom": "npm:^18.2.14" + "@vitejs/plugin-react-swc": "npm:^3.4.1" + "@vitest/coverage-istanbul": "npm:^0.34.6" + commitlint: "npm:^18.2.0" + eslint: "npm:^8.53.0" + github-markdown-css: "npm:^5.4.0" + lint-staged: "npm:^13.3.0" + npm-run-all: "npm:^4.1.5" + react: "npm:^18.2.0" + react-dom: "npm:^18.2.0" + react-router-dom: "npm:^6.18.0" + rehype-slug: "npm:^6.0.0" + remark-gfm: "npm:^4.0.0" + simple-git-hooks: "npm:^2.9.0" + size-limit: "npm:^10.0.2" + stylelint: "npm:^15.11.0" + tslib: "npm:^2.6.2" + type-coverage: "npm:^2.27.0" + typescript: "npm:^5.2.2" + unplugin-auto-import: "npm:^0.16.7" + vite: "npm:^4.5.0" + vitest: "npm:^0.34.6" + languageName: unknown + linkType: soft + "xml-name-validator@npm:^4.0.0": version: 4.0.0 resolution: "xml-name-validator@npm:4.0.0"