Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/crazy-dots-draw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@manypkg/tools": patch
---

Refactor yaml parsing to use the `yaml` package
7 changes: 3 additions & 4 deletions packages/tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions packages/tools/src/PnpmTool.ts
Original file line number Diff line number Diff line change
@@ -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";

Expand All @@ -18,10 +18,10 @@ import { readJson, readJsonSync } from "./utils.ts";
async function readYamlFile<T = unknown>(path: string): Promise<T> {
return fsp
.readFile(path, "utf8")
.then((data) => yaml.load(data)) as Promise<T>;
.then((data) => yaml.parse(data)) as Promise<T>;
}
function readYamlFileSync<T = unknown>(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 = {
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
Loading