platformatic 2.31.0 → 2.32.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/cli.js +2 -0
- package/lib/patch-config.js +47 -0
- package/package.json +17 -17
package/cli.js
CHANGED
|
@@ -20,6 +20,7 @@ import { pathToFileURL } from 'node:url'
|
|
|
20
20
|
import { logo } from './lib/ascii.js'
|
|
21
21
|
import { build } from './lib/build.js'
|
|
22
22
|
import { install } from './lib/install.js'
|
|
23
|
+
import { patchConfig } from './lib/patch-config.js'
|
|
23
24
|
import { resolve } from './lib/resolve.js'
|
|
24
25
|
import { upgrade } from './lib/upgrade.js'
|
|
25
26
|
|
|
@@ -71,6 +72,7 @@ program.register('inject', async args => injectRuntimeCommand(args))
|
|
|
71
72
|
program.register('logs', async args => streamRuntimeLogsCommand(args))
|
|
72
73
|
program.register('upgrade', upgrade)
|
|
73
74
|
program.register('resolve', resolve)
|
|
75
|
+
program.register('patch-config', patchConfig)
|
|
74
76
|
program.register('client', client)
|
|
75
77
|
program.register('build', build)
|
|
76
78
|
program.register('install', install)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Store } from '@platformatic/config'
|
|
2
|
+
import { platformaticRuntime } from '@platformatic/runtime'
|
|
3
|
+
import parseArgs from 'minimist'
|
|
4
|
+
import pino from 'pino'
|
|
5
|
+
import pretty from 'pino-pretty'
|
|
6
|
+
import { patchConfig as wattPatchConfig } from 'wattpm'
|
|
7
|
+
|
|
8
|
+
export async function patchConfig (argv) {
|
|
9
|
+
const args = parseArgs(argv, {
|
|
10
|
+
alias: {
|
|
11
|
+
config: 'c',
|
|
12
|
+
patch: 'p'
|
|
13
|
+
},
|
|
14
|
+
string: ['config', 'patch']
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
const logger = pino(
|
|
18
|
+
pretty({
|
|
19
|
+
translateTime: 'SYS:HH:MM:ss',
|
|
20
|
+
ignore: 'hostname,pid'
|
|
21
|
+
})
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
try {
|
|
25
|
+
const store = new Store({
|
|
26
|
+
cwd: process.cwd(),
|
|
27
|
+
logger
|
|
28
|
+
})
|
|
29
|
+
store.add(platformaticRuntime)
|
|
30
|
+
|
|
31
|
+
const { configManager } = await store.loadConfig({
|
|
32
|
+
config: args.config,
|
|
33
|
+
overrides: {
|
|
34
|
+
onMissingEnv () {
|
|
35
|
+
return ''
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
await wattPatchConfig(logger, configManager.fullPath, args.patch)
|
|
41
|
+
|
|
42
|
+
logger.info('✅ Patch executed correctly.')
|
|
43
|
+
} catch (err) {
|
|
44
|
+
console.log(err)
|
|
45
|
+
process.exit(1)
|
|
46
|
+
}
|
|
47
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "platformatic",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.32.0",
|
|
4
4
|
"description": "Platformatic CLI",
|
|
5
5
|
"main": "cli.js",
|
|
6
6
|
"type": "module",
|
|
@@ -37,14 +37,14 @@
|
|
|
37
37
|
"mkdirp": "^2.1.6",
|
|
38
38
|
"neostandard": "^0.12.0",
|
|
39
39
|
"typescript": "^5.5.3",
|
|
40
|
-
"@platformatic/astro": "2.
|
|
41
|
-
"@platformatic/
|
|
42
|
-
"@platformatic/
|
|
43
|
-
"@platformatic/next": "2.
|
|
44
|
-
"@platformatic/node": "2.
|
|
45
|
-
"@platformatic/remix": "2.
|
|
46
|
-
"@platformatic/service": "2.
|
|
47
|
-
"@platformatic/vite": "2.
|
|
40
|
+
"@platformatic/astro": "2.32.0",
|
|
41
|
+
"@platformatic/composer": "2.32.0",
|
|
42
|
+
"@platformatic/db": "2.32.0",
|
|
43
|
+
"@platformatic/next": "2.32.0",
|
|
44
|
+
"@platformatic/node": "2.32.0",
|
|
45
|
+
"@platformatic/remix": "2.32.0",
|
|
46
|
+
"@platformatic/service": "2.32.0",
|
|
47
|
+
"@platformatic/vite": "2.32.0"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@fastify/error": "^4.0.0",
|
|
@@ -60,14 +60,14 @@
|
|
|
60
60
|
"pino-pretty": "^13.0.0",
|
|
61
61
|
"split2": "^4.2.0",
|
|
62
62
|
"undici": "^7.0.0",
|
|
63
|
-
"@platformatic/basic": "2.
|
|
64
|
-
"@platformatic/client-cli": "2.
|
|
65
|
-
"@platformatic/config": "2.
|
|
66
|
-
"@platformatic/control": "2.
|
|
67
|
-
"@platformatic/runtime": "2.
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"wattpm": "2.
|
|
63
|
+
"@platformatic/basic": "2.32.0",
|
|
64
|
+
"@platformatic/client-cli": "2.32.0",
|
|
65
|
+
"@platformatic/config": "2.32.0",
|
|
66
|
+
"@platformatic/control": "2.32.0",
|
|
67
|
+
"@platformatic/runtime": "2.32.0",
|
|
68
|
+
"@platformatic/utils": "2.32.0",
|
|
69
|
+
"create-platformatic": "2.32.0",
|
|
70
|
+
"wattpm": "2.32.0"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
73
|
"test": "pnpm run lint && borp --no-timeout --concurrency 1",
|