From patchwork Thu Nov 16 19:15:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 56524 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 138F427BBE2; Thu, 16 Nov 2023 19:17:44 +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 EF8AD27BBE2 for ; Thu, 16 Nov 2023 19:17:41 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r3hrN-0003Yf-M7; Thu, 16 Nov 2023 14:17: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 1r3hrL-0003Xm-9a for guix-patches@gnu.org; Thu, 16 Nov 2023 14:17: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 1r3hrL-0003DU-1A for guix-patches@gnu.org; Thu, 16 Nov 2023 14:17:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r3hrK-0003lJ-Oe for guix-patches@gnu.org; Thu, 16 Nov 2023 14:17:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#67019] [PATCH v2 02/16] gnu: Add node-copy-anything. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Nov 2023 19:17:02 +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.170016220614349 (code B ref 67019); Thu, 16 Nov 2023 19:17:02 +0000 Received: (at 67019) by debbugs.gnu.org; 16 Nov 2023 19:16:46 +0000 Received: from localhost ([127.0.0.1]:44540 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r3hr2-0003j3-So for submit@debbugs.gnu.org; Thu, 16 Nov 2023 14:16:45 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:50323) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r3hqz-0003i7-Hm for 67019@debbugs.gnu.org; Thu, 16 Nov 2023 14:16:41 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 998025C00A7; Thu, 16 Nov 2023 14:16:36 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 16 Nov 2023 14:16:36 -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=1700162196; x=1700248596; bh=wTfCkR6nx9 494RMShtidiWRHC466SgApjQMOOyLBocE=; b=YHTINx5ikPTnZ77/DPYCDGESyz VqEh1vwf1HFeyHSs5/ShnqguT6NNzVhKozYRsX3C3jaNGEuJPV0HpuoHt6WguIUP faiQl1BKPuY3X9rKCMqCpSjrFnqIk3BSotocExI/1SFpTpbuiW7FMC+XMtUCCQ40 5k3MuNA3lq8sSbkQNGL1tYZrd6a/hc+xrUXef/iO+wdvk7rsFFNLfQWN3R6eCQmP //1GC/UloRuC5fjAzP3wi7ufP1KyRfM+2Xz4K7aXdOYYDhrfyT9CsV5IVzJxwqBL HWPPlSY+KVF576iiSmdNc4OJWG/NqpR66QZpXPDI9Ew9altk8M6xDDEeszKQ== 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=1700162196; x= 1700248596; bh=wTfCkR6nx9494RMShtidiWRHC466SgApjQMOOyLBocE=; b=v Tk6ODXQf8AHwGUrA/M/ubvcxaVXTraKezOFJPKlTcpvRjNGTw/M2Bgmt4U9fGB4b tE7vpqFMf6Y7xNbT55Dm9CGilBpmSX8yv2EfS085HVEzH0DWFAMvJoaQMstNGsIA 2/Qp6xxipfL/wJa7PXDd1KIEFLAphbYzX2Flw4oGjE4FcOfPQvUAxzoH0eB9+Ia2 KrCiDt6ijdzLKcaJDxmq4WYDjmVPRjeTgIBirMcTCJNbeHvZ5Bz6yV26KnzQ7RSp +6QDo82inkjOVcAUe42P1uRcd5XubHmBkDAHMOvSTv4u0AoqL5NGtCrcrpeW7c5J cMhhdaGOKLIxwFvzkGvTw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudefkedguddvtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefrhhhi lhhiphcuofgtifhrrghthhcuoehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtg homheqnecuggftrfgrthhtvghrnhepgfevgfeljeekgefhgeeigfdvhfeukefgvdduieeg tdetvdfhvdffjeeggfduffeknecuffhomhgrihhnpehgihhthhhusgdrtghomhdpnhhpmh hjshdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhr ohhmpehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomh X-ME-Proxy: Feedback-ID: i2b1146f3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 16 Nov 2023 14:16:35 -0500 (EST) From: Philip McGrath Date: Thu, 16 Nov 2023 14:15:40 -0500 Message-ID: <5bfba55639dc6d855faf260358c25c37aa34b3de.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/node-xyz.scm (node-copy-anything): New variable. --- gnu/packages/node-xyz.scm | 81 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/gnu/packages/node-xyz.scm b/gnu/packages/node-xyz.scm index 49760ded2b..ee96dee767 100644 --- a/gnu/packages/node-xyz.scm +++ b/gnu/packages/node-xyz.scm @@ -1712,3 +1712,84 @@ (define-public node-is-what functions for JavaScript, such as @code{isString}, @code{isDate}, and @code{isPlainObject}.") (license license:expat))) + +(define-public node-copy-anything + (package + (name "node-copy-anything") + (version "3.0.5") + (source + (origin (method git-fetch) + (uri (git-reference + (url "https://github.com/mesqueeb/copy-anything") + (commit (string-append "v" version)))) + (sha256 + (base32 "1lpjqanjl04k088banpns4yvp6hgf97snaj7gfbfancjpd3i8gk6")) + (snippet + #~(for-each delete-file + '("dist/cjs/index.cjs" + "dist/index.js"))) + (file-name (git-file-name name version)))) + (build-system node-build-system) + (native-inputs (list esbuild)) + (inputs (list node-is-what)) + (arguments + (list + #:tests? #f ; needs more dependencies + #:modules + `((guix build node-build-system) + (ice-9 match) + (guix build utils)) + #:phases + #~(modify-phases %standard-phases + (add-after 'patch-dependencies 'delete-dependencies + (lambda args + (delete-dependencies + '(;; devDependencies + "@typescript-eslint/eslint-plugin" + "@typescript-eslint/parser" + "del-cli" + "eslint" + "eslint-config-prettier" + "eslint-plugin-tree-shaking" + "np" + "prettier" + "rollup" + "rollup-plugin-dts" + "rollup-plugin-esbuild" + "rollup-plugin-typescript2" + "typescript" + "vitest")))) + (add-after 'delete-dependencies 'patch-build-script + (lambda args + (define esbuild + "esbuild --bundle --platform=node --external:is-what") + (define new-build-script + (string-append + esbuild + " --format=cjs --outfile=dist/cjs/index.cjs src/index.ts" + " && " + esbuild + " --format=esm --outfile=dist/index.js src/index.ts")) + (with-atomic-json-file-replacement "package.json" + (match-lambda + (('@ . alist) + (cons '@ + (map (match-lambda + (("scripts" @ . alist) + `("scripts" @ ,@(map (match-lambda + (("build" . _) + (cons "build" + new-build-script)) + (other + other)) + alist))) + (other + other)) + alist)))))))))) + (home-page "https://npmjs.com/copy-anything") + (synopsis "JavaScript library for copying objects and arrays") + (description "This library provides deep copying for JavaScript objects +and arrays. Its design emphasizes speed, simplicity, and correctness in the +face of complications like special objects, symbols, and non-enumerable +properties.") + (license license:expat)))