diff --git a/apps/desktop/src/commands.ts b/apps/desktop/src/commands.ts index e413d10f0..b6d17db50 100644 --- a/apps/desktop/src/commands.ts +++ b/apps/desktop/src/commands.ts @@ -42,7 +42,7 @@ export function lockAppTheme(themeType: AppThemeType) { return invoke()("lock_app_theme", { themeType }) } -export type RevealItem = { Location: { id: number } } | { FilePath: { id: number } } export type AppThemeType = "Auto" | "Light" | "Dark" export type OpenFilePathResult = { t: "NoLibrary" } | { t: "NoFile"; c: number } | { t: "OpenError"; c: [number, string] } | { t: "AllGood"; c: number } | { t: "Internal"; c: string } +export type RevealItem = { Location: { id: number } } | { FilePath: { id: number } } export type OpenWithApplication = { url: string; name: string } diff --git a/apps/landing/package.json b/apps/landing/package.json index d8b635f7f..35927a924 100644 --- a/apps/landing/package.json +++ b/apps/landing/package.json @@ -31,7 +31,7 @@ "react": "18.2.0", "react-burger-menu": "^3.0.9", "react-dom": "^18.2.0", - "react-hook-form": "^7.43.9", + "react-hook-form": "~7.45.2", "react-tsparticles": "^2.10.1", "reading-time": "^1.5.0", "rehype-autolink-headings": "^6.1.1", @@ -45,7 +45,7 @@ "three": "^0.154", "tsparticles": "^2.9.3", "uuid": "^9.0.0", - "zod": "^3.21.4" + "zod": "~3.22.2" }, "devDependencies": { "@sd/config": "workspace:*", diff --git a/apps/mobile/.gitignore b/apps/mobile/.gitignore index 6ea85667f..5a75721f6 100644 --- a/apps/mobile/.gitignore +++ b/apps/mobile/.gitignore @@ -1,55 +1,34 @@ -# OSX -# -.DS_Store -# Xcode -# -build/ -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata -*.xccheckout -*.moved-aside -DerivedData -*.hmap -*.ipa -*.xcuserstate -project.xcworkspace - -# Android/IntelliJ -# -build/ -.idea -.gradle -local.properties -*.iml -*.hprof -.cxx/ -*.keystore -!debug.keystore - -# node.js -# +# dependencies node_modules/ -npm-debug.log -yarn-error.log - -# Bundle artifacts -*.jsbundle - -# CocoaPods -/ios/Pods/ - -# Temporary files created by Metro to check the health of the file watcher -.metro-health-check* # Expo .expo/ +dist/ web-build/ -dist/ \ No newline at end of file + +# Native +*.orig.* +*.jks +*.p8 +*.p12 +*.key +*.mobileprovision + +# Metro +.metro-health-check* + +# debug +npm-debug.* +yarn-debug.* +yarn-error.* + +# macOS +.DS_Store +*.pem + +# local env files +.env*.local + +# typescript +*.tsbuildinfo diff --git a/apps/mobile/android/.gitignore b/apps/mobile/android/.gitignore index ab9e6d140..877b87e9a 100644 --- a/apps/mobile/android/.gitignore +++ b/apps/mobile/android/.gitignore @@ -12,4 +12,4 @@ local.properties *.hprof # Bundle artifacts -*.jsbundle \ No newline at end of file +*.jsbundle diff --git a/apps/mobile/android/app/build.gradle b/apps/mobile/android/app/build.gradle index 05b7395ad..03524c0df 100644 --- a/apps/mobile/android/app/build.gradle +++ b/apps/mobile/android/app/build.gradle @@ -1,8 +1,6 @@ apply plugin: "com.android.application" apply plugin: "com.facebook.react" -import com.android.build.OutputFile - // SPACEDRIVE CODE apply plugin: 'org.mozilla.rust-android-gradle.rust-android' @@ -33,16 +31,7 @@ tasks.whenTaskAdded { task -> } // END SPACEDRIVE CODE - def projectRoot = rootDir.getAbsoluteFile().getParentFile().getAbsolutePath() -def expoDebuggableVariants = ['debug'] -// Override `debuggableVariants` for expo-updates debugging -if (System.getenv('EX_UPDATES_NATIVE_DEBUG') == "1") { - react { - expoDebuggableVariants = [] - } -} - /** * This is the configuration block to customize your React Native Android app. @@ -52,17 +41,20 @@ react { entryFile = file(["node", "-e", "require('expo/scripts/resolveAppEntry')", projectRoot, "android", "absolute"].execute(null, rootDir).text.trim()) reactNativeDir = new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsoluteFile() hermesCommand = new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + "/sdks/hermesc/%OS-BIN%/hermesc" - debuggableVariants = expoDebuggableVariants + codegenDir = new File(["node", "--print", "require.resolve('@react-native/codegen/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsoluteFile() + + // Use Expo CLI to bundle the app, this ensures the Metro config + // works correctly with Expo projects. + cliFile = new File(["node", "--print", "require.resolve('@expo/cli')"].execute(null, rootDir).text.trim()) + bundleCommand = "export:embed" /* Folders */ // The root of your project, i.e. where "package.json" lives. Default is '..' // root = file("../") // The folder where the react-native NPM package is. Default is ../node_modules/react-native // reactNativeDir = file("../node_modules/react-native") - // The folder where the react-native Codegen package is. Default is ../node_modules/react-native-codegen - // codegenDir = file("../node_modules/react-native-codegen") - // The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js - // cliFile = file("../node_modules/react-native/cli.js") + // The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen + // codegenDir = file("../node_modules/@react-native/codegen") /* Variants */ // The list of variants to that are debuggable. For those we're going to @@ -73,9 +65,7 @@ react { /* Bundling */ // A list containing the node command and its flags. Default is just 'node'. // nodeExecutableAndArgs = ["node"] - // - // The command to run when bundling. By default is 'bundle' - // bundleCommand = "ram-bundle" + // // The path to the CLI configuration file. Default is empty. // bundleConfig = file(../rn-cli.config.js) @@ -98,19 +88,6 @@ react { // hermesFlags = ["-O", "-output-source-map"] } -// Override `hermesEnabled` by `expo.jsEngine` -ext { - hermesEnabled = (findProperty('expo.jsEngine') ?: "hermes") == "hermes" -} - -/** - * Set this to true to create four separate APKs instead of one, - * one for each native architecture. This is useful if you don't - * use App Bundles (https://developer.android.com/guide/app-bundle/) - * and want to have separate APKs to upload to the Play Store. - */ -def enableSeparateBuildPerCPUArchitecture = false - /** * Set this to true to Run Proguard on Release builds to minify the Java bytecode. */ @@ -129,37 +106,20 @@ def enableProguardInReleaseBuilds = (findProperty('android.enableProguardInRelea */ def jscFlavor = 'org.webkit:android-jsc:+' -/** - * Private function to get the list of Native Architectures you want to build. - * This reads the value from reactNativeArchitectures in your gradle.properties - * file and works together with the --active-arch-only flag of react-native run-android. - */ -def reactNativeArchitectures() { - def value = project.getProperties().get("reactNativeArchitectures") - return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] -} - android { ndkVersion rootProject.ext.ndkVersion compileSdkVersion rootProject.ext.compileSdkVersion - namespace 'com.spacedrive.app' + namespace "com.spacedrive" defaultConfig { applicationId 'com.spacedrive.app' minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 versionName "0.0.1" - } - splits { - abi { - reset() - enable enableSeparateBuildPerCPUArchitecture - universalApk false // If true, also generate a universal APK - include (*reactNativeArchitectures()) - } + buildConfigField("boolean", "REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS", (findProperty("reactNative.unstable_useRuntimeSchedulerAlways") ?: true).toString()) } signingConfigs { debug { @@ -177,26 +137,11 @@ android { // Caution! In production, you need to generate your own keystore file. // see https://reactnative.dev/docs/signed-apk-android. signingConfig signingConfigs.debug + shrinkResources (findProperty('android.enableShrinkResourcesInReleaseBuilds')?.toBoolean() ?: false) minifyEnabled enableProguardInReleaseBuilds proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" } } - - // applicationVariants are e.g. debug, release - applicationVariants.all { variant -> - variant.outputs.each { output -> - // For each separate APK per architecture, set a unique version code as described here: - // https://developer.android.com/studio/build/configure-apk-splits.html - // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc. - def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] - def abi = output.getFilter(OutputFile.ABI) - if (abi != null) { // null for the universal-debug, universal-release variants - output.versionCodeOverride = - defaultConfig.versionCode * 1000 + versionCodes.get(abi) - } - - } - } } // Apply static values from `gradle.properties` to the `android.packagingOptions` @@ -248,8 +193,6 @@ dependencies { } } - implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0") - debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { exclude group:'com.squareup.okhttp3', module:'okhttp' diff --git a/apps/mobile/android/app/proguard-rules.pro b/apps/mobile/android/app/proguard-rules.pro index 78d6c0389..551eb41da 100644 --- a/apps/mobile/android/app/proguard-rules.pro +++ b/apps/mobile/android/app/proguard-rules.pro @@ -11,4 +11,4 @@ -keep class com.swmansion.reanimated.** { *; } -keep class com.facebook.react.turbomodule.** { *; } -# Add any project specific keep options here: \ No newline at end of file +# Add any project specific keep options here: diff --git a/apps/mobile/android/app/src/debug/java/com/spacedrive/app/ReactNativeFlipper.java b/apps/mobile/android/app/src/debug/java/com/spacedrive/app/ReactNativeFlipper.java index 37ca9c904..de7a6b4ad 100644 --- a/apps/mobile/android/app/src/debug/java/com/spacedrive/app/ReactNativeFlipper.java +++ b/apps/mobile/android/app/src/debug/java/com/spacedrive/app/ReactNativeFlipper.java @@ -72,4 +72,4 @@ public class ReactNativeFlipper { } } } -} \ No newline at end of file +} diff --git a/apps/mobile/android/app/src/main/AndroidManifest.xml b/apps/mobile/android/app/src/main/AndroidManifest.xml index 23d2b8676..b1193eef6 100644 --- a/apps/mobile/android/app/src/main/AndroidManifest.xml +++ b/apps/mobile/android/app/src/main/AndroidManifest.xml @@ -14,11 +14,10 @@ - + diff --git a/apps/mobile/android/app/src/main/java/com/spacedrive/app/MainActivity.java b/apps/mobile/android/app/src/main/java/com/spacedrive/app/MainActivity.java index 1309a4b94..26c73b363 100644 --- a/apps/mobile/android/app/src/main/java/com/spacedrive/app/MainActivity.java +++ b/apps/mobile/android/app/src/main/java/com/spacedrive/app/MainActivity.java @@ -40,10 +40,7 @@ public class MainActivity extends ReactActivity { this, getMainComponentName(), // If you opted-in for the New Architecture, we enable the Fabric Renderer. - DefaultNewArchitectureEntryPoint.getFabricEnabled(), // fabricEnabled - // If you opted-in for the New Architecture, we enable Concurrent React (i.e. React 18). - DefaultNewArchitectureEntryPoint.getConcurrentReactEnabled() // concurrentRootEnabled - )); + DefaultNewArchitectureEntryPoint.getFabricEnabled())); } /** @@ -65,4 +62,4 @@ public class MainActivity extends ReactActivity { // because it's doing more than {@link Activity#moveTaskToBack} in fact. super.invokeDefaultOnBackPressed(); } -} \ No newline at end of file +} diff --git a/apps/mobile/android/app/src/main/java/com/spacedrive/app/MainApplication.java b/apps/mobile/android/app/src/main/java/com/spacedrive/app/MainApplication.java index ad2962a9e..a8b2cd804 100644 --- a/apps/mobile/android/app/src/main/java/com/spacedrive/app/MainApplication.java +++ b/apps/mobile/android/app/src/main/java/com/spacedrive/app/MainApplication.java @@ -8,6 +8,7 @@ import com.facebook.react.PackageList; import com.facebook.react.ReactApplication; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; +import com.facebook.react.config.ReactFeatureFlags; import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint; import com.facebook.react.defaults.DefaultReactNativeHost; import com.facebook.soloader.SoLoader; @@ -37,7 +38,7 @@ public class MainApplication extends Application implements ReactApplication { @Override protected String getJSMainModuleName() { - return "index"; + return ".expo/.virtual-metro-entry"; } @Override @@ -60,6 +61,9 @@ public class MainApplication extends Application implements ReactApplication { public void onCreate() { super.onCreate(); SoLoader.init(this, /* native exopackage */ false); + if (!BuildConfig.REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS) { + ReactFeatureFlags.unstable_useRuntimeSchedulerAlways = false; + } if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { // If you opted-in for the New Architecture, we load the native entry point for this app. DefaultNewArchitectureEntryPoint.load(); @@ -73,4 +77,4 @@ public class MainApplication extends Application implements ReactApplication { super.onConfigurationChanged(newConfig); ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig); } -} \ No newline at end of file +} diff --git a/apps/mobile/android/app/src/main/res/drawable-hdpi/splashscreen_image.png b/apps/mobile/android/app/src/main/res/drawable-hdpi/splashscreen_image.png index 0e0762212..9fe550638 100644 Binary files a/apps/mobile/android/app/src/main/res/drawable-hdpi/splashscreen_image.png and b/apps/mobile/android/app/src/main/res/drawable-hdpi/splashscreen_image.png differ diff --git a/apps/mobile/android/app/src/main/res/drawable-mdpi/splashscreen_image.png b/apps/mobile/android/app/src/main/res/drawable-mdpi/splashscreen_image.png index 0e0762212..9fe550638 100644 Binary files a/apps/mobile/android/app/src/main/res/drawable-mdpi/splashscreen_image.png and b/apps/mobile/android/app/src/main/res/drawable-mdpi/splashscreen_image.png differ diff --git a/apps/mobile/android/app/src/main/res/drawable-xhdpi/splashscreen_image.png b/apps/mobile/android/app/src/main/res/drawable-xhdpi/splashscreen_image.png index 0e0762212..9fe550638 100644 Binary files a/apps/mobile/android/app/src/main/res/drawable-xhdpi/splashscreen_image.png and b/apps/mobile/android/app/src/main/res/drawable-xhdpi/splashscreen_image.png differ diff --git a/apps/mobile/android/app/src/main/res/drawable-xxhdpi/splashscreen_image.png b/apps/mobile/android/app/src/main/res/drawable-xxhdpi/splashscreen_image.png index 0e0762212..9fe550638 100644 Binary files a/apps/mobile/android/app/src/main/res/drawable-xxhdpi/splashscreen_image.png and b/apps/mobile/android/app/src/main/res/drawable-xxhdpi/splashscreen_image.png differ diff --git a/apps/mobile/android/app/src/main/res/drawable-xxxhdpi/splashscreen_image.png b/apps/mobile/android/app/src/main/res/drawable-xxxhdpi/splashscreen_image.png index 0e0762212..9fe550638 100644 Binary files a/apps/mobile/android/app/src/main/res/drawable-xxxhdpi/splashscreen_image.png and b/apps/mobile/android/app/src/main/res/drawable-xxxhdpi/splashscreen_image.png differ diff --git a/apps/mobile/android/app/src/main/res/drawable/rn_edit_text_material.xml b/apps/mobile/android/app/src/main/res/drawable/rn_edit_text_material.xml index f35d99620..73b37e4d9 100644 --- a/apps/mobile/android/app/src/main/res/drawable/rn_edit_text_material.xml +++ b/apps/mobile/android/app/src/main/res/drawable/rn_edit_text_material.xml @@ -20,7 +20,7 @@ android:insetBottom="@dimen/abc_edit_text_inset_bottom_material"> -