From ba17fba7784e7ce10264553f3d05c2345a8ccc21 Mon Sep 17 00:00:00 2001 From: Charles Ancheta <55412395+cbebe@users.noreply.github.com> Date: Sat, 28 Sep 2024 19:09:01 -0600 Subject: [PATCH] Add WASM build target for tree-sitter-fysh --- pkg/tree-sitter-fysh/package.json | 22 +++++++++++++++++++++- pkg/vscode-fysh/package.json | 4 +++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/pkg/tree-sitter-fysh/package.json b/pkg/tree-sitter-fysh/package.json index c76ca26..3afc430 100644 --- a/pkg/tree-sitter-fysh/package.json +++ b/pkg/tree-sitter-fysh/package.json @@ -47,5 +47,25 @@ "install": "node-gyp-build", "prebuildify": "prebuildify --napi --strip" }, - "nx": {} + "nx": { + "targets": { + "build": { + "inputs": [ + "{projectRoot}/grammar.js" + ], + "outputs": [ + "{projectRoot}/build/tree_sitter_fysh.wasm" + ], + "executor": "nx:run-commands", + "options": { + "inputs": [ + "ignore" + ], + "cwd": "{projectRoot}", + "command": "tree-sitter build --wasm -o build/tree_sitter_fysh.wasm" + }, + "cache": true + } + } + } } diff --git a/pkg/vscode-fysh/package.json b/pkg/vscode-fysh/package.json index 086e5a3..ec32249 100644 --- a/pkg/vscode-fysh/package.json +++ b/pkg/vscode-fysh/package.json @@ -184,5 +184,7 @@ "mocha": "^10.3.0", "typescript": "^5.3.3" }, - "nx": {} + "nx": { + "implicitDependencies": ["tree-sitter-fysh"] + } }