summaryrefslogtreecommitdiff
path: root/gnu/packages/node-xyz.scm
diff options
context:
space:
mode:
authorNicolas Graves <ngraves@ngraves.fr>2026-04-08 15:12:45 +0200
committerMaxim Cournoyer <maxim@guixotic.coop>2026-08-27 10:59:21 +0900
commitcb72757b4e62b66d725e6888e404c06cefd4d079 (patch)
treeaa5c5a538d8c10c5ddb3ab3455771d7daebc4b40 /gnu/packages/node-xyz.scm
parent920a214e90127dae0127f25bb6d269dd5f067d65 (diff)
gnu: node-minipass: Fix and improve style.
The matched "format" variable overrides the guile format procedure. * gnu/packages/node-xyz.scm (node-minipass) [source]: Improve style. [arguments]: Improve style. <#:modules>: Add (srfi srfi-26). <#:phases>: Rewrite and fix 'build phase. Change-Id: I7e59143f8aad3870cd5fee98e253555b644c5b77 Signed-off-by: Jelle Licht <jlicht@fsfe.org>
Diffstat (limited to 'gnu/packages/node-xyz.scm')
-rw-r--r--gnu/packages/node-xyz.scm66
1 files changed, 34 insertions, 32 deletions
diff --git a/gnu/packages/node-xyz.scm b/gnu/packages/node-xyz.scm
index 8ef1c11116c..839e6637b63 100644
--- a/gnu/packages/node-xyz.scm
+++ b/gnu/packages/node-xyz.scm
@@ -2330,21 +2330,25 @@ This is not a through or through2 stream. It doesn't transform the data, it just
2330 (package 2330 (package
2331 (inherit node-minipass-5) 2331 (inherit node-minipass-5)
2332 (version "7.1.2") 2332 (version "7.1.2")
2333 (source (origin 2333 (name "node-minipass")
2334 (method git-fetch) 2334 (source
2335 (uri (git-reference 2335 (origin
2336 (url (git-reference-url (origin-uri (package-source node-minipass-5)))) 2336 (method git-fetch)
2337 (commit (string-append "v" version)))) 2337 (uri (git-reference
2338 (file-name (git-file-name (package-name node-minipass-5) version)) 2338 (url "https://github.com/isaacs/minipass")
2339 (sha256 (base32 "0zqnnw9ibwm660md1pfqsiwbbpbizydiwjp4fr8niyzczxk66k1j")))) 2339 (commit (string-append "v" version))))
2340 ; Use ESBuild because this is used to build Typescript. 2340 (file-name (git-file-name name version))
2341 (sha256
2342 (base32 "0zqnnw9ibwm660md1pfqsiwbbpbizydiwjp4fr8niyzczxk66k1j"))))
2343 ;; Use ESBuild because this is used to build Typescript.
2341 (native-inputs (list esbuild)) 2344 (native-inputs (list esbuild))
2342 (arguments (list 2345 (arguments
2343 #:modules '( 2346 (list
2344 (guix build node-build-system)
2345 (guix build utils)
2346 (ice-9 match))
2347 #:tests? #f ; FIXME: Tests require 'tap'. 2347 #:tests? #f ; FIXME: Tests require 'tap'.
2348 #:modules '((guix build node-build-system)
2349 (guix build utils)
2350 (ice-9 match)
2351 (srfi srfi-26))
2348 #:phases 2352 #:phases
2349 #~(modify-phases %standard-phases 2353 #~(modify-phases %standard-phases
2350 (add-before 'patch-dependencies 'modify-package 2354 (add-before 'patch-dependencies 'modify-package
@@ -2354,30 +2358,28 @@ This is not a through or through2 stream. It doesn't transform the data, it just
2354 (delete-json-fields (list "scripts.prepare"))))) 2358 (delete-json-fields (list "scripts.prepare")))))
2355 (replace 'build 2359 (replace 'build
2356 (lambda _ 2360 (lambda _
2357 (define output "output")
2358 (for-each 2361 (for-each
2359 (match-lambda 2362 (match-lambda
2360 ((format directory type) 2363 ((esbuild-format directory type)
2361 (define target-output (string-append output "/dist/" directory)) 2364 (let ((target-output (string-append "output/dist/"
2362 (invoke "esbuild" 2365 directory)))
2363 "src/index.ts" 2366 (invoke "esbuild"
2364 "--platform=node" 2367 "src/index.ts"
2365 "--target=es2022" 2368 "--platform=node"
2366 (string-append "--format=" format) 2369 "--target=es2022"
2367 "--jsx=transform" 2370 (string-append "--format=" esbuild-format)
2368 "--sourcemap" 2371 "--jsx=transform"
2369 (string-append "--outdir=" target-output)) 2372 "--sourcemap"
2370 (call-with-output-file 2373 (string-append "--outdir=" target-output))
2371 (string-append target-output "/package.json") 2374 (call-with-output-file (string-append target-output
2372 (lambda (port) 2375 "/package.json")
2373 (format port "{type: ~s}" type))))) 2376 (cut format <> "{type: ~s}" type)))))
2374 (list 2377 (list
2375 (list "cjs" "commonjs" "commonjs") 2378 (list "cjs" "commonjs" "commonjs")
2376 (list "esm" "esm" "module"))) 2379 (list "esm" "esm" "module")))
2377 (for-each 2380 (for-each (cut install-file <> "output")
2378 (lambda (file) (install-file file output)) 2381 (list "LICENSE" "package.json" "README.md"))
2379 (list "LICENSE" "package.json" "README.md")) 2382 (chdir "output"))))))))
2380 (chdir output))))))))
2381 2383
2382(define-public node-mkdirp 2384(define-public node-mkdirp
2383 (package 2385 (package