diff --git a/.circleci/config.yml b/.circleci/config.yml index 755e66e..b150201 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -49,6 +49,16 @@ jobs: mkdir -p test cd test [ -d "CITest" ] || npx react-native@<> init CITest --version <> --skip-install + + # HACK: rn 0.64.x init the test project targeting ios 10, which is incompatible with the ios SDK which requires + # a minimum of ios 11 + sed -i.bak "s/platform :ios, '10.0'/platform :ios, '11.0'/" CITest/ios/Podfile + sed -i.bak "s/IPHONEOS_DEPLOYMENT_TARGET = 10.0;/IPHONEOS_DEPLOYMENT_TARGET = 11.0;/" CITest/ios/CITest.xcodeproj/project.pbxproj + + #HACK: force rn android 0.64.x init to use minSdkVersion 30 to pass the build + sed -i.bak 's/buildToolsVersion = "29.0.3"/buildToolsVersion = "30.0.2"/' CITest/android/build.gradle + sed -i.bak "s/compileSdkVersion = 29/compileSdkVersion = 31/" CITest/android/build.gradle + sed -i.bak "s/targetSdkVersion = 29/targetSdkVersion = 31/" CITest/android/build.gradle - save_cache: name: Save RN project template to cache @@ -141,12 +151,12 @@ workflows: name: rn<>-xc<>-build-apps-using-template matrix: parameters: - rn-version: ["0.64.3", "0.65.2", "0.66.4", "0.67.3", "0.68.0","0.69.4", "0.70.1"] - xcode-version: ["12.5.1", "13.2.1", "13.4.1", "14.0.1"] + rn-version: [ "0.64.4", "0.65.2", "0.66.4", "0.67.3", "0.68.0","0.69.4", "0.70.1" ] + xcode-version: [ "12.5.1", "13.2.1", "13.4.1", "14.0.1" ] exclude: - - rn-version: "0.64.3" + - rn-version: "0.64.4" xcode-version: "13.4.1" - - rn-version: "0.64.3" + - rn-version: "0.64.4" xcode-version: "14.0.1" - rn-version: "0.65.2" xcode-version: "13.4.1" diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..44b5be3 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,6 @@ +{ + "singleQuote": true, + "trailingComma": "all", + "printWidth": 120, + "arrowParens": "always" +} diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..4a602f7 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1 @@ +* @kinyoklion @yusinto @louis-launchdarkly \ No newline at end of file diff --git a/ManualTestApp/.prettierrc b/ManualTestApp/.prettierrc new file mode 100644 index 0000000..44b5be3 --- /dev/null +++ b/ManualTestApp/.prettierrc @@ -0,0 +1,6 @@ +{ + "singleQuote": true, + "trailingComma": "all", + "printWidth": 120, + "arrowParens": "always" +} diff --git a/ManualTestApp/.prettierrc.js b/ManualTestApp/.prettierrc.js deleted file mode 100644 index 84196d9..0000000 --- a/ManualTestApp/.prettierrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - bracketSpacing: false, - jsxBracketSameLine: true, - singleQuote: true, - trailingComma: 'all', - arrowParens: 'avoid', -}; diff --git a/ManualTestApp/App.js b/ManualTestApp/App.js index b873cba..0b794bb 100644 --- a/ManualTestApp/App.js +++ b/ManualTestApp/App.js @@ -1,31 +1,20 @@ import React, { useState, useEffect } from 'react'; -import { SafeAreaView, - ScrollView, - StyleSheet, - Text, - View, - Button, - TextInput, - Alert, - Switch, - } from 'react-native'; +import { SafeAreaView, ScrollView, StyleSheet, Text, View, Button, TextInput, Alert, Switch } from 'react-native'; import { Picker } from '@react-native-picker/picker'; import LDClient from 'launchdarkly-react-native-client-sdk'; import MessageQueue from 'react-native/Libraries/BatchedBridge/MessageQueue.js'; -const Wrapper = ({children}): Node => { +const Wrapper = ({ children }): Node => { const styles = { scroll: { backgroundColor: '#fff', padding: 10 }, area: { backgroundColor: '#fff', flex: 1 }, }; return ( - - {children} - + {children} ); -} +}; const Body = () => { const [client, setClient] = useState(null); @@ -42,6 +31,10 @@ const Body = () => { let config = { mobileKey: 'MOBILE_KEY', debugMode: true, + application: { + id: 'rn-manual-test-app', + version: '0.0.1', + }, }; let user = { key: userKey }; try { @@ -70,32 +63,34 @@ const Body = () => { } Alert.alert('LD Server Response', JSON.stringify(res)); - } + }; const track = () => { client.track(flagKey, false); - } + }; const identify = () => { client.identify({ key: userKey }); - } + }; const listen = () => { if (listeners.hasOwnProperty(listenerKey)) { return; } - let listener = value => Alert.alert('Listener Callback', value); + let listener = (value) => Alert.alert('Listener Callback', value); client.registerFeatureFlagListener(listenerKey, listener); - setListeners({ ...listeners, ...{[listenerKey]: listener}}); - } + setListeners({ ...listeners, ...{ [listenerKey]: listener } }); + }; const removeListener = () => { client.unregisterFeatureFlagListener(listenerKey, listeners[listenerKey]); - let {[listenerKey]: omit, ...newListeners} = listeners; + let { [listenerKey]: omit, ...newListeners } = listeners; setListeners(newListeners); - } + }; - const flush = () => { client.flush(); } + const flush = () => { + client.flush(); + }; const setOffline = (newIsOffline) => { if (newIsOffline) { @@ -104,18 +99,15 @@ const Body = () => { client.setOnline(); } setIsOffline(newIsOffline); - } + }; return ( <> Feature Key: - +