[v2] Update Workflows + runtime

This commit is contained in:
Lea Anthony
2021-09-13 19:35:14 +10:00
parent abbbdda102
commit 5ab5246aa0
11 changed files with 29 additions and 31 deletions
+2 -2
View File
@@ -14,8 +14,8 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: 14.17.6
# cache: 'npm'
# cache-dependency-path: v2/internal/frontend/runtime/package-lock.json
cache: 'npm'
cache-dependency-path: v2/internal/frontend/runtime/package-lock.json
- run: npm install
working-directory: v2/internal/frontend/runtime
- run: npm run build
@@ -36,6 +36,9 @@ func (d *Dispatcher) ProcessMessage(message string, sender frontend.Frontend) (s
return d.processCallMessage(message, sender)
case 'W':
return d.processWindowMessage(message, sender)
case 'Q':
sender.Quit()
return "", nil
default:
return "", errors.New("Unknown message from front end: " + message)
}
@@ -71,8 +71,6 @@ func (d *Dispatcher) processWindowMessage(message string, sender frontend.Fronte
w := d.mustAtoI(parts[0])
h := d.mustAtoI(parts[1])
go sender.WindowSetMinSize(w, h)
case 'C':
sender.Quit()
default:
d.log.Error("unknown Window message: %s", message)
}
@@ -14,6 +14,11 @@ import {Callback, callbacks} from './calls';
import {SetBindings} from "./bindings";
import * as Window from "./window";
export function Quit() {
window.WailsInvoke('Q');
}
// The JS runtime
window.runtime = {
...Log,
@@ -23,6 +28,7 @@ window.runtime = {
EventsOnMultiple,
EventsEmit,
EventsOff,
Quit
};
// Internal wails endpoints
@@ -185,12 +185,3 @@ export function WindowSetRGBA(RGBA) {
window.WailsInvoke('Wr:' + rgba);
}
/**
* Close the Window
*
* @export
*/
export function WindowClose() {
window.WailsInvoke('WC');
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -13,8 +13,14 @@ import * as Log from "./log";
import * as Events from './events';
import * as Window from './window';
export function Quit() {
window.runtime.Quit();
}
export default {
...Log,
...Events,
...Window,
Quit
};
+1 -1
View File
@@ -73,7 +73,7 @@ interface runtime {
WindowSetRGBA(rgba: RGBA): void;
WindowClose(): void
Quit(): void
}
declare global {
File diff suppressed because one or more lines are too long
@@ -185,12 +185,3 @@ export function WindowUnminimise() {
export function WindowSetRGBA(RGBA) {
window.runtime.WindowSetRGBA(RGBA);
}
/**
* Close the Window
*
* @export
*/
export function WindowClose() {
window.runtime.WindowClose();
}