Skip to content

Commit 78a95fb

Browse files
juliusmarmingecodex
andcommitted
Add T3 Code mobile app and shared remote runtime
Rebuild PR #2013 on top of current origin/main without the duplicated commit lineage. Co-authored-by: codex <codex@users.noreply.github.com>
1 parent 7968f27 commit 78a95fb

File tree

190 files changed

+23873
-2008
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+23873
-2008
lines changed

.oxfmtrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"**/routeTree.gen.ts",
1212
"apps/web/public/mockServiceWorker.js",
1313
"apps/web/src/lib/vendor/qrcodegen.ts",
14+
"apps/mobile/uniwind-types.d.ts"
1415
"*.icon/**"
1516
],
1617
"sortPackageJson": {}

.oxlintrc.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"node_modules",
77
"bun.lock",
88
"*.tsbuildinfo",
9-
"**/routeTree.gen.ts"
9+
"**/routeTree.gen.ts",
10+
"apps/mobile/uniwind-types.d.ts"
1011
],
1112
"plugins": ["eslint", "oxc", "react", "unicorn", "typescript"],
1213
"categories": {
@@ -15,6 +16,7 @@
1516
"perf": "warn"
1617
},
1718
"rules": {
19+
"unicorn/no-array-sort": "off",
1820
"react-in-jsx-scope": "off",
1921
"eslint/no-shadow": "off",
2022
"eslint/no-await-in-loop": "off"

apps/mobile/.gitignore

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
2+
3+
# dependencies
4+
node_modules/
5+
6+
# Expo
7+
.expo/
8+
dist/
9+
web-build/
10+
expo-env.d.ts
11+
12+
# Native
13+
.kotlin/
14+
*.orig.*
15+
*.jks
16+
*.p8
17+
*.p12
18+
*.key
19+
*.mobileprovision
20+
21+
# Metro
22+
.metro-health-check*
23+
24+
# debug
25+
npm-debug.*
26+
yarn-debug.*
27+
yarn-error.*
28+
29+
# macOS
30+
.DS_Store
31+
*.pem
32+
33+
# local env files
34+
.env*.local
35+
36+
# typescript
37+
*.tsbuildinfo
38+
39+
# generated native folders
40+
/ios
41+
/android

apps/mobile/README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# T3 Code Mobile
2+
3+
> [!WARNING]
4+
> T3 Code Mobile is currently in development and is not distributed yet. If you want to try it out, you can build it from source.
5+
6+
## Quickstart
7+
8+
> [!NOTE]
9+
> Uses native modules so using Expo Go is not supported. You need to use the Expo Dev Client.
10+
11+
This app has three variants:
12+
13+
- `development`: Expo dev client, installable side-by-side as `T3 Code Dev`
14+
- `preview`: persistent internal preview build, installable side-by-side as `T3 Code Preview`
15+
- `production`: store/release build as `T3 Code`
16+
17+
Run commands from `apps/mobile`.
18+
19+
## Development
20+
21+
Start Metro for the dev client:
22+
23+
```bash
24+
bun run dev:client
25+
```
26+
27+
Build and run the local iOS dev client:
28+
29+
```bash
30+
bun run ios:dev
31+
```
32+
33+
Build and run the local iOS preview app:
34+
35+
```bash
36+
bun run ios:preview
37+
```
38+
39+
Inspect the resolved Expo config for a variant:
40+
41+
```bash
42+
bun run config:dev
43+
bun run config:preview
44+
```
45+
46+
## EAS Builds
47+
48+
Create a cloud dev-client build:
49+
50+
```bash
51+
bun run eas:ios:dev
52+
```
53+
54+
Create a persistent preview build:
55+
56+
```bash
57+
bun run eas:ios:preview
58+
```
59+
60+
Android equivalents:
61+
62+
```bash
63+
bun run eas:android:dev
64+
bun run eas:android:preview
65+
```

apps/mobile/app.config.ts

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
import type { ExpoConfig } from "expo/config";
2+
3+
type AppVariant = "development" | "preview" | "production";
4+
5+
const APP_VARIANT = resolveAppVariant(process.env.APP_VARIANT);
6+
7+
const VARIANT_CONFIG: Record<
8+
AppVariant,
9+
{
10+
readonly appName: string;
11+
readonly iosIcon: string;
12+
readonly iosBundleIdentifier: string;
13+
readonly androidPackage: string;
14+
}
15+
> = {
16+
development: {
17+
appName: "T3 Code Dev",
18+
iosIcon: "./assets/icon-composer-dev.icon",
19+
iosBundleIdentifier: "com.t3tools.t3code.dev",
20+
androidPackage: "com.t3tools.t3code.dev",
21+
},
22+
preview: {
23+
appName: "T3 Code Preview",
24+
iosIcon: "./assets/icon-composer-prod.icon",
25+
iosBundleIdentifier: "com.t3tools.t3code.preview",
26+
androidPackage: "com.t3tools.t3code.preview",
27+
},
28+
production: {
29+
appName: "T3 Code",
30+
iosIcon: "./assets/icon-composer-prod.icon",
31+
iosBundleIdentifier: "com.t3tools.t3code",
32+
androidPackage: "com.t3tools.t3code",
33+
},
34+
};
35+
36+
function resolveAppVariant(value: string | undefined): AppVariant {
37+
switch (value) {
38+
case "development":
39+
case "preview":
40+
case "production":
41+
return value;
42+
default:
43+
return "production";
44+
}
45+
}
46+
47+
const variant = VARIANT_CONFIG[APP_VARIANT];
48+
49+
const config: ExpoConfig = {
50+
name: variant.appName,
51+
slug: "t3-code",
52+
scheme: "t3code",
53+
version: "0.1.0",
54+
runtimeVersion: {
55+
policy: "appVersion",
56+
},
57+
orientation: "portrait",
58+
icon: "./assets/icon.png",
59+
userInterfaceStyle: "automatic",
60+
updates: {
61+
enabled: true,
62+
url: "https://u.expo.dev/d763fcb8-d37c-41ea-a773-b54a0ab4a454",
63+
checkAutomatically: "ON_LOAD",
64+
fallbackToCacheTimeout: 0,
65+
},
66+
splash: {
67+
image: "./assets/splash-icon.png",
68+
resizeMode: "contain",
69+
backgroundColor: "#ffffff",
70+
},
71+
ios: {
72+
icon: variant.iosIcon,
73+
supportsTablet: true,
74+
bundleIdentifier: variant.iosBundleIdentifier,
75+
infoPlist: {
76+
NSAppTransportSecurity: {
77+
NSAllowsArbitraryLoads: true,
78+
},
79+
ITSAppUsesNonExemptEncryption: false,
80+
},
81+
},
82+
android: {
83+
icon: "./assets/icon.png",
84+
package: variant.androidPackage,
85+
adaptiveIcon: {
86+
backgroundColor: "#E6F4FE",
87+
foregroundImage: "./assets/android-icon-foreground.png",
88+
backgroundImage: "./assets/android-icon-background.png",
89+
monochromeImage: "./assets/android-icon-monochrome.png",
90+
},
91+
predictiveBackGestureEnabled: false,
92+
},
93+
web: {
94+
favicon: "./assets/favicon.png",
95+
},
96+
plugins: [
97+
[
98+
"expo-camera",
99+
{
100+
cameraPermission: "Allow T3 Code to access your camera so you can scan pairing QR codes.",
101+
barcodeScannerEnabled: true,
102+
},
103+
],
104+
[
105+
"expo-splash-screen",
106+
{
107+
image: "./assets/splash-icon.png",
108+
resizeMode: "contain",
109+
backgroundColor: "#ffffff",
110+
imageWidth: 220,
111+
dark: {
112+
image: "./assets/splash-icon.png",
113+
backgroundColor: "#0a0a0a",
114+
},
115+
},
116+
],
117+
"expo-secure-store",
118+
"expo-router",
119+
"./plugins/withAndroidCleartextTraffic.cjs",
120+
],
121+
extra: {
122+
appVariant: APP_VARIANT,
123+
eas: {
124+
projectId: "d763fcb8-d37c-41ea-a773-b54a0ab4a454",
125+
},
126+
},
127+
owner: "pingdotgg",
128+
};
129+
130+
export default config;
323 KB
Loading
323 KB
Loading
323 KB
Loading

apps/mobile/assets/favicon.png

73.7 KB
Loading
Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)