guix_mirror_bot pushed a commit to branch master
in repository guix.
commit 0342cecbaca859bd337af5b11e7fd4752ae05756
Author: Daniel Khodabakhsh <[email protected]>
AuthorDate: Tue Jun 24 17:20:03 2025 -0700
gnu: Add node-minimatch.
* gnu/packages/node-xyz.scm (node-minimatch): New variable.
Change-Id: Ided488ef27a54d680681d966845e6e8cee74c0f3
Signed-off-by: Andreas Enge <[email protected]>
---
gnu/packages/node-xyz.scm | 61 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 61 insertions(+)
diff --git a/gnu/packages/node-xyz.scm b/gnu/packages/node-xyz.scm
index 0066ab643f..407b62831c 100644
--- a/gnu/packages/node-xyz.scm
+++ b/gnu/packages/node-xyz.scm
@@ -1162,6 +1162,67 @@ this cache will keep that many of the most recently
accessed items.")
random number generator.")
(license license:bsd-3)))
+(define-public node-minimatch
+ (package
+ (name "node-minimatch")
+ (version "9.0.5")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/isaacs/minimatch")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256 (base32
"1m9lr4nalzml8l6lz09jmk3nhqm7jf6lkyybvdg0ccqx74si7d44"))))
+ (build-system node-build-system)
+ (inputs (list node-brace-expansion))
+ ; Use ESBuild because this is used to build Typescript.
+ (native-inputs (list esbuild))
+ (arguments (list
+ #:modules '(
+ (guix build node-build-system)
+ (guix build utils)
+ (ice-9 match))
+ #:tests? #f ; FIXME: Tests require 'tap'.
+ #:phases #~(modify-phases %standard-phases
+ (add-before 'patch-dependencies 'modify-package
+ (lambda _
+ (modify-json
+ (delete-dev-dependencies)
+ (delete-fields (list
+ "scripts.prepare")))))
+ (replace 'build
+ (lambda _
+ (define output "output")
+ (for-each
+ (match-lambda ((format directory type)
+ (define target-output (string-append output "/dist/"
directory))
+ (invoke
+ "esbuild"
+ "src/*.ts"
+ "--platform=node"
+ "--target=es2022"
+ (string-append "--format=" format)
+ "--jsx=transform"
+ "--sourcemap"
+ (string-append "--outdir=" target-output))
+ (with-output-to-file
+ (string-append target-output "/package.json")
+ (lambda _
+ (display (string-append "{\"type\": \"" type "\"}"))))))
+ (list
+ (list "cjs" "commonjs" "commonjs")
+ (list "esm" "esm" "module")))
+ (for-each
+ (lambda (file) (install-file file output))
+ (list "LICENSE" "package.json" "README.md"))
+ (chdir output))))))
+ (synopsis "A glob matcher in javascript.")
+ (description "A minimal matching utility.
+This is the matching library used internally by npm.
+It works by converting glob expressions into JavaScript RegExp objects.")
+ (home-page (git-reference-url (origin-uri source)))
+ (license license:isc)))
+
(define-public node-minimist
(package
(name "node-minimist")