Skip to content

Commit d0d8ac6

Browse files
author
Test
committed
chore: rename cmux references to mux
Change-Id: I2160509c1397552b547117dce280b02c7a884146 Signed-off-by: Test <test@example.com>
1 parent 6e09add commit d0d8ac6

Some content is hidden

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

49 files changed

+333
-200
lines changed

mobile/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# cmux Mobile App
1+
# mux Mobile App
22

3-
Expo React Native app for cmux - connects to cmux server over HTTP/WebSocket.
3+
Expo React Native app for mux - connects to mux server over HTTP/WebSocket.
44

55
## Requirements
66

@@ -48,7 +48,7 @@ Edit `app.json` to set your server URL and auth token:
4848
{
4949
"expo": {
5050
"extra": {
51-
"cmux": {
51+
"mux": {
5252
"baseUrl": "http://<your-tailscale-ip>:3000",
5353
"authToken": "your_token_here"
5454
}
@@ -59,11 +59,11 @@ Edit `app.json` to set your server URL and auth token:
5959

6060
## Server Setup
6161

62-
Start the cmux server with auth (optional):
62+
Start the mux server with auth (optional):
6363

6464
```bash
65-
# In the main cmux repo
66-
CMUX_SERVER_AUTH_TOKEN=your_token make dev-server BACKEND_HOST=0.0.0.0 BACKEND_PORT=3000
65+
# In the main mux repo
66+
MUX_SERVER_AUTH_TOKEN=your_token make dev-server BACKEND_HOST=0.0.0.0 BACKEND_PORT=3000
6767
```
6868

6969
The mobile app will:
@@ -97,4 +97,4 @@ bunx expo run:ios # or run:android
9797

9898
**Version mismatch**: Ensure Expo Go is SDK 54 (check App Store/Play Store for latest).
9999

100-
**Connection refused**: Make sure the cmux server is running and accessible from your device (use your machine's Tailscale IP or local network IP, not `localhost`).
100+
**Connection refused**: Make sure the mux server is running and accessible from your device (use your machine's Tailscale IP or local network IP, not `localhost`).

mobile/app.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"expo": {
3-
"name": "cmux-mobile",
4-
"slug": "cmux-mobile",
3+
"name": "mux-mobile",
4+
"slug": "mux-mobile",
55
"version": "0.0.1",
6-
"scheme": "cmux",
6+
"scheme": "mux",
77
"orientation": "portrait",
88
"platforms": ["ios", "android"],
99
"newArchEnabled": true,
@@ -12,14 +12,14 @@
1212
"typedRoutes": true
1313
},
1414
"extra": {
15-
"cmux": {
15+
"mux": {
1616
"baseUrl": "http://100.114.78.86:3000",
1717
"authToken": ""
1818
}
1919
},
2020
"plugins": ["expo-router", "expo-secure-store"],
2121
"ios": {
22-
"bundleIdentifier": "com.coder.cmux-mobile"
22+
"bundleIdentifier": "com.coder.mux-mobile"
2323
}
2424
}
2525
}

mobile/app/settings.tsx

Lines changed: 51 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,41 @@ import { useTheme } from "../src/theme";
77
import { Surface } from "../src/components/Surface";
88
import { ThemedText } from "../src/components/ThemedText";
99

10-
const STORAGE_KEY_BASE_URL = "com.coder.cmux.app-settings.baseUrl";
11-
const STORAGE_KEY_AUTH_TOKEN = "com.coder.cmux.app-settings.authToken";
10+
const STORAGE_KEY_BASE_URL = "com.coder.mux.app-settings.baseUrl";
11+
const STORAGE_KEY_AUTH_TOKEN = "com.coder.mux.app-settings.authToken";
12+
const LEGACY_STORAGE_KEY_BASE_URL = "com.coder.cmux.app-settings.baseUrl";
13+
const LEGACY_STORAGE_KEY_AUTH_TOKEN = "com.coder.cmux.app-settings.authToken";
1214

13-
function getDefaultBaseUrl(): string {
14-
const extra = (Constants.expoConfig?.extra as any)?.cmux;
15-
return (extra?.baseUrl as string) ?? "http://localhost:3000";
15+
type ExpoExtraConfig = {
16+
baseUrl?: string;
17+
authToken?: string;
18+
};
19+
20+
type ExpoExtraBag = {
21+
mux?: ExpoExtraConfig;
22+
cmux?: ExpoExtraConfig;
23+
};
24+
25+
function getExpoExtra(): ExpoExtraConfig {
26+
const extra = (Constants.expoConfig?.extra as ExpoExtraBag | undefined) ?? undefined;
27+
return extra?.mux ?? extra?.cmux ?? {};
28+
}
29+
30+
function getDefaultBaseUrl(extra: ExpoExtraConfig = getExpoExtra()): string {
31+
return typeof extra.baseUrl === "string" ? extra.baseUrl : "http://localhost:3000";
32+
}
33+
34+
async function readWithMigration(newKey: string, legacyKey: string): Promise<string | null> {
35+
const value = await SecureStore.getItemAsync(newKey);
36+
if (value !== null) {
37+
return value;
38+
}
39+
const legacyValue = await SecureStore.getItemAsync(legacyKey);
40+
if (legacyValue !== null) {
41+
await SecureStore.setItemAsync(newKey, legacyValue);
42+
return legacyValue;
43+
}
44+
return null;
1645
}
1746

1847
export default function Settings(): JSX.Element {
@@ -25,19 +54,25 @@ export default function Settings(): JSX.Element {
2554
useEffect(() => {
2655
async function loadSettings() {
2756
try {
28-
const storedBaseUrl = await SecureStore.getItemAsync(STORAGE_KEY_BASE_URL);
29-
const storedAuthToken = await SecureStore.getItemAsync(STORAGE_KEY_AUTH_TOKEN);
57+
const extra = getExpoExtra();
58+
const storedBaseUrl = await readWithMigration(
59+
STORAGE_KEY_BASE_URL,
60+
LEGACY_STORAGE_KEY_BASE_URL
61+
);
62+
const storedAuthToken = await readWithMigration(
63+
STORAGE_KEY_AUTH_TOKEN,
64+
LEGACY_STORAGE_KEY_AUTH_TOKEN
65+
);
3066

31-
// Use stored values if available, otherwise fall back to expo config
32-
const extra = (Constants.expoConfig?.extra as any)?.cmux;
33-
setBaseUrl(storedBaseUrl ?? extra?.baseUrl ?? getDefaultBaseUrl());
34-
setAuthToken(storedAuthToken ?? extra?.authToken ?? "");
67+
setBaseUrl(storedBaseUrl ?? getDefaultBaseUrl(extra));
68+
setAuthToken(
69+
storedAuthToken ?? (typeof extra.authToken === "string" ? extra.authToken : "")
70+
);
3571
} catch (error) {
3672
console.error("Failed to load app settings:", error);
37-
// Fall back to expo config
38-
const extra = (Constants.expoConfig?.extra as any)?.cmux;
39-
setBaseUrl(extra?.baseUrl ?? getDefaultBaseUrl());
40-
setAuthToken(extra?.authToken ?? "");
73+
const extra = getExpoExtra();
74+
setBaseUrl(getDefaultBaseUrl(extra));
75+
setAuthToken(typeof extra.authToken === "string" ? extra.authToken : "");
4176
}
4277
}
4378

@@ -142,7 +177,7 @@ export default function Settings(): JSX.Element {
142177
variant="caption"
143178
style={{ marginTop: spacing.xs, color: theme.colors.foregroundMuted }}
144179
>
145-
Tip: Set CMUX_SERVER_AUTH_TOKEN on the server and pass the token here. The app forwards
180+
Tip: Set MUX_SERVER_AUTH_TOKEN on the server and pass the token here. The app forwards
146181
it as a query parameter on WebSocket connections.
147182
</ThemedText>
148183
</View>

mobile/app/workspace/[id]/review.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { JSX } from "react";
22
import { Stack } from "expo-router";
3-
import GitReviewScreen from "../../src/screens/GitReviewScreen";
3+
import GitReviewScreen from "src/screens/GitReviewScreen";
44

55
export default function GitReviewRoute(): JSX.Element {
66
return (

mobile/bun.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"lockfileVersion": 1,
33
"workspaces": {
44
"": {
5-
"name": "@coder/cmux-mobile",
5+
"name": "@coder/mux-mobile",
66
"dependencies": {
77
"@gorhom/bottom-sheet": "^5.2.6",
88
"@react-native-async-storage/async-storage": "2.2.0",

mobile/ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ platform :ios, podfile_properties['ios.deploymentTarget'] || '15.1'
2020

2121
prepare_react_native_project!
2222

23-
target 'cmuxmobile' do
23+
target 'muxmobile' do
2424
use_expo_modules!
2525

2626
if ENV['EXPO_USE_COMMUNITY_AUTOLINKING'] == '1'

mobile/ios/cmuxmobile.xcodeproj/project.pbxproj renamed to mobile/ios/muxmobile.xcodeproj/project.pbxproj

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
/* End PBXBuildFile section */
1515

1616
/* Begin PBXFileReference section */
17-
13B07F961A680F5B00A75B9A /* cmuxmobile.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = cmuxmobile.app; sourceTree = BUILT_PRODUCTS_DIR; };
18-
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = cmuxmobile/Images.xcassets; sourceTree = "<group>"; };
19-
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = cmuxmobile/Info.plist; sourceTree = "<group>"; };
20-
AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = SplashScreen.storyboard; path = cmuxmobile/SplashScreen.storyboard; sourceTree = "<group>"; };
17+
13B07F961A680F5B00A75B9A /* muxmobile.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = muxmobile.app; sourceTree = BUILT_PRODUCTS_DIR; };
18+
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = muxmobile/Images.xcassets; sourceTree = "<group>"; };
19+
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = muxmobile/Info.plist; sourceTree = "<group>"; };
20+
AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = SplashScreen.storyboard; path = muxmobile/SplashScreen.storyboard; sourceTree = "<group>"; };
2121
BB2F792C24A3F905000567C9 /* Expo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Expo.plist; sourceTree = "<group>"; };
2222
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
23-
F11748412D0307B40044C1D9 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = cmuxmobile/AppDelegate.swift; sourceTree = "<group>"; };
24-
F11748442D0722820044C1D9 /* cmuxmobile-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "cmuxmobile-Bridging-Header.h"; path = "cmuxmobile/cmuxmobile-Bridging-Header.h"; sourceTree = "<group>"; };
23+
F11748412D0307B40044C1D9 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = muxmobile/AppDelegate.swift; sourceTree = "<group>"; };
24+
F11748442D0722820044C1D9 /* muxmobile-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "muxmobile-Bridging-Header.h"; path = "muxmobile/muxmobile-Bridging-Header.h"; sourceTree = "<group>"; };
2525
/* End PBXFileReference section */
2626

2727
/* Begin PBXFrameworksBuildPhase section */
@@ -35,17 +35,17 @@
3535
/* End PBXFrameworksBuildPhase section */
3636

3737
/* Begin PBXGroup section */
38-
13B07FAE1A68108700A75B9A /* cmuxmobile */ = {
38+
13B07FAE1A68108700A75B9A /* muxmobile */ = {
3939
isa = PBXGroup;
4040
children = (
4141
F11748412D0307B40044C1D9 /* AppDelegate.swift */,
42-
F11748442D0722820044C1D9 /* cmuxmobile-Bridging-Header.h */,
42+
F11748442D0722820044C1D9 /* muxmobile-Bridging-Header.h */,
4343
BB2F792B24A3F905000567C9 /* Supporting */,
4444
13B07FB51A68108700A75B9A /* Images.xcassets */,
4545
13B07FB61A68108700A75B9A /* Info.plist */,
4646
AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */,
4747
);
48-
name = cmuxmobile;
48+
name = muxmobile;
4949
sourceTree = "<group>";
5050
};
5151
2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
@@ -66,7 +66,7 @@
6666
83CBB9F61A601CBA00E9B192 = {
6767
isa = PBXGroup;
6868
children = (
69-
13B07FAE1A68108700A75B9A /* cmuxmobile */,
69+
13B07FAE1A68108700A75B9A /* muxmobile */,
7070
832341AE1AAA6A7D00B99B32 /* Libraries */,
7171
83CBBA001A601CBA00E9B192 /* Products */,
7272
2D16E6871FA4F8E400B85C8A /* Frameworks */,
@@ -79,7 +79,7 @@
7979
83CBBA001A601CBA00E9B192 /* Products */ = {
8080
isa = PBXGroup;
8181
children = (
82-
13B07F961A680F5B00A75B9A /* cmuxmobile.app */,
82+
13B07F961A680F5B00A75B9A /* muxmobile.app */,
8383
);
8484
name = Products;
8585
sourceTree = "<group>";
@@ -90,15 +90,15 @@
9090
BB2F792C24A3F905000567C9 /* Expo.plist */,
9191
);
9292
name = Supporting;
93-
path = cmuxmobile/Supporting;
93+
path = muxmobile/Supporting;
9494
sourceTree = "<group>";
9595
};
9696
/* End PBXGroup section */
9797

9898
/* Begin PBXNativeTarget section */
99-
13B07F861A680F5B00A75B9A /* cmuxmobile */ = {
99+
13B07F861A680F5B00A75B9A /* muxmobile */ = {
100100
isa = PBXNativeTarget;
101-
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "cmuxmobile" */;
101+
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "muxmobile" */;
102102
buildPhases = (
103103
08A4A3CD28434E44B6B9DE2E /* [CP] Check Pods Manifest.lock */,
104104
13B07F871A680F5B00A75B9A /* Sources */,
@@ -111,9 +111,9 @@
111111
);
112112
dependencies = (
113113
);
114-
name = cmuxmobile;
115-
productName = cmuxmobile;
116-
productReference = 13B07F961A680F5B00A75B9A /* cmuxmobile.app */;
114+
name = muxmobile;
115+
productName = muxmobile;
116+
productReference = 13B07F961A680F5B00A75B9A /* muxmobile.app */;
117117
productType = "com.apple.product-type.application";
118118
};
119119
/* End PBXNativeTarget section */
@@ -129,7 +129,7 @@
129129
};
130130
};
131131
};
132-
buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "cmuxmobile" */;
132+
buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "muxmobile" */;
133133
compatibilityVersion = "Xcode 3.2";
134134
developmentRegion = en;
135135
hasScannedForEncodings = 0;
@@ -142,7 +142,7 @@
142142
projectDirPath = "";
143143
projectRoot = "";
144144
targets = (
145-
13B07F861A680F5B00A75B9A /* cmuxmobile */,
145+
13B07F861A680F5B00A75B9A /* muxmobile */,
146146
);
147147
};
148148
/* End PBXProject section */
@@ -193,7 +193,7 @@
193193
outputFileListPaths = (
194194
);
195195
outputPaths = (
196-
"$(DERIVED_FILE_DIR)/Pods-cmuxmobile-checkManifestLockResult.txt",
196+
"$(DERIVED_FILE_DIR)/Pods-muxmobile-checkManifestLockResult.txt",
197197
);
198198
runOnlyForDeploymentPostprocessing = 0;
199199
shellPath = /bin/sh;
@@ -206,7 +206,7 @@
206206
files = (
207207
);
208208
inputPaths = (
209-
"${PODS_ROOT}/Target Support Files/Pods-cmuxmobile/Pods-cmuxmobile-resources.sh",
209+
"${PODS_ROOT}/Target Support Files/Pods-muxmobile/Pods-muxmobile-resources.sh",
210210
"${PODS_CONFIGURATION_BUILD_DIR}/EXConstants/EXConstants.bundle",
211211
"${PODS_CONFIGURATION_BUILD_DIR}/EXUpdates/EXUpdates.bundle",
212212
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/RCTI18nStrings.bundle",
@@ -219,7 +219,7 @@
219219
);
220220
runOnlyForDeploymentPostprocessing = 0;
221221
shellPath = /bin/sh;
222-
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-cmuxmobile/Pods-cmuxmobile-resources.sh\"\n";
222+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-muxmobile/Pods-muxmobile-resources.sh\"\n";
223223
showEnvVarsInLog = 0;
224224
};
225225
/* End PBXShellScriptBuildPhase section */
@@ -247,7 +247,7 @@
247247
"$(inherited)",
248248
"FB_SONARKIT_ENABLED=1",
249249
);
250-
INFOPLIST_FILE = cmuxmobile/Info.plist;
250+
INFOPLIST_FILE = muxmobile/Info.plist;
251251
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
252252
LD_RUNPATH_SEARCH_PATHS = (
253253
"$(inherited)",
@@ -259,9 +259,9 @@
259259
"-ObjC",
260260
"-lc++",
261261
);
262-
PRODUCT_BUNDLE_IDENTIFIER = org.name.cmuxmobile;
263-
PRODUCT_NAME = cmuxmobile;
264-
SWIFT_OBJC_BRIDGING_HEADER = "cmuxmobile/cmuxmobile-Bridging-Header.h";
262+
PRODUCT_BUNDLE_IDENTIFIER = org.name.muxmobile;
263+
PRODUCT_NAME = muxmobile;
264+
SWIFT_OBJC_BRIDGING_HEADER = "muxmobile/muxmobile-Bridging-Header.h";
265265
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
266266
SWIFT_VERSION = 5.0;
267267
VERSIONING_SYSTEM = "apple-generic";
@@ -274,7 +274,7 @@
274274
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
275275
CLANG_ENABLE_MODULES = YES;
276276
CURRENT_PROJECT_VERSION = 1;
277-
INFOPLIST_FILE = cmuxmobile/Info.plist;
277+
INFOPLIST_FILE = muxmobile/Info.plist;
278278
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
279279
LD_RUNPATH_SEARCH_PATHS = (
280280
"$(inherited)",
@@ -286,9 +286,9 @@
286286
"-ObjC",
287287
"-lc++",
288288
);
289-
PRODUCT_BUNDLE_IDENTIFIER = org.name.cmuxmobile;
290-
PRODUCT_NAME = cmuxmobile;
291-
SWIFT_OBJC_BRIDGING_HEADER = "cmuxmobile/cmuxmobile-Bridging-Header.h";
289+
PRODUCT_BUNDLE_IDENTIFIER = org.name.muxmobile;
290+
PRODUCT_NAME = muxmobile;
291+
SWIFT_OBJC_BRIDGING_HEADER = "muxmobile/muxmobile-Bridging-Header.h";
292292
SWIFT_VERSION = 5.0;
293293
VERSIONING_SYSTEM = "apple-generic";
294294
};
@@ -408,7 +408,7 @@
408408
/* End XCBuildConfiguration section */
409409

410410
/* Begin XCConfigurationList section */
411-
13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "cmuxmobile" */ = {
411+
13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "muxmobile" */ = {
412412
isa = XCConfigurationList;
413413
buildConfigurations = (
414414
13B07F941A680F5B00A75B9A /* Debug */,
@@ -417,7 +417,7 @@
417417
defaultConfigurationIsVisible = 0;
418418
defaultConfigurationName = Release;
419419
};
420-
83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "cmuxmobile" */ = {
420+
83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "muxmobile" */ = {
421421
isa = XCConfigurationList;
422422
buildConfigurations = (
423423
83CBBA201A601CBA00E9B192 /* Debug */,

0 commit comments

Comments
 (0)