Commit Graph

282 Commits

Author SHA1 Message Date
Gergely Nagy
15eeff1b58 Move xml2js to devDependencies as well
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-30 13:39:22 +02:00
Gergely Nagy
da18eb96bd Move unraw to devDependencies
It is only used during the build, to generate the CLDR data, no reason to
include it among the runtime dependencies.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-30 13:29:19 +02:00
Gergely Nagy
9a520ec55f Drop the react-localization dependency
We're using react-18next, rather than react-localization. Drop the latter, since
it is unused.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-30 13:24:54 +02:00
Gergely Nagy
29222b32c1 package.json: Only include the dfu-util binaries for the current platform
There's no need to include `dfu-util` for every platform in a platform-specific
build, so include only those that match the platform. If the platform has
multiple architectures, we'll include `dfu-util` for all of them, in every build
for the platform.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-30 13:17:10 +02:00
Gergely Nagy
05c60df247 Do not include static/cldr in packaged builds
We only use `static/cldr` during the build, to pregenerate CLDR data. Do not
include it in packaged builds.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-30 13:04:30 +02:00
Gergely Nagy
c981d7fd29 Move cldr to devDependencies
The `cldr` package is only used at compile time, to pre-generate the CLDR
keyboard layout data. There is no reason to include it among the dependencies.

Moving it to `devDependencies` shaves about 20Mb off of the packages built, and
a whole lot more when uncompressed: the cldr package is over 200mb uncompressed.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-30 12:51:37 +02:00
Gergely Nagy
a3578c87cd Bump version to 0.11.1-snapshot
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-28 15:05:16 +02:00
Gergely Nagy
3537255a98 Preparations for Chrysalis 0.11.0
Bump the version, and finalize the release date.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-28 09:29:10 +02:00
Gergely Nagy
13463523a2 Bump the version to 0.11.0-snapshot
We have enough major changes that the next version will be 0.11, rather than
0.10.5.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-27 22:12:54 +02:00
Gergely Nagy
ec8c30867a Overhaul of the flashing process
Our old flashing process suffered from a few shortcomings, biggest of which was
its reliance on timing, and retries being woefully incomplete. In practice, this
meant that if the key to help trigger bootloader mode was not pressed soon
enough, or was released too late, we ended up in a state Chrysalis could not
recover from, because it never tried the reset again.

The new process does away with the separate "bootloaderTrigger" and
"bootloaderWait" steps, and combines them into a single "bootloader" step, which
will take care of retrying the reboot too, whether from normal mode to
bootloader, or the other way around. This also moves the retry logic into the
flasher, out of `@api/focus`.

With the logic in the flasher, it can properly notify the renderer when the
keyboard is in an unexpected state, and the renderer can - and with this patch,
does - display an appropriate message the user can act on.

With retries in place, the flashing process should be more robust, and more
forgiving, and far less reliant on timing.

Fixes #941, and likely a whole lot of other, flashing related issues.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-27 01:37:17 +02:00
Gergely Nagy
c06d57fc8c Implement a firmware file auto update mechanism
Modeled after the application update mechanism, the firmware file auto-update
works in a similar way: if the feature is enabled (it is disabled by default),
it will check what's the latest version of the firmware on GitHub, and if it's
more recent than the version we ship with, and more recent than whatever we have
previously downloaded (if anything), then it will download the new bundle and
extract it.

The Firmware Update screen will ask the main process for the version, changelog,
and base directory to use for the default firmware. If firmware auto-update is
enabled, the main process will check first try the downloaded files, and only
fall back to the shipped version if we have nothing downloaded yet.

If firmware auto-update is disabled, then we won't even check if there's a new
version, because we'll almost always have an update, and we do not want to spam
notifications on every single startup.

