@gobing-ai/ts-runtime 0.3.19 → 0.3.20
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/dist/runtime-node-bun.js
CHANGED
|
@@ -48,7 +48,7 @@ export const nodeBunFactory = {
|
|
|
48
48
|
*/
|
|
49
49
|
async function loadNodeConfig(options) {
|
|
50
50
|
const fs = getNodeFileSystem();
|
|
51
|
-
const raw = readYamlConfig(fs);
|
|
51
|
+
const raw = await readYamlConfig(fs);
|
|
52
52
|
return buildConfigFromObject(raw ?? {}, options);
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
@@ -61,12 +61,15 @@ async function loadNodeConfig(options) {
|
|
|
61
61
|
*
|
|
62
62
|
* Returns `null` if no config file is found.
|
|
63
63
|
*/
|
|
64
|
-
function readYamlConfig(fs) {
|
|
64
|
+
async function readYamlConfig(fs) {
|
|
65
65
|
const candidates = [getProcessEnv().CONFIG_PATH, 'config/config.yaml', 'config/config.example.yaml'].filter((p) => typeof p === 'string' && p.length > 0);
|
|
66
66
|
for (const candidate of candidates) {
|
|
67
67
|
const resolved = fs.resolve(candidate);
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
// Await the union-return FileSystem contract — a bare `fs.exists(...)` is always
|
|
69
|
+
// truthy under an async backend, and the `readFile` Promise must be awaited rather
|
|
70
|
+
// than cast to string (parity with the migrate.ts fs.exists fix).
|
|
71
|
+
if (await fs.exists(resolved)) {
|
|
72
|
+
const content = await fs.readFile(resolved);
|
|
70
73
|
try {
|
|
71
74
|
return parseYaml(content);
|
|
72
75
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gobing-ai/ts-runtime",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.20",
|
|
4
4
|
"description": "@gobing-ai/ts-runtime — Runtime abstractions for Bun, Node, and Cloudflare Workers.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -58,13 +58,13 @@
|
|
|
58
58
|
"release": "echo 'Manual publish is disabled. Releases go through GitHub Actions via Trusted Publishing — push a tag: git tag @gobing-ai/ts-runtime-v<version> && git push --tags' && exit 1"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@gobing-ai/ts-utils": "^0.3.
|
|
61
|
+
"@gobing-ai/ts-utils": "^0.3.20",
|
|
62
62
|
"execa": "^9.5.0",
|
|
63
63
|
"yaml": "^2.7.0",
|
|
64
64
|
"zod": "^4.1.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@gobing-ai/ts-db": "^0.3.
|
|
67
|
+
"@gobing-ai/ts-db": "^0.3.20",
|
|
68
68
|
"@types/bun": "1.3.14"
|
|
69
69
|
},
|
|
70
70
|
"publishConfig": {
|
package/src/runtime-node-bun.ts
CHANGED
|
@@ -62,7 +62,7 @@ export const nodeBunFactory: RuntimeFactory = {
|
|
|
62
62
|
*/
|
|
63
63
|
async function loadNodeConfig(options?: LoadConfigOptions): Promise<Config> {
|
|
64
64
|
const fs = getNodeFileSystem();
|
|
65
|
-
const raw = readYamlConfig(fs);
|
|
65
|
+
const raw = await readYamlConfig(fs);
|
|
66
66
|
return buildConfigFromObject(raw ?? {}, options);
|
|
67
67
|
}
|
|
68
68
|
|
|
@@ -76,15 +76,18 @@ async function loadNodeConfig(options?: LoadConfigOptions): Promise<Config> {
|
|
|
76
76
|
*
|
|
77
77
|
* Returns `null` if no config file is found.
|
|
78
78
|
*/
|
|
79
|
-
function readYamlConfig(fs: FileSystem): Record<string, unknown> | null {
|
|
79
|
+
async function readYamlConfig(fs: FileSystem): Promise<Record<string, unknown> | null> {
|
|
80
80
|
const candidates = [getProcessEnv().CONFIG_PATH, 'config/config.yaml', 'config/config.example.yaml'].filter(
|
|
81
81
|
(p): p is string => typeof p === 'string' && p.length > 0,
|
|
82
82
|
);
|
|
83
83
|
|
|
84
84
|
for (const candidate of candidates) {
|
|
85
85
|
const resolved = fs.resolve(candidate);
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
// Await the union-return FileSystem contract — a bare `fs.exists(...)` is always
|
|
87
|
+
// truthy under an async backend, and the `readFile` Promise must be awaited rather
|
|
88
|
+
// than cast to string (parity with the migrate.ts fs.exists fix).
|
|
89
|
+
if (await fs.exists(resolved)) {
|
|
90
|
+
const content = await fs.readFile(resolved);
|
|
88
91
|
try {
|
|
89
92
|
return parseYaml(content) as Record<string, unknown>;
|
|
90
93
|
} catch {
|