GNU bug report logs - #67019
[PATCH 00/16] gnu: Add KaTeX, lessc, and flow-remove-types.

Previous Next

Package: guix-patches;

Reported by: Philip McGrath <philip <at> philipmcgrath.com>

Date: Thu, 9 Nov 2023 16:09:02 UTC

Severity: normal

Tags: patch

Full log


View this message in rfc822 format

From: Philip McGrath <philip <at> philipmcgrath.com>
To: 67019 <at> debbugs.gnu.org
Cc: Philip McGrath <philip <at> philipmcgrath.com>, Liliana Marie Prikler <liliana.prikler <at> gmail.com>
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





This bug report was last modified 1 year and 216 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.