Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: unexpected incorrect entries #4

Merged
merged 4 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/cyan-readers-bake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"x-fetch": patch
---

fix: unexpected incorrect entries
2 changes: 1 addition & 1 deletion .codesandbox/ci.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"node": "16",
"node": "18",
"sandboxes": []
}
11 changes: 0 additions & 11 deletions .github/FUNDING.yml

This file was deleted.

20 changes: 16 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
strategy:
matrix:
node:
- 16
- 18
- 20
os:
Expand All @@ -21,23 +22,34 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Enable Corepack
run: corepack enable

- name: Setup Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: yarn

- name: Enable Corepack
run: corepack enable
env:
# https://github.com/actions/setup-node/issues/531#issuecomment-1819151412
SKIP_YARN_COREPACK_CHECK: 1
YARN_IGNORE_NODE: 1

- name: Install Dependencies
run: yarn --immutable
env:
SKIP_YARN_COREPACK_CHECK: 1
YARN_IGNORE_NODE: 1

- name: Build, Lint and Test
run: yarn run-s build lint test
run: |
yarn build
yarn lint
env:
EFF_NO_LINK_RULES: true
PARSER_NO_WATCH: true
SKIP_YARN_COREPACK_CHECK: 1
YARN_IGNORE_NODE: 1

- name: Codecov
uses: codecov/codecov-action@v3
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ jobs:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0

- name: Setup Node.js 20
- name: Enable Corepack
run: corepack enable

- name: Setup Node.js LTS
uses: actions/setup-node@v4
with:
node-version: 20
node-version: lts/*
cache: yarn

- name: Enable Corepack
run: corepack enable

- name: Install Dependencies
run: yarn --immutable

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/size-limit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup Node.js 20
- name: Enable Corepack
run: corepack enable

- name: Setup Node.js LTS
uses: actions/setup-node@v4
with:
node-version: 20
node-version: lts/*
cache: yarn

- name: Enable Corepack
run: corepack enable

- name: Install Dependencies
run: yarn --immutable

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ coverage
dist
lib
node_modules
/auto-imports.d.ts
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import { ApiMethod, createFetchApi, fetchApi, interceptors } from 'x-fetch'
// plain url, GET method
await fetchApi('url')

// with options, `body`, `query`, etc.
// with options, `method`, `body`, `query`, etc.
await fetchApi('url', {
method: ApiMethod.POST, // or 'POST'
// plain object or array, or BodyInit
Expand Down
21 changes: 0 additions & 21 deletions auto-imports.d.ts

This file was deleted.

11 changes: 4 additions & 7 deletions docs/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ import { defineConfig } from 'vite'

export default defineConfig({
plugins: [
{
enforce: 'pre',
...mdx({
remarkPlugins: [remarkGfm],
rehypePlugins: [rehypeSlug],
}),
},
mdx({
remarkPlugins: [remarkGfm],
rehypePlugins: [rehypeSlug],
}),
react(),
],
build: {
Expand Down
61 changes: 35 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@
"author": "JounQin (https://www.1stG.me) <[email protected]>",
"funding": "https://opencollective.com/unts",
"license": "MIT",
"packageManager": "[email protected].1",
"packageManager": "[email protected].2",
"engines": {
"node": ">=18.0.0"
"node": ">=4.0.0"
},
"exports": "./src/index.ts",
"files": [
"lib",
"!**/*.tsbuildinfo"
],
"scripts": {
"build": "run-p 'build:*'",
"build": "yarn test && concurrently 'yarn:build:*'",
"build:r": "r -f cjs",
"build:tsc": "tsc -p src",
"dev": "vitest",
"docs:build": "vite build docs --emptyOutDir",
"docs:dev": "vite docs",
"lint": "run-p 'lint:*'",
"lint": "concurrently 'yarn:lint:*'",
"lint:es": "eslint . --cache -f friendly --max-warnings 10",
"lint:style": "stylelint . --cache",
"lint:tsc": "tsc --noEmit",
Expand All @@ -38,37 +38,46 @@
"tslib": "^2.6.2"
},
"devDependencies": {
"@1stg/app-config": "^9.0.0",
"@1stg/lib-config": "^12.0.0",
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.2",
"@1stg/app-config": "^9.0.1",
"@1stg/lib-config": "^12.0.1",
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.1",
"@commitlint/cli": "^18.4.3",
"@edge-runtime/vm": "^3.1.7",
"@mdx-js/rollup": "^3.0.0",
"@pkgr/rollup": "^4.1.3",
"@size-limit/preset-small-lib": "^10.0.2",
"@types/mdx": "^2.0.9",
"@types/node": "^20.8.10",
"@types/react": "^18.2.36",
"@types/react-dom": "^18.2.14",
"@vitejs/plugin-react-swc": "^3.4.1",
"@vitest/coverage-istanbul": "^0.34.6",
"commitlint": "^18.2.0",
"eslint": "^8.53.0",
"github-markdown-css": "^5.4.0",
"lint-staged": "^13.3.0",
"npm-run-all": "^4.1.5",
"@size-limit/preset-small-lib": "^11.0.1",
"@types/mdx": "^2.0.10",
"@types/node": "^20.10.4",
"@types/react": "^18.2.45",
"@types/react-dom": "^18.2.17",
"@types/web": "^0.0.127",
"@vitejs/plugin-react-swc": "^3.5.0",
"@vitest/coverage-istanbul": "^1.0.4",
"concurrently": "^8.2.2",
"eslint": "^8.55.0",
"github-markdown-css": "^5.5.0",
"lint-staged": "^15.2.0",
"prettier": "^2.8.8",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.18.0",
"react-router-dom": "^6.21.0",
"rehype-slug": "^6.0.0",
"remark-gfm": "^4.0.0",
"simple-git-hooks": "^2.9.0",
"size-limit": "^10.0.2",
"size-limit": "^11.0.1",
"stylelint": "^15.11.0",
"type-coverage": "^2.27.0",
"typescript": "^5.2.2",
"unplugin-auto-import": "^0.16.7",
"vite": "^4.5.0",
"vitest": "^0.34.6"
"typescript": "^5.3.3",
"unplugin-auto-import": "^0.17.2",
"vite": "^5.0.8",
"vitest": "^1.0.4"
},
"resolutions": {
"@commitlint/cli": "^18.4.3",
"lint-staged": "^15.2.0",
"prettier": "^2.8.8",
"rollup": "^4.3.0"
},
"publishConfig": {
"main": "./lib/index.cjs",
Expand Down
6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"extends": "@1stg/tsconfig/node16",
"compilerOptions": {
"lib": ["DOM", "ESNext"],
"module": "Node16",
"rootDir": "."
"paths": {
"x-fetch": ["./src/index.ts"]
}
}
}
4 changes: 3 additions & 1 deletion vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ export default defineConfig({
],
resolve: {
alias: {
'x-fetch': './src/index.ts',
'x-fetch': new URL('src/index.ts', import.meta.url).pathname,
},
},
test: {
environment: 'edge-runtime',
coverage: {
provider: 'istanbul',
reporter: ['lcov', 'json', 'text'],
include: ['src'],
},
},
})
Loading
Loading