@nemigo/electron 2.0.1 → 2.2.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.
@@ -35,4 +35,3 @@ export declare class NetworkSecurity {
35
35
  __handleNavigation(contents: WebContents): void;
36
36
  __handleWindowOpen(contents: WebContents): void;
37
37
  }
38
- export default NetworkSecurity;
package/dist/security.js CHANGED
@@ -1,3 +1,5 @@
1
+ /* eslint-disable no-console */
2
+ // oxlint-disable no-console
1
3
  import { extractUrlOrigin } from "@nemigo/helpers/url";
2
4
  import { app, shell } from "electron";
3
5
  /**
@@ -45,14 +47,14 @@ export class NetworkSecurity {
45
47
  return this;
46
48
  }
47
49
  __handleNavigation(contents) {
48
- contents.on("will-navigate", (e, url) => {
50
+ contents.on("will-navigate", (event, url) => {
49
51
  if (url.startsWith("file://"))
50
52
  return;
51
53
  const { origin } = new URL(url);
52
54
  if (!origin)
53
55
  return;
54
56
  if (!this.allowedInternalOrigins.has(origin)) {
55
- e.preventDefault();
57
+ event.preventDefault();
56
58
  console.warn(`Blocked navigating to disallowed origin: ${origin}`);
57
59
  }
58
60
  });
@@ -72,4 +74,3 @@ export class NetworkSecurity {
72
74
  });
73
75
  }
74
76
  }
75
- export default NetworkSecurity;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nemigo/electron",
3
- "version": "2.0.1",
3
+ "version": "2.2.0",
4
4
  "private": false,
5
5
  "author": {
6
6
  "name": "Vlad Logvin",
@@ -12,14 +12,12 @@
12
12
  "pnpm": ">=10.9.0"
13
13
  },
14
14
  "scripts": {
15
- "build": "svelte-package && rimraf .svelte-kit",
15
+ "build": "bunx --bun svelte-package && bunx --bun rimraf .svelte-kit",
16
16
  "check": "bunx --bun tsc --noemit",
17
17
  "eslint": "bunx --bun eslint ./",
18
- "eslint:fix": "bunx --bun eslint --fix ./",
19
- "lint": "biome lint",
20
- "lint:fix": "biome lint --fix --unsafe",
21
- "lint:fix:unsafe": "biome lint --fix --unsafe",
22
- "format": "biome check --write --linter-enabled=false"
18
+ "oxlint": "bunx --bun oxlint --config .././../oxlintrc.jsonc --ignore-path ../configs/.eslint.ignore ./",
19
+ "bilint": "bunx --bun biome lint",
20
+ "format": "bunx --bun biome check --write --linter-enabled=false"
23
21
  },
24
22
  "exports": {
25
23
  "./security": {
@@ -28,12 +26,12 @@
28
26
  }
29
27
  },
30
28
  "peerDependencies": {
31
- "@nemigo/helpers": ">=2.0.0",
32
- "electron": ">=32.0.0"
29
+ "@nemigo/helpers": ">=2.2.0",
30
+ "electron": ">=39.0.0"
33
31
  },
34
32
  "devDependencies": {
35
- "@nemigo/configs": "2.1.0",
36
- "@nemigo/helpers": "2.0.0",
37
- "electron": "39.2.0"
33
+ "@nemigo/configs": "2.2.0",
34
+ "@nemigo/helpers": "2.2.0",
35
+ "electron": "39.2.3"
38
36
  }
39
37
  }