electron-cli 0.3.0-alpha.2 → 0.3.0-alpha.20

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.
@@ -0,0 +1,82 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>electron-cli</title>
7
+ <style>
8
+ :root {
9
+ color-scheme: light dark;
10
+ font-family:
11
+ Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
12
+ "Segoe UI", sans-serif;
13
+ background: #f5f5f2;
14
+ color: #1d2328;
15
+ }
16
+
17
+ body {
18
+ margin: 0;
19
+ min-height: 100vh;
20
+ display: grid;
21
+ place-items: center;
22
+ }
23
+
24
+ main {
25
+ width: min(720px, calc(100vw - 48px));
26
+ }
27
+
28
+ h1 {
29
+ margin: 0 0 12px;
30
+ font-size: 5rem;
31
+ line-height: 0.92;
32
+ letter-spacing: 0;
33
+ }
34
+
35
+ p {
36
+ max-width: 48rem;
37
+ margin: 0 0 24px;
38
+ font-size: 1.05rem;
39
+ line-height: 1.6;
40
+ }
41
+
42
+ dl {
43
+ display: grid;
44
+ grid-template-columns: max-content 1fr;
45
+ gap: 8px 16px;
46
+ margin: 0;
47
+ padding-top: 20px;
48
+ border-top: 1px solid color-mix(in srgb, currentColor 24%, transparent);
49
+ }
50
+
51
+ dt {
52
+ font-weight: 700;
53
+ }
54
+
55
+ dd {
56
+ margin: 0;
57
+ }
58
+
59
+ @media (max-width: 640px) {
60
+ h1 {
61
+ font-size: 3rem;
62
+ }
63
+ }
64
+ </style>
65
+ </head>
66
+ <body>
67
+ <main>
68
+ <h1>electron-cli</h1>
69
+ <p>
70
+ This app was generated by the experimental Rust-native electron-cli
71
+ template.
72
+ </p>
73
+ <dl>
74
+ <dt>Runtime</dt>
75
+ <dd id="runtime">Loading...</dd>
76
+ <dt>Platform</dt>
77
+ <dd id="platform">Loading...</dd>
78
+ </dl>
79
+ </main>
80
+ <script src="./renderer.js"></script>
81
+ </body>
82
+ </html>
@@ -0,0 +1,33 @@
1
+ const { app, BrowserWindow } = require("electron");
2
+ const path = require("node:path");
3
+
4
+ function createWindow() {
5
+ const window = new BrowserWindow({
6
+ width: 960,
7
+ height: 640,
8
+ minWidth: 640,
9
+ minHeight: 420,
10
+ title: "electron-cli",
11
+ webPreferences: {
12
+ preload: path.join(__dirname, "preload.js"),
13
+ },
14
+ });
15
+
16
+ window.loadFile(path.join(__dirname, "index.html"));
17
+ }
18
+
19
+ app.whenReady().then(() => {
20
+ createWindow();
21
+
22
+ app.on("activate", () => {
23
+ if (BrowserWindow.getAllWindows().length === 0) {
24
+ createWindow();
25
+ }
26
+ });
27
+ });
28
+
29
+ app.on("window-all-closed", () => {
30
+ if (process.platform !== "darwin") {
31
+ app.quit();
32
+ }
33
+ });
@@ -0,0 +1,6 @@
1
+ const { contextBridge } = require("electron");
2
+
3
+ contextBridge.exposeInMainWorld("electronCli", {
4
+ platform: process.platform,
5
+ versions: process.versions,
6
+ });
@@ -0,0 +1,5 @@
1
+ const runtime = document.querySelector("#runtime");
2
+ const platform = document.querySelector("#platform");
3
+
4
+ runtime.textContent = `Electron ${window.electronCli.versions.electron}`;
5
+ platform.textContent = window.electronCli.platform;