@supacloud/elysia 0.29.0 → 0.29.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.
@@ -4,7 +4,7 @@
4
4
  "elysia": "2.0.0-beta.21",
5
5
  "effect": "4.0.2",
6
6
  "typescript": "7.0.2",
7
- "typebox": "1.3.34",
7
+ "typebox": "1.3.36",
8
8
  "exact-mirror": "1.2.6",
9
9
  "@typescript/typescript6": "6.0.2"
10
10
  }
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
- const provided = Effect.provide(layer)(program);
1042
- return Effect.runPromiseExit(provided);
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.0",
3
+ "version": "0.29.2",
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,27 +49,27 @@
49
49
  "directory": "packages/elysia"
50
50
  },
51
51
  "dependencies": {
52
- "@supacloud/app": "0.24.0",
53
- "@supacloud/contracts": "0.8.0",
52
+ "@supacloud/app": "0.26.1",
53
+ "@supacloud/contracts": "0.8.1",
54
54
  "effect": "4.0.2",
55
55
  "exact-mirror": "1.2.6",
56
- "jose": "^6.2.11",
57
- "typebox": "1.3.34"
56
+ "jose": "^6.2.12",
57
+ "typebox": "1.3.36"
58
58
  },
59
59
  "overrides": {
60
- "@supacloud/delivery": "0.8.0",
61
- "@supacloud/contracts": "0.8.0",
62
- "@supacloud/commands": "0.9.1",
60
+ "@supacloud/delivery": "0.14.1",
61
+ "@supacloud/contracts": "0.8.1",
62
+ "@supacloud/commands": "0.9.2",
63
63
  "@graphql-tools/utils": "^12.0.3"
64
64
  },
65
65
  "peerDependencies": {
66
66
  "elysia": "2.0.0-beta.21"
67
67
  },
68
68
  "devDependencies": {
69
- "@supacloud/compiler": "0.42.0",
70
- "@supacloud/delivery": "0.8.0",
71
- "@supacloud/commands": "0.9.1",
72
- "@supacloud/db": "0.14.0",
69
+ "@supacloud/compiler": "0.44.1",
70
+ "@supacloud/delivery": "0.14.1",
71
+ "@supacloud/commands": "0.9.2",
72
+ "@supacloud/db": "0.16.1",
73
73
  "@types/bun": "^1.4.2",
74
74
  "elysia": "2.0.0-beta.21",
75
75
  "typescript": "^7.0.2"