wattpm 2.32.0 → 2.33.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/lib/commands/patch-config.js +13 -2
- package/package.json +7 -7
- package/schema.json +1 -1
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { getParser, getStringifier } from '@platformatic/config'
|
|
1
|
+
import { ConfigManager, getParser, getStringifier } from '@platformatic/config'
|
|
2
2
|
import { ensureLoggableError, loadModule } from '@platformatic/utils'
|
|
3
3
|
import jsonPatch from 'fast-json-patch'
|
|
4
|
+
import { existsSync } from 'node:fs'
|
|
4
5
|
import { readFile, writeFile } from 'node:fs/promises'
|
|
5
6
|
import { createRequire } from 'node:module'
|
|
7
|
+
import { resolve } from 'node:path'
|
|
6
8
|
import { buildRuntime, findConfigurationFile, getRoot, parseArgs } from '../utils.js'
|
|
7
9
|
|
|
8
10
|
async function patchFile (path, patch) {
|
|
@@ -37,7 +39,16 @@ export async function patchConfig (logger, configurationFile, patchPath) {
|
|
|
37
39
|
const services = Object.fromEntries(loaded.runtime.services.map(service => [service.id, service]))
|
|
38
40
|
|
|
39
41
|
// Load configuration for all services
|
|
40
|
-
for (const
|
|
42
|
+
for (const service of loaded.runtime.services) {
|
|
43
|
+
if (!service.config) {
|
|
44
|
+
const candidate = ConfigManager.listConfigFiles().find(f => existsSync(resolve(service.path, f)))
|
|
45
|
+
|
|
46
|
+
if (candidate) {
|
|
47
|
+
service.config = resolve(service.path, candidate)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const { id, config } = service
|
|
41
52
|
const parser = getParser(config)
|
|
42
53
|
|
|
43
54
|
original.services[id] = parser(await readFile(configurationFile, 'utf-8'))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wattpm",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.33.0",
|
|
4
4
|
"description": "The Node.js Application Server",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"pino-pretty": "^13.0.0",
|
|
36
36
|
"split2": "^4.2.0",
|
|
37
37
|
"table": "^6.8.2",
|
|
38
|
-
"@platformatic/basic": "2.
|
|
39
|
-
"@platformatic/control": "2.
|
|
40
|
-
"@platformatic/
|
|
41
|
-
"@platformatic/
|
|
42
|
-
"@platformatic/utils": "2.
|
|
38
|
+
"@platformatic/basic": "2.33.0",
|
|
39
|
+
"@platformatic/control": "2.33.0",
|
|
40
|
+
"@platformatic/config": "2.33.0",
|
|
41
|
+
"@platformatic/runtime": "2.33.0",
|
|
42
|
+
"@platformatic/utils": "2.33.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"borp": "^0.19.0",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"neostandard": "^0.12.0",
|
|
50
50
|
"typescript": "^5.5.4",
|
|
51
51
|
"undici": "^7.0.0",
|
|
52
|
-
"@platformatic/node": "2.
|
|
52
|
+
"@platformatic/node": "2.33.0"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
55
|
"test": "npm run lint && borp --concurrency=1 --timeout=300000",
|
package/schema.json
CHANGED