From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 9DA526ECA1 for ; Wed, 25 Aug 2021 18:38:55 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 88A4913598 for ; Wed, 25 Aug 2021 18:38:25 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id A70591358A for ; Wed, 25 Aug 2021 18:38:21 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 7043F43945 for ; Wed, 25 Aug 2021 18:38:21 +0200 (CEST) Message-ID: <5fdfd5ae-d601-3032-37f8-8b5ec618dc9e@proxmox.com> Date: Wed, 25 Aug 2021 18:38:19 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.0 Content-Language: en-GB To: Proxmox VE development discussion , Dominik Csapak References: <20210719103149.3430829-1-d.csapak@proxmox.com> <20210719103149.3430829-2-d.csapak@proxmox.com> From: Thomas Lamprecht In-Reply-To: <20210719103149.3430829-2-d.csapak@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.995 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -1.305 Looks like a legit reply (A) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [proxmox.com] Subject: Re: [pve-devel] [PATCH v2 1/3] ship proper nodejs module 'pve-eslint' X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2021 16:38:55 -0000 On 19/07/2021 12:31, Dominik Csapak wrote: > instead of concatenating the eslint module into our app.js, ship > a 'pve-eslint' module that exports the built eslint module > > to do this, we have to leave the module type on 'umd' instead of > changing to 'var' so that nodejs can properly import it. > > Signed-off-by: Dominik Csapak > --- > Makefile | 2 +- Does not applies here, did not really investigated yet though: Applying: ship proper nodejs module 'pve-eslint' Using index info to reconstruct a base tree... error: removal patch leaves file contents error: src/Makefile: patch does not apply > debian/control | 7 +++++-- > debian/dirs | 1 + > debian/links | 1 + > debian/rules | 5 ++++- > patches/0001-adapt-webpack-config.patch | 19 +++++-------------- > src/Makefile | 15 --------------- > src/{ => bin}/app.js | 5 ++++- > src/index.js | 3 +++ > src/package.json | 9 +++++++++ > 10 files changed, 33 insertions(+), 34 deletions(-) > create mode 100644 debian/dirs > create mode 100644 debian/links > delete mode 100644 src/Makefile > rename src/{ => bin}/app.js (99%) > create mode 100644 src/index.js > create mode 100644 src/package.json > > diff --git a/Makefile b/Makefile > index 9dbe3d0..2a6666c 100644 > --- a/Makefile > +++ b/Makefile > @@ -49,7 +49,7 @@ download: > # NOTE: needs npm installed, downloads packages from npm > .PHONY: buildupstream > buildupstream: ${BUILDSRC} > - cp ${BUILDSRC}/build/eslint.js ${SRCDIR}/eslint.js > + cp ${BUILDSRC}/build/eslint.js ${SRCDIR}/lib/eslint.js > > ${BUILDSRC}: ${UPSTREAM} patches > rm -rf $@ > diff --git a/debian/control b/debian/control > index 3f9b014..7ea3664 100644 > --- a/debian/control > +++ b/debian/control > @@ -2,13 +2,16 @@ Source: pve-eslint > Section: devel > Priority: optional > Maintainer: Proxmox Support Team > -Build-Depends: debhelper (>= 12~) > +Build-Depends: debhelper (>= 12~), > + nodejs, > + pkg-js-tools (>= 0.8.11) > Standards-Version: 4.3.0 > Homepage: http://www.proxmox.com > > Package: pve-eslint > Architecture: all > -Depends: node-commander, node-colors, nodejs, ${misc:Depends}, > +Depends: node-commander, node-colors, nodejs (>= ${nodejs:Version}), ${misc:Depends}, > +Provides: ${nodejs:Provides} > Description: ESLint for Proxmox Virtual Environment development > This package contains a version of eslint used to develop the > Proxmox Virtual Environment, and other Proxmox projects, web GUI. > diff --git a/debian/dirs b/debian/dirs > new file mode 100644 > index 0000000..e772481 > --- /dev/null > +++ b/debian/dirs > @@ -0,0 +1 @@ > +usr/bin > diff --git a/debian/links b/debian/links > new file mode 100644 > index 0000000..99342ed > --- /dev/null > +++ b/debian/links > @@ -0,0 +1 @@ > +usr/share/nodejs/pve-eslint/bin/app.js usr/bin/eslint > diff --git a/debian/rules b/debian/rules > index 2d33f6a..b4c4090 100755 > --- a/debian/rules > +++ b/debian/rules > @@ -1,4 +1,7 @@ > #!/usr/bin/make -f > > %: > - dh $@ > + dh $@ --with nodejs > + > +execute_after_dh_fixperms: > + chmod --recursive a+x -- debian/*/usr/share/nodejs/pve-eslint/bin/* > diff --git a/patches/0001-adapt-webpack-config.patch b/patches/0001-adapt-webpack-config.patch > index 4698e74..b0201e1 100644 > --- a/patches/0001-adapt-webpack-config.patch > +++ b/patches/0001-adapt-webpack-config.patch > @@ -3,21 +3,20 @@ From: Dominik Csapak > Date: Thu, 2 Apr 2020 07:10:18 +0000 > Subject: [PATCH] adapt webpack config > > -changes to 'var' from 'umd' since we want to use it in the same file > adds 'cli-engine' to build (we use it in our wrapper) > and target 'node' since we will use it on the cli > > Signed-off-by: Dominik Csapak > --- > - webpack.config.js | 6 +++--- > - 1 file changed, 3 insertions(+), 3 deletions(-) > + webpack.config.js | 3 ++- > + 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/webpack.config.js b/webpack.config.js > -index 29d60cb4..95027075 100644 > +index a22c99b..9209159 100644 > --- a/webpack.config.js > +++ b/webpack.config.js > -@@ -2,14 +2,14 @@ > - > +@@ -4,8 +4,9 @@ const NodePolyfillPlugin = require("node-polyfill-webpack-plugin"); > + /** @type {import("webpack").Configuration} */ > module.exports = { > mode: "none", > + target: "node", > @@ -27,13 +26,5 @@ index 29d60cb4..95027075 100644 > }, > output: { > filename: "[name].js", > - library: "[name]", > -- libraryTarget: "umd", > -- globalObject: "this" > -+ libraryTarget: "var" > - }, > - module: { > - rules: [ > -- > 2.20.1 > - > diff --git a/src/Makefile b/src/Makefile > deleted file mode 100644 > index bef1c57..0000000 > diff --git a/src/app.js b/src/bin/app.js > similarity index 99% > rename from src/app.js > rename to src/bin/app.js > index 9226234..8a28923 100644 > --- a/src/app.js > +++ b/src/bin/app.js > @@ -1,9 +1,12 @@ > -(function() { > +#!/usr/bin/env node > + > +(async function(){ > 'use strict'; > > const path = require('path'); > const color = require('colors'); > const program = require('commander'); > +const eslint = require('pve-eslint'); > > program > .usage('[options] []') > diff --git a/src/index.js b/src/index.js > new file mode 100644 > index 0000000..01b9a1d > --- /dev/null > +++ b/src/index.js > @@ -0,0 +1,3 @@ > +const eslint = require('./lib/eslint.js'); > + > +module.exports = eslint; > diff --git a/src/package.json b/src/package.json > new file mode 100644 > index 0000000..b08184b > --- /dev/null > +++ b/src/package.json > @@ -0,0 +1,9 @@ > +{ > + "name": "pve-eslint", > + "version": "7.28.0", > + "files": [ > + "index.js", > + "bin/app.js", > + "lib/eslint.js" > + ] > +} >