proteum 1.0.2 → 2.0.0-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 (185) hide show
  1. package/AGENTS.md +101 -0
  2. package/agents/codex/AGENTS.md +95 -0
  3. package/agents/codex/CODING_STYLE.md +71 -0
  4. package/agents/codex/agents.md.zip +0 -0
  5. package/agents/codex/client/AGENTS.md +102 -0
  6. package/agents/codex/client/pages/AGENTS.md +35 -0
  7. package/agents/codex/server/routes/AGENTS.md +12 -0
  8. package/agents/codex/server/services/AGENTS.md +137 -0
  9. package/agents/codex/tests/AGENTS.md +8 -0
  10. package/cli/app/config.ts +13 -11
  11. package/cli/app/index.ts +74 -82
  12. package/cli/bin.js +1 -1
  13. package/cli/commands/build.ts +51 -14
  14. package/cli/commands/check.ts +19 -0
  15. package/cli/commands/deploy/app.ts +4 -8
  16. package/cli/commands/deploy/web.ts +16 -20
  17. package/cli/commands/dev.ts +189 -64
  18. package/cli/commands/devEvents.ts +106 -0
  19. package/cli/commands/init.ts +63 -57
  20. package/cli/commands/lint.ts +21 -0
  21. package/cli/commands/refresh.ts +18 -0
  22. package/cli/commands/typecheck.ts +18 -0
  23. package/cli/compiler/client/identite.ts +80 -53
  24. package/cli/compiler/client/index.ts +139 -213
  25. package/cli/compiler/common/bundleAnalysis.ts +94 -0
  26. package/cli/compiler/common/clientManifest.ts +67 -0
  27. package/cli/compiler/common/controllers.ts +288 -0
  28. package/cli/compiler/common/files/autres.ts +7 -18
  29. package/cli/compiler/common/files/images.ts +40 -37
  30. package/cli/compiler/common/files/style.ts +11 -22
  31. package/cli/compiler/common/generatedRouteModules.ts +368 -0
  32. package/cli/compiler/common/index.ts +31 -65
  33. package/cli/compiler/common/loaders/forbid-ssr-import.js +13 -0
  34. package/cli/compiler/common/rspackAliases.ts +13 -0
  35. package/cli/compiler/common/scripts.ts +37 -0
  36. package/cli/compiler/index.ts +781 -230
  37. package/cli/compiler/server/index.ts +59 -75
  38. package/cli/compiler/writeIfChanged.ts +21 -0
  39. package/cli/index.ts +71 -72
  40. package/cli/paths.ts +51 -57
  41. package/cli/print.ts +17 -11
  42. package/cli/tsconfig.json +5 -4
  43. package/cli/utils/agents.ts +100 -0
  44. package/cli/utils/check.ts +71 -0
  45. package/cli/utils/index.ts +1 -3
  46. package/cli/utils/keyboard.ts +8 -25
  47. package/cli/utils/runProcess.ts +30 -0
  48. package/client/app/component.tsx +29 -29
  49. package/client/app/index.ts +36 -57
  50. package/client/app/service.ts +7 -12
  51. package/client/app.tsconfig.json +2 -2
  52. package/client/components/Dialog/Manager.ssr.tsx +40 -0
  53. package/client/components/Dialog/Manager.tsx +119 -150
  54. package/client/components/Dialog/status.tsx +3 -3
  55. package/client/components/index.ts +1 -1
  56. package/client/components/types.d.ts +1 -3
  57. package/client/dev/hmr.ts +65 -0
  58. package/client/global.d.ts +2 -2
  59. package/client/hooks.ts +6 -9
  60. package/client/index.ts +2 -1
  61. package/client/islands/index.ts +7 -0
  62. package/client/islands/useDeferredModule.ts +199 -0
  63. package/client/pages/_layout/index.tsx +4 -12
  64. package/client/pages/useHeader.tsx +14 -21
  65. package/client/router.ts +27 -0
  66. package/client/services/router/components/Link.tsx +34 -27
  67. package/client/services/router/components/Page.tsx +6 -14
  68. package/client/services/router/components/router.ssr.tsx +36 -0
  69. package/client/services/router/components/router.tsx +63 -83
  70. package/client/services/router/index.tsx +185 -220
  71. package/client/services/router/request/api.ts +97 -119
  72. package/client/services/router/request/history.ts +2 -2
  73. package/client/services/router/request/index.ts +13 -12
  74. package/client/services/router/request/multipart.ts +72 -62
  75. package/client/services/router/response/index.tsx +68 -61
  76. package/client/services/router/response/page.ts +28 -32
  77. package/client/utils/dom.ts +17 -33
  78. package/common/app/index.ts +3 -3
  79. package/common/data/chaines/index.ts +22 -23
  80. package/common/data/dates.ts +35 -70
  81. package/common/data/markdown.ts +42 -39
  82. package/common/dev/serverHotReload.ts +26 -0
  83. package/common/errors/index.tsx +110 -142
  84. package/common/router/contracts.ts +29 -0
  85. package/common/router/index.ts +89 -108
  86. package/common/router/layouts.ts +34 -47
  87. package/common/router/pageSetup.ts +50 -0
  88. package/common/router/register.ts +53 -24
  89. package/common/router/request/api.ts +30 -36
  90. package/common/router/request/index.ts +2 -8
  91. package/common/router/response/index.ts +8 -15
  92. package/common/router/response/page.ts +70 -58
  93. package/common/utils.ts +1 -1
  94. package/doc/TODO.md +1 -1
  95. package/eslint.js +62 -0
  96. package/package.json +14 -49
  97. package/prettier.config.cjs +9 -0
  98. package/scripts/cleanup-generated-controllers.ts +62 -0
  99. package/scripts/fix-reference-app-typing.ts +490 -0
  100. package/scripts/refactor-client-app-imports.ts +244 -0
  101. package/scripts/refactor-client-pages.ts +587 -0
  102. package/scripts/refactor-server-controllers.ts +470 -0
  103. package/scripts/refactor-server-runtime-aliases.ts +360 -0
  104. package/scripts/restore-client-app-import-files.ts +41 -0
  105. package/scripts/restore-files-from-git-head.ts +20 -0
  106. package/scripts/update-codex-agents.ts +35 -0
  107. package/server/app/commands.ts +35 -64
  108. package/server/app/container/config.ts +48 -59
  109. package/server/app/container/console/index.ts +202 -248
  110. package/server/app/container/index.ts +33 -71
  111. package/server/app/controller/index.ts +61 -0
  112. package/server/app/index.ts +39 -105
  113. package/server/app/service/container.ts +41 -42
  114. package/server/app/service/index.ts +120 -147
  115. package/server/context.ts +1 -1
  116. package/server/index.ts +25 -1
  117. package/server/services/auth/index.ts +75 -115
  118. package/server/services/auth/router/index.ts +31 -32
  119. package/server/services/auth/router/request.ts +14 -16
  120. package/server/services/cron/CronTask.ts +13 -26
  121. package/server/services/cron/index.ts +14 -36
  122. package/server/services/disks/driver.ts +40 -58
  123. package/server/services/disks/drivers/local/index.ts +79 -90
  124. package/server/services/disks/drivers/s3/index.ts +116 -163
  125. package/server/services/disks/index.ts +23 -38
  126. package/server/services/email/index.ts +45 -104
  127. package/server/services/email/utils.ts +14 -27
  128. package/server/services/fetch/index.ts +53 -85
  129. package/server/services/prisma/Facet.ts +39 -91
  130. package/server/services/prisma/index.ts +74 -110
  131. package/server/services/router/generatedRuntime.ts +29 -0
  132. package/server/services/router/http/index.ts +78 -73
  133. package/server/services/router/http/multipart.ts +19 -42
  134. package/server/services/router/index.ts +378 -365
  135. package/server/services/router/request/api.ts +26 -25
  136. package/server/services/router/request/index.ts +44 -51
  137. package/server/services/router/request/service.ts +7 -11
  138. package/server/services/router/request/validation/zod.ts +111 -148
  139. package/server/services/router/response/index.ts +110 -125
  140. package/server/services/router/response/mask/Filter.ts +31 -72
  141. package/server/services/router/response/mask/index.ts +8 -15
  142. package/server/services/router/response/mask/selecteurs.ts +11 -25
  143. package/server/services/router/response/page/clientManifest.ts +25 -0
  144. package/server/services/router/response/page/document.tsx +199 -127
  145. package/server/services/router/response/page/index.tsx +89 -94
  146. package/server/services/router/service.ts +13 -15
  147. package/server/services/schema/index.ts +17 -26
  148. package/server/services/schema/request.ts +19 -33
  149. package/server/services/schema/router/index.ts +8 -11
  150. package/server/services/security/encrypt/aes/index.ts +15 -35
  151. package/server/utils/slug.ts +29 -35
  152. package/skills/clean-project-code/SKILL.md +63 -0
  153. package/skills/clean-project-code/agents/openai.yaml +4 -0
  154. package/tsconfig.common.json +4 -3
  155. package/tsconfig.json +4 -1
  156. package/types/aliases.d.ts +17 -21
  157. package/types/controller-input.test.ts +48 -0
  158. package/types/express-extra.d.ts +6 -0
  159. package/types/global/constants.d.ts +13 -0
  160. package/types/global/express-extra.d.ts +6 -0
  161. package/types/global/modules.d.ts +13 -16
  162. package/types/global/utils.d.ts +17 -49
  163. package/types/global/vendors.d.ts +62 -0
  164. package/types/icons.d.ts +65 -1
  165. package/types/uuid.d.ts +3 -0
  166. package/types/vendors.d.ts +62 -0
  167. package/cli/compiler/common/babel/index.ts +0 -170
  168. package/cli/compiler/common/babel/plugins/index.ts +0 -0
  169. package/cli/compiler/common/babel/plugins/services.ts +0 -586
  170. package/cli/compiler/common/babel/routes/imports.ts +0 -127
  171. package/cli/compiler/common/babel/routes/routes.ts +0 -1130
  172. package/client/services/captcha/index.ts +0 -67
  173. package/client/services/socket/index.ts +0 -147
  174. package/common/data/rte/nodes.ts +0 -83
  175. package/common/data/stats.ts +0 -90
  176. package/common/utils/rte.ts +0 -183
  177. package/server/services/auth/old.ts +0 -277
  178. package/server/services/cache/commands.ts +0 -41
  179. package/server/services/cache/index.ts +0 -297
  180. package/server/services/cache/service.json +0 -6
  181. package/server/services/socket/index.ts +0 -162
  182. package/server/services/socket/scope.ts +0 -226
  183. package/server/services/socket/service.json +0 -6
  184. package/server/services_old/SocketClient.ts +0 -92
  185. package/server/services_old/Token.old.ts +0 -97
