@platformatic/runtime 2.25.0 → 2.26.0-alpha.1

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
@@ -5,7 +5,7 @@
5
5
  * and run json-schema-to-typescript to regenerate this file.
6
6
  */
7
7
 
8
- export type HttpsSchemasPlatformaticDevPlatformaticRuntime2250Json = {
8
+ export type HttpsSchemasPlatformaticDevPlatformaticRuntime2260Alpha1Json = {
9
9
  [k: string]: unknown;
10
10
  } & {
11
11
  $schema?: string;
package/lib/config.js CHANGED
@@ -3,6 +3,7 @@
3
3
  const { readdir } = require('node:fs/promises')
4
4
  const { join, resolve: pathResolve, isAbsolute } = require('node:path')
5
5
 
6
+ const { createRequire, loadModule } = require('@platformatic/utils')
6
7
  const ConfigManager = require('@platformatic/config')
7
8
  const { Store } = require('@platformatic/config')
8
9
 
@@ -103,6 +104,15 @@ async function _transformConfig (configManager, args) {
103
104
  const serviceConfig = await store.loadConfig(service)
104
105
  service.isPLTService = !!serviceConfig.app.isPLTService
105
106
  service.type = serviceConfig.app.configType
107
+ const _require = createRequire(service.path)
108
+ // This is needed to work around Rust bug on dylibs:
109
+ // https://github.com/rust-lang/rust/issues/91979
110
+ // https://github.com/rollup/rollup/issues/5761
111
+ // TODO(mcollina): we should expose this inside every stackable configuration.
112
+ serviceConfig.app.modulesToLoad?.forEach((m) => {
113
+ const toLoad = _require.resolve(m)
114
+ loadModule(_require, toLoad).catch(() => {})
115
+ })
106
116
  } catch (err) {
107
117
  // Fallback if for any reason a dependency is not found
108
118
  try {
@@ -120,6 +130,25 @@ async function _transformConfig (configManager, args) {
120
130
  service.isPLTService = false
121
131
  }
122
132
  }
133
+ } else {
134
+ // We need to identify the service type
135
+ const basic = await import('@platformatic/basic')
136
+ service.isPLTService = false
137
+ try {
138
+ const imported = await basic.importStackableAndConfig(service.path)
139
+ service.type = imported.stackable.default.configType
140
+ const _require = createRequire(service.path)
141
+ // This is needed to work around Rust bug on dylibs:
142
+ // https://github.com/rust-lang/rust/issues/91979
143
+ // https://github.com/rollup/rollup/issues/5761
144
+ // TODO(mcollina): we should expose this inside every stackable configuration.
145
+ imported.stackable.default.modulesToLoad?.forEach((m) => {
146
+ const toLoad = _require.resolve(m)
147
+ loadModule(_require, toLoad).catch(() => {})
148
+ })
149
+ } catch {
150
+ // Nothing to do here
151
+ }
123
152
  }
124
153
 
125
154
  service.entrypoint = service.id === config.entrypoint
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/runtime",
3
- "version": "2.25.0",
3
+ "version": "2.26.0-alpha.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -35,12 +35,12 @@
35
35
  "typescript": "^5.5.4",
36
36
  "undici-oidc-interceptor": "^0.5.0",
37
37
  "why-is-node-running": "^2.2.2",
38
- "@platformatic/composer": "2.25.0",
39
- "@platformatic/db": "2.25.0",
40
- "@platformatic/node": "2.25.0",
41
- "@platformatic/service": "2.25.0",
42
- "@platformatic/sql-graphql": "2.25.0",
43
- "@platformatic/sql-mapper": "2.25.0"
38
+ "@platformatic/composer": "2.26.0-alpha.1",
39
+ "@platformatic/db": "2.26.0-alpha.1",
40
+ "@platformatic/node": "2.26.0-alpha.1",
41
+ "@platformatic/service": "2.26.0-alpha.1",
42
+ "@platformatic/sql-graphql": "2.26.0-alpha.1",
43
+ "@platformatic/sql-mapper": "2.26.0-alpha.1"
44
44
  },
45
45
  "dependencies": {
46
46
  "@fastify/error": "^4.0.0",
@@ -72,13 +72,13 @@
72
72
  "undici": "^7.0.0",
73
73
  "undici-thread-interceptor": "^0.10.0",
74
74
  "ws": "^8.16.0",
75
- "@platformatic/basic": "2.25.0",
76
- "@platformatic/generators": "2.25.0",
77
- "@platformatic/config": "2.25.0",
78
- "@platformatic/ts-compiler": "2.25.0",
79
- "@platformatic/telemetry": "2.25.0",
80
- "@platformatic/itc": "2.25.0",
81
- "@platformatic/utils": "2.25.0"
75
+ "@platformatic/basic": "2.26.0-alpha.1",
76
+ "@platformatic/config": "2.26.0-alpha.1",
77
+ "@platformatic/itc": "2.26.0-alpha.1",
78
+ "@platformatic/generators": "2.26.0-alpha.1",
79
+ "@platformatic/telemetry": "2.26.0-alpha.1",
80
+ "@platformatic/ts-compiler": "2.26.0-alpha.1",
81
+ "@platformatic/utils": "2.26.0-alpha.1"
82
82
  },
83
83
  "scripts": {
84
84
  "test": "npm run lint && borp --concurrency=1 --timeout=300000 && tsd",
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/runtime/2.25.0.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/runtime/2.26.0-alpha.1.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "type": "object",
5
5
  "properties": {