]> git.proxmox.com Git - novnc-pve.git/commitdiff
transpile javascript before packaging
authorDominik Csapak <d.csapak@proxmox.com>
Mon, 22 May 2017 14:58:14 +0000 (16:58 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 24 May 2017 11:00:39 +0000 (13:00 +0200)
instead of using the babel-shim (which is not production-ready),
create a bundle app.js file with node-es6-module-transpiler in the
dh_auto_build step

this way, we only need to ship 1 js file instead of many

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Makefile
debian/control
debian/install
debian/patches/0010-use-only-app.js.patch [new file with mode: 0644]
debian/patches/series
debian/rules

index 4ac049f228b1c38d9e33475788a7510e3c8f45d7..5ef857d573285b114e7cb84baaf0cfcb856851ec 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -17,7 +17,7 @@ deb: ${DEB}
 ${DEB}: | submodule
        rm -rf ${SRCDIR}.tmp
        cp -rpa ${SRCDIR} ${SRCDIR}.tmp
-       cp -a debian ${SRCDIR}.tmp/debian
+       cp -a debian ${SRCDIR}.tmp/
        echo "git clone git://git.proxmox.com/git/novnc-pve.git\\ngit checkout ${GITVERSION}" > ${SRCDIR}.tmp/debian/SOURCE
        cd ${SRCDIR}.tmp; dpkg-buildpackage -rfakeroot -b -uc -us
        lintian ${DEB}
index 1a895c8841476fb88693d4ec1dd0ae5998a62c69..63a74ad9d4da2716fd4a03d75bd4a74257ec3af5 100644 (file)
@@ -2,7 +2,7 @@ Source: novnc-pve
 Section: web
 Priority: optional
 Maintainer: Proxmox Support Team <support@proxmox.com>
-Build-Depends: debhelper (>= 7.0.0~), quilt
+Build-Depends: debhelper (>= 7.0.0~), quilt, node-es6-module-transpiler
 Standards-Version: 3.8.3
 Homepage: https://github.com/kanaka/noVNC/
 
index 37f355f2a90005f0d43fc320e4e84a71ba676cd0..7f6c2946a363362480a9d74622870d74bde523ba 100644 (file)
@@ -1,7 +1,8 @@
-app usr/share/novnc-pve
-core usr/share/novnc-pve
-docs usr/share/novnc-pve
-po usr/share/novnc-pve
-utils usr/share/novnc-pve
-vendor usr/share/novnc-pve
-index.html.tpl usr/share/novnc-pve
+app/images          usr/share/novnc-pve/app
+app/locale          usr/share/novnc-pve/app
+app/sounds          usr/share/novnc-pve/app
+app/styles          usr/share/novnc-pve/app
+app/error-handler.js usr/share/novnc-pve/app
+app.js              usr/share/novnc-pve
+docs                 usr/share/novnc-pve
+index.html.tpl      usr/share/novnc-pve
diff --git a/debian/patches/0010-use-only-app.js.patch b/debian/patches/0010-use-only-app.js.patch
new file mode 100644 (file)
index 0000000..e225250
--- /dev/null
@@ -0,0 +1,44 @@
+From 6d3945c7c0b680a871d789215659f04e42acd6e7 Mon Sep 17 00:00:00 2001
+From: Dominik Csapak <d.csapak@proxmox.com>
+Date: Tue, 16 May 2017 10:36:15 +0200
+Subject: [PATCH 10/10] use only app.js
+
+because we will use the commonjs version,
+we only need to use the generated app.js
+
+Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
+---
+ vnc.html | 17 +----------------
+ 1 file changed, 1 insertion(+), 16 deletions(-)
+
+diff --git a/vnc.html b/vnc.html
+index ff70e0c..40c726b 100644
+--- a/vnc.html
++++ b/vnc.html
+@@ -46,22 +46,7 @@
+     </script>
+     <!-- begin scripts -->
+-    <!-- promise polyfills promises for IE11 -->
+-    <script src="/novnc/vendor/promise.js"></script>
+-    <!-- ES2015/ES6 modules polyfill -->
+-    <script type="module">
+-        window._noVNC_has_module_support = true;
+-    </script>
+-    <script>
+-        window.addEventListener("load", function() {
+-            if (window._noVNC_has_module_support) return;
+-            var loader = document.createElement("script");
+-            loader.src = "/novnc/vendor/browser-es-module-loader/dist/browser-es-module-loader.js";
+-            document.head.appendChild(loader);
+-        });
+-    </script>
+-    <!-- actual script modules -->
+-    <script type="module" src="/novnc/app/ui.js"></script>
++    <script src="/novnc/app.js"></script>
+     <!-- end scripts -->
+ </head>
+-- 
+2.11.0
+
index f528c373d603b794a8173574a7996215c8582193..086ff4376324e02b1f0d248c10071a379b49edf6 100644 (file)
@@ -7,3 +7,4 @@
 0007-add-replaceable-snippets-in-vnc.html.patch
 0008-focus-canvas-after-load.patch
 0009-decrease-animation-time.patch
+0010-use-only-app.js.patch
index 169ef3d8dc776c4d87025d8519c1f7da1ad6ef85..15a62e9e4c35f89eb73907365a538bb418e5d41b 100755 (executable)
@@ -5,6 +5,10 @@
 
 export DEB_BUILD_HARDENING=1
 
+override_dh_auto_build:
+       compile-modules convert -f bundle app/ui.js > app.js
+       dh_auto_build
+
 override_dh_install:
        cp vnc.html index.html.tpl
        dh_install