@@ -2,15 +2,12 @@
2
2
  - DEPENDANCES
3
3
  ----------------------------------*/
4
4
 
5
- // Npm
6
- import zod from 'zod';
7
-
8
5
  // Specific
9
- import type { Application } from "..";
10
- import type { Command } from "../commands";
6
+ import type { Application } from '../index';
7
+ import type { Command } from '../commands';
11
8
  import type { TServiceMetas } from './container';
12
- import type { TControllerDefinition, TRoute } from '../../services/router';
13
- import { Anomaly } from "@common/errors";
9
+ import context from '@server/context';
10
+ import type { TRouterContext, TAnyRouter } from '../../services/router';
14
11
 
15
12
  export { schema } from '../../services/router/request/validation/zod';
16
13
  export type { z } from '../../services/router/request/validation/zod';
@@ -19,8 +16,7 @@ export type { z } from '../../services/router/request/validation/zod';
19
16
  - TYPES: OPTIONS
20
17
  ----------------------------------*/
21
18
 
22
- export type AnyService<TSubServices extends StartedServicesIndex = StartedServicesIndex> =
23
- Service<{}, {}, Application>
19
+ export type AnyService = Service<{}, {}, Application, any>;
24
20
 
25
21
  export type { TRegisteredServicesIndex, TRegisteredService } from './container';
