mirror of
https://github.com/186526/handlers.js
synced 2024-10-13 00:29:43 +00:00
Publish 0.0.1
This commit is contained in:
39
.github/workflows/publish.yml
vendored
Normal file
39
.github/workflows/publish.yml
vendored
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
name: release
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [created]
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.release.target_commitish }}
|
||||||
|
|
||||||
|
- name: Validate and extract release information
|
||||||
|
id: release
|
||||||
|
uses: manovotny/github-releases-for-automated-package-publishing-action@v1.0.0
|
||||||
|
|
||||||
|
- name: Set node version
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
always-auth: true
|
||||||
|
node-version: vx.x.x
|
||||||
|
registry-url: "https://registry.npmjs.org"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: yarn install
|
||||||
|
|
||||||
|
- name: Publish tagged version
|
||||||
|
if: steps.release.outputs.tag != ''
|
||||||
|
run: yarn publish --new-version ${{ steps.release.outputs.version }} --tag ${{ steps.release.outputs.tag }}
|
||||||
|
env:
|
||||||
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
|
||||||
|
# This will publish a version of a package.
|
||||||
|
- name: Publish version
|
||||||
|
if: steps.release.outputs.tag == ''
|
||||||
|
run: yarn publish --new-version ${{ steps.release.outputs.version }}
|
||||||
|
env:
|
||||||
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
@ -15,3 +15,12 @@ App.binding(
|
|||||||
App.useMappingAdapter();
|
App.useMappingAdapter();
|
||||||
App.listen(8080);
|
App.listen(8080);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Use Yarn
|
||||||
|
yarn add sw2express
|
||||||
|
# Use NPM
|
||||||
|
npm install sw2express
|
||||||
|
```
|
||||||
|
11
package.json
11
package.json
@ -2,7 +2,13 @@
|
|||||||
"name": "handlers.js",
|
"name": "handlers.js",
|
||||||
"description": "Handlers.js is a unified and lightweight web application framework for multiple platforms.",
|
"description": "Handlers.js is a unified and lightweight web application framework for multiple platforms.",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"main": "index.ts",
|
"main": "./dit/main.node.js",
|
||||||
|
"webpack": "./dist/index.js",
|
||||||
|
"browser": "./dist/main.serviceworker.js",
|
||||||
|
"files": [
|
||||||
|
"dist",
|
||||||
|
"LICENSE"
|
||||||
|
],
|
||||||
"author": "186526 <i@186526.xyz>",
|
"author": "186526 <i@186526.xyz>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
@ -48,7 +54,8 @@
|
|||||||
"tsc": "tsc",
|
"tsc": "tsc",
|
||||||
"test:node": "jest ./test/node.test.ts",
|
"test:node": "jest ./test/node.test.ts",
|
||||||
"test:deno": "BUILD_TARGET=deno:test webpack && jest ./test/deno.test.ts",
|
"test:deno": "BUILD_TARGET=deno:test webpack && jest ./test/deno.test.ts",
|
||||||
"coverage": "jest --collectCoverage --"
|
"coverage": "jest --collectCoverage --",
|
||||||
|
"prepublish": "env NODE_ENV=production yarn build && yarn tsc"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.0.0"
|
"node": ">=14.0.0"
|
||||||
|
@ -2,7 +2,7 @@ import { platformAdapater } from "./index";
|
|||||||
import { request } from "../interface/request";
|
import { request } from "../interface/request";
|
||||||
import { response } from "../interface/response";
|
import { response } from "../interface/response";
|
||||||
import { router } from "../router";
|
import { router } from "../router";
|
||||||
import serveHttp from "./txiki.js/serveHttp";
|
import serveHttp from "./txiki-js/serveHttp";
|
||||||
|
|
||||||
export class TxikiPlatformAdapter<T = any, K = any> implements platformAdapater {
|
export class TxikiPlatformAdapter<T = any, K = any> implements platformAdapater {
|
||||||
public router: router<T, K>;
|
public router: router<T, K>;
|
||||||
|
Reference in New Issue
Block a user