{id}
)
+ .reduce(
+ (prev, curr, index) => [...prev, index > 0 ? ", " : "", curr],
+ [] as ElementOrString[]
+ );
+ return {nodes};
+ } else {
+ return {item.id}
;
+ }
+}
+
+const TYPE_LABELS: Record<
+ HardwareMetadata["type"],
+ Record<"singular" | "plural", string>
+> = {
+ board: { plural: "Boards: ", singular: "Board: " },
+ shield: { singular: "Shield: ", plural: "Shields: " },
+ interconnect: { singular: "Interconnect: ", plural: "Interconnects: " },
+};
+
+function HardwareLineItem({ item }: { item: HardwareMetadata }) {
+ return (
+ {interconnect.description}
} ++ Keyboards with onboard controllers are single PCBs that contain all the + components of a keyboard, including the controller chip, switch + footprints, etc. +
++ Composite keyboards are composed of two main PCBs: a small controller + board with exposed pads, and a larger keyboard PCB (a shield, in ZMK + lingo) with switch footprints and location a where the controller is + added. +
+ {Object.values(grouped.interconnects).map(mapInterconnect)} + > + ); +} + +export default HardwareList; diff --git a/docs/src/hardware-metadata-collection-plugin/index.js b/docs/src/hardware-metadata-collection-plugin/index.js index cbea805f..5f5660bb 100644 --- a/docs/src/hardware-metadata-collection-plugin/index.js +++ b/docs/src/hardware-metadata-collection-plugin/index.js @@ -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 () { }; }, }; -}; \ No newline at end of file +}; diff --git a/docs/src/hardware-schema-typescript-plugin/index.js b/docs/src/hardware-schema-typescript-plugin/index.js index 2ccbf19c..728d501d 100644 --- a/docs/src/hardware-schema-typescript-plugin/index.js +++ b/docs/src/hardware-schema-typescript-plugin/index.js @@ -6,7 +6,7 @@ var PrebuildPlugin = require("prebuild-webpack-plugin"); const fs = require("fs"); -const { compileFromFile } = require('json-schema-to-typescript'); +const { compileFromFile } = require("json-schema-to-typescript"); async function generateHardwareMetadataTypescript() { const ts = await compileFromFile("../schema/hardware-metadata.schema.json"); @@ -26,4 +26,4 @@ module.exports = function () { }; }, }; -}; \ No newline at end of file +}; diff --git a/docs/tsconfig.json b/docs/tsconfig.json index 77c5f752..4360f0da 100644 --- a/docs/tsconfig.json +++ b/docs/tsconfig.json @@ -1,4 +1,4 @@ { "extends": "@tsconfig/docusaurus/tsconfig.json", "include": ["src/"] -} \ No newline at end of file +}