From patchwork Thu Nov 9 16:26:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 56140 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 63A9A27BBEA; Thu, 9 Nov 2023 16:28:33 +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=ham 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 54DAB27BBE2 for ; Thu, 9 Nov 2023 16:28:32 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r17tL-00083x-Kk; Thu, 09 Nov 2023 11:28:27 -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 1r17tK-00082X-2G for guix-patches@gnu.org; Thu, 09 Nov 2023 11:28:26 -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 1r17tJ-0006Zx-Qp for guix-patches@gnu.org; Thu, 09 Nov 2023 11:28:25 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r17tv-0004fK-FC; Thu, 09 Nov 2023 11:29:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#67019] [PATCH 11/16] gnu: Add flow-remove-types. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: philip@philipmcgrath.com, julien@lepiller.eu, pukkamustard@posteo.net, guix-patches@gnu.org Resent-Date: Thu, 09 Nov 2023 16:29:03 +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 , Philip McGrath , Julien Lepiller , pukkamustard X-Debbugs-Original-Xcc: Philip McGrath , Julien Lepiller , pukkamustard Received: via spool by 67019-submit@debbugs.gnu.org id=B67019.169954728717752 (code B ref 67019); Thu, 09 Nov 2023 16:29:03 +0000 Received: (at 67019) by debbugs.gnu.org; 9 Nov 2023 16:28:07 +0000 Received: from localhost ([127.0.0.1]:48515 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r17t1-0004cA-4q for submit@debbugs.gnu.org; Thu, 09 Nov 2023 11:28:07 -0500 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:52397) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r17sx-0004a5-P7 for 67019@debbugs.gnu.org; Thu, 09 Nov 2023 11:28:04 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id F34053200A47; Thu, 9 Nov 2023 11:27:23 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 09 Nov 2023 11:27:24 -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=fm3; t=1699547243; x=1699633643; bh=5O60HOAYlT jPgPcakHiT+I7U5cLWEeogtKVlV1zaySM=; b=VYDfV2VnlVlPdTrZlfJUYsQUps pdKeJ+3QHgAAwJMZ5AnTLMRn9p1noqyOhi4F/hq4T48cVbSv2q0uc/ZH6NafZaow 6qIK6+GmEsPLfxAkBSDffSgy32ZgiqLHINRJ0tCHIX/TRTg93MgjTgW2L4n3+3gx rDJrZtn02eclKmB+W8ojlwcLDv826Q8b08IeISV5yhORGIuQd4qM5GZEltTtkZ8d atEGnh/HUA8bsLDpBimZ1EM5JfB7HjaO8nf2FMJRb5BZp9zYmZC4EDxYKLLsoy8G yBXCgkedWJ/MWC611nAWgTcD2YxgzXKBU3w91iqK7J9HyVc8XajJqr/Uf8BQ== 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=fm3; t=1699547243; x= 1699633643; bh=5O60HOAYlTjPgPcakHiT+I7U5cLWEeogtKVlV1zaySM=; b=r qryWAD/bklMv+ySLt3tAdEqBIUdem3EBALTM1I4z13PlXpso8mWJBHzT3+LJWc+x rjT7yx8S0adzv+9n+epQ1UDp+V+jV2pMQmUDVq6sGq804ZSBxgiBpadhoG6GqwxY EzThgGnunRi9KyYIkb+aV8R64ZhGCbiqxDycehpkeVPV7eZkDMK0BUE7lsIBaCh/ a6F9jamlnszzpnONi1pdPsfxwZPzkuuA30J3Xh/BqOc+slPNwXJy9yGkdeXg9Mkz MRcE6xqgrML2/vMssgD5vJk5HYmWqRM2UtoJmi9SdiZAQtQht1f11H0A37M8BnKN n6azDy4KPq/qjlAtjjSHA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedruddvuddgkeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefrhhhilhhiphcuofgtifhrrghthhcuoehphhhilhhiphes phhhihhlihhpmhgtghhrrghthhdrtghomheqnecuggftrfgrthhtvghrnhepgffhgfffje egudejvddvgedvheefveehvdffueduudeivdfhgeeileehvdfhfeefnecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhhihhlihhpsehphhhilh hiphhmtghgrhgrthhhrdgtohhm X-ME-Proxy: Feedback-ID: i2b1146f3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 9 Nov 2023 11:27:23 -0500 (EST) From: Philip McGrath Date: Thu, 9 Nov 2023 11:26:33 -0500 Message-ID: <00fd9449a17eb15c0816754c6e438fa399711573.1699540553.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 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")