react-native-macos 0.81.7 → 0.81.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Libraries/Blob/RCTBlobManager.h +0 -0
- package/Libraries/Blob/RCTBlobManager.mm +0 -0
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +0 -0
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/StyleSheet/normalizeColor.js +0 -0
- package/Libraries/Text/TextInput/Multiline/RCTUITextView.mm +13 -4
- package/React/Base/RCTJavaScriptLoader.h +0 -0
- package/React/Base/RCTJavaScriptLoader.mm +0 -0
- package/React/Base/RCTVersion.m +1 -1
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +154 -2
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputNativeCommands.h +20 -0
- package/React/Views/RCTComponentData.mm +1 -1
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
- package/gradle/libs.versions.toml +1 -1
- package/local-cli/cli.js +0 -0
- package/package.json +3 -3
- package/react-native.config.js +4 -0
- package/scripts/compose-source-maps.js +0 -0
- package/scripts/featureflags/index.js +47 -0
- package/scripts/find-node-for-xcode.sh +0 -0
- package/scripts/ios-prebuild/cli.js +136 -0
- package/sdks/hermes-engine/utils/create-dummy-hermes-xcframework.sh +0 -0
- package/third-party-podspecs/RCT-Folly.podspec +1 -1
- package/third-party-podspecs/fmt.podspec +2 -2
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -328,10 +328,19 @@ static RCTUIColor *defaultPlaceholderColor(void) // [macOS]
|
|
|
328
328
|
#if !TARGET_OS_OSX // [macOS]
|
|
329
329
|
[super setAttributedText:attributedText];
|
|
330
330
|
#else // [macOS
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
331
|
+
if (self.ghostTextChanging) {
|
|
332
|
+
// Ghost text changes should not be on the undo stack. Disable undo
|
|
333
|
+
// registration around the text storage mutation so Cmd+Z skips over
|
|
334
|
+
// ghost text insertions/removals.
|
|
335
|
+
[self.undoManager disableUndoRegistration];
|
|
336
|
+
[self.textStorage setAttributedString:attributedText ?: [NSAttributedString new]];
|
|
337
|
+
[self.undoManager enableUndoRegistration];
|
|
338
|
+
} else {
|
|
339
|
+
// Break undo coalescing when the text is changed by JS (e.g. autocomplete).
|
|
340
|
+
[self breakUndoCoalescing];
|
|
341
|
+
// Avoid Exception thrown while executing UI block: *** -[NSBigMutableString replaceCharactersInRange:withString:]: nil argument
|
|
342
|
+
[self.textStorage setAttributedString:attributedText ?: [NSAttributedString new]];
|
|
343
|
+
}
|
|
335
344
|
#endif // macOS]
|
|
336
345
|
[self textDidChange];
|
|
337
346
|
}
|
|
File without changes
|
|
File without changes
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -103,6 +103,10 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
|
|
|
103
103
|
|
|
104
104
|
BOOL _hasInputAccessoryView;
|
|
105
105
|
CGSize _previousContentSize;
|
|
106
|
+
#if TARGET_OS_OSX // [macOS
|
|
107
|
+
NSString *_ghostText;
|
|
108
|
+
NSInteger _ghostTextPosition;
|
|
109
|
+
#endif // macOS]
|
|
106
110
|
}
|
|
107
111
|
|
|
108
112
|
#pragma mark - UIView overrides
|
|
@@ -514,6 +518,10 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
|
|
|
514
518
|
_lastStringStateWasUpdatedWith = nil;
|
|
515
519
|
_ignoreNextTextInputCall = NO;
|
|
516
520
|
_didMoveToWindow = NO;
|
|
521
|
+
#if TARGET_OS_OSX // [macOS
|
|
522
|
+
_ghostText = nil;
|
|
523
|
+
_ghostTextPosition = 0;
|
|
524
|
+
#endif // macOS]
|
|
517
525
|
[_backedTextInputView resignFirstResponder];
|
|
518
526
|
}
|
|
519
527
|
|
|
@@ -538,6 +546,10 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
|
|
|
538
546
|
|
|
539
547
|
- (void)textInputDidEndEditing
|
|
540
548
|
{
|
|
549
|
+
#if TARGET_OS_OSX // [macOS
|
|
550
|
+
[self setGhostText:nil];
|
|
551
|
+
#endif // macOS]
|
|
552
|
+
|
|
541
553
|
if (_eventEmitter) {
|
|
542
554
|
static_cast<const TextInputEventEmitter &>(*_eventEmitter).onEndEditing([self _textInputMetrics]);
|
|
543
555
|
static_cast<const TextInputEventEmitter &>(*_eventEmitter).onBlur([self _textInputMetrics]);
|
|
@@ -572,6 +584,12 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
|
|
|
572
584
|
|
|
573
585
|
- (NSString *)textInputShouldChangeText:(NSString *)text inRange:(NSRange)range
|
|
574
586
|
{
|
|
587
|
+
#if TARGET_OS_OSX // [macOS
|
|
588
|
+
// Clear ghost text before the text change so the undo manager's snapshot
|
|
589
|
+
// of the pre-edit state never contains ghost text.
|
|
590
|
+
[self setGhostText:nil];
|
|
591
|
+
#endif // macOS]
|
|
592
|
+
|
|
575
593
|
const auto &props = static_cast<const TextInputProps &>(*_props);
|
|
576
594
|
|
|
577
595
|
if (!_backedTextInputView.textWasPasted) {
|
|
@@ -617,6 +635,17 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
|
|
|
617
635
|
return;
|
|
618
636
|
}
|
|
619
637
|
|
|
638
|
+
#if TARGET_OS_OSX // [macOS
|
|
639
|
+
if (_ghostText != nil) {
|
|
640
|
+
NSAttributedString *attributedStringWithoutGhostText = [self removingGhostTextFromString:_backedTextInputView.attributedText strict:NO];
|
|
641
|
+
if (attributedStringWithoutGhostText != nil && ![attributedStringWithoutGhostText isEqual:_backedTextInputView.attributedText]) {
|
|
642
|
+
_backedTextInputView.attributedText = attributedStringWithoutGhostText;
|
|
643
|
+
}
|
|
644
|
+
_ghostText = nil;
|
|
645
|
+
_ghostTextPosition = 0;
|
|
646
|
+
}
|
|
647
|
+
#endif // macOS]
|
|
648
|
+
|
|
620
649
|
if (_ignoreNextTextInputCall && [_lastStringStateWasUpdatedWith isEqual:_backedTextInputView.attributedText]) {
|
|
621
650
|
_ignoreNextTextInputCall = NO;
|
|
622
651
|
return;
|
|
@@ -632,6 +661,14 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
|
|
|
632
661
|
|
|
633
662
|
- (void)textInputDidChangeSelection
|
|
634
663
|
{
|
|
664
|
+
#if TARGET_OS_OSX // [macOS
|
|
665
|
+
// Clear ghost text on any user selection change, matching Paper behavior.
|
|
666
|
+
// This prevents the user from selecting ghost text.
|
|
667
|
+
if (_ghostText != nil && !_comingFromJS && !_backedTextInputView.ghostTextChanging) {
|
|
668
|
+
[self setGhostText:nil];
|
|
669
|
+
}
|
|
670
|
+
#endif // macOS]
|
|
671
|
+
|
|
635
672
|
if (_comingFromJS) {
|
|
636
673
|
return;
|
|
637
674
|
}
|
|
@@ -805,6 +842,115 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
|
|
|
805
842
|
}
|
|
806
843
|
}
|
|
807
844
|
|
|
845
|
+
#if TARGET_OS_OSX // [macOS
|
|
846
|
+
#pragma mark - Ghost Text
|
|
847
|
+
|
|
848
|
+
- (NSDictionary<NSAttributedStringKey, id> *)ghostTextAttributes
|
|
849
|
+
{
|
|
850
|
+
NSMutableDictionary<NSAttributedStringKey, id> *textAttributes =
|
|
851
|
+
[_backedTextInputView.defaultTextAttributes mutableCopy] ?: [NSMutableDictionary new];
|
|
852
|
+
|
|
853
|
+
[textAttributes setValue:_backedTextInputView.placeholderColor ?: [RCTPlatformColor placeholderTextColor]
|
|
854
|
+
forKey:NSForegroundColorAttributeName];
|
|
855
|
+
|
|
856
|
+
return textAttributes;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
- (void)setGhostText:(NSString *)ghostText
|
|
860
|
+
{
|
|
861
|
+
NSRange selectedRange = [_backedTextInputView selectedTextRange];
|
|
862
|
+
NSInteger selectionStart = selectedRange.location;
|
|
863
|
+
NSInteger selectionEnd = selectedRange.location + selectedRange.length;
|
|
864
|
+
NSString *newGhostText = ghostText.length > 0 ? ghostText : nil;
|
|
865
|
+
|
|
866
|
+
if (selectionStart != selectionEnd) {
|
|
867
|
+
newGhostText = nil;
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
if ((_ghostText == nil && newGhostText == nil) || [_ghostText isEqual:newGhostText]) {
|
|
871
|
+
return;
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
if (_backedTextInputView.ghostTextChanging) {
|
|
875
|
+
// look out for nested callbacks -- this can happen for example when selection changes in response to
|
|
876
|
+
// attributed text changing. Such callbacks are initiated by Apple, or we could suppress this other ways.
|
|
877
|
+
return;
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
_backedTextInputView.ghostTextChanging = YES;
|
|
881
|
+
|
|
882
|
+
if (_ghostText != nil) {
|
|
883
|
+
// When setGhostText: is called after making a standard edit, the ghost text may already be gone
|
|
884
|
+
BOOL ghostTextMayAlreadyBeGone = newGhostText == nil;
|
|
885
|
+
NSAttributedString *attributedStringWithoutGhostText = [self removingGhostTextFromString:_backedTextInputView.attributedText strict:!ghostTextMayAlreadyBeGone];
|
|
886
|
+
|
|
887
|
+
if (attributedStringWithoutGhostText != nil) {
|
|
888
|
+
_backedTextInputView.attributedText = attributedStringWithoutGhostText;
|
|
889
|
+
[_backedTextInputView setSelectedTextRange:NSMakeRange(selectionStart, selectionEnd - selectionStart) notifyDelegate:NO];
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
_ghostText = [newGhostText copy];
|
|
894
|
+
_ghostTextPosition = selectionStart;
|
|
895
|
+
|
|
896
|
+
if (_ghostText != nil) {
|
|
897
|
+
NSMutableAttributedString *attributedString = [_backedTextInputView.attributedText mutableCopy];
|
|
898
|
+
NSAttributedString *ghostAttributedString = [[NSAttributedString alloc] initWithString:_ghostText
|
|
899
|
+
attributes:self.ghostTextAttributes];
|
|
900
|
+
|
|
901
|
+
[attributedString insertAttributedString:ghostAttributedString atIndex:_ghostTextPosition];
|
|
902
|
+
_backedTextInputView.attributedText = attributedString;
|
|
903
|
+
[_backedTextInputView setSelectedTextRange:NSMakeRange(_ghostTextPosition, 0) notifyDelegate:NO];
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
_backedTextInputView.ghostTextChanging = NO;
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
/**
|
|
910
|
+
* Attempts to remove the ghost text from a provided string given our current state.
|
|
911
|
+
*
|
|
912
|
+
* If `strict` mode is enabled, this method assumes the ghost text exists exactly
|
|
913
|
+
* where we expect it to be. We assert and return `nil` if we don't find the expected ghost text.
|
|
914
|
+
* It's the responsibility of the caller to make sure the result isn't `nil`.
|
|
915
|
+
*
|
|
916
|
+
* If disabled, we allow for the possibility that the ghost text has already been removed,
|
|
917
|
+
* which can happen if a delegate callback is trying to remove ghost text after invoking `setAttributedText:`.
|
|
918
|
+
*/
|
|
919
|
+
- (NSAttributedString *)removingGhostTextFromString:(NSAttributedString *)string strict:(BOOL)strict
|
|
920
|
+
{
|
|
921
|
+
if (_ghostText == nil) {
|
|
922
|
+
return string;
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
NSRange ghostTextRange = NSMakeRange(_ghostTextPosition, _ghostText.length);
|
|
926
|
+
NSMutableAttributedString *attributedString = [string mutableCopy];
|
|
927
|
+
|
|
928
|
+
if ([attributedString length] < NSMaxRange(ghostTextRange)) {
|
|
929
|
+
if (strict) {
|
|
930
|
+
RCTAssert(false, @"Ghost text not fully present in text view text");
|
|
931
|
+
return nil;
|
|
932
|
+
} else {
|
|
933
|
+
return string;
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
NSString *actualGhostText = [[attributedString attributedSubstringFromRange:ghostTextRange] string];
|
|
938
|
+
|
|
939
|
+
if (![actualGhostText isEqual:_ghostText]) {
|
|
940
|
+
if (strict) {
|
|
941
|
+
RCTAssert(false, @"Ghost text does not match text view text");
|
|
942
|
+
return nil;
|
|
943
|
+
} else {
|
|
944
|
+
return string;
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
[attributedString deleteCharactersInRange:ghostTextRange];
|
|
949
|
+
return attributedString;
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
#endif // macOS]
|
|
953
|
+
|
|
808
954
|
#pragma mark - Native Commands
|
|
809
955
|
|
|
810
956
|
- (void)handleCommand:(const NSString *)commandName args:(const NSArray *)args
|
|
@@ -842,7 +988,13 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
|
|
|
842
988
|
[_backedTextInputView resignFirstResponder];
|
|
843
989
|
#else // [macOS
|
|
844
990
|
NSWindow *window = [_backedTextInputView window];
|
|
845
|
-
|
|
991
|
+
// On macOS, when an NSTextField is focused, the window's firstResponder is the
|
|
992
|
+
// field editor (an NSTextView), not the text field itself. Check currentEditor
|
|
993
|
+
// to determine if the text field is actively being edited.
|
|
994
|
+
if ([_backedTextInputView isKindOfClass:[NSTextField class]] &&
|
|
995
|
+
[(NSTextField *)_backedTextInputView currentEditor] != nil) {
|
|
996
|
+
[window makeFirstResponder:nil];
|
|
997
|
+
} else if ([window firstResponder] == _backedTextInputView.responder) {
|
|
846
998
|
[window makeFirstResponder:nil];
|
|
847
999
|
}
|
|
848
1000
|
#endif // macOS]
|
|
@@ -881,7 +1033,7 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
|
|
|
881
1033
|
#else // [macOS
|
|
882
1034
|
NSInteger startPosition = MIN(start, end);
|
|
883
1035
|
NSInteger endPosition = MAX(start, end);
|
|
884
|
-
[_backedTextInputView setSelectedTextRange:NSMakeRange(startPosition, endPosition - startPosition) notifyDelegate:
|
|
1036
|
+
[_backedTextInputView setSelectedTextRange:NSMakeRange(startPosition, endPosition - startPosition) notifyDelegate:NO];
|
|
885
1037
|
#endif // macOS]
|
|
886
1038
|
_comingFromJS = NO;
|
|
887
1039
|
}
|
|
@@ -18,6 +18,9 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
18
18
|
value:(NSString *__nullable)value
|
|
19
19
|
start:(NSInteger)start
|
|
20
20
|
end:(NSInteger)end;
|
|
21
|
+
#if TARGET_OS_OSX // [macOS
|
|
22
|
+
- (void)setGhostText:(NSString *__nullable)ghostText;
|
|
23
|
+
#endif // macOS]
|
|
21
24
|
@end
|
|
22
25
|
|
|
23
26
|
RCT_EXTERN inline void
|
|
@@ -96,6 +99,23 @@ RCTTextInputHandleCommand(id<RCTTextInputViewProtocol> componentView, const NSSt
|
|
|
96
99
|
return;
|
|
97
100
|
}
|
|
98
101
|
|
|
102
|
+
#if TARGET_OS_OSX // [macOS
|
|
103
|
+
if ([commandName isEqualToString:@"setGhostText"]) {
|
|
104
|
+
#if RCT_DEBUG
|
|
105
|
+
if ([args count] != 1) {
|
|
106
|
+
RCTLogError(
|
|
107
|
+
@"%@ command %@ received %d arguments, expected %d.", @"TextInput", commandName, (int)[args count], 1);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
#endif
|
|
111
|
+
|
|
112
|
+
NSObject *arg0 = args[0];
|
|
113
|
+
NSString *value = [arg0 isKindOfClass:[NSNull class]] ? nil : (NSString *)arg0;
|
|
114
|
+
[componentView setGhostText:value];
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
#endif // macOS]
|
|
118
|
+
|
|
99
119
|
#if RCT_DEBUG
|
|
100
120
|
RCTLogError(@"%@ received command %@, which is not a supported command.", @"TextInput", commandName);
|
|
101
121
|
#endif
|
|
@@ -286,7 +286,7 @@ static RCTPropBlock createNSInvocationSetter(NSMethodSignature *typeSignature, S
|
|
|
286
286
|
#define RCT_CASE(_value, _type) \
|
|
287
287
|
case _value: { \
|
|
288
288
|
__block BOOL setDefaultValue = NO; \
|
|
289
|
-
__block _type defaultValue;
|
|
289
|
+
__block _type defaultValue{}; /*[macOS]*/ \
|
|
290
290
|
_type (*convert)(id, SEL, id) = (__typeof(convert))objc_msgSend; \
|
|
291
291
|
_type (*get)(id, SEL) = (__typeof(get))objc_msgSend; \
|
|
292
292
|
void (*set)(id, SEL, _type) = (__typeof(set))objc_msgSend; \
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
|
|
15
15
|
#define REACT_NATIVE_VERSION_MAJOR 0
|
|
16
16
|
#define REACT_NATIVE_VERSION_MINOR 81
|
|
17
|
-
#define REACT_NATIVE_VERSION_PATCH
|
|
17
|
+
#define REACT_NATIVE_VERSION_PATCH 8
|
|
18
18
|
|
|
19
19
|
namespace facebook::react {
|
|
20
20
|
|
|
21
21
|
constexpr struct {
|
|
22
22
|
int32_t Major = 0;
|
|
23
23
|
int32_t Minor = 81;
|
|
24
|
-
int32_t Patch =
|
|
24
|
+
int32_t Patch = 8;
|
|
25
25
|
std::string_view Prerelease = "";
|
|
26
26
|
} ReactNativeVersion;
|
|
27
27
|
|
package/local-cli/cli.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-macos",
|
|
3
|
-
"version": "0.81.
|
|
3
|
+
"version": "0.81.8",
|
|
4
4
|
"description": "React Native for macOS",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -187,7 +187,7 @@
|
|
|
187
187
|
},
|
|
188
188
|
"dependencies": {
|
|
189
189
|
"@jest/create-cache-key-function": "^29.7.0",
|
|
190
|
-
"@react-native-macos/virtualized-lists": "0.81.
|
|
190
|
+
"@react-native-macos/virtualized-lists": "0.81.8",
|
|
191
191
|
"@react-native/assets-registry": "0.81.6",
|
|
192
192
|
"@react-native/codegen": "0.81.6",
|
|
193
193
|
"@react-native/community-cli-plugin": "0.81.6",
|
|
@@ -253,4 +253,4 @@
|
|
|
253
253
|
}
|
|
254
254
|
]
|
|
255
255
|
}
|
|
256
|
-
}
|
|
256
|
+
}
|
package/react-native.config.js
CHANGED
|
@@ -71,8 +71,12 @@ try {
|
|
|
71
71
|
// [macOS
|
|
72
72
|
let apple;
|
|
73
73
|
try {
|
|
74
|
+
const iosPath = require.resolve('@react-native-community/cli-platform-ios', {
|
|
75
|
+
paths: [process.cwd()],
|
|
76
|
+
});
|
|
74
77
|
apple = findCommunityPlatformPackage(
|
|
75
78
|
'@react-native-community/cli-platform-apple',
|
|
79
|
+
iosPath,
|
|
76
80
|
);
|
|
77
81
|
} catch {
|
|
78
82
|
if (verbose) {
|
|
File without changes
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow strict-local
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
if (require.main === module) {
|
|
12
|
+
require('../../../../scripts/babel-register').registerForMonorepo();
|
|
13
|
+
|
|
14
|
+
let command;
|
|
15
|
+
|
|
16
|
+
if (process.argv.includes('--update')) {
|
|
17
|
+
command = 'update';
|
|
18
|
+
} else if (process.argv.includes('--verify-unchanged')) {
|
|
19
|
+
command = 'verify-unchanged';
|
|
20
|
+
} else if (process.argv.includes('--print')) {
|
|
21
|
+
command = 'print';
|
|
22
|
+
} else if (process.argv.includes('--help')) {
|
|
23
|
+
command = 'help';
|
|
24
|
+
} else {
|
|
25
|
+
console.log('Defaulting to `--update`. See all options using `--help`.');
|
|
26
|
+
command = 'update';
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
switch (command) {
|
|
30
|
+
case 'update':
|
|
31
|
+
require('./update').default(false);
|
|
32
|
+
break;
|
|
33
|
+
case 'verify-unchanged':
|
|
34
|
+
require('./update').default(true);
|
|
35
|
+
break;
|
|
36
|
+
case 'print':
|
|
37
|
+
require('./print').default(process.argv.includes('--json'));
|
|
38
|
+
break;
|
|
39
|
+
case 'help':
|
|
40
|
+
console.log(
|
|
41
|
+
'Usage: node featureflags.js [--update|--verify-unchanged|--print|--help]',
|
|
42
|
+
);
|
|
43
|
+
break;
|
|
44
|
+
default:
|
|
45
|
+
throw new Error('Unexpected script execution.');
|
|
46
|
+
}
|
|
47
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const yargs = require('yargs');
|
|
12
|
+
|
|
13
|
+
/*::
|
|
14
|
+
import type {BuildFlavor, Destination, Platform} from './types';
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const platforms /*: $ReadOnlyArray<Platform> */ = [
|
|
18
|
+
'ios',
|
|
19
|
+
'ios-simulator',
|
|
20
|
+
'mac-catalyst',
|
|
21
|
+
'macos', // [macOS]
|
|
22
|
+
'visionos', // [macOS]
|
|
23
|
+
'visionos-simulator', // [macOS]
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
// CI can't use commas in cache keys, so 'macOS,variant=Mac Catalyst' was creating troubles
|
|
27
|
+
// This map that converts from platforms to valid Xcodebuild destinations.
|
|
28
|
+
const platformToDestination /*: $ReadOnly<{|[Platform]: Destination|}> */ = {
|
|
29
|
+
ios: 'iOS',
|
|
30
|
+
'ios-simulator': 'iOS Simulator',
|
|
31
|
+
'mac-catalyst': 'macOS,variant=Mac Catalyst',
|
|
32
|
+
macos: 'macOS', // [macOS]
|
|
33
|
+
visionos: 'visionOS', // [macOS]
|
|
34
|
+
'visionos-simulator': 'visionOS Simulator', // [macOS]
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const cli = yargs
|
|
38
|
+
.usage(
|
|
39
|
+
'This script prepares iOS prebuilds for React Native. It downloads the dependencies, prepare them, builds them and creates the XCFrameworks.' +
|
|
40
|
+
'Calling the script with no options will build all the dependencies for all the slices and configurations.',
|
|
41
|
+
)
|
|
42
|
+
.option('setup', {
|
|
43
|
+
alias: 's',
|
|
44
|
+
type: 'boolean',
|
|
45
|
+
describe: 'Download and setup dependencies',
|
|
46
|
+
})
|
|
47
|
+
.option('build', {
|
|
48
|
+
alias: 'b',
|
|
49
|
+
type: 'boolean',
|
|
50
|
+
describe: 'Build dependencies/platforms',
|
|
51
|
+
})
|
|
52
|
+
.option('compose', {
|
|
53
|
+
alias: 'c',
|
|
54
|
+
type: 'boolean',
|
|
55
|
+
describe: 'Compose xcframework from built dependencies',
|
|
56
|
+
})
|
|
57
|
+
.option('platforms', {
|
|
58
|
+
alias: 'p',
|
|
59
|
+
type: 'array',
|
|
60
|
+
default: platforms,
|
|
61
|
+
describe: 'Specify one or more platforms to build for',
|
|
62
|
+
})
|
|
63
|
+
.option('flavor', {
|
|
64
|
+
alias: 'f',
|
|
65
|
+
type: 'string',
|
|
66
|
+
describe: 'Specify the flavor to build, Debug (default) or Release.',
|
|
67
|
+
default: 'Debug',
|
|
68
|
+
})
|
|
69
|
+
.option('identity', {
|
|
70
|
+
alias: 'i',
|
|
71
|
+
type: 'string',
|
|
72
|
+
describe:
|
|
73
|
+
'Specify the code signing identity to use for signing the frameworks.',
|
|
74
|
+
})
|
|
75
|
+
.help();
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Returns the tasks that need to be run based on the command line arguments
|
|
79
|
+
*/
|
|
80
|
+
async function getCLIConfiguration() /*: Promise<?{|
|
|
81
|
+
tasks: {|
|
|
82
|
+
setup: boolean,
|
|
83
|
+
build: boolean,
|
|
84
|
+
compose: boolean,
|
|
85
|
+
|},
|
|
86
|
+
flavor: BuildFlavor,
|
|
87
|
+
destinations: $ReadOnlyArray<Destination>,
|
|
88
|
+
identity: ?string,
|
|
89
|
+
|}> */ {
|
|
90
|
+
// Run input parsing
|
|
91
|
+
const argv = await cli.argv;
|
|
92
|
+
|
|
93
|
+
// Verify that the platforms argument is valid
|
|
94
|
+
const platformArray = Array.isArray(argv.platforms)
|
|
95
|
+
? argv.platforms
|
|
96
|
+
: [argv.platforms];
|
|
97
|
+
const invalidPlatforms = platformArray.filter(rs => !platforms.includes(rs));
|
|
98
|
+
|
|
99
|
+
if (invalidPlatforms.length > 0) {
|
|
100
|
+
console.error(
|
|
101
|
+
`Invalid platform specified: ${invalidPlatforms.join(', ')}\nValid platforms are: ${platforms.join(', ')}`,
|
|
102
|
+
);
|
|
103
|
+
return undefined;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Prepare platforms and dependencies
|
|
107
|
+
const resolvedPlatforms = platforms
|
|
108
|
+
.filter(p => argv.platforms.includes(p))
|
|
109
|
+
.map(p => platformToDestination[p]);
|
|
110
|
+
|
|
111
|
+
// Validate flavor
|
|
112
|
+
const flavor = argv.flavor;
|
|
113
|
+
if (flavor !== 'Debug' && flavor !== 'Release') {
|
|
114
|
+
console.error(
|
|
115
|
+
`Invalid flavor specified: ${flavor}\nValid flavors are: Debug, Release`,
|
|
116
|
+
);
|
|
117
|
+
return undefined;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Are we running all commands?
|
|
121
|
+
const runAllCommands =
|
|
122
|
+
argv.setup == null && argv.build == null && argv.compose == null;
|
|
123
|
+
|
|
124
|
+
return {
|
|
125
|
+
tasks: {
|
|
126
|
+
setup: runAllCommands || argv.setup != null,
|
|
127
|
+
build: runAllCommands || argv.build != null,
|
|
128
|
+
compose: runAllCommands || argv.compose != null,
|
|
129
|
+
},
|
|
130
|
+
flavor: flavor,
|
|
131
|
+
destinations: resolvedPlatforms,
|
|
132
|
+
identity: argv.identity,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
module.exports = {getCLIConfiguration};
|
|
File without changes
|
|
@@ -25,7 +25,7 @@ Pod::Spec.new do |spec|
|
|
|
25
25
|
spec.dependency "DoubleConversion"
|
|
26
26
|
spec.dependency "glog"
|
|
27
27
|
spec.dependency "fast_float", "8.0.0"
|
|
28
|
-
spec.dependency "fmt", "
|
|
28
|
+
spec.dependency "fmt", "12.1.0" # [macOS]
|
|
29
29
|
spec.compiler_flags = '-Wno-documentation -faligned-new'
|
|
30
30
|
spec.source_files = 'folly/String.cpp',
|
|
31
31
|
'folly/Conv.cpp',
|
|
@@ -8,14 +8,14 @@ fmt_git_url = fmt_config[:git]
|
|
|
8
8
|
|
|
9
9
|
Pod::Spec.new do |spec|
|
|
10
10
|
spec.name = "fmt"
|
|
11
|
-
spec.version = "
|
|
11
|
+
spec.version = "12.1.0" # [macOS]
|
|
12
12
|
spec.license = { :type => "MIT" }
|
|
13
13
|
spec.homepage = "https://github.com/fmtlib/fmt"
|
|
14
14
|
spec.summary = "{fmt} is an open-source formatting library for C++. It can be used as a safe and fast alternative to (s)printf and iostreams."
|
|
15
15
|
spec.authors = "The fmt contributors"
|
|
16
16
|
spec.source = {
|
|
17
17
|
:git => fmt_git_url,
|
|
18
|
-
:tag => "
|
|
18
|
+
:tag => "12.1.0" # [macOS]
|
|
19
19
|
}
|
|
20
20
|
spec.pod_target_xcconfig = {
|
|
21
21
|
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|