Subject: [PATCH v5 04/10] gnu: tree-sitter-javascript: Update to 0.20.0-22.f772967.

From: Hilton Chain <[email-masked]>
Date: Thu, 19 Oct 2023 23:44:30 +0800

* gnu/packages/tree-sitter.scm (tree-sitter-javascript): Update to
0.20.0-22.f772967.
[#:get-cleanup-snippet]: Remove tree-sitter-javascript.wasm binary.
---
 gnu/packages/tree-sitter.scm | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/tree-sitter.scm b/gnu/packages/tree-sitter.scm
index dcb3d5506e..51afe91631 100644
--- a/gnu/packages/tree-sitter.scm
+++ b/gnu/packages/tree-sitter.scm
@@ -317,11 +317,29 @@ (define-public tree-sitter-html
    "0.19.0"))
 
 (define-public tree-sitter-javascript
+  ;; Commit required by tree-sitter-typescript 0.20.3.
+  (let ((commit "f772967f7b7bc7c28f845be2420a38472b16a8ee")
+        (revision "22"))
   (tree-sitter-grammar
    "javascript" "JavaScript(JSX)"
-   "175yrk382n2di0c2xn4gpv8y4n83x1lg4hqn04vabf0yqynlkq67"
-   "0.20.0"
-   #:commit "rust-0.20.0"))
+   "0vp7z57scpbcvyxpya06lnpz9f5kjdb66wjlkrp684xwjjgq1wxd"
+   (git-version "0.20.0" revision commit)
+   #:commit commit
+   #:get-cleanup-snippet
+   (lambda (grammar-directories)
+     #~(begin
+         (use-modules (guix build utils))
+         (delete-file "tree-sitter-javascript.wasm")
+         (delete-file "binding.gyp")
+         (delete-file-recursively "bindings")
+         (for-each
+          (lambda (lang)
+            (with-directory-excursion lang
+              (delete-file "src/grammar.json")
+              (delete-file "src/node-types.json")
+              (delete-file "src/parser.c")
+              (delete-file-recursively "src/tree_sitter")))
+          '#$grammar-directories))))))
 
 (define-public tree-sitter-typescript
   (tree-sitter-grammar
-- 
2.41.0