@platformatic/runtime 3.12.0 → 3.13.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.
@@ -160,12 +160,13 @@ export class Controller extends EventEmitter {
160
160
  this.#logAndThrow(err)
161
161
  }
162
162
 
163
- this.emit('starting')
164
-
165
163
  if (this.capability.status === 'stopped') {
166
164
  return
167
165
  }
168
166
 
167
+ this.capability.updateStatus('starting')
168
+ this.emit('starting')
169
+
169
170
  if (this.#watch) {
170
171
  const watchConfig = await this.capability.getWatchConfig()
171
172
 
@@ -187,6 +188,9 @@ export class Controller extends EventEmitter {
187
188
  this.#listening = listen
188
189
  /* c8 ignore next 5 */
189
190
  } catch (err) {
191
+ this.capability.updateStatus('start:error')
192
+ this.emit('start:error', err)
193
+
190
194
  this.capability.log({ message: err.message, level: 'debug' })
191
195
  this.#starting = false
192
196
  throw err
@@ -194,6 +198,8 @@ export class Controller extends EventEmitter {
194
198
 
195
199
  this.#started = true
196
200
  this.#starting = false
201
+
202
+ this.capability.updateStatus('started')
197
203
  this.emit('started')
198
204
  }
199
205
 
@@ -203,6 +209,10 @@ export class Controller extends EventEmitter {
203
209
  }
204
210
 
205
211
  this.emit('stopping')
212
+ // Do not update status of the capability to "stopping" here otherwise
213
+ // if stop is called before start is finished, the capability will not
214
+ // be able to wait for start to finish and it will create a race condition.
215
+
206
216
  await this.#stopFileWatching()
207
217
  await this.capability.waitForDependentsStop(dependents)
208
218
  await this.capability.stop()
@@ -210,6 +220,8 @@ export class Controller extends EventEmitter {
210
220
  this.#started = false
211
221
  this.#starting = false
212
222
  this.#listening = false
223
+
224
+ this.capability.updateStatus('stopped')
213
225
  this.emit('stopped')
214
226
  }
215
227
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/runtime",
3
- "version": "3.12.0",
3
+ "version": "3.13.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -35,14 +35,14 @@
35
35
  "typescript": "^5.5.4",
36
36
  "undici-oidc-interceptor": "^0.5.0",
37
37
  "why-is-node-running": "^2.2.2",
38
- "@platformatic/composer": "3.12.0",
39
- "@platformatic/db": "3.12.0",
40
- "@platformatic/node": "3.12.0",
41
- "@platformatic/gateway": "3.12.0",
42
- "@platformatic/sql-graphql": "3.12.0",
43
- "@platformatic/service": "3.12.0",
44
- "@platformatic/sql-mapper": "3.12.0",
45
- "@platformatic/wattpm-pprof-capture": "3.12.0"
38
+ "@platformatic/gateway": "3.13.0",
39
+ "@platformatic/db": "3.13.0",
40
+ "@platformatic/node": "3.13.0",
41
+ "@platformatic/composer": "3.13.0",
42
+ "@platformatic/service": "3.13.0",
43
+ "@platformatic/sql-graphql": "3.13.0",
44
+ "@platformatic/sql-mapper": "3.13.0",
45
+ "@platformatic/wattpm-pprof-capture": "3.13.0"
46
46
  },
47
47
  "dependencies": {
48
48
  "@fastify/accepts": "^5.0.0",
@@ -73,12 +73,12 @@
73
73
  "undici": "^7.0.0",
74
74
  "undici-thread-interceptor": "^0.15.0",
75
75
  "ws": "^8.16.0",
76
- "@platformatic/foundation": "3.12.0",
77
- "@platformatic/generators": "3.12.0",
78
- "@platformatic/basic": "3.12.0",
79
- "@platformatic/itc": "3.12.0",
80
- "@platformatic/metrics": "3.12.0",
81
- "@platformatic/telemetry": "3.12.0"
76
+ "@platformatic/basic": "3.13.0",
77
+ "@platformatic/foundation": "3.13.0",
78
+ "@platformatic/generators": "3.13.0",
79
+ "@platformatic/itc": "3.13.0",
80
+ "@platformatic/metrics": "3.13.0",
81
+ "@platformatic/telemetry": "3.13.0"
82
82
  },
83
83
  "engines": {
84
84
  "node": ">=22.19.0"
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/runtime/3.12.0.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/runtime/3.13.0.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic Runtime Config",
5
5
  "type": "object",