diff --git a/docs/package-lock.json b/docs/package-lock.json index 2b0c829c575..e76c779b960 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -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", diff --git a/docs/package.json b/docs/package.json index 58aa6a43fde..1a086def3b3 100644 --- a/docs/package.json +++ b/docs/package.json @@ -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": [ diff --git a/docs/src/components/KeymapUpgrader/styles.module.css b/docs/src/components/KeymapUpgrader/styles.module.css index 31e06b97992..f44cf323705 100644 --- a/docs/src/components/KeymapUpgrader/styles.module.css +++ b/docs/src/components/KeymapUpgrader/styles.module.css @@ -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); diff --git a/docs/src/keymap-upgrade/parser.ts b/docs/src/keymap-upgrade/parser.ts index 52d6e981235..b496d1d5a80 100644 --- a/docs/src/keymap-upgrade/parser.ts +++ b/docs/src/keymap-upgrade/parser.ts @@ -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() { diff --git a/docs/static/tree-sitter-devicetree.wasm b/docs/static/tree-sitter-devicetree.wasm deleted file mode 100644 index 885c5274ba2..00000000000 Binary files a/docs/static/tree-sitter-devicetree.wasm and /dev/null differ diff --git a/docs/tsconfig.json b/docs/tsconfig.json index e3f649ee404..b8e14486bba 100644 --- a/docs/tsconfig.json +++ b/docs/tsconfig.json @@ -3,6 +3,7 @@ "include": ["src/"], "compilerOptions": { "types": ["node", "@docusaurus/theme-classic"], + "moduleResolution": "Bundler", "esModuleInterop": true, "resolveJsonModule": true, "strict": true,