@vercube/h3 0.0.21 → 0.0.23
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 +11 -7
- package/dist/index.mjs +8 -10
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
<br>
|
|
4
4
|
<br>
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
# Vercube
|
|
7
|
+
|
|
8
|
+
Next generation HTTP framework
|
|
9
|
+
|
|
10
10
|
<a href="https://www.npmjs.com/package/@vercube/h3">
|
|
11
11
|
<img src="https://img.shields.io/npm/v/%40vercube%2Fh3?style=for-the-badge&logo=npm&color=%23767eff" alt="npm"/>
|
|
12
12
|
</a>
|
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
<a href="https://github.com/vercube/vercube/blob/main/LICENSE" target="_blank">
|
|
17
17
|
<img src="https://img.shields.io/npm/l/%40vercube%2Fdi?style=for-the-badge&color=%23767eff" alt="License"/>
|
|
18
18
|
</a>
|
|
19
|
+
<a href="https://codecov.io/gh/vercube/vercube" target="_blank">
|
|
20
|
+
<img src="https://img.shields.io/codecov/c/github/vercube/vercube?style=for-the-badge&color=%23767eff" alt="Coverage"/>
|
|
21
|
+
</a>
|
|
19
22
|
<br/>
|
|
20
23
|
<br/>
|
|
21
24
|
</div>
|
|
@@ -23,7 +26,8 @@
|
|
|
23
26
|
An ultra-efficient JavaScript server framework that runs anywhere - Node.js, Bun, or Deno - with unmatched flexibility and complete configurability for developers who refuse to sacrifice speed or control.
|
|
24
27
|
|
|
25
28
|
## <a name="module">H3 Module</a>
|
|
26
|
-
|
|
29
|
+
|
|
30
|
+
The H3 module provides integration between Vercube applications and the H3 HTTP framework.
|
|
27
31
|
It allows you to:
|
|
28
32
|
|
|
29
33
|
- Mount Vercube applications on [H3](https://h3.dev) server
|
|
@@ -50,6 +54,6 @@ h3app.all('/api/**', toH3(app));
|
|
|
50
54
|
await serve(h3app, { port: 3000 });
|
|
51
55
|
```
|
|
52
56
|
|
|
53
|
-
|
|
54
57
|
## <a name="documentation">📖 Documentation</a>
|
|
55
|
-
|
|
58
|
+
|
|
59
|
+
Comprehensive documentation is available at [vercube.dev](https://vercube.dev). There you'll find detailed module descriptions, project information, guides, and everything else you need to know about Vercube.
|
package/dist/index.mjs
CHANGED
|
@@ -1,33 +1,31 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "@vercube/core";
|
|
2
|
+
import "h3";
|
|
2
3
|
|
|
3
4
|
//#region src/index.ts
|
|
4
5
|
/**
|
|
5
6
|
* Converts a Vercube application to an H3 event handler
|
|
6
|
-
*
|
|
7
|
+
*
|
|
7
8
|
* This adapter allows Vercube applications to be integrated with H3 servers by converting
|
|
8
9
|
* the Vercube request handling pipeline into an H3-compatible event handler.
|
|
9
|
-
*
|
|
10
|
+
*
|
|
10
11
|
* @param {App} app - The Vercube application instance to adapt
|
|
11
12
|
* @returns {EventHandler} An H3 event handler that processes requests through the Vercube app
|
|
12
|
-
*
|
|
13
|
+
*
|
|
13
14
|
* @example
|
|
14
15
|
* ```ts
|
|
15
16
|
* import { createApp } from '@vercube/core'
|
|
16
17
|
* import { toH3 } from '@vercube/h3'
|
|
17
18
|
* import { H3 } from 'h3'
|
|
18
|
-
*
|
|
19
|
+
*
|
|
19
20
|
* const h3app = new H3()
|
|
20
21
|
* const app = await createApp()
|
|
21
|
-
*
|
|
22
|
+
*
|
|
22
23
|
* // Mount Vercube app at /api path
|
|
23
24
|
* h3app.all('/api/**', toH3(app))
|
|
24
25
|
* ```
|
|
25
26
|
*/
|
|
26
27
|
function toH3(app) {
|
|
27
|
-
return (event) =>
|
|
28
|
-
const server = app.container.get(HttpServer);
|
|
29
|
-
return server.handleRequest(event.req);
|
|
30
|
-
};
|
|
28
|
+
return (event) => app.fetch(event.req);
|
|
31
29
|
}
|
|
32
30
|
|
|
33
31
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercube/h3",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.23",
|
|
4
4
|
"description": "H3 module for Vercube framework",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"h3": "npm:h3-nightly@2x",
|
|
26
|
-
"@vercube/core": "0.0.
|
|
26
|
+
"@vercube/core": "0.0.23"
|
|
27
27
|
},
|
|
28
28
|
"publishConfig": {
|
|
29
29
|
"access": "public"
|