@uni-helper/axios-adapter 1.18.0 → 1.20.0
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 +67 -23
- package/dist/index.cjs +13 -9
- package/dist/index.d.cts +6 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.js +12 -8
- package/dist/{rolldown-runtime-D6vf50IK.cjs → rolldown-runtime-VH7oDXx4.cjs} +1 -1
- package/dist/{unplugin-Cgwh-Njz.cjs → unplugin-DATd423M.cjs} +2 -2
- package/dist/{unplugin-Br8JKdJO.js → unplugin-DJxh_3Ax.js} +1 -1
- package/dist/vite.cjs +1 -1
- package/dist/vite.d.cts +1 -3
- package/dist/vite.d.ts +1 -3
- package/dist/vite.js +1 -1
- package/dist/webpack.cjs +1 -1
- package/dist/webpack.d.cts +1 -3
- package/dist/webpack.d.ts +1 -3
- package/dist/webpack.js +1 -1
- package/package.json +13 -12
- package/dist/types-NHxcq8Qp.d.cts +0 -7
- package/dist/types-NHxcq8Qp.d.ts +0 -7
package/README.md
CHANGED
|
@@ -6,20 +6,32 @@
|
|
|
6
6
|
|
|
7
7
|
[](https://deepwiki.com/uni-helper/axios-adapter)
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## 目录
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
- [简介](#简介)
|
|
12
|
+
- [平台兼容性](#平台兼容性)
|
|
13
|
+
- [安装](#安装)
|
|
14
|
+
- [快速开始](#快速开始)
|
|
15
|
+
- [使用](#使用)
|
|
16
|
+
- [创建自定义实例](#创建自定义实例)
|
|
17
|
+
- [与 useAxios 一起使用](#与-useaxios-一起使用)
|
|
18
|
+
- [上传和下载](#上传和下载)
|
|
19
|
+
- [小程序](#小程序)
|
|
20
|
+
- [API 参考](#api-参考)
|
|
21
|
+
- [版本策略](#版本策略)
|
|
22
|
+
- [参与贡献](#参与贡献)
|
|
23
|
+
- [许可证](#许可证)
|
|
14
24
|
|
|
15
|
-
##
|
|
25
|
+
## 简介
|
|
26
|
+
|
|
27
|
+
`@uni-helper/axios-adapter` 封装了 uni-app 的 `uni.request`、`uni.downloadFile`、`uni.uploadFile` 等接口,让开发者可以在 uni-app 的各类平台上继续使用熟悉的 axios 编程范式。适配器同时为 TypeScript 项目提供全局类型扩展,补充 `upload`、`download` 以及 uni-app 专有请求参数的类型定义。
|
|
16
28
|
|
|
17
|
-
|
|
18
|
-
<summary>点击查看平台兼容性</summary>
|
|
29
|
+
## 平台兼容性
|
|
19
30
|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
22
|
-
|
|
|
31
|
+
| Vue 版本 | 支持情况 |
|
|
32
|
+
| -------- | -------- |
|
|
33
|
+
| Vue 2 | √ |
|
|
34
|
+
| Vue 3 | √ |
|
|
23
35
|
|
|
24
36
|
| App | 快应用 | 微信小程序 | 支付宝小程序 | 百度小程序 | 字节小程序 | QQ 小程序 |
|
|
25
37
|
| ---------------------------------------- | ------ | ---------- | ------------ | ---------- | ---------- | --------- |
|
|
@@ -33,9 +45,15 @@ pnpm i @uni-helper/axios-adapter axios
|
|
|
33
45
|
| --------- | --------------- | ------------------- | ------------------ | ------ | --- | ---- | ------- | --------- |
|
|
34
46
|
| √ | √ | √ | √ | √ | √ | √ | √ | √ |
|
|
35
47
|
|
|
36
|
-
|
|
48
|
+
## 安装
|
|
37
49
|
|
|
38
|
-
|
|
50
|
+
```bash
|
|
51
|
+
pnpm i @uni-helper/axios-adapter axios
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
适配器与 axios 的版本需要保持主版本号和次版本号一致。当前适配器版本为 `1.20.0`,推荐搭配 `axios@^1.20.0` 使用。
|
|
55
|
+
|
|
56
|
+
## 快速开始
|
|
39
57
|
|
|
40
58
|
```ts
|
|
41
59
|
import { createUniAppAxiosAdapter } from '@uni-helper/axios-adapter'
|
|
@@ -44,7 +62,11 @@ import axios from 'axios'
|
|
|
44
62
|
axios.defaults.adapter = createUniAppAxiosAdapter()
|
|
45
63
|
```
|
|
46
64
|
|
|
47
|
-
|
|
65
|
+
配置完成后,即可像往常一样使用 `axios.get`、`axios.post` 等方法发起请求。
|
|
66
|
+
|
|
67
|
+
## 使用
|
|
68
|
+
|
|
69
|
+
### 创建自定义实例
|
|
48
70
|
|
|
49
71
|
```ts
|
|
50
72
|
import { createUniAppAxiosAdapter } from '@uni-helper/axios-adapter'
|
|
@@ -86,13 +108,12 @@ axios.request({
|
|
|
86
108
|
|
|
87
109
|
### 小程序
|
|
88
110
|
|
|
89
|
-
自 axios 1.4.0 开始,axios
|
|
111
|
+
自 axios 1.4.0 开始,axios 已对小程序环境做了兼容处理。若仍需在小程序中使用 `FormData` 和 `Blob`,可安装对应的 polyfill 并启用构建插件:
|
|
90
112
|
|
|
91
|
-
|
|
92
|
-
|
|
113
|
+
```bash
|
|
114
|
+
pnpm add miniprogram-formdata miniprogram-blob
|
|
115
|
+
```
|
|
93
116
|
|
|
94
|
-
小程序没有 `FormData` 和 `Blob` 对象,
|
|
95
|
-
使用 `pnpm add miniprogram-formdata miniprogram-blob` 来安装对应的 polyfill,然后使用插件
|
|
96
117
|
```ts
|
|
97
118
|
// vite.config.js
|
|
98
119
|
import uniAxiosAdapter from '@uni-helper/axios-adapter/vite'
|
|
@@ -104,12 +125,35 @@ export default {
|
|
|
104
125
|
}
|
|
105
126
|
```
|
|
106
127
|
|
|
107
|
-
如果你使用的是 Vue CLI,改用 `@uni-helper/axios-adapter/webpack`
|
|
128
|
+
如果你使用的是 Vue CLI,改用 `@uni-helper/axios-adapter/webpack` 即可。
|
|
129
|
+
|
|
130
|
+
## API 参考
|
|
131
|
+
|
|
132
|
+
### `createUniAppAxiosAdapter(options?: UserOptions): AxiosAdapter`
|
|
133
|
+
|
|
134
|
+
创建适配器实例,可直接赋值给 `axios.defaults.adapter` 或 `axios.create({ adapter })`。
|
|
135
|
+
|
|
136
|
+
- `options`:可选配置对象,当前版本支持扩展 uni-app 请求参数(参见 `globalExtensions.ts` 中的类型定义)。
|
|
137
|
+
- 返回值:标准的 `AxiosAdapter` 函数。
|
|
138
|
+
|
|
139
|
+
### `axios.upload<T = any, D = any, P = any>(url: string, data?: D, config?: AxiosRequestConfig<D, P>): Promise<AxiosResponse<T, D, {}, P>>`
|
|
140
|
+
|
|
141
|
+
以 `uni.uploadFile` 发送上传请求,`data` 通常为 `FormData` 实例。
|
|
142
|
+
|
|
143
|
+
### `axios.download<T = any, D = any, P = any>(url: string, config?: AxiosRequestConfig<D, P>): Promise<AxiosResponse<T, D, {}, P>>`
|
|
144
|
+
|
|
145
|
+
以 `uni.downloadFile` 发起下载请求,返回的 `response.data` 默认为文件临时路径或 `Buffer`(取决于运行环境)。
|
|
146
|
+
|
|
147
|
+
泛型已与 axios 自带方法对齐:`T` 为响应数据类型,`D`/`P` 分别对应请求数据与 `params`。旧版的第二个泛型参数 `R`(自定义返回类型)已移除——axios 1.19 起其默认值 `AxiosResponseDefault` 未导出,无法继续透传 `R`。
|
|
148
|
+
|
|
149
|
+
## 版本策略
|
|
150
|
+
|
|
151
|
+
自 1.4.0 开始,请始终保持主版本号和次版本号与 axios 一致。例如当你安装了 1.5.1 版本时,你可以安装 axios 的 1.5.x 版本。这样做的目的是确保适配器始终支持最新的 axios 特性。
|
|
108
152
|
|
|
109
|
-
|
|
153
|
+
## 参与贡献
|
|
110
154
|
|
|
111
|
-
|
|
155
|
+
欢迎通过 Issue 或 Pull Request 参与改进本项目。开始前请阅读 [CONTRIBUTING.md](./CONTRIBUTING.md),了解本地开发、测试、提交规范与架构说明。
|
|
112
156
|
|
|
113
|
-
|
|
157
|
+
## 许可证
|
|
114
158
|
|
|
115
|
-
|
|
159
|
+
[MIT](https://github.com/uni-helper/axios-adapter/blob/main/LICENSE)
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_rolldown_runtime = require("./rolldown-runtime-
|
|
2
|
+
const require_rolldown_runtime = require("./rolldown-runtime-VH7oDXx4.cjs");
|
|
3
3
|
let axios = require("axios");
|
|
4
4
|
let axios_unsafe_core_buildFullPath = require("axios/unsafe/core/buildFullPath");
|
|
5
5
|
axios_unsafe_core_buildFullPath = require_rolldown_runtime.__toESM(axios_unsafe_core_buildFullPath, 1);
|
|
@@ -70,7 +70,8 @@ function progressEventReducer(listener, isDownloadStream) {
|
|
|
70
70
|
bytes: progressBytes,
|
|
71
71
|
rate: rate || void 0,
|
|
72
72
|
estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
|
|
73
|
-
event: result
|
|
73
|
+
event: result,
|
|
74
|
+
lengthComputable: true
|
|
74
75
|
};
|
|
75
76
|
data[isDownloadStream ? "download" : "upload"] = true;
|
|
76
77
|
listener(data);
|
|
@@ -137,7 +138,7 @@ var OnCanceled = class {
|
|
|
137
138
|
if (this.config.cancelToken || this.config.signal) {
|
|
138
139
|
this.onCanceled = (cancel) => {
|
|
139
140
|
if (!task) return;
|
|
140
|
-
reject(!cancel || cancel.type ? new axios.CanceledError(void 0,
|
|
141
|
+
reject(!cancel || cancel.type ? new axios.CanceledError(void 0, this.config, task) : cancel);
|
|
141
142
|
task.abort();
|
|
142
143
|
task = null;
|
|
143
144
|
};
|
|
@@ -162,14 +163,15 @@ const download = (config, options) => {
|
|
|
162
163
|
...requestOptions,
|
|
163
164
|
success(result) {
|
|
164
165
|
if (!task) return;
|
|
165
|
-
|
|
166
|
+
const response = {
|
|
166
167
|
config: responseConfig,
|
|
167
168
|
data: result.tempFilePath,
|
|
168
169
|
headers: {},
|
|
169
170
|
status: result.statusCode,
|
|
170
171
|
statusText: result.errMsg ?? "OK",
|
|
171
172
|
request: task
|
|
172
|
-
}
|
|
173
|
+
};
|
|
174
|
+
(0, axios_unsafe_core_settle.default)(resolve, reject, response);
|
|
173
175
|
task = null;
|
|
174
176
|
},
|
|
175
177
|
fail(error) {
|
|
@@ -208,7 +210,7 @@ const request = (config, options) => {
|
|
|
208
210
|
result.header = dingHeader;
|
|
209
211
|
}
|
|
210
212
|
const headers = new axios.AxiosHeaders(result.header);
|
|
211
|
-
|
|
213
|
+
const response = {
|
|
212
214
|
config: responseConfig,
|
|
213
215
|
data: result.data,
|
|
214
216
|
headers,
|
|
@@ -216,7 +218,8 @@ const request = (config, options) => {
|
|
|
216
218
|
statusText: result.errMsg ?? "OK",
|
|
217
219
|
request: task,
|
|
218
220
|
cookies: result.cookies
|
|
219
|
-
}
|
|
221
|
+
};
|
|
222
|
+
(0, axios_unsafe_core_settle.default)(resolve, reject, response);
|
|
220
223
|
task = null;
|
|
221
224
|
},
|
|
222
225
|
fail(error) {
|
|
@@ -259,14 +262,15 @@ const upload = (config, options) => {
|
|
|
259
262
|
...requestOptions,
|
|
260
263
|
success(result) {
|
|
261
264
|
if (!task) return;
|
|
262
|
-
|
|
265
|
+
const response = {
|
|
263
266
|
config: responseConfig,
|
|
264
267
|
data: result.data,
|
|
265
268
|
headers: {},
|
|
266
269
|
status: result.statusCode,
|
|
267
270
|
statusText: result.errMsg ?? "OK",
|
|
268
271
|
request: task
|
|
269
|
-
}
|
|
272
|
+
};
|
|
273
|
+
(0, axios_unsafe_core_settle.default)(resolve, reject, response);
|
|
270
274
|
task = null;
|
|
271
275
|
},
|
|
272
276
|
fail(error) {
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { t as UserOptions } from "./types-NHxcq8Qp.cjs";
|
|
2
1
|
import { AxiosAdapter } from "axios";
|
|
3
|
-
|
|
2
|
+
//#region src/types.d.ts
|
|
3
|
+
interface Options {}
|
|
4
|
+
interface UserOptions extends Partial<Options> {}
|
|
5
|
+
//#endregion
|
|
4
6
|
//#region src/globalExtensions.d.ts
|
|
5
7
|
declare module 'axios' {
|
|
6
8
|
interface AxiosRequestConfig extends Omit<UniApp.RequestOptions, 'success' | 'fail' | 'complete' | 'header'>, Omit<UniApp.UploadFileOption, 'success' | 'fail' | 'complete' | 'header' | 'formData'>, Omit<UniApp.DownloadFileOption, 'success' | 'fail' | 'complete' | 'header'>, Partial<Pick<UniApp.RequestTask, 'onHeadersReceived'>> {}
|
|
@@ -8,8 +10,8 @@ declare module 'axios' {
|
|
|
8
10
|
cookies?: string[];
|
|
9
11
|
}
|
|
10
12
|
interface Axios {
|
|
11
|
-
upload: <T = any,
|
|
12
|
-
download: <T = any,
|
|
13
|
+
upload: <T = any, D = any, P = any>(url: string, data?: D, config?: AxiosRequestConfig<D, P>) => AxiosPromise<T, D, P>;
|
|
14
|
+
download: <T = any, D = any, P = any>(url: string, config?: AxiosRequestConfig<D, P>) => AxiosPromise<T, D, P>;
|
|
13
15
|
}
|
|
14
16
|
}
|
|
15
17
|
//#endregion
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { t as UserOptions } from "./types-NHxcq8Qp.js";
|
|
2
1
|
import { AxiosAdapter } from "axios";
|
|
3
|
-
|
|
2
|
+
//#region src/types.d.ts
|
|
3
|
+
interface Options {}
|
|
4
|
+
interface UserOptions extends Partial<Options> {}
|
|
5
|
+
//#endregion
|
|
4
6
|
//#region src/globalExtensions.d.ts
|
|
5
7
|
declare module 'axios' {
|
|
6
8
|
interface AxiosRequestConfig extends Omit<UniApp.RequestOptions, 'success' | 'fail' | 'complete' | 'header'>, Omit<UniApp.UploadFileOption, 'success' | 'fail' | 'complete' | 'header' | 'formData'>, Omit<UniApp.DownloadFileOption, 'success' | 'fail' | 'complete' | 'header'>, Partial<Pick<UniApp.RequestTask, 'onHeadersReceived'>> {}
|
|
@@ -8,8 +10,8 @@ declare module 'axios' {
|
|
|
8
10
|
cookies?: string[];
|
|
9
11
|
}
|
|
10
12
|
interface Axios {
|
|
11
|
-
upload: <T = any,
|
|
12
|
-
download: <T = any,
|
|
13
|
+
upload: <T = any, D = any, P = any>(url: string, data?: D, config?: AxiosRequestConfig<D, P>) => AxiosPromise<T, D, P>;
|
|
14
|
+
download: <T = any, D = any, P = any>(url: string, config?: AxiosRequestConfig<D, P>) => AxiosPromise<T, D, P>;
|
|
13
15
|
}
|
|
14
16
|
}
|
|
15
17
|
//#endregion
|
package/dist/index.js
CHANGED
|
@@ -64,7 +64,8 @@ function progressEventReducer(listener, isDownloadStream) {
|
|
|
64
64
|
bytes: progressBytes,
|
|
65
65
|
rate: rate || void 0,
|
|
66
66
|
estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
|
|
67
|
-
event: result
|
|
67
|
+
event: result,
|
|
68
|
+
lengthComputable: true
|
|
68
69
|
};
|
|
69
70
|
data[isDownloadStream ? "download" : "upload"] = true;
|
|
70
71
|
listener(data);
|
|
@@ -131,7 +132,7 @@ var OnCanceled = class {
|
|
|
131
132
|
if (this.config.cancelToken || this.config.signal) {
|
|
132
133
|
this.onCanceled = (cancel) => {
|
|
133
134
|
if (!task) return;
|
|
134
|
-
reject(!cancel || cancel.type ? new CanceledError(void 0,
|
|
135
|
+
reject(!cancel || cancel.type ? new CanceledError(void 0, this.config, task) : cancel);
|
|
135
136
|
task.abort();
|
|
136
137
|
task = null;
|
|
137
138
|
};
|
|
@@ -156,14 +157,15 @@ const download = (config, options) => {
|
|
|
156
157
|
...requestOptions,
|
|
157
158
|
success(result) {
|
|
158
159
|
if (!task) return;
|
|
159
|
-
|
|
160
|
+
const response = {
|
|
160
161
|
config: responseConfig,
|
|
161
162
|
data: result.tempFilePath,
|
|
162
163
|
headers: {},
|
|
163
164
|
status: result.statusCode,
|
|
164
165
|
statusText: result.errMsg ?? "OK",
|
|
165
166
|
request: task
|
|
166
|
-
}
|
|
167
|
+
};
|
|
168
|
+
settle(resolve, reject, response);
|
|
167
169
|
task = null;
|
|
168
170
|
},
|
|
169
171
|
fail(error) {
|
|
@@ -202,7 +204,7 @@ const request = (config, options) => {
|
|
|
202
204
|
result.header = dingHeader;
|
|
203
205
|
}
|
|
204
206
|
const headers = new AxiosHeaders(result.header);
|
|
205
|
-
|
|
207
|
+
const response = {
|
|
206
208
|
config: responseConfig,
|
|
207
209
|
data: result.data,
|
|
208
210
|
headers,
|
|
@@ -210,7 +212,8 @@ const request = (config, options) => {
|
|
|
210
212
|
statusText: result.errMsg ?? "OK",
|
|
211
213
|
request: task,
|
|
212
214
|
cookies: result.cookies
|
|
213
|
-
}
|
|
215
|
+
};
|
|
216
|
+
settle(resolve, reject, response);
|
|
214
217
|
task = null;
|
|
215
218
|
},
|
|
216
219
|
fail(error) {
|
|
@@ -253,14 +256,15 @@ const upload = (config, options) => {
|
|
|
253
256
|
...requestOptions,
|
|
254
257
|
success(result) {
|
|
255
258
|
if (!task) return;
|
|
256
|
-
|
|
259
|
+
const response = {
|
|
257
260
|
config: responseConfig,
|
|
258
261
|
data: result.data,
|
|
259
262
|
headers: {},
|
|
260
263
|
status: result.statusCode,
|
|
261
264
|
statusText: result.errMsg ?? "OK",
|
|
262
265
|
request: task
|
|
263
|
-
}
|
|
266
|
+
};
|
|
267
|
+
settle(resolve, reject, response);
|
|
264
268
|
task = null;
|
|
265
269
|
},
|
|
266
270
|
fail(error) {
|
|
@@ -15,7 +15,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
15
|
}
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
19
19
|
value: mod,
|
|
20
20
|
enumerable: true
|
|
21
21
|
}) : target, mod));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const require_rolldown_runtime = require("./rolldown-runtime-
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-VH7oDXx4.cjs");
|
|
2
2
|
let node_process = require("node:process");
|
|
3
3
|
node_process = require_rolldown_runtime.__toESM(node_process, 1);
|
|
4
4
|
let local_pkg = require("local-pkg");
|
|
5
5
|
//#region src/unplugin.ts
|
|
6
|
-
const unplugin$1 = (0, require("unplugin").createUnplugin)((
|
|
6
|
+
const unplugin$1 = (0, require("unplugin").createUnplugin)(() => {
|
|
7
7
|
const hasFormDataPolyfill = (0, local_pkg.isPackageExists)("miniprogram-formdata");
|
|
8
8
|
const hasBlobPolyfill = (0, local_pkg.isPackageExists)("miniprogram-blob");
|
|
9
9
|
return {
|
|
@@ -2,7 +2,7 @@ import process from "node:process";
|
|
|
2
2
|
import { isPackageExists } from "local-pkg";
|
|
3
3
|
import { createUnplugin } from "unplugin";
|
|
4
4
|
//#region src/unplugin.ts
|
|
5
|
-
const unplugin = createUnplugin((
|
|
5
|
+
const unplugin = createUnplugin(() => {
|
|
6
6
|
const hasFormDataPolyfill = isPackageExists("miniprogram-formdata");
|
|
7
7
|
const hasBlobPolyfill = isPackageExists("miniprogram-blob");
|
|
8
8
|
return {
|
package/dist/vite.cjs
CHANGED
package/dist/vite.d.cts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { n as UserUnpluginOptions } from "./types-NHxcq8Qp.cjs";
|
|
2
|
-
|
|
3
1
|
//#region src/vite.d.ts
|
|
4
|
-
declare const _default: (options
|
|
2
|
+
declare const _default: (options?: unknown) => import("vite").Plugin<any> | import("vite").Plugin<any>[];
|
|
5
3
|
export = _default;
|
package/dist/vite.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { n as UserUnpluginOptions } from "./types-NHxcq8Qp.js";
|
|
2
|
-
|
|
3
1
|
//#region src/vite.d.ts
|
|
4
|
-
declare const _default: (options
|
|
2
|
+
declare const _default: (options?: unknown) => import("vite").Plugin<any> | import("vite").Plugin<any>[];
|
|
5
3
|
//#endregion
|
|
6
4
|
export { _default as default };
|
package/dist/vite.js
CHANGED
package/dist/webpack.cjs
CHANGED
package/dist/webpack.d.cts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { n as UserUnpluginOptions } from "./types-NHxcq8Qp.cjs";
|
|
2
|
-
|
|
3
1
|
//#region src/webpack.d.ts
|
|
4
|
-
declare const _default: (options
|
|
2
|
+
declare const _default: (options?: unknown) => WebpackPluginInstance;
|
|
5
3
|
export = _default;
|
package/dist/webpack.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { n as UserUnpluginOptions } from "./types-NHxcq8Qp.js";
|
|
2
|
-
|
|
3
1
|
//#region src/webpack.d.ts
|
|
4
|
-
declare const _default: (options
|
|
2
|
+
declare const _default: (options?: unknown) => WebpackPluginInstance;
|
|
5
3
|
//#endregion
|
|
6
4
|
export { _default as default };
|
package/dist/webpack.js
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uni-helper/axios-adapter",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.20.0",
|
|
5
5
|
"description": "The Axios adapter for uniapp",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "kejunmao",
|
|
8
8
|
"email": "kejun1997@gmail.com"
|
|
9
9
|
},
|
|
10
10
|
"license": "MIT",
|
|
11
|
+
"funding": "https://afdian.com/a/kejun",
|
|
11
12
|
"homepage": "https://github.com/uni-helper/axios-adapter",
|
|
12
13
|
"repository": {
|
|
13
14
|
"type": "git",
|
|
@@ -59,7 +60,7 @@
|
|
|
59
60
|
"dist"
|
|
60
61
|
],
|
|
61
62
|
"peerDependencies": {
|
|
62
|
-
"axios": "^1.
|
|
63
|
+
"axios": "^1.20.0",
|
|
63
64
|
"vite": "^5.0.0"
|
|
64
65
|
},
|
|
65
66
|
"dependencies": {
|
|
@@ -67,17 +68,17 @@
|
|
|
67
68
|
"unplugin": "^2.3.11"
|
|
68
69
|
},
|
|
69
70
|
"devDependencies": {
|
|
70
|
-
"@antfu/eslint-config": "^9.
|
|
71
|
-
"@dcloudio/types": "^3.4.
|
|
72
|
-
"@types/node": "^24.13.
|
|
73
|
-
"axios": "^1.
|
|
74
|
-
"bumpp": "^
|
|
75
|
-
"eslint": "^10.
|
|
76
|
-
"msw": "^2.
|
|
77
|
-
"tsdown": "^0.22.
|
|
78
|
-
"typescript": "^
|
|
71
|
+
"@antfu/eslint-config": "^9.3.0",
|
|
72
|
+
"@dcloudio/types": "^3.4.32",
|
|
73
|
+
"@types/node": "^24.13.3",
|
|
74
|
+
"axios": "^1.20.0",
|
|
75
|
+
"bumpp": "^12.2.2",
|
|
76
|
+
"eslint": "^10.9.1",
|
|
77
|
+
"msw": "^2.15.0",
|
|
78
|
+
"tsdown": "^0.22.14",
|
|
79
|
+
"typescript": "^6.0.3",
|
|
79
80
|
"vite": "^5.4.21",
|
|
80
|
-
"vitest": "^3.2.
|
|
81
|
+
"vitest": "^3.2.7"
|
|
81
82
|
},
|
|
82
83
|
"scripts": {
|
|
83
84
|
"build": "tsdown",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
//#region src/types.d.ts
|
|
2
|
-
interface Options {}
|
|
3
|
-
interface UserOptions extends Partial<Options> {}
|
|
4
|
-
interface UnpluginOptions {}
|
|
5
|
-
interface UserUnpluginOptions extends Partial<UnpluginOptions> {}
|
|
6
|
-
//#endregion
|
|
7
|
-
export { UserUnpluginOptions as n, UserOptions as t };
|
package/dist/types-NHxcq8Qp.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
//#region src/types.d.ts
|
|
2
|
-
interface Options {}
|
|
3
|
-
interface UserOptions extends Partial<Options> {}
|
|
4
|
-
interface UnpluginOptions {}
|
|
5
|
-
interface UserUnpluginOptions extends Partial<UnpluginOptions> {}
|
|
6
|
-
//#endregion
|
|
7
|
-
export { UserUnpluginOptions as n, UserOptions as t };
|