@better-update/cli 0.42.0 → 0.42.1

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/dist/index.mjs CHANGED
@@ -35,7 +35,7 @@ var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
35
35
 
36
36
  //#endregion
37
37
  //#region package.json
38
- var version = "0.42.0";
38
+ var version = "0.42.1";
39
39
 
40
40
  //#endregion
41
41
  //#region src/lib/interactive-mode.ts
@@ -24533,6 +24533,7 @@ const resolveIosStrategy = (profile, projectType) => {
24533
24533
 
24534
24534
  //#endregion
24535
24535
  //#region src/lib/gradle-config.ts
24536
+ const isValidAndroidPackageName = Schema.is(AndroidPackageName);
24536
24537
  /**
24537
24538
  * Parse Groovy `build.gradle` to extract key Android config values.
24538
24539
  * Returns `undefined` if:
@@ -24579,12 +24580,27 @@ const parseVersionCode = (raw) => {
24579
24580
  const extractGradleConfig = (parsed) => {
24580
24581
  const defaultConfig = asRecord(asRecord(parsed["android"])?.["defaultConfig"]);
24581
24582
  return compact({
24582
- applicationId: typeof defaultConfig?.["applicationId"] === "string" ? unquote(defaultConfig["applicationId"]) : void 0,
24583
+ applicationId: extractApplicationId(defaultConfig?.["applicationId"]),
24583
24584
  versionCode: parseVersionCode(defaultConfig?.["versionCode"]),
24584
24585
  versionName: typeof defaultConfig?.["versionName"] === "string" ? unquote(defaultConfig["versionName"]) : void 0
24585
24586
  });
24586
24587
  };
24587
24588
  const unquote = (input) => input.startsWith("\"") && input.endsWith("\"") ? input.slice(1, -1) : input;
24589
+ /**
24590
+ * Extract a usable Android `applicationId` from the parsed Gradle value.
24591
+ *
24592
+ * react-native-config and similar setups make the id dynamic and env-driven
24593
+ * (e.g. `applicationId project.env.get("APP_ID")`, or a `def` variable). The
24594
+ * Groovy parser surfaces the raw expression text (`project.env.get("APP_ID")`,
24595
+ * `appId`, …), which is not a real package name. Treat anything that isn't a
24596
+ * valid reverse-domain package as unresolved so callers fall back to the
24597
+ * Expo/eas config value instead of building with — or validating — junk.
24598
+ */
24599
+ const extractApplicationId = (raw) => {
24600
+ if (typeof raw !== "string") return;
24601
+ const value = unquote(raw);
24602
+ return isValidAndroidPackageName(value) ? value : void 0;
24603
+ };
24588
24604
 
24589
24605
  //#endregion
24590
24606
  //#region src/application/platform-build.ts