mirror of https://github.com/zmkfirmware/zmk.git
Update web-tree-sitter and tweak keymap upgrader (#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.
This commit is contained in:
parent
7ee25c7959
commit
f0a3947044
|
|
@ -22,7 +22,8 @@
|
|||
"react-copy-to-clipboard": "^5.0.3",
|
||||
"react-dom": "^18.0.0",
|
||||
"react-toastify": "^10.0.6",
|
||||
"web-tree-sitter": "^0.23.0"
|
||||
"tree-sitter-devicetree": "^0.12.1",
|
||||
"web-tree-sitter": "^0.24.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/module-type-aliases": "^3.0.0",
|
||||
|
|
@ -16672,6 +16673,15 @@
|
|||
"tslib": "^2.0.3"
|
||||
}
|
||||
},
|
||||
"node_modules/node-addon-api": {
|
||||
"version": "8.2.1",
|
||||
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-8.2.1.tgz",
|
||||
"integrity": "sha512-vmEOvxwiH8tlOcv4SyE8RH34rI5/nWVaigUeAUPawC6f0+HoDthwI0vkMu4tbtsZrXq6QXFfrkhjofzKEs5tpA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "^18 || ^20 || >= 21"
|
||||
}
|
||||
},
|
||||
"node_modules/node-emoji": {
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-2.1.3.tgz",
|
||||
|
|
@ -16696,6 +16706,17 @@
|
|||
"node": ">= 6.13.0"
|
||||
}
|
||||
},
|
||||
"node_modules/node-gyp-build": {
|
||||
"version": "4.8.2",
|
||||
"resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.2.tgz",
|
||||
"integrity": "sha512-IRUxE4BVsHWXkV/SFOut4qTlagw2aM8T5/vnTsmrHJvVoKueJHRc/JaFND7QDDc61kLYUJ6qlZM3sqTSyx2dTw==",
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"node-gyp-build": "bin.js",
|
||||
"node-gyp-build-optional": "optional.js",
|
||||
"node-gyp-build-test": "build-test.js"
|
||||
}
|
||||
},
|
||||
"node_modules/node-releases": {
|
||||
"version": "2.0.18",
|
||||
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz",
|
||||
|
|
@ -20964,6 +20985,37 @@
|
|||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/tree-sitter": {
|
||||
"version": "0.21.1",
|
||||
"resolved": "https://registry.npmjs.org/tree-sitter/-/tree-sitter-0.21.1.tgz",
|
||||
"integrity": "sha512-7dxoA6kYvtgWw80265MyqJlkRl4yawIjO7S5MigytjELkX43fV2WsAXzsNfO7sBpPPCF5Gp0+XzHk0DwLCq3xQ==",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"node-addon-api": "^8.0.0",
|
||||
"node-gyp-build": "^4.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/tree-sitter-devicetree": {
|
||||
"version": "0.12.1",
|
||||
"resolved": "https://registry.npmjs.org/tree-sitter-devicetree/-/tree-sitter-devicetree-0.12.1.tgz",
|
||||
"integrity": "sha512-JccTH8TmgO9B4tAaCEZ8O7yOEtoixBRRnNZYO8W9tnNsv29Y+avsN6V8li2CfwooB1eqZIEbsPLKxN/e7bG+Cg==",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"node-addon-api": "^8.2.1",
|
||||
"node-gyp-build": "^4.8.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"tree-sitter": "^0.21.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"tree_sitter": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/trim-lines": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz",
|
||||
|
|
@ -22015,9 +22067,10 @@
|
|||
}
|
||||
},
|
||||
"node_modules/web-tree-sitter": {
|
||||
"version": "0.23.0",
|
||||
"resolved": "https://registry.npmjs.org/web-tree-sitter/-/web-tree-sitter-0.23.0.tgz",
|
||||
"integrity": "sha512-p1T+ju2H30fpVX2q5yr+Wv/NfdMMWMjQp9Q+4eEPrHAJpPFh9DPfI2Yr9L1f5SA5KPE+g1cNUqPbpihxUDzmVw=="
|
||||
"version": "0.24.3",
|
||||
"resolved": "https://registry.npmjs.org/web-tree-sitter/-/web-tree-sitter-0.24.3.tgz",
|
||||
"integrity": "sha512-uR9YNewr1S2EzPKE+y39nAwaTyobBaZRG/IsfkB/OT4v0lXtNj5WjtHKgn2h7eOYUWIZh5rK9Px7tI6S9CRKdA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/web-worker": {
|
||||
"version": "1.3.0",
|
||||
|
|
|
|||
|
|
@ -29,7 +29,8 @@
|
|||
"react-copy-to-clipboard": "^5.0.3",
|
||||
"react-dom": "^18.0.0",
|
||||
"react-toastify": "^10.0.6",
|
||||
"web-tree-sitter": "^0.23.0"
|
||||
"tree-sitter-devicetree": "^0.12.1",
|
||||
"web-tree-sitter": "^0.24.3"
|
||||
},
|
||||
"browserslist": {
|
||||
"production": [
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
font-size: var(--ifm-font-size-base);
|
||||
line-height: var(--ifm-pre-line-height);
|
||||
tab-size: 4;
|
||||
resize: vertical;
|
||||
|
||||
color: var(--ifm-pre-color);
|
||||
background-color: var(--ifm-pre-background);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,11 @@ const TREE_SITTER_WASM_URL = new URL(
|
|||
import.meta.url
|
||||
);
|
||||
|
||||
const TREE_SITTER_DEVICETREE_WASM_URL = new URL(
|
||||
"/node_modules/tree-sitter-devicetree/tree-sitter-devicetree.wasm",
|
||||
import.meta.url
|
||||
);
|
||||
|
||||
export let Devicetree: Parser.Language;
|
||||
|
||||
export async function initParser() {
|
||||
|
|
@ -17,7 +22,7 @@ export async function initParser() {
|
|||
return prefix + path;
|
||||
},
|
||||
});
|
||||
Devicetree = await Parser.Language.load("/tree-sitter-devicetree.wasm");
|
||||
Devicetree = await Parser.Language.load(TREE_SITTER_DEVICETREE_WASM_URL.href);
|
||||
}
|
||||
|
||||
export function createParser() {
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -3,6 +3,7 @@
|
|||
"include": ["src/"],
|
||||
"compilerOptions": {
|
||||
"types": ["node", "@docusaurus/theme-classic"],
|
||||
"moduleResolution": "Bundler",
|
||||
"esModuleInterop": true,
|
||||
"resolveJsonModule": true,
|
||||
"strict": true,
|
||||
|
|
|
|||
Loading…
Reference in New Issue