@loutrejs/loutre 0.8.2 → 0.9.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.
Files changed (41) hide show
  1. package/README.md +3 -3
  2. package/dist/adapters/bun.d.ts +1 -0
  3. package/dist/adapters/bun.js +40 -75
  4. package/dist/application/definition.d.ts +4 -4
  5. package/dist/application/kernel.js +1 -1
  6. package/dist/core/extension.d.ts +7 -3
  7. package/dist/core/generic-layer.d.ts +2 -2
  8. package/dist/core/generic-layer.js +1 -1
  9. package/dist/core/index.d.ts +4 -4
  10. package/dist/core/index.js +1 -1
  11. package/dist/core/injection.d.ts +11 -1
  12. package/dist/core/injection.js +7 -3
  13. package/dist/core/model/context.d.ts +2 -1
  14. package/dist/core/model/context.js +23 -12
  15. package/dist/core/model/lifecycle.js +1 -1
  16. package/dist/core/model/modules.js +6 -6
  17. package/dist/core/model/providers.js +2 -2
  18. package/dist/core/model/visibility.d.ts +3 -2
  19. package/dist/core/model/visibility.js +3 -5
  20. package/dist/core/model.js +1 -1
  21. package/dist/core/module.d.ts +6 -4
  22. package/dist/core/module.js +6 -1
  23. package/dist/generated/version.d.ts +1 -1
  24. package/dist/generated/version.js +1 -1
  25. package/dist/http/extension.js +7 -6
  26. package/dist/message-port/extension.js +3 -3
  27. package/dist/runtime/di.d.ts +4 -2
  28. package/dist/runtime/di.js +33 -14
  29. package/dist/runtime/engine.d.ts +1 -0
  30. package/dist/runtime/engine.js +15 -1
  31. package/dist/runtime/index.d.ts +5 -1
  32. package/dist/runtime/index.js +3 -1
  33. package/dist/runtime/kernel.d.ts +2 -2
  34. package/dist/runtime/kernel.js +47 -9
  35. package/dist/runtime/shutdown-hooks.d.ts +16 -0
  36. package/dist/runtime/shutdown-hooks.js +69 -0
  37. package/dist/runtime/shutdown.d.ts +20 -0
  38. package/dist/runtime/shutdown.js +71 -0
  39. package/dist/tasks/extension.js +11 -10
  40. package/dist/websocket/extension.js +5 -5
  41. package/package.json +2 -2
@@ -170,23 +170,23 @@ function joinPath(parent, child) {
170
170
  return child;
171
171
  return `${parent}${child}`;
172
172
  }
173
- function createWebSocketRuntime(executions, driver, applicationRuntime) {
173
+ function createWebSocketRuntime(bindings, driver, applicationRuntime) {
174
174
  const handlers = new Map();
175
175
  const sessions = new Set();
176
176
  let state = 'running';
177
177
  const ingress = new IngressGate();
178
- for (const execution of executions) {
178
+ for (const { execution, resolve } of bindings) {
179
179
  handlers.set(execution.id, runInInjectionContext({
180
180
  consumer: {
181
181
  kind: 'execution',
182
182
  id: `websocket:${execution.id}`,
183
183
  name: execution.id,
184
184
  },
185
- resolve: (token) => applicationRuntime.resolve(token, execution.id),
185
+ resolve: (token, consumer) => resolve(token, { consumer }),
186
186
  }, () => execution.compiled.factory()));
187
187
  }
188
- const routes = executions
189
- .flatMap((execution) => execution.compiled.routes.map((route) => ({
188
+ const routes = bindings
189
+ .flatMap(({ execution }) => execution.compiled.routes.map((route) => ({
190
190
  executionId: execution.id,
191
191
  route,
192
192
  })))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loutrejs/loutre",
3
- "version": "0.8.2",
3
+ "version": "0.9.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "files": [
@@ -72,7 +72,7 @@
72
72
  },
73
73
  "dependencies": {
74
74
  "@standard-schema/spec": "^1.1.0",
75
- "ts-pattern": "^5.9.0"
75
+ "ts-pattern": "^5.9.2"
76
76
  },
77
77
  "repository": {
78
78
  "type": "git",