From 3b459cd69a396c0b82ee929a98fbdc99a176b89cda64fd9ba24d8cdcc363aba3 Mon Sep 17 00:00:00 2001 From: Avindra Goolcharan Date: Tue, 16 Aug 2022 14:52:01 +0000 Subject: [PATCH 1/5] Accepting request 995192 from home:dziobian:gulgul-ultron - Allow the user to override `node` and `npm` commands in PATH. This is useful if one wants to eg. use Electron to run npm. * add 0001-Allow-the-user-to-provide-their-own-npm-command-by-m.patch - Change Requires: npm-default to Requires: npm. npm-default is already prefered by the prjconf, this works with any version of npm, and Fedora does not have npm-default. OBS-URL: https://build.opensuse.org/request/show/995192 OBS-URL: https://build.opensuse.org/package/show/devel:languages:javascript/local-npm-registry?expand=0&rev=5 --- ...o-provide-their-own-npm-command-by-m.patch | 36 +++++++++++++++++++ local-npm-registry.changes | 10 ++++++ local-npm-registry.spec | 5 +-- 3 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 0001-Allow-the-user-to-provide-their-own-npm-command-by-m.patch diff --git a/0001-Allow-the-user-to-provide-their-own-npm-command-by-m.patch b/0001-Allow-the-user-to-provide-their-own-npm-command-by-m.patch new file mode 100644 index 0000000..da055fe --- /dev/null +++ b/0001-Allow-the-user-to-provide-their-own-npm-command-by-m.patch @@ -0,0 +1,36 @@ +From 3ebbc200b9f03dae3e32d2461b77f99db645df02 Mon Sep 17 00:00:00 2001 +From: Bruno Pitrus +Date: Fri, 12 Aug 2022 16:44:59 +0200 +Subject: [PATCH] Allow the user to provide their own npm command by + manipulating PATH. + +This can be useful to eg. run npm using Electron instead of Node. +--- + src/index.ts | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/index.ts b/src/index.ts +index ee201f3..0232df4 100644 +--- a/dist/index.js ++++ b/dist/index.js +@@ -59,7 +59,7 @@ function setupServerAndGetPort(service:Service, registry:Registry): Promise { +- child_process_1.spawn("/usr/bin/npm", ['config', 'set', 'registry', service.url.toString()], { stdio: 'inherit' }) ++ child_process_1.spawn("npm", ['config', 'set', 'registry', service.url.toString()], { stdio: 'inherit' }) + .on("exit", (code) => { + code === 0 ? accept() : reject(); + }); +@@ -71,7 +71,7 @@ function runNpmInstall(): Promise { + return Promise.reject("npm install skipped"); + } + return new Promise((accept, reject) => { +- child_process_1.spawn("/usr/bin/npm", install_options, { stdio: 'inherit' }) ++ child_process_1.spawn("npm", install_options, { stdio: 'inherit' }) + .on("exit", (code) => { + code === 0 ? accept() : reject("NPM returned code: " + code); + }); +-- +2.37.1.windows.1 + diff --git a/local-npm-registry.changes b/local-npm-registry.changes index 175938e..99f898d 100644 --- a/local-npm-registry.changes +++ b/local-npm-registry.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Mon Aug 15 15:59:04 UTC 2022 - Bruno Pitrus +- Allow the user to override `node` and `npm` commands in PATH. + This is useful if one wants to eg. use Electron to run npm. + * add 0001-Allow-the-user-to-provide-their-own-npm-command-by-m.patch +- Change Requires: npm-default to Requires: npm. + npm-default is already prefered by the prjconf, + this works with any version of npm, + and Fedora does not have npm-default. + ------------------------------------------------------------------- Wed Aug 11 17:06:14 UTC 2021 - Adam Majer diff --git a/local-npm-registry.spec b/local-npm-registry.spec index e83bac6..ab626d5 100644 --- a/local-npm-registry.spec +++ b/local-npm-registry.spec @@ -23,7 +23,8 @@ Summary: Localhost-only version of NPM registry License: GPL-3.0-or-later URL: https://github.com/openSUSE/npm-localhost-proxy Source: https://github.com/openSUSE/npm-localhost-proxy/releases/download/v%{version}/local_npm_registry-v%{version}.tar.gz -Requires: npm-default +Patch0: 0001-Allow-the-user-to-provide-their-own-npm-command-by-m.patch +Requires: npm BuildArch: noarch %description @@ -51,7 +52,7 @@ then exit 0 fi -exec %{_bindir}/node %{_datadir}/%{name}/dist/ "\$@" +exec node %{_datadir}/%{name}/dist/ "\$@" EOF %files From 66e437abc7f617f3d1a93eaebb407fdf9980a830847c0858a2d3cf1f0bbf7c50 Mon Sep 17 00:00:00 2001 From: Adam Majer Date: Tue, 16 Aug 2022 16:45:11 +0000 Subject: [PATCH 2/5] - Revert Requires: back to npm-default. If we need support for Fedora to have something else, we can do this another way https://en.opensuse.org/openSUSE:Build_Service_prjconf#Substitute OBS-URL: https://build.opensuse.org/package/show/devel:languages:javascript/local-npm-registry?expand=0&rev=6 --- local-npm-registry.changes | 7 +++++++ local-npm-registry.spec | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/local-npm-registry.changes b/local-npm-registry.changes index 99f898d..b120b76 100644 --- a/local-npm-registry.changes +++ b/local-npm-registry.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Aug 16 16:43:23 UTC 2022 - Adam Majer + +- Revert Requires: back to npm-default. If we need support for + Fedora to have something else, we can do this another way + https://en.opensuse.org/openSUSE:Build_Service_prjconf#Substitute + ------------------------------------------------------------------- Mon Aug 15 15:59:04 UTC 2022 - Bruno Pitrus - Allow the user to override `node` and `npm` commands in PATH. diff --git a/local-npm-registry.spec b/local-npm-registry.spec index ab626d5..8a31ee6 100644 --- a/local-npm-registry.spec +++ b/local-npm-registry.spec @@ -1,7 +1,7 @@ # # spec file for package local-npm-registry # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,7 +24,7 @@ License: GPL-3.0-or-later URL: https://github.com/openSUSE/npm-localhost-proxy Source: https://github.com/openSUSE/npm-localhost-proxy/releases/download/v%{version}/local_npm_registry-v%{version}.tar.gz Patch0: 0001-Allow-the-user-to-provide-their-own-npm-command-by-m.patch -Requires: npm +Requires: npm-default BuildArch: noarch %description From e310433583d1f7b00e989d199dcfc2788678eb06ecc183c6ecc433f50260d473 Mon Sep 17 00:00:00 2001 From: Adam Majer Date: Fri, 21 Jul 2023 13:07:25 +0000 Subject: [PATCH 3/5] - update to 1.0.0 * update dependencies * no longer shows paths for tarballs served by the proxy * works with latest nodejs - 0001-Allow-the-user-to-provide-their-own-npm-command-by-m.patch: dropped, upstreamed OBS-URL: https://build.opensuse.org/package/show/devel:languages:javascript/local-npm-registry?expand=0&rev=7 --- ...o-provide-their-own-npm-command-by-m.patch | 36 ------------------- local-npm-registry.changes | 11 ++++++ local-npm-registry.spec | 5 ++- local_npm_registry-v1.0.0.tar.gz | 3 ++ 4 files changed, 16 insertions(+), 39 deletions(-) delete mode 100644 0001-Allow-the-user-to-provide-their-own-npm-command-by-m.patch create mode 100644 local_npm_registry-v1.0.0.tar.gz diff --git a/0001-Allow-the-user-to-provide-their-own-npm-command-by-m.patch b/0001-Allow-the-user-to-provide-their-own-npm-command-by-m.patch deleted file mode 100644 index da055fe..0000000 --- a/0001-Allow-the-user-to-provide-their-own-npm-command-by-m.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 3ebbc200b9f03dae3e32d2461b77f99db645df02 Mon Sep 17 00:00:00 2001 -From: Bruno Pitrus -Date: Fri, 12 Aug 2022 16:44:59 +0200 -Subject: [PATCH] Allow the user to provide their own npm command by - manipulating PATH. - -This can be useful to eg. run npm using Electron instead of Node. ---- - src/index.ts | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/index.ts b/src/index.ts -index ee201f3..0232df4 100644 ---- a/dist/index.js -+++ b/dist/index.js -@@ -59,7 +59,7 @@ function setupServerAndGetPort(service:Service, registry:Registry): Promise { -- child_process_1.spawn("/usr/bin/npm", ['config', 'set', 'registry', service.url.toString()], { stdio: 'inherit' }) -+ child_process_1.spawn("npm", ['config', 'set', 'registry', service.url.toString()], { stdio: 'inherit' }) - .on("exit", (code) => { - code === 0 ? accept() : reject(); - }); -@@ -71,7 +71,7 @@ function runNpmInstall(): Promise { - return Promise.reject("npm install skipped"); - } - return new Promise((accept, reject) => { -- child_process_1.spawn("/usr/bin/npm", install_options, { stdio: 'inherit' }) -+ child_process_1.spawn("npm", install_options, { stdio: 'inherit' }) - .on("exit", (code) => { - code === 0 ? accept() : reject("NPM returned code: " + code); - }); --- -2.37.1.windows.1 - diff --git a/local-npm-registry.changes b/local-npm-registry.changes index b120b76..e390a35 100644 --- a/local-npm-registry.changes +++ b/local-npm-registry.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Fri Jul 21 12:59:44 UTC 2023 - Adam Majer 1.0.0 + +- update to 1.0.0 + * update dependencies + * no longer shows paths for tarballs served by the proxy + * works with latest nodejs + +- 0001-Allow-the-user-to-provide-their-own-npm-command-by-m.patch: + dropped, upstreamed + ------------------------------------------------------------------- Tue Aug 16 16:43:23 UTC 2022 - Adam Majer diff --git a/local-npm-registry.spec b/local-npm-registry.spec index 8a31ee6..f926dfd 100644 --- a/local-npm-registry.spec +++ b/local-npm-registry.spec @@ -1,7 +1,7 @@ # # spec file for package local-npm-registry # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,13 +17,12 @@ Name: local-npm-registry -Version: 0.0.3 +Version: 1.0.0 Release: 0 Summary: Localhost-only version of NPM registry License: GPL-3.0-or-later URL: https://github.com/openSUSE/npm-localhost-proxy Source: https://github.com/openSUSE/npm-localhost-proxy/releases/download/v%{version}/local_npm_registry-v%{version}.tar.gz -Patch0: 0001-Allow-the-user-to-provide-their-own-npm-command-by-m.patch Requires: npm-default BuildArch: noarch diff --git a/local_npm_registry-v1.0.0.tar.gz b/local_npm_registry-v1.0.0.tar.gz new file mode 100644 index 0000000..fc27074 --- /dev/null +++ b/local_npm_registry-v1.0.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f107da2563e583825b82d8b8f98b3d365132cd1a4c7007c6198ff14643d9f7a0 +size 93989 From 5af58465a556f6234fcdd4d55a916a7c0fc5db37fedfe9d98cfb9d72e0a6544d Mon Sep 17 00:00:00 2001 From: Adam Majer Date: Fri, 21 Jul 2023 13:45:59 +0000 Subject: [PATCH 4/5] - update to 1.0.1 OBS-URL: https://build.opensuse.org/package/show/devel:languages:javascript/local-npm-registry?expand=0&rev=8 --- local-npm-registry.changes | 4 ++-- local-npm-registry.spec | 2 +- local_npm_registry-v1.0.0.tar.gz | 3 --- local_npm_registry-v1.0.1.tar.gz | 3 +++ 4 files changed, 6 insertions(+), 6 deletions(-) delete mode 100644 local_npm_registry-v1.0.0.tar.gz create mode 100644 local_npm_registry-v1.0.1.tar.gz diff --git a/local-npm-registry.changes b/local-npm-registry.changes index e390a35..bbeea8c 100644 --- a/local-npm-registry.changes +++ b/local-npm-registry.changes @@ -1,7 +1,7 @@ ------------------------------------------------------------------- -Fri Jul 21 12:59:44 UTC 2023 - Adam Majer 1.0.0 +Fri Jul 21 12:59:44 UTC 2023 - Adam Majer 1.0.1 -- update to 1.0.0 +- update to 1.0.1 * update dependencies * no longer shows paths for tarballs served by the proxy * works with latest nodejs diff --git a/local-npm-registry.spec b/local-npm-registry.spec index f926dfd..d8207d7 100644 --- a/local-npm-registry.spec +++ b/local-npm-registry.spec @@ -17,7 +17,7 @@ Name: local-npm-registry -Version: 1.0.0 +Version: 1.0.1 Release: 0 Summary: Localhost-only version of NPM registry License: GPL-3.0-or-later diff --git a/local_npm_registry-v1.0.0.tar.gz b/local_npm_registry-v1.0.0.tar.gz deleted file mode 100644 index fc27074..0000000 --- a/local_npm_registry-v1.0.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f107da2563e583825b82d8b8f98b3d365132cd1a4c7007c6198ff14643d9f7a0 -size 93989 diff --git a/local_npm_registry-v1.0.1.tar.gz b/local_npm_registry-v1.0.1.tar.gz new file mode 100644 index 0000000..eb3307a --- /dev/null +++ b/local_npm_registry-v1.0.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0fb9b01cc58a6462cecbb5a5461ca06a88471064334bef2c63841f320da13bb5 +size 93827 From da60278f9953bea957b9b61e9c1832cabcf8b71ce84eabb09f554a668f7d1a26 Mon Sep 17 00:00:00 2001 From: Adam Majer Date: Tue, 1 Aug 2023 11:07:49 +0000 Subject: [PATCH 5/5] remove superseded sources OBS-URL: https://build.opensuse.org/package/show/devel:languages:javascript/local-npm-registry?expand=0&rev=9 --- local_npm_registry-v0.0.3.tar.gz | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 local_npm_registry-v0.0.3.tar.gz diff --git a/local_npm_registry-v0.0.3.tar.gz b/local_npm_registry-v0.0.3.tar.gz deleted file mode 100644 index 16ccd65..0000000 --- a/local_npm_registry-v0.0.3.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8a9b520013ce1c39b44f77a2c1a1d5e3c4222ec4157addc0403d9c07097a8ae0 -size 145764