forked from kofal.net/zmk
feat(docs): Add dynamic hardware list component.
This commit is contained in:
committed by
Pete Johanson
parent
5e6634d2e5
commit
47abbe7925
@@ -8,12 +8,16 @@ var PrebuildPlugin = require("prebuild-webpack-plugin");
|
||||
const fs = require("fs");
|
||||
const yaml = require("js-yaml");
|
||||
const glob = require("glob");
|
||||
const { compile, compileFromFile } = require('json-schema-to-typescript');
|
||||
|
||||
function generateHardwareMetadataAggregate() {
|
||||
glob("../app/boards/**/*.zmk.yml", (error, files) => {
|
||||
const aggregated = files.flatMap(f => yaml.safeLoadAll(fs.readFileSync(f, "utf8")));
|
||||
fs.writeFileSync("src/data/hardware-metadata.json", JSON.stringify(aggregated));
|
||||
const aggregated = files.flatMap((f) =>
|
||||
yaml.safeLoadAll(fs.readFileSync(f, "utf8"))
|
||||
);
|
||||
fs.writeFileSync(
|
||||
"src/data/hardware-metadata.json",
|
||||
JSON.stringify(aggregated)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -30,4 +34,4 @@ module.exports = function () {
|
||||
};
|
||||
},
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user