@mirinjs/cli 0.1.0-alpha.24 → 0.1.0-alpha.25

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/cli",
3
- "version": "0.1.0-alpha.24",
3
+ "version": "0.1.0-alpha.25",
4
4
  "description": "CLI for mirin apps: dev, build, init.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -27,15 +27,15 @@
27
27
  "bun": ">=1.2.0"
28
28
  },
29
29
  "dependencies": {
30
- "create-mirinjs": "0.1.0-alpha.24",
31
- "mirinjs": "0.1.0-alpha.24"
30
+ "create-mirinjs": "0.1.0-alpha.25",
31
+ "mirinjs": "0.1.0-alpha.25"
32
32
  },
33
33
  "optionalDependencies": {
34
- "@mirinjs/darwin-arm64": "0.1.0-alpha.24",
35
- "@mirinjs/win32-x64": "0.1.0-alpha.24",
36
- "@mirinjs/win32-arm64": "0.1.0-alpha.24",
37
- "@mirinjs/linux-arm64": "0.1.0-alpha.24",
38
- "@mirinjs/linux-x64": "0.1.0-alpha.24"
34
+ "@mirinjs/darwin-arm64": "0.1.0-alpha.25",
35
+ "@mirinjs/win32-x64": "0.1.0-alpha.25",
36
+ "@mirinjs/win32-arm64": "0.1.0-alpha.25",
37
+ "@mirinjs/linux-arm64": "0.1.0-alpha.25",
38
+ "@mirinjs/linux-x64": "0.1.0-alpha.25"
39
39
  },
40
40
  "publishConfig": {
41
41
  "access": "public"
package/src/build.ts CHANGED
@@ -18,7 +18,7 @@ import { join } from "node:path";
18
18
  import { $ } from "bun";
19
19
  import { resolveArtifacts } from "./artifacts.ts";
20
20
  import { buildLinuxBundle } from "./bundle/linux/index.ts";
21
- import { buildAppBundle } from "./bundle/macos/index.ts";
21
+ import { buildAppBundle, stampMacSdk } from "./bundle/macos/index.ts";
22
22
  import { normalizeCefLocales } from "./bundle/shared/cef-locales.ts";
23
23
  import { buildWindowsBundle } from "./bundle/windows/index.ts";
24
24
  import { compileWorkers, normalizeSidecars } from "./extras.ts";
@@ -221,6 +221,7 @@ export async function build(
221
221
  await $`bun build --compile --minify ${target} ${artifacts.hostEntry} --outfile ${hostExe}`.cwd(
222
222
  projectDir,
223
223
  );
224
+ await stampMacSdk(hostExe);
224
225
  if (IS_WINDOWS) {
225
226
  patchPeToGuiSubsystem(hostExe);
226
227
  await brandWindowsExe(hostExe, {
@@ -1 +1,2 @@
1
1
  export * from "./app.ts";
2
+ export { stampMacSdk } from "./sdk-stamp.ts";
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Stamp the compiled host with the macOS 26 SDK version.
3
+ *
4
+ * `bun build --compile` clones the Bun runtime binary, so the host inherits
5
+ * Bun's LC_BUILD_VERSION (SDK 15.x). AppKit gates the macOS 26 window design
6
+ * ("linked-on-or-after") on the MAIN executable's SDK, which leaves mirin apps
7
+ * with the pre-Tahoe compatibility chrome — flat traffic lights, old window
8
+ * metrics. Rewriting the load command opts the app into the current design.
9
+ * Must run before codesigning; vtool invalidates the signature.
10
+ */
11
+
12
+ import { existsSync, renameSync } from "node:fs";
13
+ import { $ } from "bun";
14
+
15
+ /** Matches the LSMinimumSystemVersion mirin writes into Info.plist. */
16
+ const MIN_OS = "13.0";
17
+ /** The design-gate threshold; the number is declarative, no SDK needs to exist locally. */
18
+ const SDK = "26.0";
19
+
20
+ /** Best-effort: a missing vtool (bare machines) keeps Bun's original header. */
21
+ export async function stampMacSdk(hostExe: string): Promise<void> {
22
+ if (process.platform !== "darwin") return;
23
+ if (!Bun.which("vtool")) {
24
+ console.warn("[mirin] vtool not found — the app keeps the compatibility window design.");
25
+ return;
26
+ }
27
+ const out = `${hostExe}.sdkstamp`;
28
+ const res =
29
+ await $`vtool -set-build-version macos ${MIN_OS} ${SDK} -replace -output ${out} ${hostExe}`
30
+ .nothrow()
31
+ .quiet();
32
+ if (res.exitCode !== 0 || !existsSync(out)) {
33
+ console.warn(`[mirin] vtool failed (exit ${res.exitCode}) — keeping Bun's SDK header.`);
34
+ return;
35
+ }
36
+ renameSync(out, hostExe);
37
+ await $`chmod +x ${hostExe}`.quiet();
38
+ }
package/src/dev.ts CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  resolveLinuxDesktopIconPng,
24
24
  resolveLinuxIconPng,
25
25
  } from "./bundle/linux/index.ts";
26
- import { buildAppBundle } from "./bundle/macos/index.ts";
26
+ import { buildAppBundle, stampMacSdk } from "./bundle/macos/index.ts";
27
27
  import { buildWindowsBundle } from "./bundle/windows/index.ts";
28
28
 
29
29
  const IS_WINDOWS = process.platform === "win32";
@@ -104,6 +104,7 @@ export async function dev(projectDir = process.cwd(), options?: DevOptions): Pro
104
104
  projectDir,
105
105
  ),
106
106
  );
107
+ await stampMacSdk(hostExe);
107
108
  await reporter.build(
108
109
  $`bun build ${mainEntry} --target=bun --outfile ${workerJs}`.cwd(projectDir),
109
110
  );