@xwiki/cristal-electron-main 0.16.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xwiki/cristal-electron-main",
3
- "version": "0.16.0",
3
+ "version": "0.18.0",
4
4
  "license": "LGPL 2.1",
5
5
  "author": "XWiki Org Community <contact@xwiki.org>",
6
6
  "homepage": "https://cristal.xwiki.org/",
@@ -13,19 +13,19 @@
13
13
  "url": "https://jira.xwiki.org/projects/CRISTAL/"
14
14
  },
15
15
  "dependencies": {
16
- "electron": "35.0.1",
16
+ "electron": "36.0.0",
17
17
  "reflect-metadata": "0.2.2",
18
- "@xwiki/cristal-browser-electron": "0.16.0",
19
- "@xwiki/cristal-electron-authentication-github-main": "0.16.0",
20
- "@xwiki/cristal-configuration-electron-main": "0.16.0",
21
- "@xwiki/cristal-electron-authentication-xwiki-main": "0.16.0",
22
- "@xwiki/cristal-electron-authentication-nextcloud-main": "0.16.0",
23
- "@xwiki/cristal-electron-storage": "0.16.0"
18
+ "@xwiki/cristal-browser-electron": "0.18.0",
19
+ "@xwiki/cristal-electron-authentication-nextcloud-main": "0.18.0",
20
+ "@xwiki/cristal-electron-authentication-github-main": "0.18.0",
21
+ "@xwiki/cristal-electron-settings-main": "0.18.0",
22
+ "@xwiki/cristal-electron-storage": "0.18.0",
23
+ "@xwiki/cristal-electron-authentication-xwiki-main": "0.18.0"
24
24
  },
25
25
  "devDependencies": {
26
- "@types/node": "22.13.10",
27
- "typescript": "5.8.2",
28
- "vite": "6.2.2"
26
+ "@types/node": "22.15.3",
27
+ "typescript": "5.8.3",
28
+ "vite": "6.3.5"
29
29
  },
30
30
  "scripts": {
31
31
  "build": "tsc --project tsconfig.json && vite build",
package/src/index.ts CHANGED
@@ -24,19 +24,15 @@ import { loadFile } from "./reload";
24
24
  import "./security-restrictions";
25
25
  // @ts-expect-error shouldn't happen, but we need to generate the types for the whole project once.
26
26
  import loadBrowser from "@xwiki/cristal-browser-electron/main";
27
- import { load as loadConfiguration } from "@xwiki/cristal-configuration-electron-main";
28
27
  import { load as loadGitHubAuthentication } from "@xwiki/cristal-electron-authentication-github-main";
29
28
  import { load as loadNextcloudAuthentication } from "@xwiki/cristal-electron-authentication-nextcloud-main";
30
29
  import { load as loadXWikiAuthentication } from "@xwiki/cristal-electron-authentication-xwiki-main";
30
+ import { load as loadSettings } from "@xwiki/cristal-electron-settings-main";
31
31
  // @ts-expect-error shouldn't happen, but we need to generate the types for the whole project once.
32
32
  import load from "@xwiki/cristal-electron-storage/main";
33
33
  import { BrowserWindow, app } from "electron";
34
34
  import { platform } from "node:process";
35
35
 
36
- // Set up IPC listener for configuration loading before the app actually starts
37
- // It needs to be setup before the preload script runs, which means the first window mustn't have been created
38
- loadConfiguration();
39
-
40
36
  /**
41
37
  * Prevent electron from running multiple instances.
42
38
  */
@@ -78,6 +74,7 @@ app
78
74
  loadGitHubAuthentication(w, loadFile);
79
75
  loadNextcloudAuthentication(w, loadFile);
80
76
  loadXWikiAuthentication(w, loadFile);
77
+ loadSettings();
81
78
  });
82
79
  /**
83
80
  * @see https://www.electronjs.org/docs/latest/api/app#event-activate-macos Event: 'activate'.
@@ -18,7 +18,7 @@
18
18
  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19
19
  */
20
20
 
21
- import { readConfiguration } from "@xwiki/cristal-configuration-electron-main";
21
+ import { getConfigurations } from "@xwiki/cristal-electron-settings-main";
22
22
  import { app, shell } from "electron";
23
23
  import { URL } from "node:url";
24
24
  import type { Session } from "electron";
@@ -71,10 +71,10 @@ app.on("web-contents-created", (_, contents) => {
71
71
  *
72
72
  * @see https://www.electronjs.org/docs/latest/tutorial/security#13-disable-or-limit-navigation
73
73
  */
74
- const configuration = readConfiguration();
75
74
  contents.on("will-navigate", (event, url) => {
75
+ const configurations = getConfigurations();
76
76
  const { origin } = new URL(url);
77
- const isAllowedOrigin = Object.values(configuration).some(
77
+ const isAllowedOrigin = Object.values(configurations).some(
78
78
  (configuration) => {
79
79
  const baseURL = configuration.baseURL;
80
80
  if (!baseURL) {