Skip to content

Commit f0a3947

Browse files
authored
Update web-tree-sitter and tweak keymap upgrader (zmkfirmware#2593)
* fix(docs): Fix TypeScript import diagnostics Set the TypeScript module resolution mode to "bundler" so it correctly resolves imports in .ts files instead of showing errors in IDEs. * chore(docs): Update web-tree-sitter Updated web-tree-sitter, and switched from having a copy of tree-sitter-devicetree.wasm in the repo to using the latest version of the tree-sitter-devicetree module, which now contains the .wasm file. * fix(docs): Make keymap upgrader resize vertically only Changed the textarea in the keymap ugprader to allow only vertical resizing. This better fits the layout of the page, and it prevents you from shrinking the box horizontally to the point where it doesn't fit anything.
1 parent 7ee25c7 commit f0a3947

File tree

6 files changed

+67
-6
lines changed

6 files changed

+67
-6
lines changed

docs/package-lock.json

+57-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
"react-copy-to-clipboard": "^5.0.3",
3030
"react-dom": "^18.0.0",
3131
"react-toastify": "^10.0.6",
32-
"web-tree-sitter": "^0.23.0"
32+
"tree-sitter-devicetree": "^0.12.1",
33+
"web-tree-sitter": "^0.24.3"
3334
},
3435
"browserslist": {
3536
"production": [

docs/src/components/KeymapUpgrader/styles.module.css

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
font-size: var(--ifm-font-size-base);
1010
line-height: var(--ifm-pre-line-height);
1111
tab-size: 4;
12+
resize: vertical;
1213

1314
color: var(--ifm-pre-color);
1415
background-color: var(--ifm-pre-background);

docs/src/keymap-upgrade/parser.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ const TREE_SITTER_WASM_URL = new URL(
55
import.meta.url
66
);
77

8+
const TREE_SITTER_DEVICETREE_WASM_URL = new URL(
9+
"/node_modules/tree-sitter-devicetree/tree-sitter-devicetree.wasm",
10+
import.meta.url
11+
);
12+
813
export let Devicetree: Parser.Language;
914

1015
export async function initParser() {
@@ -17,7 +22,7 @@ export async function initParser() {
1722
return prefix + path;
1823
},
1924
});
20-
Devicetree = await Parser.Language.load("/tree-sitter-devicetree.wasm");
25+
Devicetree = await Parser.Language.load(TREE_SITTER_DEVICETREE_WASM_URL.href);
2126
}
2227

2328
export function createParser() {
-157 KB
Binary file not shown.

docs/tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"include": ["src/"],
44
"compilerOptions": {
55
"types": ["node", "@docusaurus/theme-classic"],
6+
"moduleResolution": "Bundler",
67
"esModuleInterop": true,
78
"resolveJsonModule": true,
89
"strict": true,

0 commit comments

Comments
 (0)