Skip to content

Commit 11228e5

Browse files
author
Shawn Dempsey
committed
Merge remote-tracking branch 'origin/master' into @shwanton/turbomodule-ios-working
# Conflicts: # example/android/build.gradle # example/android/gradle/wrapper/gradle-wrapper.properties # package.json # yarn.lock
2 parents 8a47c53 + 8cfb51a commit 11228e5

File tree

16 files changed

+2273
-3437
lines changed

16 files changed

+2273
-3437
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ jobs:
88
review:
99
name: Review
1010
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
test-name: [lint, ts]
1114
steps:
1215
- name: Checkout
1316
uses: actions/checkout@v3
@@ -17,14 +20,9 @@ jobs:
1720
node-version: 16
1821
cache: yarn
1922
- name: Install JS dependencies
20-
run: |
21-
yarn
22-
- name: Lint
23-
run: |
24-
yarn test:lint
25-
- name: TypeScript
26-
run: |
27-
yarn test:ts
23+
run: yarn
24+
- name: Run test ${{ matrix.test-name }}
25+
run: yarn test:${{ matrix.test-name }}
2826
android:
2927
name: Android
3028
runs-on: ubuntu-22.04
@@ -83,6 +81,7 @@ jobs:
8381
run: |
8482
yarn build:e2e:ios
8583
- name: Test
84+
if: false
8685
run: |
8786
yarn test:e2e:ios
8887
macos:
@@ -112,12 +111,16 @@ jobs:
112111
run: |
113112
pod install
114113
working-directory: example/macos
115-
- name: Build and test
114+
- name: Build
115+
run: |
116+
yarn build:e2e:macos
117+
- name: Test
118+
if: false
116119
run: |
117120
yarn test:e2e:macos
118121
windows:
119122
name: Windows
120-
runs-on: windows-2019
123+
runs-on: windows-2022
121124
steps:
122125
- name: Set up MSBuild
123126
uses: microsoft/setup-msbuild@v1.3
@@ -142,6 +145,7 @@ jobs:
142145
release:
143146
name: Release
144147
needs: [review, android, ios, macos, windows]
148+
if: github.event_name == 'push'
145149
runs-on: ubuntu-22.04
146150
steps:
147151
- name: Checkout

.yarnrc.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,17 @@ logFilters:
88
level: discard
99
nodeLinker: node-modules
1010
npmRegistryServer: "https://registry.npmjs.org"
11+
packageExtensions:
12+
"@expo/cli@*":
13+
peerDependencies:
14+
"expo-modules-autolinking": "*"
15+
"babel-preset-expo@*":
16+
peerDependencies:
17+
"@babel/core": "^7.0.0-0"
18+
"expo@*":
19+
peerDependencies:
20+
"@babel/core": "^7.0.0-0"
21+
"expo-asset@*":
22+
peerDependencies:
23+
"expo": "*"
1124
yarnPath: .yarn/releases/yarn-3.4.1.cjs

