diff --git a/.github/workflows/rnvUnitTest.yml b/.github/workflows/rnvUnitTest.yml index ba545806bc..1c042fed5e 100644 --- a/.github/workflows/rnvUnitTest.yml +++ b/.github/workflows/rnvUnitTest.yml @@ -20,6 +20,7 @@ jobs: run: | yarn yarn bootstrap + yarn lint yarn test env: CI: true diff --git a/packages/app-harness/appConfigs/base/renative.json b/packages/app-harness/appConfigs/base/renative.json index e4f34ea3c6..368945c054 100644 --- a/packages/app-harness/appConfigs/base/renative.json +++ b/packages/app-harness/appConfigs/base/renative.json @@ -31,8 +31,7 @@ "{{resolvePackage(react-native-vector-icons)}}/Fonts" ], "excludedPlugins": [ - "@react-native-firebase/app", - "react-native-photo-editor" + "@react-native-firebase/app" ] }, "platforms": { diff --git a/packages/app-harness/buildHooks/tsconfig.json b/packages/app-harness/buildHooks/tsconfig.json deleted file mode 100644 index 82dac4d899..0000000000 --- a/packages/app-harness/buildHooks/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "@rnv/core/tsconfig.hooks.json", - "compilerOptions": { - "outDir": "dist", - "rootDir": "src" - } -} diff --git a/packages/app-harness/package.json b/packages/app-harness/package.json index cc730db425..f1025443aa 100644 --- a/packages/app-harness/package.json +++ b/packages/app-harness/package.json @@ -53,10 +53,12 @@ "react-native-gesture-handler": "2.14.1", "react-native-orientation-locker": "1.5.0", "react-native-permissions": "4.1.4", - "react-native-photo-editor": "1.0.13", + "react-native-photo-editor": "github:AppGyver/react-native-photo-editor#v0.1.2", "react-native-splash-screen": "3.3.0", "react-native-tvos": "0.73.1-3", - "react-native-web": "0.19.9" + "react-native-web": "0.19.9", + "react-native-fs": "2.20.0", + "rn-fetch-blob": "0.12.0" }, "devDependencies": { "@flexn/assets-renative-outline": "0.3.3", diff --git a/packages/app-harness/renative.json b/packages/app-harness/renative.json index e16ab72834..1604502a3b 100644 --- a/packages/app-harness/renative.json +++ b/packages/app-harness/renative.json @@ -12,7 +12,7 @@ "react-native-splash-screen": { "android": { "templateAndroid": { - "MainActivity_java": { + "MainActivity_kt": { "createMethods": ["SplashScreen.show(this)"], "imports": ["org.devio.rn.splashscreen.SplashScreen"] } @@ -40,13 +40,14 @@ "TestNativeModule": { "android": { "templateAndroid": { - "MainApplication_java": { + "MainApplication_kt": { "packages": ["MyAppPackage"] } }, "forceLinking": true } }, + "rn-fetch-blob": { "tvos": { "disabled": true }, "version": "0.12.0" }, "react-native-carplay": { "ios": { "templateXcode": { @@ -100,6 +101,11 @@ "tag": "manifest", "android:name": "", "children": [ + { + "tag": "uses-permission ", + "android:name": "android.permission.WRITE_EXTERNAL_STORAGE", + "children": [] + }, { "tag": "application", "android:name": ".MainApplication", @@ -126,10 +132,29 @@ "podName": "iOSPhotoEditor", "git": "https://github.com/prscX/photo-editor", "commit": "4924e9ec984d25d03644e58aa148282642171de9", - "buildType": "dynamic" + "buildType": "dynamic", + "templateXcode": { + "Podfile": { + "header": ["plugin 'cocoapods-user-defined-build-types'", "enable_user_defined_build_types!"] + }, + "project_pbxproj": { + "resourceFiles": [ + "Resources/arrow1.png", + "Resources/arrow2.png", + "Resources/arrow3.png", + "Resources/arrow4.png", + "Resources/arrow5.png" + ], + "sourceFiles": ["RNPhotoEditor/RNPhotoEditor.m"], + "headerFiles": ["RNPhotoEditor/RNPhotoEditor.h"] + } + } + }, + "tvos": { + "disabled": true }, "pluginDependencies": null, - "version": "1.0.13" + "version": "github:AppGyver/react-native-photo-editor#v0.1.2" }, "react-native-permissions": { "ios": { @@ -208,6 +233,12 @@ }, "NSContactsUsageDescription": { "desc": "Contacts usage description" + }, + "NSPhotoLibraryAddUsageDescription": { + "desc": "Application needs permission to write photos..." + }, + "NSPhotoLibraryUsageDescription": { + "desc": "iOS 10 needs permission to write photos..." } } } diff --git a/packages/app-harness/src/app/index.tsx b/packages/app-harness/src/app/index.tsx index dc8019169f..85193e0a18 100644 --- a/packages/app-harness/src/app/index.tsx +++ b/packages/app-harness/src/app/index.tsx @@ -1,41 +1,66 @@ import React, { useEffect, useState } from 'react'; import { Button, Image, ScrollView, Text, View } from 'react-native'; +import { Api } from '@rnv/renative'; import { OrientationLocker, PORTRAIT, LANDSCAPE } from '../components/OrientationLocker'; import { NewModuleButton } from '../components/NewModuleButton'; -import { SplashScreen } from '../components/SplashScreen'; +import { useSplashScreen } from '../components/SplashScreen'; import { ICON_LOGO, testProps } from '../config'; import styles from '../styles'; import { addNotificationListeners, removeNotificationListeners } from '../components/Notifications'; import { requestPermissions } from '../components/Permissions'; import { TestCase } from '../components/TestCase'; -const App = () => { +import config from '../../package.json'; +import { LoggerProvider, useLoggerContext } from '../context'; +import { NotificationCallback } from '../components/types'; +import { PhotoEditorButton } from '../components/PhotoEditor'; + +const App = () => ( + + + +); + +const AppContent = () => { const [showVideo, setShowVideo] = useState(false); + const { logDebug, logs } = useLoggerContext(); + const { SplashScreen } = useSplashScreen(); + useEffect(() => { SplashScreen.hide(); - addNotificationListeners(); + addNotificationListeners(handleNotification); return () => { - removeNotificationListeners(); + removeNotificationListeners(handleNotification); }; }, []); + const handleNotification: NotificationCallback = (message) => logDebug(message); + + const handleRequestPermissions = async () => { + try { + const permission = await requestPermissions(); + logDebug(`Permissions: ${permission}`); + } catch (error) { + logDebug(`${error}`); + } + }; + return ( - + - + ReNative Harness - v1.0.0-rc.12, platform: macos, formFactor: desktop + + {`v${config.version}, platform: ${Api.platform}, factor: ${Api.formFactor}, engine: ${Api.engine}`} + @@ -58,8 +83,8 @@ const App = () => { console.log('onChange', orientation)} - onDeviceChange={(orientation) => console.log('onDeviceChange', orientation)} + onChange={(orientation) => logDebug(`onChange ${orientation}`)} + onDeviceChange={(orientation) => logDebug(`onDeviceChange ${orientation}`)} />