Skip to content

Commit f265124

Browse files
Remove js yaml (#9016)
fix #9015
1 parent dd644f1 commit f265124

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
3+
changeKind: fix
4+
packages:
5+
- "@typespec/spector"
6+
---
7+
8+
Switch `js-yaml` to `yaml` library

packages/spector/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
"homepage": "https://github.com/microsoft/typespec#readme",
3737
"dependencies": {
3838
"@azure/identity": "~4.13.0",
39-
"@types/js-yaml": "^4.0.5",
4039
"@typespec/compiler": "workspace:^",
4140
"@typespec/http": "workspace:^",
4241
"@typespec/rest": "workspace:^",
@@ -48,13 +47,13 @@
4847
"deep-equal": "^2.2.0",
4948
"express": "^5.1.0",
5049
"globby": "~15.0.0",
51-
"js-yaml": "^4.1.0",
5250
"micromatch": "^4.0.8",
5351
"morgan": "^1.10.0",
5452
"multer": "^2.0.1",
5553
"picocolors": "~1.1.1",
5654
"source-map-support": "~0.5.21",
5755
"xml2js": "^0.6.2",
56+
"yaml": "~2.8.0",
5857
"yargs": "~18.0.0"
5958
},
6059
"devDependencies": {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { readFile } from "fs/promises";
2-
import yaml from "js-yaml";
2+
import yaml from "yaml";
33
import { Diagnostic } from "../utils/diagnostic-reporter.js";
44
import { SpecConfigJsonSchema } from "./config-schema.js";
55
import { SchemaValidator } from "./schema-validator.js";
@@ -9,7 +9,7 @@ const validator = new SchemaValidator(SpecConfigJsonSchema);
99

1010
export async function loadSpecConfig(path: string): Promise<[SpecConfig, Diagnostic[]]> {
1111
const content = await readFile(path);
12-
const config: any = yaml.load(content.toString(), { filename: path });
12+
const config: any = yaml.parse(content.toString());
1313
const diagnostics = validator.validate(config, path);
1414
return [config, diagnostics];
1515
}

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)