Commit Graph

95 Commits

Author SHA1 Message Date
Mike Sawka
c7a60a80f8
initwshrpc in electron (#391) 2024-09-17 23:10:09 -07:00
Evan Simkowitz
9f53524971
update version regex 2024-09-17 14:03:10 -07:00
Evan Simkowitz
5b7535d08f
Add release channels (#385)
## New release flow

1. Run "Bump Version" workflow with the desired version bump and the
prerelease flag set to `true`. This will push a new version bump to the
target branch and create a new git tag.
    - See below for more info on how the version bumping works.
2. A new "Build Helper" workflow run will kick off automatically for the
new tag. Once it is complete, test the new build locally by downloading
with the [download
script](https://github.com/wavetermdev/thenextwave/blob/main/scripts/artifacts/download-staged-artifact.sh).
3. Release the new build using the [publish
script](https://github.com/wavetermdev/thenextwave/blob/main/scripts/artifacts/publish-from-staging.sh).
This will trigger electron-updater to distribute the package to beta
users.
4. Run "Bump Version" again with a release bump (either `major`,
`minor`, or `patch`) and the prerelease flag set to `false`.
6. Release the new build to all channels using the [publish
script](https://github.com/wavetermdev/thenextwave/blob/main/scripts/artifacts/publish-from-staging.sh).
This will trigger electron-updater to distribute the package to all
users.

## Change Summary

Creates a new "Bump Version" workflow to manage versioning and tag
creation.

Build Helper is now automated.

### Version bumps

Updates the `version.cjs` script so that an argument can be passed to
trigger a version bump. Under the hood, this utilizes NPM's `semver`
package.

If arguments are present, the version will be bumped.
If only a single argument is given, the following are valid inputs:
    - `none`: No-op.
    - `patch`: Bumps the patch version.
    - `minor`: Bumps the minor version.
    - `major`: Bumps the major version.
    - '1', 'true': Bumps the prerelease version.
If two arguments are given, the first argument must be either `none`,
`patch`, `minor`, or `major`. The second argument must be `1` or `true`
to bump the prerelease version.

### electron-builder

We are now using the release channels support in electron-builder. This
will automatically detect the channel being built based on the package
version to determine which channel update files need to be generated.
See
[here](https://www.electron.build/tutorials/release-using-channels.html)
for more information.

### Github Actions

#### Bump Version

This adds a new "Bump Version" workflow for managing versioning and
queuing new builds. When run, this workflow will bump the version,
create a new tag, and push the changes to the target branch. There is a
new dropdown when queuing the "Bump Version" workflow to select what
kind of version bump to perform. A bump must always be performed when
running a new build to ensure consistency.

I had to create a GitHub App to grant write permissions to our main
branch for the version bump commits. I've made a separate workflow file
to manage the version bump commits, which should help prevent tampering.
Thanks to using the GitHub API directly, I am able to make these commits
signed!

#### Build Helper

Build Helper is now triggered when new tags are created, rather than
being triggered automatically. This ensures we're always creating
artifacts from known checkpoints.

### Settings

Adds a new `autoupdate:channel` configuration to the settings file. If
unset, the default from the artifact will be used (should correspond to
the channel of the artifact when downloaded).

## Future Work

I want to add a release workflow that will automatically copy over the
corresponding version artifacts to the release bucket when a new GitHub
Release is created.

I also want to separate versions into separate subdirectories in the
release bucket so we can clean them up more-easily.

---------

Co-authored-by: wave-builder <builds@commandline.dev>
Co-authored-by: wave-builder[bot] <181805596+wave-builder[bot]@users.noreply.github.com>
2024-09-17 13:10:35 -07:00
Evan Simkowitz
822920bd2c
fix dirname issue 2024-09-16 15:58:35 -07:00
Evan Simkowitz
891fab7422
fix type error in emain 2024-09-11 11:28:26 -07:00
Mike Sawka
5fe0cae244
wsh web (#358) 2024-09-10 12:50:55 -07:00
sawka
5190556c37 always recreate existing window if possible (for the last window only) 2024-09-09 11:49:57 -07:00
sawka
98a55b2290 updates for local 2024-09-05 18:54:12 -07:00
sawka
fc5e53e476 update FE paths 2024-09-05 15:01:28 -07:00
Mike Sawka
a5f563b52d
new directory structure and oldmigrate (#327) 2024-09-05 14:05:42 -07:00
Evan Simkowitz
0413b240dd
Only copy the relevant wavesrv binary when packaging for a specific architecture (#316)
This change shaves ~20 MB off the download size by only copying over the
wavesrv binary that is relevant for whichever architecture we're
currently packaging. This is only relevant for macOS at the moment,
though it can also apply to Windows when we get multi-arch builds
working.

This required renaming our Go binaries from .amd64 to .x64 to comply
with electron-builder's naming conventions.
2024-09-04 11:23:39 -07:00
Evan Simkowitz
0de41fab08
Fix the client version in the about modal (#315)
The client version in the about modal was hard-coded. Now, it will use
the same values that powered the Electron about modal.
2024-09-03 21:45:44 -07:00
Evan Simkowitz
b7ed626667
fix settings check in updater code 2024-09-03 19:16:04 -07:00
Mike Sawka
a104a6e446
new focus system part 1 (#290) 2024-08-29 16:06:15 -07:00
Mike Sawka
8630e23239
new config system (#283) 2024-08-27 18:49:49 -07:00
Mike Sawka
ab5a9ec749
update window close logic for windows/linux (#268)
Co-authored-by: Sylvia Crowe
2024-08-26 22:03:43 -07:00
Evan Simkowitz
7648eaf7e9
don't log auth key on startup, lol 2024-08-26 13:53:04 -07:00
Evan Simkowitz
59a2b9b787
Replace default edit menu with one that won't eat keyboard shortcuts (#274)
We only need global Cut/Copy/Paste accelerators on macOS. Linux and
Windows do these automatically. Additionally, having these accelerators
means that we can't use shortcuts like Ctrl+C in the terminal. This PR
removes these accelerators for every platform but macOS.
2024-08-26 13:30:19 -07:00
Evan Simkowitz
3777cd1eb0
move authkey request injection to after app is ready 2024-08-26 13:20:37 -07:00
Evan Simkowitz
e527e2ab77
Add authkey header for requests to the backend (#256)
With this PR, Electron will generate a new authorization key that the Go
backend will look for in any incoming requests. The Electron backend
will inject this header with all requests to the backend to ensure no
additional work is required on the frontend.

This also adds a `fetchutil` abstraction that will use the Electron
`net` module when calls are made from the Electron backend to the Go
backend. When using the `node:fetch` module, Electron can't inject
headers to requests. The Electron `net` module is also faster than the
Node module.

This also breaks out platform functions in emain into their own file so
other emain modules can import them.
2024-08-21 15:04:39 -07:00
Evan Simkowitz
bd4bf93d4a
Update copyright indicators on a bunch of files (#255) 2024-08-20 17:01:29 -07:00
Evan Simkowitz
b3de31d0c9
don't register event handler for window controls overlay on darwin 2024-08-20 15:58:21 -07:00
Evan Simkowitz
5c00fc6e78
Fix sharp import issue (#251)
This PR updates the window controls overlay code to remove the
dependency on `sharp`, which is a natively-compiled Node library that is
really hard to package for Electron given the way that we strip node
modules after bundling. I've replaced this with `pngjs`, which has a
smaller footprint and is still relatively fast (it doesn't need to be
perfect since it runs on the Node process instead of the browser
process).
2024-08-20 13:18:47 -07:00
sawka
2f020099ec cmd:n and cmd:t 2024-08-19 22:39:52 -07:00
Red J Adaya
964c422a02
about modal (#244) 2024-08-19 15:49:40 -07:00
Evan Simkowitz
e6003c310e
Set background color for window controls on Linux (#247)
The Window Controls Overlay API applies a transparent overlay on
Windows, but not on Linux. This PR addresses this by capturing the area
underneath the overlay, averaging the color of the area, and setting
this as the overlay background color.

It will also detect whether to make the control symbols white or black,
depending on how dark the background color is.

On Linux, this will set both the background color and the symbol color,
on Windows it will just set the symbol color.

<img width="721" alt="image"
src="https://github.com/user-attachments/assets/e6f9f8f8-a49f-41b6-984e-09e7d52c631d">
2024-08-19 14:16:09 -07:00
Evan Simkowitz
edfe711eda
Use Window Controls Overlay API for native-like experience on Windows and Linux (#240)
This PR implements the [Window Controls Overlay
API](https://web.dev/articles/window-controls-overlay) to let us hide
the menu bar on Windows and Linux and directly embed the window controls
in our tab bar. With #239 merged, we no longer need the menu bar on
these platforms.

The overlaid window controls are transparent so they will take on the
background from the app. I've updated the tab bar to flow properly using
the API's CSS environment variables.

At some point, we may want to update the logic around the symbolColor so
that it can ensure a proper contrast between the background and the
symbols in the window controls. For now, setting them to white works for
all the backgrounds we currently support.

![image
(2)](https://github.com/user-attachments/assets/7610f10b-9696-435c-9a2d-a435bee9fadb)


https://github.com/user-attachments/assets/8d19b512-5281-42b9-8abb-ccb9b850061f
2024-08-16 23:45:22 -07:00
Evan Simkowitz
03587184a0
Replace logo with platform-dependent button to open app menu (#239)
Replace the logo in the tab bar with an ellipsis icon that shows on
Linux and Windows and, when clicked, opens up the system menus. This
also fixes an issue I noticed where the context menus were set to the
wrong coordinates when a window was zoomed in.


![image](https://github.com/user-attachments/assets/1be77cad-73a6-4cb8-b545-08ec908f1d9a)

![image](https://github.com/user-attachments/assets/0beef938-15f8-4084-b7bd-7d9f995187ef)
2024-08-16 16:18:42 -07:00
Sylvie Crowe
c192fe2663
Windows Pty (#206)
Add Windows Pty support, so the terminal works properly on windows
machines
2024-08-09 18:49:35 -07:00
Mike Sawka
ed0279ad72
adding telemetry updates (#209) 2024-08-08 18:24:54 -07:00
sawka
4641271bfa show the buildtimes in the about page 2024-08-08 13:39:17 -07:00
Evan Simkowitz
b8124bbc2e
Clean up the Updater class and fix a runaway interval (#207) 2024-08-08 11:55:44 -07:00
sawka
3c8bac6bf9 add console logs in front of all GetSettingsConfig calls in emain 2024-08-07 14:10:14 -07:00
sawka
4e88a27d9e fix zoom in/out to affect webcontents not webview 2024-08-06 19:47:02 -07:00
Evan Simkowitz
8ebdb58f4b
Use button for update available banner (#202) 2024-08-06 16:48:25 -07:00
Evan Simkowitz
21684b0995
use native install on quit instead 2024-08-06 16:30:42 -07:00
Evan Simkowitz
61f02b27d2
get update status on start, install update on quit 2024-08-06 16:19:55 -07:00
Evan Simkowitz
5f229048be
restart interval in checkForUpdates if update setting changes 2024-08-06 16:13:14 -07:00
Evan Simkowitz
acb6a87ca4
fix comment 2024-08-06 16:09:24 -07:00
Evan Simkowitz
2f2bbd0a27
Check for updates always if user requests it, add comments 2024-08-06 16:08:49 -07:00
Evan Simkowitz
bc26d643ca
don't set lastupdatecheck time if requested by user 2024-08-06 15:36:21 -07:00
Evan Simkowitz
5187150e3f
await more async functions in emain 2024-08-06 15:32:29 -07:00
Evan Simkowitz
335ab6d55d
fix check for updates, ensure quitAndInstall is not interrupted 2024-08-06 15:13:59 -07:00
Evan Simkowitz
7420044f2f
fix check-for-updates 2024-08-06 14:51:06 -07:00
Evan Simkowitz
46482a7f67
fix isDev check for auto updater 2024-08-06 14:25:30 -07:00
Evan Simkowitz
824a8540ff
Add banner for app updates, clean up updater logic (#200)
This improves the app updater so that it doesn't rely on unreliable
system notifications. Now, a banner in the tab bar will display when an
update is available. Clicking this will prompt the user to restart the
app and complete the installation.

This also updates the tab bar to move to the smaller tab size earlier so
we don't need to make the tab bar scrollable as much.


![image](https://github.com/user-attachments/assets/79e24617-d609-4554-bdb2-979f810a9b66)
2024-08-06 11:05:26 -07:00
sawka
c8cc1de2d4 add 'dev' label to application. also add 'un-magnify' icon when magnified 2024-08-01 13:46:06 -07:00
sawka
0a9418be10 restore emain 2024-08-01 02:05:48 -07:00
Sylvia Crowe
09ce3de108 fix: change emain imports for windows build 2024-08-01 01:12:30 -07:00
sawka
49a365e10b remove video, make initial window larger to fill the screen 2024-08-01 00:52:15 -07:00