From patchwork Thu Nov 16 19:15:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 56527 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 0FB5B27BBE9; Thu, 16 Nov 2023 19:18:09 +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 9700027BBE2 for ; Thu, 16 Nov 2023 19:18:07 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r3hsL-0004MU-31; Thu, 16 Nov 2023 14:18:05 -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 1r3hsJ-0004LY-Un for guix-patches@gnu.org; Thu, 16 Nov 2023 14:18:03 -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 1r3hsJ-0004Wg-MA for guix-patches@gnu.org; Thu, 16 Nov 2023 14:18:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r3hsJ-0003os-E7 for guix-patches@gnu.org; Thu, 16 Nov 2023 14:18:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#67019] [PATCH v2 13/16] gnu: js-commander: Install as a node module. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Nov 2023 19:18: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 , Liliana Marie Prikler Received: via spool by 67019-submit@debbugs.gnu.org id=B67019.170016223014547 (code B ref 67019); Thu, 16 Nov 2023 19:18:03 +0000 Received: (at 67019) by debbugs.gnu.org; 16 Nov 2023 19:17:10 +0000 Received: from localhost ([127.0.0.1]:44597 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r3hrR-0003mT-DM for submit@debbugs.gnu.org; Thu, 16 Nov 2023 14:17:09 -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 1r3hr3-0003iG-VQ for 67019@debbugs.gnu.org; Thu, 16 Nov 2023 14:16:46 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 14CB35C00D1; Thu, 16 Nov 2023 14:16:46 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 16 Nov 2023 14:16:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:cc:content-transfer-encoding :content-type: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=1700162206; x=1700248606; bh=Ki Wcea6wn/K24MSCD0fOryDe70WTqDSaNudxaoHqdSk=; b=ZvjohQt5pWNhV/O+Am V+oR0BB6mUGyZF1owTlpwHaQrDqDnqIs+toIErD/QdjtELn8qdLMcsE4jkFr9s1C 9saGhxc+D0cYieQ15LkiJceVwggvdoKGHh3QXg63vyzPOsoNh+uMouwoofvNvd9B hEzOyrRY77HqUivZHlVYO1Zad4Kf3MhW1ciBhrqlNEDl9fG500A32QPdysJTq/Bj 3xLBKoariwoeRMm4a4dUe+4ewovjMBz0rW1aNuWVFkA3jzgcMHUYRLu4SUYk18gv stQkzRfsGlWrbM2WE6xw5ZbdJpMooFY/GNpZeo/r8Y6u2rTsPm2Nv327fQ8pxrGU 2VQQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type: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= 1700162206; x=1700248606; bh=KiWcea6wn/K24MSCD0fOryDe70WTqDSaNud xaoHqdSk=; b=ahR49F/Jq2WrUmfNXACtNb+WjVlV1LsuDdbsCbUUcXe7i1eb6Xi G6pb9o/JH6UHp8vaq6ySzX4IPzlESgQnMUn341Uq6rHxXa1wBDknh846bHFmOpMh OuKYdRcjf8RkeNzUMGXxB0YhibutE/X5nm54/EfHUGg5gFXNOLY/dhkDq7V/QdBg oL9gjuqrMZpPC+50D2+gjLDNWp2NQsIjAB4EAYctaeM1bbsGrq9cx13bSnc/wRo2 CfveGS5TPiagjmUvQVPmuVKHjNj+4NKpvsaLz4NUcpA7x4LLnPgvKw4djhMo9uoO sD4FUS9Z8d+upryjBwCn3JuFkLzL3Vc1bgg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudefkedguddvtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enfghrlhcuvffnffculdefhedmnecujfgurhephffvvefufffkofgjfhggtgfgsehtkeer tdertdejnecuhfhrohhmpefrhhhilhhiphcuofgtifhrrghthhcuoehphhhilhhiphesph hhihhlihhpmhgtghhrrghthhdrtghomheqnecuggftrfgrthhtvghrnhepgefguefgfedt vdejhfettdeuvdduheehgeevvdekgfelvefffedthffhkeetgeffnecuffhomhgrihhnpe hgihhthhhusgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgr ihhlfhhrohhmpehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomh X-ME-Proxy: Feedback-ID: i2b1146f3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 16 Nov 2023 14:16:45 -0500 (EST) From: Philip McGrath Date: Thu, 16 Nov 2023 14:15:51 -0500 Message-ID: <2dbd50a275174556a071bc7047823c80fa20ee67.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 Previously, NPM would not find 'commander' when resolving dependencies. In case anyone is using it, keep building the bundled version at 'share/javascript/commander/index.min.js', too. * gnu/packages/javascript.scm (js-commander)[build-system]: Use 'node-build-system'. [arguments]: Delete unpackaged 'devDependencies'. Build bundle for compatibility. --- gnu/packages/javascript.scm | 52 ++++++++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 15 deletions(-) diff --git a/gnu/packages/javascript.scm b/gnu/packages/javascript.scm index c62b23a4c4..97cb3b6270 100644 --- a/gnu/packages/javascript.scm +++ b/gnu/packages/javascript.scm @@ -7,6 +7,7 @@ ;;; Copyright © 2021 Pierre Neidhardt ;;; Copyright © 2021 Maxim Cournoyer ;;; Copyright © 2022 Frank Pursel +;;; Copyright © 2023 Philip McGrath ;;; ;;; This file is part of GNU Guix. ;;; @@ -42,6 +43,7 @@ (define-module (gnu packages javascript) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) #:use-module (guix build-system minify) + #:use-module (guix build-system node) #:use-module (guix build-system trivial) #:use-module (guix utils)) @@ -384,22 +386,42 @@ (define-public js-commander (sha256 (base32 "1xwh85kbxj76ni41r2h0apl8mjbfcnmxzzp3vlspq30w8kwfckni")))) - (build-system trivial-build-system) + (build-system node-build-system) (arguments - `(#:modules ((guix build utils)) - #:builder - (begin - (use-modules (guix build utils)) - (chdir (assoc-ref %build-inputs "source")) - (let ((esbuild (search-input-file %build-inputs "/bin/esbuild")) - (target (string-append %output "/share/javascript/commander"))) - (invoke esbuild - "--bundle" - "--minify" - "--tsconfig=tsconfig.json" - "--platform=node" - (string-append "--outfile=" target "/index.min.js") - "index.js"))))) + (list + #:tests? #f ; many more dependencies + #:phases + #~(modify-phases %standard-phases + (add-after 'patch-dependencies 'delete-dependencies + (lambda args + (delete-dependencies `(;; devDependencies + "@types/jest" + "@types/node" + "@typescript-eslint/eslint-plugin" + "@typescript-eslint/parser" + "eslint" + "eslint-config-standard" + "eslint-config-standard-with-typescript" + "eslint-plugin-import" + "eslint-plugin-jest" + "eslint-plugin-n" + "eslint-plugin-promise" + "jest" + "ts-jest" + "tsd" + "typescript")))) + (add-after 'install 'install-compat + (lambda args + ;; This is what this package built before adopting + ;; node-build-system. Does anything use it? + (invoke "esbuild" + "--bundle" + "--minify" + "--platform=node" + (string-append "--outfile=" + #$output + "/share/javascript/commander/index.min.js") + "index.js")))))) (native-inputs (list esbuild)) (home-page "https://github.com/tj/commander.js")