mirinjs 0.0.1-alpha.4 → 0.0.1-alpha.5
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 +1 -1
- package/src/config.ts +6 -0
- package/src/runtime.ts +7 -2
package/package.json
CHANGED
package/src/config.ts
CHANGED
|
@@ -73,6 +73,12 @@ export interface MirinConfig {
|
|
|
73
73
|
name: string;
|
|
74
74
|
/** Main-process entry, relative to the project root (runs in the Bun Worker). */
|
|
75
75
|
main: string;
|
|
76
|
+
/**
|
|
77
|
+
* App icon, relative to the project root (macOS). Accepts a `.icns`, a
|
|
78
|
+
* `.iconset` directory, or a single square `.png` (≥512px) that mirin renders
|
|
79
|
+
* into an `.icns`. Embedded in the bundle for the Dock and Finder.
|
|
80
|
+
*/
|
|
81
|
+
icon?: string;
|
|
76
82
|
windows: Record<string, WindowConfig>;
|
|
77
83
|
}
|
|
78
84
|
|
package/src/runtime.ts
CHANGED
|
@@ -35,9 +35,14 @@ export function runtime(): Runtime {
|
|
|
35
35
|
return current;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
/** Dev: every window loads the Vite server. Production: its manifest app:// URL.
|
|
38
|
+
/** Dev: every window loads the Vite server. Production: its manifest app:// URL.
|
|
39
|
+
* Any query/hash on the requested URL (e.g. "#devtools") is preserved so
|
|
40
|
+
* hash-routed sub-windows reach the right view through the dev server too. */
|
|
39
41
|
export function resolveUrl(url: string): string {
|
|
40
|
-
|
|
42
|
+
const devUrl = current?.devUrl;
|
|
43
|
+
if (!devUrl) return url;
|
|
44
|
+
const suffix = url.match(/[?#].*$/)?.[0] ?? "";
|
|
45
|
+
return devUrl + suffix;
|
|
41
46
|
}
|
|
42
47
|
|
|
43
48
|
// ---- native event dispatch ----
|