wattpm 2.7.1-alpha.2 → 2.8.0-alpha.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.
@@ -75,7 +75,7 @@ export async function restartCommand (logger, args) {
75
75
  await client.restartRuntime(runtime.pid)
76
76
  await client.close()
77
77
 
78
- logger.done(`Runtime ${bold(runtime.packageName)} have been restarted.`)
78
+ logger.done(`Runtime ${bold(runtime.packageName)} has been restarted.`)
79
79
  } catch (error) {
80
80
  if (error.code === 'PLT_CTR_RUNTIME_NOT_FOUND') {
81
81
  logger.fatal('Cannot find a matching runtime.')
@@ -96,17 +96,21 @@ export async function servicesCommand (logger, args) {
96
96
  try {
97
97
  const client = new RuntimeApiClient()
98
98
  const runtime = await client.getMatchingRuntime(getMatchingRuntimeArgs(logger, positionals))
99
- const services = await client.getRuntimeServices(runtime.pid)
99
+ const { production, services } = await client.getRuntimeServices(runtime.pid)
100
100
  await client.close()
101
101
 
102
- const rows = services.services.map(runtime => {
103
- const { id, type, entrypoint } = runtime
102
+ const headers = production
103
+ ? [bold('Name'), bold('Workers'), bold('Type'), bold('Entrypoint')]
104
+ : [bold('Name'), bold('Type'), bold('Entrypoint')]
105
+
106
+ const rows = services.map(runtime => {
107
+ const { id, workers, type, entrypoint } = runtime
104
108
 
105
109
  /* c8 ignore next */
106
- return [id, type, entrypoint ? 'Yes' : 'No']
110
+ return [id, workers, type, entrypoint ? 'Yes' : 'No'].filter(t => t)
107
111
  })
108
112
 
109
- console.log('\n' + table([[bold('Name'), bold('Type'), bold('Entrypoint')], ...rows], tableConfig))
113
+ console.log('\n' + table([headers, ...rows], tableConfig))
110
114
  } catch (error) {
111
115
  if (error.code === 'PLT_CTR_RUNTIME_NOT_FOUND') {
112
116
  logger.fatal('Cannot find a matching runtime.')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wattpm",
3
- "version": "2.7.1-alpha.2",
3
+ "version": "2.8.0-alpha.2",
4
4
  "description": "The Node.js Application Server",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -34,11 +34,11 @@
34
34
  "pino-pretty": "^11.2.2",
35
35
  "split2": "^4.2.0",
36
36
  "table": "^6.8.2",
37
- "@platformatic/basic": "2.7.1-alpha.2",
38
- "@platformatic/config": "2.7.1-alpha.2",
39
- "@platformatic/runtime": "2.7.1-alpha.2",
40
- "@platformatic/control": "2.7.1-alpha.2",
41
- "@platformatic/utils": "2.7.1-alpha.2"
37
+ "@platformatic/basic": "2.8.0-alpha.2",
38
+ "@platformatic/config": "2.8.0-alpha.2",
39
+ "@platformatic/runtime": "2.8.0-alpha.2",
40
+ "@platformatic/utils": "2.8.0-alpha.2",
41
+ "@platformatic/control": "2.8.0-alpha.2"
42
42
  },
43
43
  "devDependencies": {
44
44
  "borp": "^0.18.0",
@@ -50,8 +50,8 @@
50
50
  "undici": "^6.19.8"
51
51
  },
52
52
  "scripts": {
53
- "test": "npm run lint && borp --concurrency=1 --timeout=180000",
54
- "coverage": "npm run lint && borp -X test -C --concurrency=1 --timeout=180000",
53
+ "test": "npm run lint && borp --concurrency=1 --timeout=300000",
54
+ "coverage": "npm run lint && borp -X test -C --concurrency=1 --timeout=300000",
55
55
  "gen-schema": "node lib/schema.js > schema.json",
56
56
  "gen-types": "json2ts > config.d.ts < schema.json",
57
57
  "build": "pnpm run gen-schema && pnpm run gen-types",
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/wattpm/2.7.1-alpha.2.json",
2
+ "$id": "https://schemas.platformatic.dev/wattpm/2.8.0-alpha.2.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "type": "object",
5
5
  "properties": {
@@ -91,10 +91,33 @@
91
91
  },
92
92
  "useHttp": {
93
93
  "type": "boolean"
94
+ },
95
+ "workers": {
96
+ "anyOf": [
97
+ {
98
+ "type": "number",
99
+ "minimum": 1
100
+ },
101
+ {
102
+ "type": "string"
103
+ }
104
+ ]
94
105
  }
95
106
  }
96
107
  }
97
108
  },
109
+ "workers": {
110
+ "anyOf": [
111
+ {
112
+ "type": "number",
113
+ "minimum": 1
114
+ },
115
+ {
116
+ "type": "string"
117
+ }
118
+ ],
119
+ "default": 1
120
+ },
98
121
  "web": {
99
122
  "type": "array",
100
123
  "items": {
@@ -129,6 +152,17 @@
129
152
  },
130
153
  "useHttp": {
131
154
  "type": "boolean"
155
+ },
156
+ "workers": {
157
+ "anyOf": [
158
+ {
159
+ "type": "number",
160
+ "minimum": 1
161
+ },
162
+ {
163
+ "type": "string"
164
+ }
165
+ ]
132
166
  }
133
167
  }
134
168
  }
@@ -340,6 +374,41 @@
340
374
  }
341
375
  ]
342
376
  },
377
+ "gracefulShutdown": {
378
+ "type": "object",
379
+ "properties": {
380
+ "runtime": {
381
+ "anyOf": [
382
+ {
383
+ "type": "number",
384
+ "minimum": 1
385
+ },
386
+ {
387
+ "type": "string"
388
+ }
389
+ ],
390
+ "default": 10000
391
+ },
392
+ "service": {
393
+ "anyOf": [
394
+ {
395
+ "type": "number",
396
+ "minimum": 1
397
+ },
398
+ {
399
+ "type": "string"
400
+ }
401
+ ],
402
+ "default": 10000
403
+ }
404
+ },
405
+ "default": {},
406
+ "required": [
407
+ "runtime",
408
+ "service"
409
+ ],
410
+ "additionalProperties": false
411
+ },
343
412
  "undici": {
344
413
  "type": "object",
345
414
  "properties": {
@@ -382,35 +451,6 @@
382
451
  }
383
452
  }
384
453
  },
385
- "httpCache": {
386
- "oneOf": [
387
- {
388
- "type": "boolean"
389
- },
390
- {
391
- "type": "object",
392
- "properties": {
393
- "store": {
394
- "type": "string"
395
- },
396
- "methods": {
397
- "type": "array",
398
- "items": {
399
- "type": "string"
400
- },
401
- "default": [
402
- "GET",
403
- "HEAD"
404
- ],
405
- "minItems": 1
406
- },
407
- "cacheTagsHeader": {
408
- "type": "string"
409
- }
410
- }
411
- }
412
- ]
413
- },
414
454
  "watch": {
415
455
  "anyOf": [
416
456
  {