example/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default function App(): JSX.Element {
3131
const [iteration, setIteration] = useState(0);
3232
const [currentTest, setCurrentTest] = useState(SCREENS.Functional);
3333

34-
const dismissKeyboard = useCallback(Keyboard.dismiss, []);
34+
const dismissKeyboard = useCallback(() => Keyboard.dismiss(), []);
3535
const simulateRestart = useCallback(
3636
() => setIteration(iteration + 1),
3737
[iteration]

example/android/build.gradle

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,6 @@ allprojects {
6464
}
6565
}
6666

67-
repositories {
68-
maven {
69-
url("$rootDir/../../node_modules/detox/Detox-android")
70-
}
71-
mavenCentral()
72-
google()
73-
}
7467
afterEvaluate { project ->
7568
def androidExtension = project.extensions.findByName('android')
7669

@@ -100,13 +93,8 @@ allprojects {
10093
}
10194
androidExtension.testBuildType = 'release'
10295
androidExtension.sourceSets.androidTest.java.srcDirs += "$rootDir/app/src/androidTest/java"
103-
if(System.getenv("CIRCLECI") == "true") {
104-
// explicitly apply NDK version available in CI image
105-
androidExtension.ndkVersion = "20.1.5948944"
106-
}
107-
project.dependencies {
108-
androidTestImplementation('com.wix:detox:+')
10996

97+
project.dependencies {
11098
def hermesDir = file('../../node_modules/hermes-engine/android').absolutePath
11199
nextImplementation files("$hermesDir/hermes-release.aar")
112100
}
935 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
2-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

example/android/gradlew

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,12 @@ set -- \
205205
org.gradle.wrapper.GradleWrapperMain \
206206
"$@"
207207

208+
# Stop when "xargs" is not available.
209+
if ! command -v xargs >/dev/null 2>&1
210+
then
211+
die "xargs is not available"
212+
fi
213+
208214
# Use "xargs" to parse quoted args.
209215
#
210216
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.

example/android/gradlew.bat

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
@rem limitations under the License.
1515
@rem
1616

17-
@if "%DEBUG%" == "" @echo off
17+
@if "%DEBUG%"=="" @echo off
1818
@rem ##########################################################################
1919
@rem
2020
@rem Gradle startup script for Windows
@@ -25,7 +25,7 @@
2525
if "%OS%"=="Windows_NT" setlocal
2626

2727
set DIRNAME=%~dp0
28-
if "%DIRNAME%" == "" set DIRNAME=.
28+
if "%DIRNAME%"=="" set DIRNAME=.
2929
set APP_BASE_NAME=%~n0
3030
set APP_HOME=%DIRNAME%
3131

@@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
4040

4141
set JAVA_EXE=java.exe
4242
%JAVA_EXE% -version >NUL 2>&1
43-
if "%ERRORLEVEL%" == "0" goto execute
43+
if %ERRORLEVEL% equ 0 goto execute
4444

4545
echo.
4646
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
7575

7676
:end
7777
@rem End local scope for the variables with windows NT shell
78-
if "%ERRORLEVEL%"=="0" goto mainEnd
78+
if %ERRORLEVEL% equ 0 goto mainEnd
7979

8080
:fail
8181
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
8282
rem the _cmd.exe /c_ return code!
83-
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84-
exit /b 1
83+
set EXIT_CODE=%ERRORLEVEL%
84+
if %EXIT_CODE% equ 0 set EXIT_CODE=1
85+
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
86+
exit /b %EXIT_CODE%
8587

8688
:mainEnd
8789
if "%OS%"=="Windows_NT" endlocal

example/e2e/config.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

example/e2e/environment.js

Lines changed: 0 additions & 23 deletions
This file was deleted.

example/e2e/jest.setup.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

example/examples/Functional.tsx

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,15 @@ async function execute(steps: TestStep[]): Promise<void> {
8080
function Functional(): JSX.Element {
8181
const [results, setResults] = useState<[string, TestResult?][]>([]);
8282
useEffect(() => {
83-
const results: [string, TestResult?][] = [];
83+
const testResults: [string, TestResult?][] = [];
8484
Promise.resolve()
8585
.then(async () => {
8686
for (const [name, test] of Object.entries(tests)) {
8787
try {
8888
await execute(test);
89-
results.push([name, undefined]);
89+
testResults.push([name, undefined]);
9090
} catch (e: any) {
91-
results.push([name, e]);
91+
testResults.push([name, e]);
9292
}
9393
}
9494
})
@@ -100,15 +100,15 @@ function Functional(): JSX.Element {
100100
const name = currentName + ' with delegate';
101101

102102
if (!AsyncStorageTestSupport?.test_setDelegate) {
103-
results.push([name, SKIP_TEST]);
103+
testResults.push([name, SKIP_TEST]);
104104
continue;
105105
}
106106

107107
const isNativeDelegateSet = await new Promise((resolve) => {
108108
AsyncStorageTestSupport.test_setDelegate(resolve);
109109
});
110110
if (!isNativeDelegateSet) {
111-
results.push([
111+
testResults.push([
112112
name,
113113
{
114114
step: 0,
@@ -121,27 +121,31 @@ function Functional(): JSX.Element {
121121

122122
try {
123123
await execute(test);
124-
results.push([name, undefined]);
124+
testResults.push([name, undefined]);
125125
} catch (e: any) {
126-
results.push([name, e]);
126+
testResults.push([name, e]);
127127
await new Promise((resolve) => {
128128
AsyncStorageTestSupport.test_unsetDelegate(resolve);
129129
});
130130
}
131131
}
132132
})
133-
.then(() => setResults(results));
133+
.then(() => setResults(testResults));
134134
}, []);
135135
return (
136-
<ScrollView contentContainerStyle={{ flexGrow: 1 }}>
136+
<ScrollView contentContainerStyle={styles.container}>
137137
<View>
138138
{results.map(([name, result]) => {
139139
const testID = 'test:' + name;
140140
if (!result) {
141141
return (
142142
<View key={name} style={styles.passed}>
143143
<Text style={styles.testLabel}>{name}</Text>
144-
<Text accessibilityLabel="Pass" testID={testID}>
144+
<Text
145+
accessibilityLabel="Pass"
146+
testID={testID}
147+
style={styles.testResult}
148+
>
145149
Pass
146150
</Text>
147151
</View>
@@ -152,7 +156,11 @@ function Functional(): JSX.Element {
152156
return (
153157
<View key={name} style={styles.skipped}>
154158
<Text style={styles.testLabel}>{name}</Text>
155-
<Text accessibilityLabel="Skip" testID={testID}>
159+
<Text
160+
accessibilityLabel="Skip"
161+
testID={testID}
162+
style={styles.testResult}
163+
>
156164
Skip
157165
</Text>
158166
</View>
@@ -163,9 +171,15 @@ function Functional(): JSX.Element {
163171
<View key={name} style={styles.failed}>
164172
<Text style={styles.testLabel}>{name}</Text>
165173
<View accessibilityLabel="Fail" testID={testID}>
166-
<Text>{`Step: ${result.step + 1}`}</Text>
167-
<Text>{`Expected: ${stringify(result.expected)}`}</Text>
168-
<Text>{`Actual: ${result.actual}`}</Text>
174+
<Text style={styles.testResult}>{`Step: ${
175+
result.step + 1
176+
}`}</Text>
177+
<Text style={styles.testResult}>{`Expected: ${stringify(
178+
result.expected
179+
)}`}</Text>
180+
<Text
181+
style={styles.testResult}
182+
>{`Actual: ${result.actual}`}</Text>
169183
</View>
170184
</View>
171185
);
@@ -176,6 +190,9 @@ function Functional(): JSX.Element {
176190
}
177191

178192
const styles = StyleSheet.create({
193+
container: {
194+
flexGrow: 1,
195+
},
179196
failed: {
180197
backgroundColor: '#e53935',
181198
flex: 1,
@@ -193,8 +210,12 @@ const styles = StyleSheet.create({
193210
padding: 4,
194211
},
195212
testLabel: {
213+
color: '#000000',
196214
flex: 1,
197215
},
216+
testResult: {
217+
color: '#000000',
218+
},
198219
});
199220

200221
export default {

0 commit comments

Comments
 (0)