Skip to content

Commit ee6c4cb

Browse files
authored
fix: ci (#902)
1 parent 3de7342 commit ee6c4cb

File tree

13 files changed

+11642
-8476
lines changed

13 files changed

+11642
-8476
lines changed

.flowconfig

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[version]
2+
^0.237.2
3+
14
[ignore]
25
; We fork some components by platform
36
.*/*[.]android.js
@@ -20,21 +23,24 @@ node_modules/warning/.*
2023
; Ignore test files in resolve
2124
.*/node_modules/resolve/test/.*
2225

26+
; Ignore fbjs flow weak mode
27+
.*/node_modules/fbjs/lib/.*
28+
2329
[untyped]
2430
.*/node_modules/@react-native-community/cli/.*/.*
31+
.*/node_modules/fbjs/.*
2532

2633
[include]
2734

2835
[libs]
2936
node_modules/react-native/interface.js
3037
node_modules/react-native/flow/
38+
flow-typed/
3139

3240
[options]
3341
server.max_workers=4
3442
emoji=true
3543

36-
esproposal.optional_chaining=enable
37-
esproposal.nullish_coalescing=enable
3844

3945
module.file_ext=.js
4046
module.file_ext=.json
@@ -49,9 +55,12 @@ suppress_type=$FlowIssue
4955
suppress_type=$FlowFixMe
5056
suppress_type=$FlowFixMeProps
5157
suppress_type=$FlowFixMeState
58+
suppress_type=$FlowFixMeEmpty
59+
60+
; Errors from built-in Flow library definitions
61+
exact_by_default=false
62+
5263

53-
well_formed_exports=true
54-
experimental.abstract_locations=true
5564

5665
sharedmemory.heap_size=4000000000
5766

@@ -64,8 +73,6 @@ nonstrict-import=warn
6473
deprecated-type=warn
6574
unsafe-getters-setters=warn
6675
unnecessary-invariant=warn
67-
signature-verification-failure=warn
68-
deprecated-utility=error
6976

7077
[strict]
7178
deprecated-type

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ jobs:
116116
- name: Install Dependencies
117117
run: pnpm install
118118
- name: Build android
119-
run: cd example && pnpm build:android
119+
run: cd example && NODE_OPTIONS="--openssl-legacy-provider" pnpm build:android
120120
- name: Build Android Example App and Library
121121
run: cd example/android && ./gradlew clean assembleDebug
122122
ios:
@@ -145,6 +145,6 @@ jobs:
145145
- name: Install Dependencies
146146
run: pnpm install
147147
- name: Build ios
148-
run: cd example && pnpm build:ios
148+
run: cd example && NODE_OPTIONS="--openssl-legacy-provider" pnpm build:ios
149149
- name: Pod install
150150
run: cd example && pod install --project-directory=ios

example/metro.config.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,7 @@
77

88
const path = require('path');
99

10-
const exclusionList = (() => {
11-
try {
12-
return require('metro-config/src/defaults/exclusionList');
13-
} catch (_) {
14-
// `blacklist` was renamed to `exclusionList` in 0.60
15-
return require('metro-config/src/defaults/blacklist');
16-
}
17-
})();
18-
19-
const {makeMetroConfig} = require('@rnx-kit/metro-config');
10+
const {makeMetroConfig, exclusionList} = require('@rnx-kit/metro-config');
2011
const MetroSymlinksResolver = require('@rnx-kit/metro-resolver-symlinks');
2112

2213
const symlinkResolver = MetroSymlinksResolver();

example/package.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
"dependencies": {
1919
"hermes-engine": "0.10.0",
20-
"react": "16.13.1",
20+
"react": "17.0.2",
2121
"react-native": "0.63.4",
2222
"react-native-macos": "^0.63.0",
2323
"react-native-windows": "^0.63.0"
@@ -28,14 +28,11 @@
2828
"metro-react-native-babel-preset": "0.77.0",
2929
"mkdirp": "^3.0.1",
3030
"react-native-test-app": "1.4.6",
31-
"react-test-renderer": "16.13.1",
31+
"react-test-renderer": "17.0.2",
3232
"@rnx-kit/metro-config": "1.3.7",
3333
"@rnx-kit/metro-resolver-symlinks":"0.1.30"
3434
},
3535
"jest": {
3636
"preset": "react-native"
37-
},
38-
"volta": {
39-
"node": "16.20.1"
4037
}
4138
}

