Re: [Pkg-javascript-devel] node-strip-json-comments: a dirty patch

2021-08-27 Thread Pirate Praveen


2021, ഓഗസ്റ്റ് 27 6:47:50 PM IST, Julien Puydt ൽ എഴുതി
>Le vendredi 27 août 2021 à 12:20 +0200, Yadd a écrit :
>> use `echo require > debian/tests/pkg-js/SKIP` for such modules.
>
>That makes a node-something package not try to require itself as part
>of the autopkgtest-ing ; but I don't think that answers my question.
>
>The current upstream version of strip-json-comments declares it's a JS-
>module -- hence it can't be require'd. With my dirty patch, I made it
>possible again, so existing node-* packages work -- that was the goal:
>don't break deps.
>
>But of course, future packages (or future versions of existing ones)
>will probably work différently. Let's assume in the near future we end
>up with:
>(1) node-foo wants to import node-strip-json-comments ;
>(2) node-bar wants to require it.
>If I understand well, without my dirty patch, node-bar has a problem,
>and with it node-foo has a problem.
>
>So my question is: is it possible to handle things cleanly and how?
>
>[If not, I'll drop the patch and upload a breaking package immediately:
>the sooner broken, the sooner fixed...]

Please use experimental for breaking changes. Upload to unstable only after 
fixing all reverse dependencies or giving a reasonable notice with a important 
severity bug.

This is like a major version transition. All dependencies may also need updates 
to use import instead of require.

May be pkg-js-tools should skip require tests for modules which declare 
type=module in package.json
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

-- 
Pkg-javascript-devel mailing list
Pkg-javascript-devel@alioth-lists.debian.net
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-javascript-devel


Re: [Pkg-javascript-devel] node-strip-json-comments: a dirty patch

2021-08-27 Thread Jonas Smedegaard
Quoting Julien Puydt (2021-08-27 15:17:50)
> Le vendredi 27 août 2021 à 12:20 +0200, Yadd a écrit :
> > use `echo require > debian/tests/pkg-js/SKIP` for such modules.
> 
> That makes a node-something package not try to require itself as part
> of the autopkgtest-ing ; but I don't think that answers my question.
> 
> The current upstream version of strip-json-comments declares it's a JS-
> module -- hence it can't be require'd. With my dirty patch, I made it
> possible again, so existing node-* packages work -- that was the goal:
> don't break deps.
> 
> But of course, future packages (or future versions of existing ones)
> will probably work différently. Let's assume in the near future we end
> up with:
> (1) node-foo wants to import node-strip-json-comments ;
> (2) node-bar wants to require it.
> If I understand well, without my dirty patch, node-bar has a problem,
> and with it node-foo has a problem.
> 
> So my question is: is it possible to handle things cleanly and how?
> 
> [If not, I'll drop the patch and upload a breaking package immediately:
> the sooner broken, the sooner fixed...]

Your patch changes how the code can be used by other code.

That looks very wrong to me: When code depends on a specific version of 
a module, they expect the interface of that module to be like the 
upstream release interface.

Modules can provide modern "import" style code or old "require" style 
code or both, and if you as package maintainer deviate from upstream 
choice of offered interface(s) then you become responsible for patching 
all consumers as well.  Is that really what you want to do here?

Seems all you wanted to do was make your build-and-test routines not 
complain.  Or did I misunderstand that?


 - Jonas

-- 
 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/

 [x] quote me freely  [ ] ask before reusing  [ ] keep private

signature.asc
Description: signature
-- 
Pkg-javascript-devel mailing list
Pkg-javascript-devel@alioth-lists.debian.net
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-javascript-devel


Re: [Pkg-javascript-devel] node-strip-json-comments: a dirty patch

2021-08-27 Thread Julien Puydt
Le vendredi 27 août 2021 à 12:20 +0200, Yadd a écrit :
> use `echo require > debian/tests/pkg-js/SKIP` for such modules.

That makes a node-something package not try to require itself as part
of the autopkgtest-ing ; but I don't think that answers my question.

The current upstream version of strip-json-comments declares it's a JS-
module -- hence it can't be require'd. With my dirty patch, I made it
possible again, so existing node-* packages work -- that was the goal:
don't break deps.

But of course, future packages (or future versions of existing ones)
will probably work différently. Let's assume in the near future we end
up with:
(1) node-foo wants to import node-strip-json-comments ;
(2) node-bar wants to require it.
If I understand well, without my dirty patch, node-bar has a problem,
and with it node-foo has a problem.

So my question is: is it possible to handle things cleanly and how?

[If not, I'll drop the patch and upload a breaking package immediately:
the sooner broken, the sooner fixed...]

Cheers,

J.Puydt


-- 
Pkg-javascript-devel mailing list
Pkg-javascript-devel@alioth-lists.debian.net
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-javascript-devel


Re: [Pkg-javascript-devel] node-strip-json-comments: a dirty patch

2021-08-27 Thread Yadd
Le 26/08/2021 à 06:25, Julien Puydt a écrit :
> Hi,
> 
> I updated the node-strip-json-comments package ; it required refreshing
> the existing patch (porting upstream test suite to a framework we
> have), which was pretty normal, but also, and I find it annnoying, a
> new one.
> 
> The upstream package.json declares it's a JS module, so it can't be
> require'd. Yes, that meant autopkgtest-pkg-nodejs' most basic test was
> failing! And I figured that also meant every dep in Debian would fail
> likewise.
> 
> So the new patch:
> https://salsa.debian.org/js-team/node-strip-json-comments/-/blob/master/debian/patches/dont_be_a_module.patch
> reverts upstream's change, so hopefully everything keeps on working.
> 
> But still, I find it dirty, and when we'll have both deps which require
> and deps which import, we'll probably have a problem.
> 
> Can someone more knowledgeable chime in and make nice
> observations/propositions?

Hi,

use `echo require > debian/tests/pkg-js/SKIP` for such modules.

Cheers,
Yadd

-- 
Pkg-javascript-devel mailing list
Pkg-javascript-devel@alioth-lists.debian.net
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-javascript-devel


[Pkg-javascript-devel] node-strip-json-comments: a dirty patch

2021-08-27 Thread Julien Puydt
Hi,

I updated the node-strip-json-comments package ; it required refreshing
the existing patch (porting upstream test suite to a framework we
have), which was pretty normal, but also, and I find it annnoying, a
new one.

The upstream package.json declares it's a JS module, so it can't be
require'd. Yes, that meant autopkgtest-pkg-nodejs' most basic test was
failing! And I figured that also meant every dep in Debian would fail
likewise.

So the new patch:
https://salsa.debian.org/js-team/node-strip-json-comments/-/blob/master/debian/patches/dont_be_a_module.patch
reverts upstream's change, so hopefully everything keeps on working.

But still, I find it dirty, and when we'll have both deps which require
and deps which import, we'll probably have a problem.

Can someone more knowledgeable chime in and make nice
observations/propositions?

Thanks,

J.Puydt


-- 
Pkg-javascript-devel mailing list
Pkg-javascript-devel@alioth-lists.debian.net
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-javascript-devel