From 01d2102c2326b86b0f87bb008c2a3eb3871e3963 Mon Sep 17 00:00:00 2001 From: Peter Johanson Date: Sat, 16 Oct 2021 02:42:38 +0000 Subject: refactor: Add js-yaml dep, scrtipt gen tweaks. * Make the synthetic "base name" property double underscore prefixed, since internal, and to avoid future conflicts w/ YAML format add'ns. * Switch to PS hash dictionaries for our metadata collections for saner data inspection/use. --- docs/src/setup-script-generation-plugin/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/src/setup-script-generation-plugin') diff --git a/docs/src/setup-script-generation-plugin/index.js b/docs/src/setup-script-generation-plugin/index.js index 0d768d7..908ac65 100644 --- a/docs/src/setup-script-generation-plugin/index.js +++ b/docs/src/setup-script-generation-plugin/index.js @@ -14,8 +14,8 @@ const Mustache = require("mustache"); function generateSetupScripts() { return glob("../app/boards/**/*.zmk.yml", (error, files) => { const aggregated = files.map((f) => ({ - ...yaml.safeLoadAll(fs.readFileSync(f, "utf8"))[0], - base_dir: path.basename(path.dirname(f)), + ...yaml.load(fs.readFileSync(f, "utf8")), + __base_dir: path.basename(path.dirname(f)), })); const data = aggregated.reduce( -- cgit v1.2.3