Fixes #952.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-20 13:21:42 +02:00
Gergely Nagy
9224b074d9 Bump version to 0.10.5-snapshot
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-07 19:42:51 +02:00
Gergely Nagy
b293a2c685 Preparations for Chrysalis 0.10.4
Bump the version, and finalize the release date.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-07 16:33:45 +02:00
Gergely Nagy
7934f3729d Bump version to 0.10.4-snapshot
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-06 23:03:26 +02:00
Gergely Nagy
ddf17cd403 Preparations for Chrysalis 0.10.3
Bump the version, and finalize the release date.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-06 22:20:14 +02:00
Gergely Nagy
9e7af77542 FirmwareUpdate: Implement a Firmware Changes dialog
The dialog simply displays `static/firmware-changelog.md` rendered into HTML.
The file is read from the main process, for which a generic IPC named
`file.read` was implemented.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-06-25 01:14:55 +02:00
Gergely Nagy
21a1797501 windows: Build and publish a portable version too
Fixes #594.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-06-24 15:32:53 +02:00
Jesse Vincent
210c8770a9 Merge pull request #958 from keyboardio/cldr/pregenerate
Pregenerate the CLDR data, rather than loading it from the renderer
2022-06-23 19:46:20 -07:00
Jesse Vincent
637c57c30a Merge branch 'master' into auto-update 2022-06-23 19:44:42 -07:00
Gergely Nagy
32132bf351 Pregenerate the CLDR data, rather than loading it from the renderer
We still import cldr from the renderer process, for
`cldr.extractLanguageDisplayNames`, but that hopefully doesn't expect to be in a
node environment.

If it does, we'll have to push it (along with the cldr data) to the main process.

Fixes #924.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-06-23 18:16:18 +02:00
Gergely Nagy
e786edbe12 package.json: Set Keyboardio as the author
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-06-22 21:22:41 +02:00
Gergely Nagy
f4abea1c8d Implement an opt-in auto-upgrade mechanism
This replaces the old, fragile, latest version notification on the menubar with
an auto-upgrade mechanism.

While it is the main process that does the update, it is the renderer that
initiates it. We do this so that we have better control over the process, and
can display notifications on the renderer, without race conditions.

The renderer orchestrates the process via the `useAutoUpdate` hook, called by
the `App`. The hook itself will first tell the main process to check for
updates, which in turn will result in an `update-available` event being fired,
if there's an update. That event will get sent forward to the renderer as
`auto-update.update-available`, and the hook will display a toast. We handle the
rest of the upgrade process similarly, the main process pushing new
notifications to the renderer.

