aboutsummaryrefslogtreecommitdiffstats
path: root/packages/main/src/index.ts
Commit message (Collapse)AuthorAge
* chore: use node16 moduleResolution where possibleLibravatar Kristóf Marussy2022-05-26
| | | | | | | We can't do this in the renderer package, because we need to import MUI files that are not exported (MUI v6 is not ESM yet). Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* build: integration testing supportLibravatar Kristóf Marussy2022-05-16
| | | | | | Run integration tests in an electron environment for the main process. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* refactor: config file saving and debuggingLibravatar Kristóf Marussy2022-05-16
| | | | | | | | | | Reduce the number of dependencies and the amount of code running in a security sensitive context. Instead of a deep comparison, we just compare the serialized versions of the config files. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* feat: Add custom menubarLibravatar Kristóf Marussy2022-05-16
| | | | | | | | | | | The menu is populated reactive from the store with no caching. This doesn't seem to cause any performance problems so far. Currently the menu is electron-specific. In the future, we'll need a more runtime-independent way to build the menu. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* feat: Open in external browserLibravatar Kristóf Marussy2022-05-16
| | | | Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* feat: Load and switch servicesLibravatar Kristóf Marussy2022-02-14
| | | | Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* feat: Save selected service to fileLibravatar Kristóf Marussy2022-02-08
| | | | | | | Sophie start off from the service that was selected when it was last open. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* refactor: Extract main window hardeningLibravatar Kristóf Marussy2022-02-08
| | | | | | | This code is security critical, so it should be properly extracted to enable testing. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* refactor: Extract resource path managementLibravatar Kristóf Marussy2022-02-08
| | | | | | | Lets us access absolute paths and URLs without directly calling node APIs. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* refactor: Coding conventionsLibravatar Kristóf Marussy2022-02-08
| | | | | | | | | Make sure that files have a default import with the same name as the file whenever possible to reduce surprise. Also shuffles around some file names for better legibility. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* refactor: Apply shared store patches in batchesLibravatar Kristóf Marussy2022-02-08
| | | | | | Makes sure that the renderer always sees a consistent state. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* refactor: Move runtime state into shared modelsLibravatar Kristóf Marussy2022-02-08
| | | | | | | | | | | Now the runtime state lives inside the model (instead of being associated to the static settings via a map), which simplifies state management. Static settings are now located inside the runtime models, so we must create tests to make sure that the settings are being persisted correctly. The contents of the config file are now generated as a view of store (instead of a snapshot), which adds flexibility. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* feat: Add selected service field to SharedStoreLibravatar Kristóf Marussy2022-02-08
| | | | | | Lets the main process see which service is currently selected. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* feat: Source mapping for stacktraces in dev modeLibravatar Kristóf Marussy2022-02-08
| | | | | | We have to cheat again and use require() to lazy load a dev dependency. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* build: Add eslint-plugin-promiseLibravatar Kristóf Marussy2022-01-09
| | | | Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* build: Add eslint-plugin-unicornLibravatar Kristóf Marussy2022-01-09
| | | | Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* build: Add prettierLibravatar Kristóf Marussy2022-01-09
| | | | | | | eslint will also enforce prettier rules, so there is no need to call prettier separately in CI. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* build: Eslint fixes for multi-module projectLibravatar Kristóf Marussy2022-01-09
| | | | Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* New configurations based on review comments (WIP)Libravatar Vijay A2022-01-09
| | | | Signed-off-by: Vijay A <vraravam@users.noreply.github.com>
* Incorporate 'eslint' (fixes #3)Libravatar Vijay A2022-01-09
| | | | Signed-off-by: Vijay A <vraravam@users.noreply.github.com>
* Enhance 'About' dialog with more infoLibravatar Vijay A2022-01-03
| | | | Signed-off-by: Vijay A <vraravam@users.noreply.github.com>
* chore: Add @avijayr as a copyright holderLibravatar Kristóf Marussy2022-01-02
| | | | Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* Ensure that the 'userData' directory is present when starting up the appLibravatar Vijay A2022-01-02
| | | | Signed-off-by: Vijay A <vraravam@users.noreply.github.com>
* fix: Allow devtools extensions to be installedLibravatar Kristóf Marussy2022-01-02
| | | | | | | | | | | | | On the first startup in dev mode, Electron must be able to download the devtools extensions and wait for them to be installed. Loosens the UI process request filter a bit, but the behavior should match production mode in all cases except chrome webstore URLs. Nevertheless, only production mode should be considered secure. Fixes #6 Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* fix: Ensure dev user directory existsLibravatar Kristóf Marussy2022-01-02
| | | | | | Fixes #5 Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* feat: Load browserview contents asynchronouslyLibravatar Kristóf Marussy2022-01-01
| | | | | | Also changes the default browserview contents to the gitlab repo. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* chore: Add import extensions preparing for ts 4.6 nodenextLibravatar Kristóf Marussy2021-12-31
|
* refactor: Install devtools extensions earlierLibravatar Kristóf Marussy2021-12-30
| | | | | | 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).
* build: Switch to esbuildLibravatar Kristóf Marussy2021-12-30
| | | | | | | | | | 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).
* refactor: Functional design for controllersLibravatar Kristóf Marussy2021-12-28
|
* refactor: Get rid of dependency injectorLibravatar Kristóf Marussy2021-12-28
|
* refactor: Inversion of control with typed-injectLibravatar Kristóf Marussy2021-12-27
|
* refactor: Less boilerplate around SophieRendererLibravatar Kristóf Marussy2021-12-26
|
* refactor: Clarify main process architectureLibravatar Kristóf Marussy2021-12-26
| | | | | | | | * 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)
* refactor: Config persistence architectureLibravatar Kristóf Marussy2021-12-26
| | | | | | | | 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
* feat: Switch to json5 config formatLibravatar Kristóf Marussy2021-12-26
|
* refactor: Improved config reloadingLibravatar Kristóf Marussy2021-12-26
| | | | | If we watch the containing directory, we can use inotify instead of stat polling.
* feat: Config persistenceLibravatar Kristóf Marussy2021-12-26
|
* feat: Set nativeTheme theme source on dark modeLibravatar Kristóf Marussy2021-12-26
|
* refactor: Simplify browserViewBounds handlingLibravatar Kristóf Marussy2021-12-26
|
* feat: Disable main window devtools in productionLibravatar Kristóf Marussy2021-12-25
|
* refactor: Fetch service inject asynchronouslyLibravatar Kristóf Marussy2021-12-25
| | | | | | 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.
* fix: Restore accidentally deleted autoHideMenuBarLibravatar Kristóf Marussy2021-12-25
|
* feat: Harden window navigation and permissionsLibravatar Kristóf Marussy2021-12-25
|
* refactor: Simplify script injectionLibravatar Kristóf Marussy2021-12-25
| | | | | | | | | Inject CSS and main world scripts synchronously to avoid race conditions with page loading. Don't try to miming userAgentData for now, since it won't bypass google's checks. However, simply omitting chrome from the user agent does bypass them, at least for now.
* feat: Shim userAgentData in all frames and workersLibravatar Kristóf Marussy2021-12-24
| | | | Not good enough for google, we'll need a different approach.
* feat: User agent data simulatorLibravatar Kristóf Marussy2021-12-24
|
* feat: User-agent reductionLibravatar Kristóf Marussy2021-12-24
| | | | | Unfortunately, the reduced user-agent doesn't fool the google login form, but at least reduces the amount of leaked information.
* refactor: Load ui and service in parallelLibravatar Kristóf Marussy2021-12-24
|
* feat: Alternative background color workaroundLibravatar Kristóf Marussy2021-12-24
| | | | | | | Let's try injecting CSS to set the background color of html to white (instead of transparent) into the loaded pages. The CSS is injected before the website's own styles load, so they should always have the lowest priority.