26
22
 
@@ -28,27 +24,49 @@ export type { TRegisteredServicesIndex, TRegisteredService } from './container';
28
24
  - TYPES: HOOKS
29
25
  ----------------------------------*/
30
26
 
31
- export type THookCallback<THookArgs extends THookOptions> = (...args: THookArgs["args"]) => Promise<void>;
27
+ export type THookCallback<THookArgs extends THookOptions> = (...args: THookArgs['args']) => Promise<void>;
32
28
 
33
- type THooksList = {
34
- [hookName: string]: THookOptions
35
- }
29
+ type THooksList = { [hookName: string]: THookOptions };
36
30
 
37
- type THookOptions = {
38
- args: any[]
39
- }
31
+ type THookOptions = { args: any[] };
40
32
 
41
- export type THooksIndex<THooks extends THooksList> = {[name in keyof THooks]?: THookCallback< THooks[name] >[]}
33
+ export type THooksIndex<THooks extends THooksList> = { [name in keyof THooks]?: THookCallback<THooks[name]>[] };
42
34
 
43
- export type StartedServicesIndex = {
44
- [serviceId: string]: AnyService
45
- }
35
+ export type StartedServicesIndex = { [serviceId: string]: AnyService };
36
+
37
+ type TServiceRouter<TApplication extends Application> = TApplication extends { Router: infer TRouter }
38
+ ? TRouter extends TAnyRouter
39
+ ? TRouter
40
+ : TAnyRouter
41
+ : TAnyRouter;
46
42
 
