Skip to content

Commit f7a86e9

Browse files
authored
chore: use js-yaml instead of yaml as it's much faster on config read. (#255)
1 parent 3deda16 commit f7a86e9

File tree

4 files changed

+20
-12
lines changed

4 files changed

+20
-12
lines changed

dev/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,22 +55,22 @@
5555
"dependencies": {
5656
"@clack/prompts": "^0.11.0",
5757
"@google/adk": "^0.6.1",
58-
"camelcase-keys": "^6.2.2",
5958
"@mikro-orm/mariadb": "^6.6.6",
6059
"@mikro-orm/mssql": "^6.6.6",
6160
"@mikro-orm/mysql": "^6.6.6",
6261
"@mikro-orm/postgresql": "^6.6.6",
6362
"@mikro-orm/sqlite": "^6.6.6",
63+
"camelcase-keys": "^6.2.2",
6464
"commander": "^14.0.0",
6565
"cors": "^2.8.5",
6666
"dotenv": "^17.2.3",
6767
"esbuild": "^0.25.9",
6868
"esbuild-shim-plugin": "^1.0.3",
6969
"express": "^4.21.2",
7070
"fast-glob": "^3.3.3",
71+
"js-yaml": "^4.1.1",
7172
"ts-graphviz": "^1.0.1",
7273
"winston": "^3.19.0",
73-
"yaml": "^2.8.3",
7474
"zod": "^4.2.1"
7575
}
7676
}

dev/src/conformance/yaml_agent_loader.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
import camelcaseKeys from 'camelcase-keys';
88
import fg from 'fast-glob';
9+
import yaml from 'js-yaml';
910
import * as fs from 'node:fs/promises';
1011
import * as path from 'node:path';
11-
import {parse} from 'yaml';
1212
import {AgentToolArgs, YamlAgentConfig} from '../integration/agent_types.js';
1313

1414
/**
@@ -28,7 +28,7 @@ export async function batchLoadYamlAgentConfig(
2828
for await (const file of files) {
2929
const filePath = (file as string).replaceAll('\\', '/');
3030
const content = await fs.readFile(filePath, 'utf-8');
31-
const agentConfig = camelcaseKeys(parse(content), {
31+
const agentConfig = camelcaseKeys(yaml.load(content) as YamlAgentConfig, {
3232
deep: true,
3333
}) as YamlAgentConfig;
3434

package-lock.json

Lines changed: 15 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"@eslint/js": "^9.37.0",
4141
"@secretlint/secretlint-rule-pattern": "^11.3.1",
4242
"@secretlint/secretlint-rule-preset-recommend": "^11.3.1",
43+
"@types/js-yaml": "^4.0.9",
4344
"@types/node": "^20.12.7",
4445
"@vitest/coverage-v8": "^3.2.4",
4546
"concurrently": "^9.2.1",

0 commit comments

Comments
 (0)