@supacloud/elysia 0.29.0 → 0.29.1
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/effect.d.ts +1 -0
- package/dist/index.js +10 -4
- package/package.json +6 -6
package/dist/effect.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export interface CompiledEffectDescriptor {
|
|
|
16
16
|
}
|
|
17
17
|
export interface SupaCloudEffectRuntime {
|
|
18
18
|
run(program: Effect.Effect<unknown, unknown, unknown>): Promise<Exit.Exit<unknown, unknown>>;
|
|
19
|
+
dispose?(): Promise<void>;
|
|
19
20
|
}
|
|
20
21
|
export declare class EffectApplicationError extends Error {
|
|
21
22
|
readonly status: number;
|
package/dist/index.js
CHANGED
|
@@ -1015,7 +1015,7 @@ function createDocumentationPlugin(options = {}) {
|
|
|
1015
1015
|
}
|
|
1016
1016
|
|
|
1017
1017
|
// src/effect.ts
|
|
1018
|
-
import { Cause, Duration, Effect, Exit, Schedule } from "effect";
|
|
1018
|
+
import { Cause, Duration, Effect, Exit, ManagedRuntime, Schedule } from "effect";
|
|
1019
1019
|
|
|
1020
1020
|
class EffectApplicationError extends Error {
|
|
1021
1021
|
status;
|
|
@@ -1036,11 +1036,12 @@ function createDefaultEffectRuntime() {
|
|
|
1036
1036
|
};
|
|
1037
1037
|
}
|
|
1038
1038
|
function createEffectRuntimeFromLayer(layer) {
|
|
1039
|
+
const managedRuntime = ManagedRuntime.make(layer);
|
|
1039
1040
|
return {
|
|
1040
1041
|
run(program) {
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1042
|
+
return managedRuntime.runPromiseExit(program);
|
|
1043
|
+
},
|
|
1044
|
+
dispose: () => managedRuntime.dispose()
|
|
1044
1045
|
};
|
|
1045
1046
|
}
|
|
1046
1047
|
function isRecord(value) {
|
|
@@ -2892,6 +2893,11 @@ function createApplication(options) {
|
|
|
2892
2893
|
errors.push(error);
|
|
2893
2894
|
}
|
|
2894
2895
|
}
|
|
2896
|
+
try {
|
|
2897
|
+
await options.effectRuntime?.dispose?.();
|
|
2898
|
+
} catch (error) {
|
|
2899
|
+
errors.push(error);
|
|
2900
|
+
}
|
|
2895
2901
|
if (errors.length > 0) {
|
|
2896
2902
|
throw new AggregateError(errors, "Application destruction failed");
|
|
2897
2903
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supacloud/elysia",
|
|
3
|
-
"version": "0.29.
|
|
3
|
+
"version": "0.29.1",
|
|
4
4
|
"description": "Elysia runtime adapter for SupaCloud compiled modules: application/request scopes, route registration and validation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"directory": "packages/elysia"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@supacloud/app": "0.
|
|
52
|
+
"@supacloud/app": "0.25.0",
|
|
53
53
|
"@supacloud/contracts": "0.8.0",
|
|
54
54
|
"effect": "4.0.2",
|
|
55
55
|
"exact-mirror": "1.2.6",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"typebox": "1.3.34"
|
|
58
58
|
},
|
|
59
59
|
"overrides": {
|
|
60
|
-
"@supacloud/delivery": "0.
|
|
60
|
+
"@supacloud/delivery": "0.14.0",
|
|
61
61
|
"@supacloud/contracts": "0.8.0",
|
|
62
62
|
"@supacloud/commands": "0.9.1",
|
|
63
63
|
"@graphql-tools/utils": "^12.0.3"
|
|
@@ -66,10 +66,10 @@
|
|
|
66
66
|
"elysia": "2.0.0-beta.21"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@supacloud/compiler": "0.
|
|
70
|
-
"@supacloud/delivery": "0.
|
|
69
|
+
"@supacloud/compiler": "0.43.0",
|
|
70
|
+
"@supacloud/delivery": "0.14.0",
|
|
71
71
|
"@supacloud/commands": "0.9.1",
|
|
72
|
-
"@supacloud/db": "0.
|
|
72
|
+
"@supacloud/db": "0.16.0",
|
|
73
73
|
"@types/bun": "^1.4.2",
|
|
74
74
|
"elysia": "2.0.0-beta.21",
|
|
75
75
|
"typescript": "^7.0.2"
|