Browse Source

feat: Generate setup scripts from metadata.

xmkb
Peter Johanson 3 years ago committed by Pete Johanson
parent
commit
b82bbb5ba2
  1. 2
      docs/.prettierignore
  2. 1
      docs/docusaurus.config.js
  3. 352
      docs/package-lock.json
  4. 7
      docs/package.json
  5. 62
      docs/src/setup-script-generation-plugin/index.js
  6. 10
      docs/src/templates/setup.ps1.mustache
  7. 115
      docs/src/templates/setup.sh.mustache
  8. 5
      docs/static/.gitignore

2
docs/.prettierignore

@ -1,3 +1,5 @@
node_modules node_modules
build build
.docusaurus .docusaurus
*.mustache
hardware-metadata.json

1
docs/docusaurus.config.js

@ -12,6 +12,7 @@ module.exports = {
path.resolve(__dirname, "src/docusaurus-tree-sitter-plugin"), path.resolve(__dirname, "src/docusaurus-tree-sitter-plugin"),
path.resolve(__dirname, "src/hardware-metadata-collection-plugin"), path.resolve(__dirname, "src/hardware-metadata-collection-plugin"),
path.resolve(__dirname, "src/hardware-schema-typescript-plugin"), path.resolve(__dirname, "src/hardware-schema-typescript-plugin"),
path.resolve(__dirname, "src/setup-script-generation-plugin"),
], ],
themeConfig: { themeConfig: {
colorMode: { colorMode: {

352
docs/package-lock.json generated

@ -24213,11 +24213,11 @@
} }
}, },
"@babel/generator": { "@babel/generator": {
"version": "7.14.8", "version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.8.tgz", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.5.tgz",
"integrity": "sha512-cYDUpvIzhBVnMzRoY1fkSEhK/HmwEVwlyULYgn/tMQYd6Obag3ylCjONle3gdErfXBW61SVTlR9QR7uWlgeIkg==", "integrity": "sha512-y3rlP+/G25OIX3mYKKIOlQRcqj7YgrvHxOLbVmyLJ9bPmi5ttvUmpydVjcFjZphOktWuA7ovbx91ECloWTfjIA==",
"requires": { "requires": {
"@babel/types": "^7.14.8", "@babel/types": "^7.14.5",
"jsesc": "^2.5.1", "jsesc": "^2.5.1",
"source-map": "^0.5.0" "source-map": "^0.5.0"
} }
@ -24265,18 +24265,18 @@
} }
}, },
"@babel/helper-module-transforms": { "@babel/helper-module-transforms": {
"version": "7.14.8", "version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.8.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.5.tgz",
"integrity": "sha512-RyE+NFOjXn5A9YU1dkpeBaduagTlZ0+fccnIcAGbv1KGUlReBj7utF7oEth8IdIBQPcux0DDgW5MFBH2xu9KcA==", "integrity": "sha512-iXpX4KW8LVODuAieD7MzhNjmM6dzYY5tfRqT+R9HDXWl0jPn/djKmA+G9s/2C2T9zggw5tK1QNqZ70USfedOwA==",
"requires": { "requires": {
"@babel/helper-module-imports": "^7.14.5", "@babel/helper-module-imports": "^7.14.5",
"@babel/helper-replace-supers": "^7.14.5", "@babel/helper-replace-supers": "^7.14.5",
"@babel/helper-simple-access": "^7.14.8", "@babel/helper-simple-access": "^7.14.5",
"@babel/helper-split-export-declaration": "^7.14.5", "@babel/helper-split-export-declaration": "^7.14.5",
"@babel/helper-validator-identifier": "^7.14.8", "@babel/helper-validator-identifier": "^7.14.5",
"@babel/template": "^7.14.5", "@babel/template": "^7.14.5",
"@babel/traverse": "^7.14.8", "@babel/traverse": "^7.14.5",
"@babel/types": "^7.14.8" "@babel/types": "^7.14.5"
} }
}, },
"@babel/helper-optimise-call-expression": { "@babel/helper-optimise-call-expression": {
@ -24304,11 +24304,11 @@
} }
}, },
"@babel/helper-simple-access": { "@babel/helper-simple-access": {
"version": "7.14.8", "version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.14.8.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.14.5.tgz",
"integrity": "sha512-TrFN4RHh9gnWEU+s7JloIho2T76GPwRHhdzOWLqTrMnlas8T9O7ec+oEDNsRXndOmru9ymH9DFrEOxpzPoSbdg==", "integrity": "sha512-nfBN9xvmCt6nrMZjfhkl7i0oTV3yxR4/FztsbOASyTvVcoYd0TRHh7eMLdlEcCqobydC0LAF3LtC92Iwxo0wyw==",
"requires": { "requires": {
"@babel/types": "^7.14.8" "@babel/types": "^7.14.5"
} }
}, },
"@babel/helper-split-export-declaration": { "@babel/helper-split-export-declaration": {
@ -24320,9 +24320,15 @@
} }
}, },
"@babel/helper-validator-identifier": { "@babel/helper-validator-identifier": {
"version": "7.14.8", "version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.8.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.14.5.tgz",
"integrity": "sha512-ZGy6/XQjllhYQrNw/3zfWRwZCTVSiBLZ9DHVZxn9n2gip/7ab8mv2TWlKPIBk26RwedCBoWdjLmn+t9na2Gcow==" "integrity": "sha512-3i1Qe9/8x/hCHINujn+iuHy+mMRLoc77b2nI9TB0zjH1hvn9qGlXjWlggdwUcju36PkPCy/lpM7LLUdcTyH4Ow==",
"requires": {
"@babel/helper-member-expression-to-functions": "^7.14.5",
"@babel/helper-optimise-call-expression": "^7.14.5",
"@babel/traverse": "^7.14.5",
"@babel/types": "^7.14.5"
}
}, },
"@babel/highlight": { "@babel/highlight": {
"version": "7.14.5", "version": "7.14.5",
@ -24335,9 +24341,9 @@
} }
}, },
"@babel/parser": { "@babel/parser": {
"version": "7.14.8", "version": "7.14.7",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.8.tgz", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.7.tgz",
"integrity": "sha512-syoCQFOoo/fzkWDeM0dLEZi5xqurb5vuyzwIMNZRNun+N/9A4cUZeQaE7dTrB8jGaKuJRBtEOajtnmw0I5hvvA==" "integrity": "sha512-X67Z5y+VBJuHB/RjwECp8kSl5uYi0BvRbNeWqkaJCVh+LiTPl19WBUfG627psSgp9rSf6ojuXghQM3ha6qHHdA=="
}, },
"@babel/template": { "@babel/template": {
"version": "7.14.5", "version": "7.14.5",
@ -24350,27 +24356,27 @@
} }
}, },
"@babel/traverse": { "@babel/traverse": {
"version": "7.14.8", "version": "7.14.7",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.8.tgz", "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.7.tgz",
"integrity": "sha512-kexHhzCljJcFNn1KYAQ6A5wxMRzq9ebYpEDV4+WdNyr3i7O44tanbDOR/xjiG2F3sllan+LgwK+7OMk0EmydHg==", "integrity": "sha512-9vDr5NzHu27wgwejuKL7kIOm4bwEtaPQ4Z6cpCmjSuaRqpH/7xc4qcGEscwMqlkwgcXl6MvqoAjZkQ24uSdIZQ==",
"requires": { "requires": {
"@babel/code-frame": "^7.14.5", "@babel/code-frame": "^7.14.5",
"@babel/generator": "^7.14.8", "@babel/generator": "^7.14.5",
"@babel/helper-function-name": "^7.14.5", "@babel/helper-function-name": "^7.14.5",
"@babel/helper-hoist-variables": "^7.14.5", "@babel/helper-hoist-variables": "^7.14.5",
"@babel/helper-split-export-declaration": "^7.14.5", "@babel/helper-split-export-declaration": "^7.14.5",
"@babel/parser": "^7.14.8", "@babel/parser": "^7.14.7",
"@babel/types": "^7.14.8", "@babel/types": "^7.14.5",
"debug": "^4.1.0", "debug": "^4.1.0",
"globals": "^11.1.0" "globals": "^11.1.0"
} }
}, },
"@babel/types": { "@babel/types": {
"version": "7.14.8", "version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.8.tgz", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.5.tgz",
"integrity": "sha512-iob4soQa7dZw8nodR/KlOQkPh9S4I8RwCxwRIFuiMRYjOzH/KJzdUfDgz6cGi5dDaclXF4P2PAhCdrBJNIg68Q==", "integrity": "sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg==",
"requires": { "requires": {
"@babel/helper-validator-identifier": "^7.14.8", "@babel/helper-validator-identifier": "^7.14.5",
"to-fast-properties": "^2.0.0" "to-fast-properties": "^2.0.0"
} }
}, },
@ -25150,16 +25156,16 @@
} }
}, },
"@babel/helper-validator-identifier": { "@babel/helper-validator-identifier": {
"version": "7.14.8", "version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.8.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.5.tgz",
"integrity": "sha512-ZGy6/XQjllhYQrNw/3zfWRwZCTVSiBLZ9DHVZxn9n2gip/7ab8mv2TWlKPIBk26RwedCBoWdjLmn+t9na2Gcow==" "integrity": "sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg=="
}, },
"@babel/types": { "@babel/types": {
"version": "7.14.8", "version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.8.tgz", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.5.tgz",
"integrity": "sha512-iob4soQa7dZw8nodR/KlOQkPh9S4I8RwCxwRIFuiMRYjOzH/KJzdUfDgz6cGi5dDaclXF4P2PAhCdrBJNIg68Q==", "integrity": "sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg==",
"requires": { "requires": {
"@babel/helper-validator-identifier": "^7.14.8", "@babel/helper-validator-identifier": "^7.14.5",
"to-fast-properties": "^2.0.0" "to-fast-properties": "^2.0.0"
} }
} }
@ -25229,11 +25235,11 @@
} }
}, },
"@babel/generator": { "@babel/generator": {
"version": "7.14.8", "version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.8.tgz", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.5.tgz",
"integrity": "sha512-cYDUpvIzhBVnMzRoY1fkSEhK/HmwEVwlyULYgn/tMQYd6Obag3ylCjONle3gdErfXBW61SVTlR9QR7uWlgeIkg==", "integrity": "sha512-y3rlP+/G25OIX3mYKKIOlQRcqj7YgrvHxOLbVmyLJ9bPmi5ttvUmpydVjcFjZphOktWuA7ovbx91ECloWTfjIA==",
"requires": { "requires": {
"@babel/types": "^7.14.8", "@babel/types": "^7.14.5",
"jsesc": "^2.5.1", "jsesc": "^2.5.1",
"source-map": "^0.5.0" "source-map": "^0.5.0"
} }
@ -25247,13 +25253,13 @@
} }
}, },
"@babel/helper-create-class-features-plugin": { "@babel/helper-create-class-features-plugin": {
"version": "7.14.8", "version": "7.14.6",
"resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.8.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.6.tgz",
"integrity": "sha512-bpYvH8zJBWzeqi1o+co8qOrw+EXzQ/0c74gVmY205AWXy9nifHrOg77y+1zwxX5lXE7Icq4sPlSQ4O2kWBrteQ==", "integrity": "sha512-Z6gsfGofTxH/+LQXqYEK45kxmcensbzmk/oi8DmaQytlQCgqNZt9XQF8iqlI/SeXWVjaMNxvYvzaYw+kh42mDg==",
"requires": { "requires": {
"@babel/helper-annotate-as-pure": "^7.14.5", "@babel/helper-annotate-as-pure": "^7.14.5",
"@babel/helper-function-name": "^7.14.5", "@babel/helper-function-name": "^7.14.5",
"@babel/helper-member-expression-to-functions": "^7.14.7", "@babel/helper-member-expression-to-functions": "^7.14.5",
"@babel/helper-optimise-call-expression": "^7.14.5", "@babel/helper-optimise-call-expression": "^7.14.5",
"@babel/helper-replace-supers": "^7.14.5", "@babel/helper-replace-supers": "^7.14.5",
"@babel/helper-split-export-declaration": "^7.14.5" "@babel/helper-split-export-declaration": "^7.14.5"
@ -25326,9 +25332,9 @@
} }
}, },
"@babel/helper-validator-identifier": { "@babel/helper-validator-identifier": {
"version": "7.14.8", "version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.8.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.5.tgz",
"integrity": "sha512-ZGy6/XQjllhYQrNw/3zfWRwZCTVSiBLZ9DHVZxn9n2gip/7ab8mv2TWlKPIBk26RwedCBoWdjLmn+t9na2Gcow==" "integrity": "sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg=="
}, },
"@babel/highlight": { "@babel/highlight": {
"version": "7.14.5", "version": "7.14.5",
@ -25341,9 +25347,9 @@
} }
}, },
"@babel/parser": { "@babel/parser": {
"version": "7.14.8", "version": "7.14.7",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.8.tgz", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.7.tgz",
"integrity": "sha512-syoCQFOoo/fzkWDeM0dLEZi5xqurb5vuyzwIMNZRNun+N/9A4cUZeQaE7dTrB8jGaKuJRBtEOajtnmw0I5hvvA==" "integrity": "sha512-X67Z5y+VBJuHB/RjwECp8kSl5uYi0BvRbNeWqkaJCVh+LiTPl19WBUfG627psSgp9rSf6ojuXghQM3ha6qHHdA=="
}, },
"@babel/plugin-syntax-typescript": { "@babel/plugin-syntax-typescript": {
"version": "7.14.5", "version": "7.14.5",
@ -25364,27 +25370,27 @@
} }
}, },
"@babel/traverse": { "@babel/traverse": {
"version": "7.14.8", "version": "7.14.7",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.8.tgz", "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.7.tgz",
"integrity": "sha512-kexHhzCljJcFNn1KYAQ6A5wxMRzq9ebYpEDV4+WdNyr3i7O44tanbDOR/xjiG2F3sllan+LgwK+7OMk0EmydHg==", "integrity": "sha512-9vDr5NzHu27wgwejuKL7kIOm4bwEtaPQ4Z6cpCmjSuaRqpH/7xc4qcGEscwMqlkwgcXl6MvqoAjZkQ24uSdIZQ==",
"requires": { "requires": {
"@babel/code-frame": "^7.14.5", "@babel/code-frame": "^7.14.5",
"@babel/generator": "^7.14.8", "@babel/generator": "^7.14.5",
"@babel/helper-function-name": "^7.14.5", "@babel/helper-function-name": "^7.14.5",
"@babel/helper-hoist-variables": "^7.14.5", "@babel/helper-hoist-variables": "^7.14.5",
"@babel/helper-split-export-declaration": "^7.14.5", "@babel/helper-split-export-declaration": "^7.14.5",
"@babel/parser": "^7.14.8", "@babel/parser": "^7.14.7",
"@babel/types": "^7.14.8", "@babel/types": "^7.14.5",
"debug": "^4.1.0", "debug": "^4.1.0",
"globals": "^11.1.0" "globals": "^11.1.0"
} }
}, },
"@babel/types": { "@babel/types": {
"version": "7.14.8", "version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.8.tgz", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.5.tgz",
"integrity": "sha512-iob4soQa7dZw8nodR/KlOQkPh9S4I8RwCxwRIFuiMRYjOzH/KJzdUfDgz6cGi5dDaclXF4P2PAhCdrBJNIg68Q==", "integrity": "sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg==",
"requires": { "requires": {
"@babel/helper-validator-identifier": "^7.14.8", "@babel/helper-validator-identifier": "^7.14.5",
"to-fast-properties": "^2.0.0" "to-fast-properties": "^2.0.0"
} }
}, },
@ -25473,16 +25479,16 @@
"integrity": "sha512-/37qQCE3K0vvZKwoK4XU/irIJQdIfCJuhU5eKnNxpFDsOkgFaUAwbv+RYw6eYgsC0E4hS7r5KqGULUogqui0fQ==" "integrity": "sha512-/37qQCE3K0vvZKwoK4XU/irIJQdIfCJuhU5eKnNxpFDsOkgFaUAwbv+RYw6eYgsC0E4hS7r5KqGULUogqui0fQ=="
}, },
"@babel/helper-validator-identifier": { "@babel/helper-validator-identifier": {
"version": "7.14.8", "version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.8.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.5.tgz",
"integrity": "sha512-ZGy6/XQjllhYQrNw/3zfWRwZCTVSiBLZ9DHVZxn9n2gip/7ab8mv2TWlKPIBk26RwedCBoWdjLmn+t9na2Gcow==" "integrity": "sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg=="
}, },
"@babel/types": { "@babel/types": {
"version": "7.14.8", "version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.8.tgz", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.5.tgz",
"integrity": "sha512-iob4soQa7dZw8nodR/KlOQkPh9S4I8RwCxwRIFuiMRYjOzH/KJzdUfDgz6cGi5dDaclXF4P2PAhCdrBJNIg68Q==", "integrity": "sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg==",
"requires": { "requires": {
"@babel/helper-validator-identifier": "^7.14.8", "@babel/helper-validator-identifier": "^7.14.5",
"to-fast-properties": "^2.0.0" "to-fast-properties": "^2.0.0"
} }
} }
@ -25663,9 +25669,9 @@
} }
}, },
"@babel/helper-validator-identifier": { "@babel/helper-validator-identifier": {
"version": "7.14.8", "version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.8.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.5.tgz",
"integrity": "sha512-ZGy6/XQjllhYQrNw/3zfWRwZCTVSiBLZ9DHVZxn9n2gip/7ab8mv2TWlKPIBk26RwedCBoWdjLmn+t9na2Gcow==" "integrity": "sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg=="
}, },
"@babel/highlight": { "@babel/highlight": {
"version": "7.14.5", "version": "7.14.5",
@ -25678,9 +25684,9 @@
} }
}, },
"@babel/parser": { "@babel/parser": {
"version": "7.14.8", "version": "7.14.7",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.8.tgz", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.7.tgz",
"integrity": "sha512-syoCQFOoo/fzkWDeM0dLEZi5xqurb5vuyzwIMNZRNun+N/9A4cUZeQaE7dTrB8jGaKuJRBtEOajtnmw0I5hvvA==" "integrity": "sha512-X67Z5y+VBJuHB/RjwECp8kSl5uYi0BvRbNeWqkaJCVh+LiTPl19WBUfG627psSgp9rSf6ojuXghQM3ha6qHHdA=="
}, },
"ansi-styles": { "ansi-styles": {
"version": "3.2.1", "version": "3.2.1",
@ -25744,21 +25750,21 @@
} }
}, },
"@babel/generator": { "@babel/generator": {
"version": "7.14.8", "version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.8.tgz", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.5.tgz",
"integrity": "sha512-cYDUpvIzhBVnMzRoY1fkSEhK/HmwEVwlyULYgn/tMQYd6Obag3ylCjONle3gdErfXBW61SVTlR9QR7uWlgeIkg==", "integrity": "sha512-y3rlP+/G25OIX3mYKKIOlQRcqj7YgrvHxOLbVmyLJ9bPmi5ttvUmpydVjcFjZphOktWuA7ovbx91ECloWTfjIA==",
"requires": { "requires": {
"@babel/types": "^7.14.8", "@babel/types": "^7.14.5",
"jsesc": "^2.5.1", "jsesc": "^2.5.1",
"source-map": "^0.5.0" "source-map": "^0.5.0"
}, },
"dependencies": { "dependencies": {
"@babel/types": { "@babel/types": {
"version": "7.14.8", "version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.8.tgz", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.5.tgz",
"integrity": "sha512-iob4soQa7dZw8nodR/KlOQkPh9S4I8RwCxwRIFuiMRYjOzH/KJzdUfDgz6cGi5dDaclXF4P2PAhCdrBJNIg68Q==", "integrity": "sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg==",
"requires": { "requires": {
"@babel/helper-validator-identifier": "^7.14.8", "@babel/helper-validator-identifier": "^7.14.5",
"to-fast-properties": "^2.0.0" "to-fast-properties": "^2.0.0"
} }
} }
@ -25775,11 +25781,11 @@
}, },
"dependencies": { "dependencies": {
"@babel/types": { "@babel/types": {
"version": "7.14.8", "version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.8.tgz", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.5.tgz",
"integrity": "sha512-iob4soQa7dZw8nodR/KlOQkPh9S4I8RwCxwRIFuiMRYjOzH/KJzdUfDgz6cGi5dDaclXF4P2PAhCdrBJNIg68Q==", "integrity": "sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg==",
"requires": { "requires": {
"@babel/helper-validator-identifier": "^7.14.8", "@babel/helper-validator-identifier": "^7.14.5",
"to-fast-properties": "^2.0.0" "to-fast-properties": "^2.0.0"
} }
} }
@ -25794,11 +25800,11 @@
}, },
"dependencies": { "dependencies": {
"@babel/types": { "@babel/types": {
"version": "7.14.8", "version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.8.tgz", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.5.tgz",
"integrity": "sha512-iob4soQa7dZw8nodR/KlOQkPh9S4I8RwCxwRIFuiMRYjOzH/KJzdUfDgz6cGi5dDaclXF4P2PAhCdrBJNIg68Q==", "integrity": "sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg==",
"requires": { "requires": {
"@babel/helper-validator-identifier": "^7.14.8", "@babel/helper-validator-identifier": "^7.14.5",
"to-fast-properties": "^2.0.0" "to-fast-properties": "^2.0.0"
} }
} }
@ -25813,20 +25819,20 @@
}, },
"dependencies": { "dependencies": {
"@babel/types": { "@babel/types": {
"version": "7.14.8", "version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.8.tgz", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.5.tgz",
"integrity": "sha512-iob4soQa7dZw8nodR/KlOQkPh9S4I8RwCxwRIFuiMRYjOzH/KJzdUfDgz6cGi5dDaclXF4P2PAhCdrBJNIg68Q==", "integrity": "sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg==",
"requires": { "requires": {
"@babel/helper-validator-identifier": "^7.14.8", "@babel/helper-validator-identifier": "^7.14.5",
"to-fast-properties": "^2.0.0" "to-fast-properties": "^2.0.0"
} }
} }
} }
}, },
"@babel/helper-validator-identifier": { "@babel/helper-validator-identifier": {
"version": "7.14.8", "version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.8.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.5.tgz",
"integrity": "sha512-ZGy6/XQjllhYQrNw/3zfWRwZCTVSiBLZ9DHVZxn9n2gip/7ab8mv2TWlKPIBk26RwedCBoWdjLmn+t9na2Gcow==" "integrity": "sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg=="
}, },
"@babel/highlight": { "@babel/highlight": {
"version": "7.14.5", "version": "7.14.5",
@ -25839,9 +25845,9 @@
} }
}, },
"@babel/parser": { "@babel/parser": {
"version": "7.14.8", "version": "7.14.7",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.8.tgz", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.7.tgz",
"integrity": "sha512-syoCQFOoo/fzkWDeM0dLEZi5xqurb5vuyzwIMNZRNun+N/9A4cUZeQaE7dTrB8jGaKuJRBtEOajtnmw0I5hvvA==" "integrity": "sha512-X67Z5y+VBJuHB/RjwECp8kSl5uYi0BvRbNeWqkaJCVh+LiTPl19WBUfG627psSgp9rSf6ojuXghQM3ha6qHHdA=="
}, },
"@babel/template": { "@babel/template": {
"version": "7.14.5", "version": "7.14.5",
@ -25854,11 +25860,11 @@
}, },
"dependencies": { "dependencies": {
"@babel/types": { "@babel/types": {
"version": "7.14.8", "version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.8.tgz", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.5.tgz",
"integrity": "sha512-iob4soQa7dZw8nodR/KlOQkPh9S4I8RwCxwRIFuiMRYjOzH/KJzdUfDgz6cGi5dDaclXF4P2PAhCdrBJNIg68Q==", "integrity": "sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg==",
"requires": { "requires": {
"@babel/helper-validator-identifier": "^7.14.8", "@babel/helper-validator-identifier": "^7.14.5",
"to-fast-properties": "^2.0.0" "to-fast-properties": "^2.0.0"
} }
} }
@ -25912,9 +25918,9 @@
}, },
"dependencies": { "dependencies": {
"@babel/helper-validator-identifier": { "@babel/helper-validator-identifier": {
"version": "7.14.8", "version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.8.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.5.tgz",
"integrity": "sha512-ZGy6/XQjllhYQrNw/3zfWRwZCTVSiBLZ9DHVZxn9n2gip/7ab8mv2TWlKPIBk26RwedCBoWdjLmn+t9na2Gcow==" "integrity": "sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg=="
} }
} }
}, },
@ -27345,9 +27351,9 @@
} }
}, },
"@docusaurus/module-type-aliases": { "@docusaurus/module-type-aliases": {
"version": "2.0.0-alpha.72", "version": "2.0.0-beta.3",
"resolved": "https://registry.npmjs.org/@docusaurus/module-type-aliases/-/module-type-aliases-2.0.0-alpha.72.tgz", "resolved": "https://registry.npmjs.org/@docusaurus/module-type-aliases/-/module-type-aliases-2.0.0-beta.3.tgz",
"integrity": "sha512-z8qGXvvyF8FYgnc0c7v5BqulrUJ0A01jsb2gT4miC6Gc/pKnpahZqBXcm1MrQiiUrlHMEjdOAxlHQVZuOwSSRQ==", "integrity": "sha512-vciejziDBu39cyfmdvbpn865YlvugJMUOeD2m/7Kg4RLUPIZzQTWns0ZGIMc/iToiwebHwkoJtRsHaHzj8FpnA==",
"dev": true "dev": true
}, },
"@docusaurus/plugin-content-blog": { "@docusaurus/plugin-content-blog": {
@ -28397,6 +28403,11 @@
} }
} }
}, },
"@mdx-js/react": {
"version": "1.6.22",
"resolved": "https://registry.npmjs.org/@mdx-js/react/-/react-1.6.22.tgz",
"integrity": "sha512-TDoPum4SHdfPiGSAaRBw7ECyI8VaHpK8GJugbJIJuqyh6kzw9ZLJZW3HGL3NNrJGxcAixUvqROm+YuQOo5eXtg=="
},
"@nodelib/fs.scandir": { "@nodelib/fs.scandir": {
"version": "2.1.5", "version": "2.1.5",
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
@ -30556,9 +30567,9 @@
} }
}, },
"electron-to-chromium": { "electron-to-chromium": {
"version": "1.3.788", "version": "1.3.779",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.788.tgz", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.779.tgz",
"integrity": "sha512-dbMIpX4E4/Gk4gzOh1GYS7ls1vGsByWKpIqLviJi1mSmSt5BvrWLLtSqpFE5BaC7Ef4NnI0GMaiddNX2Brw6zA==" "integrity": "sha512-nreave0y/1Qhmo8XtO6C/LpawNyC6U26+q7d814/e+tIqUK073pM+4xW7WUXyqCRa5K4wdxHmNMBAi8ap9nEew=="
}, },
"semver": { "semver": {
"version": "7.0.0", "version": "7.0.0",
@ -34767,6 +34778,12 @@
"resolved": "https://registry.npmjs.org/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz", "resolved": "https://registry.npmjs.org/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz",
"integrity": "sha1-iZ8R2WhuXgXLkbNdXw5jt3PPyQE=" "integrity": "sha1-iZ8R2WhuXgXLkbNdXw5jt3PPyQE="
}, },
"mustache": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz",
"integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==",
"dev": true
},
"mz": { "mz": {
"version": "2.7.0", "version": "2.7.0",
"resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz",
@ -35916,9 +35933,9 @@
} }
}, },
"electron-to-chromium": { "electron-to-chromium": {
"version": "1.3.788", "version": "1.3.779",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.788.tgz", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.779.tgz",
"integrity": "sha512-dbMIpX4E4/Gk4gzOh1GYS7ls1vGsByWKpIqLviJi1mSmSt5BvrWLLtSqpFE5BaC7Ef4NnI0GMaiddNX2Brw6zA==" "integrity": "sha512-nreave0y/1Qhmo8XtO6C/LpawNyC6U26+q7d814/e+tIqUK073pM+4xW7WUXyqCRa5K4wdxHmNMBAi8ap9nEew=="
}, },
"postcss-value-parser": { "postcss-value-parser": {
"version": "4.1.0", "version": "4.1.0",
@ -35989,9 +36006,9 @@
} }
}, },
"electron-to-chromium": { "electron-to-chromium": {
"version": "1.3.788", "version": "1.3.779",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.788.tgz", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.779.tgz",
"integrity": "sha512-dbMIpX4E4/Gk4gzOh1GYS7ls1vGsByWKpIqLviJi1mSmSt5BvrWLLtSqpFE5BaC7Ef4NnI0GMaiddNX2Brw6zA==" "integrity": "sha512-nreave0y/1Qhmo8XtO6C/LpawNyC6U26+q7d814/e+tIqUK073pM+4xW7WUXyqCRa5K4wdxHmNMBAi8ap9nEew=="
} }
} }
}, },
@ -38389,9 +38406,9 @@
} }
}, },
"electron-to-chromium": { "electron-to-chromium": {
"version": "1.3.788", "version": "1.3.779",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.788.tgz", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.779.tgz",
"integrity": "sha512-dbMIpX4E4/Gk4gzOh1GYS7ls1vGsByWKpIqLviJi1mSmSt5BvrWLLtSqpFE5BaC7Ef4NnI0GMaiddNX2Brw6zA==" "integrity": "sha512-nreave0y/1Qhmo8XtO6C/LpawNyC6U26+q7d814/e+tIqUK073pM+4xW7WUXyqCRa5K4wdxHmNMBAi8ap9nEew=="
}, },
"postcss-selector-parser": { "postcss-selector-parser": {
"version": "6.0.6", "version": "6.0.6",
@ -38514,6 +38531,12 @@
} }
} }
}, },
"tapable": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.0.tgz",
"integrity": "sha512-FBk4IesMV1rBxX2tfiK8RAmogtWn53puLOQlvO8XuwlgxcYbP4mVPS9Ph4aeamSyyVjOl24aYWAuc8U5kCVwMw==",
"dev": true
},
"terser": { "terser": {
"version": "5.7.1", "version": "5.7.1",
"resolved": "https://registry.npmjs.org/terser/-/terser-5.7.1.tgz", "resolved": "https://registry.npmjs.org/terser/-/terser-5.7.1.tgz",
@ -38536,6 +38559,28 @@
} }
} }
}, },
"terser-webpack-plugin": {
"version": "5.1.4",
"resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.1.4.tgz",
"integrity": "sha512-C2WkFwstHDhVEmsmlCxrXUtVklS+Ir1A7twrYzrDrQQOIMOaVAYykaoo/Aq1K0QRkMoY2hhvDQY1cm4jnIMFwA==",
"dev": true,
"requires": {
"jest-worker": "^27.0.2",
"p-limit": "^3.1.0",
"schema-utils": "^3.0.0",
"serialize-javascript": "^6.0.0",
"source-map": "^0.6.1",
"terser": "^5.7.0"
},
"dependencies": {
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true
}
}
},
"text-table": { "text-table": {
"version": "0.2.0", "version": "0.2.0",
"resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
@ -39203,6 +39248,61 @@
"resolved": "https://registry.npmjs.org/web-tree-sitter/-/web-tree-sitter-0.19.4.tgz", "resolved": "https://registry.npmjs.org/web-tree-sitter/-/web-tree-sitter-0.19.4.tgz",
"integrity": "sha512-8G0xBj05hqZybCqBtW7RPZ/hWEtP3DiLTauQzGJZuZYfVRgw7qj7iaZ+8djNqJ4VPrdOO+pS2dR1JsTbsLxdYg==" "integrity": "sha512-8G0xBj05hqZybCqBtW7RPZ/hWEtP3DiLTauQzGJZuZYfVRgw7qj7iaZ+8djNqJ4VPrdOO+pS2dR1JsTbsLxdYg=="
}, },
"webpack": {
"version": "5.46.0",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.46.0.tgz",
"integrity": "sha512-qxD0t/KTedJbpcXUmvMxY5PUvXDbF8LsThCzqomeGaDlCA6k998D8yYVwZMvO8sSM3BTEOaD4uzFniwpHaTIJw==",
"dev": true,
"requires": {
"@types/eslint-scope": "^3.7.0",
"@types/estree": "^0.0.50",
"@webassemblyjs/ast": "1.11.1",
"@webassemblyjs/wasm-edit": "1.11.1",
"@webassemblyjs/wasm-parser": "1.11.1",
"acorn": "^8.4.1",
"browserslist": "^4.14.5",
"chrome-trace-event": "^1.0.2",
"enhanced-resolve": "^5.8.0",
"es-module-lexer": "^0.7.1",
"eslint-scope": "5.1.1",
"events": "^3.2.0",
"glob-to-regexp": "^0.4.1",
"graceful-fs": "^4.2.4",
"json-parse-better-errors": "^1.0.2",
"loader-runner": "^4.2.0",
"mime-types": "^2.1.27",
"neo-async": "^2.6.2",
"schema-utils": "^3.1.0",
"tapable": "^2.1.1",
"terser-webpack-plugin": "^5.1.3",
"watchpack": "^2.2.0",
"webpack-sources": "^2.3.1"
},
"dependencies": {
"acorn": {
"version": "8.4.1",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.4.1.tgz",
"integrity": "sha512-asabaBSkEKosYKMITunzX177CXxQ4Q8BSSzMTKD+FefUhipQC70gfW5SiUDhYQ3vk8G+81HqQk7Fv9OXwwn9KA==",
"dev": true
},
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true
},
"webpack-sources": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-2.3.1.tgz",
"integrity": "sha512-y9EI9AO42JjEcrTJFOYmVywVZdKVUfOvDUPsJea5GIr1JOEGFVqwlY2K098fFoIjOkDzHn2AjRvM8dsBZu+gCA==",
"dev": true,
"requires": {
"source-list-map": "^2.0.1",
"source-map": "^0.6.1"
}
}
}
},
"webpack-bundle-analyzer": { "webpack-bundle-analyzer": {
"version": "4.4.2", "version": "4.4.2",
"resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.4.2.tgz", "resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.4.2.tgz",
@ -39671,9 +39771,9 @@
} }
}, },
"url-parse": { "url-parse": {
"version": "1.5.3", "version": "1.5.1",
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.3.tgz", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.1.tgz",
"integrity": "sha512-IIORyIQD9rvj0A4CLWsHkBBJuNqWpFQe224b6j9t/ABmquIS0qDU2pY6kl6AuOrL5OkCXHMCFNe1jBcuAggjvQ==", "integrity": "sha512-HOfCOUJt7iSYzEx/UqgtwKRMC6EU91NFhsCHMv9oM03VJcVo2Qrp8T8kI9D7amFf1cu+/3CEhgb3rF9zL7k85Q==",
"requires": { "requires": {
"querystringify": "^2.1.1", "querystringify": "^2.1.1",
"requires-port": "^1.0.0" "requires-port": "^1.0.0"

7
docs/package.json

@ -26,7 +26,8 @@
"react-copy-to-clipboard": "^5.0.3", "react-copy-to-clipboard": "^5.0.3",
"react-dom": "^17.0.2", "react-dom": "^17.0.2",
"react-toastify": "^7.0.4", "react-toastify": "^7.0.4",
"web-tree-sitter": "^0.19.4" "web-tree-sitter": "^0.19.4",
"@mdx-js/react": "^1.6.22"
}, },
"browserslist": { "browserslist": {
"production": [ "production": [
@ -46,12 +47,14 @@
"eslint-plugin-mdx": "^1.13.0", "eslint-plugin-mdx": "^1.13.0",
"eslint-plugin-react": "^7.23.2", "eslint-plugin-react": "^7.23.2",
"json-schema-to-typescript": "^10.1.3", "json-schema-to-typescript": "^10.1.3",
"mustache": "^4.2.0",
"null-loader": "^4.0.0", "null-loader": "^4.0.0",
"prebuild-webpack-plugin": "^1.1.1", "prebuild-webpack-plugin": "^1.1.1",
"prettier": "2.3.1", "prettier": "2.3.1",
"string-replace-loader": "^3.0.3", "string-replace-loader": "^3.0.3",
"typescript": "^4.2.3", "typescript": "^4.2.3",
"@docusaurus/module-type-aliases": "^2.0.0-alpha.72", "webpack": "^5.46.0",
"@docusaurus/module-type-aliases": "^2.0.0-beta.3",
"@tsconfig/docusaurus": "^1.0.2", "@tsconfig/docusaurus": "^1.0.2",
"@types/react": "^17.0.3", "@types/react": "^17.0.3",
"@types/react-helmet": "^6.1.0", "@types/react-helmet": "^6.1.0",

62
docs/src/setup-script-generation-plugin/index.js

@ -0,0 +1,62 @@
/*
* Copyright (c) 2021 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
var PrebuildPlugin = require("prebuild-webpack-plugin");
const fs = require("fs");
const glob = require("glob");
const yaml = require("js-yaml");
const Mustache = require("mustache");
function generateSetupScripts() {
return glob("../app/boards/**/*.zmk.yml", (error, files) => {
const aggregated = files.flatMap((f) =>
yaml.safeLoadAll(fs.readFileSync(f, "utf8"))
);
const data = aggregated.reduce(
(agg, item) => {
switch (item.type) {
case "shield":
item.compatible = true;
item.split = item.siblings?.length > 1;
agg.keyboards.push(item);
break;
case "board":
if (!item.features?.includes("keys")) {
agg.boards.push(item);
}
break;
}
return agg;
},
{ keyboards: [], boards: [] }
);
for (let script_ext of ["sh", "ps1"]) {
const templateBuffer = fs.readFileSync(
`src/templates/setup.${script_ext}.mustache`,
"utf8"
);
const script = Mustache.render(templateBuffer, data);
fs.writeFileSync(`static/setup.${script_ext}`, script);
}
});
}
module.exports = function () {
return {
name: "setup-script-generation-plugin",
configureWebpack() {
return {
plugins: [
new PrebuildPlugin({
build: generateSetupScripts,
}),
],
};
},
};
};

10
docs/static/setup.ps1 → docs/src/templates/setup.ps1.mustache

@ -75,8 +75,8 @@ $repo_path = "https://github.com/zmkfirmware/zmk-config-split-template.git"
$title = "ZMK Config Setup:" $title = "ZMK Config Setup:"
$prompt = "Pick an MCU board" $prompt = "Pick an MCU board"
$options = "nice!nano v1", "nice!nano v2", "QMK Proton-C", "BlueMicro840 (v1)", "makerdiary nRF52840 M.2" $options = {{#boards}}"{{{name}}}", {{/boards}} "" | Where-Object { $_ -ne "" }
$boards = "nice_nano", "nice_nano_v2", "proton_c", "bluemicro840_v1", "nrf52840_m2" $boards = {{#boards}}"{{id}}", {{/boards}} "" | Where-Object { $_ -ne "" }
Write-Host "$title" Write-Host "$title"
Write-Host "" Write-Host ""
@ -90,9 +90,9 @@ Write-Host "Keyboard Shield Selection:"
$prompt = "Pick a keyboard" $prompt = "Pick a keyboard"
# TODO: Add support for "Other" and linking to docs on adding custom shields in user config repos. # TODO: Add support for "Other" and linking to docs on adding custom shields in user config repos.
$options = "Kyria", "Lily58", "Corne", "Splitreus62", "Sofle", "Iris", "Reviung41", "RoMac", "RoMac+", "makerdiary M60", "Microdox", "TG4X", "QAZ", "NIBBLE", "Jorne", "Jian", "CRBN", "Tidbit", "Eek!", "BFO-9000", "Helix" $options = {{#keyboards}}"{{name}}", {{/keyboards}} "" | Where-Object { $_ -ne "" }
$names = "kyria", "lily58", "corne", "splitreus62", "sofle", "iris", "reviung41", "romac", "romac_plus", "m60", "microdox", "tg4x", "qaz", "nibble", "jorne", "jian", "crbn", "tidbit", "eek", "bfo9000", "helix" $names = {{#keyboards}}"{{id}}", {{/keyboards}} "" | Where-Object { $_ -ne "" }
$splits = "y", "y", "y", "y", "y", "y", "n", "n", "n", "n", "y", "n", "n", "n", "y", "y", "n", "n", "n", "n", "y" $splits = {{#keyboards}}"{{#split}}y{{/split}}{{^split}}n{{/split}}", {{/keyboards}} "" | Where-Object { $_ -ne "" }
$choice = Get-Choice-From-Options -Options $options -Prompt $prompt $choice = Get-Choice-From-Options -Options $options -Prompt $prompt
$shield_title = $($options[$choice]) $shield_title = $($options[$choice])

115
docs/static/setup.sh → docs/src/templates/setup.sh.mustache

@ -65,71 +65,70 @@ fi
repo_path="https://github.com/zmkfirmware/zmk-config-split-template.git" repo_path="https://github.com/zmkfirmware/zmk-config-split-template.git"
title="ZMK Config Setup:" title="ZMK Config Setup:"
prompt="Pick an MCU board:"
options=("nice!nano v1" "nice!nano v2" "QMK Proton-C" "BlueMicro840 (v1)" "makerdiary nRF52840 M.2")
echo "$title"
echo "" echo ""
echo "MCU Board Selection:" echo "Keyboard Selection:"
PS3="$prompt " PS3="Pick a keyboard: "
options=({{#keyboards}}"{{{name}}}" {{/keyboards}})
keyboards_id=({{#keyboards}}"{{id}}" {{/keyboards}})
keyboards_type=({{#keyboards}}"{{type}}" {{/keyboards}})
keyboards_split=({{#keyboards}}"{{#split}}y{{/split}}{{^split}}n{{/split}}" {{/keyboards}})
keyboards_shield=({{#keyboards}}"{{#compatible}}y{{/compatible}}{{^compatible}}n{{/compatible}}" {{/keyboards}})
select opt in "${options[@]}" "Quit"; do select opt in "${options[@]}" "Quit"; do
case "$REPLY" in case "$REPLY" in
''|*[!0-9]*) echo "Invalid option. Try another one."; continue;;
1 ) board="nice_nano"; break;;
2 ) board="nice_nano_v2"; break;; $(( ${#options[@]}+1 )) ) echo "Goodbye!"; exit 1;;
3 ) board="proton_c"; break;; *)
4 ) board="bluemicro840_v1"; break;; if [ $REPLY -gt $(( ${#options[@]}+1 )) ] || [ $REPLY -lt 0 ]; then
5 ) board="nrf52840_m2"; break;; echo "Invalid option. Try another one."
continue
$(( ${#options[@]}+1 )) ) echo "Goodbye!"; exit 1;; fi
*) echo "Invalid option. Try another one."; continue;; keyboard_index=$(( $REPLY-1 ))
keyboard=${keyboards_id[$keyboard_index]}
keyboard_title=${options[$keyboard_index]}
split=${keyboards_split[$keyboard_index]}
type=${keyboards_type[$keyboard_index]}
keyboard_shield=${keyboards_shield[$keyboard_index]}
break
;;
esac esac
done done
echo "" if [ "$keyboard_shield" == "y" ]; then
echo "Keyboard Shield Selection:" shield=${keyboard}
shield_title=${keyboard_title}
prompt="Pick an keyboard:"
options=("Kyria" "Lily58" "Corne" "Splitreus62" "Sofle" "Iris" "Reviung41" "RoMac" "RoMac+" "makerdiary M60" "Microdox" "TG4X" "QAZ" "NIBBLE" "Jorne" "Jian" "CRBN" "Tidbit" "Eek!" "BFO-9000" "Helix") prompt="Pick an MCU board:"
options=({{#boards}}"{{{name}}}" {{/boards}})
PS3="$prompt " board_ids=({{#boards}}"{{id}}" {{/boards}})
# TODO: Add support for "Other" and linking to docs on adding custom shields in user config repos.
# select opt in "${options[@]}" "Other" "Quit"; do echo ""
select opt in "${options[@]}" "Quit"; do echo "MCU Board Selection:"
PS3="$prompt "
case "$REPLY" in select opt in "${options[@]}" "Quit"; do
case "$REPLY" in
1 ) shield_title="Kyria" shield="kyria"; split="y"; break;; ''|*[!0-9]*) echo "Invalid option. Try another one."; continue;;
2 ) shield_title="Lily58" shield="lily58"; split="y"; break;;
3 ) shield_title="Corne" shield="corne"; split="y"; break;; $(( ${#options[@]}+1 )) ) echo "Goodbye!"; exit 1;;
4 ) shield_title="Splitreus62" shield="splitreus62"; split="y"; break;; *)
5 ) shield_title="Sofle" shield="sofle"; split="y"; break;; if [ $REPLY -gt $(( ${#options[@]}+1 )) ] || [ $REPLY -lt 0 ]; then
6 ) shield_title="Iris" shield="iris"; split="y"; break;; echo "Invalid option. Try another one."
7 ) shield_title="Reviung41" shield="reviung41"; split="n"; break;; continue
8 ) shield_title="RoMac" shield="romac"; split="n"; break;; fi
9 ) shield_title="RoMac+" shield="romac_plus"; split="n"; break;; board_index=$(( $REPLY-1 ))
10 ) shield_title="M60" shield="m60"; split="n"; break;; board=${board_ids[$board_index]}
11 ) shield_title="Microdox" shield="microdox"; split="y"; break;; board_title=${options[$board_index]}
12 ) shield_title="TG4X" shield="tg4x"; split="n"; break;; break
13 ) shield_title="QAZ" shield="qaz"; split="n"; break;; ;;
14 ) shield_title="NIBBLE" shield="nibble"; split="n"; break;;
15 ) shield_title="Jorne" shield="jorne"; split="y"; break;; esac
16 ) shield_title="Jian" shield="jian"; split="y"; break;; done
17 ) shield_title="CRBN" shield="crbn"; split="n"; break;; else
18 ) shield_title="Tidbit" shield="tidbit"; split="n"; break;; board=${keyboard}
19 ) shield_title="Eek!" shield="eek"; split="n"; break;; echo "Support for onboard microcontroller keyboards is still a work in progress."
20 ) shield_title="BFO-9000" shield="bfo9000"; split="y"; break;; exit 1
21 ) shield_title="Helix" shield="helix"; split="y"; break;; fi
# Add link to docs on adding your own custom shield in your ZMK config!
# $(( ${#options[@]}+1 )) ) echo "Other!"; break;;
$(( ${#options[@]}+1 )) ) echo "Goodbye!"; exit 1;;
*) echo "Invalid option. Try another one.";continue;;
esac
done
if [ "$split" == "n" ]; then if [ "$split" == "n" ]; then
repo_path="https://github.com/zmkfirmware/zmk-config-template.git" repo_path="https://github.com/zmkfirmware/zmk-config-template.git"

5
docs/static/.gitignore vendored

@ -0,0 +1,5 @@
# Ignore generated setup script
setup.ps1
setup.sh
Loading…
Cancel
Save