@platformatic/control 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.
- package/lib/services.js +19 -13
- package/package.json +5 -5
package/lib/services.js
CHANGED
|
@@ -7,36 +7,42 @@ const RuntimeApiClient = require('./runtime-api-client')
|
|
|
7
7
|
const tableColumns = [
|
|
8
8
|
{
|
|
9
9
|
value: 'id',
|
|
10
|
-
alias: 'NAME'
|
|
10
|
+
alias: 'NAME'
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
value: 'workers',
|
|
14
|
+
alias: 'WORKERS',
|
|
15
|
+
production: true
|
|
11
16
|
},
|
|
12
17
|
{
|
|
13
18
|
value: 'type',
|
|
14
|
-
alias: 'TYPE'
|
|
19
|
+
alias: 'TYPE'
|
|
15
20
|
},
|
|
16
21
|
{
|
|
17
22
|
value: 'entrypoint',
|
|
18
23
|
alias: 'ENTRYPOINT',
|
|
19
|
-
formatter:
|
|
24
|
+
formatter: entrypoint => {
|
|
20
25
|
return entrypoint ? 'yes' : 'no'
|
|
21
|
-
}
|
|
22
|
-
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
23
28
|
]
|
|
24
29
|
|
|
25
30
|
const tableConfig = {
|
|
26
31
|
border: getBorderCharacters('void'),
|
|
27
32
|
columnDefault: {
|
|
28
33
|
paddingLeft: 0,
|
|
29
|
-
paddingRight: 1
|
|
34
|
+
paddingRight: 1
|
|
30
35
|
},
|
|
31
|
-
drawHorizontalLine: () => false
|
|
36
|
+
drawHorizontalLine: () => false
|
|
32
37
|
}
|
|
33
38
|
|
|
34
|
-
async function printRuntimeServices (services) {
|
|
35
|
-
const
|
|
39
|
+
async function printRuntimeServices ({ production, services }) {
|
|
40
|
+
const columns = tableColumns.filter(c => typeof c.production === 'undefined' || c.production === production)
|
|
41
|
+
const raws = [columns.map(column => column.alias)]
|
|
36
42
|
|
|
37
|
-
for (const service of services
|
|
43
|
+
for (const service of services) {
|
|
38
44
|
const raw = []
|
|
39
|
-
for (const column of
|
|
45
|
+
for (const column of columns) {
|
|
40
46
|
let value = service[column.value]
|
|
41
47
|
if (column.formatter) {
|
|
42
48
|
value = column.formatter(value)
|
|
@@ -56,9 +62,9 @@ async function getRuntimeServicesCommand (argv) {
|
|
|
56
62
|
args: argv,
|
|
57
63
|
options: {
|
|
58
64
|
pid: { type: 'string', short: 'p' },
|
|
59
|
-
name: { type: 'string', short: 'n' }
|
|
65
|
+
name: { type: 'string', short: 'n' }
|
|
60
66
|
},
|
|
61
|
-
strict: false
|
|
67
|
+
strict: false
|
|
62
68
|
}).values
|
|
63
69
|
|
|
64
70
|
const client = new RuntimeApiClient()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformatic/control",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0-alpha.2",
|
|
4
4
|
"description": "Platformatic Control",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"split2": "^4.2.0",
|
|
26
26
|
"tsd": "^0.31.0",
|
|
27
27
|
"typescript": "^5.5.4",
|
|
28
|
-
"@platformatic/runtime": "2.
|
|
29
|
-
"@platformatic/service": "2.
|
|
28
|
+
"@platformatic/runtime": "2.8.0-alpha.2",
|
|
29
|
+
"@platformatic/service": "2.8.0-alpha.2"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@fastify/error": "^4.0.0",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"table": "^6.8.1",
|
|
38
38
|
"undici": "^6.9.0",
|
|
39
39
|
"ws": "^8.16.0",
|
|
40
|
-
"@platformatic/utils": "2.
|
|
40
|
+
"@platformatic/utils": "2.8.0-alpha.2"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"test": "pnpm run lint && pnpm run unit",
|
|
44
|
-
"unit": "borp --concurrency=1 --timeout=
|
|
44
|
+
"unit": "borp --concurrency=1 --timeout=300000",
|
|
45
45
|
"lint": "eslint"
|
|
46
46
|
}
|
|
47
47
|
}
|