@hyper-fetch/axios 8.2.0 → 8.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/__tests__/tsconfig.json +4 -14
- package/package.json +8 -8
- package/tsconfig.json +2 -3
- package/vite.config.ts +14 -20
- package/.eslintrc.cjs +0 -12
package/README.md
CHANGED
|
@@ -30,7 +30,9 @@
|
|
|
30
30
|
|
|
31
31
|
## 📖 About
|
|
32
32
|
|
|
33
|
-
This adapter replaces HyperFetch's built-in HTTP engine with Axios. You get all of Axios's features — interceptors,
|
|
33
|
+
This adapter replaces HyperFetch's built-in HTTP engine with Axios. You get all of Axios's features — interceptors,
|
|
34
|
+
automatic JSON transforms, request/response transforms — while keeping HyperFetch's typed request system, caching,
|
|
35
|
+
queuing, and React hooks.
|
|
34
36
|
|
|
35
37
|
## 🎯 Key Capabilities
|
|
36
38
|
|
|
@@ -82,9 +84,7 @@ axiosInstance.interceptors.response.use(
|
|
|
82
84
|
},
|
|
83
85
|
);
|
|
84
86
|
|
|
85
|
-
const client = createClient({ url: "https://api.example.com" }).setAdapter(
|
|
86
|
-
AxiosAdapter({ instance: axiosInstance }),
|
|
87
|
-
);
|
|
87
|
+
const client = createClient({ url: "https://api.example.com" }).setAdapter(AxiosAdapter({ instance: axiosInstance }));
|
|
88
88
|
```
|
|
89
89
|
|
|
90
90
|
### Create typed requests (same as core)
|
package/__tests__/tsconfig.json
CHANGED
|
@@ -1,21 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
+
"extends": "../tsconfig.json",
|
|
2
3
|
"compilerOptions": {
|
|
3
|
-
"target": "esnext",
|
|
4
|
-
"module": "esnext",
|
|
5
|
-
"moduleResolution": "bundler",
|
|
6
|
-
"lib": ["dom", "dom.iterable", "ESNext"],
|
|
7
|
-
"strict": true,
|
|
8
4
|
"noEmit": true,
|
|
9
|
-
"skipLibCheck": true,
|
|
10
|
-
"esModuleInterop": true,
|
|
11
|
-
"allowSyntheticDefaultImports": true,
|
|
12
|
-
"resolveJsonModule": true,
|
|
13
|
-
"isolatedModules": true,
|
|
14
5
|
"noUnusedLocals": false,
|
|
15
6
|
"noUnusedParameters": false,
|
|
16
|
-
"types": ["vitest/globals", "@types/node"]
|
|
17
|
-
"baseUrl": "../src",
|
|
18
|
-
"paths": {}
|
|
7
|
+
"types": ["vitest/globals", "@types/node"]
|
|
19
8
|
},
|
|
20
|
-
"include": ["**/*.ts", "**/*.tsx", "../../../global.d.ts", "../../../vitest.d.ts"]
|
|
9
|
+
"include": ["**/*.ts", "**/*.tsx", "../../../global.d.ts", "../../../vitest.d.ts"],
|
|
10
|
+
"exclude": ["node_modules"]
|
|
21
11
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyper-fetch/axios",
|
|
3
|
-
"version": "8.2.
|
|
3
|
+
"version": "8.2.3",
|
|
4
4
|
"description": "Simple axios adapter for Hyper Fetch",
|
|
5
5
|
"author": "Maciej Pyrc <maciekpyrc@gmail.com>, Kacper Skawina <kacper.skawina@gmail.com>",
|
|
6
6
|
"homepage": "https://hyperfetch.bettertyped.com/",
|
|
@@ -11,17 +11,17 @@
|
|
|
11
11
|
"source": "src/index.ts",
|
|
12
12
|
"scripts": {
|
|
13
13
|
"test": "vitest run",
|
|
14
|
-
"start": "
|
|
14
|
+
"start": "pnpm build && npx run-when-changed --watch 'src/**/*.ts' --exec 'pnpm build'",
|
|
15
15
|
"build": "vite build",
|
|
16
|
-
"lint": "
|
|
17
|
-
"format": "
|
|
18
|
-
"typecheck": "
|
|
19
|
-
"tests": "
|
|
20
|
-
"release": "
|
|
16
|
+
"lint": "oxlint .",
|
|
17
|
+
"format": "oxfmt --write .",
|
|
18
|
+
"typecheck": "tsgo --noEmit --emitDeclarationOnly false && tsgo --noEmit -p __tests__/tsconfig.json",
|
|
19
|
+
"tests": "pnpm lint-staged",
|
|
20
|
+
"release": "pnpm semantic-release --extends ../../release.config.js -t 'hyper-fetch-axios-v${version}'"
|
|
21
21
|
},
|
|
22
22
|
"publishConfig": {
|
|
23
23
|
"access": "public",
|
|
24
|
-
"registry": "https://registry.npmjs.
|
|
24
|
+
"registry": "https://registry.npmjs.org/"
|
|
25
25
|
},
|
|
26
26
|
"repository": {
|
|
27
27
|
"type": "git",
|
package/tsconfig.json
CHANGED
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
"extends": "../../tsconfig.json",
|
|
3
3
|
"compilerOptions": {
|
|
4
4
|
"rootDir": ".",
|
|
5
|
-
"baseUrl": "./src",
|
|
6
5
|
"paths": {
|
|
7
|
-
"@browser-adapter": ["./adapter/adapter.browser.ts"],
|
|
8
|
-
"@server-adapter": ["./adapter/adapter.server.ts"]
|
|
6
|
+
"@browser-adapter": ["./src/adapter/adapter.browser.ts"],
|
|
7
|
+
"@server-adapter": ["./src/adapter/adapter.server.ts"]
|
|
9
8
|
}
|
|
10
9
|
},
|
|
11
10
|
"exclude": ["node_modules", "dist", "vite.config.ts", "__tests__"]
|
package/vite.config.ts
CHANGED
|
@@ -1,45 +1,39 @@
|
|
|
1
1
|
/// <reference types="vitest/config" />
|
|
2
|
+
import path from "path";
|
|
2
3
|
import { defineConfig } from "vite";
|
|
3
4
|
import dts from "vite-plugin-dts";
|
|
4
5
|
import tsconfigPaths from "vite-tsconfig-paths";
|
|
5
|
-
|
|
6
|
-
import { getDtsCompilerOptionsForPackage } from "../../scripts/vite-dts-internal-paths";
|
|
6
|
+
|
|
7
7
|
import { getRollupExternalsFromPackageJson } from "../../scripts/vite-lib-externals-from-package";
|
|
8
8
|
|
|
9
9
|
export default defineConfig({
|
|
10
10
|
build: {
|
|
11
11
|
lib: {
|
|
12
12
|
entry: "src/index.ts",
|
|
13
|
-
formats: ["es"],
|
|
14
13
|
fileName: "index",
|
|
14
|
+
formats: ["es"],
|
|
15
15
|
},
|
|
16
|
-
sourcemap: true,
|
|
17
16
|
minify: false,
|
|
18
17
|
rollupOptions: {
|
|
19
18
|
external: getRollupExternalsFromPackageJson(__dirname),
|
|
20
19
|
},
|
|
20
|
+
sourcemap: true,
|
|
21
21
|
},
|
|
22
|
-
plugins: [
|
|
23
|
-
dts({
|
|
24
|
-
entryRoot: "src",
|
|
25
|
-
compilerOptions: getDtsCompilerOptionsForPackage(__dirname),
|
|
26
|
-
}),
|
|
27
|
-
tsconfigPaths(),
|
|
28
|
-
],
|
|
22
|
+
plugins: [tsconfigPaths(), dts({ entryRoot: "src" })],
|
|
29
23
|
test: {
|
|
30
|
-
globals: true,
|
|
31
|
-
environment: "node",
|
|
32
|
-
setupFiles: ["./__tests__/vitest.setup.ts"],
|
|
33
|
-
include: ["__tests__/**/*.spec.{ts,tsx}", "src/**/*.spec.{ts,tsx}"],
|
|
34
|
-
coverage: {
|
|
35
|
-
provider: "v8",
|
|
36
|
-
include: ["src/**/*.{ts,tsx}"],
|
|
37
|
-
exclude: ["**/*.spec.*", "**/types.*", "**/constants.*", "**/index.ts"],
|
|
38
|
-
},
|
|
39
24
|
alias: {
|
|
40
25
|
"@hyper-fetch/core": path.resolve(__dirname, "../core/src/index.ts"),
|
|
41
26
|
"@hyper-fetch/sockets": path.resolve(__dirname, "../sockets/src/index.ts"),
|
|
42
27
|
"@hyper-fetch/testing": path.resolve(__dirname, "../testing/src/index.ts"),
|
|
43
28
|
},
|
|
29
|
+
coverage: {
|
|
30
|
+
exclude: ["**/*.spec.*", "**/types.*", "**/constants.*", "**/index.ts"],
|
|
31
|
+
include: ["src/**/*.{ts,tsx}"],
|
|
32
|
+
provider: "v8",
|
|
33
|
+
},
|
|
34
|
+
environment: "node",
|
|
35
|
+
globals: true,
|
|
36
|
+
include: ["__tests__/**/*.spec.{ts,tsx}", "src/**/*.spec.{ts,tsx}"],
|
|
37
|
+
setupFiles: ["./__tests__/vitest.setup.ts"],
|
|
44
38
|
},
|
|
45
39
|
});
|
package/.eslintrc.cjs
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: ["plugin:@nx/react", "../../.eslintrc.js"],
|
|
3
|
-
parserOptions: {
|
|
4
|
-
tsconfigRootDir: __dirname,
|
|
5
|
-
project: ["./tsconfig.json", "./__tests__/tsconfig.json"],
|
|
6
|
-
},
|
|
7
|
-
rules: {
|
|
8
|
-
"react/jsx-props-no-spreading": 0,
|
|
9
|
-
"react/require-default-props": 0,
|
|
10
|
-
},
|
|
11
|
-
ignorePatterns: ["dist/", "coverage/", "vite.config.ts", "/*.js"],
|
|
12
|
-
};
|