@ulpi/browse 2.3.1 → 2.3.2

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.
Files changed (2) hide show
  1. package/dist/browse.cjs +47 -18
  2. package/package.json +1 -1
package/dist/browse.cjs CHANGED
@@ -864,7 +864,7 @@ var require_package = __commonJS({
864
864
  "package.json"(exports2, module2) {
865
865
  module2.exports = {
866
866
  name: "@ulpi/browse",
867
- version: "2.3.0",
867
+ version: "2.3.2",
868
868
  homepage: "https://browse.ulpi.io",
869
869
  repository: {
870
870
  type: "git",
@@ -1089,13 +1089,19 @@ __export(bridge_exports, {
1089
1089
  installAdb: () => installAdb
1090
1090
  });
1091
1091
  function resolveDriverApkPath() {
1092
- const localBuild = path7.resolve(
1093
- __dirname2,
1094
- "../../../browse-android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk"
1095
- );
1096
- if (fs7.existsSync(localBuild)) return localBuild;
1097
- const installed = path7.resolve(__dirname2, "../../bin/browse-android.apk");
1098
- if (fs7.existsSync(installed)) return installed;
1092
+ const candidates = [
1093
+ // 1. Local dev build
1094
+ path7.resolve(__dirname2, "../../../browse-android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk"),
1095
+ // 2. Installed alongside source (bin/ at project root)
1096
+ path7.resolve(__dirname2, "../../bin/browse-android.apk"),
1097
+ // 3. Bundled build (dist/browse.cjs → ../bin/)
1098
+ path7.resolve(__dirname2, "../bin/browse-android.apk"),
1099
+ // 4. Same directory as binary
1100
+ path7.resolve(__dirname2, "browse-android.apk")
1101
+ ];
1102
+ for (const p of candidates) {
1103
+ if (fs7.existsSync(p)) return p;
1104
+ }
1099
1105
  const lazyPath = path7.join(
1100
1106
  process.env.BROWSE_LOCAL_DIR || path7.join(process.cwd(), ".browse"),
1101
1107
  "bin",
@@ -1103,9 +1109,21 @@ function resolveDriverApkPath() {
1103
1109
  );
1104
1110
  if (fs7.existsSync(lazyPath)) return lazyPath;
1105
1111
  throw new Error(
1106
- "browse-android APK not found. Build it with:\n cd browse-android && ./gradlew :app:assembleDebugAndroidTest\nOr run: browse doctor --platform android"
1112
+ "browse-android APK not found. Run: browse enable android\nOr build manually: cd browse-android && ./gradlew :app:assembleDebugAndroidTest"
1107
1113
  );
1108
1114
  }
1115
+ function resolveAppApkPath() {
1116
+ const candidates = [
1117
+ path7.resolve(__dirname2, "../../../browse-android/app/build/outputs/apk/debug/app-debug.apk"),
1118
+ path7.resolve(__dirname2, "../../bin/browse-android-app.apk"),
1119
+ path7.resolve(__dirname2, "../bin/browse-android-app.apk"),
1120
+ path7.resolve(__dirname2, "browse-android-app.apk")
1121
+ ];
1122
+ for (const p of candidates) {
1123
+ if (fs7.existsSync(p)) return p;
1124
+ }
1125
+ return null;
1126
+ }
1109
1127
  function adbExec(serial, ...args) {
1110
1128
  return (0, import_child_process3.execSync)(["adb", "-s", serial, ...args].join(" "), {
1111
1129
  encoding: "utf-8",
@@ -1242,7 +1260,7 @@ function installDriverApk(serial, apkPath) {
1242
1260
  if (installedBase?.includes(`package:${DRIVER_PACKAGE}`) && installedTest?.includes(DRIVER_TEST_PACKAGE)) {
1243
1261
  return;
1244
1262
  }
1245
- const appApkPath = apkPath.replace("-androidTest", "");
1263
+ const appApkPath = resolveAppApkPath() || apkPath.replace("-androidTest", "");
1246
1264
  if (fs7.existsSync(appApkPath)) {
1247
1265
  try {
1248
1266
  adbExec(serial, "install", "-t", "-r", `"${appApkPath}"`);
@@ -2486,7 +2504,12 @@ async function startIOS(opts = {}) {
2486
2504
  } catch {
2487
2505
  }
2488
2506
  }
2489
- const runnerDir = path10.resolve(__dirname_svc, "../../../browse-ios-runner");
2507
+ const runnerCandidates = [
2508
+ path10.resolve(__dirname_svc, "../../../browse-ios-runner"),
2509
+ path10.resolve(__dirname_svc, "../../browse-ios-runner"),
2510
+ path10.resolve(__dirname_svc, "../bin/browse-ios-runner")
2511
+ ];
2512
+ const runnerDir = runnerCandidates.find((d) => fs10.existsSync(path10.join(d, "project.yml"))) || runnerCandidates[0];
2490
2513
  const { execSync: execSync7 } = await import("child_process");
2491
2514
  if (!fs10.existsSync(path10.join(runnerDir, "BrowseRunner.xcodeproj", "project.pbxproj"))) {
2492
2515
  log2("Generating Xcode project...");
@@ -23836,12 +23859,18 @@ __export(bridge_exports3, {
23836
23859
  resolveBridgePath: () => resolveBridgePath
23837
23860
  });
23838
23861
  function resolveBridgePath() {
23839
- const localBuild = path17.resolve(__dirname_bridge, "../../../browse-ax/.build/release/browse-ax");
23840
- if (fs22.existsSync(localBuild)) return localBuild;
23841
- const localDebug = path17.resolve(__dirname_bridge, "../../../browse-ax/.build/debug/browse-ax");
23842
- if (fs22.existsSync(localDebug)) return localDebug;
23843
- const installed = path17.resolve(__dirname_bridge, "../../bin/browse-ax");
23844
- if (fs22.existsSync(installed)) return installed;
23862
+ const candidates = [
23863
+ // 1. Local dev build
23864
+ path17.resolve(__dirname_bridge, "../../../browse-ax/.build/release/browse-ax"),
23865
+ path17.resolve(__dirname_bridge, "../../../browse-ax/.build/debug/browse-ax"),
23866
+ // 2. Installed alongside source (bin/ at project root)
23867
+ path17.resolve(__dirname_bridge, "../../bin/browse-ax"),
23868
+ // 3. Bundled build (dist/browse.cjs → ../bin/)
23869
+ path17.resolve(__dirname_bridge, "../bin/browse-ax")
23870
+ ];
23871
+ for (const p of candidates) {
23872
+ if (fs22.existsSync(p)) return p;
23873
+ }
23845
23874
  const lazyPath = path17.join(
23846
23875
  process.env.BROWSE_LOCAL_DIR || path17.join(process.cwd(), ".browse"),
23847
23876
  "bin",
@@ -23849,7 +23878,7 @@ function resolveBridgePath() {
23849
23878
  );
23850
23879
  if (fs22.existsSync(lazyPath)) return lazyPath;
23851
23880
  throw new Error(
23852
- "browse-ax binary not found. Build it with: cd browse-ax && swift build -c release\nOr run: browse doctor --platform macos"
23881
+ "browse-ax binary not found. Run: browse enable macos\nOr build manually: cd browse-ax && swift build -c release"
23853
23882
  );
23854
23883
  }
23855
23884
  async function ensureMacOSBridge() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ulpi/browse",
3
- "version": "2.3.1",
3
+ "version": "2.3.2",
4
4
  "homepage": "https://browse.ulpi.io",
5
5
  "repository": {
6
6
  "type": "git",