react-native 0.87.0-rc.2 → 0.87.0-rc.4
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/Core/ReactNativeVersion.js +1 -1
- package/React/Base/RCTVersion.m +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 +1 -1
- package/ReactCommon/jsinspector-modern/HostTargetTraceRecording.cpp +10 -7
- package/ReactCommon/jsinspector-modern/tracing/HostTracingProfile.h +14 -1
- package/ReactCommon/jsinspector-modern/tracing/TraceRecordingState.h +11 -0
- package/ReactCommon/react/nativemodule/dom/NativeDOM.cpp +10 -4
- package/package.json +10 -8
- package/scripts/cocoapods/rncore.rb +1 -0
- package/scripts/replace-rncore-version.js +51 -127
- package/scripts/setup-apple-spm.js +111 -9
- package/scripts/spm/__doc__/spm-scripts.md +36 -1
- package/scripts/spm/autolinking-plugins.js +2 -2
- package/scripts/spm/download-spm-artifacts.js +3 -3
- package/scripts/spm/generate-spm-autolinking-config.js +62 -2
- package/scripts/spm/generate-spm-autolinking.js +1 -1
- package/scripts/spm/generate-spm-xcodeproj.js +54 -12
- package/scripts/spm/scaffold-package-swift.js +3 -3
- package/scripts/spm/spm-types.js +3 -0
- package/types_generated/Libraries/ActionSheetIOS/ActionSheetIOS.d.ts +7 -7
- package/types_generated/Libraries/Alert/Alert.d.ts +6 -6
- package/types_generated/Libraries/Animated/AnimatedEvent.d.ts +2 -2
- package/types_generated/Libraries/Animated/AnimatedImplementation.d.ts +3 -3
- package/types_generated/Libraries/Animated/animations/Animation.d.ts +7 -7
- package/types_generated/Libraries/Animated/animations/DecayAnimation.d.ts +5 -5
- package/types_generated/Libraries/Animated/animations/SpringAnimation.d.ts +49 -49
- package/types_generated/Libraries/Animated/animations/TimingAnimation.d.ts +13 -13
- package/types_generated/Libraries/Animated/components/AnimatedFlatList.d.ts +3 -3
- package/types_generated/Libraries/Animated/components/AnimatedSectionList.d.ts +3 -3
- package/types_generated/Libraries/Animated/createAnimatedComponent.d.ts +4 -4
- package/types_generated/Libraries/Animated/nodes/AnimatedColor.d.ts +2 -2
- package/types_generated/Libraries/Animated/nodes/AnimatedInterpolation.d.ts +9 -9
- package/types_generated/Libraries/Animated/nodes/AnimatedNode.d.ts +3 -3
- package/types_generated/Libraries/Blob/BlobTypes.d.ts +4 -4
- package/types_generated/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +3 -3
- package/types_generated/Libraries/Components/ActivityIndicator/ActivityIndicator.d.ts +3 -3
- package/types_generated/Libraries/Components/Button.d.ts +5 -5
- package/types_generated/Libraries/Components/Keyboard/KeyboardAvoidingView.d.ts +3 -3
- package/types_generated/Libraries/Components/Pressable/Pressable.d.ts +5 -5
- package/types_generated/Libraries/Components/Pressable/useAndroidRippleForView.d.ts +6 -6
- package/types_generated/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.d.ts +3 -3
- package/types_generated/Libraries/Components/SafeAreaView/SafeAreaView.d.ts +3 -3
- package/types_generated/Libraries/Components/ScrollView/ScrollView.d.ts +20 -20
- package/types_generated/Libraries/Components/ScrollView/ScrollViewStickyHeader.d.ts +4 -4
- package/types_generated/Libraries/Components/Switch/Switch.d.ts +3 -3
- package/types_generated/Libraries/Components/TextInput/TextInput.flow.d.ts +5 -5
- package/types_generated/Libraries/Components/Touchable/TouchableHighlight.d.ts +4 -4
- package/types_generated/Libraries/Components/Touchable/TouchableOpacity.d.ts +3 -3
- package/types_generated/Libraries/Components/Touchable/TouchableWithoutFeedback.d.ts +2 -2
- package/types_generated/Libraries/Components/View/View.d.ts +3 -3
- package/types_generated/Libraries/Components/View/ViewAccessibility.d.ts +12 -12
- package/types_generated/Libraries/Components/View/ViewPropTypes.d.ts +10 -10
- package/types_generated/Libraries/Core/ExtendedError.d.ts +10 -10
- package/types_generated/Libraries/Image/ImageProps.d.ts +13 -13
- package/types_generated/Libraries/Image/ImageTypes.flow.d.ts +5 -5
- package/types_generated/Libraries/Lists/FlatList.d.ts +13 -13
- package/types_generated/Libraries/Lists/SectionList.d.ts +4 -4
- package/types_generated/Libraries/LogBox/Data/LogBoxData.d.ts +2 -2
- package/types_generated/Libraries/LogBox/Data/LogBoxLog.d.ts +2 -2
- package/types_generated/Libraries/LogBox/Data/parseLogBoxLog.d.ts +2 -2
- package/types_generated/Libraries/Modal/Modal.d.ts +4 -4
- package/types_generated/Libraries/Network/FormData.d.ts +5 -5
- package/types_generated/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts +4 -4
- package/types_generated/Libraries/Pressability/Pressability.d.ts +5 -5
- package/types_generated/Libraries/PushNotificationIOS/PushNotificationIOS.d.ts +11 -11
- package/types_generated/Libraries/ReactNative/AppRegistry.flow.d.ts +4 -4
- package/types_generated/Libraries/ReactNative/IPerformanceLogger.flow.d.ts +5 -5
- package/types_generated/Libraries/Renderer/shims/ReactNativeTypes.d.ts +34 -34
- package/types_generated/Libraries/Share/Share.d.ts +11 -11
- package/types_generated/Libraries/StyleSheet/PlatformColorValueTypesIOS.d.ts +3 -3
- package/types_generated/Libraries/StyleSheet/StyleSheetTypes.d.ts +182 -182
- package/types_generated/Libraries/StyleSheet/private/_TransformStyle.d.ts +3 -3
- package/types_generated/Libraries/Text/Text.d.ts +3 -3
- package/types_generated/Libraries/Text/TextProps.d.ts +5 -5
- package/types_generated/Libraries/TurboModule/RCTExport.d.ts +2 -2
- package/types_generated/Libraries/Types/CoreEventTypes.d.ts +8 -8
- package/types_generated/Libraries/Utilities/PlatformTypes.d.ts +6 -6
- package/types_generated/Libraries/Utilities/codegenNativeComponent.d.ts +5 -5
- package/types_generated/Libraries/Utilities/differ/deepDiffer.d.ts +2 -2
- package/types_generated/src/private/assets/AssetRegistry.d.ts +2 -2
- package/types_generated/src/private/components/virtualcollection/VirtualCollectionView.d.ts +5 -5
- package/types_generated/src/private/components/virtualcollection/column/VirtualColumn.d.ts +3 -3
- package/types_generated/src/private/components/virtualcollection/row/VirtualRow.d.ts +3 -3
- package/types_generated/src/private/components/virtualview/VirtualView.d.ts +7 -7
- package/types_generated/src/private/components/virtualview/VirtualViewExperimentalNativeComponent.d.ts +5 -5
- package/types_generated/src/private/components/virtualview/VirtualViewNativeComponent.d.ts +5 -5
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeDeviceInfo.d.ts +7 -7
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeExceptionsManager.d.ts +5 -5
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeUIManager.d.ts +8 -8
- package/types_generated/src/private/types/HostComponent.d.ts +3 -3
- package/types_generated/src/private/webapis/dom/events/CustomEvent.d.ts +2 -2
- package/types_generated/src/private/webapis/dom/events/Event.d.ts +4 -4
- package/types_generated/src/private/webapis/dom/events/EventTarget.d.ts +8 -8
- package/types_generated/src/private/webapis/dom/nodes/specs/NativeDOM.d.ts +3 -3
|
@@ -117,7 +117,7 @@ function discoverPlugins(
|
|
|
117
117
|
);
|
|
118
118
|
}
|
|
119
119
|
const pluginPath = path.resolve(dep.root, rel);
|
|
120
|
-
let fn
|
|
120
|
+
let fn /*: unknown */ = null;
|
|
121
121
|
try {
|
|
122
122
|
// $FlowFixMe[unsupported-syntax] dynamic require by computed path
|
|
123
123
|
fn = require(pluginPath);
|
|
@@ -175,7 +175,7 @@ function invokePlugins(
|
|
|
175
175
|
const seenFrameworkNames /*: Set<string> */ = new Set();
|
|
176
176
|
|
|
177
177
|
for (const {depName, pluginPath, plugin} of plugins) {
|
|
178
|
-
let result
|
|
178
|
+
let result /*: unknown */ = null;
|
|
179
179
|
try {
|
|
180
180
|
result = plugin(context);
|
|
181
181
|
} catch (e) {
|
|
@@ -943,7 +943,7 @@ async function processArtifact(
|
|
|
943
943
|
return localPath;
|
|
944
944
|
};
|
|
945
945
|
|
|
946
|
-
let tarPath
|
|
946
|
+
let tarPath /*: string */ = '';
|
|
947
947
|
let fromShared = false;
|
|
948
948
|
if (isLocalTarball) {
|
|
949
949
|
tarPath = url;
|
|
@@ -970,7 +970,7 @@ async function processArtifact(
|
|
|
970
970
|
onProgress(xcframeworkName, 0, 0, 0, false, 0);
|
|
971
971
|
}
|
|
972
972
|
const tmpExtractDir = path.join(outputDir, '.extract-tmp', label);
|
|
973
|
-
let xcfwPath
|
|
973
|
+
let xcfwPath /*: string */ = '';
|
|
974
974
|
try {
|
|
975
975
|
xcfwPath = extractXCFramework(tarPath, tmpExtractDir);
|
|
976
976
|
} catch (e) {
|
|
@@ -1349,7 +1349,7 @@ function validateArtifactsCache(
|
|
|
1349
1349
|
if (!fs.existsSync(artifactsJsonPath)) {
|
|
1350
1350
|
return `artifacts.json missing in ${artifactsDir}`;
|
|
1351
1351
|
}
|
|
1352
|
-
let json
|
|
1352
|
+
let json /*: {[string]: {xcframeworkPath: string, url: string}} */ = {};
|
|
1353
1353
|
try {
|
|
1354
1354
|
// $FlowFixMe[unclear-type] JSON.parse returns any
|
|
1355
1355
|
const parsed /*: any */ = JSON.parse(
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
*
|
|
17
17
|
* Invokes the React Native community CLI to produce its config and writes the
|
|
18
18
|
* raw JSON to <project.ios.sourceDir>/build/generated/autolinking/autolinking.json.
|
|
19
|
+
* The config command can be overridden by `--config-command` or
|
|
20
|
+
* `RCT_SPM_AUTOLINKING_CONFIG_COMMAND`, in that order, before the default.
|
|
19
21
|
*
|
|
20
22
|
* No filtering or reshaping happens here — the downstream consumer
|
|
21
23
|
* (generate-spm-autolinking.js) does its own iOS-only filtering when reading
|
|
@@ -60,6 +62,32 @@ const FALLBACK_CONFIG_COMMAND = [
|
|
|
60
62
|
'config',
|
|
61
63
|
];
|
|
62
64
|
|
|
65
|
+
function parseConfigCommandJson(
|
|
66
|
+
raw /*: string */,
|
|
67
|
+
source /*: string */,
|
|
68
|
+
) /*: Array<string> */ {
|
|
69
|
+
let parsed;
|
|
70
|
+
try {
|
|
71
|
+
parsed = JSON.parse(raw);
|
|
72
|
+
} catch {
|
|
73
|
+
throw new Error(
|
|
74
|
+
`${source}: config command must be a JSON array of strings. Example: '["npx","@react-native-community/cli","config"]'`,
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (
|
|
79
|
+
!Array.isArray(parsed) ||
|
|
80
|
+
parsed.length === 0 ||
|
|
81
|
+
!parsed.every(value => typeof value === 'string' && value.length > 0)
|
|
82
|
+
) {
|
|
83
|
+
throw new Error(
|
|
84
|
+
`${source}: config command must be a non-empty JSON array of non-empty strings`,
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return parsed;
|
|
89
|
+
}
|
|
90
|
+
|
|
63
91
|
function resolveDefaultConfigCommand(
|
|
64
92
|
projectRoot /*: string */,
|
|
65
93
|
) /*: Array<string> */ {
|
|
@@ -94,6 +122,31 @@ function resolveDefaultConfigCommand(
|
|
|
94
122
|
return FALLBACK_CONFIG_COMMAND;
|
|
95
123
|
}
|
|
96
124
|
|
|
125
|
+
const ENV_CONFIG_COMMAND = 'RCT_SPM_AUTOLINKING_CONFIG_COMMAND';
|
|
126
|
+
|
|
127
|
+
// The raw env override, or null when unset or blank. Exported so callers that
|
|
128
|
+
// only need to know whether the override is in play (setup-apple-spm.js) share
|
|
129
|
+
// this blankness rule instead of re-deriving it.
|
|
130
|
+
function readEnvConfigCommand() /*: ?string */ {
|
|
131
|
+
const raw = process.env[ENV_CONFIG_COMMAND];
|
|
132
|
+
return typeof raw === 'string' && raw.trim().length > 0 ? raw : null;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// The env override, parsed and validated, or null when unset or blank. Throws
|
|
136
|
+
// on a set-but-invalid value — never silently degrades to the default.
|
|
137
|
+
function resolveEnvConfigCommand() /*: ?Array<string> */ {
|
|
138
|
+
const raw = readEnvConfigCommand();
|
|
139
|
+
return raw == null ? null : parseConfigCommandJson(raw, ENV_CONFIG_COMMAND);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// Env-var / default resolution for the autolinking config command. An explicit
|
|
143
|
+
// `configCommand` (e.g. from `--config-command`) is handled upstream by
|
|
144
|
+
// generateAutolinkingConfig's destructuring default, so it never reaches here —
|
|
145
|
+
// this only decides between the env-var override and the built-in default.
|
|
146
|
+
function resolveConfigCommand(projectRoot /*: string */) /*: Array<string> */ {
|
|
147
|
+
return resolveEnvConfigCommand() ?? resolveDefaultConfigCommand(projectRoot);
|
|
148
|
+
}
|
|
149
|
+
|
|
97
150
|
function defaultCliRunner(
|
|
98
151
|
command /*: Array<string> */,
|
|
99
152
|
opts /*: {cwd: string} */,
|
|
@@ -116,7 +169,7 @@ function generateAutolinkingConfig(
|
|
|
116
169
|
) /*: GenerateAutolinkingConfigResult */ {
|
|
117
170
|
const {
|
|
118
171
|
projectRoot,
|
|
119
|
-
configCommand =
|
|
172
|
+
configCommand = resolveConfigCommand(projectRoot),
|
|
120
173
|
cliRunner = defaultCliRunner,
|
|
121
174
|
} = opts;
|
|
122
175
|
|
|
@@ -158,4 +211,11 @@ function generateAutolinkingConfig(
|
|
|
158
211
|
return {config, outputPath: outPath, rawJson};
|
|
159
212
|
}
|
|
160
213
|
|
|
161
|
-
module.exports = {
|
|
214
|
+
module.exports = {
|
|
215
|
+
generateAutolinkingConfig,
|
|
216
|
+
parseConfigCommandJson,
|
|
217
|
+
readEnvConfigCommand,
|
|
218
|
+
resolveConfigCommand,
|
|
219
|
+
resolveDefaultConfigCommand,
|
|
220
|
+
resolveEnvConfigCommand,
|
|
221
|
+
};
|
|
@@ -426,7 +426,7 @@ function hasMixedLanguageSources(absSource /*: string */) /*: boolean */ {
|
|
|
426
426
|
let hasClang = false;
|
|
427
427
|
const walk = (dir /*: string */, depth /*: number */) => {
|
|
428
428
|
if (depth > 6 || (hasSwift && hasClang)) return;
|
|
429
|
-
let entries
|
|
429
|
+
let entries /*: Array<{name: string, isDirectory(): boolean}> */ = [];
|
|
430
430
|
try {
|
|
431
431
|
// $FlowFixMe[incompatible-type] Dirent typing
|
|
432
432
|
entries = fs.readdirSync(dir, {withFileTypes: true});
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
24
|
const {readFlavoredFrameworksManifest} = require('./flavored-frameworks');
|
|
25
|
+
const {parseConfigCommandJson} = require('./generate-spm-autolinking-config');
|
|
25
26
|
const {
|
|
26
27
|
addArrayMembers,
|
|
27
28
|
addArrayStringValues,
|
|
@@ -1799,13 +1800,13 @@ function readGeneratedSourcesManifest(
|
|
|
1799
1800
|
appRoot /*: string */,
|
|
1800
1801
|
) /*: Array<GeneratedSource> */ {
|
|
1801
1802
|
const manifestPath = path.join(appRoot, SPM_GENERATED_SOURCES_MANIFEST);
|
|
1802
|
-
let raw
|
|
1803
|
+
let raw /*: string */ = '';
|
|
1803
1804
|
try {
|
|
1804
1805
|
raw = fs.readFileSync(manifestPath, 'utf8');
|
|
1805
1806
|
} catch {
|
|
1806
1807
|
return [];
|
|
1807
1808
|
}
|
|
1808
|
-
let entries
|
|
1809
|
+
let entries /*: unknown */ = null;
|
|
1809
1810
|
try {
|
|
1810
1811
|
entries = JSON.parse(raw);
|
|
1811
1812
|
} catch {
|
|
@@ -1844,7 +1845,7 @@ function readGeneratedSourcesManifest(
|
|
|
1844
1845
|
*/
|
|
1845
1846
|
function readMarker(
|
|
1846
1847
|
xcodeprojPath /*: string */,
|
|
1847
|
-
) /*: ?{generatedSources?: {[string]: Array<string>}, artifactsVersionOverride?: ?string, buildSettingChanges?: Array<BuildSettingChange>, ...} */ {
|
|
1848
|
+
) /*: ?{generatedSources?: {[string]: Array<string>}, artifactsVersionOverride?: ?string, configCommand?: ?Array<string>, buildSettingChanges?: Array<BuildSettingChange>, ...} */ {
|
|
1848
1849
|
const markerPath = path.join(xcodeprojPath, SPM_INJECTED_MARKER);
|
|
1849
1850
|
try {
|
|
1850
1851
|
// $FlowFixMe[incompatible-return] JSON.parse returns any
|
|
@@ -1857,10 +1858,11 @@ function readMarker(
|
|
|
1857
1858
|
// Returns the `*.xcodeproj` under `appRoot` carrying a `.spm-injected.json`
|
|
1858
1859
|
// marker (the user-owned project SPM packages were injected into in place),
|
|
1859
1860
|
// or null when none has been injected yet. Pure fs reads — safe for the
|
|
1860
|
-
//
|
|
1861
|
-
//
|
|
1861
|
+
// marker readers below, and for callers that only locate the project (setup-
|
|
1862
|
+
// apple-spm.js's action defaulting and `deinit`), to call without exercising
|
|
1863
|
+
// any pbxproj-editing machinery.
|
|
1862
1864
|
function findInjectedXcodeproj(appRoot /*: string */) /*: string | null */ {
|
|
1863
|
-
let entries
|
|
1865
|
+
let entries /*: Array<{name: string, isDirectory(): boolean}> */ = [];
|
|
1864
1866
|
try {
|
|
1865
1867
|
// $FlowFixMe[incompatible-type] Dirent typing
|
|
1866
1868
|
entries = fs.readdirSync(appRoot, {withFileTypes: true});
|
|
@@ -1884,11 +1886,13 @@ function findInjectedXcodeproj(appRoot /*: string */) /*: string | null */ {
|
|
|
1884
1886
|
* update --version` pinned into the injected xcodeproj's `.spm-injected.json`
|
|
1885
1887
|
* marker (see the field's doc comment in injectSpmIntoExistingXcodeproj
|
|
1886
1888
|
* below), or null when no project is injected yet, no override is pinned, or
|
|
1887
|
-
* the marker can't be read (never throws). Pure fs reads
|
|
1888
|
-
*
|
|
1889
|
-
* the
|
|
1890
|
-
*
|
|
1891
|
-
*
|
|
1889
|
+
* the marker can't be read (never throws). Pure fs reads.
|
|
1890
|
+
*
|
|
1891
|
+
* Nothing in production calls this yet: the pin is written but never read
|
|
1892
|
+
* back, so the build-time sync (sync-spm-autolinking.js) still derives the
|
|
1893
|
+
* version from node_modules/react-native/package.json and can heal against a
|
|
1894
|
+
* different artifact slot than the explicit `--version` selected. Only the
|
|
1895
|
+
* tests cover it.
|
|
1892
1896
|
*/
|
|
1893
1897
|
function readArtifactsVersionOverride(appRoot /*: string */) /*: ?string */ {
|
|
1894
1898
|
const xcodeprojPath = findInjectedXcodeproj(appRoot);
|
|
@@ -1899,13 +1903,39 @@ function readArtifactsVersionOverride(appRoot /*: string */) /*: ?string */ {
|
|
|
1899
1903
|
return typeof override === 'string' && override.length > 0 ? override : null;
|
|
1900
1904
|
}
|
|
1901
1905
|
|
|
1906
|
+
/**
|
|
1907
|
+
* Read the autolinking config command a previous `spm add`/`update` pinned into
|
|
1908
|
+
* the injected xcodeproj's `.spm-injected.json` marker, or null when nothing
|
|
1909
|
+
* usable is pinned. Pure fs reads, like readArtifactsVersionOverride above, but
|
|
1910
|
+
* this one IS wired: setup-apple-spm.js's resolveExplicitConfigCommand reads it
|
|
1911
|
+
* on add/update/scaffold and on the build-time `sync`. Re-validated through the
|
|
1912
|
+
* same parseConfigCommandJson the flag goes through, and never throws, so a
|
|
1913
|
+
* hand-edited marker degrades to the env-var/default command instead of
|
|
1914
|
+
* injecting a bogus argv into the build.
|
|
1915
|
+
*/
|
|
1916
|
+
function readPinnedConfigCommand(appRoot /*: string */) /*: ?Array<string> */ {
|
|
1917
|
+
const xcodeprojPath = findInjectedXcodeproj(appRoot);
|
|
1918
|
+
if (xcodeprojPath == null) {
|
|
1919
|
+
return null;
|
|
1920
|
+
}
|
|
1921
|
+
const pinned = readMarker(xcodeprojPath)?.configCommand;
|
|
1922
|
+
if (pinned == null) {
|
|
1923
|
+
return null;
|
|
1924
|
+
}
|
|
1925
|
+
try {
|
|
1926
|
+
return parseConfigCommandJson(JSON.stringify(pinned), SPM_INJECTED_MARKER);
|
|
1927
|
+
} catch {
|
|
1928
|
+
return null;
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
|
|
1902
1932
|
/**
|
|
1903
1933
|
* Add SPM packages to a user's EXISTING xcodeproj in place. Returns
|
|
1904
1934
|
* {status: 'injected', target} on success, or {status: 'refused', reason}
|
|
1905
1935
|
* when the project can't be safely edited (caller surfaces it; fail-loud).
|
|
1906
1936
|
*/
|
|
1907
1937
|
function injectSpmIntoExistingXcodeproj(
|
|
1908
|
-
opts /*: {appRoot: string, reactNativeRoot: string, xcodeprojPath: string, appName?: ?string, artifactsVersionOverride?: ?string} */,
|
|
1938
|
+
opts /*: {appRoot: string, reactNativeRoot: string, xcodeprojPath: string, appName?: ?string, artifactsVersionOverride?: ?string, configCommand?: ?Array<string>} */,
|
|
1909
1939
|
) /*: {status: 'injected', target: string} | {status: 'refused', reason: string} */ {
|
|
1910
1940
|
const {appRoot, reactNativeRoot, xcodeprojPath} = opts;
|
|
1911
1941
|
const pbxprojPath = path.join(xcodeprojPath, 'project.pbxproj');
|
|
@@ -2022,6 +2052,16 @@ function injectSpmIntoExistingXcodeproj(
|
|
|
2022
2052
|
prevMarker?.artifactsVersionOverride ??
|
|
2023
2053
|
null;
|
|
2024
2054
|
|
|
2055
|
+
// Same set-or-preserve contract as the version pin above, for the autolinking
|
|
2056
|
+
// config command `add`/`update` resolved (`--config-command` or
|
|
2057
|
+
// RCT_SPM_AUTOLINKING_CONFIG_COMMAND) — the build-time sync sees neither the
|
|
2058
|
+
// flag nor the developer's shell environment, so without the pin it
|
|
2059
|
+
// re-derives autolinking.json with the default @react-native-community/cli
|
|
2060
|
+
// command and breaks apps that replace it. Read back by
|
|
2061
|
+
// readPinnedConfigCommand (above). No "clear" verb yet either; `deinit` drops
|
|
2062
|
+
// the whole marker, this field with it.
|
|
2063
|
+
const configCommand = opts.configCommand ?? prevMarker?.configCommand ?? null;
|
|
2064
|
+
|
|
2025
2065
|
// Marker: idempotency signal + the exact, reversible record of every edit so
|
|
2026
2066
|
// `deinit` (removeSpmInjection) can undo precisely what was added.
|
|
2027
2067
|
writeIfChanged(
|
|
@@ -2038,6 +2078,7 @@ function injectSpmIntoExistingXcodeproj(
|
|
|
2038
2078
|
// `update` to reconcile away entries that left the manifest.
|
|
2039
2079
|
generatedSources: generatedSourceUuids,
|
|
2040
2080
|
artifactsVersionOverride,
|
|
2081
|
+
configCommand,
|
|
2041
2082
|
scheme: {
|
|
2042
2083
|
file: schemeResult.file,
|
|
2043
2084
|
created: schemeResult.status === 'created',
|
|
@@ -2220,5 +2261,6 @@ module.exports = {
|
|
|
2220
2261
|
removePreActionFromScheme,
|
|
2221
2262
|
findInjectedXcodeproj,
|
|
2222
2263
|
readArtifactsVersionOverride,
|
|
2264
|
+
readPinnedConfigCommand,
|
|
2223
2265
|
SPM_INJECTED_MARKER,
|
|
2224
2266
|
};
|
|
@@ -197,7 +197,7 @@ function collectSubdirs(
|
|
|
197
197
|
]);
|
|
198
198
|
const out /*: Array<string> */ = [];
|
|
199
199
|
const walk = (absDir /*: string */, relDir /*: string */) => {
|
|
200
|
-
let entries
|
|
200
|
+
let entries /*: Array<{name: string, isDirectory(): boolean}> */ = [];
|
|
201
201
|
try {
|
|
202
202
|
// $FlowFixMe[incompatible-type] Dirent typing
|
|
203
203
|
entries = fs.readdirSync(absDir, {withFileTypes: true});
|
|
@@ -930,7 +930,7 @@ function scaffoldPackageSwiftForDep(
|
|
|
930
930
|
};
|
|
931
931
|
}
|
|
932
932
|
|
|
933
|
-
let model
|
|
933
|
+
let model;
|
|
934
934
|
try {
|
|
935
935
|
model = readPodspec(podspecPath);
|
|
936
936
|
} catch (e) {
|
|
@@ -1126,7 +1126,7 @@ function scaffoldAll(
|
|
|
1126
1126
|
directDeps.push({name, root, platforms: {ios: iosPlatform}});
|
|
1127
1127
|
}
|
|
1128
1128
|
|
|
1129
|
-
let allDeps
|
|
1129
|
+
let allDeps /*: Array<AutolinkedDep> */ = [];
|
|
1130
1130
|
try {
|
|
1131
1131
|
allDeps = expandSpmDependencies(directDeps, {
|
|
1132
1132
|
readConfig: defaultReadConfig,
|
package/scripts/spm/spm-types.js
CHANGED
|
@@ -16,6 +16,9 @@ export type SetupArgs = {
|
|
|
16
16
|
// `debug/` and `release/` cache slots, each with artifacts.json.
|
|
17
17
|
artifacts: string | null,
|
|
18
18
|
skipCodegen: boolean,
|
|
19
|
+
// Overrides the autolinking config command; also settable via
|
|
20
|
+
// RCT_SPM_AUTOLINKING_CONFIG_COMMAND.
|
|
21
|
+
configCommand: Array<string> | null,
|
|
19
22
|
// Artifact download policy: 'auto' fetches when missing, 'skip' never
|
|
20
23
|
// fetches, 'force' clears the cache slot and re-downloads.
|
|
21
24
|
downloadPolicy: 'auto' | 'skip' | 'force',
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<c9df6a2ec502499b961157efa0dd4654>>
|
|
8
8
|
*
|
|
9
9
|
* This file was translated from Flow by scripts/js-api/build-types/index.js.
|
|
10
10
|
* Original file: packages/react-native/Libraries/ActionSheetIOS/ActionSheetIOS.js
|
|
@@ -16,14 +16,14 @@ export type ActionSheetIOSOptions = Readonly<{
|
|
|
16
16
|
title?: string | undefined;
|
|
17
17
|
message?: string | undefined;
|
|
18
18
|
options: Array<string>;
|
|
19
|
-
destructiveButtonIndex?: (number | undefined) | (Array<number> | undefined);
|
|
19
|
+
destructiveButtonIndex?: (number | undefined) | (Array<number> | undefined) | undefined;
|
|
20
20
|
cancelButtonIndex?: number | undefined;
|
|
21
21
|
anchor?: number | undefined;
|
|
22
|
-
tintColor?: ColorValue | ProcessedColorValue;
|
|
23
|
-
cancelButtonTintColor?: ColorValue | ProcessedColorValue;
|
|
24
|
-
disabledButtonTintColor?: ColorValue | ProcessedColorValue;
|
|
25
|
-
userInterfaceStyle?: string;
|
|
26
|
-
disabledButtonIndices?: Array<number
|
|
22
|
+
tintColor?: ColorValue | ProcessedColorValue | undefined;
|
|
23
|
+
cancelButtonTintColor?: ColorValue | ProcessedColorValue | undefined;
|
|
24
|
+
disabledButtonTintColor?: ColorValue | ProcessedColorValue | undefined;
|
|
25
|
+
userInterfaceStyle?: string | undefined;
|
|
26
|
+
disabledButtonIndices?: Array<number> | undefined;
|
|
27
27
|
}>;
|
|
28
28
|
export type ShareActionSheetIOSOptions = Readonly<{
|
|
29
29
|
message?: string | undefined;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<91c4fbdaf5ce348ce30173be24dc7367>>
|
|
8
8
|
*
|
|
9
9
|
* This file was translated from Flow by scripts/js-api/build-types/index.js.
|
|
10
10
|
* Original file: packages/react-native/Libraries/Alert/Alert.js
|
|
@@ -19,16 +19,16 @@ export type AlertType = "default" | "plain-text" | "secure-text" | "login-passwo
|
|
|
19
19
|
*/
|
|
20
20
|
export type AlertButtonStyle = "default" | "cancel" | "destructive";
|
|
21
21
|
export type AlertButton = {
|
|
22
|
-
text?: string;
|
|
23
|
-
onPress?: (((value?: string) => any) | undefined) | (Function | undefined);
|
|
24
|
-
isPreferred?: boolean;
|
|
25
|
-
style?: AlertButtonStyle;
|
|
22
|
+
text?: string | undefined;
|
|
23
|
+
onPress?: (((value?: string) => any) | undefined) | (Function | undefined) | undefined;
|
|
24
|
+
isPreferred?: boolean | undefined;
|
|
25
|
+
style?: AlertButtonStyle | undefined;
|
|
26
26
|
};
|
|
27
27
|
export type AlertButtons = Array<AlertButton>;
|
|
28
28
|
export type AlertOptions = {
|
|
29
29
|
/** @platform android */
|
|
30
30
|
cancelable?: boolean | undefined;
|
|
31
|
-
userInterfaceStyle?: "unspecified" | "light" | "dark";
|
|
31
|
+
userInterfaceStyle?: "unspecified" | "light" | "dark" | undefined;
|
|
32
32
|
/** @platform android */
|
|
33
33
|
onDismiss?: (() => void) | undefined;
|
|
34
34
|
};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<156c6b4bd89b4931acd61ed1d1291a7e>>
|
|
8
8
|
*
|
|
9
9
|
* This file was translated from Flow by scripts/js-api/build-types/index.js.
|
|
10
10
|
* Original file: packages/react-native/Libraries/Animated/AnimatedEvent.js
|
|
@@ -20,7 +20,7 @@ export type Mapping = {
|
|
|
20
20
|
export type EventConfig<T> = {
|
|
21
21
|
listener?: (($$PARAM_0$$: NativeSyntheticEvent<T>) => unknown) | undefined;
|
|
22
22
|
useNativeDriver: boolean;
|
|
23
|
-
platformConfig?: PlatformConfig;
|
|
23
|
+
platformConfig?: PlatformConfig | undefined;
|
|
24
24
|
};
|
|
25
25
|
export declare function attachNativeEventImpl(viewRef: any, eventName: string, argMapping: ReadonlyArray<null | undefined | Mapping>, platformConfig: null | undefined | PlatformConfig): {
|
|
26
26
|
detach: () => void;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<6191fe499d9fba3ac96ba27e46a87695>>
|
|
8
8
|
*
|
|
9
9
|
* This file was translated from Flow by scripts/js-api/build-types/index.js.
|
|
10
10
|
* Original file: packages/react-native/Libraries/Animated/AnimatedImplementation.js
|
|
@@ -65,14 +65,14 @@ declare const timingImpl: (value: AnimatedValue | AnimatedValueXY | AnimatedColo
|
|
|
65
65
|
declare const decayImpl: (value: AnimatedValue | AnimatedValueXY | AnimatedColor, config: DecayAnimationConfig) => CompositeAnimation;
|
|
66
66
|
declare const sequenceImpl: (animations: Array<CompositeAnimation>) => CompositeAnimation;
|
|
67
67
|
type ParallelConfig = {
|
|
68
|
-
stopTogether?: boolean;
|
|
68
|
+
stopTogether?: boolean | undefined;
|
|
69
69
|
};
|
|
70
70
|
declare const parallelImpl: (animations: Array<CompositeAnimation>, config?: null | undefined | ParallelConfig) => CompositeAnimation;
|
|
71
71
|
declare const delayImpl: (time: number) => CompositeAnimation;
|
|
72
72
|
declare const staggerImpl: (time: number, animations: Array<CompositeAnimation>) => CompositeAnimation;
|
|
73
73
|
type LoopAnimationConfig = {
|
|
74
74
|
iterations: number;
|
|
75
|
-
resetBeforeIteration?: boolean;
|
|
75
|
+
resetBeforeIteration?: boolean | undefined;
|
|
76
76
|
};
|
|
77
77
|
declare const loopImpl: (animation: CompositeAnimation, $$PARAM_1$$?: LoopAnimationConfig) => CompositeAnimation;
|
|
78
78
|
declare function forkEventImpl(event: (null | undefined | AnimatedEvent) | (null | undefined | Function), listener: Function): AnimatedEvent | Function;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<75b3486fbb3158cfb8bcab03e5ad45f0>>
|
|
8
8
|
*
|
|
9
9
|
* This file was translated from Flow by scripts/js-api/build-types/index.js.
|
|
10
10
|
* Original file: packages/react-native/Libraries/Animated/animations/Animation.js
|
|
@@ -14,17 +14,17 @@ import type { PlatformConfig } from "../AnimatedPlatformConfig";
|
|
|
14
14
|
import type AnimatedValue from "../nodes/AnimatedValue";
|
|
15
15
|
export type EndResult = {
|
|
16
16
|
finished: boolean;
|
|
17
|
-
value?: number;
|
|
18
|
-
offset?: number;
|
|
17
|
+
value?: number | undefined;
|
|
18
|
+
offset?: number | undefined;
|
|
19
19
|
};
|
|
20
20
|
export type EndCallback = (result: EndResult) => void;
|
|
21
21
|
export type AnimationConfig = Readonly<{
|
|
22
|
-
isInteraction?: boolean;
|
|
22
|
+
isInteraction?: boolean | undefined;
|
|
23
23
|
useNativeDriver: boolean;
|
|
24
|
-
platformConfig?: PlatformConfig;
|
|
24
|
+
platformConfig?: PlatformConfig | undefined;
|
|
25
25
|
onComplete?: EndCallback | undefined;
|
|
26
|
-
iterations?: number;
|
|
27
|
-
isLooping?: boolean;
|
|
26
|
+
iterations?: number | undefined;
|
|
27
|
+
isLooping?: boolean | undefined;
|
|
28
28
|
debugID?: string | undefined;
|
|
29
29
|
}>;
|
|
30
30
|
declare class Animation {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<87d33b318553204c4cfbb4837dfeff3b>>
|
|
8
8
|
*
|
|
9
9
|
* This file was translated from Flow by scripts/js-api/build-types/index.js.
|
|
10
10
|
* Original file: packages/react-native/Libraries/Animated/animations/DecayAnimation.js
|
|
@@ -18,20 +18,20 @@ export type DecayAnimationConfig = Readonly<Omit<AnimationConfig, keyof {
|
|
|
18
18
|
x: number;
|
|
19
19
|
y: number;
|
|
20
20
|
}>;
|
|
21
|
-
deceleration?: number;
|
|
21
|
+
deceleration?: number | undefined;
|
|
22
22
|
}> & {
|
|
23
23
|
velocity: number | Readonly<{
|
|
24
24
|
x: number;
|
|
25
25
|
y: number;
|
|
26
26
|
}>;
|
|
27
|
-
deceleration?: number;
|
|
27
|
+
deceleration?: number | undefined;
|
|
28
28
|
}>;
|
|
29
29
|
export type DecayAnimationConfigSingle = Readonly<Omit<AnimationConfig, keyof {
|
|
30
30
|
velocity: number;
|
|
31
|
-
deceleration?: number;
|
|
31
|
+
deceleration?: number | undefined;
|
|
32
32
|
}> & {
|
|
33
33
|
velocity: number;
|
|
34
|
-
deceleration?: number;
|
|
34
|
+
deceleration?: number | undefined;
|
|
35
35
|
}>;
|
|
36
36
|
declare class DecayAnimation extends Animation {
|
|
37
37
|
constructor(config: DecayAnimationConfigSingle);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<8d1ddb1f144198187d21b409ceca53cd>>
|
|
8
8
|
*
|
|
9
9
|
* This file was translated from Flow by scripts/js-api/build-types/index.js.
|
|
10
10
|
* Original file: packages/react-native/Libraries/Animated/animations/SpringAnimation.js
|
|
@@ -26,21 +26,21 @@ export type SpringAnimationConfig = Readonly<Omit<AnimationConfig, keyof {
|
|
|
26
26
|
b: number;
|
|
27
27
|
a: number;
|
|
28
28
|
} | AnimatedColor | AnimatedInterpolation<number>;
|
|
29
|
-
overshootClamping?: boolean;
|
|
30
|
-
restDisplacementThreshold?: number;
|
|
31
|
-
restSpeedThreshold?: number;
|
|
29
|
+
overshootClamping?: boolean | undefined;
|
|
30
|
+
restDisplacementThreshold?: number | undefined;
|
|
31
|
+
restSpeedThreshold?: number | undefined;
|
|
32
32
|
velocity?: number | Readonly<{
|
|
33
33
|
x: number;
|
|
34
34
|
y: number;
|
|
35
|
-
}
|
|
36
|
-
bounciness?: number;
|
|
37
|
-
speed?: number;
|
|
38
|
-
tension?: number;
|
|
39
|
-
friction?: number;
|
|
40
|
-
stiffness?: number;
|
|
41
|
-
damping?: number;
|
|
42
|
-
mass?: number;
|
|
43
|
-
delay?: number;
|
|
35
|
+
}> | undefined;
|
|
36
|
+
bounciness?: number | undefined;
|
|
37
|
+
speed?: number | undefined;
|
|
38
|
+
tension?: number | undefined;
|
|
39
|
+
friction?: number | undefined;
|
|
40
|
+
stiffness?: number | undefined;
|
|
41
|
+
damping?: number | undefined;
|
|
42
|
+
mass?: number | undefined;
|
|
43
|
+
delay?: number | undefined;
|
|
44
44
|
}> & {
|
|
45
45
|
toValue: number | AnimatedValue | {
|
|
46
46
|
x: number;
|
|
@@ -51,50 +51,50 @@ export type SpringAnimationConfig = Readonly<Omit<AnimationConfig, keyof {
|
|
|
51
51
|
b: number;
|
|
52
52
|
a: number;
|
|
53
53
|
} | AnimatedColor | AnimatedInterpolation<number>;
|
|
54
|
-
overshootClamping?: boolean;
|
|
55
|
-
restDisplacementThreshold?: number;
|
|
56
|
-
restSpeedThreshold?: number;
|
|
54
|
+
overshootClamping?: boolean | undefined;
|
|
55
|
+
restDisplacementThreshold?: number | undefined;
|
|
56
|
+
restSpeedThreshold?: number | undefined;
|
|
57
57
|
velocity?: number | Readonly<{
|
|
58
58
|
x: number;
|
|
59
59
|
y: number;
|
|
60
|
-
}
|
|
61
|
-
bounciness?: number;
|
|
62
|
-
speed?: number;
|
|
63
|
-
tension?: number;
|
|
64
|
-
friction?: number;
|
|
65
|
-
stiffness?: number;
|
|
66
|
-
damping?: number;
|
|
67
|
-
mass?: number;
|
|
68
|
-
delay?: number;
|
|
60
|
+
}> | undefined;
|
|
61
|
+
bounciness?: number | undefined;
|
|
62
|
+
speed?: number | undefined;
|
|
63
|
+
tension?: number | undefined;
|
|
64
|
+
friction?: number | undefined;
|
|
65
|
+
stiffness?: number | undefined;
|
|
66
|
+
damping?: number | undefined;
|
|
67
|
+
mass?: number | undefined;
|
|
68
|
+
delay?: number | undefined;
|
|
69
69
|
}>;
|
|
70
70
|
export type SpringAnimationConfigSingle = Readonly<Omit<AnimationConfig, keyof {
|
|
71
71
|
toValue: number;
|
|
72
|
-
overshootClamping?: boolean;
|
|
73
|
-
restDisplacementThreshold?: number;
|
|
74
|
-
restSpeedThreshold?: number;
|
|
75
|
-
velocity?: number;
|
|
76
|
-
bounciness?: number;
|
|
77
|
-
speed?: number;
|
|
78
|
-
tension?: number;
|
|
79
|
-
friction?: number;
|
|
80
|
-
stiffness?: number;
|
|
81
|
-
damping?: number;
|
|
82
|
-
mass?: number;
|
|
83
|
-
delay?: number;
|
|
72
|
+
overshootClamping?: boolean | undefined;
|
|
73
|
+
restDisplacementThreshold?: number | undefined;
|
|
74
|
+
restSpeedThreshold?: number | undefined;
|
|
75
|
+
velocity?: number | undefined;
|
|
76
|
+
bounciness?: number | undefined;
|
|
77
|
+
speed?: number | undefined;
|
|
78
|
+
tension?: number | undefined;
|
|
79
|
+
friction?: number | undefined;
|
|
80
|
+
stiffness?: number | undefined;
|
|
81
|
+
damping?: number | undefined;
|
|
82
|
+
mass?: number | undefined;
|
|
83
|
+
delay?: number | undefined;
|
|
84
84
|
}> & {
|
|
85
85
|
toValue: number;
|
|
86
|
-
overshootClamping?: boolean;
|
|
87
|
-
restDisplacementThreshold?: number;
|
|
88
|
-
restSpeedThreshold?: number;
|
|
89
|
-
velocity?: number;
|
|
90
|
-
bounciness?: number;
|
|
91
|
-
speed?: number;
|
|
92
|
-
tension?: number;
|
|
93
|
-
friction?: number;
|
|
94
|
-
stiffness?: number;
|
|
95
|
-
damping?: number;
|
|
96
|
-
mass?: number;
|
|
97
|
-
delay?: number;
|
|
86
|
+
overshootClamping?: boolean | undefined;
|
|
87
|
+
restDisplacementThreshold?: number | undefined;
|
|
88
|
+
restSpeedThreshold?: number | undefined;
|
|
89
|
+
velocity?: number | undefined;
|
|
90
|
+
bounciness?: number | undefined;
|
|
91
|
+
speed?: number | undefined;
|
|
92
|
+
tension?: number | undefined;
|
|
93
|
+
friction?: number | undefined;
|
|
94
|
+
stiffness?: number | undefined;
|
|
95
|
+
damping?: number | undefined;
|
|
96
|
+
mass?: number | undefined;
|
|
97
|
+
delay?: number | undefined;
|
|
98
98
|
}>;
|
|
99
99
|
declare type SpringAnimationInternalState = symbol & {
|
|
100
100
|
__SpringAnimationInternalState__: string;
|