mirinjs 0.0.1-alpha.4 → 0.0.1-alpha.6

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": "mirinjs",
3
- "version": "0.0.1-alpha.4",
3
+ "version": "0.0.1-alpha.6",
4
4
  "description": "Build desktop apps with Bun, TypeScript, and Chromium (CEF). The Bun-native Electron alternative.",
5
5
  "type": "module",
6
6
  "license": "MIT",
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/host.ts CHANGED
@@ -36,7 +36,9 @@ const manifest = JSON.parse(
36
36
 
37
37
  const coreConfig = JSON.parse(
38
38
  process.env.MIRIN_CONFIG_JSON ??
39
- JSON.stringify(process.env.MIRIN_DEV_URL ? {} : { resources_path: resourcesDir }),
39
+ JSON.stringify(
40
+ process.env.MIRIN_DEV_URL ? { dev: true } : { resources_path: resourcesDir },
41
+ ),
40
42
  );
41
43
 
42
44
  // Load the native core on the main thread FIRST. The Worker also dlopens the
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
- return current?.devUrl ?? url;
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 ----