@platformatic/node 2.27.1 → 2.28.1-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/index.js +2 -16
- package/package.json +6 -6
- package/schema.json +1 -1
package/index.js
CHANGED
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
cleanBasePath,
|
|
4
4
|
createServerListener,
|
|
5
5
|
ensureTrailingSlash,
|
|
6
|
-
getAsyncLocalStorageSnapshot,
|
|
7
6
|
getServerUrl,
|
|
8
7
|
importFile,
|
|
9
8
|
injectViaRequest,
|
|
@@ -13,7 +12,6 @@ import {
|
|
|
13
12
|
import { ConfigManager } from '@platformatic/config'
|
|
14
13
|
import { features } from '@platformatic/utils'
|
|
15
14
|
import inject from 'light-my-request'
|
|
16
|
-
import { AsyncResource } from 'node:async_hooks'
|
|
17
15
|
import { existsSync } from 'node:fs'
|
|
18
16
|
import { readFile } from 'node:fs/promises'
|
|
19
17
|
import { Server } from 'node:http'
|
|
@@ -186,19 +184,6 @@ export class NodeStackable extends BaseStackable {
|
|
|
186
184
|
}
|
|
187
185
|
|
|
188
186
|
async inject (injectParams, onInject) {
|
|
189
|
-
const snapshot = this.#server && getAsyncLocalStorageSnapshot(this.#server)
|
|
190
|
-
if (!snapshot) {
|
|
191
|
-
return this.#inject(injectParams, onInject)
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
return snapshot(() => {
|
|
195
|
-
// Need to new resource so each inject has separate context
|
|
196
|
-
const resource = new AsyncResource('PLTNodeStackable')
|
|
197
|
-
return resource.runInAsyncScope(this.#inject, this, injectParams, onInject)
|
|
198
|
-
})
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
async #inject (injectParams, onInject) {
|
|
202
187
|
let res
|
|
203
188
|
|
|
204
189
|
if (this.#useHttpForDispatch) {
|
|
@@ -411,7 +396,8 @@ export async function buildStackable (opts) {
|
|
|
411
396
|
source: opts.config ?? {},
|
|
412
397
|
schemaOptions,
|
|
413
398
|
transformConfig,
|
|
414
|
-
dirname: root
|
|
399
|
+
dirname: root,
|
|
400
|
+
context: opts.context
|
|
415
401
|
})
|
|
416
402
|
await configManager.parseAndValidate()
|
|
417
403
|
const config = configManager.current
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformatic/node",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.28.1-alpha.1",
|
|
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": "^6.0.0",
|
|
19
|
-
"@platformatic/basic": "2.
|
|
20
|
-
"@platformatic/config": "2.
|
|
21
|
-
"@platformatic/utils": "2.
|
|
19
|
+
"@platformatic/basic": "2.28.1-alpha.1",
|
|
20
|
+
"@platformatic/config": "2.28.1-alpha.1",
|
|
21
|
+
"@platformatic/utils": "2.28.1-alpha.1"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"borp": "^0.19.0",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"neostandard": "^0.12.0",
|
|
31
31
|
"tsx": "^4.19.0",
|
|
32
32
|
"typescript": "^5.5.4",
|
|
33
|
-
"@platformatic/composer": "2.
|
|
34
|
-
"@platformatic/service": "2.
|
|
33
|
+
"@platformatic/composer": "2.28.1-alpha.1",
|
|
34
|
+
"@platformatic/service": "2.28.1-alpha.1"
|
|
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.
|
|
2
|
+
"$id": "https://schemas.platformatic.dev/@platformatic/node/2.28.1-alpha.1.json",
|
|
3
3
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
4
|
"title": "Platformatic Node.js Stackable",
|
|
5
5
|
"type": "object",
|