| Commit message (Collapse) | Author | Age |
| |
|
| |
|
|
|
|
|
| |
The renderer package still has to use node module resolution to be able
to find MUI packages.
|
| |
|
|
|
|
| |
Requires some workarounds for ts-jest to find the vendored dependencies.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Changed jest to run from the root package and reference the packages
as projects. This required moving the base jest config file away from
the project root.
- Module isolation seems to prevent ts-jest from loading the shared
package, so we disabled it for now.
- To better facilitate mocking, services should be split into interfaces
and implementation
- Had to downgrade to chald 4.1.2 as per
https://github.com/chalk/chalk/releases/tag/v5.0.0 at least until
https://github.com/microsoft/TypeScript/issues/46452 is resolved.
|
|
|
|
|
|
| |
This doesn't seem to cause any race conditions (except for the warnings
that appear even if we install the extensions before initializing the
main window and are ignored by yarn watch).
|
|
|
|
|
|
| |
There are less opportunities now to optimize away code relying on
import.meta.env, but we can directly check for the presence of
import.meta.env.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now we can run with ESM at build and test time and transpile into
commonjs for electron. This greatly simplifies testing, since we treat
everything as ESM during build with esbuild anyways. Now the test
environment and the build scripts match the apparent (but not the actual
for the main, preload, and inject modules) runtime environment.
Caveats:
- We may use top-level async expressions in tests and script, but not in
code that gets transpiled into commonjs or scripts that get imported
by vite. The limitation w.r.t. commonjs seems fundamental.
- Jest only experimentally supports ESM and there are some limitations
with mocking. Most limitations (except the lack of automatic mocks)
can be worked around by async importing code that uses mocks.
- There are packages marked as modules (so that node reads any scripts
in them as ESM) that nevertheless get transpiled into commonjs
modules. However, these should be clearly marked by using a .cjs
extension as their bundle. The worst offender is the root package,
which has a .cjs as its main entry point that gets read by electron,
but is in fact marked as a module. This doesn't seem to bother electron
at all. The service-inject package is an IIFE with a .js extension,
but it outputs a fully self-contained bundle, so the choice of module
format should be irrelevant.
|
|
|
|
|
| |
The rest of the packages aren't buld with vite, so we shouldn't use its
typings.
|
|
|
|
|
|
|
|
|
|
| |
By running the build for the shared packages only once, errors in them
are reported only once in watch mode.
We still have to point jest to the original source files (and rebuild
the shared source files as part of the test), because it won't load the
"module" entry of the shared packages. However, as a benefit, jest can
now run even if the shared packages haven't been built yet.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
We will build all packages except the frontend (where vite remains in
use) with esbuild.
For some reason, the @yarnpkg/esbuild-plugin-pnp doesn't allow esbuild
to load esm modules and we fall back to commonjs for dependencies.
Hence we had to switch back to node_modules (but still rely on yarn
hardlinking for a more efficient install).
|
|
|
|
| |
This reverts commit 5c38af061348ec604337280009775832edc66270.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This way the shared store will be able to stay connected even if vite
HMR replaces the renderer code.
|
| |
|
| |
|
| |
|
|
|
|
| |
Jest mocking keeps the electron interaction testable
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
This reduces boilerplate and helps with config file robustness: if a
field is missing from the config file, it will be replaced with its
default value.
|
|
|
|
|
|
|
|
| |
* stores: reactive data structures to hold application state
* controllers: subscribe to store changes and call store actions in
response to external events from services
* services: integrate with the nodejs and electron environment (should
be mocked for unit testing)
|
|
|
|
|
|
|
|
| |
The architecture in the main process is split into 3 main parts:
* services: interfaces for services are injected into the stores through
the MainEnv interface (for testability)
* services/impl: electron-specific implementations of services
* stores: the actions of the stores can invoke (asynchronous) services
|
| |
|
|
|
|
|
| |
If we watch the containing directory, we can use inotify instead of stat
polling.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Since we don't plan to shim any APIs that must be present immediately
when the service loads, we might as well switch to asynchronous IPC for
fetching the script to inject into the main world.
|
|
|
|
| |
Disables some node flags in production and enables cookie encryption.
|
| |
|
| |
|
| |
|