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.
This commit is contained in:
Peter Johanson
2021-10-16 02:42:38 +00:00
committed by Pete Johanson
parent e544d74948
commit 01d2102c23
6 changed files with 600 additions and 1445 deletions

View File

@@ -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(