[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#67019] [PATCH v2 11/16] gnu: Add flow-remove-types.
From: |
Philip McGrath |
Subject: |
[bug#67019] [PATCH v2 11/16] gnu: Add flow-remove-types. |
Date: |
Thu, 16 Nov 2023 14:15:49 -0500 |
* gnu/packages/web.scm (flow-remove-types): New variable.
---
gnu/packages/web.scm | 60 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 60 insertions(+)
diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index b8646e9d0d..f5afb453f9 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -2076,6 +2076,66 @@ (define-public node-flow-parser
provides the Flow parser in its compiled-to-JavaScript form for use with
Node.js and NPM.")))
+(define-public flow-remove-types
+ (package
+ (inherit node-flow-parser)
+ (name "flow-remove-types")
+ (inputs (list node-flow-parser node-vlq))
+ (arguments
+ (list
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'delete-workspace-file
+ (lambda args
+ ;; this workspace file causes NPM to try to install dependencies
+ ;; of other packages developed in this source repository
+ (delete-file "package.json")))
+ (add-after 'delete-workspace-file 'chdir
+ (lambda args
+ (chdir "packages/flow-remove-types")))
+ (add-after 'patch-dependencies 'delete-dependencies
+ (lambda args
+ (delete-dependencies '("pirates"))))
+ (add-after 'delete-dependencies 'remove-unsupported-features
+ (lambda args
+ (delete-file "register.js")
+ (with-output-to-file "register.js"
+ (lambda ()
+ (for-each
+ display
+ '("console.warn('flow-remove-types/register.js does not add"
+ " a require hook on Guix');\n"
+ "module.exports ="
+ " function setOptions(newOptions) {};\n"))))
+ (substitute* "flow-node"
+ (("var flowRemoveTypes")
+ (string-append
+ "process.stderr.write('flow-node: not yet supported"
+ " on Guix');\n"
+ "return process.exit(1);\n"
+ "var flowRemoveTypes")))
+ (substitute* "test.sh"
+ (("echo \"Test: node require hook\"")
+ "echo \"SKIPPING Test: node require hook\"")
+ (("RES=\\$[(]node -e 'require[(]\"\\./register\"[)];")
+ "RES=42 # ")
+ (("echo \"Test: flow-node\"")
+ "echo \"SKIPPING Test: flow-node\"")
+ (("FLOW_NODE=")
+ "FLOW_NODE=42 # ")
+ (("echo \"Test: flow-node with options\"")
+ "echo \"SKIPPING Test: flow-node with options\"")
+ (("FLOW_NODE_OPTS=")
+ "FLOW_NODE_OPTS=4 # ")))))))
+ (synopsis "Utility to erase Flow type annotations from JavaScript")
+ (description "Flow is a gradual type system for JavaScript. This package
+provides @command{flow-remove-types}, a command-line tool that erases Flow
+type annotations, producing standard JavaScript files. The functionality is
+also provided as a JavaScript library.
+
+Note that the Guix package does not yet support the @command{flow-node}
+command or the Node.js require hook for interactive development.")))
+
(define-public tinyproxy
(package
(name "tinyproxy")
--
2.41.0
- [bug#67019] [PATCH 03/16] gnu: Add lessc., (continued)
- [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, 2023/11/16
- [bug#67019] [PATCH v2 11/16] gnu: Add flow-remove-types.,
Philip McGrath <=
- [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
- [bug#67019] [PATCH v2 09/16] gnu: Add ocaml-flow-parser., Liliana Marie Prikler, 2023/11/16