@fedify/elysia 2.4.0-pr.936.41 → 2.4.0

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/index.cjs CHANGED
@@ -24,10 +24,10 @@ const fedify = (federation, contextDataFactory) => {
24
24
  });
25
25
  if (!notFound && !notAcceptable) {
26
26
  set.status = response.status;
27
+ if (response.body) return response;
27
28
  response.headers.forEach((value, key) => {
28
29
  set.headers[key] = value;
29
30
  });
30
- if (response.body) return response;
31
31
  return new Response(null, { status: response.status });
32
32
  }
33
33
  }).as("global");
package/dist/index.d.cts CHANGED
@@ -1,35 +1,8 @@
1
- import * as _$elysia from "elysia";
2
- import { Elysia } from "elysia";
3
1
  import { Federation } from "@fedify/fedify";
2
+ import { AnyElysia } from "elysia";
4
3
 
5
4
  //#region src/index.d.ts
6
5
  type ContextDataFactory<TContextData> = (req?: Request) => TContextData | Promise<TContextData>;
7
- declare const fedify: <TContextData = unknown>(federation: Federation<TContextData>, contextDataFactory: ContextDataFactory<TContextData>) => (app: Elysia) => Elysia<"", {
8
- decorator: {
9
- federation: Federation<TContextData>;
10
- };
11
- store: {};
12
- derive: {};
13
- resolve: {};
14
- }, {
15
- typebox: {};
16
- error: {};
17
- }, {
18
- schema: _$elysia.MergeSchema<_$elysia.MergeSchema<{}, {}, "">, {}, "">;
19
- standaloneSchema: {};
20
- macro: {};
21
- macroFn: {};
22
- parser: {};
23
- }, {}, {
24
- derive: {};
25
- resolve: {};
26
- schema: {};
27
- standaloneSchema: {};
28
- }, {
29
- derive: {};
30
- resolve: {};
31
- schema: {};
32
- standaloneSchema: {};
33
- }>;
6
+ declare const fedify: <TContextData = unknown>(federation: Federation<TContextData>, contextDataFactory: ContextDataFactory<TContextData>) => (app: AnyElysia) => AnyElysia;
34
7
  //#endregion
35
8
  export { ContextDataFactory, fedify };
package/dist/index.d.ts CHANGED
@@ -1,35 +1,8 @@
1
- import * as _$elysia from "elysia";
2
- import { Elysia } from "elysia";
3
1
  import { Federation } from "@fedify/fedify";
2
+ import { AnyElysia } from "elysia";
4
3
 
5
4
  //#region src/index.d.ts
6
5
  type ContextDataFactory<TContextData> = (req?: Request) => TContextData | Promise<TContextData>;
7
- declare const fedify: <TContextData = unknown>(federation: Federation<TContextData>, contextDataFactory: ContextDataFactory<TContextData>) => (app: Elysia) => Elysia<"", {
8
- decorator: {
9
- federation: Federation<TContextData>;
10
- };
11
- store: {};
12
- derive: {};
13
- resolve: {};
14
- }, {
15
- typebox: {};
16
- error: {};
17
- }, {
18
- schema: _$elysia.MergeSchema<_$elysia.MergeSchema<{}, {}, "">, {}, "">;
19
- standaloneSchema: {};
20
- macro: {};
21
- macroFn: {};
22
- parser: {};
23
- }, {}, {
24
- derive: {};
25
- resolve: {};
26
- schema: {};
27
- standaloneSchema: {};
28
- }, {
29
- derive: {};
30
- resolve: {};
31
- schema: {};
32
- standaloneSchema: {};
33
- }>;
6
+ declare const fedify: <TContextData = unknown>(federation: Federation<TContextData>, contextDataFactory: ContextDataFactory<TContextData>) => (app: AnyElysia) => AnyElysia;
34
7
  //#endregion
35
8
  export { ContextDataFactory, fedify };
package/dist/index.js CHANGED
@@ -23,10 +23,10 @@ const fedify = (federation, contextDataFactory) => {
23
23
  });
24
24
  if (!notFound && !notAcceptable) {
25
25
  set.status = response.status;
26
+ if (response.body) return response;
26
27
  response.headers.forEach((value, key) => {
27
28
  set.headers[key] = value;
28
29
  });
29
- if (response.body) return response;
30
30
  return new Response(null, { status: response.status });
31
31
  }
32
32
  }).as("global");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/elysia",
3
- "version": "2.4.0-pr.936.41+59c7432c",
3
+ "version": "2.4.0",
4
4
  "description": "Integrate Fedify with Elysia",
5
5
  "keywords": [
6
6
  "Fedify",
@@ -44,7 +44,7 @@
44
44
  ],
45
45
  "peerDependencies": {
46
46
  "elysia": "^1.3.6",
47
- "@fedify/fedify": "^2.4.0-pr.936.41+59c7432c"
47
+ "@fedify/fedify": "^2.4.0"
48
48
  },
49
49
  "devDependencies": {
50
50
  "bun-types": "^1.2.19",
@@ -54,6 +54,8 @@
54
54
  "scripts": {
55
55
  "build:self": "tsdown",
56
56
  "build": "pnpm --filter @fedify/elysia... run build:self",
57
- "prepublish": "pnpm build"
57
+ "prepublish": "pnpm build",
58
+ "test": "node --experimental-transform-types --test",
59
+ "test:bun": "bun test src/"
58
60
  }
59
61
  }