@platformatic/service 1.13.5 → 1.13.6
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const { BaseGenerator } = require('@platformatic/generators')
|
|
3
|
+
const { BaseGenerator, addPrefixToEnv } = require('@platformatic/generators')
|
|
4
4
|
const { getPackageConfigurationObject } = require('@platformatic/generators/lib/utils')
|
|
5
5
|
const { readFile } = require('node:fs/promises')
|
|
6
6
|
const { join } = require('node:path')
|
|
@@ -68,8 +68,10 @@ declare module 'fastify' {
|
|
|
68
68
|
`
|
|
69
69
|
this.addFile({ path: '', file: 'global.d.ts', contents: GLOBAL_TYPES_TEMPLATE })
|
|
70
70
|
if (this.config.isRuntimeContext) {
|
|
71
|
-
// remove env variables
|
|
72
|
-
this.config.env
|
|
71
|
+
// remove env variables that are not for the plugins
|
|
72
|
+
delete this.config.env.PLT_SERVER_HOSTNAME
|
|
73
|
+
delete this.config.env.PORT
|
|
74
|
+
delete this.config.env.PLT_SERVER_LOGGER_LEVEL
|
|
73
75
|
}
|
|
74
76
|
|
|
75
77
|
this.addFile({ path: '', file: 'README.md', contents: await readFile(join(__dirname, 'README.md')) })
|
|
@@ -113,9 +115,22 @@ declare module 'fastify' {
|
|
|
113
115
|
config.plugins = {}
|
|
114
116
|
}
|
|
115
117
|
config.plugins.packages = this.packages.map((packageDefinition) => {
|
|
118
|
+
const packageConfigOutput = getPackageConfigurationObject(packageDefinition.options, this.config.serviceName)
|
|
119
|
+
if (Object.keys(packageConfigOutput.env).length > 0) {
|
|
120
|
+
const envForPackages = {}
|
|
121
|
+
Object.entries(packageConfigOutput.env).forEach((kv) => {
|
|
122
|
+
envForPackages[kv[0]] = kv[1]
|
|
123
|
+
})
|
|
124
|
+
if (this.config.isRuntimeContext) {
|
|
125
|
+
this.config.env = {
|
|
126
|
+
...this.config.env,
|
|
127
|
+
...addPrefixToEnv(envForPackages, this.config.envPrefix)
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
116
131
|
return {
|
|
117
132
|
name: packageDefinition.name,
|
|
118
|
-
options:
|
|
133
|
+
options: packageConfigOutput.config
|
|
119
134
|
}
|
|
120
135
|
})
|
|
121
136
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformatic/service",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.6",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -69,12 +69,12 @@
|
|
|
69
69
|
"pino-pretty": "^10.2.0",
|
|
70
70
|
"rfdc": "^1.3.0",
|
|
71
71
|
"ua-parser-js": "^1.0.36",
|
|
72
|
-
"@platformatic/
|
|
73
|
-
"@platformatic/
|
|
74
|
-
"@platformatic/
|
|
75
|
-
"@platformatic/
|
|
76
|
-
"@platformatic/
|
|
77
|
-
"@platformatic/
|
|
72
|
+
"@platformatic/client": "1.13.6",
|
|
73
|
+
"@platformatic/config": "1.13.6",
|
|
74
|
+
"@platformatic/swagger-ui-theme": "1.13.6",
|
|
75
|
+
"@platformatic/utils": "1.13.6",
|
|
76
|
+
"@platformatic/generators": "1.13.6",
|
|
77
|
+
"@platformatic/telemetry": "1.13.6"
|
|
78
78
|
},
|
|
79
79
|
"standard": {
|
|
80
80
|
"ignore": [
|