diff --git a/.changeset/crazy-dots-draw.md b/.changeset/crazy-dots-draw.md new file mode 100644 index 00000000..f1c85476 --- /dev/null +++ b/.changeset/crazy-dots-draw.md @@ -0,0 +1,5 @@ +--- +"@manypkg/tools": patch +--- + +Refactor yaml parsing to use the `yaml` package diff --git a/packages/tools/package.json b/packages/tools/package.json index 03760490..12c0dce6 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -14,12 +14,11 @@ }, "dependencies": { "jju": "^1.4.0", - "js-yaml": "^4.1.0", - "tinyglobby": "^0.2.13" + "tinyglobby": "^0.2.13", + "yaml": "^2.9.0" }, "devDependencies": { - "@types/jju": "^1.4.5", - "@types/js-yaml": "^4.0.9" + "@types/jju": "^1.4.5" }, "engines": { "node": ">=20.0.0" diff --git a/packages/tools/src/PnpmTool.ts b/packages/tools/src/PnpmTool.ts index 4c4c17f0..e5c0ec88 100644 --- a/packages/tools/src/PnpmTool.ts +++ b/packages/tools/src/PnpmTool.ts @@ -1,5 +1,5 @@ import path from "node:path"; -import yaml from "js-yaml"; +import * as yaml from "yaml"; import fs from "node:fs"; import fsp from "node:fs/promises"; @@ -18,10 +18,10 @@ import { readJson, readJsonSync } from "./utils.ts"; async function readYamlFile(path: string): Promise { return fsp .readFile(path, "utf8") - .then((data) => yaml.load(data)) as Promise; + .then((data) => yaml.parse(data)) as Promise; } function readYamlFileSync(path: string): T { - return yaml.load(fs.readFileSync(path, "utf8")) as T; + return yaml.parse(fs.readFileSync(path, "utf8")) as T; } export const PnpmTool: Tool = { diff --git a/yarn.lock b/yarn.lock index 9b64ea4c..b3015de4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1501,11 +1501,6 @@ resolved "https://registry.yarnpkg.com/@types/jju/-/jju-1.4.5.tgz#512ce273594b8d025b7eb9029658e041af9631b4" integrity sha512-5Yx4wOq3X+xArOlyZcuAK1Pli4vW0E6nQ6UC8jWdbcY5OlBsoElFTOf4kggYKls/NCHdShAK6UR8NRSQARUNfQ== -"@types/js-yaml@^4.0.9": - version "4.0.9" - resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-4.0.9.tgz#cd82382c4f902fed9691a2ed79ec68c5898af4c2" - integrity sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg== - "@types/node@*", "@types/node@^22.15.3": version "22.15.3" resolved "https://registry.yarnpkg.com/@types/node/-/node-22.15.3.tgz#b7fb9396a8ec5b5dfb1345d8ac2502060e9af68b" @@ -3436,6 +3431,11 @@ yallist@^3.0.2: resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== +yaml@^2.9.0: + version "2.9.0" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.9.0.tgz#78274afd93598a1dfdd6130df6a566defcbf9aa4" + integrity sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA== + yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"