Skip to content

Commit 5212f01

Browse files
committed
chore: integrate automd
1 parent 80ed5b3 commit 5212f01

File tree

8 files changed

+184
-49
lines changed

8 files changed

+184
-49
lines changed

.config/automd.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
input: ["README.md", "docs/**/*.md"]

.github/workflows/autofix.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ jobs:
1616
- run: corepack enable
1717
- uses: actions/setup-node@v4
1818
with:
19-
node-version: 18
19+
node-version: 20
2020
cache: "pnpm"
2121
- run: pnpm install
22-
- name: Fix lint issues
23-
run: pnpm run lint:fix
22+
- run: pnpm run lint:fix
23+
- run: pnpm automd
2424
- uses: autofix-ci/action@ea32e3a12414e6d3183163c3424a7d7a8631ad84
2525
with:
26-
commit-message: "chore: apply automated fixes"
26+
commit-message: "chore: apply automated updates"

README.md

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,48 @@
11
# H3
22

3-
[![npm version][npm-version-src]][npm-version-href]
4-
[![npm downloads][npm-downloads-src]][npm-downloads-href]
5-
[![bundle][bundle-src]][bundle-href]
6-
[![Codecov][codecov-src]][codecov-href]
7-
[![License][license-src]][license-href]
8-
[![JSDocs][jsdocs-src]][jsdocs-href]
3+
<!-- automd:badges -->
4+
5+
[![npm version](https://flat.badgen.net/npm/v/h3)](https://npmjs.com/package/h3)
6+
[![npm downloads](https://flat.badgen.net/npm/dm/h3)](https://npmjs.com/package/h3)
7+
8+
<!-- /automd -->
99

1010
H3 (pronounced as /eɪtʃθriː/, like h-3) is a minimal h(ttp) framework built for high performance and portability.
1111

12-
👉 [Online Playground](https://stackblitz.com/github/unjs/h3/tree/main/playground)
12+
👉 [Documentation](https://h3.unjs.io)
1313

14-
👉 [Online Examples Playground](https://stackblitz.com/github/unjs/h3/tree/main/examples)
14+
## Contribution
1515

16-
## Features
16+
<details>
17+
<summary>Local development</summary>
1718

18-
✔️ &nbsp;**Portable:** Works perfectly in Serverless, Workers, and Node.js
19+
- Clone this repository
20+
- Install the latest LTS version of [Node.js](https://nodejs.org/en/)
21+
- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable`
22+
- Install dependencies using `pnpm install`
23+
- Run tests using `pnpm dev` or `pnpm test`
1924

20-
✔️ &nbsp;**Minimal:** Small and tree-shakable
25+
</details>
2126

22-
✔️ &nbsp;**Modern:** Native promise support
27+
<!-- /automd -->
2328

24-
✔️ &nbsp;**Extendable:** Ships with a set of composable utilities but can be extended
29+
## License
2530

26-
✔️ &nbsp;**Router:** Super fast route matching using [unjs/radix3](https://github.com/unjs/radix3)
31+
<!-- automd:contributors license=MIT author="pi0" -->
2732

28-
✔️ &nbsp;**Compatible:** Compatibility layer with node/connect/express middleware
33+
Published under the [MIT](https://github.com/unjs/h3/blob/main/LICENSE) license.
34+
Made by [@pi0](https://github.com/pi0) and [community](https://github.com/unjs/h3/graphs/contributors) 💛
35+
<br><br>
36+
<a href="https://github.com/unjs/h3/graphs/contributors">
37+
<img src="https://contrib.rocks/image?repo=unjs/h3" />
38+
</a>
2939

30-
## License
40+
<!-- /automd -->
41+
42+
<!-- automd:with-automd -->
43+
44+
---
45+
46+
_🤖 auto updated with [automd](https://automd.unjs.io)_
3147

32-
MIT
33-
34-
<!-- Badges -->
35-
36-
[npm-version-src]: https://img.shields.io/npm/v/h3?style=flat&colorA=18181B&colorB=F0DB4F
37-
[npm-version-href]: https://npmjs.com/package/h3
38-
[npm-downloads-src]: https://img.shields.io/npm/dm/h3?style=flat&colorA=18181B&colorB=F0DB4F
39-
[npm-downloads-href]: https://npmjs.com/package/h3
40-
[codecov-src]: https://img.shields.io/codecov/c/gh/unjs/h3/main?style=flat&colorA=18181B&colorB=F0DB4F
41-
[codecov-href]: https://codecov.io/gh/unjs/h3
42-
[bundle-src]: https://img.shields.io/bundlephobia/minzip/h3?style=flat&colorA=18181B&colorB=F0DB4F
43-
[bundle-href]: https://bundlephobia.com/result?p=h3
44-
[license-src]: https://img.shields.io/github/license/unjs/h3.svg?style=flat&colorA=18181B&colorB=F0DB4F
45-
[license-href]: https://github.com/unjs/h3/blob/main/LICENSE
46-
[jsdocs-src]: https://img.shields.io/badge/jsDocs.io-reference-18181B?style=flat&colorA=18181B&colorB=F0DB4F
47-
[jsdocs-href]: https://www.jsdocs.io/package/h3
48+
<!-- /automd -->

docs/2.utils/1.request.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> Utilities to access incoming request
44
5-
<!-- automd:jsdocs src="https://togithub.com/src/utils/request.ts" -->
5+
<!-- automd:jsdocs src="https://togithub.com/%3Cspan%20class="x x-first x-last">../src/utils/request.ts" -->
66

77
### `assertMethod(event, expected, allowHead?)`
88

@@ -38,15 +38,15 @@
3838

3939
<!-- /automd -->
4040

41-
<!-- automd:jsdocs src="https://togithub.com/src/utils/fingerprint.ts" -->
41+
<!-- automd:jsdocs src="https://togithub.com/%3Cspan%20class="x x-first x-last">../src/utils/fingerprint.ts" -->
4242

4343
### `getRequestFingerprint(event, opts)`
4444

4545
<!-- /automd -->
4646

4747
## Body utils
4848

49-
<!-- automd:jsdocs src="https://togithub.com/src/utils/body.ts" -->
49+
<!-- automd:jsdocs src="https://togithub.com/%3Cspan%20class="x x-first x-last">../src/utils/body.ts" -->
5050

5151
### `getRequestWebStream(event)`
5252

docs/2.utils/2.reponse.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> Utilities to send response headers and data
44
5-
<!-- automd:jsdocs src="https://togithub.com/src/utils/response.ts" -->
5+
<!-- automd:jsdocs src="https://togithub.com/%3Cspan%20class="x x-first x-last">../src/utils/response.ts" -->
66

77
### `appendHeader(event, name, value)`
88

docs/2.utils/98.advanced.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
## Session utils
66

7-
<!-- automd:jsdocs src="https://togithub.com/src/utils/session.ts" -->
7+
<!-- automd:jsdocs src="https://togithub.com/%3Cspan%20class="x x-first x-last">../src/utils/session.ts" -->
88

99
### `clearSession(event, config)`
1010

@@ -22,7 +22,7 @@
2222

2323
## Cookie utils
2424

25-
<!-- automd:jsdocs src="https://togithub.com/src/utils/cookie.ts" -->
25+
<!-- automd:jsdocs src="https://togithub.com/%3Cspan%20class="x x-first x-last">../src/utils/cookie.ts" -->
2626

2727
### `deleteCookie(event, name, serializeOptions?)`
2828

@@ -42,13 +42,13 @@ Set a cookie value by name.
4242

4343
### `splitCookiesString(cookiesString)`
4444

45-
Set-Cookie header field-values are sometimes comma joined in one string. This splits them without choking on commas that are within a single set-cookie field-value, such as in the Expires portion. This is uncommon, but explicitly allowed - see https://tools.ietf.org/html/rfc2616#section-4.2 Node.js does this for every header _except_ set-cookie - see https://github.com/nodejs/node/blob/d5e363b77ebaf1caf67cd7528224b651c86815c1/lib/_http_incoming.js#L128 Based on: https://github.com/google/j2objc/commit/16820fdbc8f76ca0c33472810ce0cb03d20efe25 Credits to: https://github.com/tomball for original and https://github.com/chrusart for JavaScript implementation
45+
Set-Cookie header field-values are sometimes comma joined in one string. This splits them without choking on commas that are within a single set-cookie field-value, such as in the Expires portion. This is uncommon, but explicitly allowed - see https://tools.ietf.org/html/rfc2616#section-4.2 Node.js does this for every header *except* set-cookie - see https://github.com/nodejs/node/blob/d5e363b77ebaf1caf67cd7528224b651c86815c1/lib/_http_incoming.js#L128 Based on: https://github.com/google/j2objc/commit/16820fdbc8f76ca0c33472810ce0cb03d20efe25 Credits to: https://github.com/tomball for original and https://github.com/chrusart for JavaScript implementation
4646

4747
<!-- /automd -->
4848

4949
## Sanitize
5050

51-
<!-- automd:jsdocs src="https://togithub.com/src/utils/sanitize.ts" -->
51+
<!-- automd:jsdocs src="https://togithub.com/%3Cspan%20class="x x-first x-last">../src/utils/sanitize.ts" -->
5252

5353
### `sanitizeStatusCode(statusCode?, defaultStatusCode)`
5454

@@ -58,7 +58,7 @@ Set-Cookie header field-values are sometimes comma joined in one string. This sp
5858

5959
## Route
6060

61-
<!-- automd:jsdocs src="https://togithub.com/src/utils/route.ts" -->
61+
<!-- automd:jsdocs src="https://togithub.com/%3Cspan%20class="x x-first x-last">../src/utils/route.ts" -->
6262

6363
### `useBase(base, handler)`
6464

@@ -68,7 +68,7 @@ Prefixes and executes a handler with a base path.
6868

6969
## Cache
7070

71-
<!-- automd:jsdocs src="https://togithub.com/src/utils/cache.ts" -->
71+
<!-- automd:jsdocs src="https://togithub.com/%3Cspan%20class="x x-first x-last">../src/utils/cache.ts" -->
7272

7373
### `handleCacheHeaders(event, opts)`
7474

@@ -78,7 +78,7 @@ Check request caching headers (`If-Modified-Since`) and add caching headers (Las
7878

7979
## Proxy
8080

81-
<!-- automd:jsdocs src="https://togithub.com/src/utils/proxy.ts" -->
81+
<!-- automd:jsdocs src="https://togithub.com/%3Cspan%20class="x x-first x-last">../src/utils/proxy.ts" -->
8282

8383
### `fetchWithEvent(event, req, init?, options?: { fetch: F })`
8484

@@ -92,7 +92,7 @@ Check request caching headers (`If-Modified-Since`) and add caching headers (Las
9292

9393
## CORS
9494

95-
<!-- automd:jsdocs src="https://togithub.com/src/utils/cors/index.ts" -->
95+
<!-- automd:jsdocs src="https://togithub.com/%3Cspan%20class="x x-first x-last">../src/utils/cors/index.ts" -->
9696

9797
### `appendCorsHeaders(event, options)`
9898

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"@types/supertest": "^6.0.2",
4949
"@vitest/coverage-v8": "^1.3.1",
5050
"autocannon": "^7.15.0",
51+
"automd": "^0.3.5",
5152
"changelogen": "^0.5.5",
5253
"connect": "^3.7.0",
5354
"eslint": "^8.56.0",

0 commit comments

Comments
 (0)