@platformatic/service 2.1.0 → 2.2.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.d.ts CHANGED
@@ -35,6 +35,7 @@ export interface Stackable<ConfigType, Generator = DefaultGenerator> extends _St
35
35
  version?: string
36
36
  upgrade?: (config: any, version: string) => Promise<any>
37
37
  transformConfig?: (config: any) => Promise<any>
38
+ buildStackable: (opts: { config: string }, app?: object) => Promise<StackableInterface>
38
39
  }
39
40
 
40
41
  interface TSCompilerOptions {
package/index.test-d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { expectType, expectError } from 'tsd'
2
2
  import { FastifyInstance } from 'fastify'
3
- import ConfigManager from '@platformatic/config'
3
+ import ConfigManager, { StackableInterface } from '@platformatic/config'
4
4
  import { OpenAPI } from 'openapi-types'
5
5
  import type { MercuriusPlugin } from 'mercurius'
6
6
  import { PlatformaticService } from './config'
@@ -57,6 +57,7 @@ function buildStackable (): Stackable<PlatformaticServiceConfig> {
57
57
  }
58
58
  return config
59
59
  },
60
+ buildStackable: () => Promise.resolve({} as StackableInterface),
60
61
  }
61
62
 
62
63
  // configVersion is not part of ConfigManagerConfig
@@ -95,6 +96,7 @@ function buildStackable2 (): Stackable<PlatformaticServiceConfig> {
95
96
  }
96
97
  },
97
98
  },
99
+ buildStackable: () => Promise.resolve({} as StackableInterface),
98
100
  }
99
101
 
100
102
  await start(myApp, ['--help'])
package/lib/start.js CHANGED
@@ -103,13 +103,13 @@ async function buildServer (options, app, context) {
103
103
  context
104
104
  }
105
105
  const handler = await createServer(serverContext)
106
- handler.decorate('start', async () => {
106
+ handler.start = async function () {
107
107
  serverContext.url = await handler.listen({
108
108
  host: options.server?.hostname || '127.0.0.1',
109
109
  port: options.server?.port || 0,
110
110
  })
111
111
  return serverContext.url
112
- })
112
+ }
113
113
  configManager.on('error', function (err) {
114
114
  /* c8 ignore next 1 */
115
115
  handler.log.error({ err }, 'error reloading the configuration')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/service",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -76,13 +76,13 @@
76
76
  "rfdc": "^1.3.1",
77
77
  "semgrator": "^0.3.0",
78
78
  "undici": "^6.9.0",
79
- "@platformatic/client": "2.1.0",
80
- "@platformatic/generators": "2.1.0",
81
- "@platformatic/config": "2.1.0",
82
- "@platformatic/ts-compiler": "2.1.0",
83
- "@platformatic/utils": "2.1.0",
84
- "@platformatic/scalar-theme": "2.1.0",
85
- "@platformatic/telemetry": "2.1.0"
79
+ "@platformatic/client": "2.2.0",
80
+ "@platformatic/config": "2.2.0",
81
+ "@platformatic/scalar-theme": "2.2.0",
82
+ "@platformatic/telemetry": "2.2.0",
83
+ "@platformatic/generators": "2.2.0",
84
+ "@platformatic/ts-compiler": "2.2.0",
85
+ "@platformatic/utils": "2.2.0"
86
86
  },
87
87
  "scripts": {
88
88
  "test": "pnpm run lint && borp -T --concurrency=1 --timeout=180000 && tsd",
package/schema.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/service/2.1.0.json",
3
- "version": "2.1.0",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/service/2.2.0.json",
3
+ "version": "2.2.0",
4
4
  "title": "Platformatic Service",
5
5
  "type": "object",
6
6
  "properties": {