@platformatic/node 2.0.0-alpha.6 → 2.0.0-alpha.7
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 +7 -0
- package/index.js +22 -5
- package/lib/schema.js +1 -0
- package/package.json +6 -6
- package/schema.json +28 -1
package/config.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
BaseStackable,
|
|
3
|
+
createServerListener,
|
|
4
|
+
getServerUrl,
|
|
5
|
+
importFile,
|
|
6
|
+
injectViaRequest,
|
|
7
|
+
schemaOptions,
|
|
8
|
+
transformConfig
|
|
9
|
+
} from '@platformatic/basic'
|
|
2
10
|
import { ConfigManager } from '@platformatic/config'
|
|
3
11
|
import inject from 'light-my-request'
|
|
4
12
|
import { existsSync } from 'node:fs'
|
|
@@ -18,7 +26,7 @@ const validFields = [
|
|
|
18
26
|
'exports#.#node',
|
|
19
27
|
'exports#.#import',
|
|
20
28
|
'exports#.#require',
|
|
21
|
-
'exports#.#default'
|
|
29
|
+
'exports#.#default'
|
|
22
30
|
]
|
|
23
31
|
|
|
24
32
|
const validFilesBasenames = ['index', 'main', 'app', 'application', 'server', 'start', 'bundle', 'run', 'entrypoint']
|
|
@@ -136,6 +144,12 @@ export class NodeStackable extends BaseStackable {
|
|
|
136
144
|
return { statusCode, headers, body, payload, rawPayload }
|
|
137
145
|
}
|
|
138
146
|
|
|
147
|
+
getMeta () {
|
|
148
|
+
return {
|
|
149
|
+
deploy: this.configManager.current.deploy
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
139
153
|
async _listen () {
|
|
140
154
|
const serverOptions = this.serverConfig
|
|
141
155
|
|
|
@@ -215,7 +229,7 @@ export async function buildStackable (opts) {
|
|
|
215
229
|
|
|
216
230
|
const { entrypoint, hadEntrypointField } = await getEntrypointInformation(root)
|
|
217
231
|
|
|
218
|
-
const configManager = new ConfigManager({ schema, source: opts.config ?? {} })
|
|
232
|
+
const configManager = new ConfigManager({ schema, source: opts.config ?? {}, schemaOptions, transformConfig })
|
|
219
233
|
await configManager.parseAndValidate()
|
|
220
234
|
|
|
221
235
|
return new NodeStackable(opts, root, configManager, entrypoint, hadEntrypointField)
|
|
@@ -223,8 +237,11 @@ export async function buildStackable (opts) {
|
|
|
223
237
|
|
|
224
238
|
export default {
|
|
225
239
|
configType: 'nodejs',
|
|
226
|
-
configManagerConfig: {
|
|
240
|
+
configManagerConfig: {
|
|
241
|
+
schemaOptions,
|
|
242
|
+
transformConfig
|
|
243
|
+
},
|
|
227
244
|
buildStackable,
|
|
228
245
|
schema,
|
|
229
|
-
version: packageJson.version
|
|
246
|
+
version: packageJson.version
|
|
230
247
|
}
|
package/lib/schema.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformatic/node",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.7",
|
|
4
4
|
"description": "Platformatic Node.js Stackable",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"homepage": "https://github.com/platformatic/platformatic#readme",
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"light-my-request": "^5.13.0",
|
|
19
|
-
"@platformatic/basic": "2.0.0-alpha.
|
|
20
|
-
"@platformatic/utils": "2.0.0-alpha.
|
|
21
|
-
"@platformatic/config": "2.0.0-alpha.
|
|
19
|
+
"@platformatic/basic": "2.0.0-alpha.7",
|
|
20
|
+
"@platformatic/utils": "2.0.0-alpha.7",
|
|
21
|
+
"@platformatic/config": "2.0.0-alpha.7"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"borp": "^0.17.0",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"json-schema-to-typescript": "^15.0.1",
|
|
29
29
|
"neostandard": "^0.11.1",
|
|
30
30
|
"typescript": "^5.5.4",
|
|
31
|
-
"@platformatic/composer": "2.0.0-alpha.
|
|
32
|
-
"@platformatic/service": "2.0.0-alpha.
|
|
31
|
+
"@platformatic/composer": "2.0.0-alpha.7",
|
|
32
|
+
"@platformatic/service": "2.0.0-alpha.7"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"test": "npm run lint && borp --concurrency=1 --timeout=180000",
|
package/schema.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://schemas.platformatic.dev/@platformatic/vite/2.0.0-alpha.
|
|
2
|
+
"$id": "https://schemas.platformatic.dev/@platformatic/vite/2.0.0-alpha.7.json",
|
|
3
3
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
4
|
"title": "Platformatic Node.js Stackable",
|
|
5
5
|
"type": "object",
|
|
@@ -491,6 +491,33 @@
|
|
|
491
491
|
"type": "string"
|
|
492
492
|
}
|
|
493
493
|
]
|
|
494
|
+
},
|
|
495
|
+
"deploy": {
|
|
496
|
+
"type": "object",
|
|
497
|
+
"properties": {
|
|
498
|
+
"include": {
|
|
499
|
+
"type": "array",
|
|
500
|
+
"items": {
|
|
501
|
+
"type": "string"
|
|
502
|
+
},
|
|
503
|
+
"default": [
|
|
504
|
+
"dist"
|
|
505
|
+
]
|
|
506
|
+
},
|
|
507
|
+
"buildCommand": {
|
|
508
|
+
"type": "string",
|
|
509
|
+
"default": "npm run build"
|
|
510
|
+
},
|
|
511
|
+
"installCommand": {
|
|
512
|
+
"type": "string",
|
|
513
|
+
"default": "npm ci --omit-dev"
|
|
514
|
+
},
|
|
515
|
+
"startCommand": {
|
|
516
|
+
"type": "string",
|
|
517
|
+
"default": "npm run start"
|
|
518
|
+
}
|
|
519
|
+
},
|
|
520
|
+
"default": {}
|
|
494
521
|
}
|
|
495
522
|
},
|
|
496
523
|
"additionalProperties": false
|