Skip to content

Commit 4ea073d

Browse files
chore(mobile): improve Expo build readiness (#68)
* chore(mobile): improve Expo build readiness * ci: limit workflow token permissions
1 parent edf0578 commit 4ea073d

8 files changed

Lines changed: 369 additions & 287 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
branches: [main]
66
pull_request:
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
build:
1013
runs-on: ubuntu-latest
@@ -16,7 +19,7 @@ jobs:
1619

1720
- uses: actions/setup-node@v5
1821
with:
19-
node-version: lts/*
22+
node-version-file: .nvmrc
2023
cache: pnpm
2124

2225
- name: Install

‎.github/workflows/mobile.yml‎

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,18 @@ on:
66
paths:
77
- 'apps/mobile/**'
88
- '.github/workflows/mobile.yml'
9+
- '.nvmrc'
10+
- 'package.json'
11+
- 'pnpm-lock.yaml'
12+
- 'pnpm-workspace.yaml'
913
pull_request:
1014
paths:
1115
- 'apps/mobile/**'
1216
- '.github/workflows/mobile.yml'
17+
- '.nvmrc'
18+
- 'package.json'
19+
- 'pnpm-lock.yaml'
20+
- 'pnpm-workspace.yaml'
1321
# EAS cloud builds / store submits are manual so they don't burn build
1422
# credits on every push. Trigger from the Actions tab → "Run workflow".
1523
workflow_dispatch:
@@ -29,13 +37,16 @@ on:
2937
type: boolean
3038
default: false
3139

40+
permissions:
41+
contents: read
42+
3243
defaults:
3344
run:
3445
working-directory: apps/mobile
3546

3647
jobs:
37-
# Fast, free check on every push/PR: typecheck, lint, and prove the JS bundle
38-
# builds via `expo export` (no device, no EAS minutes).
48+
# Fast, free check on every push/PR: typecheck, lint, test, and prove both JS
49+
# bundles build via `expo export` (no device, no EAS minutes).
3950
ci:
4051
runs-on: ubuntu-latest
4152
steps:
@@ -45,7 +56,7 @@ jobs:
4556

4657
- uses: actions/setup-node@v5
4758
with:
48-
node-version: lts/*
59+
node-version-file: .nvmrc
4960
cache: pnpm
5061

5162
- name: Install
@@ -58,8 +69,11 @@ jobs:
5869
- name: Lint
5970
run: pnpm lint
6071

72+
- name: Test
73+
run: pnpm test
74+
6175
- name: Bundle (expo export)
62-
run: pnpm exec expo export --platform android --output-dir dist-export
76+
run: pnpm export
6377

6478
# Cloud build + optional store submit via EAS. Requires the EXPO_TOKEN repo
6579
# secret (Expo account access token). iOS/Android signing credentials are
@@ -74,7 +88,7 @@ jobs:
7488

7589
- uses: actions/setup-node@v5
7690
with:
77-
node-version: lts/*
91+
node-version-file: .nvmrc
7892
cache: pnpm
7993

8094
- name: Install

‎.nvmrc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
24

‎apps/mobile/BUILD_READINESS.md‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Mobile build readiness
2+
3+
This checklist covers the Expo companion in `apps/mobile`. It does not cover
4+
the native Chromium build in `apps/android-engine`.
5+
6+
## Local toolchain
7+
8+
- Node.js 24 (see the repository `.nvmrc` and root `engines` field)
9+
- pnpm 9.12.0 via Corepack
10+
11+
Run these local release-readiness checks from the repository root:
12+
13+
```bash
14+
corepack enable
15+
pnpm install --frozen-lockfile
16+
pnpm --filter @tronbrowser/mobile typecheck
17+
pnpm --filter @tronbrowser/mobile lint
18+
pnpm --filter @tronbrowser/mobile test
19+
pnpm --filter @tronbrowser/mobile export
20+
cd apps/mobile && pnpm dlx expo-doctor
21+
```
22+
23+
The mobile package intentionally stays on the workspace TypeScript 5.x line.
24+
Expo Doctor currently recommends TypeScript 6 for SDK 57, but changing the
25+
compiler major is a workspace-wide migration rather than a mobile-only update.
26+
The exception is declared in `package.json`; typecheck, tests, lint, and both
27+
platform bundles remain the CI acceptance checks. Expo Doctor is a
28+
network-backed local diagnostic and is not run in CI.
29+
30+
## EAS preview build
31+
32+
The app is linked to the `profullstack/tronbrowserdev` EAS project. Cloud builds
33+
require an Expo access token from the `profullstack` account. The account owner
34+
should add that token directly to the GitHub repository as the `EXPO_TOKEN`
35+
Actions secret; the token should not be shared in chat or committed to git.
36+
37+
After the secret is present, run the `Mobile` workflow manually with:
38+
39+
- platform: `android`
40+
- profile: `preview`
41+
- submit: `false`
42+
43+
The workflow starts an asynchronous EAS build. Its EAS build URL is the handoff
44+
artifact for review. Store submission remains a separate production step and
45+
requires the corresponding Apple or Google developer account and signing setup.

‎apps/mobile/README.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ TronBrowser mobile **companion** app (iOS + Android) — **Expo / React Native**
44
Expo SDK 57. See [`docs/mobile-architecture.md`](../../docs/mobile-architecture.md)
55
for how this fits the three mobile tracks.
66

7+
Build prerequisites and the EAS access checklist are documented in
8+
[`BUILD_READINESS.md`](BUILD_READINESS.md).
9+
710
> **This is the companion app, not the engine.** It uses the *system* WebView
811
> (WKWebView on iOS — mandatory; system WebView on Android), so it is **not** the
912
> Ungoogled Chromium engine and has **no Chrome extensions / no bundled Tor**.

‎apps/mobile/metro.config.js‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ config.resolver.nodeModulesPaths = [
1313
path.resolve(projectRoot, 'node_modules'),
1414
path.resolve(workspaceRoot, 'node_modules'),
1515
];
16-
// pnpm stores real packages under a symlinked layout; follow them.
17-
config.resolver.unstable_enableSymlinks = true;
1816
config.resolver.disableHierarchicalLookup = false;
1917

2018
module.exports = config;

‎apps/mobile/package.json‎

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,28 @@
77
"scripts": {
88
"build": "tsc --noEmit",
99
"typecheck": "tsc --noEmit",
10-
"test": "vitest run --passWithNoTests",
10+
"test": "vitest run",
1111
"lint": "eslint . --ext .ts,.tsx",
1212
"start": "expo start",
1313
"android": "expo run:android",
1414
"ios": "expo run:ios",
1515
"export": "expo export --platform all",
1616
"prebuild": "expo prebuild"
1717
},
18+
"expo": {
19+
"install": {
20+
"exclude": [
21+
"typescript"
22+
]
23+
}
24+
},
1825
"dependencies": {
19-
"expo": "^57.0.1",
20-
"expo-constants": "~57.0.2",
21-
"expo-status-bar": "~57.0.0",
26+
"@expo/dom-webview": "~57.0.1",
27+
"expo": "~57.0.9",
28+
"expo-constants": "~57.0.8",
29+
"expo-status-bar": "~57.0.1",
2230
"react": "19.2.3",
23-
"react-native": "0.86.0",
31+
"react-native": "0.86.2",
2432
"react-native-webview": "13.16.1"
2533
},
2634
"devDependencies": {

0 commit comments

Comments
 (0)