@platformatic/node 2.0.0-alpha.23 → 2.0.0-alpha.25

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 +4 -3
  2. package/package.json +7 -7
  3. package/schema.json +1 -1
package/index.js CHANGED
@@ -10,6 +10,7 @@ import {
10
10
  transformConfig
11
11
  } from '@platformatic/basic'
12
12
  import { ConfigManager } from '@platformatic/config'
13
+ import { setupNodeHTTPTelemetry } from '@platformatic/telemetry'
13
14
  import inject from 'light-my-request'
14
15
  import { existsSync } from 'node:fs'
15
16
  import { readFile } from 'node:fs/promises'
@@ -17,7 +18,6 @@ import { Server } from 'node:http'
17
18
  import { resolve as pathResolve, resolve } from 'node:path'
18
19
  import { pathToFileURL } from 'url'
19
20
  import { packageJson, schema } from './lib/schema.js'
20
- import { setupNodeHTTPTelemetry } from '@platformatic/telemetry'
21
21
 
22
22
  const validFields = [
23
23
  'main',
@@ -101,11 +101,12 @@ export class NodeStackable extends BaseStackable {
101
101
  this.#module = this.#module.default || this.#module
102
102
 
103
103
  // Deal with application
104
- if (typeof this.#module.build === 'function') {
104
+ const factory = ['build', 'create'].find(f => typeof this.#module[f] === 'function')
105
+ if (factory) {
105
106
  // We have build function, this Stackable will not use HTTP unless it is the entrypoint
106
107
  serverPromise.cancel()
107
108
 
108
- this.#app = await this.#module.build()
109
+ this.#app = await this.#module[factory]()
109
110
  this.#isFastify = isFastify(this.#app)
110
111
 
111
112
  if (this.#isFastify) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/node",
3
- "version": "2.0.0-alpha.23",
3
+ "version": "2.0.0-alpha.25",
4
4
  "description": "Platformatic Node.js Stackable",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -16,10 +16,10 @@
16
16
  "homepage": "https://github.com/platformatic/platformatic#readme",
17
17
  "dependencies": {
18
18
  "light-my-request": "^6.0.0",
19
- "@platformatic/basic": "2.0.0-alpha.23",
20
- "@platformatic/telemetry": "2.0.0-alpha.23",
21
- "@platformatic/utils": "2.0.0-alpha.23",
22
- "@platformatic/config": "2.0.0-alpha.23"
19
+ "@platformatic/basic": "2.0.0-alpha.25",
20
+ "@platformatic/config": "2.0.0-alpha.25",
21
+ "@platformatic/utils": "2.0.0-alpha.25",
22
+ "@platformatic/telemetry": "2.0.0-alpha.25"
23
23
  },
24
24
  "devDependencies": {
25
25
  "borp": "^0.17.0",
@@ -30,8 +30,8 @@
30
30
  "neostandard": "^0.11.1",
31
31
  "tsx": "^4.19.0",
32
32
  "typescript": "^5.5.4",
33
- "@platformatic/composer": "2.0.0-alpha.23",
34
- "@platformatic/service": "2.0.0-alpha.23"
33
+ "@platformatic/composer": "2.0.0-alpha.25",
34
+ "@platformatic/service": "2.0.0-alpha.25"
35
35
  },
36
36
  "scripts": {
37
37
  "test": "npm run lint && borp --concurrency=1 --no-timeout",
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/node/2.0.0-alpha.23.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/node/2.0.0-alpha.25.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic Node.js Stackable",
5
5
  "type": "object",