unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Philip McGrath <philip@philipmcgrath.com>
To: 67019@debbugs.gnu.org
Cc: Philip McGrath <philip@philipmcgrath.com>,
	Philip McGrath <philip@philipmcgrath.com>,
	Julien Lepiller <julien@lepiller.eu>,
	pukkamustard <pukkamustard@posteo.net>
Subject: [bug#67019] [PATCH 11/16] gnu: Add flow-remove-types.
Date: Thu,  9 Nov 2023 11:26:33 -0500	[thread overview]
Message-ID: <00fd9449a17eb15c0816754c6e438fa399711573.1699540553.git.philip@philipmcgrath.com> (raw)
In-Reply-To: <cover.1699540553.git.philip@philipmcgrath.com>

* 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 0ade9e46e3..8f0295998a 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -2075,6 +2075,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





  parent reply	other threads:[~2023-11-09 16:28 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-09 16:06 [bug#67019] [PATCH 00/16] gnu: Add KaTeX, lessc, and flow-remove-types Philip McGrath
2023-11-09 16:12 ` [bug#67019] [PATCH 01/16] gnu: Add node-is-what Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 02/16] gnu: Add node-copy-anything Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 03/16] gnu: Add lessc Philip McGrath
2023-11-11  0:56   ` Liliana Marie Prikler
2023-11-15 19:35     ` Philip McGrath
2023-11-15 20:23       ` Liliana Marie Prikler
2023-11-16  0:03         ` Philip McGrath
2023-11-16  1:17           ` Liliana Marie Prikler
2023-11-16  1:51             ` Philip McGrath
2023-11-16  7:18               ` Liliana Marie Prikler
2023-11-16 19:15               ` [bug#67019] [PATCH v2 00/16] gnu: Add KaTeX, lessc, and flow-remove-types Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 01/16] gnu: Add node-is-what Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 02/16] gnu: Add node-copy-anything Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 03/16] gnu: Add lessc Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 04/16] gnu: Add ocaml-wtf8 Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 05/16] gnu: Add ocaml-visitors Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 06/16] gnu: Add ocaml-ppx-gen-rec Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 07/16] gnu: Add ocaml-dtoa Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 08/16] gnu: Add node-vlq Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 09/16] gnu: Add ocaml-flow-parser Philip McGrath
2023-11-16 20:29                   ` Liliana Marie Prikler
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 10/16] gnu: Add node-flow-parser Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 11/16] gnu: Add flow-remove-types Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 12/16] gnu: js-commander: Update to 11.1.0 Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 13/16] gnu: js-commander: Install as a node module Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 14/16] gnu: Add mftrace Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 15/16] gnu: Add font-katex Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 16/16] gnu: Add katex Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 04/16] gnu: Add ocaml-wtf8 Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 05/16] gnu: Add ocaml-visitors Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 06/16] gnu: Add ocaml-ppx-gen-rec Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 07/16] gnu: Add ocaml-dtoa Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 08/16] gnu: Add node-vlq Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 09/16] gnu: Add ocaml-flow-parser Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 10/16] gnu: Add node-flow-parser Philip McGrath
2023-11-09 16:26 ` Philip McGrath [this message]
2023-11-09 16:26 ` [bug#67019] [PATCH 12/16] gnu: js-commander: Update to 11.1.0 Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 13/16] gnu: js-commander: Install as a node module Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 14/16] gnu: Add mftrace Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 15/16] gnu: Add font-katex Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 16/16] gnu: Add katex Philip McGrath

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=00fd9449a17eb15c0816754c6e438fa399711573.1699540553.git.philip@philipmcgrath.com \
    --to=philip@philipmcgrath.com \
    --cc=67019@debbugs.gnu.org \
    --cc=julien@lepiller.eu \
    --cc=pukkamustard@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).