47
- export type TServiceArgs<TService extends AnyService> = [
48
- parent: AnyService | 'self',
49
- config: null | undefined | TService['config'],
50
- app: TService['app'] | 'self'
51
- ]
43
+ export type TServiceRequestContext<TApplication extends Application = Application> = TRouterContext<
44
+ TServiceRouter<TApplication>
45
+ >;
46
+
47
+ export type TServiceModelsClient<TApplication extends Application = Application> = TApplication extends {
48
+ Models: { client: infer TModels };
49
+ }
50
+ ? TModels
51
+ : TApplication extends {
52
+ models: { client: infer TModels };
53
+ }
54
+ ? TModels
55
+ : never;
56
+
57
+ export type TSetupConfig<TConfig> = TConfig extends (...args: any[]) => any
58
+ ? TConfig
59
+ : TConfig extends Array<infer TItem>
60
+ ? Array<TSetupConfig<TItem>>
61
+ : TConfig extends object
62
+ ? ({ [K in keyof TConfig]?: TSetupConfig<TConfig[K]> } & Record<string, unknown>)
63
+ : TConfig;
64
+
65
+ export type TServiceArgs<TService extends { config: any; app: any; parent: any }> = [
66
+ parent: TService['parent'] | 'self',
67
+ config: null | undefined | TSetupConfig<TService['config']>,
68
+ app: TService['app'] | 'self',
69
+ ];
52
70
 
53
71
  /*----------------------------------
54
72
  - CONFIG
@@ -56,128 +74,100 @@ export type TServiceArgs<TService extends AnyService> = [
56
74
 
57
75
  const LogPrefix = '[service]';
58
76
 
59
- type TDecoratorArgs = (
60
- [path: string] |
61
- [path: string, schema: zod.ZodSchema] |
62
- [path: string, schema: zod.ZodSchema, options?: Omit<TControllerDefinition, 'controller'|'schema'|'path'>] |
63
- [options: Omit<TControllerDefinition, 'controller'>]
64
- )
65
-
66
- export function Route( ...args: TDecoratorArgs ) {
67
-
68
- let path: string | undefined;
69
- let schema: zod.ZodSchema | undefined;
70
- let options: Omit<TControllerDefinition, 'controller'|'schema'|'path'> = {};
71
-
72
- if (typeof args[0] === 'object') {
73
- const { path: path_, schema: schema_, ...options_ } = args[0];
74
- path = path_;
75
- schema = schema_;
76
- options = options_;
77
- } else {
78
- path = args[0];
79
- schema = args[1];
80
- options = args[2] || {};
81
- }
82
-
83
- return function (
84
- target: any,
85
- propertyKey: string,
86
- descriptor: PropertyDescriptor
87
- ) {
88
- // Store the original method
89
- const originalMethod = descriptor.value;
90
-
91
- if (path === undefined)
92
- path = target.constructor.name + '/' + propertyKey;
93
-
94
- // Ensure the class has a static property to collect routes
95
- if (!target.__routes) {
96
- target.__routes = [];
97
- }
98
-
99
- // Create route object
100
- const route: TRoute = {
101
- method: 'POST',
102
- path: '/api/' + path,
103
- controller: originalMethod,
104
- schema: schema,
105
- options: {
106
- priority: options.priority || 0
107
- }
108
- };
109
-
110
- // Add this route to the class's routes collection
111
- target.__routes.push(route);
112
-
113
- // Original method is unchanged, just registered with router
114
- return descriptor;
115
- };
116
- }
77
+ const resolveSelfReference = <TSelf extends object, TValue extends object>(
78
+ value: TValue | 'self',
79
+ self: TSelf,
80
+ ): TValue | (TSelf & TValue) => (value === 'self' ? (self as TSelf & TValue) : value);
117
81
 
118
82
  /*----------------------------------
119
83
  - CLASS
120
84
  ----------------------------------*/
