Fix YAMLParseError: Nested mappings are not allowed in compact mappings

Fixes #29

Fix the YAMLParseError related to nested mappings in compact mappings.

* **Import and Function Call Changes**
  - Update the `yaml` import to use `yaml` instead of `yaml-js`.
  - Modify the `yaml.load` function call to use `yaml.parse`.

* **Schema Field Changes**
  - Ensure the `schema` field does not contain nested mappings.

* **Error Logging**
  - Update the `asyncretry_error` object to correctly log errors without causing nested mappings error.
This commit is contained in:
LuckyMod 2024-11-03 11:33:07 +05:30
parent 3d3ee9326b
commit 793e91f406

View File

@ -1,6 +1,6 @@
import fs from "fs";
import path from "path";
import yaml from "yaml-js";
import yaml from "yaml";
import yml from "yaml";
import { merge, fromPairs } from "lodash-es";
import retry from "async-retry";
@ -344,7 +344,7 @@ const system = await build({
{},
...(await Promise.all(
(await getFilesRecursively(unitsDir, ".yaml")).map((file) =>
yaml.load(fs.readFileSync(`./${file}`, `utf-8`).toString()),
yaml.parse(fs.readFileSync(`./${file}`, `utf-8`).toString()),
),
)),
),