[Pkg-javascript-devel] Bug#1011816: Bug#1004471: Update node-terser to latest upstream (node-terser 5)

2022-06-25 Thread Jonas Smedegaard
[ dropping randomly one of the cross-posted bugreports ]

Quoting Yadd (2022-06-25 12:13:48)
> On 25/06/2022 12:03, Jonas Smedegaard wrote:
> > Quoting Yadd (2022-06-25 09:51:05)
> >> On 30/05/2022 13:07, Jonas Smedegaard wrote:
> > Your fixing the issues is great.  The minor issue I had with it
> > was your sharing fixes for multiple issues as a single patch, making it
> > hard to follow what exactly is going on, and consequently making it hard
> > to navigate in it - i.e. adopt only some changes but not others.
> > 
> > Concretely, I am not ready to move to terser v5 yet, and this RC bug
> > does *not* require bumping to terser v5.  Your sharing a fix for this
> > issue that goes "first upgrade to terser v5, then patch that different
> > codebase like this..." made it hard for me to change that *one line*
> > really related to this bug:
> > 
> > -+if ("ecma" in opts) {
> > ++if ("ecma" in opts && opts.ecma != undefined) {
> > 
> > Let me repeat to emphasize: I truly appreciate your work triaging bugs!
> > 
> > Just please consider making "atomic changes": One git commit (or patch
> > file) per semantic change - not multiple lesser-related changes lumped
> > together.
> 
> Thanks, usually  it seems like you prefer debdiff instead of MR, that's 
> why I did this. Would you rather I make some MRs this time?

No thanks: I dislike MRs because they put the burden on the receiver to
play along with a specific model of using git indirectly via a custom
web interface (or a custom REST interface).

But the alternative to MRs is not a debdiff, but a diff.

If it takes 7 changes to fix a bug, then share that as 7 distinct
pieces, either as a git branch somewhere containing 7 commits, or as 7
unified diff patches attached to an email.


Regards,

 - 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


[Pkg-javascript-devel] Bug#1011816: Bug#1004471: Update node-terser to latest upstream (node-terser 5)

2022-05-30 Thread Yadd

On 30/05/2022 14:37, Yadd wrote:

There is something broken with cjs/mjs. I'm going to fix that.

Cheers,
Yadd

Le Lundi, Mai 30, 2022 13:07 CEST, Jonas Smedegaard  a écrit:
  

Quoting Yadd (2022-05-30 12:05:41)

here is a debdiff (debian part only) to update terser to version 5.13.1.
This fixes also #1011816 (FTBFS)


Thanks!

It seems you are sharing that patch as a proposal, as you only pushed
some parts of it to git.

...and I disagree with some minor parts of it, so that's good: I will
take a look at it, and when I get a better sense of it reply back here
in more detail which parts I disagree with.


Hi Jonas,

I fixed:
 * debdiff: diff from debian/latest (still only debian/ directory)
 * commonjs use

Now autopkgtest passed except pure browser test (command2): webpack 
produces a bundle unusable for domino test, maybe for browser...


I think mocha test could be added to autopkgtest now

Cheers,
Yadddiff --git a/debian/changelog b/debian/changelog
index bf31486e..af5ba64d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,20 @@
+node-terser (5.13.1-1) UNRELEASED; urgency=medium
+
+  * Team upload
+  * Declare compliance with policy 4.6.1
+  * Fix debian/rules for parallel build (manpage needs bundle file)
+  * New upstream version 5.13.1
+  * Refresh patches
+  * Add patches to fix test
+  * Add links during build
+  * Render mocha test required
+  * Update nodejs dependency to nodejs:any
+  * Fix commander patch
+  * Use pkg-js-autopkgtest in require test because type=module
+  * Fix commonjs usage
+
+ -- Yadd   Mon, 30 May 2022 18:14:52 +0200
+
 node-terser (4.8.0-2) experimental; urgency=medium
 
   * update copyright info:
diff --git a/debian/clean b/debian/clean
index 479d4e14..51146a4a 100644
--- a/debian/clean
+++ b/debian/clean
@@ -1,5 +1,6 @@
 debian/js/
 debian-man/
 dist/bundle*
+node_modules/
 README.html
 README.txt
diff --git a/debian/control b/debian/control
index e4610eca..929149f3 100644
--- a/debian/control
+++ b/debian/control
@@ -78,7 +78,7 @@ Architecture: all
 Depends:
  node-commander (>= 7),
  node-terser (= ${source:Version}),
- nodejs,
+ nodejs:any,
  ${misc:Depends},
 Recommends:
  node-source-map-support,
diff --git a/debian/libjs-terser.links b/debian/libjs-terser.links
index 73aef070..bfd0d2ae 100644
--- a/debian/libjs-terser.links
+++ b/debian/libjs-terser.links
@@ -1 +1 @@
-usr/share/nodejs/terser/dist/bundle.min.js 
usr/share/javascript/terser/bundle.js
+usr/share/nodejs/terser/dist/bundle.min.cjs 
usr/share/javascript/terser/bundle.js
diff --git a/debian/node-terser.install b/debian/node-terser.install
index 338e037d..9fe7de5a 100644
--- a/debian/node-terser.install
+++ b/debian/node-terser.install
@@ -1,2 +1,2 @@
 package.json lib tools main.js /usr/share/nodejs/terser
-dist/bundle.min.js /usr/share/nodejs/terser/dist
+dist/bundle.min.cjs /usr/share/nodejs/terser/dist
diff --git a/debian/patches/1001_commander.patch 
b/debian/patches/1001_commander.patch
index abcf1fa5..24717184 100644
--- a/debian/patches/1001_commander.patch
+++ b/debian/patches/1001_commander.patch
@@ -4,231 +4,219 @@ Description: support node module commander release 8
  (and possibly v7 as well),
  at the expense of compatibility with older releases of commander.
 Author: Yadd 
-Last-Update: 2022-02-06
+Last-Update: 2022-05-30
 ---
 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
 a/bin/terser
-+++ b/bin/terser
-@@ -25,6 +25,15 @@
- program.version(info.name + " " + info.version);
- program.parseArgv = program.parse;
- program.parse = undefined;
-+var argv = [];
-+process.argv.forEach(function(arg){
-+  if(arg.match(/^-([pcmbode]+)$/)) {
-+argv = argv.concat(RegExp.$1.split('').map(s => { return '-'+s }));
-+  }
-+  else argv.push(arg);
-+});
-+process.argv = argv;
-+
- if (process.argv.includes("ast")) program.helpInformation = describe_ast;
- else if (process.argv.includes("options")) program.helpInformation = 
function() {
- var text = [];
+
+--- a/lib/cli.js
 b/lib/cli.js
+@@ -26,6 +26,15 @@
+ program.parseArgv = program.parse;
+ program.parse = undefined;
+ 
++var argv = [];
++process.argv.forEach(function(arg){
++  if(arg.match(/^-([pcmbode]+)$/)) {
++argv = argv.concat(RegExp.$1.split('').map(s => { return '-'+s }));
++  }
++  else argv.push(arg);
++});
++process.argv = argv;
++
+ if (process.argv.includes("ast")) program.helpInformation = describe_ast;
+ else if (process.argv.includes("options")) program.helpInformation = 
function() {
+ var text = [];
 @@ -62,10 +71,11 @@
- program.option("--warn", "Print warning messages.");
- program.option("--wrap ", "Embed everything as a function with 
“exports” corresponding to “name” globally.");
- program.arguments("[files...]").parseArgv(process.argv);
--if (program.configFile) {
--options = JSON.parse(read_file(program.configFile));
-+const opts = program.opts();
-+if (opts.configFile) {
-+options =