aboutsummaryrefslogtreecommitdiffstats
path: root/packages/shared/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>
* feat: Certificate viewerLibravatar Kristóf Marussy2022-05-16
| | | | | | | | | | Show certificates with an interface modeled after firefox's certificate viewer so that they can be inspected before trusting. The current implementation assumes that each certificate has a unique fingerprint (collisions are astronomically unlikely). Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* feat: Always show location bar on errorLibravatar Kristóf Marussy2022-05-16
| | | | | | | | | | | | | | The location bar should be visible on error page to let people see and change the URL if needed. Additionally, it must be visible on insecure connections to show people that the connection if not secure. In the future, the location bar should also be shown if the loaded website is uncommon in the context of the current service, i.e., it is not explcitly allowlisted by the recipe. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* refactor: Use i18next for language resolutionLibravatar Kristóf Marussy2022-05-16
| | | | | | | | | | | | | | | | | | | Due to https://github.com/i18next/i18next/issues/1564 we still have to implement our own language resolution, but we can rely on resolvedLanguage to determine which language to pass through to the renderer. We will use the language detected by chromium as the system locale, so there is no need to use os-locale for detection any more. We use i18next in the main process do resolve the language, then set the resolve (not requested!) language in the renderer process to avoid doing resolution twice. This avoids the need in the renderer process to know the list of supported languages. We set the language and the writing direction in HTML in the renderer. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* feat(main): Language setting in config fileLibravatar Kristóf Marussy2022-05-16
| | | | | | | | | | | | | | | Load localization according to either the environment or the configuration file from the list of supported locales. Ideally, we would also set the chromium locale with --lang, but by the time we have read the config file (to known which locale to set), electron has already initialized the chromium resource bundle. So the chromium localization will always be auto-detected by chromium. Also makes startup hopefully a bit faster by doing more things concurrently while the localization and the main window is being loaded. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* feat(renderer): Renderer translationsLibravatar Kristóf Marussy2022-05-16
| | | | | | | | | Add react-i18n to make us able to use i18next translations in the renderer process just like we do in the main process. Translations are hot-reloaded automatically. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* feat: Temporary certificate acceptance backendLibravatar Kristóf Marussy2022-03-15
| | | | | | | | | | | | | We use the 'certificate-error' event of webContents to detect certificate verification errors and display a message to manually trust the certificate. Certificates are trusted per profile and only until Sophie is restarted. We still need to build the associated UI, the current one is just a rough prototype for debugging. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* feat: Location bar actionsLibravatar Kristóf Marussy2022-03-06
| | | | | | | | | | The buttons and the text field in the location bar shall now affect the BrowserView of the loaded service. Some error handling is still needed, e.g., when loading a web page fails due to a DNS error. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* refactor: Shared model type factoriesLibravatar Kristóf Marussy2022-03-06
| | | | | | | | | | | | | | | Allows customization of stores both in the renderer and in the main process. Instead of exposing a basic model type from the shared module (which was be overwritted with more specific props in the main package), we expose factory function that can create specific model types in both the renderer and the main process. Using these package-specific customization to stores, the renderer package can attach IPC calls directly to store objects, which the main package can attach the handlers for IPC calls and other internal actions. 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: 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 RuntimeService storeLibravatar Kristóf Marussy2022-02-08
| | | | | | | Stores transient state for services shared between the main and renderer processes. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* feat: Add Profile and Service storesLibravatar Kristóf Marussy2022-02-08
| | | | | | | | | | In the main process, it is optional to specify the ID of a Profile or a Service. The missing ID will be filled in with a randomly generated one. Moreover, services without a profile will get a profile generated with the same name. 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>
* chore: Add import extensions preparing for ts 4.6 nodenextLibravatar Kristóf Marussy2021-12-31
|
* refactor: Less boilerplate around SophieRendererLibravatar Kristóf Marussy2021-12-26
|
* refactor: Make all stores optionalLibravatar Kristóf Marussy2021-12-26
| | | | | | 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.
* feat: Set nativeTheme theme source on dark modeLibravatar Kristóf Marussy2021-12-26
|
* feat: Service to main process communicationLibravatar Kristóf Marussy2021-12-24
|
* feat: Add BrowserView and synchronize its positionLibravatar Kristóf Marussy2021-12-23
|
* chore: Add license headersLibravatar Kristóf Marussy2021-12-23
| | | | | Centralizes vite configuration to be able to add license banners to outputs in one place.
* feat: Main to renderer store synchronizationLibravatar Kristóf Marussy2021-12-23
| | | | | | | | | | | | Patches are send in one direction only, from the main to the renderer, so all actions have to go through the context bridge and the renderer IPC to modify the store in the renderer. This makes the store in the main process a single source of truth, which simplifies debugging and state persistence. The store in the renderer is connected to redux devtools for inspection, but playing back the state in the devtools won't change the sotre in main process.
* feat: Add shared package for electron ipcLibravatar Kristóf Marussy2021-12-23