[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#67019] [PATCH v2 01/16] gnu: Add node-is-what.
From: |
Philip McGrath |
Subject: |
[bug#67019] [PATCH v2 01/16] gnu: Add node-is-what. |
Date: |
Thu, 16 Nov 2023 14:15:39 -0500 |
* gnu/packages/node-xyz.scm (node-is-what): New variable.
---
gnu/packages/node-xyz.scm | 81 +++++++++++++++++++++++++++++++++++++++
1 file changed, 81 insertions(+)
diff --git a/gnu/packages/node-xyz.scm b/gnu/packages/node-xyz.scm
index 6c16417309..49760ded2b 100644
--- a/gnu/packages/node-xyz.scm
+++ b/gnu/packages/node-xyz.scm
@@ -1631,3 +1631,84 @@ (define-public node-yazl
@item Prefer to open input files one at a time than all at once.
@end enumerate")
(license license:expat)))
+
+(define-public node-is-what
+ (package
+ (name "node-is-what")
+ (version "4.1.16")
+ (source
+ (origin (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mesqueeb/is-what")
+ (commit (string-append "v" version))))
+ (sha256
+ (base32 "02h76klvjxgk0cl8a7sq4wbi7l4pvdimbams08l34k5carg03bdx"))
+ (snippet
+ #~(for-each delete-file
+ '("dist/cjs/index.cjs"
+ "dist/index.js")))
+ (file-name (git-file-name name version))))
+ (build-system node-build-system)
+ (native-inputs (list esbuild))
+ (arguments
+ (list
+ #:tests? #f ; needs more dependencies
+ #:modules
+ `((guix build node-build-system)
+ (ice-9 match)
+ (guix build utils))
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'patch-dependencies 'delete-dependencies
+ (lambda args
+ (delete-dependencies
+ '(;; devDependencies
+ "@typescript-eslint/eslint-plugin"
+ "@typescript-eslint/parser"
+ "del-cli"
+ "eslint"
+ "eslint-config-prettier"
+ "eslint-plugin-tree-shaking"
+ "np"
+ "prettier"
+ "prettier-plugin-jsdoc"
+ "rollup"
+ "rollup-plugin-dts"
+ "rollup-plugin-esbuild"
+ "rollup-plugin-typescript2"
+ "typedoc"
+ "typescript"
+ "vitest"))))
+ (add-after 'delete-dependencies 'patch-build-script
+ (lambda args
+ (define esbuild
+ "esbuild --bundle --platform=node")
+ (define new-build-script
+ (string-append
+ esbuild
+ " --format=cjs --outfile=dist/cjs/index.cjs src/index.ts"
+ " && "
+ esbuild
+ " --format=esm --outfile=dist/index.js src/index.ts"))
+ (with-atomic-json-file-replacement "package.json"
+ (match-lambda
+ (('@ . alist)
+ (cons '@
+ (map (match-lambda
+ (("scripts" @ . alist)
+ `("scripts" @ ,@(map (match-lambda
+ (("build" . _)
+ (cons "build"
+ new-build-script))
+ (other
+ other))
+ alist)))
+ (other
+ other))
+ alist))))))))))
+ (home-page "https://npmjs.com/is-what")
+ (synopsis "Type predicate functions for JavaScript")
+ (description "This package provides simple and small type predicate
+functions for JavaScript, such as @code{isString}, @code{isDate}, and
+@code{isPlainObject}.")
+ (license license:expat)))
--
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/10
- [bug#67019] [PATCH 03/16] gnu: Add lessc., Philip McGrath, 2023/11/15
- [bug#67019] [PATCH 03/16] gnu: Add lessc., Liliana Marie Prikler, 2023/11/15
- [bug#67019] [PATCH 03/16] gnu: Add lessc., Philip McGrath, 2023/11/15
- [bug#67019] [PATCH 03/16] gnu: Add lessc., Liliana Marie Prikler, 2023/11/15
- [bug#67019] [PATCH 03/16] gnu: Add lessc., Philip McGrath, 2023/11/15
- [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 <=
- [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, 2023/11/16
- [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