@platformatic/node 3.0.0-alpha.1 → 3.0.0-alpha.2

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/config.d.ts CHANGED
@@ -432,5 +432,6 @@ export interface PlatformaticNodeJsConfig {
432
432
  absoluteUrl?: boolean;
433
433
  dispatchViaHttp?: boolean;
434
434
  disablePlatformaticInBuild?: boolean;
435
+ hasServer?: boolean;
435
436
  };
436
437
  }
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { transform as basicTransform, resolve, validationOptions } from '@platformatic/basic'
2
- import { kMetadata, loadConfiguration as utilsLoadConfiguration } from '@platformatic/utils'
2
+ import { kMetadata, loadConfiguration as utilsLoadConfiguration } from '@platformatic/foundation'
3
3
  import { schema } from './lib/schema.js'
4
4
  import { NodeStackable } from './lib/stackable.js'
5
5
 
package/lib/schema.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { schemaComponents as basicSchemaComponents } from '@platformatic/basic'
2
- import { schemaComponents as utilsSchemaComponents } from '@platformatic/utils'
2
+ import { schemaComponents as utilsSchemaComponents } from '@platformatic/foundation'
3
3
  import { readFileSync } from 'node:fs'
4
4
  import { resolve } from 'node:path'
5
5
 
@@ -24,6 +24,10 @@ const node = {
24
24
  disablePlatformaticInBuild: {
25
25
  type: 'boolean',
26
26
  default: false
27
+ },
28
+ hasServer: {
29
+ type: 'boolean',
30
+ default: true
27
31
  }
28
32
  },
29
33
  default: {},
@@ -44,7 +48,7 @@ export const schema = {
44
48
  logger: utilsSchemaComponents.logger,
45
49
  server: utilsSchemaComponents.server,
46
50
  watch: basicSchemaComponents.watch,
47
- application: basicSchemaComponents.application,
51
+ application: basicSchemaComponents.buildableApplication,
48
52
  runtime: utilsSchemaComponents.wrappedRuntime,
49
53
  node
50
54
  },
package/lib/stackable.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  importFile,
8
8
  injectViaRequest
9
9
  } from '@platformatic/basic'
10
- import { features } from '@platformatic/utils'
10
+ import { features } from '@platformatic/foundation'
11
11
  import inject from 'light-my-request'
12
12
  import { existsSync } from 'node:fs'
13
13
  import { readFile } from 'node:fs/promises'
@@ -117,7 +117,7 @@ export class NodeStackable extends BaseStackable {
117
117
  const config = this.config
118
118
 
119
119
  if (!this.isProduction && (await isServiceBuildable(this.root, config))) {
120
- this.logger.info(`Building service "${this.serviceId}" before starting in devevelopment mode ...`)
120
+ this.logger.info(`Building service "${this.serviceId}" before starting in development mode ...`)
121
121
  try {
122
122
  await this.build()
123
123
  this.childManager = null
@@ -159,7 +159,7 @@ export class NodeStackable extends BaseStackable {
159
159
  // Deal with application
160
160
  const factory = ['build', 'create'].find(f => typeof this.#module[f] === 'function')
161
161
 
162
- if (this.#module.hasServer !== false) {
162
+ if (config.node?.hasServer !== false && this.#module.hasServer !== false) {
163
163
  if (factory) {
164
164
  // We have build function, this Stackable will not use HTTP unless it is the entrypoint
165
165
  serverPromise.cancel()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/node",
3
- "version": "3.0.0-alpha.1",
3
+ "version": "3.0.0-alpha.2",
4
4
  "description": "Platformatic Node.js Stackable",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -17,9 +17,9 @@
17
17
  "dependencies": {
18
18
  "json5": "^2.2.3",
19
19
  "light-my-request": "^6.0.0",
20
- "@platformatic/basic": "3.0.0-alpha.1",
21
- "@platformatic/generators": "3.0.0-alpha.1",
22
- "@platformatic/utils": "3.0.0-alpha.1"
20
+ "@platformatic/generators": "3.0.0-alpha.2",
21
+ "@platformatic/basic": "3.0.0-alpha.2",
22
+ "@platformatic/foundation": "3.0.0-alpha.2"
23
23
  },
24
24
  "devDependencies": {
25
25
  "borp": "^0.20.0",
@@ -31,8 +31,11 @@
31
31
  "neostandard": "^0.12.0",
32
32
  "tsx": "^4.19.0",
33
33
  "typescript": "^5.5.4",
34
- "@platformatic/composer": "3.0.0-alpha.1",
35
- "@platformatic/service": "3.0.0-alpha.1"
34
+ "@platformatic/composer": "3.0.0-alpha.2",
35
+ "@platformatic/service": "3.0.0-alpha.2"
36
+ },
37
+ "engines": {
38
+ "node": ">=22.18.0"
36
39
  },
37
40
  "scripts": {
38
41
  "test": "pnpm run lint && borp --concurrency=1 --timeout 1200000",
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/node/3.0.0-alpha.1.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/node/3.0.0-alpha.2.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic Node.js Config",
5
5
  "type": "object",
@@ -362,6 +362,7 @@
362
362
  }
363
363
  },
364
364
  "additionalProperties": false,
365
+ "required": [],
365
366
  "default": {}
366
367
  },
367
368
  "runtime": {
@@ -1401,6 +1402,10 @@
1401
1402
  "disablePlatformaticInBuild": {
1402
1403
  "type": "boolean",
1403
1404
  "default": false
1405
+ },
1406
+ "hasServer": {
1407
+ "type": "boolean",
1408
+ "default": true
1404
1409
  }
1405
1410
  },
1406
1411
  "default": {},