From patchwork Thu Nov 16 19:15:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 56526 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id DC66027BBE9; Thu, 16 Nov 2023 19:17:50 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 999E427BBE2 for ; Thu, 16 Nov 2023 19:17:48 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r3hrP-0003aX-4h; Thu, 16 Nov 2023 14:17:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r3hrN-0003YS-3R for guix-patches@gnu.org; Thu, 16 Nov 2023 14:17:05 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r3hrM-0003Dv-Rr for guix-patches@gnu.org; Thu, 16 Nov 2023 14:17:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r3hrM-0003lo-JO for guix-patches@gnu.org; Thu, 16 Nov 2023 14:17:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#67019] [PATCH v2 11/16] gnu: Add flow-remove-types. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Nov 2023 19:17:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67019 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 67019@debbugs.gnu.org Cc: Philip McGrath , Liliana Marie Prikler Received: via spool by 67019-submit@debbugs.gnu.org id=B67019.170016221214428 (code B ref 67019); Thu, 16 Nov 2023 19:17:04 +0000 Received: (at 67019) by debbugs.gnu.org; 16 Nov 2023 19:16:52 +0000 Received: from localhost ([127.0.0.1]:44578 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r3hr7-0003kG-2G for submit@debbugs.gnu.org; Thu, 16 Nov 2023 14:16:52 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:60411) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r3hr2-0003iG-DD for 67019@debbugs.gnu.org; Thu, 16 Nov 2023 14:16:45 -0500 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 7F6455C016D; Thu, 16 Nov 2023 14:16:44 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 16 Nov 2023 14:16:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1700162204; x=1700248604; bh=uBxMIl98z1 QafFPnCZo1QGRCcJxaB99KsSJeQmDtnug=; b=ic6f5CHeJqHBv/ba1wOnG1bA3m /c9v1Cj4E6e6qFumlzAvd9Fqw1y3EEg/+W7kNzx3/Q6wTO1D9ValNoRxdtYzoBCb 35j99dDbhJ9U7+UVK1nT8chk4qkjDrn1S5yvjkHLzrU/AtckXYp+RFdzYKIsbEzw 2mh+3V3abl7fqjA/FzKqYKXHLRrOxTaksbyMyVl+DUpj30Og636EQmFzNOefbsse tv3yL18DtH/aiuxkoaTA65tQGfSw42Zd6WeMmDN3WH7OL5bLuxpIonBWrqgSfsMS pyTgrvjK6+u8Gk0Qu7oYl4yB5e8ABDYpmveG8XrK99OqjHfemPYtmaKsB5bQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1700162204; x= 1700248604; bh=uBxMIl98z1QafFPnCZo1QGRCcJxaB99KsSJeQmDtnug=; b=I 7XjIU/wIlifIwouSkOOH1kMOA4aZRwx+UFMVO/qQk1ebGirrndMjEFOyVmL9qAoq 45AaWfVWu9wqDctpAPUcmYN2DXztYCcdb1FZeDP1wSep/tJDGJ1e8x2+CSV2/27Y c+INtO5mtmmAKq5CT8buOYYDDzb5RBcCGAaIbhO03Epu2TCCfDVaXmkYoGYzoHRt nPLh99srVD0u579zpJnIpxxr2pVKDn37/uOhEBCFt33rNUfwXZhvl799dlCBkIve XNRIhP2Z9CyxYyHTdkwnRVgTwoHC9d5/f7+8SotU9CgrcKCq0hVFwH/65pz/CQWC CwaqHbf2frtsvlZgDjPYQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudefkedguddvtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefrhhhi lhhiphcuofgtifhrrghthhcuoehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtg homheqnecuggftrfgrthhtvghrnhepgffhgfffjeegudejvddvgedvheefveehvdffuedu udeivdfhgeeileehvdfhfeefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepphhhihhlihhpsehphhhilhhiphhmtghgrhgrthhhrdgtohhm X-ME-Proxy: Feedback-ID: i2b1146f3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 16 Nov 2023 14:16:43 -0500 (EST) From: Philip McGrath Date: Thu, 16 Nov 2023 14:15:49 -0500 Message-ID: <875d54cc655b21a748fbf0e981642475ddd94bde.1700161584.git.philip@philipmcgrath.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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")