flow-typed/globals.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// @flow
2+
// Global type definitions to suppress Flow library errors
3+
4+
// Declare global types that are causing issues in Flow's built-in libraries
5+
declare class Headers {}
6+
declare class Request {}
7+
declare class Response {}

js/SegmentedControl.ios.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ type Props = $ReadOnly<{|
4343
*/
4444

4545
class SegmentedControlIOS extends React.Component<Props> {
46-
static defaultProps = {
46+
static defaultProps: {|
47+
values: $ReadOnlyArray<string | number>,
48+
enabled: boolean,
49+
|} = {
4750
values: [],
4851
enabled: true,
4952
};
@@ -54,7 +57,7 @@ class SegmentedControlIOS extends React.Component<Props> {
5457
this.props.onValueChange(event.nativeEvent.value);
5558
};
5659

57-
render() {
60+
render(): React.Node {
5861
const {forwardedRef, fontStyle, activeFontStyle, values, ...props} =
5962
this.props;
6063
return (

js/SegmentedControl.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const SegmentedControl = ({
4444
const colorScheme = appearance || colorSchemeHook;
4545
const [segmentWidth, setSegmentWidth] = React.useState(0);
4646
const animation = React.useRef(new Animated.Value(0)).current;
47-
const ref = React.useRef();
47+
const ref = React.useRef<?React.ElementRef<typeof View>>(null);
4848

4949
const handleChange = (index: number) => {
5050
// mocks iOS's nativeEvent
@@ -75,15 +75,17 @@ const SegmentedControl = ({
7575
Animated.timing(animation, {
7676
toValue: isRTL * (selectedIndex || 0),
7777
duration: 300,
78-
easing: Easing.out(Easing.quad),
78+
easing: Easing.out(Easing.quad.bind(Easing)),
7979
useNativeDriver: true,
8080
}).start();
8181
}
8282
}, [animation, segmentWidth, selectedIndex]);
8383

8484
React.useEffect(() => {
8585
if (ref.current) {
86-
ref.current.measure((_x, _y, width) => updateSegmentWidth(width));
86+
ref.current.measure((_x: number, _y: number, width: number) =>
87+
updateSegmentWidth(width),
88+
);
8789
}
8890
}, [values, updateSegmentWidth]);
8991

js/SegmentedControlTab.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ type Props = $ReadOnly<{|
3232
testID?: string,
3333
|}>;
3434

35-
function isBase64(str) {
35+
function isBase64(str: mixed): boolean {
3636
const regex =
3737
/^data:image\/(?:gif|png|jpeg|bmp|webp)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/;
38-
return str && regex.test(str);
38+
return typeof str === 'string' && regex.test(str);
3939
}
4040

4141
export const SegmentedControlTab = ({

js/SegmentsSeparators.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const SegmentsSeparators = ({
1818
selectedIndex,
1919
}: Props): React.Node => {
2020
const colorScheme = useColorScheme();
21-
const hide = (val) => {
21+
const hide = (val: number) => {
2222
return selectedIndex === val || selectedIndex === val + 1;
2323
};
2424

js/types.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,8 @@ export type SegmentedControlProps = $ReadOnly<{|
116116
* Style properties for the slider component (Animated.View)
117117
*/
118118
sliderStyle?: ViewStyle,
119+
/**
120+
* Accessibility hint separator text
121+
*/
122+
accessibilityHintSeperator?: string,
119123
|}>;

0 commit comments

Comments
 (0)