Because we don't want to force updates on everybody, the feature is opt-in, and
there's a new section in the User Interface tab of Preferences to enable the
feature.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-06-19 21:32:24 +02:00
Gergely Nagy
49a5521525 package.json: Add a zip target for macOS builds
We'll need the zip files for auto-update.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-06-10 07:53:04 +02:00
Gergely Nagy
79af3d9e08 Bump version to 0.10.3-snapshot
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-06-09 22:54:39 +02:00
Gergely Nagy
bc3b0f705f Preparations for Chrysalis 0.10.2
Bump the version, and finalize the release date.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-06-09 22:18:28 +02:00
Gergely Nagy
eb2ed3d9d5 Bump version to 0.10.2-snapshot
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-06-08 23:37:45 +02:00
Gergely Nagy
d265cf7be9 Preparations for Chrysalis 0.10.1
Bump the version, and finalize the release date.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-06-08 22:08:04 +02:00
Jesse Vincent
5ed4527cec Let our json pretty printer print lines up to 1k long in systeminfo
dumps to make them default to a more compact, more scannable format
2022-06-07 16:00:24 -07:00
Jesse Vincent
8d97a17573 Finish the revert of electron-universal 2022-06-05 13:58:20 -07:00
Jesse Vincent
2e6988faf1 Revert "Remove the legacy electron/universal from deps"
This reverts commit 85377935f9.
2022-06-05 13:57:07 -07:00
Gergely Nagy
afec94637c Revert "remove aliases for platform-specific builds"
This reverts commit 2dce9d5977, because our CI
setup depends on them.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-06-05 10:06:43 +02:00
Jesse Vincent
94ba535eaf Remove unused jest testing infrastructure. This should absolutely come
back, but with a modern setup
2022-06-04 22:05:36 -07:00
Jesse Vincent
a429baaf6e We don't have a direct dependency on terser.
(This doesn't change the version of terser in yarn.lock)
2022-06-04 22:05:36 -07:00
Jesse Vincent
2dce9d5977 remove aliases for platform-specific builds 2022-06-04 22:03:51 -07:00
Jesse Vincent
135dac7755 babel/core and electron/universal shouldn't end up packaged as part of
Chrysalis
2022-06-04 22:03:51 -07:00
Jesse Vincent
85377935f9 Remove the legacy electron/universal from deps 2022-06-04 22:03:51 -07:00
Jesse Vincent
9dbe5e9f56 electron-universal 1.3.0 has the patches we'd used a fork for 2022-06-04 22:03:51 -07:00
Jesse Vincent
8b4b909369 Remove two unused deps that were mistakenly included with the dnd
implementation
2022-06-04 22:03:51 -07:00
Gergely Nagy
01db9f21c4 Overhaul how Chrysalis does logging
We've been using a home-grown, pretty ad-hoc logging setup, which suffered from
a number of issues. It was simply bad, really. Log levels were all over the
place, logging was inconsistent, sometimes we logged to the console directly,
sometimes we only popped up a toast without logging it, and so on and so forth.

This is an overhaul of the whole thing.

We pull in the Winston logging library to help us out. This lets us store logs
in files too, along with logging to the developer console. We'll use this file
during the debug bundle creation, instead of keeping the session's log
in-memory.

Another big benefit of this rework is that I went through every place we log
from, and adjusted log levels to make more sense. I also added missing logging
to a number of places, so we'll get a much more useful, much more complete set
of logs.

With this new setup, we can have different log levels for the file transport,
and another for the console one. This in turn, allows us to turn down the log
level of console logs, while still having debug logs saved to disk.

Setting the log level in preferences now saves that setting, and will not reset
to the default when Chrysalis is started up again next time.

Fixes #881.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-06-03 15:38:47 +02:00
Jesse Vincent
cdfb0ad940 Initial implementation of drag and drop for macro steps 2022-06-02 12:15:22 -07:00
Jesse Vincent
bc4307fa3d Switch our background setting away from Helmet to use the theme 2022-06-02 12:01:52 -07:00
Gergely Nagy
403b510818 Preferences: Use a slightly darker body background
We want to make a few elements stand out a bit more, so we're setting a slightly
darker (or in case of dark mode, slightly lighter) background on body. We set it
on the body so it will be the default background, and we won't have to go to
great lengths to hide the original body background.

Because we need the background color  to be theme-dependent, we make use of the
`react-helmet` library, which helps us set properties on elements normally
outside of React's reach - like `body`.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-06-02 00:09:59 +02:00
Gergely Nagy
9a534d367f Downgrade Electron further, to 17
Unfortunately, we fail to build on macOS with Electron 18, so temporarily
downgrade to 17, because that builds on macOS, and printing appears to work on
both Windows and Linux.

We'll bump it back up later, once we figure out how to fix the build.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-06-01 13:05:06 +02:00
Jesse Vincent
9b7a60e634 Electron 19 appears to break printing for us. 2022-05-31 22:34:37 -07:00
Jesse Vincent
5898ec0eab Merge pull request #870 from keyboardio/dependencies/dependabot-updates
Update a few package resolutions to make dependabot happy
2022-05-30 16:54:54 -07:00
Gergely Nagy
481a7d8d5f Bump version to 0.10.1-snapshot
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-05-30 11:03:01 +02:00
Gergely Nagy
7b25be5d37 package.json: Adjust the glob-parent resolution
Another package pulled in transitively by `electron-webpack`. I have no idea how
and where this is used, but updating to 5.1.2 seems to work, so lets make
Dependabot happy.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-05-30 10:56:05 +02:00
Gergely Nagy
cb1cd35dea package.json: Adjust the node-forge resolution
The `node-forge` package is pulled in by `electron-webpack` via `selfsigned`.
It's not something we use directly or indirectly, and as such, is safe to
upgrade, and that should make Dependabot happy.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-05-30 10:49:26 +02:00
Gergely Nagy
29cf3fbdcd package.json: Adjust the async resolution for some packages
An unused dependeny of avrgirl-arduino depends on an ancient `async` package
Dependabot keeps complaining about. Adjust the dependency to a fixed version.

As we're not using the parts of AvrGirl that make use of this particular version
of async, there should be no issues. The parts we use were already using the 2.6
series.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-05-30 10:31:12 +02:00
Gergely Nagy
7ee2a11ea9 Preparations for Chrysalis 0.10.0
Bump the version, and finalize the release date.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-05-30 09:53:48 +02:00