healkite 0.2.0 → 0.3.0
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/healkite.mjs +610 -29
- package/package.json +4 -4
package/dist/healkite.mjs
CHANGED
|
@@ -8,9 +8,9 @@ var __export = (target, all) => {
|
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
// src/main.ts
|
|
11
|
-
import { existsSync as
|
|
11
|
+
import { existsSync as existsSync4 } from "node:fs";
|
|
12
12
|
import { readFile as readFile5 } from "node:fs/promises";
|
|
13
|
-
import { join as
|
|
13
|
+
import { join as join6, resolve as resolve2 } from "node:path";
|
|
14
14
|
|
|
15
15
|
// ../core/src/ids.ts
|
|
16
16
|
var ALPHABET = "0123456789abcdefghjkmnpqrstvwxyz";
|
|
@@ -19834,6 +19834,12 @@ var paths = {
|
|
|
19834
19834
|
assertHex(sha256, "sha256");
|
|
19835
19835
|
return `p/${sha256}.hkp`;
|
|
19836
19836
|
},
|
|
19837
|
+
/** Module manifest (per-team module releases: Re.Pack chunks / federated modules) — short TTL, purged on publish. */
|
|
19838
|
+
modules(channelKey, platform, runtimeVersion) {
|
|
19839
|
+
assertSegment(channelKey, "channelKey");
|
|
19840
|
+
assertSegment(runtimeVersion, "runtimeVersion");
|
|
19841
|
+
return `m/${channelKey}/${platform}/${runtimeVersion}.modules.json`;
|
|
19842
|
+
},
|
|
19837
19843
|
/** Individual asset (campaigns, icons, lazy assets) — content-addressed, immutable. */
|
|
19838
19844
|
asset(sha256) {
|
|
19839
19845
|
assertHex(sha256, "sha256");
|
|
@@ -20079,19 +20085,19 @@ var ProvenancePolicy = external_exports.object({
|
|
|
20079
20085
|
});
|
|
20080
20086
|
|
|
20081
20087
|
// ../core/src/publish-release.ts
|
|
20082
|
-
async function publishRelease(
|
|
20083
|
-
const clock =
|
|
20084
|
-
const ids =
|
|
20088
|
+
async function publishRelease(deps2, input2) {
|
|
20089
|
+
const clock = deps2.clock ?? systemClock;
|
|
20090
|
+
const ids = deps2.ids ?? defaultIds;
|
|
20085
20091
|
const bundleKey = paths.bundle(input2.sha256);
|
|
20086
20092
|
const manifestKey = paths.manifest(input2.channel, input2.platform, input2.runtimeVersion);
|
|
20087
|
-
const existing = await
|
|
20093
|
+
const existing = await deps2.blobs.head(bundleKey);
|
|
20088
20094
|
if (!existing) {
|
|
20089
|
-
await
|
|
20095
|
+
await deps2.blobs.put(bundleKey, input2.hkb, {
|
|
20090
20096
|
contentType: "application/vnd.healkite.hkb",
|
|
20091
20097
|
cacheControl: cacheControl.immutable
|
|
20092
20098
|
});
|
|
20093
20099
|
}
|
|
20094
|
-
const previous = await readManifest(
|
|
20100
|
+
const previous = await readManifest(deps2.blobs, manifestKey);
|
|
20095
20101
|
const now = clock.now();
|
|
20096
20102
|
const releaseId = ids.id("rel");
|
|
20097
20103
|
const label = input2.label ?? nextLabel(previous?.release?.label);
|
|
@@ -20126,11 +20132,11 @@ async function publishRelease(deps, input2) {
|
|
|
20126
20132
|
eventSampleRate: previous?.eventSampleRate ?? 1
|
|
20127
20133
|
};
|
|
20128
20134
|
const manifest = ManifestV1.parse(candidate);
|
|
20129
|
-
await
|
|
20135
|
+
await deps2.blobs.put(manifestKey, JSON.stringify(manifest), {
|
|
20130
20136
|
contentType: "application/json",
|
|
20131
20137
|
cacheControl: cacheControl.manifest
|
|
20132
20138
|
});
|
|
20133
|
-
await
|
|
20139
|
+
await deps2.cdn?.purge([joinUrl(deps2.cdnBaseUrl, manifestKey)]);
|
|
20134
20140
|
return { releaseId, bundleKey, manifestKey, manifest, uploaded: !existing };
|
|
20135
20141
|
}
|
|
20136
20142
|
async function readManifest(blobs, key) {
|
|
@@ -20144,10 +20150,10 @@ function nextLabel(previous) {
|
|
|
20144
20150
|
}
|
|
20145
20151
|
|
|
20146
20152
|
// ../core/src/rollback.ts
|
|
20147
|
-
async function rollbackToEmbedded(
|
|
20148
|
-
const clock =
|
|
20153
|
+
async function rollbackToEmbedded(deps2, input2) {
|
|
20154
|
+
const clock = deps2.clock ?? systemClock;
|
|
20149
20155
|
const manifestKey = paths.manifest(input2.channel, input2.platform, input2.runtimeVersion);
|
|
20150
|
-
const previous = await readManifest(
|
|
20156
|
+
const previous = await readManifest(deps2.blobs, manifestKey);
|
|
20151
20157
|
const manifest = ManifestV1.parse({
|
|
20152
20158
|
...previous ?? {
|
|
20153
20159
|
protocolVersion: 1,
|
|
@@ -20159,11 +20165,11 @@ async function rollbackToEmbedded(deps, input2) {
|
|
|
20159
20165
|
release: null,
|
|
20160
20166
|
rollout: void 0
|
|
20161
20167
|
});
|
|
20162
|
-
await
|
|
20168
|
+
await deps2.blobs.put(manifestKey, JSON.stringify(manifest), {
|
|
20163
20169
|
contentType: "application/json",
|
|
20164
20170
|
cacheControl: cacheControl.manifest
|
|
20165
20171
|
});
|
|
20166
|
-
await
|
|
20172
|
+
await deps2.cdn?.purge([joinUrl(deps2.cdnBaseUrl, manifestKey)]);
|
|
20167
20173
|
return { manifestKey, previousLabel: previous?.release?.label ?? null };
|
|
20168
20174
|
}
|
|
20169
20175
|
|
|
@@ -24390,7 +24396,7 @@ function projectRelative(source, projectDir) {
|
|
|
24390
24396
|
var FRAMES = 8;
|
|
24391
24397
|
var FILE_WEIGHT = 0.3;
|
|
24392
24398
|
var NAME_WEIGHT = 0.15;
|
|
24393
|
-
async function findSuspects(errors, changes,
|
|
24399
|
+
async function findSuspects(errors, changes, deps2) {
|
|
24394
24400
|
const owner = /* @__PURE__ */ new Map();
|
|
24395
24401
|
for (const c of changes) {
|
|
24396
24402
|
owner.set(c.sha, c);
|
|
@@ -24416,19 +24422,19 @@ async function findSuspects(errors, changes, deps) {
|
|
|
24416
24422
|
const w = errWeight / (i + 1) ** 2;
|
|
24417
24423
|
let file2 = null;
|
|
24418
24424
|
let line = 0;
|
|
24419
|
-
const pos =
|
|
24425
|
+
const pos = deps2.map?.lookup(f.line, f.column) ?? null;
|
|
24420
24426
|
if (pos) {
|
|
24421
|
-
file2 = projectRelative(pos.source,
|
|
24427
|
+
file2 = projectRelative(pos.source, deps2.projectDir);
|
|
24422
24428
|
line = pos.line;
|
|
24423
24429
|
} else if (!/\.(jsbundle|bundle)$/.test(f.file)) {
|
|
24424
|
-
file2 = projectRelative(f.file,
|
|
24430
|
+
file2 = projectRelative(f.file, deps2.projectDir);
|
|
24425
24431
|
line = f.line;
|
|
24426
24432
|
}
|
|
24427
24433
|
const message = err.message.slice(0, 300);
|
|
24428
24434
|
if (file2) {
|
|
24429
24435
|
mapped++;
|
|
24430
24436
|
const key = `${file2}:${line}`;
|
|
24431
|
-
if (!blameCache.has(key)) blameCache.set(key,
|
|
24437
|
+
if (!blameCache.has(key)) blameCache.set(key, deps2.blame(file2, line));
|
|
24432
24438
|
const sha = await blameCache.get(key);
|
|
24433
24439
|
const blamed = sha ? owner.get(sha) : void 0;
|
|
24434
24440
|
if (blamed) {
|
|
@@ -24552,6 +24558,440 @@ async function isClean(cwd) {
|
|
|
24552
24558
|
return (await git(cwd, ["status", "--porcelain", "--untracked-files=no"])).trim() === "";
|
|
24553
24559
|
}
|
|
24554
24560
|
|
|
24561
|
+
// src/lib/projectview.ts
|
|
24562
|
+
import { existsSync as existsSync3, readdirSync, readFileSync as readFileSync2, statSync } from "node:fs";
|
|
24563
|
+
import { join as join5, relative as relative3 } from "node:path";
|
|
24564
|
+
var SKIP = /* @__PURE__ */ new Set(["node_modules", "Pods", "build", ".gradle", "DerivedData", ".git", ".healkite", "dist", ".expo"]);
|
|
24565
|
+
function fsProject(root) {
|
|
24566
|
+
return {
|
|
24567
|
+
read(p) {
|
|
24568
|
+
try {
|
|
24569
|
+
return readFileSync2(join5(root, p), "utf8");
|
|
24570
|
+
} catch {
|
|
24571
|
+
return null;
|
|
24572
|
+
}
|
|
24573
|
+
},
|
|
24574
|
+
find(dir, name, maxDepth = 3) {
|
|
24575
|
+
const out = [];
|
|
24576
|
+
const walk2 = (abs, depth) => {
|
|
24577
|
+
let entries;
|
|
24578
|
+
try {
|
|
24579
|
+
entries = readdirSync(abs);
|
|
24580
|
+
} catch {
|
|
24581
|
+
return;
|
|
24582
|
+
}
|
|
24583
|
+
for (const e of entries) {
|
|
24584
|
+
if (SKIP.has(e)) continue;
|
|
24585
|
+
const full = join5(abs, e);
|
|
24586
|
+
let st;
|
|
24587
|
+
try {
|
|
24588
|
+
st = statSync(full);
|
|
24589
|
+
} catch {
|
|
24590
|
+
continue;
|
|
24591
|
+
}
|
|
24592
|
+
if (st.isDirectory()) {
|
|
24593
|
+
if (depth < maxDepth) walk2(full, depth + 1);
|
|
24594
|
+
} else if (name.test(e)) out.push(relative3(root, full));
|
|
24595
|
+
}
|
|
24596
|
+
};
|
|
24597
|
+
walk2(join5(root, dir), 0);
|
|
24598
|
+
return out.sort();
|
|
24599
|
+
},
|
|
24600
|
+
hasNativeCode(pkg) {
|
|
24601
|
+
const base = [root, join5(root, ".."), join5(root, "../..")].map((r) => join5(r, "node_modules", pkg)).find((p) => existsSync3(p));
|
|
24602
|
+
if (!base) return false;
|
|
24603
|
+
if (["android", "ios"].some((d) => existsSync3(join5(base, d)))) return true;
|
|
24604
|
+
if (existsSync3(join5(base, "expo-module.config.json"))) return true;
|
|
24605
|
+
try {
|
|
24606
|
+
return readdirSync(base).some((f) => f.endsWith(".podspec"));
|
|
24607
|
+
} catch {
|
|
24608
|
+
return false;
|
|
24609
|
+
}
|
|
24610
|
+
}
|
|
24611
|
+
};
|
|
24612
|
+
}
|
|
24613
|
+
function appSources(root, limit = 3e3) {
|
|
24614
|
+
const out = [];
|
|
24615
|
+
const walk2 = (abs) => {
|
|
24616
|
+
if (out.length >= limit) return;
|
|
24617
|
+
let entries;
|
|
24618
|
+
try {
|
|
24619
|
+
entries = readdirSync(abs);
|
|
24620
|
+
} catch {
|
|
24621
|
+
return;
|
|
24622
|
+
}
|
|
24623
|
+
for (const e of entries) {
|
|
24624
|
+
if (SKIP.has(e) || e === "ios" || e === "android" || e.startsWith(".") || e === "__tests__") continue;
|
|
24625
|
+
const full = join5(abs, e);
|
|
24626
|
+
let st;
|
|
24627
|
+
try {
|
|
24628
|
+
st = statSync(full);
|
|
24629
|
+
} catch {
|
|
24630
|
+
continue;
|
|
24631
|
+
}
|
|
24632
|
+
if (st.isDirectory()) walk2(full);
|
|
24633
|
+
else if (/\.(m|c)?[jt]sx?$/.test(e) && !/\.(test|spec)\.|\.d\.ts$/.test(e) && st.size < 4e5) out.push({ path: relative3(root, full), text: readFileSync2(full, "utf8") });
|
|
24634
|
+
}
|
|
24635
|
+
};
|
|
24636
|
+
walk2(root);
|
|
24637
|
+
return out;
|
|
24638
|
+
}
|
|
24639
|
+
async function changesSince(projectDir, base) {
|
|
24640
|
+
const prefix = (await git(projectDir, ["rev-parse", "--show-prefix"])).trim();
|
|
24641
|
+
const strip = (p) => prefix && p.startsWith(prefix) ? p.slice(prefix.length) : p;
|
|
24642
|
+
const status = await git(projectDir, ["diff", "--name-status", "--no-renames", base, "--", "."]);
|
|
24643
|
+
const changes = [];
|
|
24644
|
+
for (const line of status.split("\n").filter(Boolean)) {
|
|
24645
|
+
const [s, p] = line.split(" ");
|
|
24646
|
+
changes.push({ path: strip(p), status: s[0] ?? "M", added: [] });
|
|
24647
|
+
}
|
|
24648
|
+
const untracked = await git(projectDir, ["ls-files", "--others", "--exclude-standard", "--", "."], { allowFail: true });
|
|
24649
|
+
for (const p of untracked.split("\n").filter(Boolean)) {
|
|
24650
|
+
const text = existsSync3(join5(projectDir, p)) && /\.(m|c)?[jt]sx?$/.test(p) ? readFileSync2(join5(projectDir, p), "utf8") : "";
|
|
24651
|
+
changes.push({ path: p, status: "A", added: text ? text.split("\n").slice(0, 2e3) : [] });
|
|
24652
|
+
}
|
|
24653
|
+
const js = changes.filter((c) => /\.(m|c)?[jt]sx?$/.test(c.path) && c.status !== "D" && !c.path.includes("node_modules/") && !c.added.length);
|
|
24654
|
+
if (js.length) {
|
|
24655
|
+
const diff = await git(projectDir, ["diff", "-U0", "--no-renames", base, "--", ...js.slice(0, 500).map((c) => c.path)]);
|
|
24656
|
+
let current;
|
|
24657
|
+
for (const line of diff.split("\n")) {
|
|
24658
|
+
const m = /^\+\+\+ b\/(.+)$/.exec(line);
|
|
24659
|
+
if (m) current = js.find((c) => c.path === strip(m[1]));
|
|
24660
|
+
else if (current && line.startsWith("+") && !line.startsWith("+++")) current.added.push(line.slice(1));
|
|
24661
|
+
}
|
|
24662
|
+
}
|
|
24663
|
+
return changes;
|
|
24664
|
+
}
|
|
24665
|
+
async function fileAt(projectDir, rev, path2) {
|
|
24666
|
+
const prefix = (await git(projectDir, ["rev-parse", "--show-prefix"], { allowFail: true })).trim();
|
|
24667
|
+
const out = await git(projectDir, ["show", `${rev}:${prefix}${path2}`], { allowFail: true });
|
|
24668
|
+
return out || null;
|
|
24669
|
+
}
|
|
24670
|
+
var fileNow = (projectDir, path2) => existsSync3(join5(projectDir, path2)) ? readFileSync2(join5(projectDir, path2), "utf8") : null;
|
|
24671
|
+
|
|
24672
|
+
// src/lib/storecheck.ts
|
|
24673
|
+
var SEVERITY_ORDER = { blocker: 0, high: 1, medium: 2, info: 3 };
|
|
24674
|
+
var sortFindings = (f) => [...f].sort((a, b) => SEVERITY_ORDER[a.severity] - SEVERITY_ORDER[b.severity] || a.id.localeCompare(b.id));
|
|
24675
|
+
var IOS_PURPOSE = [
|
|
24676
|
+
{ pkgs: ["react-native-vision-camera", "expo-camera", "react-native-camera-kit", "react-native-camera"], keys: ["NSCameraUsageDescription"], what: "the camera" },
|
|
24677
|
+
{ pkgs: ["react-native-image-picker", "expo-image-picker", "react-native-image-crop-picker"], keys: ["NSPhotoLibraryUsageDescription", "NSCameraUsageDescription"], what: "photos and the camera" },
|
|
24678
|
+
{ pkgs: ["@react-native-camera-roll/camera-roll", "expo-media-library"], keys: ["NSPhotoLibraryUsageDescription"], what: "the photo library" },
|
|
24679
|
+
{ pkgs: ["@react-native-community/geolocation", "react-native-geolocation-service", "expo-location", "react-native-background-geolocation"], keys: ["NSLocationWhenInUseUsageDescription"], what: "location" },
|
|
24680
|
+
{ pkgs: ["react-native-contacts", "expo-contacts"], keys: ["NSContactsUsageDescription"], what: "contacts" },
|
|
24681
|
+
{ pkgs: ["react-native-calendar-events", "expo-calendar"], keys: ["NSCalendarsFullAccessUsageDescription|NSCalendarsUsageDescription"], what: "calendars" },
|
|
24682
|
+
{ pkgs: ["@react-native-voice/voice"], keys: ["NSMicrophoneUsageDescription", "NSSpeechRecognitionUsageDescription"], what: "the microphone and speech recognition" },
|
|
24683
|
+
{ pkgs: ["react-native-audio-recorder-player", "react-native-audio-record", "expo-audio"], keys: ["NSMicrophoneUsageDescription"], what: "the microphone" },
|
|
24684
|
+
{ pkgs: ["react-native-ble-plx", "react-native-ble-manager"], keys: ["NSBluetoothAlwaysUsageDescription"], what: "Bluetooth" },
|
|
24685
|
+
{ pkgs: ["react-native-biometrics", "expo-local-authentication", "react-native-touch-id", "react-native-keychain"], keys: ["NSFaceIDUsageDescription"], what: "Face ID" },
|
|
24686
|
+
{ pkgs: ["react-native-tracking-transparency", "expo-tracking-transparency"], keys: ["NSUserTrackingUsageDescription"], what: "tracking (App Tracking Transparency)" },
|
|
24687
|
+
{ pkgs: ["react-native-health"], keys: ["NSHealthShareUsageDescription"], what: "HealthKit" },
|
|
24688
|
+
{ pkgs: ["expo-sensors"], keys: ["NSMotionUsageDescription"], what: "motion data" }
|
|
24689
|
+
];
|
|
24690
|
+
var TRACKING_SDKS = ["react-native-appsflyer", "react-native-adjust", "react-native-fbsdk-next", "react-native-google-mobile-ads", "react-native-branch", "@singular-apps/react-native-singular"];
|
|
24691
|
+
var THIRD_PARTY_LOGIN = ["@react-native-google-signin/google-signin", "react-native-fbsdk-next", "@react-native-seoul/kakao-login", "react-native-line-sdk"];
|
|
24692
|
+
var APPLE_LOGIN = ["@invertase/react-native-apple-authentication", "expo-apple-authentication"];
|
|
24693
|
+
var PAYMENT_SDKS = ["@stripe/stripe-react-native", "react-native-razorpay", "react-native-paypal", "react-native-braintree-dropin-ui", "react-native-cashfree-pg-sdk", "paytm_allinone_react-native", "@juspay-tech/react-native-hyperswitch"];
|
|
24694
|
+
var IAP_SDKS = ["react-native-iap", "react-native-purchases", "expo-in-app-purchases", "@adapty/react-native-sdk", "react-native-qonversion"];
|
|
24695
|
+
var ANDROID_RESTRICTED = {
|
|
24696
|
+
READ_SMS: { severity: "high", title: "SMS permission", detail: "Google Play only allows SMS permissions for the default SMS app or approved exceptions, with a Permissions Declaration Form.", fix: "Remove it, or use the SMS Retriever / SMS User Consent API for one-time codes." },
|
|
24697
|
+
RECEIVE_SMS: { severity: "high", title: "SMS permission", detail: "Restricted to default SMS handlers and approved exceptions.", fix: "Use the SMS Retriever API for OTP codes." },
|
|
24698
|
+
SEND_SMS: { severity: "high", title: "SMS permission", detail: "Restricted to default SMS handlers and approved exceptions.", fix: "Open the SMS app with an intent instead." },
|
|
24699
|
+
READ_CALL_LOG: { severity: "high", title: "Call log permission", detail: "Restricted to default phone/assistant apps and approved exceptions.", fix: "Remove it unless your app is a dialer." },
|
|
24700
|
+
WRITE_CALL_LOG: { severity: "high", title: "Call log permission", detail: "Restricted to default phone apps.", fix: "Remove it." },
|
|
24701
|
+
PROCESS_OUTGOING_CALLS: { severity: "high", title: "Call permission", detail: "Restricted to default phone apps.", fix: "Remove it." },
|
|
24702
|
+
QUERY_ALL_PACKAGES: { severity: "high", title: "Package visibility", detail: "Only apps that must see all installed apps (e.g. launchers, antivirus) may use it; others are rejected.", fix: "Declare the specific apps you need in <queries> instead." },
|
|
24703
|
+
MANAGE_EXTERNAL_STORAGE: { severity: "high", title: "All files access", detail: "Allowed only for file managers, backup and similar apps, after a declaration.", fix: "Use scoped storage or the Storage Access Framework." },
|
|
24704
|
+
ACCESS_BACKGROUND_LOCATION: { severity: "high", title: "Background location", detail: "Needs a declaration in Play Console, a video of the feature, and in-app disclosure before asking.", fix: "Use foreground location unless background tracking is your core feature." },
|
|
24705
|
+
REQUEST_INSTALL_PACKAGES: { severity: "high", title: "Installing other apps", detail: "Allowed only when installing apps is a core purpose of your app.", fix: "Remove it." },
|
|
24706
|
+
READ_MEDIA_IMAGES: { severity: "medium", title: "Photo access", detail: "Google Play's photo and video permissions policy allows broad photo access only when it's core to the app; others must use the system photo picker.", fix: "Use the Android photo picker (no permission needed)." },
|
|
24707
|
+
READ_MEDIA_VIDEO: { severity: "medium", title: "Video access", detail: "Same policy as photos: broad access only for core use.", fix: "Use the Android photo picker." },
|
|
24708
|
+
USE_EXACT_ALARM: { severity: "medium", title: "Exact alarms", detail: "USE_EXACT_ALARM is only for alarm clock and calendar apps.", fix: "Use SCHEDULE_EXACT_ALARM (user-granted) or inexact alarms." },
|
|
24709
|
+
SYSTEM_ALERT_WINDOW: { severity: "medium", title: "Draw over other apps", detail: "Reviewed closely; needs a clear user-facing reason.", fix: "Remove it if the app doesn't draw overlays." },
|
|
24710
|
+
BIND_ACCESSIBILITY_SERVICE: { severity: "high", title: "Accessibility service", detail: "Google Play's AccessibilityService API policy needs a declaration and in-app disclosure.", fix: "Remove it unless it's an accessibility tool." }
|
|
24711
|
+
};
|
|
24712
|
+
function deps(pkg) {
|
|
24713
|
+
return new Set(Object.keys({ ...pkg?.dependencies }));
|
|
24714
|
+
}
|
|
24715
|
+
function parseJson(text) {
|
|
24716
|
+
if (!text) return null;
|
|
24717
|
+
try {
|
|
24718
|
+
return JSON.parse(text);
|
|
24719
|
+
} catch {
|
|
24720
|
+
return null;
|
|
24721
|
+
}
|
|
24722
|
+
}
|
|
24723
|
+
function plistStrings(xml) {
|
|
24724
|
+
const out = /* @__PURE__ */ new Map();
|
|
24725
|
+
for (const m of xml.matchAll(/<key>([^<]+)<\/key>\s*<string>([^<]*)<\/string>/g)) out.set(m[1].trim(), m[2].trim());
|
|
24726
|
+
return out;
|
|
24727
|
+
}
|
|
24728
|
+
function plistArray(xml, key) {
|
|
24729
|
+
const m = new RegExp(`<key>${key}</key>\\s*<array>([\\s\\S]*?)</array>`).exec(xml);
|
|
24730
|
+
return m ? [...m[1].matchAll(/<string>([^<]*)<\/string>/g)].map((x) => x[1].trim()) : [];
|
|
24731
|
+
}
|
|
24732
|
+
function androidPermissions(manifest) {
|
|
24733
|
+
return [...manifest.matchAll(/<uses-permission(?:-sdk-23)?\s+[^>]*android:name="([^"]+)"/g)].map((m) => m[1].replace(/^android\.permission\./, ""));
|
|
24734
|
+
}
|
|
24735
|
+
function targetSdk(gradleFiles) {
|
|
24736
|
+
for (const g of gradleFiles) {
|
|
24737
|
+
const m = /targetSdk(?:Version)?\s*=?\s*(\d{2})\b/.exec(g);
|
|
24738
|
+
if (m) return Number(m[1]);
|
|
24739
|
+
}
|
|
24740
|
+
return null;
|
|
24741
|
+
}
|
|
24742
|
+
var PLACEHOLDER = /^(|todo|tbd|test|xxx|description|usage description|\$\([A-Z_]+\))$/i;
|
|
24743
|
+
function scanProject(view, sources) {
|
|
24744
|
+
const findings = [];
|
|
24745
|
+
const add = (f) => findings.push(f);
|
|
24746
|
+
const pkg = parseJson(view.read("package.json"));
|
|
24747
|
+
const d = deps(pkg);
|
|
24748
|
+
const expo = d.has("expo");
|
|
24749
|
+
const has = (list) => list.filter((p) => d.has(p));
|
|
24750
|
+
const plistPath = view.find("ios", /^Info\.plist$/, 2).find((p) => !/Tests?\//.test(p) && !/Pods\//.test(p)) ?? null;
|
|
24751
|
+
const plist = plistPath ? view.read(plistPath) : null;
|
|
24752
|
+
const strings = plist ? plistStrings(plist) : /* @__PURE__ */ new Map();
|
|
24753
|
+
if (plist) {
|
|
24754
|
+
for (const rule of IOS_PURPOSE) {
|
|
24755
|
+
const used = has(rule.pkgs);
|
|
24756
|
+
if (!used.length) continue;
|
|
24757
|
+
for (const alt of rule.keys) {
|
|
24758
|
+
const keys2 = alt.split("|");
|
|
24759
|
+
const present = keys2.find((k) => strings.has(k));
|
|
24760
|
+
if (!present) {
|
|
24761
|
+
add({
|
|
24762
|
+
id: `ios.purpose.${keys2[0]}`,
|
|
24763
|
+
store: "apple",
|
|
24764
|
+
severity: "blocker",
|
|
24765
|
+
title: `Missing ${keys2[0]}`,
|
|
24766
|
+
detail: `${used.join(", ")} uses ${rule.what}. Without a purpose string the app crashes when it asks, and App Review rejects it.`,
|
|
24767
|
+
guideline: "5.1.1",
|
|
24768
|
+
file: plistPath,
|
|
24769
|
+
fix: `Add <key>${keys2[0]}</key><string>Why your app needs ${rule.what}, in plain words</string> to Info.plist.`
|
|
24770
|
+
});
|
|
24771
|
+
} else if (PLACEHOLDER.test(strings.get(present))) {
|
|
24772
|
+
add({
|
|
24773
|
+
id: `ios.purpose.vague.${present}`,
|
|
24774
|
+
store: "apple",
|
|
24775
|
+
severity: "high",
|
|
24776
|
+
title: `${present} is empty or a placeholder`,
|
|
24777
|
+
detail: "Apple rejects purpose strings that don't explain why the app needs access.",
|
|
24778
|
+
guideline: "5.1.1",
|
|
24779
|
+
file: plistPath,
|
|
24780
|
+
fix: "Write a specific sentence, e.g. \u201CScan receipts to add them to your expenses.\u201D"
|
|
24781
|
+
});
|
|
24782
|
+
}
|
|
24783
|
+
}
|
|
24784
|
+
}
|
|
24785
|
+
for (const [key, value] of strings) {
|
|
24786
|
+
if (/UsageDescription$/.test(key) && PLACEHOLDER.test(value) && !findings.some((f) => f.id === `ios.purpose.vague.${key}`)) {
|
|
24787
|
+
add({
|
|
24788
|
+
id: `ios.purpose.vague.${key}`,
|
|
24789
|
+
store: "apple",
|
|
24790
|
+
severity: "medium",
|
|
24791
|
+
title: `${key} is empty or a placeholder`,
|
|
24792
|
+
detail: "If the app (or an SDK in it) ever asks for this permission, Apple rejects a purpose string that doesn't explain why.",
|
|
24793
|
+
guideline: "5.1.1",
|
|
24794
|
+
file: plistPath,
|
|
24795
|
+
fix: "Write the specific reason, or remove the key if nothing in the app asks for it."
|
|
24796
|
+
});
|
|
24797
|
+
}
|
|
24798
|
+
}
|
|
24799
|
+
const tracking = has(TRACKING_SDKS);
|
|
24800
|
+
if (tracking.length && !strings.has("NSUserTrackingUsageDescription")) {
|
|
24801
|
+
add({
|
|
24802
|
+
id: "ios.att",
|
|
24803
|
+
store: "apple",
|
|
24804
|
+
severity: "high",
|
|
24805
|
+
title: "Tracking SDKs without App Tracking Transparency",
|
|
24806
|
+
detail: `${tracking.join(", ")} can track users across apps. If they use the advertising identifier, Apple requires the ATT prompt and NSUserTrackingUsageDescription.`,
|
|
24807
|
+
guideline: "5.1.2",
|
|
24808
|
+
file: plistPath,
|
|
24809
|
+
fix: "Ask with react-native-tracking-transparency before starting these SDKs, or configure them not to track."
|
|
24810
|
+
});
|
|
24811
|
+
}
|
|
24812
|
+
const modes = plistArray(plist, "UIBackgroundModes");
|
|
24813
|
+
if (modes.includes("location") && !strings.has("NSLocationAlwaysAndWhenInUseUsageDescription")) {
|
|
24814
|
+
add({ id: "ios.background-location", store: "apple", severity: "high", title: "Background location without the \u201CAlways\u201D purpose string", detail: "UIBackgroundModes has location, but NSLocationAlwaysAndWhenInUseUsageDescription is missing.", guideline: "2.5.4 / 5.1.1", file: plistPath, fix: "Add the purpose string, or remove the location background mode if you don't track in the background." });
|
|
24815
|
+
}
|
|
24816
|
+
if (modes.includes("audio") && !has(["react-native-track-player", "react-native-video", "expo-av", "expo-audio", "react-native-sound"]).length) {
|
|
24817
|
+
add({ id: "ios.background-audio", store: "apple", severity: "medium", title: "Background audio mode without an audio player", detail: "Apple rejects background modes the app doesn't need.", guideline: "2.5.4", file: plistPath, fix: "Remove the audio background mode unless the app plays audio in the background." });
|
|
24818
|
+
}
|
|
24819
|
+
if (!strings.has("ITSAppUsesNonExemptEncryption") && !/ITSAppUsesNonExemptEncryption/.test(plist)) {
|
|
24820
|
+
add({ id: "ios.encryption", store: "apple", severity: "info", title: "Export compliance not declared", detail: "Without ITSAppUsesNonExemptEncryption, App Store Connect asks about encryption on every upload.", file: plistPath, fix: "Add <key>ITSAppUsesNonExemptEncryption</key><false/> if you only use HTTPS and system crypto." });
|
|
24821
|
+
}
|
|
24822
|
+
const manifests = view.find("ios", /^PrivacyInfo\.xcprivacy$/, 3);
|
|
24823
|
+
if (!manifests.length) {
|
|
24824
|
+
add({ id: "ios.privacy-manifest", store: "apple", severity: "blocker", title: "No privacy manifest", detail: "Apps must include PrivacyInfo.xcprivacy declaring why they use required-reason APIs (React Native itself uses some). Uploads without it are rejected.", guideline: "ITMS-91053", fix: "Add ios/<App>/PrivacyInfo.xcprivacy (the React Native template includes one) and list the APIs your app and SDKs use." });
|
|
24825
|
+
} else if (!manifests.some((m) => /NSPrivacyAccessedAPITypes/.test(view.read(m) ?? ""))) {
|
|
24826
|
+
add({ id: "ios.privacy-manifest.empty", store: "apple", severity: "high", title: "Privacy manifest declares no API reasons", detail: "React Native uses UserDefaults, file timestamps and system boot time; these need declared reasons.", guideline: "ITMS-91053", file: manifests[0], fix: "Add NSPrivacyAccessedAPITypes entries for each required-reason API." });
|
|
24827
|
+
}
|
|
24828
|
+
}
|
|
24829
|
+
const thirdPartyLogin = has(THIRD_PARTY_LOGIN);
|
|
24830
|
+
if (thirdPartyLogin.length && !has(APPLE_LOGIN).length) {
|
|
24831
|
+
add({
|
|
24832
|
+
id: "ios.login",
|
|
24833
|
+
store: "apple",
|
|
24834
|
+
severity: "high",
|
|
24835
|
+
title: "Third-party login without an equivalent option",
|
|
24836
|
+
detail: `${thirdPartyLogin.join(", ")} found. Apps that offer third-party login must also offer a login that limits data collection, such as Sign in with Apple.`,
|
|
24837
|
+
guideline: "4.8",
|
|
24838
|
+
fix: "Add Sign in with Apple (@invertase/react-native-apple-authentication or expo-apple-authentication)."
|
|
24839
|
+
});
|
|
24840
|
+
}
|
|
24841
|
+
const payments = has(PAYMENT_SDKS);
|
|
24842
|
+
if (payments.length && !has(IAP_SDKS).length) {
|
|
24843
|
+
add({
|
|
24844
|
+
id: "ios.payments",
|
|
24845
|
+
store: "apple",
|
|
24846
|
+
severity: "medium",
|
|
24847
|
+
title: "Card payments without in-app purchase",
|
|
24848
|
+
detail: `${payments.join(", ")} found and no in-app purchase library. That's fine for physical goods and services; digital content, subscriptions and features must use in-app purchase.`,
|
|
24849
|
+
guideline: "3.1.1",
|
|
24850
|
+
fix: "If you sell digital content, use react-native-iap or RevenueCat on iOS."
|
|
24851
|
+
});
|
|
24852
|
+
}
|
|
24853
|
+
const code = sources.map((s) => s.text).join("\n");
|
|
24854
|
+
const signsUp = /\b(sign\s?up|signUp|create\s?account|createAccount|register(User|Account)?)\b/i.test(code);
|
|
24855
|
+
const deletes = /\b(delete\s?(my\s)?account|deleteAccount|delete_account|account\s?deletion|close\s?account)\b/i.test(code);
|
|
24856
|
+
if (signsUp && !deletes) {
|
|
24857
|
+
add({
|
|
24858
|
+
id: "both.account-deletion",
|
|
24859
|
+
store: "both",
|
|
24860
|
+
severity: "high",
|
|
24861
|
+
title: "Account creation without account deletion",
|
|
24862
|
+
detail: "The app lets people create an account, but no way to delete it was found. Apple requires deletion inside the app; Google Play requires it in the app and on the web.",
|
|
24863
|
+
guideline: "Apple 5.1.1(v) \xB7 Google Play User Data policy",
|
|
24864
|
+
fix: "Add \u201CDelete account\u201D in settings and a web page for deletion requests."
|
|
24865
|
+
});
|
|
24866
|
+
}
|
|
24867
|
+
if (/\b(eval\s*\(|new\s+Function\s*\()/.test(code)) {
|
|
24868
|
+
add({ id: "both.dynamic-code", store: "apple", severity: "info", title: "Runs code from strings (eval / new Function)", detail: "Code that downloads and runs other code is reviewed closely; over-the-air JavaScript is allowed only within the reviewed app's purpose.", guideline: "2.5.2" });
|
|
24869
|
+
}
|
|
24870
|
+
const manifestPath = view.read("android/app/src/main/AndroidManifest.xml") ? "android/app/src/main/AndroidManifest.xml" : null;
|
|
24871
|
+
const manifest = manifestPath ? view.read(manifestPath) : null;
|
|
24872
|
+
const expoConfig = parseJson(view.read("app.json"));
|
|
24873
|
+
const perms = manifest ? androidPermissions(manifest) : (expoConfig?.expo?.android?.permissions ?? []).map((p) => p.replace(/^android\.permission\./, ""));
|
|
24874
|
+
for (const p of perms) {
|
|
24875
|
+
const rule = ANDROID_RESTRICTED[p];
|
|
24876
|
+
if (rule) add({ id: `android.permission.${p}`, store: "google", severity: rule.severity, title: `${rule.title} (${p})`, detail: rule.detail, guideline: "Google Play permissions policy", file: manifestPath ?? "app.json", fix: rule.fix });
|
|
24877
|
+
}
|
|
24878
|
+
if (manifest && /usesCleartextTraffic="true"/.test(manifest)) {
|
|
24879
|
+
add({ id: "android.cleartext", store: "google", severity: "medium", title: "Cleartext (http://) traffic allowed", detail: "Not a policy rejection, but Google Play's pre-launch report and security reviews flag it.", file: manifestPath, fix: "Use HTTPS, or allow cleartext only for debug builds." });
|
|
24880
|
+
}
|
|
24881
|
+
const gradle = ["android/build.gradle", "android/app/build.gradle", "android/app/build.gradle.kts", "android/build.gradle.kts"].map((p) => view.read(p)).filter((x) => !!x);
|
|
24882
|
+
const sdk = targetSdk(gradle);
|
|
24883
|
+
if (sdk !== null && sdk < 35) {
|
|
24884
|
+
add({ id: "android.target-sdk", store: "google", severity: "blocker", title: `targetSdk ${sdk} is too old`, detail: "Google Play requires new apps and updates to target Android 15 (API 35) or higher since 31 August 2025, and raises the level every year.", guideline: "Google Play target API level requirement", file: "android/build.gradle", fix: "Set targetSdkVersion to 35 or higher (36 recommended) and test the behaviour changes." });
|
|
24885
|
+
} else if (sdk !== null && sdk < 36) {
|
|
24886
|
+
add({ id: "android.target-sdk.next", store: "google", severity: "medium", title: `targetSdk ${sdk}: the yearly requirement moves up`, detail: "Google Play raises the required target API level every August. Check Play Console for the current deadline.", file: "android/build.gradle", fix: "Plan the move to API 36." });
|
|
24887
|
+
}
|
|
24888
|
+
if (d.has("react-native-google-mobile-ads") && manifest && !/com\.google\.android\.gms\.ads\.APPLICATION_ID/.test(manifest) && !expo) {
|
|
24889
|
+
add({ id: "android.ads-id", store: "google", severity: "high", title: "AdMob app ID missing", detail: "react-native-google-mobile-ads needs com.google.android.gms.ads.APPLICATION_ID in the manifest; the app crashes at start without it.", file: manifestPath, fix: "Set your AdMob app ID in app.json (react-native-google-mobile-ads) and rebuild." });
|
|
24890
|
+
}
|
|
24891
|
+
return { findings: sortFindings(findings), checked: { ios: !!plist, android: !!manifest || !!expoConfig?.expo, expo, sources: sources.length } };
|
|
24892
|
+
}
|
|
24893
|
+
var NATIVE_PATH = /^(ios|android)\/|(^|\/)(Podfile(\.lock)?|Gemfile(\.lock)?|.*\.podspec)$/;
|
|
24894
|
+
var JS_FILE = /\.(m|c)?[jt]sx?$/;
|
|
24895
|
+
var SCREEN_PATH = /(^|\/)(screens?|pages|views)\/|(^|\/)app\/(?!.*_layout)[^/]+\.[jt]sx$/i;
|
|
24896
|
+
function scanOta(input2) {
|
|
24897
|
+
const findings = [];
|
|
24898
|
+
const add = (f) => findings.push(f);
|
|
24899
|
+
const native = input2.changes.filter((c) => NATIVE_PATH.test(c.path));
|
|
24900
|
+
if (native.length) {
|
|
24901
|
+
add({
|
|
24902
|
+
id: "ota.native-files",
|
|
24903
|
+
store: "both",
|
|
24904
|
+
severity: "blocker",
|
|
24905
|
+
title: "Native code changed",
|
|
24906
|
+
detail: `${native.length} native file(s) changed (${native.slice(0, 4).map((c) => c.path).join(", ")}${native.length > 4 ? "\u2026" : ""}). Over-the-air updates only carry JavaScript and assets; JavaScript that relies on these changes will crash on the store build users have.`,
|
|
24907
|
+
fix: "Ship a store build for this, or move the native change to a separate branch."
|
|
24908
|
+
});
|
|
24909
|
+
}
|
|
24910
|
+
const before = deps(parseJson(input2.pkgBefore));
|
|
24911
|
+
const beforeVersions = parseJson(input2.pkgBefore)?.dependencies ?? {};
|
|
24912
|
+
const afterVersions = parseJson(input2.pkgAfter)?.dependencies ?? {};
|
|
24913
|
+
const nativeDeps = Object.keys(afterVersions).filter((p) => (!before.has(p) || beforeVersions[p] !== afterVersions[p]) && input2.view.hasNativeCode(p));
|
|
24914
|
+
if (nativeDeps.length) {
|
|
24915
|
+
add({
|
|
24916
|
+
id: "ota.native-deps",
|
|
24917
|
+
store: "both",
|
|
24918
|
+
severity: "blocker",
|
|
24919
|
+
title: "Dependencies with native code added or upgraded",
|
|
24920
|
+
detail: `${nativeDeps.join(", ")}: the store build users have doesn't contain this native code, so the update would crash or misbehave.`,
|
|
24921
|
+
fix: "Ship a store build with these dependencies first, then OTA updates that use them."
|
|
24922
|
+
});
|
|
24923
|
+
}
|
|
24924
|
+
if (input2.appJsonBefore !== void 0 && input2.appJsonAfter !== void 0 && input2.appJsonBefore !== input2.appJsonAfter) {
|
|
24925
|
+
const strip = (t) => {
|
|
24926
|
+
const j = parseJson(t ?? null)?.expo ?? {};
|
|
24927
|
+
const { plugins, ios, android, permissions, name, scheme } = j;
|
|
24928
|
+
return JSON.stringify({ plugins, ios, android, permissions, name, scheme });
|
|
24929
|
+
};
|
|
24930
|
+
if (strip(input2.appJsonBefore) !== strip(input2.appJsonAfter)) {
|
|
24931
|
+
add({ id: "ota.expo-native-config", store: "both", severity: "blocker", title: "Native app config changed (app.json)", detail: "Plugins, permissions, name or platform settings in app.json only take effect in a new store build.", fix: "Ship a store build for these settings." });
|
|
24932
|
+
}
|
|
24933
|
+
}
|
|
24934
|
+
const jsAdded = input2.changes.filter((c) => JS_FILE.test(c.path) && !c.path.includes("node_modules/"));
|
|
24935
|
+
const lines = jsAdded.flatMap((c) => c.added.map((l) => ({ path: c.path, l })));
|
|
24936
|
+
const firstHit = (re) => lines.find((x) => re.test(x.l));
|
|
24937
|
+
const plistPath = input2.view.find("ios", /^Info\.plist$/, 2).find((p) => !/Tests?\//.test(p)) ?? null;
|
|
24938
|
+
const strings = plistPath ? plistStrings(input2.view.read(plistPath) ?? "") : null;
|
|
24939
|
+
const manifest = input2.view.read("android/app/src/main/AndroidManifest.xml");
|
|
24940
|
+
const declared = manifest ? new Set(androidPermissions(manifest)) : null;
|
|
24941
|
+
for (const x of lines) {
|
|
24942
|
+
for (const m of x.l.matchAll(/PERMISSIONS\.(?:ANDROID\.|)([A-Z_]{3,})/g)) {
|
|
24943
|
+
const p = m[1];
|
|
24944
|
+
if (declared && !declared.has(p) && !/^(IOS)$/.test(p)) {
|
|
24945
|
+
add({ id: `ota.android-permission.${p}`, store: "google", severity: "blocker", title: `Asks for ${p}, which the app doesn't declare`, detail: `${x.path} requests ${p}, but AndroidManifest.xml doesn't list it. The request fails on the store build.`, file: x.path, fix: "Add the permission in a store build first." });
|
|
24946
|
+
}
|
|
24947
|
+
}
|
|
24948
|
+
for (const m of x.l.matchAll(/PERMISSIONS\.IOS\.([A-Z_]+)/g)) {
|
|
24949
|
+
const key = { CAMERA: "NSCameraUsageDescription", MICROPHONE: "NSMicrophoneUsageDescription", PHOTO_LIBRARY: "NSPhotoLibraryUsageDescription", CONTACTS: "NSContactsUsageDescription", LOCATION_WHEN_IN_USE: "NSLocationWhenInUseUsageDescription", LOCATION_ALWAYS: "NSLocationAlwaysAndWhenInUseUsageDescription", FACE_ID: "NSFaceIDUsageDescription", APP_TRACKING_TRANSPARENCY: "NSUserTrackingUsageDescription", BLUETOOTH: "NSBluetoothAlwaysUsageDescription", CALENDARS: "NSCalendarsUsageDescription" }[m[1]];
|
|
24950
|
+
if (key && strings && !strings.has(key)) {
|
|
24951
|
+
add({ id: `ota.ios-permission.${key}`, store: "apple", severity: "blocker", title: `Asks for ${m[1].toLowerCase().replace(/_/g, " ")} without ${key}`, detail: `${x.path} requests it, but the store build's Info.plist has no ${key}. iOS terminates the app when it asks.`, file: x.path, fix: "Add the purpose string in a store build first." });
|
|
24952
|
+
}
|
|
24953
|
+
}
|
|
24954
|
+
}
|
|
24955
|
+
const pay = firstHit(/(@stripe\/stripe-react-native|react-native-razorpay|checkout\.stripe\.com|buy\.stripe\.com|razorpay\.com\/payment|paypal\.com\/checkout|initPaymentSheet|presentPaymentSheet)/);
|
|
24956
|
+
if (pay) {
|
|
24957
|
+
add({
|
|
24958
|
+
id: "ota.payments",
|
|
24959
|
+
store: "apple",
|
|
24960
|
+
severity: "medium",
|
|
24961
|
+
title: "Adds or changes a card or web payment flow",
|
|
24962
|
+
detail: `${pay.path}: Apple requires in-app purchase for digital goods, subscriptions and features. A new external payment flow shipped over the air, without review, is a common reason for removal.`,
|
|
24963
|
+
guideline: "3.1.1 / 3.3.1(B)",
|
|
24964
|
+
file: pay.path,
|
|
24965
|
+
fix: "Fine for physical goods and services. For digital content, use in-app purchase or ship this in a reviewed store build."
|
|
24966
|
+
});
|
|
24967
|
+
}
|
|
24968
|
+
const dyn = firstHit(/\b(eval\s*\(|new\s+Function\s*\(|injectedJavaScript\s*=\s*\{?\s*await|injectJavaScript\(\s*(await|remote|fetched))/);
|
|
24969
|
+
if (dyn) {
|
|
24970
|
+
add({ id: "ota.dynamic-code", store: "apple", severity: "medium", title: "Runs code from strings", detail: `${dyn.path}: code that downloads and runs further code goes beyond what reviewed OTA updates may do.`, guideline: "2.5.2", file: dyn.path, fix: "Remove eval/new Function, or ship it in a store build." });
|
|
24971
|
+
}
|
|
24972
|
+
const newScreens = input2.changes.filter((c) => c.status === "A" && JS_FILE.test(c.path) && SCREEN_PATH.test(c.path));
|
|
24973
|
+
const newRoutes = lines.filter((x) => /<(Stack|Tab|Drawer)\.Screen\b|createStackNavigator|name=["'][A-Z]\w+["']\s+component=/.test(x.l)).length;
|
|
24974
|
+
if (newScreens.length >= 3 || newRoutes >= 3) {
|
|
24975
|
+
add({
|
|
24976
|
+
id: "ota.new-features",
|
|
24977
|
+
store: "apple",
|
|
24978
|
+
severity: "medium",
|
|
24979
|
+
title: `Adds ${Math.max(newScreens.length, newRoutes)} new screens`,
|
|
24980
|
+
detail: "Apple allows OTA updates that fix bugs and improve features without changing the app's primary purpose. A set of new screens may count as a new feature that should go through review.",
|
|
24981
|
+
guideline: "3.3.1(B) \xB7 2.3.1",
|
|
24982
|
+
fix: "If this is a new feature area, include it in a store build; keep OTA for fixes and small changes."
|
|
24983
|
+
});
|
|
24984
|
+
}
|
|
24985
|
+
const hidden = firstHit(/\b(isReviewer|inReview|appReviewMode|hideFromReview|REVIEW_MODE)\b/);
|
|
24986
|
+
if (hidden) {
|
|
24987
|
+
add({ id: "ota.hidden-features", store: "both", severity: "blocker", title: "Behaves differently for app reviewers", detail: `${hidden.path}: hiding features from App Review is a reason for removal from the store and the developer program.`, guideline: "Apple 2.3.1 \xB7 Google Play Deceptive Behavior", file: hidden.path, fix: "Remove the review-specific code path." });
|
|
24988
|
+
}
|
|
24989
|
+
const sorted = sortFindings(findings);
|
|
24990
|
+
const verdict = sorted.some((f) => f.severity === "blocker") ? "blocked" : sorted.some((f) => f.severity === "high" || f.severity === "medium") ? "risky" : "safe";
|
|
24991
|
+
const summary = verdict === "safe" ? "Safe to ship over the air: JavaScript and asset changes only, nothing the stores restrict." : verdict === "blocked" ? `Don't ship this over the air: ${sorted.find((f) => f.severity === "blocker").title.toLowerCase()}.` : `Review before shipping: ${sorted.filter((f) => f.severity !== "info").map((f) => f.title.toLowerCase()).join("; ")}.`;
|
|
24992
|
+
return { verdict, findings: sorted, summary };
|
|
24993
|
+
}
|
|
24994
|
+
|
|
24555
24995
|
// ../../node_modules/aws4fetch/dist/aws4fetch.esm.mjs
|
|
24556
24996
|
/**
|
|
24557
24997
|
* @license MIT <https://opensource.org/licenses/MIT>
|
|
@@ -24994,7 +25434,7 @@ async function api() {
|
|
|
24994
25434
|
if (!config2) throw new Error("Not logged in. Run `healkite login --api-url <url> --token <hk_\u2026>` or set HEALKITE_API_URL/HEALKITE_TOKEN.");
|
|
24995
25435
|
return new ApiClient(config2);
|
|
24996
25436
|
}
|
|
24997
|
-
var program2 = new Command().name("healkite").description("Self-healing over-the-air updates for React Native").version("0.
|
|
25437
|
+
var program2 = new Command().name("healkite").description("Self-healing over-the-air updates for React Native").version("0.3.0");
|
|
24998
25438
|
program2.command("login").description("Save API credentials to ~/.healkite/config.json").requiredOption("--api-url <url>", "Healkite API URL, e.g. https://api.healkite.com").requiredOption("--token <token>", "access key (hk_\u2026)").action(async (o) => {
|
|
24999
25439
|
const client = new ApiClient({ apiUrl: o.apiUrl, token: o.token });
|
|
25000
25440
|
await client.request("GET", "/v1/apps");
|
|
@@ -25096,7 +25536,7 @@ channels.command("create").argument("<name>").requiredOption("--app <appId>").ac
|
|
|
25096
25536
|
log(`Created channel ${name}. Put this key in your app config (HealkiteChannel / healkite_channel):`);
|
|
25097
25537
|
console.log(ch.key);
|
|
25098
25538
|
});
|
|
25099
|
-
program2.command("release").description("Bundle the app's JS + assets and publish it to a channel").addOption(platformOption()).requiredOption("-c, --channel <key>", "channel key").requiredOption("-r, --runtime-version <version>", "binary/runtime version this bundle targets").option("--project <dir>", "React Native project directory", ".").option("--entry-file <file>", "JS entry file", "index.js").option("--no-hermes", "skip Hermes bytecode compilation (JSC apps)").option("--rollout <pct>", "percentage of devices (1-100)", pct).option("--mandatory", "mark the update as mandatory", false).option("-d, --description <text>", "release notes").option("--sign <pem>", "sign with this private key (or set HEALKITE_SIGNING_KEY / HEALKITE_SIGNING_KEY_PATH)").option("--patch-from <n>", "diff against the last N distinct bundles on this target (0 disables)", "3").option("--guarded", "Guarded Release: start small, auto-advance when healthy, auto-halt on crashes").option("--guard-steps <list>", "rollout steps, e.g. 1,10,50,100").option("--guard-soak <duration>", "time per step, e.g. 30m, 2h, 0s").option("--guard-min-installs <n>", "installs needed per step before advancing").option("--guard-metric <event:maxDropPct...>", "halt if trackEvent(event) per session drops > maxDropPct % vs previous release, e.g. checkout_success:20").option("--at <time>", 'go live later: +2h, "2026-11-20 00:00" (local time) or an ISO time').option("--until <time>", "campaign end: the release turns itself off and devices go back to the previous one").option("--device <id...>", "only these devices get it (support fixes, testers); everyone else is untouched").option("--hotfix", "instant hotfix: mandatory + silent push so devices update now (needs Firebase connected)").option("--live", "live patch: like --hotfix, and apps reload at a safe moment keeping the state they registered (screen, cart, forms)").option("--push", "silent push so devices check now (not mandatory)").option("--experiment <name>", "A/B experiment: compare this release (--rollout %) with what everyone else runs").option("--metric <event...>", "with --experiment: trackEvent names to compare per session (first = primary)").option("--max-size <size>", "fail before uploading if the bundle is bigger, e.g. 2MB").option("--max-growth <pct>", "fail before uploading if the bundle grew more than this % vs the previous release").option("--out <dir>", "local mode: write to a CDN directory instead of the API").action(async (o) => void await releaseAction(o));
|
|
25539
|
+
program2.command("release").description("Bundle the app's JS + assets and publish it to a channel").addOption(platformOption()).requiredOption("-c, --channel <key>", "channel key").requiredOption("-r, --runtime-version <version>", "binary/runtime version this bundle targets").option("--project <dir>", "React Native project directory", ".").option("--entry-file <file>", "JS entry file", "index.js").option("--no-hermes", "skip Hermes bytecode compilation (JSC apps)").option("--rollout <pct>", "percentage of devices (1-100)", pct).option("--mandatory", "mark the update as mandatory", false).option("-d, --description <text>", "release notes").option("--sign <pem>", "sign with this private key (or set HEALKITE_SIGNING_KEY / HEALKITE_SIGNING_KEY_PATH)").option("--patch-from <n>", "diff against the last N distinct bundles on this target (0 disables)", "3").option("--guarded", "Guarded Release: start small, auto-advance when healthy, auto-halt on crashes").option("--guard-steps <list>", "rollout steps, e.g. 1,10,50,100").option("--guard-soak <duration>", "time per step, e.g. 30m, 2h, 0s").option("--guard-min-installs <n>", "installs needed per step before advancing").option("--guard-max-startup <pct>", "halt if the median app start gets more than this % slower than the previous release, e.g. 20").option("--guard-metric <event:maxDropPct...>", "halt if trackEvent(event) per session drops > maxDropPct % vs previous release, e.g. checkout_success:20").option("--at <time>", 'go live later: +2h, "2026-11-20 00:00" (local time) or an ISO time').option("--until <time>", "campaign end: the release turns itself off and devices go back to the previous one").option("--device <id...>", "only these devices get it (support fixes, testers); everyone else is untouched").option("--hotfix", "instant hotfix: mandatory + silent push so devices update now (needs Firebase connected)").option("--live", "live patch: like --hotfix, and apps reload at a safe moment keeping the state they registered (screen, cart, forms)").option("--push", "silent push so devices check now (not mandatory)").option("--experiment <name>", "A/B experiment: compare this release (--rollout %) with what everyone else runs").option("--metric <event...>", "with --experiment: trackEvent names to compare per session (first = primary)").option("--max-size <size>", "fail before uploading if the bundle is bigger, e.g. 2MB").option("--max-growth <pct>", "fail before uploading if the bundle grew more than this % vs the previous release").option("--out <dir>", "local mode: write to a CDN directory instead of the API").option("--no-store-check", "skip the OTA store-rules check").option("--no-startup-profile", "don't measure start-up time on devices").option("--force", "publish even when the store check says it can't ship over the air").action(async (o) => void await releaseAction(o));
|
|
25100
25540
|
var codepush = program2.command("codepush").description("CodePush / App Center-compatible commands for migrating scripts and CI (a deployment is a Healkite channel)");
|
|
25101
25541
|
async function cpApp(nameOrId) {
|
|
25102
25542
|
const { apps: apps2 } = await (await api()).request("GET", "/v1/summary");
|
|
@@ -25252,7 +25692,7 @@ program2.command("size").description("Build the bundle and check its size agains
|
|
|
25252
25692
|
projectDir,
|
|
25253
25693
|
platform: o.platform,
|
|
25254
25694
|
entryFile: o.entryFile,
|
|
25255
|
-
outDir:
|
|
25695
|
+
outDir: join6(projectDir, ".healkite/build", o.platform),
|
|
25256
25696
|
hermes: o.hermes,
|
|
25257
25697
|
log: o.json ? () => {
|
|
25258
25698
|
} : log
|
|
@@ -25356,6 +25796,7 @@ function guardOptions(o) {
|
|
|
25356
25796
|
if (o.guardSteps) g.steps = String(o.guardSteps).split(",").map((x) => Number(x.trim()));
|
|
25357
25797
|
if (o.guardSoak) g.soakSeconds = parseDuration(String(o.guardSoak));
|
|
25358
25798
|
if (o.guardMinInstalls) g.minInstalls = Number(o.guardMinInstalls);
|
|
25799
|
+
if (o.guardMaxStartup) g.maxStartupRegressionPct = Number(o.guardMaxStartup);
|
|
25359
25800
|
if (Array.isArray(o.guardMetric) && o.guardMetric.length) {
|
|
25360
25801
|
g.metrics = o.guardMetric.map((spec) => {
|
|
25361
25802
|
const [event, pct2] = spec.split(":");
|
|
@@ -25444,6 +25885,125 @@ program2.command("inspect").description("Verify and list the contents of an .hkb
|
|
|
25444
25885
|
}
|
|
25445
25886
|
log(`${files.size} files verified`);
|
|
25446
25887
|
});
|
|
25888
|
+
var ICON = { blocker: "\x1B[31m\u2718 BLOCKER\x1B[0m", high: "\x1B[31m\u25B2 HIGH\x1B[0m", medium: "\x1B[33m\u25CF MEDIUM\x1B[0m", info: "\x1B[2m\xB7 info\x1B[0m" };
|
|
25889
|
+
var STORE = { apple: "App Store", google: "Google Play", both: "Both stores" };
|
|
25890
|
+
function printFindings(findings) {
|
|
25891
|
+
for (const f of findings) {
|
|
25892
|
+
console.log(`
|
|
25893
|
+
${ICON[f.severity]} ${f.title} \x1B[2m(${STORE[f.store]}${f.guideline ? ` \xB7 ${f.guideline}` : ""})\x1B[0m`);
|
|
25894
|
+
console.log(` ${f.detail}`);
|
|
25895
|
+
if (f.file) console.log(` \x1B[2m${f.file}\x1B[0m`);
|
|
25896
|
+
if (f.fix) console.log(` \u2192 ${f.fix}`);
|
|
25897
|
+
}
|
|
25898
|
+
}
|
|
25899
|
+
program2.command("store-check").description("Find what could get your next App Store / Google Play build rejected (permissions, purpose strings, privacy manifest, login, payments, account deletion, target SDK\u2026)").option("--project <dir>", "React Native project directory", ".").option("--json", "print findings as JSON (for CI)").option("--fail-on <level>", "exit with an error at this severity or worse: blocker | high | medium", "blocker").action(async (o) => {
|
|
25900
|
+
const projectDir = resolve2(o.project);
|
|
25901
|
+
const r = scanProject(fsProject(projectDir), appSources(projectDir));
|
|
25902
|
+
if (o.json) console.log(JSON.stringify(r, null, 2));
|
|
25903
|
+
else {
|
|
25904
|
+
log(`Checked ${[r.checked.ios && "iOS", r.checked.android && "Android"].filter(Boolean).join(" and ") || "the project"} (${r.checked.sources} source files)${r.checked.expo ? ", Expo" : ""}`);
|
|
25905
|
+
if (!r.findings.length) log("No store rejection risks found.");
|
|
25906
|
+
printFindings(r.findings);
|
|
25907
|
+
const n = (s) => r.findings.filter((f) => f.severity === s).length;
|
|
25908
|
+
console.log(`
|
|
25909
|
+
${n("blocker")} blocker \xB7 ${n("high")} high \xB7 ${n("medium")} medium \xB7 ${n("info")} info`);
|
|
25910
|
+
}
|
|
25911
|
+
const order = ["blocker", "high", "medium"];
|
|
25912
|
+
const limit = order.indexOf(o.failOn);
|
|
25913
|
+
if (limit >= 0 && r.findings.some((f) => order.indexOf(f.severity) >= 0 && order.indexOf(f.severity) <= limit)) process.exitCode = 1;
|
|
25914
|
+
});
|
|
25915
|
+
program2.command("ota-check").description("Check whether changes can ship over the air: native changes, missing permissions, payments, new features (store rules for OTA)").option("--project <dir>", "React Native project directory", ".").option("--base <ref>", "compare with this commit or branch (default: what the channel's devices run, with -c/-p/-r)").option("-c, --channel <key>", "channel key (to compare with the live release)").addOption(new Option("-p, --platform <platform>").choices([...PLATFORMS])).option("-r, --runtime-version <version>", "app version").option("--json", "print the result as JSON").action(async (o) => {
|
|
25916
|
+
const projectDir = resolve2(o.project);
|
|
25917
|
+
let base = o.base;
|
|
25918
|
+
if (!base && o.channel && o.platform && o.runtimeVersion) base = await liveCommit(o.channel, o.platform, o.runtimeVersion) ?? void 0;
|
|
25919
|
+
if (!base) throw new Error("pass --base <ref>, or -c/-p/-r so Healkite compares with the release devices run");
|
|
25920
|
+
const r = await otaCheck(projectDir, base);
|
|
25921
|
+
if (o.json) return console.log(JSON.stringify(r, null, 2));
|
|
25922
|
+
log(r.summary);
|
|
25923
|
+
printFindings(r.findings);
|
|
25924
|
+
if (r.verdict === "blocked") process.exitCode = 1;
|
|
25925
|
+
});
|
|
25926
|
+
async function liveCommit(channel, platform, runtimeVersion) {
|
|
25927
|
+
const client = await api();
|
|
25928
|
+
const q = new URLSearchParams({ platform, runtimeVersion, limit: "20" });
|
|
25929
|
+
const { releases } = await client.request("GET", `/v1/channels/${channel}/releases?${q}`);
|
|
25930
|
+
const live = releases.find((r) => r.status === "active" && !r.audience);
|
|
25931
|
+
if (!live) return null;
|
|
25932
|
+
return (await client.request("GET", `/v1/releases/${live.id}/source`).catch(() => ({ source: null }))).source?.commit ?? null;
|
|
25933
|
+
}
|
|
25934
|
+
async function otaCheck(projectDir, base) {
|
|
25935
|
+
const view = fsProject(projectDir);
|
|
25936
|
+
return scanOta({
|
|
25937
|
+
changes: await changesSince(projectDir, base),
|
|
25938
|
+
pkgBefore: await fileAt(projectDir, base, "package.json"),
|
|
25939
|
+
pkgAfter: fileNow(projectDir, "package.json"),
|
|
25940
|
+
appJsonBefore: await fileAt(projectDir, base, "app.json"),
|
|
25941
|
+
appJsonAfter: fileNow(projectDir, "app.json"),
|
|
25942
|
+
view
|
|
25943
|
+
});
|
|
25944
|
+
}
|
|
25945
|
+
program2.command("startup").description("App start time on real devices for a release, vs the previous one, and the modules that take the time").argument("<release>", "release id").option("--json", "print as JSON").action(async (releaseId, o) => {
|
|
25946
|
+
const client = await api();
|
|
25947
|
+
const v = await client.request("GET", `/v1/releases/${releaseId}/startup`);
|
|
25948
|
+
if (o.json) return console.log(JSON.stringify(v, null, 2));
|
|
25949
|
+
const s = (ms) => ms === null ? "\u2013" : `${(ms / 1e3).toFixed(2)} s`;
|
|
25950
|
+
if (!v.release.samples) return log("No start-up samples yet. Devices send them on 1 in 5 launches once the build has the Babel plugin.");
|
|
25951
|
+
log(`${v.release.label}: median ${s(v.release.p50)} \xB7 p75 ${s(v.release.p75)} \xB7 p90 ${s(v.release.p90)} (${v.release.samples} launches)`);
|
|
25952
|
+
if (v.previous?.p50 && v.release.p50) {
|
|
25953
|
+
const d = (v.release.p50 - v.previous.p50) / v.previous.p50 * 100;
|
|
25954
|
+
log(`${v.previous.label}: median ${s(v.previous.p50)} \u2192 ${d >= 0 ? "+" : ""}${d.toFixed(0)}%`);
|
|
25955
|
+
}
|
|
25956
|
+
console.log("\nWhere start-up time goes (average per launch, own work only):");
|
|
25957
|
+
for (const m of v.modules.slice(0, 15)) {
|
|
25958
|
+
const was = m.isNew ? " \x1B[33mnew\x1B[0m" : m.previousAvgMs !== null && m.avgMs > m.previousAvgMs * 1.2 + 2 ? ` \x1B[33mwas ${m.previousAvgMs} ms\x1B[0m` : "";
|
|
25959
|
+
console.log(` ${String(m.avgMs).padStart(7)} ms ${m.path}${was}`);
|
|
25960
|
+
}
|
|
25961
|
+
console.log("\nTo speed it up: move work out of module top level (do it when first used), and import heavy packages where they're needed, not in App.tsx.");
|
|
25962
|
+
});
|
|
25963
|
+
var moduleCmd = program2.command("module").description("Independent releases per team: ship a module (Re.Pack chunk or federated remote) on its own");
|
|
25964
|
+
moduleCmd.command("release").description("Publish one module's scripts (from its Re.Pack output folder) with its own rollout or guard").argument("<name>", "module name, e.g. payments").requiredOption("--dir <dir>", "folder with this module's built scripts (Re.Pack output), e.g. build/outputs/android/remotes/payments").addOption(platformOption()).requiredOption("-c, --channel <key>", "channel key").requiredOption("-r, --runtime-version <version>", "app version the module is built for").option("--rollout <pct>", "percentage of devices (1-100)", pct).option("--guarded", "roll out 1% \u2192 10% \u2192 50% \u2192 100% and stop on load failures or errors in the module").option("-d, --description <text>", "release notes").action(async (name, o) => {
|
|
25965
|
+
const client = await api();
|
|
25966
|
+
const dir = resolve2(o.dir);
|
|
25967
|
+
const { readdir: readdir3, stat: stat2 } = await import("node:fs/promises");
|
|
25968
|
+
const { createHash: createHash2 } = await import("node:crypto");
|
|
25969
|
+
const files = {};
|
|
25970
|
+
const walk2 = async (d, prefix) => {
|
|
25971
|
+
for (const e of await readdir3(d)) {
|
|
25972
|
+
const full = join6(d, e);
|
|
25973
|
+
if ((await stat2(full)).isDirectory()) await walk2(full, `${prefix}${e}/`);
|
|
25974
|
+
else if (!e.endsWith(".map")) {
|
|
25975
|
+
const bytes = new Uint8Array(await readFile5(full));
|
|
25976
|
+
const sha256 = createHash2("sha256").update(bytes).digest("hex");
|
|
25977
|
+
await client.uploadBlob(bytes, sha256, "asset");
|
|
25978
|
+
files[`${prefix}${e}`] = { sha256, size: bytes.byteLength };
|
|
25979
|
+
}
|
|
25980
|
+
}
|
|
25981
|
+
};
|
|
25982
|
+
await walk2(dir, "");
|
|
25983
|
+
if (!Object.keys(files).length) throw new Error(`no scripts in ${dir}`);
|
|
25984
|
+
log(`Uploaded ${Object.keys(files).length} file(s) for ${name}`);
|
|
25985
|
+
const r = await client.request("POST", "/v1/modules/releases", {
|
|
25986
|
+
channelKey: o.channel,
|
|
25987
|
+
platform: o.platform,
|
|
25988
|
+
runtimeVersion: o.runtimeVersion,
|
|
25989
|
+
module: name,
|
|
25990
|
+
files,
|
|
25991
|
+
description: o.description,
|
|
25992
|
+
rolloutPct: o.rollout,
|
|
25993
|
+
guard: o.guarded || void 0
|
|
25994
|
+
});
|
|
25995
|
+
log(`Released ${r.label} (${r.id}) to ${r.rolloutPct}% of devices${o.guarded ? ", guarded" : ""}. Other modules are unchanged.`);
|
|
25996
|
+
});
|
|
25997
|
+
moduleCmd.command("list").description("Module releases of an app").requiredOption("--app <id>", "app id").action(async (o) => {
|
|
25998
|
+
const client = await api();
|
|
25999
|
+
const { releases } = await client.request(
|
|
26000
|
+
"GET",
|
|
26001
|
+
`/v1/apps/${o.app}/modules`
|
|
26002
|
+
);
|
|
26003
|
+
for (const r of releases) {
|
|
26004
|
+
console.log(`${r.label.padEnd(24)} ${r.platform}/${r.runtimeVersion} ${String(r.rolloutPct).padStart(3)}% ${r.status}${r.guard ? ` \xB7 guard ${r.guard.state}${r.guard.reason ? ` (${r.guard.reason})` : ""}` : ""} ${r.id}`);
|
|
26005
|
+
}
|
|
26006
|
+
});
|
|
25447
26007
|
var debugCmd = program2.command("debug").description("Production debugging: logpoint builds for chosen devices");
|
|
25448
26008
|
debugCmd.command("build").description("Build the release those devices run with the session's logpoints and send it to them only (run in CI or locally)").argument("<session>", "debug session id (dbg_\u2026), from the dashboard").option("--project <dir>", "React Native project directory", ".").option("--entry-file <file>", "JS entry file", "index.js").option("--no-hermes", "skip Hermes bytecode compilation (JSC apps)").option("--sign <pem>", "sign with this private key (or HEALKITE_SIGNING_KEY)").action(async (sessionId, o) => {
|
|
25449
26009
|
const client = await api();
|
|
@@ -25462,7 +26022,7 @@ debugCmd.command("build").description("Build the release those devices run with
|
|
|
25462
26022
|
if (head !== spec.baseCommit) log(`Note: building ${head.slice(0, 8)}, but the devices run ${spec.baseCommit.slice(0, 8)}. Check out that commit so line numbers match.`);
|
|
25463
26023
|
}
|
|
25464
26024
|
for (const lp of spec.logpoints) {
|
|
25465
|
-
if (!
|
|
26025
|
+
if (!existsSync4(join6(projectDir, lp.file))) await fail(`${lp.file} doesn't exist in this checkout`);
|
|
25466
26026
|
}
|
|
25467
26027
|
await client.request("POST", `/v1/debug-sessions/${sessionId}/status`, { status: "building" });
|
|
25468
26028
|
log(`Debug session ${sessionId}: ${spec.logpoints.length} logpoint(s) for ${spec.devices.length} device(s)`);
|
|
@@ -25509,8 +26069,8 @@ debugCmd.command("logs").description("Print the values captured by a debug sessi
|
|
|
25509
26069
|
});
|
|
25510
26070
|
async function hasLogpointPlugin(projectDir) {
|
|
25511
26071
|
for (const f of ["babel.config.js", "babel.config.cjs", "babel.config.mjs", "babel.config.json", ".babelrc", ".babelrc.js", "package.json"]) {
|
|
25512
|
-
const p =
|
|
25513
|
-
if (
|
|
26072
|
+
const p = join6(projectDir, f);
|
|
26073
|
+
if (existsSync4(p) && (await readFile5(p, "utf8")).includes("react-native-healkite/babel")) return true;
|
|
25514
26074
|
}
|
|
25515
26075
|
return false;
|
|
25516
26076
|
}
|
|
@@ -25538,7 +26098,7 @@ program2.command("blame").description("Find the change that broke a release: sym
|
|
|
25538
26098
|
projectDir,
|
|
25539
26099
|
platform: release.platform,
|
|
25540
26100
|
entryFile: o.entryFile,
|
|
25541
|
-
outDir:
|
|
26101
|
+
outDir: join6(projectDir, ".healkite/blame", release.platform),
|
|
25542
26102
|
hermes: o.hermes,
|
|
25543
26103
|
sourcemap: true,
|
|
25544
26104
|
log
|
|
@@ -25675,14 +26235,20 @@ async function releaseAction(o) {
|
|
|
25675
26235
|
const maxSize = o.maxSize ? parseSize(o.maxSize) : void 0;
|
|
25676
26236
|
const maxGrowthPct = o.maxGrowth !== void 0 ? parsePercent(o.maxGrowth) : void 0;
|
|
25677
26237
|
const signingKey = await loadSigningKey(o.sign);
|
|
26238
|
+
const profileEnv = !o.buildEnv && o.startupProfile !== false && await hasLogpointPlugin(projectDir) ? {
|
|
26239
|
+
HEALKITE_STARTUP_PROFILE: "1",
|
|
26240
|
+
HEALKITE_PROJECT_ROOT: projectDir,
|
|
26241
|
+
...existsSync4(join6(projectDir, o.entryFile ?? "index.js")) ? { HEALKITE_ENTRY: join6(projectDir, o.entryFile ?? "index.js") } : {}
|
|
26242
|
+
} : {};
|
|
26243
|
+
if (profileEnv.HEALKITE_STARTUP_PROFILE) log("Start-up profiling on (devices report start time and the slowest modules)");
|
|
25678
26244
|
const built = await buildBundle({
|
|
25679
26245
|
projectDir,
|
|
25680
26246
|
platform: o.platform,
|
|
25681
26247
|
entryFile: o.entryFile,
|
|
25682
|
-
outDir:
|
|
26248
|
+
outDir: join6(projectDir, ".healkite/build", o.platform),
|
|
25683
26249
|
hermes: o.hermes,
|
|
25684
26250
|
log,
|
|
25685
|
-
env: o.buildEnv
|
|
26251
|
+
env: o.buildEnv ?? (Object.keys(profileEnv).length ? profileEnv : void 0)
|
|
25686
26252
|
});
|
|
25687
26253
|
const packed = await packDirectory(built);
|
|
25688
26254
|
log(`Packed ${packed.index.files.length} files \u2192 ${(packed.hkb.byteLength / 1024).toFixed(1)} KB (sha256 ${packed.sha256.slice(0, 12)}\u2026)`);
|
|
@@ -25776,10 +26342,25 @@ async function releaseAction(o) {
|
|
|
25776
26342
|
log(`Couldn't read git history (${e.message}); publishing without it.`);
|
|
25777
26343
|
}
|
|
25778
26344
|
}
|
|
26345
|
+
let review = null;
|
|
26346
|
+
if (!o.skipSource && source?.baseCommit && !o.noStoreCheck && o.storeCheck !== false) {
|
|
26347
|
+
try {
|
|
26348
|
+
review = await otaCheck(projectDir, source.baseCommit);
|
|
26349
|
+
log(`Store check: ${review.summary}`);
|
|
26350
|
+
for (const f of review.findings.filter((x) => x.severity !== "info")) log(` ${f.severity.toUpperCase()}: ${f.title}`);
|
|
26351
|
+
if (review.verdict === "blocked" && !o.force) {
|
|
26352
|
+
throw new Error("This update can't safely ship over the air (see above). Ship a store build, or pass --force if you're sure.");
|
|
26353
|
+
}
|
|
26354
|
+
} catch (e) {
|
|
26355
|
+
if (e.message.startsWith("This update can't")) throw e;
|
|
26356
|
+
log(`Store check skipped (${e.message})`);
|
|
26357
|
+
}
|
|
26358
|
+
}
|
|
25779
26359
|
const githubOidcToken = await githubOidc();
|
|
25780
26360
|
if (githubOidcToken) log("Build provenance: GitHub Actions identity attached");
|
|
25781
26361
|
const release = await client.request("POST", "/v1/releases", {
|
|
25782
26362
|
provenance: githubOidcToken ? { githubOidcToken } : void 0,
|
|
26363
|
+
review: review ? { verdict: review.verdict, summary: review.summary, findings: review.findings } : void 0,
|
|
25783
26364
|
source: source ?? void 0,
|
|
25784
26365
|
channelKey: o.channel,
|
|
25785
26366
|
platform: o.platform,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "healkite",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Healkite CLI — release, promote and roll back over-the-air React Native updates.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
"@types/node": "^24",
|
|
14
14
|
"typescript": "~6.0.3",
|
|
15
15
|
"vitest": "^5.1.0",
|
|
16
|
-
"@healkite/adapter-blob-fs": "0.0.0",
|
|
17
16
|
"@healkite/adapter-blob-s3": "0.0.0",
|
|
18
|
-
"@healkite/adapter-cdn-cloudflare": "0.0.0",
|
|
19
17
|
"@healkite/core": "0.0.0",
|
|
20
|
-
"healkite-protocol": "0.
|
|
18
|
+
"healkite-protocol": "0.3.0",
|
|
19
|
+
"@healkite/adapter-cdn-cloudflare": "0.0.0",
|
|
20
|
+
"@healkite/adapter-blob-fs": "0.0.0"
|
|
21
21
|
},
|
|
22
22
|
"author": "Healkite",
|
|
23
23
|
"homepage": "https://healkite.com",
|