[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#67019] [PATCH v2 13/16] gnu: js-commander: Install as a node module
From: |
Philip McGrath |
Subject: |
[bug#67019] [PATCH v2 13/16] gnu: js-commander: Install as a node module. |
Date: |
Thu, 16 Nov 2023 14:15:51 -0500 |
Previously, NPM would not find 'commander' when resolving dependencies.
In case anyone is using it, keep building the bundled version at
'share/javascript/commander/index.min.js', too.
* gnu/packages/javascript.scm (js-commander)[build-system]: Use
'node-build-system'.
[arguments]: Delete unpackaged 'devDependencies'. Build bundle for
compatibility.
---
gnu/packages/javascript.scm | 52 ++++++++++++++++++++++++++-----------
1 file changed, 37 insertions(+), 15 deletions(-)
diff --git a/gnu/packages/javascript.scm b/gnu/packages/javascript.scm
index c62b23a4c4..97cb3b6270 100644
--- a/gnu/packages/javascript.scm
+++ b/gnu/packages/javascript.scm
@@ -7,6 +7,7 @@
;;; Copyright © 2021 Pierre Neidhardt <mail@ambrevar.xyz>
;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2022 Frank Pursel <frank.pursel@gmail.com>
+;;; Copyright © 2023 Philip McGrath <philip@philipmcgrath.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -42,6 +43,7 @@ (define-module (gnu packages javascript)
#:use-module (guix build-system cmake)
#:use-module (guix build-system gnu)
#:use-module (guix build-system minify)
+ #:use-module (guix build-system node)
#:use-module (guix build-system trivial)
#:use-module (guix utils))
@@ -384,22 +386,42 @@ (define-public js-commander
(sha256
(base32
"1xwh85kbxj76ni41r2h0apl8mjbfcnmxzzp3vlspq30w8kwfckni"))))
- (build-system trivial-build-system)
+ (build-system node-build-system)
(arguments
- `(#:modules ((guix build utils))
- #:builder
- (begin
- (use-modules (guix build utils))
- (chdir (assoc-ref %build-inputs "source"))
- (let ((esbuild (search-input-file %build-inputs "/bin/esbuild"))
- (target (string-append %output "/share/javascript/commander")))
- (invoke esbuild
- "--bundle"
- "--minify"
- "--tsconfig=tsconfig.json"
- "--platform=node"
- (string-append "--outfile=" target "/index.min.js")
- "index.js")))))
+ (list
+ #:tests? #f ; many more dependencies
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'patch-dependencies 'delete-dependencies
+ (lambda args
+ (delete-dependencies `(;; devDependencies
+ "@types/jest"
+ "@types/node"
+ "@typescript-eslint/eslint-plugin"
+ "@typescript-eslint/parser"
+ "eslint"
+ "eslint-config-standard"
+ "eslint-config-standard-with-typescript"
+ "eslint-plugin-import"
+ "eslint-plugin-jest"
+ "eslint-plugin-n"
+ "eslint-plugin-promise"
+ "jest"
+ "ts-jest"
+ "tsd"
+ "typescript"))))
+ (add-after 'install 'install-compat
+ (lambda args
+ ;; This is what this package built before adopting
+ ;; node-build-system. Does anything use it?
+ (invoke "esbuild"
+ "--bundle"
+ "--minify"
+ "--platform=node"
+ (string-append "--outfile="
+ #$output
+
"/share/javascript/commander/index.min.js")
+ "index.js"))))))
(native-inputs
(list esbuild))
(home-page "https://github.com/tj/commander.js")
--
2.41.0
- [bug#67019] [PATCH 03/16] gnu: Add lessc., (continued)
- [bug#67019] [PATCH 03/16] gnu: Add lessc., Liliana Marie Prikler, 2023/11/16
- [bug#67019] [PATCH v2 00/16] gnu: Add KaTeX, lessc, and flow-remove-types., Philip McGrath, 2023/11/16
- [bug#67019] [PATCH v2 02/16] gnu: Add node-copy-anything., Philip McGrath, 2023/11/16
- [bug#67019] [PATCH v2 03/16] gnu: Add lessc., Philip McGrath, 2023/11/16
- [bug#67019] [PATCH v2 01/16] gnu: Add node-is-what., Philip McGrath, 2023/11/16
- [bug#67019] [PATCH v2 11/16] gnu: Add flow-remove-types., Philip McGrath, 2023/11/16
- [bug#67019] [PATCH v2 04/16] gnu: Add ocaml-wtf8., Philip McGrath, 2023/11/16
- [bug#67019] [PATCH v2 05/16] gnu: Add ocaml-visitors., Philip McGrath, 2023/11/16
- [bug#67019] [PATCH v2 06/16] gnu: Add ocaml-ppx-gen-rec., Philip McGrath, 2023/11/16
- [bug#67019] [PATCH v2 12/16] gnu: js-commander: Update to 11.1.0., Philip McGrath, 2023/11/16
- [bug#67019] [PATCH v2 13/16] gnu: js-commander: Install as a node module.,
Philip McGrath <=
- [bug#67019] [PATCH v2 14/16] gnu: Add mftrace., Philip McGrath, 2023/11/16
- [bug#67019] [PATCH v2 08/16] gnu: Add node-vlq., Philip McGrath, 2023/11/16
- [bug#67019] [PATCH v2 10/16] gnu: Add node-flow-parser., Philip McGrath, 2023/11/16
- [bug#67019] [PATCH v2 09/16] gnu: Add ocaml-flow-parser., Philip McGrath, 2023/11/16
- [bug#67019] [PATCH v2 09/16] gnu: Add ocaml-flow-parser., Liliana Marie Prikler, 2023/11/16
- [bug#67019] [PATCH v2 07/16] gnu: Add ocaml-dtoa., Philip McGrath, 2023/11/16
- [bug#67019] [PATCH v2 15/16] gnu: Add font-katex., Philip McGrath, 2023/11/16
- [bug#67019] [PATCH v2 16/16] gnu: Add katex., Philip McGrath, 2023/11/16
[bug#67019] [PATCH 05/16] gnu: Add ocaml-visitors., Philip McGrath, 2023/11/09
[bug#67019] [PATCH 06/16] gnu: Add ocaml-ppx-gen-rec., Philip McGrath, 2023/11/09