From 015736486c22d1edf6c11e02912ca2be0a076ba1 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 22 Jul 2025 19:02:41 +0200 Subject: [PATCH 001/311] tray: only quit if server is stopped; hide in tray when starting minimzed --- src/launcher/toolbar.js | 2 +- src/server/electron-window.js | 7 +------ src/server/index.js | 27 ++++++++++++++++++++------- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/src/launcher/toolbar.js b/src/launcher/toolbar.js index ee623b60..fa3208d4 100644 --- a/src/launcher/toolbar.js +++ b/src/launcher/toolbar.js @@ -116,7 +116,7 @@ menu.append(new MenuItem({type: 'submenu' , label: 'Launcher', submenu: [ } }), new MenuItem({ - label: 'Start minimized', + label: 'Start hidden (in tray)', type: 'checkbox', checked: settings.remote.read('startMinimized'), click: (e)=>{ diff --git a/src/server/electron-window.js b/src/server/electron-window.js index 77786bc0..b0231faa 100644 --- a/src/server/electron-window.js +++ b/src/server/electron-window.js @@ -61,13 +61,8 @@ module.exports = function(options={}) { window.setBounds(geometry) window.once('ready-to-show', ()=>{ - window.show() if (options.id === 'launcher' && settings.read('startMinimized')) { - if (process.platform === 'darwin') { - window.hide() - } else { - window.minimize() - } + window.hide() } }) diff --git a/src/server/index.js b/src/server/index.js index 7c74cca6..c222b065 100644 --- a/src/server/index.js +++ b/src/server/index.js @@ -177,20 +177,27 @@ function stopServerProcess() { if (settings.read('no-gui')) { if (serverProcess) serverProcess.kill('SIGINT') + serverProcess = null return } - var toClose = [...clientWindows].filter(w=>w && !w.isDestroyed()), + var toClose = clientWindows.filter(w=>w && !w.isDestroyed()), closed = 0 - if (toClose.length === 0) serverProcess.kill('SIGINT') + if (toClose.length === 0) { + serverProcess.kill('SIGINT') + serverProcess = null + } for (var w of toClose) { w.on('closed', ()=>{ closed++ if (closed === toClose.length) { clientWindows = [] - if (serverProcess) serverProcess.kill('SIGINT') + if (serverProcess) { + serverProcess.kill('SIGINT') + serverProcess = null + } } }) w.close() @@ -227,14 +234,14 @@ function startLauncher() { }) launcher.on('will-close', ()=>{ - if (clientWindows.length) { + if (clientWindows.some(w=>w && !w.isDestroyed())) { launcher.hide() e.preventDefault() } }) launcher.on('close', (e)=>{ - if (clientWindows.length) { + if (clientWindows.some(w=>w && !w.isDestroyed()) && serverProcess) { launcher.hide() e.preventDefault() return @@ -345,13 +352,19 @@ if (settings.read('docs')) { app.on('ready', ()=>{ process.on('SIGINT', function() { - if (serverProcess) serverProcess.kill('SIGINT') + if (serverProcess) { + serverProcess.kill('SIGINT') + serverProcess = null + } process.exit(0) }) }) app.on('before-quit',()=>{ - if (serverProcess) serverProcess.kill('SIGINT') + if (serverProcess) { + serverProcess.kill('SIGINT') + serverProcess = null + } }) From 65ebe938de99f5aae31c4507cbc91a4d81319bc8 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 22 Jul 2025 19:11:03 +0200 Subject: [PATCH 002/311] docs: tray icon menu --- resources/docs/docs/user-interface/launcher.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/resources/docs/docs/user-interface/launcher.md b/resources/docs/docs/user-interface/launcher.md index 13640d63..c3e356de 100644 --- a/resources/docs/docs/user-interface/launcher.md +++ b/resources/docs/docs/user-interface/launcher.md @@ -12,8 +12,10 @@ - Clear: clear console - Autoscroll: enable/disable console autoscroll - Check for update at startup: enable/disable this feature -- Autostart: start the server automatically when launcher is started -- Always on top: pin the launcher window above other the windows +- Launcher + - Autostart: start the server automatically when launcher is started + - Start hidden: starts the launcher hidden in tray + - Always on top: pin the launcher window above other the windows The "play/stop" icon can be used to start and stop the server without opening the menu. @@ -25,6 +27,10 @@ Each server option is displayed here. When clicking on an option's label, a shor The console displays various information, runtime errors and server debug messages. +## Tray icon + +The launcher comes with a system tray icon that keeps the launcher alive when closed if there is at least one client window opened or if the server is running. Its context menu can be used to toggle the launcher's visibility and access some of the launcher's menu actions. + ## Keyboard shortcuts === "Linux" From 89b82d3c9b869432149bc486219897971c1318bf Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 22 Jul 2025 19:12:49 +0200 Subject: [PATCH 003/311] log: tray menu should have wait for 1.30 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 11d9f676..fc6ca7b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 1.29.7 + +- launcher + - add tray icon and menu (landed in 1.29.6 accidentally) + + ## 1.29.6 - bug fixes From 5cf59ea97ce80abfe64c361b2396f64764946651 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 22 Jul 2025 19:24:50 +0200 Subject: [PATCH 004/311] tray: make it optional and disabled by default --- src/launcher/toolbar.js | 26 +++++++++++++++++--------- src/server/electron-window.js | 6 +++++- src/server/index.js | 35 ++++++++++++++++++++--------------- 3 files changed, 42 insertions(+), 25 deletions(-) diff --git a/src/launcher/toolbar.js b/src/launcher/toolbar.js index fa3208d4..15a2fcd4 100644 --- a/src/launcher/toolbar.js +++ b/src/launcher/toolbar.js @@ -115,14 +115,6 @@ menu.append(new MenuItem({type: 'submenu' , label: 'Launcher', submenu: [ remote.getCurrentWindow().setAlwaysOnTop(e.checked) } }), - new MenuItem({ - label: 'Start hidden (in tray)', - type: 'checkbox', - checked: settings.remote.read('startMinimized'), - click: (e)=>{ - settings.remote.write('startMinimized', e.checked) - } - }), new MenuItem({ label: 'Always on top', type: 'checkbox', @@ -131,7 +123,23 @@ menu.append(new MenuItem({type: 'submenu' , label: 'Launcher', submenu: [ settings.remote.write('alwaysOnTop', e.checked) remote.getCurrentWindow().setAlwaysOnTop(e.checked) } - }) + }), + new MenuItem({ + label: 'Use tray icon', + type: 'checkbox', + checked: settings.remote.read('useTray'), + click: (e)=>{ + settings.remote.write('useTray', e.checked) + } + }), + new MenuItem({ + label: 'Start minimized', + type: 'checkbox', + checked: settings.remote.read('startMinimized'), + click: (e)=>{ + settings.remote.write('startMinimized', e.checked) + } + }), ]})) menu.append(new MenuItem({ type: 'separator' diff --git a/src/server/electron-window.js b/src/server/electron-window.js index b0231faa..3808dedb 100644 --- a/src/server/electron-window.js +++ b/src/server/electron-window.js @@ -62,7 +62,11 @@ module.exports = function(options={}) { window.once('ready-to-show', ()=>{ if (options.id === 'launcher' && settings.read('startMinimized')) { - window.hide() + if (settings.read('useTray') || process.platform === 'darwin') { + window.hide() + } else { + window.minimize() + } } }) diff --git a/src/server/index.js b/src/server/index.js index c222b065..cb530568 100644 --- a/src/server/index.js +++ b/src/server/index.js @@ -225,23 +225,28 @@ function startLauncher() { launcher = require('./electron-window')({address:address, shortcuts:dev, width:680, height:(40 + 200 + 20 + 24 * Object.keys(settings.options).filter(x=>settings.options[x].launcher !== false).length / 2), node:true, color:'#151a24', id: 'launcher'}) require('@electron/remote/main').enable(launcher.webContents) - tray = require('./tray')({ - window: launcher, - openClient: openClient, - app: app, - startServer: startServerProcess, - stopServer: stopServerProcess - }) + if (settings.read('useTray')) { + + tray = require('./tray')({ + window: launcher, + openClient: openClient, + app: app, + startServer: startServerProcess, + stopServer: stopServerProcess + }) + + launcher.on('will-close', ()=>{ + if (clientWindows.some(w=>w && !w.isDestroyed())) { + launcher.hide() + e.preventDefault() + } + }) + + } - launcher.on('will-close', ()=>{ - if (clientWindows.some(w=>w && !w.isDestroyed())) { - launcher.hide() - e.preventDefault() - } - }) launcher.on('close', (e)=>{ - if (clientWindows.some(w=>w && !w.isDestroyed()) && serverProcess) { + if (tray && clientWindows.some(w=>w && !w.isDestroyed()) && serverProcess) { launcher.hide() e.preventDefault() return @@ -249,7 +254,7 @@ function startLauncher() { process.stdout.write = stdoutWrite process.stderr.write = stderrWrite if (process.log) process.log = processLog - tray.destroy() + if (tray) tray.destroy() }) }) From 28c0877dc9d75cb0617403b7e7853d17eb0aedf1 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 22 Jul 2025 19:34:30 +0200 Subject: [PATCH 005/311] launcher: add hide action if using tray --- src/launcher/toolbar.js | 10 ++++++++++ src/server/electron-window.js | 3 +++ src/server/index.js | 7 +++++++ 3 files changed, 20 insertions(+) diff --git a/src/launcher/toolbar.js b/src/launcher/toolbar.js index 15a2fcd4..22a8de25 100644 --- a/src/launcher/toolbar.js +++ b/src/launcher/toolbar.js @@ -157,6 +157,16 @@ menu.append(new MenuItem({ openDocs() } })) + +if (settings.remote.read('useTray')) { + menu.append(new MenuItem({ + label: 'Hide', + click: ()=>{ + ipcRenderer.send('hide') + } + })) +} + menu.append(new MenuItem({ role: 'Quit' })) diff --git a/src/server/electron-window.js b/src/server/electron-window.js index 3808dedb..18a7caad 100644 --- a/src/server/electron-window.js +++ b/src/server/electron-window.js @@ -65,8 +65,11 @@ module.exports = function(options={}) { if (settings.read('useTray') || process.platform === 'darwin') { window.hide() } else { + window.show() window.minimize() } + } else { + window.show() } }) diff --git a/src/server/index.js b/src/server/index.js index cb530568..f15ec7c6 100644 --- a/src/server/index.js +++ b/src/server/index.js @@ -303,6 +303,13 @@ function startLauncher() { showQRCode() }) + + + ipcMain.on('hide',function(e, options){ + + launcher.hide() + + }) } From 0de9f239c8d7c6a874c72ac606398b773f565220 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 22 Jul 2025 19:58:29 +0200 Subject: [PATCH 006/311] docs: tray things --- CHANGELOG.md | 2 +- resources/docs/docs/user-interface/launcher.md | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc6ca7b8..de8395e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## 1.29.7 - launcher - - add tray icon and menu (landed in 1.29.6 accidentally) + - add tray icon and menu (landed in 1.29.6 accidentally), disabled by default (can be enabled from the launcher's menu) ## 1.29.6 diff --git a/resources/docs/docs/user-interface/launcher.md b/resources/docs/docs/user-interface/launcher.md index c3e356de..304aa33b 100644 --- a/resources/docs/docs/user-interface/launcher.md +++ b/resources/docs/docs/user-interface/launcher.md @@ -14,12 +14,13 @@ - Check for update at startup: enable/disable this feature - Launcher - Autostart: start the server automatically when launcher is started - - Start hidden: starts the launcher hidden in tray - Always on top: pin the launcher window above other the windows + - Use tray: enable tray icon and menu + - Start minimized: starts the launcher minimized (or hidden in tray) The "play/stop" icon can be used to start and stop the server without opening the menu. -## 2. Configuration form +## 2. Configuration form Each server option is displayed here. When clicking on an option's label, a short help will be printed in the console. When an option is not correctly set, its label will turn to orange and an error message will be printed in the console. @@ -29,7 +30,7 @@ The console displays various information, runtime errors and server debug messag ## Tray icon -The launcher comes with a system tray icon that keeps the launcher alive when closed if there is at least one client window opened or if the server is running. Its context menu can be used to toggle the launcher's visibility and access some of the launcher's menu actions. +If `Use tray` is set, the launcher comes with a system tray icon that keeps the launcher alive when closed if there is at least one client window opened or if the server is running. Its context menu can be used to toggle the launcher's visibility and access some of the launcher's menu actions. ## Keyboard shortcuts From 83fd78e322881102de82dbabe2ff9a078631a1e3 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 23 Jul 2025 08:17:09 +0200 Subject: [PATCH 007/311] tray: fix (?) quit menu action --- src/server/tray.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/server/tray.js b/src/server/tray.js index bb49d4a6..1d150eb9 100644 --- a/src/server/tray.js +++ b/src/server/tray.js @@ -55,7 +55,9 @@ module.exports = function(options = {}) { }, { label: 'Quit', - role: 'Quit' + click: ()=>{ + options.app.quit() + } }, ]) From 84bf487169777c812e34bd2bb7f4dffae38f8f8c Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 23 Jul 2025 08:33:30 +0200 Subject: [PATCH 008/311] package: 1.29.7 & doc update --- package.json | 2 +- .../docs/docs/getting-started/introduction.md | 19 +++++++++++---- .../getting-started/running-from-sources.md | 23 +++++++++++++++---- 3 files changed, 34 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index d60c7d7d..7e352089 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "open-stage-control", "productName": "Open Stage Control", "description": "Libre and modular OSC / MIDI controller", - "version": "1.29.6", + "version": "1.29.7", "author": { "name": "Jean-Emmanuel Doucet", "email": "jean-emmanuel@ammd.net" diff --git a/resources/docs/docs/getting-started/introduction.md b/resources/docs/docs/getting-started/introduction.md index b1a9171d..9c82bfd4 100644 --- a/resources/docs/docs/getting-started/introduction.md +++ b/resources/docs/docs/getting-started/introduction.md @@ -25,7 +25,7 @@ iOS devices must be of version `10.3` or higher. ## Installation -??? example "Linux 64bit" +=== "Linux 64bit" **Ubuntu / Debian** @@ -41,19 +41,28 @@ iOS devices must be of version `10.3` or higher. - Extract it in the location of your choice - The file inside it named `open-stage-control` is the app's main executable -??? example "Mac 64bit" +=== "Mac 64bit" - - [Download](/download) `open-stage-control-VERSION-osx.zip` + - [Download](/download) `open-stage-control-VERSION-osx-x64.zip` - Extract it in the location of your choice - Drag `open-stage-control.app` in your `Application` folder -??? example "Windows 64bit" + +=== "Mac Silicon (arm)" + + - [Download](/download) `open-stage-control-VERSION-osx-arm.zip` + - Extract it in the location of your choice + - Drag `open-stage-control.app` in your `Application` folder + + See [https://disable-gatekeeper.github.io/](https://disable-gatekeeper.github.io/) to workaround the "damaged and can't be opened" error. + +=== "Windows 64bit" - [Download](/download) `open-stage-control-VERSION-win32-x64.zip` - Extract it in the location of your choice - The file inside it named `open-stage-control.exe` is the app's main executable -??? example "Other systems" +=== "Other systems" - Install [Node.js](https://nodejs.org/en/download/package-manager/) - Download `open-stage-control-VERSION-node.zip` diff --git a/resources/docs/docs/getting-started/running-from-sources.md b/resources/docs/docs/getting-started/running-from-sources.md index aab53eba..20951cc3 100644 --- a/resources/docs/docs/getting-started/running-from-sources.md +++ b/resources/docs/docs/getting-started/running-from-sources.md @@ -87,8 +87,23 @@ This will build the app in `dist/open-stage-control-PLATFORM-ARCH`. Building the app for windows from a linux system requires wine to be installed. -## Debian/Ubuntu installer +## Debian / Ubuntu and RPM installers -``` -npm run deb64 -``` +=== "Debian / Ubuntu" + + ``` + npm run deb64 + ``` + +=== "RPM" + + ``` + npm run rpm + ``` + + +## Build script on Mac Silicon + +This user-contributed script can be used to build open stage control on recent Macs: + +https://github.com/rewgs/osc-as From f38bcb9ea05f9de684852ede94a56f4c7726928b Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 5 Aug 2025 15:31:12 +0200 Subject: [PATCH 009/311] client: add title client option --- CHANGELOG.md | 5 +++++ package.json | 2 +- resources/docs/docs/client-options.md | 1 + src/client/globals.js | 2 +- src/client/ipc/callbacks.js | 2 ++ 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index de8395e9..6872f2e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 1.29.8 + +- client + - add `title` client option + ## 1.29.7 - launcher diff --git a/package.json b/package.json index 7e352089..53e3d61f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "open-stage-control", "productName": "Open Stage Control", "description": "Libre and modular OSC / MIDI controller", - "version": "1.29.7", + "version": "1.29.8", "author": { "name": "Jean-Emmanuel Doucet", "email": "jean-emmanuel@ammd.net" diff --git a/resources/docs/docs/client-options.md b/resources/docs/docs/client-options.md index 41b046ae..d653890f 100644 --- a/resources/docs/docs/client-options.md +++ b/resources/docs/docs/client-options.md @@ -18,6 +18,7 @@ Client options can be set either with the server's `--client-options` option, or | altTraversing | 1 / 0 | 0 | set to 1 to enable an alternative traversing behavior for toggle buttons (traversing gestures on toggle buttons will change their values in only one way depending on the first touched button's state) | | virtualKeyboard | 1 / 0 | 0 | (desktop only) set to 1 to enable the virtual keyboard by default | | notifications | 1 / 0 | 1 | set to 0 to hide notifications by default | +| title | string | '' | replace window title | Example: diff --git a/src/client/globals.js b/src/client/globals.js index 4503ceee..c5213fc4 100644 --- a/src/client/globals.js +++ b/src/client/globals.js @@ -43,4 +43,4 @@ window.JSON.parseFlex = require('json5').parse window.DOM = require('./dom') -window.TITLE = PACKAGE.productName + ' v' + PACKAGE.version +window.TITLE = ENV.title || (PACKAGE.productName + ' v' + PACKAGE.version) diff --git a/src/client/ipc/callbacks.js b/src/client/ipc/callbacks.js index b6dff81f..e8134030 100644 --- a/src/client/ipc/callbacks.js +++ b/src/client/ipc/callbacks.js @@ -155,6 +155,8 @@ module.exports = { setTitle: function(data) { + if (ENV.title) return + document.title = TITLE + (data ? ' (' + data + ')' : '') }, From 5b9bcd63ce58c568e9deb8b46d0877eca13a9a74 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Mon, 11 Aug 2025 13:52:31 +0200 Subject: [PATCH 010/311] firefox: `onTouch` error when the cursor goes outside the page --- CHANGELOG.md | 3 +++ src/client/widgets/containers/panel.js | 3 ++- src/client/widgets/pads/canvas.js | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6872f2e1..f634f95c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## 1.29.8 +- bug fixes + - firefox: `onTouch` error when the cursor goes outside the page + - client - add `title` client option diff --git a/src/client/widgets/containers/panel.js b/src/client/widgets/containers/panel.js index f4e51441..fdb8e93d 100644 --- a/src/client/widgets/containers/panel.js +++ b/src/client/widgets/containers/panel.js @@ -362,7 +362,8 @@ class Panel extends Container() { var event = {...e}, w - event.targetName = event.target ? event.target.getAttribute('name') : '' + // NOTE: in firefox target.getAttribute is undefined when the cursor is outside the page + event.targetName = event.target && event.target.getAttribute ? event.target.getAttribute('name') : '' event.targetTagName = event.target ? event.target.tagName : '' w = widgetManager.getWidgetByElement(event.target) diff --git a/src/client/widgets/pads/canvas.js b/src/client/widgets/pads/canvas.js index ce0d96c6..123c913c 100644 --- a/src/client/widgets/pads/canvas.js +++ b/src/client/widgets/pads/canvas.js @@ -114,7 +114,8 @@ class CanvasWidget extends Canvas { var event = {...e} delete event.firstTarget - event.targetName = event.target ? event.target.getAttribute('name') : '' + // NOTE: in firefox target.getAttribute is undefined when the cursor is outside the page + event.targetName = event.target && event.target.getAttribute ? event.target.getAttribute('name') : '' event.targetTagName = event.target ? event.target.tagName : '' var w = widgetManager.getWidgetByElement(event.target) From 7d38418a66083aa2afc69615ed71f330798d8019 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 12 Aug 2025 09:20:26 +0200 Subject: [PATCH 011/311] dropdown: fix label init, make it dynamic prop, refresh it when values are parsed --- CHANGELOG.md | 1 + src/client/widgets/basics/dropdown.js | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f634f95c..483f28bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - bug fixes - firefox: `onTouch` error when the cursor goes outside the page + - dropdown: label not initialized until a value is set - client - add `title` client option diff --git a/src/client/widgets/basics/dropdown.js b/src/client/widgets/basics/dropdown.js index bb1a2769..36a99e66 100644 --- a/src/client/widgets/basics/dropdown.js +++ b/src/client/widgets/basics/dropdown.js @@ -83,6 +83,8 @@ class Dropdown extends MenuBase { `) } + this.setValue(this.value) + } setValue(v,options={}) { @@ -120,7 +122,9 @@ class Dropdown extends MenuBase { this.parseValues() this.setValue(this.value) return - + case 'label': + this.setLabel() + return } return ret @@ -130,7 +134,8 @@ class Dropdown extends MenuBase { } Dropdown.dynamicProps = Dropdown.prototype.constructor.dynamicProps.concat( - 'values' + 'values', + 'label' ) From c450c6133cc272a9871fc783926de9c0e6062d46 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 12 Aug 2025 14:31:18 +0200 Subject: [PATCH 012/311] editor: fix colorpicker dragend handler (dragend doesn't bubble up anymore, it needs to be caught for all 3 subwidgets) --- CHANGELOG.md | 1 + src/client/ui/ui-colorpicker.js | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 483f28bd..a109bdf2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - bug fixes - firefox: `onTouch` error when the cursor goes outside the page - dropdown: label not initialized until a value is set + - editor: regression (1.29.0) preventing color changes made with the color to be undoable unless validaed with the enter key - client - add `title` client option diff --git a/src/client/ui/ui-colorpicker.js b/src/client/ui/ui-colorpicker.js index 43e3cbbd..7e4c851b 100644 --- a/src/client/ui/ui-colorpicker.js +++ b/src/client/ui/ui-colorpicker.js @@ -37,10 +37,13 @@ class ColorPicker extends UiWidget { this.trigger('change', {preventHistory: true}) }) - this.rgb.on('dragend', (e)=>{ + var dragEndCb = (e)=>{ this.value = chroma(this.rgb.value).hex() this.trigger('change') - }) + } + this.rgb.pad.on('dragend', dragEndCb) + this.rgb.hue.on('dragend', dragEndCb) + this.rgb.alpha.on('dragend', dragEndCb) this.opened = 0 From 3b792d24312ed8420bb4878da35b475110348c28 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 13 Aug 2025 22:21:43 +0200 Subject: [PATCH 013/311] rgb: fix long standing (presumably) issue with touchstate, affecting editor' colorpicker as well --- CHANGELOG.md | 2 ++ src/client/widgets/pads/rgb.js | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a109bdf2..4fb0837c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ - firefox: `onTouch` error when the cursor goes outside the page - dropdown: label not initialized until a value is set - editor: regression (1.29.0) preventing color changes made with the color to be undoable unless validaed with the enter key + - editor: color picker interaction issue in near #000000 + - rgb: incoming values were not queued when during user interaction - client - add `title` client option diff --git a/src/client/widgets/pads/rgb.js b/src/client/widgets/pads/rgb.js index 9576814a..6e5d1369 100644 --- a/src/client/widgets/pads/rgb.js +++ b/src/client/widgets/pads/rgb.js @@ -110,9 +110,6 @@ module.exports = class Rgb extends Widget { initValue[3] = this.getProp('rangeAlpha').min } - - touchstate(this, {element: this.widget, multitouch: true, ignoreCustomBindings: true}) - if (this.getProp('spring')) { this.on('dragend', (e)=>{ @@ -124,6 +121,7 @@ module.exports = class Rgb extends Widget { } + touchstate(this, {element: this.widget, multitouch: true, ignoreCustomBindings: false}) this.hsb = {h:0,s:0,b:0} From d70df6fb6db52f50eee2ef8b00306c9316bb2752 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Thu, 14 Aug 2025 09:02:43 +0200 Subject: [PATCH 014/311] docs: update --- resources/docs/docs/widgets/properties-reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/docs/docs/widgets/properties-reference.md b/resources/docs/docs/widgets/properties-reference.md index 9abc2a70..3fb510b9 100644 --- a/resources/docs/docs/widgets/properties-reference.md +++ b/resources/docs/docs/widgets/properties-reference.md @@ -135,7 +135,7 @@ | property | type |default | description | | --- | --- | --- | --- | - | | `string`|
`boolean` | "auto" | Displayed text (defaults to current value). Keywords `%key` and `%value` will be replaced by the widget's selected key/value. | + | | `string`|
`boolean` | "auto" | Displayed text (defaults to current value). Keywords `%key` and `%value` will be replaced by the widget's selected key/value. | | | `boolean` | "true" | Set to `false` to hide the dropdown icon | | | `string` | "center" | Set to `left` or `right` to change text alignment (otherwise center)

Choices: `center`, `left`, `right` | From 7fd668bdf93756ef97b5e00ee2d3d8aecb3470fd Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Thu, 14 Aug 2025 09:08:00 +0200 Subject: [PATCH 015/311] travis: focal fails now --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2f7c3412..c7985b53 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ anHsudo: required language: node_js -dist: focal +dist: jammy node_js: - "16" before_install: From f2189e29ce065cb86dc3bbdb9fd53e621d458dbd Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Thu, 14 Aug 2025 14:13:33 +0200 Subject: [PATCH 016/311] firefox: better fix for out of page events --- src/client/events/utils.js | 2 +- src/client/widgets/containers/panel.js | 3 +-- src/client/widgets/pads/canvas.js | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/client/events/utils.js b/src/client/events/utils.js index e1260bed..f824ebf0 100644 --- a/src/client/events/utils.js +++ b/src/client/events/utils.js @@ -10,7 +10,7 @@ module.exports = { return { - target: e.target, + target: e.target === document ? null : e.target, // firefox passes document when outside the page firstTarget: null, offsetX: e.offsetX, offsetY: e.offsetY, diff --git a/src/client/widgets/containers/panel.js b/src/client/widgets/containers/panel.js index fdb8e93d..f4e51441 100644 --- a/src/client/widgets/containers/panel.js +++ b/src/client/widgets/containers/panel.js @@ -362,8 +362,7 @@ class Panel extends Container() { var event = {...e}, w - // NOTE: in firefox target.getAttribute is undefined when the cursor is outside the page - event.targetName = event.target && event.target.getAttribute ? event.target.getAttribute('name') : '' + event.targetName = event.target ? event.target.getAttribute('name') : '' event.targetTagName = event.target ? event.target.tagName : '' w = widgetManager.getWidgetByElement(event.target) diff --git a/src/client/widgets/pads/canvas.js b/src/client/widgets/pads/canvas.js index 123c913c..ce0d96c6 100644 --- a/src/client/widgets/pads/canvas.js +++ b/src/client/widgets/pads/canvas.js @@ -114,8 +114,7 @@ class CanvasWidget extends Canvas { var event = {...e} delete event.firstTarget - // NOTE: in firefox target.getAttribute is undefined when the cursor is outside the page - event.targetName = event.target && event.target.getAttribute ? event.target.getAttribute('name') : '' + event.targetName = event.target ? event.target.getAttribute('name') : '' event.targetTagName = event.target ? event.target.tagName : '' var w = widgetManager.getWidgetByElement(event.target) From 4cde746a74156dfe570999bb474cce886148d471 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 27 Aug 2025 22:47:13 +0200 Subject: [PATCH 017/311] server: fix resolving absolute file urls containing the remote-root path --- CHANGELOG.md | 6 ++++++ src/server/server.js | 12 ++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fb0837c..70c2cc19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 1.29.9 + +- bug fixes + - server: fix resolving absolute file urls containing the remote-root path + + ## 1.29.8 - bug fixes diff --git a/src/server/server.js b/src/server/server.js index 604a825b..692f7b33 100644 --- a/src/server/server.js +++ b/src/server/server.js @@ -43,9 +43,11 @@ if (settings.read('client-options')) { } } -var resolveDirs = theme.files.map(x=>path.dirname(x)) +var resolveDirs = theme.files.map(x=>path.dirname(x)), + remoteRoot = settings.read('remote-root') + resolveDirs = resolveDirs.filter((x, index)=>{return resolveDirs.indexOf(x) === index}) -resolveDirs.push(settings.read('remote-root') || '') // remote-root / absolute +resolveDirs.push(remoteRoot || '') // remote-root / absolute function resolvePath(url, clientId) { @@ -60,6 +62,12 @@ function resolvePath(url, clientId) { for (var i = sessionPath ? -1 : 0; i < resolveDirs.length; i++) { var p = i === -1 ? sessionPath : resolveDirs[i] + + if (i == resolveDirs.length - 1 && remoteRoot) { + // strip out remote-root path from request url when resolving against it + url = url.replace(settings.read('remote-root'), '') + } + p = path.resolve(path.join(p, url)) if (fs.existsSync(p)) return p From 93ba5d739711aaf2b697cec10b3e4564bccbe394 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 9 Sep 2025 15:04:05 +0200 Subject: [PATCH 018/311] canvas: add webgl2 context type as an option --- package.json | 2 +- src/client/widgets/common/canvas.js | 2 +- src/client/widgets/pads/canvas.js | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 53e3d61f..ada8292c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "open-stage-control", "productName": "Open Stage Control", "description": "Libre and modular OSC / MIDI controller", - "version": "1.29.8", + "version": "1.29.9-dev", "author": { "name": "Jean-Emmanuel Doucet", "email": "jean-emmanuel@ammd.net" diff --git a/src/client/widgets/common/canvas.js b/src/client/widgets/common/canvas.js index 614283d8..2f63a62e 100644 --- a/src/client/widgets/common/canvas.js +++ b/src/client/widgets/common/canvas.js @@ -30,7 +30,7 @@ class Canvas extends Widget { this.canvas = DOM.get(this.container, 'canvas')[0] - this.ctx = this.canvas.getContext('2d',{ + this.ctx = this.canvas.getContext(this.getProp('contextType') || '2d',{ desynchronized: !ELECTRON_NOGPU && ENV.desynccanvas ? true : false, alpha: true }) diff --git a/src/client/widgets/pads/canvas.js b/src/client/widgets/pads/canvas.js index ce0d96c6..ff6ee96d 100644 --- a/src/client/widgets/pads/canvas.js +++ b/src/client/widgets/pads/canvas.js @@ -15,6 +15,7 @@ class CanvasWidget extends Canvas { var defaults = super.defaults().extend({ class_specific: { + contextType: {type: 'string', value: '2d', choices: ['2d', 'webgl2'], help: 'Context type for the canvas'}, valueLength: {type: 'number', value: 1, help:[ 'Defines the number of values accepted by the widget (minimum 1). Incoming messages that don\'t comply will be ignored', 'When calling `set()` from a script, submitted value should be an array only if `valueLength` is greater than 1.' From 291b1a07521bccca68a83aab440a07a2a8efb985 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 9 Sep 2025 17:02:28 +0200 Subject: [PATCH 019/311] canvas: autoClear is only for 2d mode --- src/client/widgets/pads/canvas.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/widgets/pads/canvas.js b/src/client/widgets/pads/canvas.js index ff6ee96d..c9c668d6 100644 --- a/src/client/widgets/pads/canvas.js +++ b/src/client/widgets/pads/canvas.js @@ -21,7 +21,7 @@ class CanvasWidget extends Canvas { 'When calling `set()` from a script, submitted value should be an array only if `valueLength` is greater than 1.' ]}, autoClear: {type: 'boolean', value: true, help: [ - 'If set to `false`, the canvas context won\'t be cleared automatically and `ctx.clearRect()` will need to be called in `onDraw`.' + 'If set to `false`, the canvas context won\'t be cleared automatically and `ctx.clearRect()` will need to be called in `onDraw`. Ignored if `contextType` is different from `2d`.' ]}, continuous: {type: 'boolean|number', value: false, help: [ 'If set to `true`, `onDraw` will be called at each frame, otherwise it will be called only when the widget is touched and when it receives a value.', @@ -156,7 +156,7 @@ class CanvasWidget extends Canvas { if (!this.getProp('onDraw')) return - if (this.getProp('autoClear')) { + if (this.getProp('autoClear') && this.getProp('contextType') === '2d') { this.clear() this.ctx.beginPath() } From 5b38c79318ef7d9dc54d06dae1edb58ad497dc37 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 9 Sep 2025 17:02:28 +0200 Subject: [PATCH 020/311] canvas: autoClear is only for 2d mode --- src/client/widgets/pads/canvas.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/widgets/pads/canvas.js b/src/client/widgets/pads/canvas.js index ff6ee96d..c9c668d6 100644 --- a/src/client/widgets/pads/canvas.js +++ b/src/client/widgets/pads/canvas.js @@ -21,7 +21,7 @@ class CanvasWidget extends Canvas { 'When calling `set()` from a script, submitted value should be an array only if `valueLength` is greater than 1.' ]}, autoClear: {type: 'boolean', value: true, help: [ - 'If set to `false`, the canvas context won\'t be cleared automatically and `ctx.clearRect()` will need to be called in `onDraw`.' + 'If set to `false`, the canvas context won\'t be cleared automatically and `ctx.clearRect()` will need to be called in `onDraw`. Ignored if `contextType` is different from `2d`.' ]}, continuous: {type: 'boolean|number', value: false, help: [ 'If set to `true`, `onDraw` will be called at each frame, otherwise it will be called only when the widget is touched and when it receives a value.', @@ -156,7 +156,7 @@ class CanvasWidget extends Canvas { if (!this.getProp('onDraw')) return - if (this.getProp('autoClear')) { + if (this.getProp('autoClear') && this.getProp('contextType') === '2d') { this.clear() this.ctx.beginPath() } From bdfade96a7c264185953727dca35ca7aeb89a783 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 10 Sep 2025 01:45:54 +0200 Subject: [PATCH 021/311] build: migrate build system to rollup & rm app/ from repository --- .babelrc | 13 --- .gitignore | 16 +--- app/assets/themes/.gitignore | 2 - app/client/.gitignore | 2 - app/docs/.htaccess | 1 - app/launcher/.gitignore | 2 - app/server/.keep | 0 package.json | 33 ++++---- scripts/build-client.js | 98 --------------------- scripts/build-css.js | 2 + scripts/build-launcher.js | 16 ---- scripts/build-server.js | 27 ------ scripts/build.js | 49 ----------- scripts/client.plugin-watch.js | 40 +++++++++ scripts/client.rollup.config.js | 99 ++++++++++++++++++++++ scripts/copy-assets.js | 65 -------------- scripts/launcher.rollup.config.js | 47 ++++++++++ scripts/license-header.txt | 7 ++ scripts/package-node.js | 6 +- scripts/server.rollup.config.js | 58 +++++++++++++ {app => src/app}/index.js | 0 src/client/ui/context-menu.js | 2 +- src/client/ui/notifications.js | 2 +- src/client/ui/ui-code-editor.js | 10 +-- src/client/ui/ui-colorpicker.js | 2 +- src/client/ui/ui-console.js | 12 +-- src/client/ui/ui-dragresize.js | 2 +- src/client/ui/ui-filebrowser.js | 2 +- src/client/ui/ui-fileupload.js | 2 +- src/client/ui/ui-inspector-field.js | 2 +- src/client/ui/ui-inspector.js | 2 +- src/client/ui/ui-keyboard.js | 2 +- src/client/ui/ui-modal.js | 2 +- src/client/ui/ui-selectarea.js | 2 +- src/client/ui/ui-tree.js | 2 +- src/client/widgets/basics/button.js | 2 +- src/client/widgets/basics/dropdown.js | 2 +- src/client/widgets/basics/file.js | 2 +- src/client/widgets/basics/input.js | 2 +- src/client/widgets/basics/menu.js | 2 +- src/client/widgets/basics/switch.js | 2 +- src/client/widgets/basics/textarea.js | 2 +- src/client/widgets/common/canvas.js | 2 +- src/client/widgets/common/widget.js | 2 +- src/client/widgets/containers/clone.js | 2 +- src/client/widgets/containers/fragment.js | 2 +- src/client/widgets/containers/modal.js | 2 +- src/client/widgets/containers/panel.js | 2 +- src/client/widgets/containers/patchbay.js | 2 +- src/client/widgets/frames/frame.js | 2 +- src/client/widgets/frames/html.js | 2 +- src/client/widgets/frames/image.js | 2 +- src/client/widgets/frames/svg.js | 2 +- src/client/widgets/graphs/plot.js | 2 +- src/client/widgets/indicators/led.js | 2 +- src/client/widgets/indicators/text.js | 2 +- src/client/widgets/pads/canvas.js | 2 +- src/client/widgets/pads/pad.js | 2 +- src/client/widgets/pads/rgb.js | 2 +- src/client/widgets/scripts/gyro-archive.js | 2 +- src/client/widgets/sliders/range.js | 2 +- src/client/widgets/sliders/slider.js | 2 +- src/launcher/main.js | 2 +- src/launcher/settings.js | 2 +- src/launcher/terminal.js | 2 +- 65 files changed, 327 insertions(+), 362 deletions(-) delete mode 100644 .babelrc delete mode 100644 app/assets/themes/.gitignore delete mode 100644 app/client/.gitignore delete mode 100644 app/docs/.htaccess delete mode 100644 app/launcher/.gitignore delete mode 100644 app/server/.keep delete mode 100644 scripts/build-client.js delete mode 100644 scripts/build-launcher.js delete mode 100644 scripts/build-server.js delete mode 100644 scripts/build.js create mode 100644 scripts/client.plugin-watch.js create mode 100644 scripts/client.rollup.config.js delete mode 100644 scripts/copy-assets.js create mode 100644 scripts/launcher.rollup.config.js create mode 100644 scripts/license-header.txt create mode 100644 scripts/server.rollup.config.js rename {app => src/app}/index.js (100%) diff --git a/.babelrc b/.babelrc deleted file mode 100644 index c591efcc..00000000 --- a/.babelrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "presets": [ - ["@babel/env", { - "targets": { - "ios": "10.3", - "chrome": "60" - }, - "useBuiltIns": "usage", - "corejs": 3 - }] - ], - "plugins": ["@babel/plugin-proposal-object-rest-spread"] -} diff --git a/.gitignore b/.gitignore index a619f6df..40ce7479 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,4 @@ -node_modules -dist -app/LICENSE -app/assets/fonts/* -app/assets/*.css* -app/assets/*.png -app/client/*.js* -app/launcher/*.js* -app/server/* -app/docs/* -!app/docs/.htaccess -!app/server/.keep -app/package.json +node_modules/ +dist/ +/app/ *.pyc diff --git a/app/assets/themes/.gitignore b/app/assets/themes/.gitignore deleted file mode 100644 index d6b7ef32..00000000 --- a/app/assets/themes/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/app/client/.gitignore b/app/client/.gitignore deleted file mode 100644 index d6b7ef32..00000000 --- a/app/client/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/app/docs/.htaccess b/app/docs/.htaccess deleted file mode 100644 index de377bfe..00000000 --- a/app/docs/.htaccess +++ /dev/null @@ -1 +0,0 @@ -ErrorDocument 404 /404.html diff --git a/app/launcher/.gitignore b/app/launcher/.gitignore deleted file mode 100644 index d6b7ef32..00000000 --- a/app/launcher/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/app/server/.keep b/app/server/.keep deleted file mode 100644 index e69de29b..00000000 diff --git a/package.json b/package.json index ada8292c..76033892 100644 --- a/package.json +++ b/package.json @@ -21,17 +21,18 @@ "license": "GPL-3.0", "dependencies": { "@babel/core": "7.18.0", - "@babel/eslint-parser": "7.17.0", - "@babel/plugin-proposal-object-rest-spread": "7.18.0", - "@babel/polyfill": "7.12.1", "@babel/preset-env": "7.18.0", "@electron/remote": "2.0.8", + "@rollup/plugin-babel": "^6.0.4", + "@rollup/plugin-commonjs": "^28.0.6", + "@rollup/plugin-json": "^6.1.0", + "@rollup/plugin-node-resolve": "^16.0.1", + "@rollup/plugin-terser": "^0.4.4", "ace-builds": "1.39.0", "ansi-html": "0.0.9", "babelify": "10.0.0", "balanced-match": "2.0.0", "bonjour": "github:jean-emmanuel/bonjour", - "browserify": "17.0.0", "chokidar": "3.5.3", "chroma-js": "2.4.2", "core-js": "3.22.5", @@ -65,6 +66,10 @@ "python-shell": "3.0.1", "qrcode": "1.5.1", "replacestream": "4.0.3", + "rollup": "4.50.1", + "rollup-plugin-copy": "3.5.0", + "rollup-plugin-license": "^3.6.0", + "rollup-plugin-node-externals": "^8.1.1", "sanitize-html": "1.27.5", "sass": "1.89.2", "scope-css": "1.2.1", @@ -74,9 +79,6 @@ "sortablejs": "1.15.0", "source-map-support": "0.5.21", "stacktrace-js": "2.0.2", - "through": "2.3.8", - "uglifyify": "5.0.2", - "webworkify": "1.5.0", "ws": "8.6.0", "yargs": "17.5.1" }, @@ -88,21 +90,20 @@ "scripts": { "postinstall": "echo '\\033[36m=> Dependencies installed successfully. Run \"npm run build\" to build the assets.\\033[0m\n'", "start": "electron app/", - "build": "npm run build-css && npm run build-js && node scripts/copy-assets.js && echo '\\033[36m=> JS and CSS assets built successfully. Run \"npm run package\" to build an executable or \"npm start\" to run the app.\\033[0m\n'", + "build": "npm run build-css && npm run build-js && echo '\\033[36m=> JS and CSS assets built successfully. Run \"npm run package\" to build an executable or \"npm start\" to run the app.\\033[0m\n'", "package": "node scripts/package.js", "package-node": "node scripts/package-node.js", "deb64": "electron-installer-debian --src dist/open-stage-control-linux-x64/ --arch amd64 --dest dist/open-stage-control-linux-x64/ --icon resources/images/logo.png", "rpm64": "electron-installer-redhat --src dist/open-stage-control-linux-x64/ --arch x86_64 --dest dist/open-stage-control-linux-x64/ --icon resources/images/logo.png", "build-css": "node scripts/build-css.js", - "build-js": "npm run build-launcher-js && npm run build-client-js && npm run build-server-js", - "build-client-js": "node scripts/build-client.js", - "build-launcher-js": "node scripts/build-launcher.js", - "build-server-js": "node scripts/build-server.js", - "watch-client": "npm run build-client-js -- --watch", - "watch-browser": "npm run build-client-js -- --watch", "watch-css": "nodemon --watch src/scss -e scss -x \"npm run build-css -- --reload\"", - "watch-server": "nodemon --watch src/server/ -e js -x \"npm run build-server-js\"", - "watch-launcher": "nodemon --watch src/launcher/ -e js -x \"npm run build-launcher-js\"", + "build-js": "npm run build-launcher-js && npm run build-client-js && npm run build-server-js", + "build-client-js": "rollup -c scripts/client.rollup.config.js", + "watch-client": "npm run build-client-js -- --watch", + "build-server-js": "rollup -c scripts/server.rollup.config.js", + "watch-server": "npm run build-server-js -- --watch", + "build-launcher-js": "rollup -c scripts/launcher.rollup.config.js", + "watch-launcher": "npm run build-launcherr-js -- --watch", "build-docs": "node scripts/build-widgets-reference.js > resources/docs/docs/widgets/properties-reference.md && cd resources && python3 -m mkdocs build", "test": "eslint src && npm run build && node tests/test.js" }, diff --git a/scripts/build-client.js b/scripts/build-client.js deleted file mode 100644 index f6e4b64b..00000000 --- a/scripts/build-client.js +++ /dev/null @@ -1,98 +0,0 @@ -var build = require('./build'), - path = require('path'), - babelify = require('babelify'), - nanohtml = require('nanohtml'), - watch = process.argv.includes('--watch'), - through = require('through'), - minimatch = require('minimatch') - - -var ignores = ['**/*.min.js', '**/jquery.ui.js', 'gyronorm.complete.min.js'], - transformWrapper = function(transform){ - return function(file, opts){ - if (ignores.some(pattern => minimatch(file, pattern))) { - return through() - } else { - return transform(file, opts) - } - } - } - -var transforms = [ - [transformWrapper(nanohtml)], - [transformWrapper(babelify)] -] - -console.warn('\033[36m=> Building compressed client scripts...\033[0m') -transforms.push([transformWrapper(require('uglifyify')), {global: true, safari10: true}]) - -var bundle = build({ - input: '../src/client/index.js', - output: '../app/client/open-stage-control-client.js', - options: { - debug: true, - insertGlobals: false, - noParse: ['**/*.min.js', '**/jquery.ui.js'], - cache: {}, - packageCache: {}, - }, - plugins: watch ? [require('watchify')] : [], - transforms: transforms, - ignore: [ - 'postcss' // only needed by sanitize-html if