From patchwork Thu Dec 30 07:39:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 35790 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 607A027BBEA; Thu, 30 Dec 2021 07:46:10 +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,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, 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 E0C4B27BBE9 for ; Thu, 30 Dec 2021 07:46:09 +0000 (GMT) Received: from localhost ([::1]:58514 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2q8W-0002vZ-Dv for patchwork@mira.cbaines.net; Thu, 30 Dec 2021 02:46:09 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54326) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2q6Y-0001Ap-TO for guix-patches@gnu.org; Thu, 30 Dec 2021 02:44:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:39542) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2q6Y-0001o8-JG for guix-patches@gnu.org; Thu, 30 Dec 2021 02:44:06 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n2q6Y-0006jS-IA for guix-patches@gnu.org; Thu, 30 Dec 2021 02:44:06 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51838] [PATCH v6 26/41] gnu: Add node-file-uri-to-path. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 30 Dec 2021 07:44:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51838 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 51838@debbugs.gnu.org Cc: Timothy Sample , Pierre Langlois , Jelle Licht , Philip McGrath , Liliana Marie Prikler Received: via spool by 51838-submit@debbugs.gnu.org id=B51838.164085020425645 (code B ref 51838); Thu, 30 Dec 2021 07:44:06 +0000 Received: (at 51838) by debbugs.gnu.org; 30 Dec 2021 07:43:24 +0000 Received: from localhost ([127.0.0.1]:51053 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2q5s-0006fS-4z for submit@debbugs.gnu.org; Thu, 30 Dec 2021 02:43:24 -0500 Received: from mail-qv1-f52.google.com ([209.85.219.52]:37532) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2q53-0006bR-86 for 51838@debbugs.gnu.org; Thu, 30 Dec 2021 02:42:33 -0500 Received: by mail-qv1-f52.google.com with SMTP id fo11so21389887qvb.4 for <51838@debbugs.gnu.org>; Wed, 29 Dec 2021 23:42:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=m4ey9PAs1l0oX379xrQCflc4IPx1npXrYzxZmle5J0A=; b=UPIsytVSQUUE6wZQO9YxRrMzk46bShYtMbmFrkBUqGE5k2zEEdX+y0T1MYzrnipA5b 9G04MohbNs+8eDNVRE793NyCB7380y2DOjUjjArzpuNb30Lm+aQcX9NS8fkTjHzBBrlu gyOvI/KuRYDlcNitB0nUbJo+LiD3FeJylqaQjb5B2i8gp+dCmhwvj3AiQJ4xs8LZLxEa R6YNwTMfKQlgLgIpd1oN5DfaLwMEGwWTonKVwnK4VtkiHIIOPobq7hKJ7hF5mEbSVuxm 0vPGv+8PvswqNkID3NXE0yq9/ox4bnQ3be0ndBlOQ07kFed/c8l2pu1qtGbBKj0PtXII RVcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=m4ey9PAs1l0oX379xrQCflc4IPx1npXrYzxZmle5J0A=; b=EJLPvGsTILZlhw5PYIl5Uax1wyA5op/fhpQQ/bkKEoxPx3BWtygucAMt27cs+D4QAd Dz+8t4DIf51wUb2AvsGYsTITbhbEVI+W80R2un6lkmTnzI4XT/LrlcRS7b8pzAbjBvyd ucv9oG5gad/sKVVmfwilFpXvRDwl76HSNonMTojztV1khy4evHtqGAhwsJUlkPyj1ljx ymR9ajP5PayGDKkAWRc66cC8GFsBbiAmKtaQmoFEnTCLwukGuV9HiNMYgq1xBrsTYVZK H7o8ULEugusvlkA2HqtyfxCgUlvOexfK9fWO3bHsGcmDEzU1ESUn/ex/wgQRUUAQdjIs oygg== X-Gm-Message-State: AOAM530ozBdD1PQJMXnMdK+bGLGsUpl2E2fOjuXB2iQYBepOOYD9VHk7 e5/mfVDhWatsedUHIDKnyI6mT8PsweF+xK/J X-Google-Smtp-Source: ABdhPJw1dO/dYaR9luzmZiA5g+CYCjGnXd3gC0doqgx982s/63R5shkuymv6Q6bX8nuiXOT89kfwdw== X-Received: by 2002:ad4:5bcc:: with SMTP id t12mr14324657qvt.41.1640850147737; Wed, 29 Dec 2021 23:42:27 -0800 (PST) Received: from localhost (c-73-125-89-242.hsd1.fl.comcast.net. [73.125.89.242]) by smtp.gmail.com with UTF8SMTPSA id x17sm20047439qta.66.2021.12.29.23.42.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Dec 2021 23:42:27 -0800 (PST) From: Philip McGrath Date: Thu, 30 Dec 2021 02:39:04 -0500 Message-Id: <20211230073919.30327-27-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211230073919.30327-1-philip@philipmcgrath.com> References: <082a81964a43ae5f735ad2ca433d0dfe00859c35.camel@gmail.com> <20211230073919.30327-1-philip@philipmcgrath.com> 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" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/node-xyz.scm (node-file-uri-to-path): New variable. --- gnu/packages/node-xyz.scm | 58 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/gnu/packages/node-xyz.scm b/gnu/packages/node-xyz.scm index 23ed209fd1..ef190e56c1 100644 --- a/gnu/packages/node-xyz.scm +++ b/gnu/packages/node-xyz.scm @@ -24,6 +24,7 @@ (define-module (gnu packages node-xyz) #:use-module ((guix licenses) #:prefix license:) #:use-module (gnu packages sqlite) #:use-module (gnu packages python) + #:use-module (gnu packages web) #:use-module (guix gexp) #:use-module (guix packages) #:use-module (guix git-download) @@ -862,3 +863,60 @@ (define-public node-sqlite3 non-blocking bindings for SQLite3, written in modern C++ and tested for memory leaks.") (license license:bsd-3))) + +(define-public node-file-uri-to-path + (package + (name "node-file-uri-to-path") + (version "2.0.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/TooTallNate/file-uri-to-path") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "08l779az44czm12xdhgcrnzpqw34s59hbrlfphs7g9y2k26drqav")))) + (native-inputs + (list esbuild)) + (build-system node-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'patch-dependencies 'delete-dependencies + (lambda args + (with-atomic-json-file-replacement "package.json" + (lambda (pkg-meta) + (delete-dependencies pkg-meta + `("@types/mocha" + "@types/node" + "@typescript-eslint/eslint-plugin" + "@typescript-eslint/parser" + "cpy-cli" + "eslint" + "eslint-config-airbnb" + "eslint-config-prettier" + "eslint-import-resolver-typescript" + "eslint-plugin-import" + "eslint-plugin-jsx-a11y" + "eslint-plugin-react" + "mocha" + "rimraf" + "typescript")))))) + (replace 'build + (lambda* (#:key inputs native-inputs #:allow-other-keys) + (copy-recursively "src" "dist") + (invoke (search-input-file (or native-inputs inputs) + "/bin/esbuild") + "dist/index.ts" + "--outfile=dist/src/index.js" + "--format=cjs" + "--sourcemap" + "--platform=node")))) + #:tests? #f)) + (home-page "https://github.com/TooTallNate/file-uri-to-path") + (synopsis "Convert a @code{file:} URI to a file path") + (description "This package provides a function to convert a @code{file:} +URI to a file path. It accepts a @code{file:} URI and returns a file path +suitable for use with the @code{fs} module functions.") + (license license:expat)))