@platformatic/basic 2.27.0 → 2.28.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.
Files changed (3) hide show
  1. package/index.js +11 -3
  2. package/package.json +7 -6
  3. package/schema.json +1 -1
package/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { createRequire } from '@platformatic/utils'
2
+ import jsonPatch from 'fast-json-patch'
2
3
  import { existsSync } from 'node:fs'
3
4
  import { readFile } from 'node:fs/promises'
4
5
  import { relative, resolve } from 'node:path'
@@ -109,7 +110,10 @@ export async function importStackableAndConfig (root, config) {
109
110
 
110
111
  async function buildStackable (opts) {
111
112
  const hadConfig = !!opts.config
112
- const { stackable, config, autodetectDescription, moduleName } = await importStackableAndConfig(opts.context.directory, opts.config)
113
+ const { stackable, config, autodetectDescription, moduleName } = await importStackableAndConfig(
114
+ opts.context.directory,
115
+ opts.config
116
+ )
113
117
  opts.config = config
114
118
 
115
119
  const serviceRoot = relative(process.cwd(), opts.context.directory)
@@ -136,8 +140,12 @@ async function buildStackable (opts) {
136
140
  }
137
141
 
138
142
  /* c8 ignore next 3 */
139
- export function transformConfig () {
140
- // This is currently empty but it left as a placeholder for the future
143
+ export async function transformConfig () {
144
+ const patch = workerData?.serviceConfig?.configPatch
145
+
146
+ if (Array.isArray(patch)) {
147
+ this.current = jsonPatch.applyPatch(this.current, patch).newDocument
148
+ }
141
149
  }
142
150
 
143
151
  export const schemaOptions = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/basic",
3
- "version": "2.27.0",
3
+ "version": "2.28.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -17,17 +17,18 @@
17
17
  "dependencies": {
18
18
  "@fastify/error": "^4.0.0",
19
19
  "execa": "^9.3.1",
20
+ "fast-json-patch": "^3.1.1",
20
21
  "pino": "^9.3.2",
21
22
  "pino-abstract-transport": "^2.0.0",
22
23
  "semver": "^7.6.3",
23
24
  "split2": "^4.2.0",
24
25
  "undici": "^7.0.0",
25
26
  "ws": "^8.18.0",
26
- "@platformatic/config": "2.27.0",
27
- "@platformatic/itc": "2.27.0",
28
- "@platformatic/telemetry": "2.27.0",
29
- "@platformatic/metrics": "2.27.0",
30
- "@platformatic/utils": "2.27.0"
27
+ "@platformatic/config": "2.28.0",
28
+ "@platformatic/itc": "2.28.0",
29
+ "@platformatic/metrics": "2.28.0",
30
+ "@platformatic/utils": "2.28.0",
31
+ "@platformatic/telemetry": "2.28.0"
31
32
  },
32
33
  "devDependencies": {
33
34
  "borp": "^0.19.0",
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/basic/2.27.0.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/basic/2.28.0.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic Stackable",
5
5
  "type": "object",