121
85
  export default abstract class Service<
122
- TConfig extends {},
86
+ TConfig extends {},
123
87
  THooks extends THooksList,
124
- TApplication extends Application,
125
- TParent extends AnyService
88
+ TApplication extends Application = Application,
89
+ TParent extends object = AnyService,
126
90
  > {
127
-
128
91
  public started?: Promise<void>;
92
+ public starting?: Promise<void>;
129
93
  public status: 'stopped' | 'starting' | 'running' | 'paused' = 'starting';
130
94
 
131
95
  public commands?: Command[];
132
96
  public metas!: TServiceMetas;
133
- public bindings: string[] = []
97
+ public bindings: string[] = [];
134
98
 
135
99
  public parent: TParent;
136
100
  public app: TApplication;
137
101
  public config: TConfig = {} as TConfig;
138
102
 
139
- public constructor(...[parent, config, app]: TServiceArgs<AnyService>) {
140
-
141
- this.parent = parent;
142
- if (this.parent === 'self')
143
- this.parent = this as unknown as TParent;
103
+ public constructor(
104
+ parent: TParent | 'self',
105
+ config: null | undefined | TSetupConfig<TConfig>,
106
+ app: TApplication | 'self',
107
+ ) {
108
+ this.parent = resolveSelfReference(parent, this) as TParent;
144
109
 
145
- this.app = app === 'self'
146
- ? this as unknown as TApplication
147
- : app
110
+ this.app = resolveSelfReference(app, this) as TApplication;
148
111
 
149
- this.config = config || {};
150
-
112
+ this.config = (config || {}) as TConfig;
151
113
  }
152
114
 
153
115
  public getServiceInstance() {
154
116
  return this;
155
117
  }
156
118
 
119
+ public get services(): TApplication {
120
+ return this.app;
121
+ }
122
+
123
+ public get models(): TServiceModelsClient<TApplication> {
124
+ const app = this.app as {
125
+ models?: { client?: TServiceModelsClient<TApplication> };
126
+ Models?: { client?: TServiceModelsClient<TApplication> };
127
+ };
128
+ const models = app.models?.client ?? app.Models?.client;
129
+
130
+ if (!models)
131
+ throw new Error(`${this.constructor.name} tried to access models but no Models service is registered.`);
132
+
133
+ return models;
134
+ }
135
+
136
+ protected get request(): TServiceRequestContext<TApplication> {
137
+ const store = context.getStore() as { requestContext?: TServiceRequestContext<TApplication> } | undefined;
138
+ const requestContext = store?.requestContext;
139
+
140
+ if (!requestContext)
141
+ throw new Error(
142
+ `${this.constructor.name} tried to access request context outside of a controller request.`,
143
+ );
144
+
145
+ return requestContext;
146
+ }
147
+
157
148
  /*----------------------------------
158
149
  - LIFECYCLE
159
150
  ----------------------------------*/
160
151
 
161
- protected async ready(): Promise<void> {}
152
+ protected async ready(): Promise<any> {}
162
153
 
163
- protected async shutdown(): Promise<void> {}
154
+ protected async shutdown(): Promise<any> {}
164
155
 
165
156
  /*----------------------------------
166
157
  - SUBSERVICES
167
158
  ----------------------------------*/
168
159
 
169
- // TODO:; babel plugin: transform Service references to app.use('Service')
170
- public use<TService extends AnyService = AnyService>(
160
+ public use<TService extends AnyService = AnyService>(
171
161
  serviceId: string,
172
- useOptions: { optional?: boolean } = {}
162
+ useOptions: { optional?: boolean } = {},
173
163
  ): TService | undefined {
164
+ const app = this.app as {
165
+ registered?: Record<string, { name: string }>;
166
+ } & Record<string, unknown>;
167
+ const registeredService = app.registered?.[serviceId];
168
+ if (registeredService !== undefined) return app[registeredService.name] as TService;
174
169
 
175
- const registeredService = this.app.registered[serviceId];
176
- if (registeredService !== undefined)
177
- return this.app[ registeredService.name ];
178
-
179
- if (useOptions.optional === false)
180
- throw new Error(`Service ${registeredService} not registered.`);
170
+ if (useOptions.optional === false) throw new Error(`Service ${registeredService} not registered.`);
181
171
 
182
172
  return undefined;
183
173
  }
@@ -186,50 +176,33 @@ export default abstract class Service<
186
176
  - HOOKS
187
177
  ----------------------------------*/
188
178
 
189
- public hooks: THooksIndex<THooks> = {}
190
-
191
- public on<THookName extends keyof THooksList>(
192
- name: THookName,
193
- callback: THookCallback<THooksList[THookName]>
194
- ) {
179
+ public hooks: THooksIndex<THooks> = {};
195
180
 
196
- const callbacks = this.hooks[ name ];
197
- if (callbacks)
198
- callbacks.push( callback );
199
- else
200
- this.hooks[ name ] = [callback]
181
+ public on<THookName extends keyof THooksList>(name: THookName, callback: THookCallback<THooksList[THookName]>) {
182
+ const callbacks = this.hooks[name];
183
+ if (callbacks) callbacks.push(callback);
184
+ else this.hooks[name] = [callback];
201
185
 
202
186
  return this;
203
187
  }
204
188
 
205
- public runHook<THookName extends keyof THooksList>(
206
- name: THookName,
207
- ...args: THooksList[THookName]["args"]
208
- ) {
209
-
189
+ public runHook<THookName extends keyof THooksList>(name: THookName, ...args: THooksList[THookName]['args']) {
210
190
  const callbacks = this.hooks[name];
211
- if (!callbacks)
212
- return;// console.info(LogPrefix, `No ${name} hook defined in the current service instance.`);
191
+ if (!callbacks) return; // console.info(LogPrefix, `No ${name} hook defined in the current service instance.`);
213
192
 
214
193
  //this.config.debug && console.info(`[hook] Run all ${name} hook (${callbacks.length}).`);
215
- return Promise.all(
216
- callbacks.map(
217
- cb => cb(...args)
218
- )
219
- ).then(() => {
220
- //this.config.debug && console.info(`[hook] Hooks ${name} executed with success.`);
221
- }).catch(e => {
222
- if (name === 'error') {
223
-
224
- // In error hook = avoid infinite loop
225
- console.error("Error hook", e);
226
-
227
- } else {
228
-
229
- // Let the error hook handle it
230
- throw e;
231
- }
232
- })
194
+ return Promise.all(callbacks.map((cb) => cb(...args)))
195
+ .then(() => {
196
+ //this.config.debug && console.info(`[hook] Hooks ${name} executed with success.`);
197
+ })
198
+ .catch((e) => {
199
+ if (name === 'error') {
200
+ // In error hook = avoid infinite loop
201
+ console.error('Error hook', e);
202
+ } else {
203
+ // Let the error hook handle it
204
+ throw e;
205
+ }
206
+ });
233
207
  }
234
-
235
- }
208
+ }
package/server/context.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import { AsyncLocalStorage } from 'async_hooks';
2
2
  import type { ChannelInfos } from '@server/app/container/console';
3
3
 
4
- export default new AsyncLocalStorage<ChannelInfos>();
4
+ export default new AsyncLocalStorage<ChannelInfos>();
package/server/index.ts CHANGED
@@ -1,4 +1,28 @@
1
1
  import AppContainer from './app/container';
2
2
  import Application from '@/server/.generated/app';
3
+ import { isServerHotReloadRequest, serverHotReloadMessageType } from '@common/dev/serverHotReload';
3
4
 
4
- AppContainer.start( Application );
5
+ const application = AppContainer.start(Application);
6
+
7
+ if (__DEV__ && typeof process.send === 'function') {
8
+ process.on('message', (message: unknown) => {
9
+ if (!isServerHotReloadRequest(message)) return;
10
+
11
+ void (async () => {
12
+ try {
13
+ await application.Router?.started;
14
+ await application.Router.reloadGeneratedDefinitions(message.changedFiles);
15
+
16
+ process.send?.({ type: serverHotReloadMessageType.succeeded, changedFiles: message.changedFiles });
17
+ } catch (error) {
18
+ const errorMessage = error instanceof Error ? error.stack || error.message : String(error);
19
+
20
+ process.send?.({
21
+ type: serverHotReloadMessageType.failed,
22
+ changedFiles: message.changedFiles,
23
+ error: errorMessage,
24
+ });
25
+ }
26
+ })();
27
+ });
28
+ }