wattpm 2.55.0 → 2.57.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.
- package/index.js +4 -0
- package/lib/commands/admin.js +37 -0
- package/lib/commands/build.js +8 -6
- package/package.json +7 -7
- package/schema.json +1 -1
package/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import { logsCommand } from './lib/commands/logs.js'
|
|
|
9
9
|
import { configCommand, envCommand, psCommand, servicesCommand } from './lib/commands/management.js'
|
|
10
10
|
import { metricsCommand } from './lib/commands/metrics.js'
|
|
11
11
|
import { patchConfigCommand } from './lib/commands/patch-config.js'
|
|
12
|
+
import { adminCommand } from './lib/commands/admin.js'
|
|
12
13
|
import { version } from './lib/schema.js'
|
|
13
14
|
import { createLogger, overrideFatal, parseArgs, setVerbose } from './lib/utils.js'
|
|
14
15
|
|
|
@@ -111,6 +112,9 @@ export async function main () {
|
|
|
111
112
|
case 'metrics':
|
|
112
113
|
command = metricsCommand
|
|
113
114
|
break
|
|
115
|
+
case 'admin':
|
|
116
|
+
command = adminCommand
|
|
117
|
+
break
|
|
114
118
|
default:
|
|
115
119
|
logger.fatal(
|
|
116
120
|
`Unknown command ${bold(unparsed[0])}. Please run ${bold("'wattpm help'")} to see available commands.`
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process'
|
|
2
|
+
import { parseArgs } from '../utils.js'
|
|
3
|
+
|
|
4
|
+
export function adminCommand (logger, args) {
|
|
5
|
+
logger.info('Running watt-admin via npx')
|
|
6
|
+
const {
|
|
7
|
+
values: { latest },
|
|
8
|
+
} = parseArgs(
|
|
9
|
+
args,
|
|
10
|
+
{
|
|
11
|
+
latest: {
|
|
12
|
+
type: 'boolean',
|
|
13
|
+
short: 'l'
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
false
|
|
17
|
+
)
|
|
18
|
+
const modifier = latest ? '@latest' : ''
|
|
19
|
+
const proc = spawn('npx', ['-y', '@platformatic/watt-admin' + modifier], { stdio: 'inherit' })
|
|
20
|
+
|
|
21
|
+
proc.on('exit', (code) => {
|
|
22
|
+
process.exit(code)
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const help = {
|
|
27
|
+
admin: {
|
|
28
|
+
usage: 'admin',
|
|
29
|
+
description: 'Start the admin interface',
|
|
30
|
+
options: [
|
|
31
|
+
{
|
|
32
|
+
usage: '-l --latest',
|
|
33
|
+
description: 'Use the latest version of @platformatic/watt-admin from',
|
|
34
|
+
},
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
}
|
package/lib/commands/build.js
CHANGED
|
@@ -86,7 +86,7 @@ export async function installDependencies (logger, root, services, production, p
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
async function updateDependencies (logger, availableVersions, path, target, force) {
|
|
89
|
+
async function updateDependencies (logger, latest, availableVersions, path, target, force) {
|
|
90
90
|
// Parse the configuration file, if any
|
|
91
91
|
const packageJsonPath = resolve(path, 'package.json')
|
|
92
92
|
|
|
@@ -112,10 +112,10 @@ async function updateDependencies (logger, availableVersions, path, target, forc
|
|
|
112
112
|
logger.fatal(
|
|
113
113
|
`Dependency ${bold(pkg)} of ${target}${sectionLabel} requires a non-updatable range ${bold(range)}. Try again with ${bold('-f/--force')} to update to the latest version.`
|
|
114
114
|
)
|
|
115
|
+
} else {
|
|
116
|
+
specifier = ''
|
|
117
|
+
newRange = latest
|
|
115
118
|
}
|
|
116
|
-
|
|
117
|
-
specifier = '^'
|
|
118
|
-
newRange = availableVersions[0]
|
|
119
119
|
} else {
|
|
120
120
|
newRange = availableVersions.find(v => satisfies(v, range))
|
|
121
121
|
}
|
|
@@ -239,17 +239,19 @@ export async function updateCommand (logger, args) {
|
|
|
239
239
|
}
|
|
240
240
|
|
|
241
241
|
const selfInfo = await selfInfoResponse.json()
|
|
242
|
+
const { latest } = selfInfo['dist-tags']
|
|
243
|
+
|
|
242
244
|
const availableVersions = rsort(
|
|
243
245
|
Object.values(selfInfo.versions)
|
|
244
246
|
.filter(s => !s.deprecated)
|
|
245
247
|
.map(s => s.version)
|
|
246
248
|
)
|
|
247
249
|
|
|
248
|
-
await updateDependencies(logger, availableVersions, root, `the ${bold('application')}`, force)
|
|
250
|
+
await updateDependencies(logger, latest, availableVersions, root, `the ${bold('application')}`, force)
|
|
249
251
|
|
|
250
252
|
// Now, for all the services in the configuration file, update the dependencies
|
|
251
253
|
for (const service of services) {
|
|
252
|
-
await updateDependencies(logger, availableVersions, service.path, `the service ${bold(service.id)}`, force)
|
|
254
|
+
await updateDependencies(logger, latest, availableVersions, service.path, `the service ${bold(service.id)}`, force)
|
|
253
255
|
}
|
|
254
256
|
|
|
255
257
|
logger.done('All dependencies have been updated.')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wattpm",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.57.0",
|
|
4
4
|
"description": "The Node.js Application Server",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"semver": "^7.7.0",
|
|
37
37
|
"split2": "^4.2.0",
|
|
38
38
|
"table": "^6.8.2",
|
|
39
|
-
"@platformatic/basic": "2.
|
|
40
|
-
"@platformatic/
|
|
41
|
-
"@platformatic/
|
|
42
|
-
"@platformatic/
|
|
43
|
-
"@platformatic/utils": "2.
|
|
39
|
+
"@platformatic/basic": "2.57.0",
|
|
40
|
+
"@platformatic/control": "2.57.0",
|
|
41
|
+
"@platformatic/runtime": "2.57.0",
|
|
42
|
+
"@platformatic/config": "2.57.0",
|
|
43
|
+
"@platformatic/utils": "2.57.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"borp": "^0.19.0",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"neostandard": "^0.12.0",
|
|
51
51
|
"typescript": "^5.5.4",
|
|
52
52
|
"undici": "^7.0.0",
|
|
53
|
-
"@platformatic/node": "2.
|
|
53
|
+
"@platformatic/node": "2.57.0"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"test": "npm run lint && borp --concurrency=1 --timeout=300000",
|
package/schema.json
CHANGED