@fedify/hono 2.1.0 → 2.1.2
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/dist/mod.cjs +4 -5
- package/dist/mod.d.cts +0 -1
- package/dist/mod.d.ts +0 -1
- package/dist/mod.js +3 -4
- package/package.json +4 -4
package/dist/mod.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
//#region src/mod.ts
|
|
3
3
|
/**
|
|
4
4
|
* Create a Hono middleware to integrate with the {@link Federation} object.
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
* @returns A Hono middleware.
|
|
13
13
|
* @since 1.9.0
|
|
14
14
|
*/
|
|
15
|
-
function federation(federation
|
|
15
|
+
function federation(federation, contextDataFactory) {
|
|
16
16
|
return async (ctx, next) => {
|
|
17
17
|
let contextData = contextDataFactory(ctx);
|
|
18
18
|
if (contextData instanceof Promise) contextData = await contextData;
|
|
19
|
-
return await federation
|
|
19
|
+
return await federation.fetch(ctx.req.raw, {
|
|
20
20
|
contextData,
|
|
21
21
|
...integrateFetchOptions(ctx, next)
|
|
22
22
|
});
|
|
@@ -41,6 +41,5 @@ function integrateFetchOptions(ctx, next) {
|
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
|
|
45
44
|
//#endregion
|
|
46
|
-
exports.federation = federation;
|
|
45
|
+
exports.federation = federation;
|
package/dist/mod.d.cts
CHANGED
package/dist/mod.d.ts
CHANGED
package/dist/mod.js
CHANGED
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
* @returns A Hono middleware.
|
|
12
12
|
* @since 1.9.0
|
|
13
13
|
*/
|
|
14
|
-
function federation(federation
|
|
14
|
+
function federation(federation, contextDataFactory) {
|
|
15
15
|
return async (ctx, next) => {
|
|
16
16
|
let contextData = contextDataFactory(ctx);
|
|
17
17
|
if (contextData instanceof Promise) contextData = await contextData;
|
|
18
|
-
return await federation
|
|
18
|
+
return await federation.fetch(ctx.req.raw, {
|
|
19
19
|
contextData,
|
|
20
20
|
...integrateFetchOptions(ctx, next)
|
|
21
21
|
});
|
|
@@ -40,6 +40,5 @@ function integrateFetchOptions(ctx, next) {
|
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
-
|
|
44
43
|
//#endregion
|
|
45
|
-
export { federation };
|
|
44
|
+
export { federation };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fedify/hono",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "Integrate Fedify with Hono",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Fedify",
|
|
@@ -50,11 +50,11 @@
|
|
|
50
50
|
],
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"hono": "^4.0.0",
|
|
53
|
-
"@fedify/fedify": "^2.1.
|
|
53
|
+
"@fedify/fedify": "^2.1.2"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"tsdown": "^0.
|
|
57
|
-
"typescript": "^5.9.
|
|
56
|
+
"tsdown": "^0.21.6",
|
|
57
|
+
"typescript": "^5.9.2"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
60
60
|
"build:self": "tsdown",
|