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 = JSON.parse(read_file(opt