diff --git a/.github/workflows/mobile-ci.yml b/.github/workflows/mobile-ci.yml index f355ab5b5..0440521e5 100644 --- a/.github/workflows/mobile-ci.yml +++ b/.github/workflows/mobile-ci.yml @@ -77,11 +77,11 @@ jobs: # - name: Cache NDK # uses: actions/cache@v3 # with: - # path: ${{ env.ANDROID_HOME }}/ndk/23.1.7779620 - # key: ndk-23.1.7779620 + # path: ${{ env.ANDROID_HOME }}/ndk/26.1.10909125 + # key: ndk-26.1.10909125 # # - name: Install NDK - # run: echo "y" | sudo ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "ndk;23.1.7779620" + # run: echo "y" | sudo ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "ndk;26.1.10909125" # # - name: Cache Gradle # uses: gradle/gradle-build-action@v2 @@ -106,7 +106,7 @@ jobs: # arch: x86_64 # api-level: 30 # target: google_apis - # ndk: 23.1.7779620 + # ndk: 26.1.10909125 # ram-size: 4096M # emulator-boot-timeout: 12000 # force-avd-creation: false @@ -126,7 +126,7 @@ jobs: # arch: x86_64 # api-level: 30 # target: google_apis - # ndk: 23.1.7779620 + # ndk: 26.1.10909125 # ram-size: 4096M # emulator-boot-timeout: 12000 # force-avd-creation: false diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 03ab45ae6..34e6c25a1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -40,12 +40,12 @@ To make changes locally, follow these steps: 1. Clone the repository: `git clone https://github.com/spacedriveapp/spacedrive` 2. Navigate to the project directory: `cd spacedrive` 3. Configure your system environment for Spacedrive development - 1. For Linux users, run: `./scripts/setup.sh` - > This [script](https://github.com/spacedriveapp/spacedrive/blob/main/scripts/setup.sh#L133) will check if Rust and pnpm are installed then proceed to install Clang, NASM, LLVM, libvips, Gstreamer's Plugins, FFmpeg, Perl, [Tauri essentials](https://tauri.app/v1/guides/getting-started/prerequisites/#setting-up-linux) and any other required dependencies for Spacedrive to build. - 2. For macOS users, run: `./scripts/setup.sh` - > This [script](https://github.com/spacedriveapp/spacedrive/blob/main/scripts/setup.sh#L108) will check if Rust, pnpm and Xcode are installed and proceed to use Homebrew to install NASM, [Tauri essentials](https://tauri.app/v1/guides/getting-started/prerequisites/#setting-up-macos) and install any other required dependencies for Spacedrive to build. - 3. For Windows users, run in PowerShell: `.\scripts\setup.ps1` - > This [script](https://github.com/spacedriveapp/spacedrive/blob/main/scripts/setup.ps1#L81) will install pnpm, LLVM, FFmpeg, C++ build tools, NASM, Rust + Cargo, Rust tools, Edge Webview 2, Strawberry Perl, [Tauri essentials](https://tauri.app/v1/guides/getting-started/prerequisites/#setting-up-windows) and any other required dependencies for Spacedrive to build. + 1. For Linux users, run: `./scripts/setup.sh` + > This [script](https://github.com/spacedriveapp/spacedrive/blob/main/scripts/setup.sh#L133) will check if Rust and pnpm are installed then proceed to install Clang, NASM, LLVM, libvips, Gstreamer's Plugins, FFmpeg, Perl, [Tauri essentials](https://tauri.app/v1/guides/getting-started/prerequisites/#setting-up-linux) and any other required dependencies for Spacedrive to build. + 2. For macOS users, run: `./scripts/setup.sh` + > This [script](https://github.com/spacedriveapp/spacedrive/blob/main/scripts/setup.sh#L108) will check if Rust, pnpm and Xcode are installed and proceed to use Homebrew to install NASM, [Tauri essentials](https://tauri.app/v1/guides/getting-started/prerequisites/#setting-up-macos) and install any other required dependencies for Spacedrive to build. + 3. For Windows users, run in PowerShell: `.\scripts\setup.ps1` + > This [script](https://github.com/spacedriveapp/spacedrive/blob/main/scripts/setup.ps1#L81) will install pnpm, LLVM, FFmpeg, C++ build tools, NASM, Rust + Cargo, Rust tools, Edge Webview 2, Strawberry Perl, [Tauri essentials](https://tauri.app/v1/guides/getting-started/prerequisites/#setting-up-windows) and any other required dependencies for Spacedrive to build. 4. Install dependencies: `pnpm i` 5. Prepare the build: `pnpm prep` (This will run all necessary codegen and build required dependencies) @@ -89,11 +89,19 @@ To run the mobile app: - Install [Android Studio](https://developer.android.com/studio) for Android and [Xcode](https://apps.apple.com/au/app/xcode/id497799835) for iOS development. - Run `./scripts/setup.sh mobile` - This will set up most of the dependencies required to build the mobile app. -- Make sure you have [NDK 23.1.7779620 and CMake](https://developer.android.com/studio/projects/install-ndk#default-version) installed in Android Studio. +- Make sure you have [NDK 26.1.10909125 and CMake](https://developer.android.com/studio/projects/install-ndk#default-version) installed in Android Studio. - Run the following commands: - - `pnpm android` (runs on Android Emulator) - - `pnpm ios` (runs on iOS Emulator) - - `pnpm start` (runs the metro bundler) + - `pnpm mobile android` (runs on Android Emulator) + - In order to have locations working on Android, you must run the following command once the application has been installed for the first time. Otherwise, locations will not work. + - `adb shell appops set --uid com.spacedrive.app MANAGE_EXTERNAL_STORAGE allow` + - Run the following commands to access the logs from `sd-core`. + - `adb shell` + - Then `run-as com.spacedrive.app` to access the app's directory on device. + - Run `cd files/logs` and then select the logs with the timestamp of when you ran the app. Ex: `sd.log.2023-11-28`. + - You can view the logs using `tail -f [log-name]`. Ex: `tail -f sd.log.2023-11-28`. + - `pnpm mobile ios` (runs on iOS Emulator) + - `xcrun simctl launch --console booted com.spacedrive.app` allows you to view the console output of the iOS app from `tracing`. However, the application must be built in `debug` mode for this. + - `pnpm mobile start` (runs the metro bundler only) ##### AppImage diff --git a/README.md b/README.md index 43d01e37a..8f82b799e 100644 --- a/README.md +++ b/README.md @@ -90,20 +90,28 @@ This project is using what I'm calling the **"PRRTT"** stack (Prisma, Rust, Reac - `desktop`: A [Tauri](https://tauri.app) app. - `mobile`: A [React Native](https://reactnative.dev/) app. - `web`: A [React](https://reactjs.org) webapp. -- `landing`: A [React](https://reactjs.org) app using Vite SSR & Vite pages. +- `landing`: A [React](https://reactjs.org) app using [Next.js](https://nextjs.org). +- `server`: A [Rust](https://www.rust-lang.org) server for the webapp. (planned) +- `cli`: A [Rust](https://www.rust-lang.org) command line interface. (planned) +- `storybook`: A [React](https://reactjs.org) storybook for the UI components. ### Core: - `core`: The [Rust](https://www.rust-lang.org) core, referred to internally as `sdcore`. Contains filesystem, database and networking logic. Can be deployed in a variety of host applications. +- `crates`: Shared Rust libraries used by the core and other Rust applications. + +### Interface: + +- `interface`: The complete user interface in React (used by apps `desktop`, `web`) ### Packages: +- `assets`: Shared assets (images, fonts, etc). - `client`: A [TypeScript](https://www.typescriptlang.org/) client library to handle dataflow via RPC between UI and the Rust core. -- `ui`: A [React](https://reactjs.org) Shared component library. -- `interface`: The complete user interface in React (used by apps `desktop`, `web` and `landing`) - `config`: `eslint` configurations (includes `eslint-config-next`, `eslint-config-prettier` and all `tsconfig.json` configs used throughout the monorepo). +- `ui`: A [React](https://reactjs.org) Shared component library. -- `macos`: A [Swift](https://developer.apple.com/swift/) Native binary for MacOS system extensions. +- `macos`: A [Swift](https://developer.apple.com/swift/) Native binary for MacOS system extensions (planned). - `ios`: A [Swift](https://developer.apple.com/swift/) Native binary (planned). - `windows`: A [C#](https://docs.microsoft.com/en-us/dotnet/csharp/) Native binary (planned). - `android`: A [Kotlin](https://kotlinlang.org/) Native binary (planned). diff --git a/docs/developers/prerequisites/environment-setup.mdx b/docs/developers/prerequisites/environment-setup.mdx index 4cc74f29f..86f80ecef 100644 --- a/docs/developers/prerequisites/environment-setup.mdx +++ b/docs/developers/prerequisites/environment-setup.mdx @@ -60,9 +60,18 @@ To run mobile app 1. Install [Android Studio](https://developer.android.com/studio) for Android and [Xcode](https://apps.apple.com/au/app/xcode/id497799835) for IOS development 2. `./scripts/setup.sh mobile` _The should setup most of the dependencies for the mobile app to build._ -3. You must also ensure you have [NDK 23.1.7779620 and CMake](https://developer.android.com/studio/projects/install-ndk#default-version) in Android Studio -4. `pnpm mobile android` - runs on Android Emulator -5. `pnpm mobile ios` - runs on iOS Emulator +3. You must also ensure you have [NDK 26.1.10909125 and CMake](https://developer.android.com/studio/projects/install-ndk#default-version) in Android Studio +4. `pnpm mobile android` (runs on Android Emulator) + - In order to have locations working on Android, you must run the following command once the application has been installed for the first time. Otherwise, locations will not work. + - `adb shell appops set --uid com.spacedrive.app MANAGE_EXTERNAL_STORAGE allow` + - Run the following commands to access the logs from `sd-core`. + - `adb shell` + - Then `run-as com.spacedrive.app` to access the app's directory on device. + - Run `cd files/logs` and then select the logs with the timestamp of when you ran the app. Ex: `sd.log.2023-11-28`. + - You can view the logs using `cat [log-name]`. Ex: `cat sd.log.2023-11-28`. +5. `pnpm mobile ios` (runs on iOS Emulator) + - `xcrun simctl launch --console booted com.spacedrive.app` allows you to view the console output of the iOS app from `tracing`. However, the application must be built in `debug` mode for this. +6. `pnpm mobile start` (runs the metro bundler only) ### Troubleshooting diff --git a/interface/app/$libraryId/settings/client/general.tsx b/interface/app/$libraryId/settings/client/general.tsx index 83143bba6..d81e336ed 100644 --- a/interface/app/$libraryId/settings/client/general.tsx +++ b/interface/app/$libraryId/settings/client/general.tsx @@ -22,6 +22,8 @@ const NodeSettingLabel = tw.div`mb-1 text-xs font-medium`; // https://doc.rust-lang.org/std/u16/index.html const u16 = z.number().min(0).max(65_535); +// Unsorted list of languages available in the app. +// Make sure to add new languages to this list and to `project.inlang/settings.json` const LANGUAGE_OPTIONS = [ { value: 'en', label: 'English' }, { value: 'de', label: 'Deutsch' }, @@ -35,6 +37,9 @@ const LANGUAGE_OPTIONS = [ { value: 'zh-TW', label: '中文(繁體)' } ]; +// Sort the languages by their label +LANGUAGE_OPTIONS.sort((a, b) => a.label.localeCompare(b.label)); + export const Component = () => { const node = useBridgeQuery(['nodeState']); const platform = usePlatform(); @@ -202,7 +207,7 @@ export const Component = () => {