Skip to content

Commit

Permalink
[add] KoAJAX adapter for mini-app HTTP request
Browse files Browse the repository at this point in the history
[add] NPM publish action
  • Loading branch information
Soecka committed Oct 28, 2024
0 parents commit 899e8b7
Show file tree
Hide file tree
Showing 7 changed files with 2,402 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CI & CD
on:
push:
tags:
- v*
jobs:
Build-and-Publish:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org
cache: pnpm
- name: Install Dependencies
run: pnpm i --frozen-lockfile

- name: Build & Publish
run: npm publish --access public --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Update document
uses: peaceiris/actions-gh-pages@v4
with:
publish_dir: ./docs
personal_token: ${{ secrets.GITHUB_TOKEN }}
force_orphan: true
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
dist/
.vscode/
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# KoAJAX Taro adapter

A [KoAJAX][1] adapter for mini-app HTTP requests.

[![NPM Dependency](https://img.shields.io/librariesio/github/idea2app/KoAJAX-Taro-adapter.svg)][2]
[![CI & CD](https://github.com/idea2app/KoAJAX-Taro-adapter/actions/workflows/main.yml/badge.svg)][3]
[![](https://data.jsdelivr.com/v1/package/npm/koajax-taro-adapter/badge?style=rounded)][4]

[![NPM](https://nodei.co/npm/koajax-taro-adapter.png?downloads=true&downloadRank=true&stars=true)][5]

## Usage

### Installation

```shell
npm i koajax koajax-taro-adapter
```

### Initialization

```javascript
import { HTTPClient } from "koajax";
import { request } from "koajax-taro-adapter";

export const client = new HTTPClient({ baseRequest: request });
```

[1]: https://github.com/EasyWebApp/KoAJAX
[2]: https://libraries.io/npm/koajax-taro-adapter
[3]: https://github.com/idea2app/KoAJAX-Taro-adapter/actions/workflows/main.yml
[4]: https://www.jsdelivr.com/package/npm/koajax-taro-adapter
[5]: https://nodei.co/npm/koajax-taro-adapter/
42 changes: 42 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "koajax-taro-adapter",
"version": "0.1.0",
"description": "A KoAJAX adapter for mini-app HTTP requests",
"keywords": [
"koajax",
"taro",
"request",
"fetch",
"miniapp",
"wechat",
"adapter"
],
"author": "[email protected]",
"license": "LGPL-3.0-or-later",
"homepage": "https://github.com/idea2app/KoAJAX-Taro-adapter/",
"repository": {
"type": "git",
"url": "git+https://github.com/idea2app/KoAJAX-Taro-adapter.git"
},
"bugs": {
"url": "https://github.com/idea2app/KoAJAX-Taro-adapter/issues"
},
"types": "dist/index.d.ts",
"main": "dist/index.js",
"dependencies": {
"koajax": "^3.0.2",
"miniprogram-blob": "^2.0.0",
"taro-fetch-polyfill": "0.5.0-rc.1",
"web-streams-polyfill": "^4.0.0"
},
"devDependencies": {
"typedoc": "^0.26.10",
"typedoc-plugin-mdn-links": "^3.3.5",
"typescript": "^5.6.3"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "rm -rf dist/ docs/ && tsc && typedoc source/",
"prepublishOnly": "npm run build"
}
}
Loading

0 comments on commit 899e8b7

Please sign in to comment.