diff --git a/.yarnrc.yml b/.yarnrc.yml new file mode 100644 index 0000000000..b44f21edbd --- /dev/null +++ b/.yarnrc.yml @@ -0,0 +1,3 @@ +nodeLinker: node-modules +nmHoistingLimits: workspaces + diff --git a/android/app/build.gradle b/android/app/build.gradle deleted file mode 100644 index c57fc55a83..0000000000 --- a/android/app/build.gradle +++ /dev/null @@ -1,146 +0,0 @@ -import groovy.json.JsonSlurper -import org.gradle.api.tasks.testing.logging.TestExceptionFormat - -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: "com.facebook.react" - - -react { - jsRootDir = file("../../src/") - libraryName = "rnnavigation" - codegenJavaPackageName = "com.reactnativenavigation.react" -} - - -def safeExtGet(prop, fallback) { - rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback -} - -def safeExtGetFallbackLowerBound(prop, fallback) { - Math.max(safeExtGet(prop, fallback), fallback) -} - -def DEFAULT_COMPILE_SDK_VERSION = 35 -def DEFAULT_MIN_SDK_VERSION = 24 -def DEFAULT_TARGET_SDK_VERSION = 35 -def DEFAULT_KOTLIN_VERSION = "1.5.31" -def DEFAULT_KOTLIN_STDLIB = 'kotlin-stdlib-jdk8' -def DEFAULT_BUILD_TOOLS_VERSION = "35.0.0" -def kotlinVersion = safeExtGet("RNNKotlinVersion", DEFAULT_KOTLIN_VERSION) -def kotlinStdlib = safeExtGet('RNNKotlinStdlib', DEFAULT_KOTLIN_STDLIB) -def kotlinCoroutinesCore = safeExtGet('RNNKotlinCoroutinesCore', '1.5.2') -def _buildToolsVersion = safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) - -android { - namespace 'com.reactnativenavigation' - compileSdkVersion safeExtGetFallbackLowerBound('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) - buildToolsVersion = _buildToolsVersion - defaultConfig { - minSdkVersion safeExtGetFallbackLowerBound('minSdkVersion', DEFAULT_MIN_SDK_VERSION) - targetSdkVersion safeExtGetFallbackLowerBound('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - buildTypes { - release { - minifyEnabled false - } - debug { - minifyEnabled false - } - } - lintOptions { - abortOnError false - } - - testOptions { - managedDevices { - localDevices { - pixel3aapi34 { - device = "Pixel 3a" - apiLevel = 34 - systemImageSource = "aosp-atd" - } - } - } - unitTests.includeAndroidResources = true - unitTests.all { t -> - maxHeapSize = "4g" - testLogging { - events "PASSED", "SKIPPED", "FAILED" - exceptionFormat TestExceptionFormat.FULL - showExceptions true - showCauses true - showStackTraces true - } - afterSuite { desc, result -> - if (!desc.parent) { // will match the outermost suite - def output = " ${result.resultType} (${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped) " - def repeatLength = output.length() - println '\n\n' + ('-' * repeatLength) + '\n' + output + '\n' + ('-' * repeatLength) + '\n' - - println "see report at file://${t.reports.html.outputLocation}/index.html" - } - } - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 - } - kotlinOptions { - jvmTarget = JavaVersion.VERSION_17 - } -} - -dependencies { - - implementation "androidx.core:core-ktx:1.6.0" - implementation "org.jetbrains.kotlin:$kotlinStdlib:$kotlinVersion" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlinCoroutinesCore" - implementation "androidx.constraintlayout:constraintlayout:2.0.4" - - implementation 'androidx.appcompat:appcompat:1.7.0' - implementation 'androidx.annotation:annotation:1.2.0' - implementation 'com.google.android.material:material:1.2.0-alpha03' - - implementation 'com.github.wix-playground:ahbottomnavigation:4.0.0' - implementation 'com.github.Dimezis:BlurView:version-3.0.0' -// implementation project(':AHBottomNavigation') - implementation 'com.github.wix-playground:reflow-animator:1.0.6' - implementation 'com.github.clans:fab:1.6.4' - - //noinspection GradleDynamicVersion - implementation 'com.facebook.react:react-native:+' - - - if ("Playground".toLowerCase() == rootProject.name.toLowerCase()) { - // tests only for our playground - testImplementation 'junit:junit:4.13.2' - testImplementation "org.robolectric:robolectric:4.14.1" - testImplementation 'org.assertj:assertj-core:3.11.1' - testImplementation 'org.mockito:mockito-core:4.0.0' - testImplementation 'com.squareup.assertj:assertj-android:1.2.0' - testImplementation 'org.mockito:mockito-inline:4.6.1' - testImplementation "org.mockito.kotlin:mockito-kotlin:4.0.0" - testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlinVersion" - - // Core testing libraries - androidTestImplementation "androidx.test.ext:junit:1.2.1" - androidTestImplementation 'org.assertj:assertj-core:3.11.1' - - androidTestImplementation "androidx.test.espresso:espresso-core:3.6.1" - - androidTestImplementation "com.linkedin.dexmaker:dexmaker-mockito-inline:2.28.4" - androidTestImplementation 'org.opentest4j:opentest4j:1.2.0' - androidTestImplementation ("org.mockito.kotlin:mockito-kotlin:5.4.0") { - exclude group: 'org.mockito', module: 'mockito-core' - } - - androidTestImplementation "androidx.test.uiautomator:uiautomator:2.3.0" - - androidTestImplementation("com.facebook.react:hermes-android") - - } -} diff --git a/playground/package.json b/playground/package.json new file mode 100644 index 0000000000..e24b09eaf1 --- /dev/null +++ b/playground/package.json @@ -0,0 +1,100 @@ +{ + "name": "react-native-navigation-playground", + "version": "8.4.2", + "description": "React Native Navigation - truly native navigation for iOS and Android", + "license": "MIT", + "private": true, + "scripts": { + "start": "react-native start", + "pod-install": "cd ios && pod install", + "pretest-e2e-android": "yarn run build", + "test-e2e-android": "node ./scripts/test-e2e --android", + "test-e2e-android-multi": "yarn run test-e2e-android -- --multi", + "pretest-e2e-ios": "yarn run build", + "test-e2e-ios": "node ./scripts/test-e2e --ios", + "test-e2e-ios-multi": "yarn run test-e2e-ios -- --multi", + "test-e2e-android-ci": "yarn run test-e2e-android-multi -- --release --headless --ci", + "test-e2e-ios-ci": "yarn run test-e2e-ios -- --release --multi --ci", + "lint": "eslint --ext .js,.jsx,.ts,.tsx ./" + }, + "dependencies": { + "hoist-non-react-statics": "3.x.x", + "lodash": "4.17.x", + "prop-types": "15.x.x", + "react-lifecycles-compat": "^3.0.4", + "react-native-redash": "^12.6.1", + "reanimated-color-picker": "^3.0.6", + "ssim.js": "^3.5.0", + "tslib": "1.9.3" + }, + "devDependencies": { + "@babel/core": "^7.25.2", + "@babel/plugin-proposal-export-default-from": "7.10.1", + "@babel/plugin-proposal-export-namespace-from": "7.10.1", + "@babel/preset-env": "^7.25.3", + "@babel/runtime": "^7.25.0", + "@babel/types": "7.25.0", + "@react-native-community/cli": "15.1.0", + "@react-native-community/cli-platform-android": "15.1.0", + "@react-native-community/cli-platform-ios": "15.1.0", + "@react-native-community/datetimepicker": "^8.2.0", + "@react-native-community/netinfo": "^11.4.1", + "@react-native/babel-preset": "0.78.3", + "@react-native/eslint-config": "0.78.3", + "@react-native/metro-config": "0.78.3", + "@react-native/typescript-config": "0.78.3", + "@testing-library/jest-native": "^5.4.2", + "@testing-library/react-native": "^13.0.1", + "@types/hoist-non-react-statics": "^3.3.6", + "@types/jasmine": "3.5.10", + "@types/jest": "^29.5.13", + "@types/lodash": "^4.14.149", + "@types/react": "^18.2.6", + "@types/react-test-renderer": "^18.0.0", + "@typescript-eslint/eslint-plugin": "8.21.0", + "@typescript-eslint/parser": "8.21.0", + "clang-format": "^1.4.0", + "detox": "20.34.4", + "detox-testing-library-rnn-adapter": "^2.0.3", + "eslint": "^8.19.0", + "eslint-config-prettier": "6.11.0", + "eslint-formatter-codeframe": "^7.32.1", + "eslint-plugin-jest": "^28.11.0", + "eslint-plugin-prettier": "3.1.4", + "github-release-notes": "https://github.com/yogevbd/github-release-notes/tarball/e601b3dba72dcd6cba323c1286ea6dd0c0110b58", + "husky": "4.2.5", + "identity-obj-proxy": "3.0.0", + "jest": "^29.6.3", + "lint-staged": "10.2.11", + "pixelmatch": "^5.2.1", + "pngjs": "^6.0.0", + "prettier": "2.8.8", + "react": "19.0.0", + "react-native": "0.78.3", + "react-native-fast-image": "^8.6.3", + "react-native-gesture-handler": "^2.22.1", + "react-native-monorepo-config": "^0.3.0", + "react-native-reanimated": "3.18.0", + "react-redux": "9.1.2", + "react-test-renderer": "19.0.0", + "redux": "^5.0.1", + "remx": "3.x.x", + "semver": "5.x.x", + "shell-utils": "1.x.x", + "ts-mockito": "^2.3.1", + "typedoc": "0.x.x", + "typescript": "5.0.4" + }, + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } + }, + "lint-staged": { + "*.{js,ts,tsx}": "eslint --fix", + "*.{h,m,mm}": "node ./scripts/check-clang-format" + }, + "detox": { + "extends": "./e2e/detox.config" + } +} diff --git a/playground/react-native.config.js b/playground/react-native.config.js new file mode 100644 index 0000000000..82eef5ccc8 --- /dev/null +++ b/playground/react-native.config.js @@ -0,0 +1,19 @@ +const path = require('path'); +const pkg = require('../package.json'); + +module.exports = { + project: { + ios: { + automaticPodsInstallation: true, + }, + }, + dependencies: { + [pkg.name]: { + root: path.join(__dirname, '..'), + platforms: { + ios: {}, + android: {}, + }, + }, + }, +};