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

Jonas Smedegaard jonas at jones.dk
Fri Aug 27 15:12:26 BST 2021


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-javascript-devel/attachments/20210827/8a5b4052/attachment.sig>


More information about the Pkg-javascript-devel mailing list