Skip to content

Commit 963fbab

Browse files
authored
[optimize] support Custom Request implements (#15)
1 parent 53ea34d commit 963fbab

File tree

7 files changed

+904
-692
lines changed

7 files changed

+904
-692
lines changed

.github/workflows/main.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
jobs:
77
Build-and-Publish:
88
runs-on: ubuntu-latest
9+
permissions:
10+
contents: write
11+
id-token: write
912
steps:
1013
- uses: actions/checkout@v4
1114

@@ -21,7 +24,7 @@ jobs:
2124
run: pnpm i --frozen-lockfile
2225

2326
- name: Build & Publish
24-
run: npm publish
27+
run: npm publish --access public --provenance
2528
env:
2629
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2730

ReadMe.md

+17-3
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ Automatic Parsed type:
3333

3434
### Browser
3535

36-
```Shell
36+
#### Installation
37+
38+
```shell
3739
npm install koajax
3840
```
3941

40-
`index.html`
42+
#### `index.html`
4143

4244
```html
4345
<head>
@@ -51,11 +53,13 @@ npm install koajax
5153

5254
### Node.js
5355

56+
#### Installation
57+
5458
```shell
5559
npm install koajax jsdom
5660
```
5761

58-
`index.js`
62+
#### `index.ts`
5963

6064
```javascript
6165
import { HTTPClient } from 'koajax';
@@ -74,6 +78,16 @@ polyfill(origin).then(() => {
7478
});
7579
```
7680

81+
#### Execution
82+
83+
```shell
84+
npx tsx index.ts
85+
```
86+
87+
### Non-polyfillable runtimes
88+
89+
1. https://github.com/idea2app/KoAJAX-Taro-adapter
90+
7791
## Example
7892

7993
### RESTful API with Token-based Authorization

package.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "koajax",
3-
"version": "3.0.2",
3+
"version": "3.0.3",
44
"license": "LGPL-3.0",
55
"author": "[email protected]",
66
"description": "HTTP Client based on Koa-like middlewares",
@@ -29,7 +29,7 @@
2929
"core-js": "^3.38.1",
3030
"regenerator-runtime": "^0.14.1",
3131
"web-streams-polyfill": "^4.0.0",
32-
"web-utility": "^4.4.0"
32+
"web-utility": "^4.4.1"
3333
},
3434
"peerDependencies": {
3535
"jsdom": ">=21"
@@ -38,23 +38,23 @@
3838
"@parcel/packager-ts": "~2.12.0",
3939
"@parcel/transformer-typescript-types": "~2.12.0",
4040
"@types/core-js": "^2.5.8",
41-
"@types/jest": "^29.5.12",
41+
"@types/jest": "^29.5.14",
4242
"@types/jsdom": "^21.1.7",
43-
"@types/node": "^20.16.5",
43+
"@types/node": "^20.17.1",
4444
"cross-env": "^7.0.3",
45-
"husky": "^9.1.5",
45+
"husky": "^9.1.6",
4646
"jest": "^29.7.0",
4747
"jest-environment-jsdom": "^29.7.0",
48-
"jsdom": "^25.0.0",
48+
"jsdom": "^25.0.1",
4949
"lint-staged": "^15.2.10",
5050
"open-cli": "^8.0.0",
5151
"parcel": "~2.12.0",
5252
"prettier": "^3.3.3",
5353
"ts-jest": "^29.2.5",
5454
"ts-node": "^10.9.2",
55-
"typedoc": "^0.26.6",
56-
"typedoc-plugin-mdn-links": "^3.2.11",
57-
"typescript": "~5.5.4"
55+
"typedoc": "^0.26.10",
56+
"typedoc-plugin-mdn-links": "^3.3.5",
57+
"typescript": "~5.6.3"
5858
},
5959
"prettier": {
6060
"singleQuote": true,

0 commit comments

Comments
 (0)