mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Compare commits
73
Commits
@@ -9,3 +9,12 @@ end_of_line = lf
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.gradle]
|
||||
indent_size = 4
|
||||
|
||||
[*.kts]
|
||||
indent_size = 4
|
||||
|
||||
[BUCK]
|
||||
indent_size = 4
|
||||
|
||||
@@ -13,6 +13,7 @@ packages/*/dist
|
||||
packages/*/types_generated
|
||||
packages/debugger-frontend/dist/**/*
|
||||
packages/react-native-codegen/lib
|
||||
tools/eslint/rules/sort-imports.js
|
||||
**/Pods/*
|
||||
**/*.macos.js
|
||||
**/*.windows.js
|
||||
|
||||
+28
-33
@@ -4,18 +4,21 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @noflow
|
||||
* @format
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const path = require('node:path');
|
||||
|
||||
require('eslint-plugin-lint').load(path.join(__dirname, 'tools/eslint/rules'));
|
||||
|
||||
module.exports = {
|
||||
root: true,
|
||||
|
||||
extends: ['@react-native'],
|
||||
|
||||
plugins: ['@react-native/monorepo', '@react-native/specs'],
|
||||
plugins: ['@react-native/eslint-plugin-specs', 'lint'],
|
||||
|
||||
overrides: [
|
||||
// overriding the JS config from @react-native/eslint-config to ensure
|
||||
@@ -24,34 +27,28 @@ module.exports = {
|
||||
files: ['*.js', '*.js.flow', '*.jsx'],
|
||||
parser: 'hermes-eslint',
|
||||
rules: {
|
||||
'@react-native/monorepo/sort-imports': 'warn',
|
||||
'eslint-comments/no-unlimited-disable': 'off',
|
||||
'ft-flow/require-valid-file-annotation': ['error', 'always'],
|
||||
'no-extra-boolean-cast': 'off',
|
||||
'no-void': 'off',
|
||||
// These rules are not required with hermes-eslint
|
||||
'ft-flow/define-flow-type': 'off',
|
||||
'ft-flow/use-flow-type': 'off',
|
||||
// Flow handles these checks for us, so they aren't required
|
||||
'no-undef': 'off',
|
||||
'no-unreachable': 'off',
|
||||
'ft-flow/define-flow-type': 0,
|
||||
'ft-flow/use-flow-type': 0,
|
||||
'lint/sort-imports': 1,
|
||||
// flow handles this check for us, so it's not required
|
||||
'no-undef': 0,
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['*.js', '*.jsx', '*.ts', '*.tsx'],
|
||||
rules: {
|
||||
'@react-native/no-deep-imports': 'off',
|
||||
'@react-native/no-deep-imports': 0,
|
||||
},
|
||||
},
|
||||
{
|
||||
files: [
|
||||
'./packages/react-native/Libraries/**/*.{js,flow}',
|
||||
'./packages/react-native/src/**/*.{js,flow}',
|
||||
'./packages/react-native/**/*.{js,flow}',
|
||||
'./packages/assets/registry.js',
|
||||
],
|
||||
parser: 'hermes-eslint',
|
||||
rules: {
|
||||
'@react-native/monorepo/no-commonjs-exports': 'warn',
|
||||
'lint/no-commonjs-exports': 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -61,17 +58,15 @@ module.exports = {
|
||||
{
|
||||
files: ['package.json'],
|
||||
rules: {
|
||||
'@react-native/monorepo/react-native-manifest': 'error',
|
||||
'lint/react-native-manifest': 2,
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['flow-typed/**/*.js', 'packages/react-native/flow/**/*'],
|
||||
files: ['flow-typed/**/*.js'],
|
||||
rules: {
|
||||
'@react-native/monorepo/valid-flow-typed-signature': 'error',
|
||||
'ft-flow/require-valid-file-annotation': 'off',
|
||||
'no-shadow': 'off',
|
||||
'no-unused-vars': 'off',
|
||||
quotes: 'off',
|
||||
'lint/valid-flow-typed-signature': 2,
|
||||
'no-unused-vars': 0,
|
||||
quotes: 0,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -80,14 +75,14 @@ module.exports = {
|
||||
'packages/react-native/src/**/*.js',
|
||||
],
|
||||
rules: {
|
||||
'@react-native/monorepo/no-haste-imports': 'error',
|
||||
'@react-native/monorepo/no-react-default-imports': 'error',
|
||||
'@react-native/monorepo/no-react-named-type-imports': 'error',
|
||||
'@react-native/monorepo/no-react-native-imports': 'error',
|
||||
'@react-native/monorepo/no-react-node-imports': 'error',
|
||||
'@react-native/monorepo/require-extends-error': 'error',
|
||||
'@react-native/platform-colors': 'error',
|
||||
'@react-native/specs/react-native-modules': 'error',
|
||||
'@react-native/platform-colors': 2,
|
||||
'@react-native/specs/react-native-modules': 2,
|
||||
'lint/no-haste-imports': 2,
|
||||
'lint/no-react-native-imports': 2,
|
||||
'lint/require-extends-error': 2,
|
||||
'lint/no-react-node-imports': 2,
|
||||
'lint/no-react-default-imports': 2,
|
||||
'lint/no-react-named-type-imports': 2,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -139,9 +134,9 @@ module.exports = {
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['**/__tests__/**'],
|
||||
files: ['**/*-itest{.fb,}.js'],
|
||||
rules: {
|
||||
'@react-native/monorepo/no-react-native-imports': 'off',
|
||||
'lint/no-react-native-imports': 'off',
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
+4
-7
@@ -9,7 +9,7 @@
|
||||
<PROJECT_ROOT>/packages/react-native-codegen/e2e/__test_fixtures__/modules/NativeEnumTurboModule.js
|
||||
|
||||
; Ignore the Dangerfile
|
||||
<PROJECT_ROOT>/private/react-native-bots/dangerfile.js
|
||||
<PROJECT_ROOT>/packages/react-native-bots/dangerfile.js
|
||||
|
||||
; Ignore "BUCK" generated dirs
|
||||
<PROJECT_ROOT>/\.buckd/
|
||||
@@ -27,7 +27,7 @@
|
||||
<PROJECT_ROOT>/packages/.*/dist
|
||||
|
||||
; helloworld
|
||||
<PROJECT_ROOT>/private/helloworld/ios/Pods/
|
||||
<PROJECT_ROOT>/packages/helloworld/ios/Pods/
|
||||
|
||||
; Ignore rn-tester Pods
|
||||
<PROJECT_ROOT>/packages/rn-tester/Pods/
|
||||
@@ -44,12 +44,11 @@
|
||||
flow-typed/
|
||||
packages/react-native/interface.js
|
||||
packages/react-native/flow/
|
||||
packages/react-native/src/types/
|
||||
|
||||
[options]
|
||||
enums=true
|
||||
experimental.pattern_matching=true
|
||||
casting_syntax=both
|
||||
component_syntax=true
|
||||
|
||||
emoji=true
|
||||
|
||||
@@ -71,8 +70,6 @@ module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/packages/react-nat
|
||||
module.name_mapper='^@react-native/dev-middleware$' -> '<PROJECT_ROOT>/packages/dev-middleware'
|
||||
module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\|xml\)$' -> '<PROJECT_ROOT>/packages/react-native/Libraries/Image/RelativeImageStub'
|
||||
|
||||
module.system.haste.module_ref_prefix=m#
|
||||
|
||||
react.runtime=automatic
|
||||
|
||||
suppress_type=$FlowIssue
|
||||
@@ -104,4 +101,4 @@ untyped-import
|
||||
untyped-type-import
|
||||
|
||||
[version]
|
||||
^0.275.0
|
||||
^0.269.1
|
||||
|
||||
@@ -83,7 +83,7 @@ body:
|
||||
path: /bin/zsh
|
||||
Binaries:
|
||||
Node: ...
|
||||
version: 22.14.0
|
||||
version: 18.14.0
|
||||
...
|
||||
render: text
|
||||
validations:
|
||||
|
||||
@@ -62,7 +62,7 @@ body:
|
||||
path: /bin/zsh
|
||||
Binaries:
|
||||
Node: ...
|
||||
version: 22.14.0
|
||||
version: 18.14.0
|
||||
...
|
||||
render: text
|
||||
validations:
|
||||
|
||||
@@ -95,7 +95,7 @@ body:
|
||||
path: /bin/zsh
|
||||
Binaries:
|
||||
Node: ...
|
||||
version: 22.14.0
|
||||
version: 18.14.0
|
||||
...
|
||||
render: text
|
||||
validations:
|
||||
|
||||
@@ -86,13 +86,27 @@ runs:
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: rntester-debug
|
||||
path: packages/rn-tester/android/app/build/outputs/apk/debug/
|
||||
name: rntester-hermes-debug
|
||||
path: packages/rn-tester/android/app/build/outputs/apk/hermes/debug/
|
||||
compression-level: 0
|
||||
- name: Upload RNTester APK - hermes-release
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: rntester-release
|
||||
path: packages/rn-tester/android/app/build/outputs/apk/release/
|
||||
name: rntester-hermes-release
|
||||
path: packages/rn-tester/android/app/build/outputs/apk/hermes/release/
|
||||
compression-level: 0
|
||||
- name: Upload RNTester APK - jsc-debug
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: rntester-jsc-debug
|
||||
path: packages/rn-tester/android/app/build/outputs/apk/jsc/debug/
|
||||
compression-level: 0
|
||||
- name: Upload RNTester APK - jsc-release
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: rntester-jsc-release
|
||||
path: packages/rn-tester/android/app/build/outputs/apk/jsc/release/
|
||||
compression-level: 0
|
||||
|
||||
@@ -107,12 +107,6 @@ runs:
|
||||
pattern: ReactNativeDependencies*
|
||||
path: ./packages/react-native/ReactAndroid/external-artifacts/artifacts
|
||||
merge-multiple: true
|
||||
- name: Download ReactCore artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
pattern: ReactCore*
|
||||
path: ./packages/react-native/ReactAndroid/external-artifacts/artifacts
|
||||
merge-multiple: true
|
||||
- name: Print Artifacts Directory
|
||||
shell: bash
|
||||
run: ls -lR ./packages/react-native/ReactAndroid/external-artifacts/artifacts/
|
||||
@@ -129,7 +123,7 @@ runs:
|
||||
run: yarn build
|
||||
- name: Build types
|
||||
shell: bash
|
||||
run: yarn build-types --skip-snapshot
|
||||
run: yarn build-types
|
||||
# Continue with publish steps
|
||||
- name: Set npm credentials
|
||||
if: ${{ inputs.release-type == 'release' ||
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
name: diff-js-api-breaking-changes
|
||||
description: Check for breaking changes in the public React Native JS API
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Fetch snapshot from PR head
|
||||
shell: bash
|
||||
env:
|
||||
SCRATCH_DIR: ${{ runner.temp }}/diff-js-api-breaking-changes
|
||||
run: |
|
||||
mkdir $SCRATCH_DIR
|
||||
git fetch --depth=1 origin ${{ github.event.pull_request.head.sha }}
|
||||
git show ${{ github.event.pull_request.head.sha }}:packages/react-native/ReactNativeApi.d.ts > $SCRATCH_DIR/ReactNativeApi-after.d.ts \
|
||||
|| echo "" > $SCRATCH_DIR/ReactNativeApi.d.ts
|
||||
- name: Run breaking change detection
|
||||
shell: bash
|
||||
env:
|
||||
SCRATCH_DIR: ${{ runner.temp }}/diff-js-api-breaking-changes
|
||||
run: |
|
||||
node ./scripts/js-api/diff-api-snapshot \
|
||||
${{ github.workspace }}/packages/react-native/ReactNativeApi.d.ts \
|
||||
$SCRATCH_DIR/ReactNativeApi-after.d.ts \
|
||||
> $SCRATCH_DIR/output.json
|
||||
@@ -4,7 +4,7 @@ inputs:
|
||||
node-version:
|
||||
description: "The node.js version to use"
|
||||
required: false
|
||||
default: "22"
|
||||
default: "20"
|
||||
github-token:
|
||||
description: "The GitHub token used by pull-bot"
|
||||
required: true
|
||||
@@ -26,12 +26,15 @@ runs:
|
||||
- name: Lint code
|
||||
shell: bash
|
||||
run: ./.github/workflow-scripts/exec_swallow_error.sh yarn lint --format junit -o ./reports/junit/eslint/results.xml
|
||||
- name: Lint java
|
||||
shell: bash
|
||||
run: ./.github/workflow-scripts/exec_swallow_error.sh yarn lint-java --check
|
||||
- name: Lint file structure
|
||||
shell: bash
|
||||
run: ./.github/workflow-scripts/lint_files.sh
|
||||
- name: Verify not committing repo after running build
|
||||
shell: bash
|
||||
run: yarn run build --validate
|
||||
run: yarn run build --check
|
||||
- name: Run flowcheck
|
||||
shell: bash
|
||||
run: yarn flow-check
|
||||
@@ -47,9 +50,3 @@ runs:
|
||||
- name: Lint markdown
|
||||
shell: bash
|
||||
run: yarn run lint-markdown
|
||||
- name: Build types
|
||||
shell: bash
|
||||
run: yarn build-types --skip-snapshot
|
||||
- name: Run typescript check of generated types
|
||||
shell: bash
|
||||
run: yarn test-generated-typescript
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name: Maestro E2E Android
|
||||
description: Runs E2E Tests on Android using Maestro
|
||||
description: Runs E2E Tests on iOS using Maestro
|
||||
inputs:
|
||||
app-path:
|
||||
required: true
|
||||
@@ -7,6 +7,9 @@ inputs:
|
||||
app-id:
|
||||
required: true
|
||||
description: The id of the app to test
|
||||
jsengine:
|
||||
required: true
|
||||
description: The js engine we are using
|
||||
maestro-flow:
|
||||
required: true
|
||||
description: the folder that contains the maestro tests
|
||||
@@ -22,6 +25,10 @@ inputs:
|
||||
required: false
|
||||
default: "."
|
||||
description: The directory from which metro should be started
|
||||
architecture:
|
||||
required: false
|
||||
default: "NewArch"
|
||||
description: The react native architecture to test
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
@@ -72,7 +79,7 @@ runs:
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
if: always()
|
||||
with:
|
||||
name: e2e_android_${{ steps.normalize-app-id.outputs.app-id }}_report_${{ inputs.flavor }}_NewArch
|
||||
name: e2e_android_${{ steps.normalize-app-id.outputs.app-id }}_report_${{ inputs.jsengine }}_${{ inputs.flavor }}_${{ inputs.architecture }}
|
||||
path: |
|
||||
report.xml
|
||||
screen.mp4
|
||||
@@ -80,5 +87,5 @@ runs:
|
||||
if: steps.run-tests.outcome == 'failure'
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: maestro-logs-android-${{ steps.normalize-app-id.outputs.app-id }}-${{ inputs.flavor }}-NewArch
|
||||
name: maestro-logs-android-${{ steps.normalize-app-id.outputs.app-id }}-${{ inputs.jsengine }}-${{ inputs.flavor }}-${{ inputs.architecture }}
|
||||
path: /tmp/MaestroLogs
|
||||
|
||||
@@ -7,6 +7,9 @@ inputs:
|
||||
app-id:
|
||||
required: true
|
||||
description: The id of the app to test
|
||||
jsengine:
|
||||
required: true
|
||||
description: The js engine we are using
|
||||
maestro-flow:
|
||||
required: true
|
||||
description: the folder that contains the maestro tests
|
||||
@@ -18,6 +21,10 @@ inputs:
|
||||
required: false
|
||||
default: "."
|
||||
description: The directory from which metro should be started
|
||||
architecture:
|
||||
required: false
|
||||
default: "NewArch"
|
||||
description: The react native architecture to test
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
@@ -59,24 +66,24 @@ runs:
|
||||
"${{ inputs.app-path }}" \
|
||||
"${{ inputs.app-id }}" \
|
||||
"${{ inputs.maestro-flow }}" \
|
||||
"Hermes" \
|
||||
"${{ inputs.jsengine }}" \
|
||||
"${{ inputs.flavor }}" \
|
||||
"${{ inputs.working-directory }}"
|
||||
- name: Store video record
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: e2e_ios_${{ inputs.app-id }}_report_${{ inputs.flavor }}_NewArch
|
||||
name: e2e_ios_${{ inputs.app-id }}_report_${{ inputs.jsengine }}_${{ inputs.flavor }}_${{ inputs.architecture }}
|
||||
path: |
|
||||
video_record_1.mov
|
||||
video_record_2.mov
|
||||
video_record_3.mov
|
||||
video_record_4.mov
|
||||
video_record_5.mov
|
||||
video_record_${{ inputs.jsengine }}_1.mov
|
||||
video_record_${{ inputs.jsengine }}_2.mov
|
||||
video_record_${{ inputs.jsengine }}_3.mov
|
||||
video_record_${{ inputs.jsengine }}_4.mov
|
||||
video_record_${{ inputs.jsengine }}_5.mov
|
||||
report.xml
|
||||
- name: Store Logs
|
||||
if: failure() && steps.run-tests.outcome == 'failure'
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: maestro-logs-${{ inputs.app-id }}-${{ inputs.flavor }}-NewArch
|
||||
name: maestro-logs-${{ inputs.app-id }}-${{ inputs.jsengine }}-${{ inputs.flavor }}-${{ inputs.architecture }}
|
||||
path: /tmp/MaestroLogs
|
||||
|
||||
@@ -4,7 +4,7 @@ inputs:
|
||||
node-version:
|
||||
description: 'The node.js version to use'
|
||||
required: false
|
||||
default: '22.14.0'
|
||||
default: '20'
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
|
||||
@@ -4,9 +4,15 @@ inputs:
|
||||
hermes-version:
|
||||
description: The version of hermes
|
||||
required: true
|
||||
jsengine:
|
||||
dscription: The js engine in use
|
||||
default: Hermes
|
||||
flavor:
|
||||
description: The flavor that is going to be built
|
||||
default: Debug
|
||||
architecture:
|
||||
description: The architecture that is going to be built
|
||||
default: NewArch
|
||||
use-frameworks:
|
||||
description: Whether we are bulding with DynamicFrameworks or StaticLibraries
|
||||
default: StaticLibraries
|
||||
@@ -24,9 +30,9 @@ runs:
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: packages/rn-tester/Podfile.lock
|
||||
key: v13-podfilelock-${{ github.job }}-NewArch-${{ inputs.flavor }}-${{ inputs.use-frameworks }}-${{ inputs.ruby-version }}-${{ hashfiles('packages/rn-tester/Podfile') }}-${{ inputs.hermes-version }}
|
||||
key: v13-podfilelock-${{ github.job }}-${{ inputs.architecture }}-${{ inputs.jsengine }}-${{ inputs.flavor }}-${{ inputs.use-frameworks }}-${{ inputs.ruby-version }}-${{ hashfiles('packages/rn-tester/Podfile') }}-${{ inputs.hermes-version }}
|
||||
- name: Cache cocoapods
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: packages/rn-tester/Pods
|
||||
key: v15-cocoapods-${{ github.job }}-NewArch-${{ inputs.flavor }}-${{ inputs.use-frameworks }}-${{ inputs.ruby-version }}-${{ hashfiles('packages/rn-tester/Podfile.lock') }}-${{ hashfiles('packages/rn-tester/Podfile') }}-${{ inputs.hermes-version}}
|
||||
key: v15-cocoapods-${{ github.job }}-${{ inputs.architecture }}-${{ inputs.jsengine }}-${{ inputs.flavor }}-${{ inputs.use-frameworks }}-${{ inputs.ruby-version }}-${{ hashfiles('packages/rn-tester/Podfile.lock') }}-${{ hashfiles('packages/rn-tester/Podfile') }}-${{ inputs.hermes-version}}
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
name: test-ios-helloworld
|
||||
description: Test iOS Hello World
|
||||
inputs:
|
||||
jsengine:
|
||||
description: Which JavaScript engine to use. Must be one of "Hermes", "JSC".
|
||||
default: Hermes
|
||||
use-frameworks:
|
||||
description: The dependency building and linking strategy to use. Must be one of "StaticLibraries", "DynamicFrameworks"
|
||||
default: StaticLibraries
|
||||
architecture:
|
||||
description: The React Native architecture to Test. RNTester has always Fabric enabled, but we want to run integration test with the old arch setup. Must be one of "OldArch" or "NewArch"
|
||||
default: OldArch
|
||||
ruby-version:
|
||||
description: The version of ruby that must be used
|
||||
default: 2.6.10
|
||||
@@ -48,53 +54,46 @@ runs:
|
||||
- name: Print third-party folder
|
||||
shell: bash
|
||||
run: ls -lR /tmp/third-party
|
||||
- name: Download React Native Prebuilds
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ReactCore${{ inputs.flavor }}.xcframework.tar.gz
|
||||
path: /tmp/ReactCore
|
||||
- name: Print ReactCore folder
|
||||
shell: bash
|
||||
run: ls -lR /tmp/ReactCore
|
||||
- name: Install iOS dependencies - Configuration ${{ inputs.flavor }};
|
||||
- name: Install iOS dependencies - Configuration ${{ inputs.flavor }}; New Architecture ${{ inputs.architecture }}; JS Engine ${{ inputs.jsengine }}
|
||||
shell: bash
|
||||
run: |
|
||||
cd private/helloworld
|
||||
cd packages/helloworld
|
||||
args=()
|
||||
|
||||
if [[ ${{ inputs.architecture }} == "OldArch" ]]; then
|
||||
args+=(--arch old)
|
||||
fi
|
||||
|
||||
if [[ ${{ inputs.use-frameworks }} == "DynamicFrameworks" ]]; then
|
||||
args+=(--frameworks dynamic)
|
||||
fi
|
||||
|
||||
# Tarball is restored with capital flavors suffix, but somehow the tarball name from JS at line 96 returns as lowercased.
|
||||
# Let's ensure that the tarballs have the right names
|
||||
if [[ ${{ inputs.jsengine }} == "JSC" ]]; then
|
||||
args+=(--jsvm jsc)
|
||||
yarn bootstrap ios "${args[@]}" | cat
|
||||
else
|
||||
# Tarball is restored with capital flavors suffix, but somehow the tarball name from JS at line 96 returns as lowercased.
|
||||
# Let's ensure that the tarballs have the right names
|
||||
|
||||
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz" ]]; then
|
||||
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-debug.tar.gz"
|
||||
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz" ]]; then
|
||||
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-debug.tar.gz"
|
||||
fi
|
||||
|
||||
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz" ]]; then
|
||||
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-release.tar.gz"
|
||||
fi
|
||||
|
||||
BUILD_TYPE="${{ inputs.flavor }}"
|
||||
TARBALL_FILENAME=$(node ../react-native/scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE")
|
||||
export HERMES_ENGINE_TARBALL_PATH="$HERMES_WS_DIR/hermes-runtime-darwin/$TARBALL_FILENAME"
|
||||
export RCT_USE_LOCAL_RN_DEP="/tmp/third-party/ReactNativeDependencies${{ inputs.flavor }}.xcframework.tar.gz"
|
||||
|
||||
yarn bootstrap ios "${args[@]}" | cat
|
||||
fi
|
||||
|
||||
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz" ]]; then
|
||||
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-release.tar.gz"
|
||||
fi
|
||||
|
||||
BUILD_TYPE="${{ inputs.flavor }}"
|
||||
TARBALL_FILENAME=$(node ../../packages/react-native/scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE")
|
||||
export HERMES_ENGINE_TARBALL_PATH="$HERMES_WS_DIR/hermes-runtime-darwin/$TARBALL_FILENAME"
|
||||
export RCT_USE_LOCAL_RN_DEP="/tmp/third-party/ReactNativeDependencies${{ inputs.flavor }}.xcframework.tar.gz"
|
||||
export RCT_TESTONLY_RNCORE_TARBALL_PATH="/tmp/ReactCore/ReactCore${{ inputs.flavor }}.xcframework.tar.gz"
|
||||
|
||||
yarn bootstrap ios "${args[@]}" | cat
|
||||
|
||||
- name: Run Helloworld tests
|
||||
- name: Build HelloWorld project
|
||||
shell: bash
|
||||
run: |
|
||||
cd private/helloworld
|
||||
yarn test
|
||||
|
||||
- name: Build HelloWorld project
|
||||
shell: bash
|
||||
run: |
|
||||
cd private/helloworld
|
||||
cd packages/helloworld
|
||||
|
||||
args=()
|
||||
if [[ ${{ inputs.flavor }} == "Release" ]]; then
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
name: test-ios-rntester
|
||||
description: Test iOS RNTester
|
||||
inputs:
|
||||
jsengine:
|
||||
description: Which JavaScript engine to use. Must be one of "Hermes", "JSC".
|
||||
default: Hermes
|
||||
use-frameworks:
|
||||
description: The dependency building and linking strategy to use. Must be one of "StaticLibraries", "DynamicFrameworks"
|
||||
default: StaticLibraries
|
||||
architecture:
|
||||
description: The React Native architecture to Test. RNTester has always Fabric enabled, but we want to run integration test with the old arch setup
|
||||
default: NewArch
|
||||
ruby-version:
|
||||
description: The version of ruby that must be used
|
||||
default: 2.6.10
|
||||
@@ -94,32 +100,33 @@ runs:
|
||||
- name: Print third-party folder
|
||||
shell: bash
|
||||
run: ls -lR /tmp/third-party
|
||||
- name: Download React Native Prebuilds
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ReactCore${{ inputs.flavor }}.xcframework.tar.gz
|
||||
path: /tmp/ReactCore
|
||||
- name: Print ReactCore folder
|
||||
shell: bash
|
||||
run: ls -lR /tmp/ReactCore
|
||||
- name: Setup xcode build cache
|
||||
uses: ./.github/actions/setup-xcode-build-cache
|
||||
with:
|
||||
hermes-version: ${{ inputs.hermes-version }}
|
||||
jsengine: ${{ inputs.jsengine }}
|
||||
architecture: ${{ inputs.architecture }}
|
||||
use-frameworks: ${{ inputs.use-frameworks }}
|
||||
flavor: ${{ inputs.flavor }}
|
||||
ruby-version: ${{ inputs.ruby-version }}
|
||||
- name: Install CocoaPods dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
export HERMES_ENGINE_TARBALL_PATH=$HERMES_ENGINE_TARBALL_PATH
|
||||
export RCT_USE_LOCAL_RN_DEP="/tmp/third-party/ReactNativeDependencies${{ inputs.flavor }}.xcframework.tar.gz"
|
||||
export RCT_TESTONLY_RNCORE_TARBALL_PATH="/tmp/ReactCore/ReactCore${{ inputs.flavor }}.xcframework.tar.gz"
|
||||
if [[ ${{ inputs.jsengine }} == "JSC" ]]; then
|
||||
export USE_HERMES=0
|
||||
else
|
||||
export HERMES_ENGINE_TARBALL_PATH=$HERMES_ENGINE_TARBALL_PATH
|
||||
fi
|
||||
|
||||
if [[ ${{ inputs.use-frameworks }} == "DynamicFrameworks" ]]; then
|
||||
export USE_FRAMEWORKS=dynamic
|
||||
fi
|
||||
|
||||
if [[ ${{ inputs.architecture }} == "OldArch" ]]; then
|
||||
export RCT_NEW_ARCH_ENABLED=0
|
||||
fi
|
||||
|
||||
export RCT_USE_LOCAL_RN_DEP="/tmp/third-party/ReactNativeDependencies${{ inputs.flavor }}.xcframework.tar.gz"
|
||||
cd packages/rn-tester
|
||||
|
||||
bundle install
|
||||
@@ -163,7 +170,7 @@ runs:
|
||||
if: ${{ inputs.use-frameworks == 'StaticLibraries' && inputs.ruby-version == '2.6.10' }} # This is needed to avoid conflicts with the artifacts
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: RNTesterApp-NewArch-${{ inputs.flavor }}
|
||||
name: RNTesterApp-${{ inputs.architecture }}-${{ inputs.jsengine }}-${{ inputs.flavor }}
|
||||
path: ${{ env.app-path }}
|
||||
- name: Store test results
|
||||
if: ${{ inputs.run-unit-tests == 'true' }}
|
||||
|
||||
@@ -4,7 +4,7 @@ inputs:
|
||||
node-version:
|
||||
description: "The node.js version to use"
|
||||
required: false
|
||||
default: "22"
|
||||
default: "20"
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
|
||||
@@ -2,8 +2,6 @@ name: yarn-install
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
@@ -38,7 +38,7 @@ describe('#verifyArtifactsAreOnMaven', () => {
|
||||
|
||||
expect(mockSleep).toHaveBeenCalledTimes(1);
|
||||
expect(mockFetch).toHaveBeenCalledWith(
|
||||
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1/react-native-artifacts-0.78.1.pom',
|
||||
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -55,7 +55,7 @@ describe('#verifyArtifactsAreOnMaven', () => {
|
||||
|
||||
expect(mockSleep).toHaveBeenCalledTimes(1);
|
||||
expect(mockFetch).toHaveBeenCalledWith(
|
||||
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1/react-native-artifacts-0.78.1.pom',
|
||||
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -67,7 +67,7 @@ describe('#verifyArtifactsAreOnMaven', () => {
|
||||
|
||||
expect(mockSleep).toHaveBeenCalledTimes(0);
|
||||
expect(mockFetch).toHaveBeenCalledWith(
|
||||
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1/react-native-artifacts-0.78.1.pom',
|
||||
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -81,7 +81,7 @@ describe('#verifyArtifactsAreOnMaven', () => {
|
||||
expect(mockSleep).toHaveBeenCalledTimes(90);
|
||||
expect(mockExit).toHaveBeenCalledWith(1);
|
||||
expect(mockFetch).toHaveBeenCalledWith(
|
||||
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1/react-native-artifacts-0.78.1.pom',
|
||||
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -95,6 +95,12 @@ module.exports = async (github, context, labelWithContext) => {
|
||||
);
|
||||
await requestAuthorFeedback();
|
||||
return;
|
||||
case 'Newer Patch Available':
|
||||
await addComment(
|
||||
`> [!TIP]\n` +
|
||||
`> **Newer version available**: You are on a supported minor version, but it looks like there's a newer patch available - ${labelWithContext.newestPatch}. Please [upgrade](https://reactnative.dev/docs/upgrading) to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.`,
|
||||
);
|
||||
return;
|
||||
case 'Needs: Version Info':
|
||||
await addComment(
|
||||
`> [!WARNING]\n` +
|
||||
|
||||
@@ -4,16 +4,12 @@
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
export GITHUB_OWNER=-facebook
|
||||
export GITHUB_REPO=-react-native
|
||||
GITHUB_OWNER=-facebook
|
||||
GITHUB_REPO=-react-native
|
||||
export GITHUB_OWNER
|
||||
export GITHUB_REPO
|
||||
|
||||
{
|
||||
echo eslint
|
||||
npm run lint --silent -- --format=json
|
||||
|
||||
echo flow
|
||||
npm run flow-check --silent --json
|
||||
} | node private/react-native-bots/code-analysis-bot.js
|
||||
cat <(echo eslint; npm run lint --silent -- --format=json; echo flow; npm run flow-check --silent --json; echo google-java-format; node scripts/lint-java.js --diff) | node packages/react-native-bots/code-analysis-bot.js
|
||||
|
||||
STATUS=$?
|
||||
if [ $STATUS == 0 ]; then
|
||||
@@ -21,4 +17,3 @@ if [ $STATUS == 0 ]; then
|
||||
else
|
||||
echo "Code analysis failed, error status $STATUS."
|
||||
fi
|
||||
exit $STATUS
|
||||
|
||||
@@ -13,14 +13,13 @@ const SLEEP_S = 60; // 1 minute
|
||||
const MAX_RETRIES = 90; // 90 attempts. Waiting between attempt: 1 min. Total time: 90 min.
|
||||
const ARTIFACT_URL =
|
||||
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/';
|
||||
const ARTIFACT_NAME = 'react-native-artifacts-';
|
||||
|
||||
async function verifyArtifactsAreOnMaven(version, retries = MAX_RETRIES) {
|
||||
if (version.startsWith('v')) {
|
||||
version = version.substring(1);
|
||||
}
|
||||
|
||||
const artifactUrl = `${ARTIFACT_URL}${version}/${ARTIFACT_NAME}${version}.pom`;
|
||||
const artifactUrl = `${ARTIFACT_URL}${version}`;
|
||||
for (let currentAttempt = 1; currentAttempt <= retries; currentAttempt++) {
|
||||
const response = await fetch(artifactUrl);
|
||||
|
||||
|
||||
@@ -45,6 +45,18 @@ module.exports = async (github, context) => {
|
||||
if (!isVersionSupported(issueVersion, latestVersion)) {
|
||||
return {label: 'Type: Unsupported Version'};
|
||||
}
|
||||
|
||||
// We want to encourage users to repro the issue on the highest available patch for the given minor.
|
||||
const latestPatchForVersion = getLatestPatchForVersion(
|
||||
issueVersion,
|
||||
recentReleases,
|
||||
);
|
||||
if (latestPatchForVersion > issueVersion.patch) {
|
||||
return {
|
||||
label: 'Newer Patch Available',
|
||||
newestPatch: `${issueVersion.major}.${issueVersion.minor}.${latestPatchForVersion}`,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -75,6 +87,22 @@ function isVersionTooOld(actualVersion, latestVersion) {
|
||||
);
|
||||
}
|
||||
|
||||
// Assumes that releases are sorted in the order of recency (i.e. most recent releases are earlier in the list)
|
||||
// This enables us to stop looking as soon as we find the first release with a matching major/minor version, since
|
||||
// we know it's the most recent release, therefore the highest patch available.
|
||||
function getLatestPatchForVersion(version, releases) {
|
||||
for (releaseName of releases) {
|
||||
const release = parseVersionFromString(releaseName);
|
||||
if (
|
||||
release &&
|
||||
release.major == version.major &&
|
||||
release.minor == version.minor
|
||||
) {
|
||||
return release.patch;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getReactNativeVersionFromIssueBodyIfExists(issue) {
|
||||
if (!issue || !issue.body) return;
|
||||
const rnVersionRegex = /React Native Version[\r\n]+(?<version>.+)[\r\n]*/;
|
||||
|
||||
@@ -10,6 +10,7 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
|
||||
fetch-depth: 0
|
||||
fetch-tags: true
|
||||
- name: Install dependencies
|
||||
@@ -18,10 +19,6 @@ jobs:
|
||||
run: |
|
||||
git config --local user.email "bot@reactnative.dev"
|
||||
git config --local user.name "React Native Bot"
|
||||
- name: Setup xcode
|
||||
uses: ./.github/actions/setup-xcode
|
||||
with:
|
||||
xcode-version: '16.2.0'
|
||||
- name: Extract branch name
|
||||
run: |
|
||||
TAG="${{ github.ref_name }}";
|
||||
|
||||
@@ -14,7 +14,7 @@ jobs:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup Node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Use Node.js 18
|
||||
uses: actions/setup-node@v4
|
||||
- name: Trim the cache
|
||||
run: node scripts/clean-gha-cache.js
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# This jobs runs every day 2 hours after the nightly job and its purpose is to report
|
||||
# a failure in case the nightly failed to be published. We are going to hook this to an internal automation.
|
||||
name: Check Nightlies
|
||||
name: Check Nigthlies
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
@@ -18,14 +18,10 @@ jobs:
|
||||
if: github.repository == 'facebook/react-native'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup Node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Run yarn install
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Run diff-js-api-breaking-changes
|
||||
uses: ./.github/actions/diff-js-api-breaking-changes
|
||||
- name: Danger
|
||||
run: yarn danger ci --use-github-checks --failOnErrors
|
||||
working-directory: private/react-native-bots
|
||||
working-directory: packages/react-native-bots
|
||||
env:
|
||||
DANGER_GITHUB_API_TOKEN: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
|
||||
|
||||
@@ -10,6 +10,7 @@ jobs:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
|
||||
fetch-depth: 0
|
||||
fetch-tags: true
|
||||
- name: Install dependencies
|
||||
@@ -22,6 +23,7 @@ jobs:
|
||||
- name: Generate Changelog
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
|
||||
script: |
|
||||
const {generateChangelog} = require('./.github/workflow-scripts/generateChangelog');
|
||||
const version = '${{ github.ref_name }}';
|
||||
|
||||
@@ -17,7 +17,9 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up Node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
- name: Install dependencies
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Extract next oncall
|
||||
|
||||
@@ -101,14 +101,9 @@ jobs:
|
||||
flavor: ${{ matrix.flavor }}
|
||||
|
||||
prebuild_apple_dependencies:
|
||||
uses: ./.github/workflows/prebuild-ios-dependencies.yml
|
||||
uses: ./.github/workflows/prebuild-ios.yml
|
||||
secrets: inherit
|
||||
|
||||
prebuild_react_native_core:
|
||||
uses: ./.github/workflows/prebuild-ios-core.yml
|
||||
secrets: inherit
|
||||
needs: [prebuild_apple_dependencies, build_hermes_macos]
|
||||
|
||||
build_hermesc_linux:
|
||||
runs-on: ubuntu-latest
|
||||
needs: prepare_hermes_workspace
|
||||
@@ -175,7 +170,6 @@ jobs:
|
||||
build_hermesc_windows,
|
||||
build_android,
|
||||
prebuild_apple_dependencies,
|
||||
prebuild_react_native_core,
|
||||
]
|
||||
container:
|
||||
image: reactnativecommunity/react-native-android:latest
|
||||
|
||||
@@ -1,212 +0,0 @@
|
||||
name: Prebuild iOS Dependencies
|
||||
|
||||
on:
|
||||
workflow_call: # this directive allow us to call this workflow from other workflows
|
||||
|
||||
|
||||
jobs:
|
||||
build-rn-slice:
|
||||
runs-on: macos-14
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
flavor: ['Debug', 'Release']
|
||||
slice: [
|
||||
'ios',
|
||||
'ios-simulator',
|
||||
'mac-catalyst',
|
||||
]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Restore cache if present
|
||||
id: restore-ios-slice
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/setup.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
|
||||
path: packages/react-native/
|
||||
- name: Setup node.js
|
||||
if: steps.restore-ios-slice.outputs.cache-hit != 'true'
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Setup xcode
|
||||
if: steps.restore-ios-slice.outputs.cache-hit != 'true'
|
||||
uses: ./.github/actions/setup-xcode
|
||||
with:
|
||||
xcode-version: '16.2.0'
|
||||
- name: Yarn Install
|
||||
if: steps.restore-ios-slice.outputs.cache-hit != 'true'
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Download Hermes
|
||||
if: steps.restore-ios-slice.outputs.cache-hit != 'true'
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermes-darwin-bin-${{ matrix.flavor }}
|
||||
path: /tmp/hermes/hermes-runtime-darwin
|
||||
- name: Extract Hermes
|
||||
if: steps.restore-ios-slice.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
HERMES_TARBALL_ARTIFACTS_DIR=/tmp/hermes/hermes-runtime-darwin
|
||||
if [ ! -d $HERMES_TARBALL_ARTIFACTS_DIR ]; then
|
||||
echo "Hermes tarball artifacts dir not present ($HERMES_TARBALL_ARTIFACTS_DIR)."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
TARBALL_FILENAME=$(node ./packages/react-native/scripts/hermes/get-tarball-name.js --buildType "${{ matrix.flavor }}")
|
||||
TARBALL_PATH=$HERMES_TARBALL_ARTIFACTS_DIR/$TARBALL_FILENAME
|
||||
|
||||
echo "Looking for $TARBALL_FILENAME in $HERMES_TARBALL_ARTIFACTS_DIR"
|
||||
echo "$TARBALL_PATH"
|
||||
|
||||
if [ ! -f $TARBALL_PATH ]; then
|
||||
echo "Hermes tarball not present ($TARBALL_PATH). Build Hermes from source."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Found Hermes tarball at $TARBALL_PATH"
|
||||
echo "HERMES_ENGINE_TARBALL_PATH=$TARBALL_PATH" >> $GITHUB_ENV
|
||||
- name: Download ReactNativeDependencies
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ReactNativeDependencies${{ matrix.flavor }}.xcframework.tar.gz
|
||||
path: /tmp/third-party/
|
||||
- name: Extract ReactNativeDependencies
|
||||
if: steps.restore-ios-slice.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
# Extract ReactNativeDependencies
|
||||
tar -xzf /tmp/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework.tar.gz -C /tmp/third-party/
|
||||
|
||||
# Create destination folder
|
||||
mkdir -p packages/react-native/third-party/
|
||||
|
||||
# Move the XCFramework in the destination directory
|
||||
mv /tmp/third-party/packages/react-native/third-party/ReactNativeDependencies.xcframework packages/react-native/third-party/ReactNativeDependencies.xcframework
|
||||
|
||||
VERSION=$(jq -r '.version' packages/react-native/package.json)
|
||||
echo "$VERSION-${{matrix.flavor}}" > "packages/react-native/third-party/version.txt"
|
||||
cat "packages/react-native/third-party/version.txt"
|
||||
# Check destination directory
|
||||
ls -lR packages/react-native/third-party/
|
||||
- name: Setup the workspace
|
||||
if: steps.restore-ios-slice.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
cd packages/react-native
|
||||
node scripts/ios-prebuild.js -s -f "${{ matrix.flavor }}"
|
||||
- name: Build React Native
|
||||
if: steps.restore-ios-slice.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
# This is going to be replaced by a CLI script
|
||||
cd packages/react-native
|
||||
node scripts/ios-prebuild -b -f "${{ matrix.flavor }}" -p "${{ matrix.slice }}"
|
||||
- name: Upload headers
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: prebuild-ios-core-headers-${{ matrix.flavor }}-${{ matrix.slice }}
|
||||
path:
|
||||
packages/react-native/.build/headers
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: prebuild-ios-core-slice-${{ matrix.flavor }}-${{ matrix.slice }}
|
||||
path: |
|
||||
packages/react-native/.build/output/spm/${{ matrix.flavor }}/Build/Products
|
||||
- name: Save Cache
|
||||
uses: actions/cache/save@v4
|
||||
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode
|
||||
with:
|
||||
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/setup.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
|
||||
path: |
|
||||
packages/react-native/.build/output/spm/${{ matrix.flavor }}/Build/Products
|
||||
packages/react-native/.build/headers
|
||||
|
||||
compose-xcframework:
|
||||
runs-on: macos-14
|
||||
needs: [build-rn-slice]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
flavor: ['Debug', 'Release']
|
||||
env:
|
||||
REACT_ORG_CODE_SIGNING_P12_CERT: ${{ secrets.REACT_ORG_CODE_SIGNING_P12_CERT }}
|
||||
REACT_ORG_CODE_SIGNING_P12_CERT_PWD: ${{ secrets.REACT_ORG_CODE_SIGNING_P12_CERT_PWD }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Restore cache if present
|
||||
id: restore-ios-xcframework
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: packages/react-native/.build/output/xcframeworks
|
||||
key: v2-ios-core-xcframework-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/setup.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
|
||||
- name: Setup node.js
|
||||
if: steps.restore-ios-xcframework.outputs.cache-hit != 'true'
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Setup xcode
|
||||
if: steps.restore-ios-xcframework.outputs.cache-hit != 'true'
|
||||
uses: ./.github/actions/setup-xcode
|
||||
with:
|
||||
xcode-version: '16.2.0'
|
||||
- name: Yarn Install
|
||||
if: steps.restore-ios-xcframework.outputs.cache-hit != 'true'
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Download slice artifacts
|
||||
if: steps.restore-ios-xcframework.outputs.cache-hit != 'true'
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
pattern: prebuild-ios-core-slice-${{ matrix.flavor }}-*
|
||||
path: packages/react-native/.build/output/spm/${{ matrix.flavor }}/Build/Products
|
||||
merge-multiple: true
|
||||
- name: Download headers
|
||||
if: steps.restore-ios-xcframework.outputs.cache-hit != 'true'
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
pattern: prebuild-ios-core-headers-${{ matrix.flavor }}-*
|
||||
path: packages/react-native/.build/headers
|
||||
merge-multiple: true
|
||||
- name: Setup Keychain
|
||||
if: ${{ steps.restore-ios-xcframework.outputs.cache-hit != 'true' && env.REACT_ORG_CODE_SIGNING_P12_CERT != '' }}
|
||||
uses: apple-actions/import-codesign-certs@v3 # https://github.com/marketplace/actions/import-code-signing-certificates
|
||||
with:
|
||||
p12-file-base64: ${{ secrets.REACT_ORG_CODE_SIGNING_P12_CERT }}
|
||||
p12-password: ${{ secrets.REACT_ORG_CODE_SIGNING_P12_CERT_PWD }}
|
||||
- name: Create XCFramework
|
||||
if: ${{ steps.restore-ios-xcframework.outputs.cache-hit != 'true' && env.REACT_ORG_CODE_SIGNING_P12_CERT == '' }}
|
||||
run: |
|
||||
cd packages/react-native
|
||||
node scripts/ios-prebuild -c -f "${{ matrix.flavor }}"
|
||||
- name: Create and Sign XCFramework
|
||||
if: ${{ steps.restore-ios-xcframework.outputs.cache-hit != 'true' && env.REACT_ORG_CODE_SIGNING_P12_CERT != '' }}
|
||||
run: |
|
||||
cd packages/react-native
|
||||
node scripts/ios-prebuild -c -f "${{ matrix.flavor }}" -i "React Org"
|
||||
- name: Compress and Rename XCFramework
|
||||
if: steps.restore-ios-xcframework.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cd packages/react-native/.build/output/xcframeworks/${{matrix.flavor}}
|
||||
tar -cz -f ../ReactCore${{matrix.flavor}}.xcframework.tar.gz React.xcframework
|
||||
- name: Compress and Rename dSYM
|
||||
if: steps.restore-ios-xcframework.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cd packages/react-native/.build/output/xcframeworks/${{matrix.flavor}}/Symbols
|
||||
tar -cz -f ../../ReactCore${{ matrix.flavor }}.framework.dSYM.tar.gz .
|
||||
- name: Upload XCFramework Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ReactCore${{ matrix.flavor }}.xcframework.tar.gz
|
||||
path: packages/react-native/.build/output/xcframeworks/ReactCore${{matrix.flavor}}.xcframework.tar.gz
|
||||
- name: Upload dSYM Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ReactCore${{ matrix.flavor }}.framework.dSYM.tar.gz
|
||||
path: packages/react-native/.build/output/xcframeworks/ReactCore${{matrix.flavor}}.framework.dSYM.tar.gz
|
||||
- name: Save cache if present
|
||||
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: |
|
||||
packages/react-native/.build/output/xcframeworks/ReactCore${{matrix.flavor}}.xcframework.tar.gz
|
||||
packages/react-native/.build/output/xcframeworks/ReactCore${{matrix.flavor}}.framework.dSYM.tar.gz
|
||||
key: v2-ios-core-xcframework-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/setup.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
name: Prebuild iOS Dependencies
|
||||
name: Prebuild iOS
|
||||
|
||||
on:
|
||||
workflow_call: # this directive allow us to call this workflow from other workflows
|
||||
@@ -21,7 +21,7 @@ jobs:
|
||||
- name: Build packages
|
||||
run: yarn build
|
||||
- name: Build types
|
||||
run: yarn build-types --skip-snapshot
|
||||
run: yarn build-types
|
||||
- name: Set NPM auth token
|
||||
run: echo "//registry.npmjs.org/:_authToken=$GHA_NPM_TOKEN" > ~/.npmrc
|
||||
- name: Find and publish all bumped packages
|
||||
|
||||
@@ -96,16 +96,10 @@ jobs:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
flavor: ${{ matrix.flavor }}
|
||||
|
||||
prebuild_apple_dependencies:
|
||||
uses: ./.github/workflows/prebuild-ios-dependencies.yml
|
||||
uses: ./.github/workflows/prebuild-ios.yml
|
||||
secrets: inherit
|
||||
|
||||
prebuild_react_native_core:
|
||||
uses: ./.github/workflows/prebuild-ios-core.yml
|
||||
secrets: inherit
|
||||
needs: [prebuild_apple_dependencies, build_hermes_macos]
|
||||
|
||||
build_hermesc_linux:
|
||||
runs-on: ubuntu-latest
|
||||
needs: prepare_hermes_workspace
|
||||
@@ -150,7 +144,6 @@ jobs:
|
||||
build_hermesc_linux,
|
||||
build_hermesc_windows,
|
||||
prebuild_apple_dependencies,
|
||||
prebuild_react_native_core,
|
||||
]
|
||||
container:
|
||||
image: reactnativecommunity/react-native-android:latest
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
name: Retry workflow
|
||||
# Based on https://stackoverflow.com/a/78314483
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
run_id:
|
||||
required: true
|
||||
jobs:
|
||||
rerun:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: rerun ${{ inputs.run_id }}
|
||||
env:
|
||||
GH_REPO: ${{ github.repository }}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
gh run watch ${{ inputs.run_id }} > /dev/null 2>&1
|
||||
gh run rerun ${{ inputs.run_id }} --failed
|
||||
@@ -14,8 +14,8 @@ jobs:
|
||||
with:
|
||||
repo-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
|
||||
days-before-stale: 180
|
||||
stale-issue-message: 'This issue is stale because it has been open for 180 days with no activity. It will be closed in 7 days unless you comment on it or remove the "Stale" label.'
|
||||
stale-pr-message: 'This PR is stale because it has been open for 180 days with no activity. It will be closed in 7 days unless you comment on it or remove the "Stale" label.'
|
||||
stale-issue-message: 'This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
|
||||
stale-pr-message: 'This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
|
||||
close-issue-message: 'This issue was closed because it has been stalled for 7 days with no activity.'
|
||||
close-pr-message: 'This PR was closed because it has been stalled for 7 days with no activity.'
|
||||
exempt-issue-labels: 'Help Wanted :octocat:, Good first issue, Never gets stale, Issue: Author Provided Repro'
|
||||
|
||||
@@ -117,18 +117,13 @@ jobs:
|
||||
flavor: ${{ matrix.flavor }}
|
||||
|
||||
prebuild_apple_dependencies:
|
||||
uses: ./.github/workflows/prebuild-ios-dependencies.yml
|
||||
uses: ./.github/workflows/prebuild-ios.yml
|
||||
secrets: inherit
|
||||
|
||||
prebuild_react_native_core:
|
||||
uses: ./.github/workflows/prebuild-ios-core.yml
|
||||
secrets: inherit
|
||||
needs: [prebuild_apple_dependencies, build_hermes_macos]
|
||||
|
||||
test_ios_rntester_ruby_3_2_0:
|
||||
runs-on: macos-14
|
||||
needs:
|
||||
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies, prebuild_react_native_core]
|
||||
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies]
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
|
||||
@@ -141,12 +136,11 @@ jobs:
|
||||
ruby-version: "3.2.0"
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
flavor: Debug
|
||||
|
||||
test_ios_rntester:
|
||||
runs-on: macos-14-large
|
||||
test_ios_rntester_dynamic_frameworks:
|
||||
runs-on: macos-14
|
||||
needs:
|
||||
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies, prebuild_react_native_core]
|
||||
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies]
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
|
||||
@@ -154,15 +148,49 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
flavor: [Debug, Release]
|
||||
frameworks: [StaticLibraries, DynamicFrameworks]
|
||||
jsengine: [Hermes, JSC]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Run it
|
||||
uses: ./.github/actions/test-ios-rntester
|
||||
with:
|
||||
use-frameworks: ${{ matrix.frameworks }}
|
||||
jsengine: ${{ matrix.jsengine }}
|
||||
use-frameworks: DynamicFrameworks
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
|
||||
test_ios_rntester:
|
||||
runs-on: macos-14-large
|
||||
needs:
|
||||
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies]
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
|
||||
continue-on-error: true
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
jsengine: [Hermes, JSC]
|
||||
architecture: [NewArch, OldArch]
|
||||
flavor: [Debug, Release]
|
||||
exclude: # We don't want to test the Old Arch in Release for E2E
|
||||
- jsengine: Hermes
|
||||
architecture: OldArch
|
||||
flavor: Release
|
||||
- jsengine: JSC
|
||||
architecture: OldArch
|
||||
flavor: Release
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Run it
|
||||
uses: ./.github/actions/test-ios-rntester
|
||||
with:
|
||||
jsengine: ${{ matrix.jsengine }}
|
||||
architecture: ${{ matrix.architecture }}
|
||||
run-unit-tests: "false"
|
||||
use-frameworks: StaticLibraries
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
flavor: ${{ matrix.flavor }}
|
||||
@@ -175,19 +203,20 @@ jobs:
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
|
||||
continue-on-error: true
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
jsengine: [Hermes, JSC]
|
||||
architecture: [NewArch]
|
||||
flavor: [Debug, Release]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Download App
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: RNTesterApp-NewArch-${{ matrix.flavor }}
|
||||
name: RNTesterApp-${{ matrix.architecture }}-${{ matrix.jsengine }}-${{ matrix.flavor }}
|
||||
path: /tmp/RNTesterBuild/RNTester.app
|
||||
- name: Check downloaded folder content
|
||||
run: ls -lR /tmp/RNTesterBuild
|
||||
@@ -198,6 +227,7 @@ jobs:
|
||||
with:
|
||||
app-path: "/tmp/RNTesterBuild/RNTester.app"
|
||||
app-id: com.meta.RNTester.localDevelopment
|
||||
jsengine: ${{ matrix.jsengine }}
|
||||
maestro-flow: ./packages/rn-tester/.maestro/
|
||||
flavor: ${{ matrix.flavor }}
|
||||
|
||||
@@ -208,10 +238,13 @@ jobs:
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
|
||||
continue-on-error: true
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
jsengine: [Hermes, JSC]
|
||||
flavor: [Debug, Release]
|
||||
architecture: [OldArch, NewArch]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
@@ -245,14 +278,6 @@ jobs:
|
||||
- name: Print third-party folder
|
||||
shell: bash
|
||||
run: ls -lR /tmp/third-party
|
||||
- name: Download React Native Prebuilds
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ReactCore${{ matrix.flavor }}.xcframework.tar.gz
|
||||
path: /tmp/ReactCore
|
||||
- name: Print ReactCore folder
|
||||
shell: bash
|
||||
run: ls -lR /tmp/ReactCore
|
||||
- name: Prepare artifacts
|
||||
run: |
|
||||
REACT_NATIVE_PKG=$(find /tmp/react-native-tmp -type f -name "*.tgz")
|
||||
@@ -273,9 +298,12 @@ jobs:
|
||||
cd /tmp/RNTestProject/ios
|
||||
bundle install
|
||||
NEW_ARCH_ENABLED=1
|
||||
if [[ ${{ matrix.architecture }} == "OldArch" ]]; then
|
||||
echo "Disable the New Architecture"
|
||||
NEW_ARCH_ENABLED=0
|
||||
fi
|
||||
|
||||
export RCT_USE_LOCAL_RN_DEP=/tmp/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework.tar.gz
|
||||
export RCT_TESTONLY_RNCORE_TARBALL_PATH="/tmp/ReactCore/ReactCore${{ matrix.flavor }}.xcframework.tar.gz"
|
||||
HERMES_ENGINE_TARBALL_PATH=$HERMES_PATH RCT_NEW_ARCH_ENABLED=$NEW_ARCH_ENABLED bundle exec pod install
|
||||
|
||||
xcodebuild \
|
||||
@@ -290,18 +318,23 @@ jobs:
|
||||
with:
|
||||
app-path: "/tmp/RNTestProject/Build/Products/${{ matrix.flavor }}-iphonesimulator/RNTestProject.app"
|
||||
app-id: org.reactjs.native.example.RNTestProject
|
||||
jsengine: ${{ matrix.jsengine }}
|
||||
maestro-flow: ./scripts/e2e/.maestro/
|
||||
flavor: ${{ matrix.flavor }}
|
||||
working-directory: /tmp/RNTestProject
|
||||
architecture: ${{ matrix.architecture }}
|
||||
|
||||
test_e2e_android_templateapp:
|
||||
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
|
||||
runs-on: 4-core-ubuntu
|
||||
needs: build_npm_package
|
||||
continue-on-error: true
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
jsengine: [Hermes, JSC]
|
||||
flavor: [debug, release]
|
||||
architecture: [OldArch, NewArch]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
@@ -347,6 +380,16 @@ jobs:
|
||||
cd /tmp/RNTestProject
|
||||
echo "react.internal.mavenLocalRepo=$MAVEN_LOCAL" >> android/gradle.properties
|
||||
|
||||
if [[ ${{matrix.architecture}} == "OldArch" ]]; then
|
||||
echo "Disabling the New Architecture"
|
||||
sed -i 's/newArchEnabled=true/newArchEnabled=false/' android/gradle.properties
|
||||
fi
|
||||
|
||||
if [[ ${{matrix.jsengine}} == "JSC" ]]; then
|
||||
echo "Using JSC instead of Hermes"
|
||||
sed -i 's/hermesEnabled=true/hermesEnabled=false/' android/gradle.properties
|
||||
fi
|
||||
|
||||
# Build
|
||||
cd android
|
||||
CAPITALIZED_FLAVOR=$(echo "${{ matrix.flavor }}" | awk '{print toupper(substr($0, 1, 1)) substr($0, 2)}')
|
||||
@@ -358,10 +401,12 @@ jobs:
|
||||
with:
|
||||
app-path: /tmp/RNTestProject/android/app/build/outputs/apk/${{ matrix.flavor }}/app-${{ matrix.flavor }}.apk
|
||||
app-id: com.rntestproject
|
||||
jsengine: ${{ matrix.jsengine }}
|
||||
maestro-flow: ./scripts/e2e/.maestro/
|
||||
install-java: 'false'
|
||||
flavor: ${{ matrix.flavor }}
|
||||
working-directory: /tmp/RNTestProject
|
||||
architecture: ${{ matrix.architecture }}
|
||||
|
||||
build_hermesc_linux:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -424,6 +469,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
jsengine: [hermes, jsc]
|
||||
flavor: [debug, release]
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -435,16 +481,17 @@ jobs:
|
||||
- name: Download APK
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: rntester-${{ matrix.flavor }}
|
||||
path: ./packages/rn-tester/android/app/build/outputs/apk/${{ matrix.flavor }}/
|
||||
name: rntester-${{ matrix.jsengine }}-${{ matrix.flavor }}
|
||||
path: ./packages/rn-tester/android/app/build/outputs/apk/${{ matrix.jsengine }}/${{ matrix.flavor }}/
|
||||
- name: Print folder structure
|
||||
run: ls -lR ./packages/rn-tester/android/app/build/outputs/apk/${{ matrix.flavor }}/
|
||||
run: ls -lR ./packages/rn-tester/android/app/build/outputs/apk/${{ matrix.jsengine }}/${{ matrix.flavor }}/
|
||||
- name: Run E2E Tests
|
||||
uses: ./.github/actions/maestro-android
|
||||
timeout-minutes: 60
|
||||
with:
|
||||
app-path: ./packages/rn-tester/android/app/build/outputs/apk/${{ matrix.flavor }}/app-x86-${{ matrix.flavor }}.apk
|
||||
app-path: ./packages/rn-tester/android/app/build/outputs/apk/${{ matrix.jsengine }}/${{ matrix.flavor }}/app-${{ matrix.jsengine }}-x86-${{ matrix.flavor }}.apk
|
||||
app-id: com.facebook.react.uiapp
|
||||
jsengine: ${{ matrix.jsengine }}
|
||||
maestro-flow: ./packages/rn-tester/.maestro
|
||||
flavor: ${{ matrix.flavor }}
|
||||
|
||||
@@ -459,7 +506,6 @@ jobs:
|
||||
build_hermesc_windows,
|
||||
build_android,
|
||||
prebuild_apple_dependencies,
|
||||
prebuild_react_native_core,
|
||||
]
|
||||
container:
|
||||
image: reactnativecommunity/react-native-android:latest
|
||||
@@ -496,6 +542,8 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
flavor: [Debug, Release]
|
||||
architecture: [NewArch, OldArch]
|
||||
jsengine: [Hermes, JSC]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
@@ -520,11 +568,17 @@ jobs:
|
||||
- name: Prepare the Helloworld application
|
||||
shell: bash
|
||||
run: node ./scripts/e2e/init-project-e2e.js --useHelloWorld --pathToLocalReactNative "$GITHUB_WORKSPACE/build/$(cat build/react-native-package-version)"
|
||||
- name: Build the Helloworld application for ${{ matrix.flavor }} with Architecture set to New Architecture.
|
||||
- name: Build the Helloworld application for ${{ matrix.flavor }} with Architecture set to ${{ matrix.architecture }}, and using the ${{ matrix.jsengine }} JS engine.
|
||||
shell: bash
|
||||
run: |
|
||||
cd private/helloworld/android
|
||||
cd packages/helloworld/android
|
||||
args=()
|
||||
if [[ ${{ matrix.architecture }} == "OldArch" ]]; then
|
||||
args+=(--arch old)
|
||||
fi
|
||||
if [[ ${{ matrix.jsengine }} == "JSC" ]]; then
|
||||
args+=(--jsvm jsc)
|
||||
fi
|
||||
if [[ ${{ matrix.flavor }} == "Release" ]]; then
|
||||
args+=(--prod)
|
||||
fi
|
||||
@@ -532,13 +586,13 @@ jobs:
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: helloworld-apk-${{ matrix.flavor }}-NewArch-hermes
|
||||
path: ./private/helloworld/android/app/build/outputs/apk/
|
||||
name: helloworld-apk-${{ matrix.flavor }}-${{ matrix.architecture }}-${{ matrix.jsengine }}
|
||||
path: ./packages/helloworld/android/app/build/outputs/apk/
|
||||
compression-level: 0
|
||||
|
||||
test_ios_helloworld_with_ruby_3_2_0:
|
||||
runs-on: macos-14
|
||||
needs: [prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies, prebuild_react_native_core] # prepare_hermes_workspace must be there because we need its reference to retrieve a couple of outputs
|
||||
needs: [prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies] # prepare_hermes_workspace must be there because we need its reference to retrieve a couple of outputs
|
||||
env:
|
||||
PROJECT_NAME: iOSTemplateProject
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
@@ -549,20 +603,23 @@ jobs:
|
||||
- uses: ./.github/actions/test-ios-helloworld
|
||||
with:
|
||||
ruby-version: 3.2.0
|
||||
architecture: NewArch
|
||||
flavor: Debug
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
|
||||
test_ios_helloworld:
|
||||
runs-on: macos-14
|
||||
needs: [prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies, prebuild_react_native_core] # prepare_hermes_workspace must be there because we need its reference to retrieve a couple of outputs
|
||||
needs: [prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies] # prepare_hermes_workspace must be there because we need its reference to retrieve a couple of outputs
|
||||
strategy:
|
||||
matrix:
|
||||
flavor: [Debug, Release]
|
||||
jsengine: [Hermes, JSC]
|
||||
use_frameworks: [StaticLibraries, DynamicFrameworks]
|
||||
exclude:
|
||||
# This config is tested with Ruby 3.2.0. Let's not double test it.
|
||||
- flavor: Debug
|
||||
jsengine: Hermes
|
||||
use_frameworks: StaticLibraries
|
||||
env:
|
||||
PROJECT_NAME: iOSTemplateProject
|
||||
@@ -574,6 +631,7 @@ jobs:
|
||||
- uses: ./.github/actions/test-ios-helloworld
|
||||
with:
|
||||
flavor: ${{ matrix.flavor }}
|
||||
jsengine: ${{ matrix.jsengine }}
|
||||
use-frameworks: ${{ matrix.use_frameworks }}
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
@@ -583,7 +641,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node-version: ["24", "22", "20"]
|
||||
node-version: ["22", "20", "18"]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
@@ -599,47 +657,7 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Run all the linters
|
||||
- name: Run all the Linters
|
||||
uses: ./.github/actions/lint
|
||||
with:
|
||||
github-token: ${{ env.GH_TOKEN }}
|
||||
|
||||
# This job should help with the E2E flakyness.
|
||||
# In case E2E tests fails, it launches a new retry-workflow workflow, passing the current run_id as input.
|
||||
# The retry-workflow reruns only the failed jobs of the current test-all workflow using
|
||||
# ```
|
||||
# gh run rerun ${{ inputs.run_id }} --failed
|
||||
# ```
|
||||
# From https://stackoverflow.com/a/78314483 it seems like that adding the extra workflow
|
||||
# rather then calling directly this command should improve stability of this solution.
|
||||
# This is exactly the same as rerunning failed tests from the GH UI, but automated.
|
||||
rerun-failed-jobs:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [test_e2e_ios_rntester, test_e2e_android_rntester, test_e2e_ios_templateapp, test_e2e_android_templateapp]
|
||||
if: always()
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Rerun failed jobs in the current workflow
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
SHOULD_RETRY=${{fromJSON(github.run_attempt) < 3}}
|
||||
if [[ $SHOULD_RETRY == "false" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
RNTESTER_ANDROID_FAILED=${{ needs.test_e2e_android_rntester.result == 'failure' }}
|
||||
TEMPLATE_ANDROID_FAILED=${{ needs.test_e2e_android_templateapp.result == 'failure' }}
|
||||
RNTESTER_IOS_FAILED=${{ needs.test_e2e_ios_rntester.result == 'failure' }}
|
||||
TEMPLATE_IOS_FAILED=${{ needs.test_e2e_ios_templateapp.result == 'failure' }}
|
||||
|
||||
echo "RNTESTER_ANDROID_FAILED: $RNTESTER_ANDROID_FAILED"
|
||||
echo "TEMPLATE_ANDROID_FAILED: $TEMPLATE_ANDROID_FAILED"
|
||||
echo "RNTESTER_IOS_FAILED: $RNTESTER_IOS_FAILED"
|
||||
echo "TEMPLATE_IOS_FAILED: $TEMPLATE_IOS_FAILED"
|
||||
|
||||
if [[ $RNTESTER_ANDROID_FAILED == "true" || $TEMPLATE_ANDROID_FAILED == "true" || $RNTESTER_IOS_FAILED == "true" || $TEMPLATE_IOS_FAILED == "true" ]]; then
|
||||
echo "Rerunning failed jobs in the current workflow"
|
||||
gh workflow run retry-workflow.yml -F run_id=${{ github.run_id }}
|
||||
fi
|
||||
|
||||
@@ -48,6 +48,7 @@ jobs:
|
||||
"react-native-contacts",
|
||||
"react-native-device-info",
|
||||
"react-native-email-link",
|
||||
"react-native-exit-app",
|
||||
"@dr.pogodin/react-native-fs",
|
||||
"react-native-permissions",
|
||||
"react-native-vector-icons",
|
||||
@@ -58,8 +59,6 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up Node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Test ${{ matrix.library }}
|
||||
id: run-test
|
||||
uses: ./.github/actions/test-library-on-nightly
|
||||
|
||||
+10
-23
@@ -30,7 +30,6 @@ project.xcworkspace
|
||||
/packages/rn-tester/android/app/gradle/
|
||||
/packages/rn-tester/android/app/gradlew
|
||||
/packages/rn-tester/android/app/gradlew.bat
|
||||
/packages/react-native/build/
|
||||
/packages/react-native/ReactAndroid/build/
|
||||
/packages/react-native/ReactAndroid/.cxx/
|
||||
/packages/react-native/ReactAndroid/gradle/
|
||||
@@ -40,8 +39,8 @@ project.xcworkspace
|
||||
/packages/react-native/ReactAndroid/external-artifacts/artifacts/
|
||||
/packages/react-native/ReactAndroid/hermes-engine/build/
|
||||
/packages/react-native/ReactAndroid/hermes-engine/.cxx/
|
||||
/private/helloworld/android/app/build/
|
||||
/private/helloworld/android/build/
|
||||
/packages/helloworld/android/app/build/
|
||||
/packages/helloworld/android/build/
|
||||
/packages/react-native-popup-menu-android/android/build/
|
||||
/packages/react-native-test-library/android/build/
|
||||
|
||||
@@ -108,42 +107,33 @@ package-lock.json
|
||||
|
||||
# Ruby Gems (Bundler)
|
||||
/packages/react-native/vendor
|
||||
/private/helloworld/vendor
|
||||
/packages/helloworld/vendor
|
||||
.ruby-version
|
||||
/**/.ruby-version
|
||||
vendor/
|
||||
|
||||
# iOS / CocoaPods
|
||||
/private/helloworld/ios/build/
|
||||
/private/helloworld/ios/Pods/
|
||||
/private/helloworld/ios/Podfile.lock
|
||||
/packages/rn-tester/bin/
|
||||
/packages/rn-tester/cache/
|
||||
/packages/rn-tester/extensions/
|
||||
/packages/rn-tester/gems/
|
||||
/packages/rn-tester/specifications/
|
||||
/packages/helloworld/ios/build/
|
||||
/packages/helloworld/ios/Pods/
|
||||
/packages/helloworld/ios/Podfile.lock
|
||||
/packages/rn-tester/Gemfile.lock
|
||||
/packages/**/RCTLegacyInteropComponents.mm
|
||||
/packages/sourcemap.ios.map
|
||||
|
||||
# Ignore RNTester specific Pods, but keep the __offline_mirrors__ here.
|
||||
/packages/rn-tester/Pods/*
|
||||
!/packages/rn-tester/Pods/__offline_mirrors_hermes__
|
||||
!/packages/rn-tester/Pods/__offline_mirrors_jsc__
|
||||
|
||||
# Swift Package build folder
|
||||
/packages/react-native/.build
|
||||
/packages/react-native/.swiftpm
|
||||
|
||||
# @react-native/codegen
|
||||
/packages/react-native/React/FBReactNativeSpec/
|
||||
/packages/react-native-codegen/lib
|
||||
/packages/react-native-codegen/tmp/
|
||||
/packages/react-native/ReactCommon/react/renderer/components/rncore/
|
||||
/packages/rn-tester/NativeModuleExample/ScreenshotManagerSpec*
|
||||
/**/RCTThirdPartyFabricComponentsProvider.*
|
||||
|
||||
# @react-native/codegen-typescript-test
|
||||
/private/react-native-codegen-typescript-test/lib
|
||||
/packages/react-native-codegen-typescript-test/lib
|
||||
|
||||
# Additional SDKs
|
||||
/packages/react-native/sdks/download
|
||||
@@ -170,11 +160,8 @@ fix_*.patch
|
||||
.metro-health-check*
|
||||
|
||||
# Jest Integration
|
||||
/private/react-native-fantom/build/
|
||||
/private/react-native-fantom/tester/build/
|
||||
/packages/react-native-fantom/build/
|
||||
/packages/react-native-fantom/tester/build/
|
||||
|
||||
# [Experimental] Generated TS type definitions
|
||||
/packages/**/types_generated/
|
||||
|
||||
/packages/debugger-shell/build/
|
||||
/packages/*/dist/
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
## Summary:
|
||||
This change fixes the script that updates the RN Version to also update the Codegen snapshots so that they are in sync with the current version of React Native.
|
||||
It also updates the Snapshot as it was failing in rc.0
|
||||
|
||||
## Changelog:
|
||||
[Internal] - Fixed script that updates the react native versions
|
||||
|
||||
## Test Plan:
|
||||
Tested locally by running `node ./scripts/releases/set-rn-artifacts-version --built-type release --to-version 0.80.0-rc.0` and verifying that the snapshot file was getting updated. I then run the `yarn test
|
||||
generate-artifacts-executor-test.js` command to verify that the tests were passing.
|
||||
-4902
File diff suppressed because it is too large
Load Diff
+4543
-1142
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -28,7 +28,7 @@ Examples of contributing to the release include being a [community releaser](htt
|
||||
|
||||
### Current partners:
|
||||
* **[Coinbase](https://www.coinbase.com/):** Publishes [posts](https://blog.coinbase.com/tagged/react-native) advocating React Native usage. Supports `@react-native-community/datetimepicker` and other community modules to migrate to the new architecture. Supports releases in testing and feedback.
|
||||
* **[Callstack](https://callstack.com/):** Maintains [React Native Community CLI](https://github.com/react-native-community/cli), develops [RNEF](https://rnef.dev), [Re.Pack](https://re-pack.dev) and [other community libraries](https://github.com/callstack). Hosts [React Universe Conf](https://www.reactuniverseconf.com/) and [React Universe On Air](https://www.callstack.com/podcast).
|
||||
* **[Callstack](https://callstack.com/):** Maintains the [React Native CLI](https://github.com/react-native-community/react-native-cli) and [other community libraries](https://github.com/callstack), organizes [React Native EU](https://react-native.eu/) and hosts [The React Native Show podcast](https://www.callstack.com/podcast-react-native-show)
|
||||
* **[Expo](https://expo.dev/):** Builds [Expo Go and SDK](https://github.com/expo/expo), [Snack](https://snack.expo.dev/), and [Expo Application Services](https://expo.dev/eas). Maintains [React Native Directory](https://reactnative.directory/), stewards [React Navigation](https://reactnavigation.org/) along with other partners.
|
||||
* **[Infinite Red](https://infinite.red/):** Maintains the [ignite cli/boilerplate](https://github.com/infinitered/ignite), organizes [Chain React Conf](https://cr.infinite.red/), hosts the [React Native Radio podcast](https://reactnativeradio.com), publishes the [React Native Newsletter](https://reactnativenewsletter.com)
|
||||
* **[Meta](https://opensource.fb.com/):** Oversees the React Native product and maintains the [React Native core repo](https://reactnative.dev/)
|
||||
|
||||
+1
-3
@@ -45,8 +45,6 @@ TODO: Explain the different components of React Native at a high level.
|
||||
- UI / Fabric
|
||||
- Events
|
||||
- Shadow Tree Lifecycle
|
||||
- [Runtime Shadow Node Reference Update](../packages/react-native/ReactCommon/react/renderer/core/__docs__/RSNRU.md)
|
||||
- [passChildrenWhenCloningPersistedNodes](../packages/react-native/ReactCommon/react/renderer/core/__docs__/passChildrenWhenCloning.md)
|
||||
- Layout
|
||||
- Mounting
|
||||
- Native Modules / TurboModules
|
||||
@@ -90,7 +88,7 @@ TODO: Explain the different components of React Native at a high level.
|
||||
- Jest
|
||||
- ESLint
|
||||
- Integration / E2E
|
||||
- [Fantom](../private/react-native-fantom/__docs__/README.md)
|
||||
- [Fantom](../packages/react-native-fantom/__docs__/README.md)
|
||||
- Tooling
|
||||
- React Native DevTools
|
||||
|
||||
|
||||
+1
-29
@@ -13,7 +13,6 @@ plugins {
|
||||
alias(libs.plugins.kotlin.android) apply false
|
||||
alias(libs.plugins.binary.compatibility.validator) apply true
|
||||
alias(libs.plugins.android.test) apply false
|
||||
alias(libs.plugins.ktfmt) apply true
|
||||
}
|
||||
|
||||
val reactAndroidProperties = java.util.Properties()
|
||||
@@ -125,36 +124,9 @@ if (project.findProperty("react.internal.useHermesNightly")?.toString()?.toBoole
|
||||
configurations.all {
|
||||
resolutionStrategy.dependencySubstitution {
|
||||
substitute(project(":packages:react-native:ReactAndroid:hermes-engine"))
|
||||
.using(module("com.facebook.react:hermes-android:0.+"))
|
||||
.using(module("com.facebook.react:hermes-android:0.0.0-+"))
|
||||
.because("Users opted to use hermes from nightly")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ktfmt {
|
||||
blockIndent.set(2)
|
||||
continuationIndent.set(4)
|
||||
maxWidth.set(100)
|
||||
removeUnusedImports.set(false)
|
||||
manageTrailingCommas.set(false)
|
||||
}
|
||||
|
||||
// Configure ktfmt tasks to include gradle-plugin
|
||||
listOf("ktfmtCheck", "ktfmtFormat").forEach { taskName ->
|
||||
tasks.named(taskName) { dependsOn(gradle.includedBuild("gradle-plugin").task(":$taskName")) }
|
||||
}
|
||||
|
||||
allprojects {
|
||||
// Apply exclusions for specific files that should not be formatted
|
||||
val excludePatterns =
|
||||
listOf(
|
||||
"**/build/**",
|
||||
"**/hermes-engine/**",
|
||||
"**/internal/featureflags/**",
|
||||
"**/systeminfo/ReactNativeVersion.kt")
|
||||
listOf(
|
||||
com.ncorti.ktfmt.gradle.tasks.KtfmtCheckTask::class,
|
||||
com.ncorti.ktfmt.gradle.tasks.KtfmtFormatTask::class)
|
||||
.forEach { tasks.withType(it) { exclude(excludePatterns) } }
|
||||
}
|
||||
|
||||
Vendored
+1
-68
@@ -4,8 +4,8 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
* @format
|
||||
* @oncall flow
|
||||
*/
|
||||
|
||||
// Adapted from https://github.com/flow-typed/flow-typed/blob/main/definitions/environments/node/flow_v0.261.x-/node.js
|
||||
@@ -3229,73 +3229,6 @@ declare module 'util' {
|
||||
isWebAssemblyCompiledModule: (value: mixed) => boolean,
|
||||
...
|
||||
};
|
||||
|
||||
declare type BackgroundColors =
|
||||
| 'bgBlack'
|
||||
| 'bgBlackBright'
|
||||
| 'bgBlue'
|
||||
| 'bgBlueBright'
|
||||
| 'bgCyan'
|
||||
| 'bgCyanBright'
|
||||
| 'bgGray'
|
||||
| 'bgGreen'
|
||||
| 'bgGreenBright'
|
||||
| 'bgGrey'
|
||||
| 'bgMagenta'
|
||||
| 'bgMagentaBright'
|
||||
| 'bgRed'
|
||||
| 'bgRedBright'
|
||||
| 'bgWhite'
|
||||
| 'bgWhiteBright'
|
||||
| 'bgYellow'
|
||||
| 'bgYellowBright';
|
||||
|
||||
declare type ForegroundColors =
|
||||
| 'black'
|
||||
| 'blackBright'
|
||||
| 'blue'
|
||||
| 'blueBright'
|
||||
| 'cyan'
|
||||
| 'cyanBright'
|
||||
| 'gray'
|
||||
| 'green'
|
||||
| 'greenBright'
|
||||
| 'grey'
|
||||
| 'magenta'
|
||||
| 'magentaBright'
|
||||
| 'red'
|
||||
| 'redBright'
|
||||
| 'white'
|
||||
| 'whiteBright'
|
||||
| 'yellow'
|
||||
| 'yellowBright';
|
||||
|
||||
declare type Modifiers =
|
||||
| 'blink'
|
||||
| 'bold'
|
||||
| 'dim'
|
||||
| 'doubleunderline'
|
||||
| 'framed'
|
||||
| 'hidden'
|
||||
| 'inverse'
|
||||
| 'italic'
|
||||
| 'overlined'
|
||||
| 'reset'
|
||||
| 'strikethrough'
|
||||
| 'underline';
|
||||
|
||||
declare function styleText(
|
||||
format:
|
||||
| ForegroundColors
|
||||
| BackgroundColors
|
||||
| Modifiers
|
||||
| $ReadOnlyArray<ForegroundColors | BackgroundColors | Modifiers>,
|
||||
text: string,
|
||||
options?: $ReadOnly<{
|
||||
stream?: ?stream$Stream,
|
||||
validStream?: ?boolean,
|
||||
}>,
|
||||
): string;
|
||||
}
|
||||
|
||||
type vm$ScriptOptions = {
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*
|
||||
* @flow strict
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
declare module '@react-native-community/cli-server-api' {
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*
|
||||
* @flow
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
declare module '@react-native-community/cli-types' {
|
||||
|
||||
+1
-1
@@ -8,6 +8,6 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
declare module '@tsconfig/node22/tsconfig.json' {
|
||||
declare module '@tsconfig/node18/tsconfig.json' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
+1
@@ -6,6 +6,7 @@
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
declare module 'actual-request-url' {
|
||||
|
||||
+1
@@ -6,6 +6,7 @@
|
||||
*
|
||||
* @flow
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
// The sections between BEGIN GENERATED and END GENERATED are generated
|
||||
|
||||
Vendored
+231
@@ -0,0 +1,231 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
// flow-typed signature: 79cfa6bcaa67fdb60f10d320da0470fc
|
||||
// flow-typed version: 6cecea2e51/chalk_v4.x.x/flow_>=v0.104.x
|
||||
|
||||
// From: https://github.com/chalk/chalk/blob/master/index.d.ts
|
||||
|
||||
declare module 'chalk' {
|
||||
declare type ForegroundColor =
|
||||
| 'black'
|
||||
| 'red'
|
||||
| 'green'
|
||||
| 'yellow'
|
||||
| 'blue'
|
||||
| 'magenta'
|
||||
| 'cyan'
|
||||
| 'white'
|
||||
| 'gray'
|
||||
| 'grey'
|
||||
| 'blackBright'
|
||||
| 'redBright'
|
||||
| 'greenBright'
|
||||
| 'yellowBright'
|
||||
| 'blueBright'
|
||||
| 'magentaBright'
|
||||
| 'cyanBright'
|
||||
| 'whiteBright';
|
||||
|
||||
declare type BackgroundColor =
|
||||
| 'bgBlack'
|
||||
| 'bgRed'
|
||||
| 'bgGreen'
|
||||
| 'bgYellow'
|
||||
| 'bgBlue'
|
||||
| 'bgMagenta'
|
||||
| 'bgCyan'
|
||||
| 'bgWhite'
|
||||
| 'bgGray'
|
||||
| 'bgGrey'
|
||||
| 'bgBlackBright'
|
||||
| 'bgRedBright'
|
||||
| 'bgGreenBright'
|
||||
| 'bgYellowBright'
|
||||
| 'bgBlueBright'
|
||||
| 'bgMagentaBright'
|
||||
| 'bgCyanBright'
|
||||
| 'bgWhiteBright';
|
||||
|
||||
declare type Color = ForegroundColor | BackgroundColor;
|
||||
|
||||
declare type Modifiers =
|
||||
| 'reset'
|
||||
| 'bold'
|
||||
| 'dim'
|
||||
| 'italic'
|
||||
| 'underline'
|
||||
| 'inverse'
|
||||
| 'hidden'
|
||||
| 'strikethrough'
|
||||
| 'visible';
|
||||
|
||||
declare type TemplateStringsArray = $ReadOnlyArray<string>;
|
||||
|
||||
declare type Level = $Values<{
|
||||
None: 0,
|
||||
Basic: 1,
|
||||
Ansi256: 2,
|
||||
TrueColor: 3,
|
||||
...
|
||||
}>;
|
||||
|
||||
declare type ChalkOptions = {|
|
||||
level?: Level,
|
||||
|};
|
||||
|
||||
declare type ColorSupport = {|
|
||||
level: Level,
|
||||
hasBasic: boolean,
|
||||
has256: boolean,
|
||||
has16m: boolean,
|
||||
|};
|
||||
|
||||
declare class Instance implements Chalk {
|
||||
constructor(options?: ChalkOptions): this;
|
||||
|
||||
(...text: string[]): string;
|
||||
(text: TemplateStringsArray, ...placeholders: string[]): string;
|
||||
Instance: typeof Instance;
|
||||
level: Level;
|
||||
rgb(r: number, g: number, b: number): Chalk;
|
||||
hsl(h: number, s: number, l: number): Chalk;
|
||||
hsv(h: number, s: number, v: number): Chalk;
|
||||
hwb(h: number, w: number, b: number): Chalk;
|
||||
bgHex(color: string): Chalk;
|
||||
bgKeyword(color: string): Chalk;
|
||||
bgRgb(r: number, g: number, b: number): Chalk;
|
||||
bgHsl(h: number, s: number, l: number): Chalk;
|
||||
bgHsv(h: number, s: number, v: number): Chalk;
|
||||
bgHwb(h: number, w: number, b: number): Chalk;
|
||||
hex(color: string): Chalk;
|
||||
keyword(color: string): Chalk;
|
||||
|
||||
+reset: Chalk;
|
||||
+bold: Chalk;
|
||||
+dim: Chalk;
|
||||
+italic: Chalk;
|
||||
+underline: Chalk;
|
||||
+inverse: Chalk;
|
||||
+hidden: Chalk;
|
||||
+strikethrough: Chalk;
|
||||
|
||||
+visible: Chalk;
|
||||
|
||||
+black: Chalk;
|
||||
+red: Chalk;
|
||||
+green: Chalk;
|
||||
+yellow: Chalk;
|
||||
+blue: Chalk;
|
||||
+magenta: Chalk;
|
||||
+cyan: Chalk;
|
||||
+white: Chalk;
|
||||
+gray: Chalk;
|
||||
+grey: Chalk;
|
||||
+blackBright: Chalk;
|
||||
+redBright: Chalk;
|
||||
+greenBright: Chalk;
|
||||
+yellowBright: Chalk;
|
||||
+blueBright: Chalk;
|
||||
+magentaBright: Chalk;
|
||||
+cyanBright: Chalk;
|
||||
+whiteBright: Chalk;
|
||||
|
||||
+bgBlack: Chalk;
|
||||
+bgRed: Chalk;
|
||||
+bgGreen: Chalk;
|
||||
+bgYellow: Chalk;
|
||||
+bgBlue: Chalk;
|
||||
+bgMagenta: Chalk;
|
||||
+bgCyan: Chalk;
|
||||
+bgWhite: Chalk;
|
||||
+bgBlackBright: Chalk;
|
||||
+bgRedBright: Chalk;
|
||||
+bgGreenBright: Chalk;
|
||||
+bgYellowBright: Chalk;
|
||||
+bgBlueBright: Chalk;
|
||||
+bgMagentaBright: Chalk;
|
||||
+bgCyanBright: Chalk;
|
||||
+bgWhiteBright: Chalk;
|
||||
|
||||
supportsColor: ColorSupport;
|
||||
}
|
||||
|
||||
declare interface Chalk {
|
||||
(...text: string[]): string;
|
||||
(text: TemplateStringsArray, ...placeholders: string[]): string;
|
||||
Instance: typeof Instance;
|
||||
level: Level;
|
||||
rgb(r: number, g: number, b: number): Chalk;
|
||||
hsl(h: number, s: number, l: number): Chalk;
|
||||
hsv(h: number, s: number, v: number): Chalk;
|
||||
hwb(h: number, w: number, b: number): Chalk;
|
||||
bgHex(color: string): Chalk;
|
||||
bgKeyword(color: string): Chalk;
|
||||
bgRgb(r: number, g: number, b: number): Chalk;
|
||||
bgHsl(h: number, s: number, l: number): Chalk;
|
||||
bgHsv(h: number, s: number, v: number): Chalk;
|
||||
bgHwb(h: number, w: number, b: number): Chalk;
|
||||
hex(color: string): Chalk;
|
||||
keyword(color: string): Chalk;
|
||||
|
||||
+reset: Chalk;
|
||||
+bold: Chalk;
|
||||
+dim: Chalk;
|
||||
+italic: Chalk;
|
||||
+underline: Chalk;
|
||||
+inverse: Chalk;
|
||||
+hidden: Chalk;
|
||||
+strikethrough: Chalk;
|
||||
|
||||
+visible: Chalk;
|
||||
|
||||
+black: Chalk;
|
||||
+red: Chalk;
|
||||
+green: Chalk;
|
||||
+yellow: Chalk;
|
||||
+blue: Chalk;
|
||||
+magenta: Chalk;
|
||||
+cyan: Chalk;
|
||||
+white: Chalk;
|
||||
+gray: Chalk;
|
||||
+grey: Chalk;
|
||||
+blackBright: Chalk;
|
||||
+redBright: Chalk;
|
||||
+greenBright: Chalk;
|
||||
+yellowBright: Chalk;
|
||||
+blueBright: Chalk;
|
||||
+magentaBright: Chalk;
|
||||
+cyanBright: Chalk;
|
||||
+whiteBright: Chalk;
|
||||
|
||||
+bgBlack: Chalk;
|
||||
+bgRed: Chalk;
|
||||
+bgGreen: Chalk;
|
||||
+bgYellow: Chalk;
|
||||
+bgBlue: Chalk;
|
||||
+bgMagenta: Chalk;
|
||||
+bgCyan: Chalk;
|
||||
+bgWhite: Chalk;
|
||||
+bgBlackBright: Chalk;
|
||||
+bgRedBright: Chalk;
|
||||
+bgGreenBright: Chalk;
|
||||
+bgYellowBright: Chalk;
|
||||
+bgBlueBright: Chalk;
|
||||
+bgMagentaBright: Chalk;
|
||||
+bgCyanBright: Chalk;
|
||||
+bgWhiteBright: Chalk;
|
||||
|
||||
supportsColor: ColorSupport;
|
||||
}
|
||||
|
||||
declare module.exports: Chalk;
|
||||
}
|
||||
+1
@@ -6,6 +6,7 @@
|
||||
*
|
||||
* @flow strict
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
declare module 'chrome-launcher' {
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*
|
||||
* @flow strict
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
declare module 'chromium-edge-launcher' {
|
||||
|
||||
Vendored
+1
@@ -6,6 +6,7 @@
|
||||
*
|
||||
* @flow strict
|
||||
* @format
|
||||
* @oncall react_native
|
||||
* @generated
|
||||
*/
|
||||
|
||||
|
||||
Vendored
+1
@@ -6,6 +6,7 @@
|
||||
*
|
||||
* @flow strict
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
declare module 'connect' {
|
||||
|
||||
Vendored
-20
@@ -1,20 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow strict
|
||||
* @format
|
||||
*/
|
||||
|
||||
declare module 'cross-spawn' {
|
||||
import * as child_process from 'child_process';
|
||||
|
||||
type spawn = typeof child_process.spawn & {
|
||||
spawn: spawn,
|
||||
sync: typeof child_process.spawnSync,
|
||||
};
|
||||
|
||||
declare module.exports: spawn;
|
||||
}
|
||||
-149
@@ -1,149 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
*/
|
||||
|
||||
declare module '@electron/packager' {
|
||||
declare export type AsarOptions = $FlowFixMe;
|
||||
|
||||
declare export type ElectronDownloadRequestOptions = $FlowFixMe;
|
||||
|
||||
declare export type TargetDefinition = {
|
||||
arch: TargetArch,
|
||||
platform: TargetPlatform,
|
||||
};
|
||||
|
||||
declare export type FinalizePackageTargetsHookFunction = (
|
||||
targets: TargetDefinition[],
|
||||
callback: HookFunctionErrorCallback,
|
||||
) => void;
|
||||
|
||||
declare export type HookFunction = (
|
||||
buildPath: string,
|
||||
electronVersion: string,
|
||||
platform: TargetPlatform,
|
||||
arch: TargetArch,
|
||||
callback: HookFunctionErrorCallback,
|
||||
) => void;
|
||||
|
||||
declare export type IgnoreFunction = (path: string) => boolean;
|
||||
|
||||
declare export type HookFunctionErrorCallback = (err?: Error | null) => void;
|
||||
|
||||
declare export interface MacOSProtocol {
|
||||
name: string;
|
||||
schemes: string[];
|
||||
}
|
||||
|
||||
declare export type NotaryToolCredentials = $FlowFixMe;
|
||||
|
||||
declare export type OsxSignOptions = $FlowFixMe;
|
||||
|
||||
declare export type OsxUniversalOptions = $FlowFixMe;
|
||||
|
||||
declare export type Win32MetadataOptions = $ReadOnly<{
|
||||
CompanyName?: string,
|
||||
FileDescription?: string,
|
||||
OriginalFilename?: string,
|
||||
ProductName?: string,
|
||||
InternalName?: string,
|
||||
'requested-execution-level'?:
|
||||
| 'asInvoker'
|
||||
| 'highestAvailable'
|
||||
| 'requireAdministrator',
|
||||
'application-manifest'?: string,
|
||||
}>;
|
||||
|
||||
declare export type WindowsSignOptions = $FlowFixMe;
|
||||
|
||||
declare export type OfficialArch =
|
||||
| 'ia32'
|
||||
| 'x64'
|
||||
| 'armv7l'
|
||||
| 'arm64'
|
||||
| 'mips64el'
|
||||
| 'universal';
|
||||
|
||||
declare export type OfficialPlatform = 'linux' | 'win32' | 'darwin' | 'mas';
|
||||
|
||||
declare export type TargetArch = OfficialArch | string;
|
||||
|
||||
declare export type TargetPlatform = OfficialPlatform | string;
|
||||
|
||||
declare export type ArchOption = TargetArch | 'all';
|
||||
|
||||
declare export type PlatformOption = TargetPlatform | 'all';
|
||||
|
||||
declare export interface Options {
|
||||
dir: string;
|
||||
afterAsar?: HookFunction[];
|
||||
afterComplete?: HookFunction[];
|
||||
afterCopy?: HookFunction[];
|
||||
afterCopyExtraResources?: HookFunction[];
|
||||
afterExtract?: HookFunction[];
|
||||
afterFinalizePackageTargets?: FinalizePackageTargetsHookFunction[];
|
||||
afterInitialize?: HookFunction[];
|
||||
afterPrune?: HookFunction[];
|
||||
all?: boolean;
|
||||
appBundleId?: string;
|
||||
appCategoryType?: string;
|
||||
appCopyright?: string;
|
||||
appVersion?: string;
|
||||
arch?: ArchOption | ArchOption[];
|
||||
asar?: boolean | AsarOptions;
|
||||
beforeAsar?: HookFunction[];
|
||||
beforeCopy?: HookFunction[];
|
||||
beforeCopyExtraResources?: HookFunction[];
|
||||
buildVersion?: string;
|
||||
darwinDarkModeSupport?: boolean;
|
||||
derefSymlinks?: boolean;
|
||||
download?: ElectronDownloadRequestOptions;
|
||||
electronVersion?: string;
|
||||
electronZipDir?: string;
|
||||
executableName?: string;
|
||||
extendHelperInfo?:
|
||||
| string
|
||||
| {
|
||||
[property: string]: any,
|
||||
};
|
||||
extendInfo?:
|
||||
| string
|
||||
| {
|
||||
[property: string]: any,
|
||||
};
|
||||
extraResource?: string | string[];
|
||||
helperBundleId?: string;
|
||||
icon?: string;
|
||||
ignore?: RegExp | (string | RegExp)[] | IgnoreFunction;
|
||||
junk?: boolean;
|
||||
name?: string;
|
||||
osxNotarize?: NotaryToolCredentials;
|
||||
osxSign?: true | OsxSignOptions;
|
||||
osxUniversal?: OsxUniversalOptions;
|
||||
out?: string;
|
||||
overwrite?: boolean;
|
||||
platform?: TargetPlatform | 'all' | Array<TargetPlatform | 'all'>;
|
||||
prebuiltAsar?: string;
|
||||
protocols?: MacOSProtocol[];
|
||||
prune?: boolean;
|
||||
quiet?: boolean;
|
||||
tmpdir?: string | false;
|
||||
usageDescription?: {
|
||||
[property: string]: string,
|
||||
};
|
||||
win32metadata?: Win32MetadataOptions;
|
||||
windowsSign?: true | WindowsSignOptions;
|
||||
}
|
||||
|
||||
declare function packager(options: Options): Promise<string[]>;
|
||||
|
||||
declare module.exports: typeof packager & {
|
||||
packager: typeof packager,
|
||||
default: typeof packager,
|
||||
};
|
||||
}
|
||||
Vendored
+1
@@ -6,6 +6,7 @@
|
||||
*
|
||||
* @flow strict
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
// Modified from flow-typed repo:
|
||||
|
||||
Vendored
+1
@@ -3,6 +3,7 @@
|
||||
*
|
||||
* @flow strict
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
declare module 'jest-diff' {
|
||||
|
||||
+1
@@ -6,6 +6,7 @@
|
||||
*
|
||||
* @flow strict
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
declare module 'jest-snapshot' {
|
||||
|
||||
Vendored
+1
-5
@@ -4,8 +4,8 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
// Modified from https://raw.githubusercontent.com/flow-typed/flow-typed/master/definitions/npm/jest_v29.x.x/flow_v0.134.x-/jest_v29.x.x.js
|
||||
@@ -854,10 +854,6 @@ type JestObjectType = {
|
||||
* Returns the number of fake timers still left to run.
|
||||
*/
|
||||
getTimerCount(): number,
|
||||
/**
|
||||
* Returns the time in ms of the current clock.
|
||||
*/
|
||||
now(): number,
|
||||
/**
|
||||
* Set the current system time used by fake timers.
|
||||
* Simulates a user changing the system clock while your program is running.
|
||||
|
||||
Vendored
+1
@@ -6,6 +6,7 @@
|
||||
*
|
||||
* @flow strict
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
// Modified from flow-typed repo:
|
||||
|
||||
Vendored
+1
@@ -6,6 +6,7 @@
|
||||
*
|
||||
* @flow strict
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
declare module 'open' {
|
||||
|
||||
+1
@@ -3,6 +3,7 @@
|
||||
*
|
||||
* @flow strict
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
declare type Print = (value: mixed) => string;
|
||||
declare type Indent = (value: string) => string;
|
||||
|
||||
Vendored
+1
@@ -6,6 +6,7 @@
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
declare module 'selfsigned' {
|
||||
|
||||
+1
@@ -6,6 +6,7 @@
|
||||
*
|
||||
* @flow strict
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
declare module 'serve-static' {
|
||||
|
||||
+1
-1
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
|
||||
*
|
||||
* @flow strict
|
||||
* @format
|
||||
* @flow strict
|
||||
*/
|
||||
|
||||
declare module 'signedsource' {
|
||||
|
||||
Vendored
+1
@@ -6,6 +6,7 @@
|
||||
*
|
||||
* @flow strict
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
declare module 'tinybench' {
|
||||
|
||||
Vendored
-5
@@ -48,11 +48,6 @@ declare module 'typescript' {
|
||||
file: SourceFile,
|
||||
start?: number,
|
||||
): $ReadOnly<{line: number, character: number}>,
|
||||
convertCompilerOptionsFromJson(
|
||||
jsonOptions: any,
|
||||
basePath: string,
|
||||
configFileName?: string,
|
||||
): {options: Object, errors: Diagnostic[]},
|
||||
ModuleResolutionKind: typeof ModuleResolutionKind,
|
||||
...
|
||||
};
|
||||
|
||||
Vendored
+1
@@ -6,6 +6,7 @@
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
// Very incomplete types for the undici package.
|
||||
|
||||
+1
@@ -6,6 +6,7 @@
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
declare module 'wait-for-expect' {
|
||||
|
||||
Vendored
+1
@@ -6,6 +6,7 @@
|
||||
*
|
||||
* @flow strict
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
declare type ws$PerMessageDeflateOptions = {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
+4
-10
@@ -4,19 +4,16 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow strict
|
||||
* @format
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
// $FlowFixMe[cannot-resolve-module]
|
||||
// $FlowFixMe[untyped-import]
|
||||
const {defaults} = require('jest-config');
|
||||
|
||||
const PODS_LOCATIONS = [
|
||||
'packages/rn-tester/Pods',
|
||||
'private/helloworld/ios/Pods',
|
||||
'packages/helloworld/ios/Pods',
|
||||
];
|
||||
|
||||
module.exports = {
|
||||
@@ -42,21 +39,18 @@ module.exports = {
|
||||
'<rootDir>/packages/react-native/Libraries/Renderer',
|
||||
'<rootDir>/packages/react-native/sdks/hermes/',
|
||||
...PODS_LOCATIONS,
|
||||
] /*:: as $ReadOnlyArray<string> */,
|
||||
],
|
||||
transformIgnorePatterns: ['node_modules/(?!@react-native/)'],
|
||||
haste: {
|
||||
defaultPlatform: 'ios',
|
||||
platforms: ['ios', 'android'],
|
||||
},
|
||||
moduleFileExtensions: [
|
||||
'fb.js',
|
||||
...defaults.moduleFileExtensions,
|
||||
] /*:: as $ReadOnlyArray<string> */,
|
||||
moduleFileExtensions: ['fb.js'].concat(defaults.moduleFileExtensions),
|
||||
modulePathIgnorePatterns: [
|
||||
'scripts/.*/__fixtures__/',
|
||||
'<rootDir>/packages/react-native/sdks/hermes/',
|
||||
...PODS_LOCATIONS,
|
||||
] /*:: as $ReadOnlyArray<string> */,
|
||||
],
|
||||
unmockedModulePathPatterns: [
|
||||
'node_modules/react/',
|
||||
'packages/react-native/Libraries/Renderer',
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
* @format
|
||||
* @flow
|
||||
*/
|
||||
|
||||
/* eslint-env node */
|
||||
|
||||
'use strict';
|
||||
|
||||
// eslint-disable-next-line @react-native/monorepo/sort-imports
|
||||
// eslint-disable-next-line lint/sort-imports
|
||||
const {
|
||||
transformFromAstSync: babelTransformFromAstSync,
|
||||
transformSync: babelTransformSync,
|
||||
@@ -32,7 +32,7 @@ if (process.env.FBSOURCE_ENV === '1') {
|
||||
require('@fb-tools/babel-register');
|
||||
} else {
|
||||
// Register Babel to allow local packages to be loaded from source
|
||||
require('../scripts/shared/babelRegister').registerForMonorepo();
|
||||
require('../scripts/babel-register').registerForMonorepo();
|
||||
}
|
||||
|
||||
const transformer = require('@react-native/metro-babel-transformer');
|
||||
@@ -59,9 +59,6 @@ const babelPluginPreventBabelRegister = [
|
||||
|
||||
module.exports = {
|
||||
process(src /*: string */, file /*: string */) /*: {code: string, ...} */ {
|
||||
if (file.endsWith('.json')) {
|
||||
return {code: src};
|
||||
}
|
||||
if (nodeFiles.test(file)) {
|
||||
// node specific transforms only
|
||||
return babelTransformSync(src, {
|
||||
|
||||
+27
-33
@@ -8,21 +8,18 @@
|
||||
"android": "yarn --cwd packages/rn-tester android",
|
||||
"build-android": "./gradlew :packages:react-native:ReactAndroid:build",
|
||||
"build": "node ./scripts/build/build.js",
|
||||
"build-types": "node ./scripts/js-api/build-types",
|
||||
"build-types": "node ./scripts/build-types",
|
||||
"clang-format": "clang-format -i --glob=*/**/*.{h,cpp,m,mm}",
|
||||
"clean": "node ./scripts/build/clean.js",
|
||||
"cxx-api-build": "node ./scripts/cxx-api/public-api.js",
|
||||
"flow-check": "flow check",
|
||||
"flow": "flow",
|
||||
"format-check": "prettier --list-different \"./**/*.{js,md,yml,ts,tsx}\"",
|
||||
"format": "npm run prettier && npm run clang-format",
|
||||
"featureflags": "yarn --cwd packages/react-native featureflags",
|
||||
"js-api-diff": "node ./scripts/js-api/diff-api-snapshot",
|
||||
"lint-ci": "./.github/workflow-scripts/analyze_code.sh && yarn shellcheck",
|
||||
"lint-kotlin-check": "./gradlew ktfmtCheck",
|
||||
"lint-kotlin": "./gradlew ktfmtFormat",
|
||||
"lint-java": "node ./scripts/lint-java.js",
|
||||
"lint-markdown": "markdownlint-cli2 2>&1",
|
||||
"lint": "eslint --max-warnings 0 .",
|
||||
"lint": "eslint .",
|
||||
"prettier": "prettier --write \"./**/*.{js,md,yml,ts,tsx}\"",
|
||||
"print-packages": "node ./scripts/monorepo/print",
|
||||
"shellcheck": "./.github/workflow-scripts/analyze_scripts.sh",
|
||||
@@ -30,20 +27,19 @@
|
||||
"set-version": "node ./scripts/releases/set-version.js",
|
||||
"test-android": "./gradlew :packages:react-native:ReactAndroid:test",
|
||||
"test-ci": "jest --maxWorkers=2 --ci --reporters=\"default\" --reporters=\"jest-junit\"",
|
||||
"test-release-local-clean": "node ./scripts/release-testing/test-release-local-clean.js",
|
||||
"test-release-local": "node ./scripts/release-testing/test-release-local.js",
|
||||
"test-e2e-local-clean": "node ./scripts/release-testing/test-e2e-local-clean.js",
|
||||
"test-e2e-local": "node ./scripts/release-testing/test-e2e-local.js",
|
||||
"test-ios": "./scripts/objc-test.sh test",
|
||||
"test-typescript": "tsc -p packages/react-native/types/tsconfig.json",
|
||||
"test-generated-typescript": "tsc -p packages/react-native/types_generated/tsconfig.test.json",
|
||||
"test-typescript": "tsc -p packages/react-native/types/tsconfig.test.json",
|
||||
"test": "jest",
|
||||
"fantom": "./scripts/fantom.sh",
|
||||
"fantom": "JS_DIR='..' yarn jest --config packages/react-native-fantom/config/jest.config.js",
|
||||
"trigger-react-native-release": "node ./scripts/releases-local/trigger-react-native-release.js",
|
||||
"update-lock": "npx yarn-deduplicate"
|
||||
},
|
||||
"workspaces": [
|
||||
"packages/*",
|
||||
"private/*",
|
||||
"!private/helloworld"
|
||||
"tools/*",
|
||||
"!packages/helloworld"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
@@ -53,19 +49,18 @@
|
||||
"@babel/plugin-transform-regenerator": "^7.24.7",
|
||||
"@babel/preset-env": "^7.25.3",
|
||||
"@babel/preset-flow": "^7.24.7",
|
||||
"@electron/packager": "^18.3.6",
|
||||
"@jest/create-cache-key-function": "^29.7.0",
|
||||
"@microsoft/api-extractor": "^7.52.2",
|
||||
"@react-native/metro-babel-transformer": "0.81.0-main",
|
||||
"@react-native/metro-config": "0.81.0-main",
|
||||
"@tsconfig/node22": "22.0.2",
|
||||
"@types/react": "^19.1.0",
|
||||
"@typescript-eslint/parser": "^8.36.0",
|
||||
"@react-native/metro-babel-transformer": "0.80.2",
|
||||
"@react-native/metro-config": "0.80.2",
|
||||
"@tsconfig/node18": "1.0.1",
|
||||
"@types/react": "^19.0.0",
|
||||
"@typescript-eslint/parser": "^7.1.1",
|
||||
"ansi-styles": "^4.2.1",
|
||||
"babel-plugin-minify-dead-code-elimination": "^0.5.2",
|
||||
"babel-plugin-syntax-hermes-parser": "0.29.1",
|
||||
"babel-plugin-syntax-hermes-parser": "0.28.1",
|
||||
"babel-plugin-transform-define": "^2.1.4",
|
||||
"babel-plugin-transform-flow-enums": "^0.0.2",
|
||||
"chalk": "^4.0.0",
|
||||
"clang-format": "^1.8.0",
|
||||
"connect": "^3.6.5",
|
||||
"debug": "^4.4.0",
|
||||
@@ -77,16 +72,17 @@
|
||||
"eslint-plugin-ft-flow": "^2.0.1",
|
||||
"eslint-plugin-jest": "^27.9.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.6.0",
|
||||
"eslint-plugin-lint": "^1.0.0",
|
||||
"eslint-plugin-react": "^7.30.1",
|
||||
"eslint-plugin-react-hooks": "^5.2.0",
|
||||
"eslint-plugin-react-native": "^4.0.0",
|
||||
"eslint-plugin-redundant-undefined": "^0.4.0",
|
||||
"eslint-plugin-relay": "^1.8.3",
|
||||
"flow-api-translator": "0.29.1",
|
||||
"flow-bin": "^0.275.0",
|
||||
"flow-api-translator": "0.28.1",
|
||||
"flow-bin": "^0.269.1",
|
||||
"glob": "^7.1.1",
|
||||
"hermes-eslint": "0.29.1",
|
||||
"hermes-transform": "0.29.1",
|
||||
"ini": "^5.0.0",
|
||||
"hermes-eslint": "0.28.1",
|
||||
"hermes-transform": "0.28.1",
|
||||
"inquirer": "^7.1.0",
|
||||
"jest": "^29.7.0",
|
||||
"jest-config": "^29.7.0",
|
||||
@@ -95,27 +91,25 @@
|
||||
"jest-snapshot": "^29.7.0",
|
||||
"markdownlint-cli2": "^0.17.2",
|
||||
"markdownlint-rule-relative-links": "^3.0.0",
|
||||
"memfs": "^4.7.7",
|
||||
"metro-babel-register": "^0.83.0",
|
||||
"metro-transform-plugins": "^0.83.0",
|
||||
"metro-babel-register": "^0.82.2",
|
||||
"metro-memory-fs": "^0.82.2",
|
||||
"metro-transform-plugins": "^0.82.2",
|
||||
"micromatch": "^4.0.4",
|
||||
"node-fetch": "^2.2.0",
|
||||
"nullthrows": "^1.1.1",
|
||||
"prettier": "2.8.8",
|
||||
"prettier-plugin-hermes-parser": "0.29.1",
|
||||
"prettier-plugin-hermes-parser": "0.28.1",
|
||||
"react": "19.1.0",
|
||||
"react-test-renderer": "19.1.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"shelljs": "^0.8.5",
|
||||
"signedsource": "^1.0.0",
|
||||
"supports-color": "^7.1.0",
|
||||
"temp-dir": "^2.0.0",
|
||||
"tinybench": "^3.1.0",
|
||||
"typescript": "5.8.3",
|
||||
"typescript": "5.0.4",
|
||||
"ws": "^6.2.3"
|
||||
},
|
||||
"resolutions": {
|
||||
"eslint-plugin-react-hooks": "6.1.0-canary-12bc60f5-20250613",
|
||||
"react-is": "19.1.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
import {getAndroidResourceFolderName} from '../path-support';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/assets-registry",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.80.2",
|
||||
"description": "Asset support code for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -17,7 +17,7 @@
|
||||
],
|
||||
"bugs": "https://github.com/facebook/react-native/issues",
|
||||
"engines": {
|
||||
"node": ">= 20.19.4"
|
||||
"node": ">=18"
|
||||
},
|
||||
"files": [
|
||||
"path-support.js",
|
||||
|
||||
@@ -40,5 +40,5 @@ function getAssetByID(assetId /*: number */) /*: PackagerAsset */ {
|
||||
return assets[assetId - 1];
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @react-native/monorepo/no-commonjs-exports
|
||||
// eslint-disable-next-line lint/no-commonjs-exports
|
||||
module.exports = {registerAsset, getAssetByID};
|
||||
|
||||
@@ -4,27 +4,24 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
import failures from '../__test_fixtures__/failures.js';
|
||||
import fixtures from '../__test_fixtures__/fixtures.js';
|
||||
import {transformSync} from '@babel/core';
|
||||
'use strict';
|
||||
|
||||
const transform = (fixture /*: string */, filename /*: string */) =>
|
||||
transformSync(fixture, {
|
||||
const failures = require('../__test_fixtures__/failures.js');
|
||||
const fixtures = require('../__test_fixtures__/fixtures.js');
|
||||
const {transform: babelTransform} = require('@babel/core');
|
||||
|
||||
const transform = (fixture, filename) =>
|
||||
babelTransform(fixture, {
|
||||
babelrc: false,
|
||||
browserslistConfigFile: false,
|
||||
cwd: '/',
|
||||
filename,
|
||||
filename: filename,
|
||||
highlightCode: false,
|
||||
plugins: [
|
||||
// $FlowFixMe[untyped-import]
|
||||
require('@babel/plugin-syntax-flow'),
|
||||
// $FlowFixMe[untyped-import]
|
||||
require('../index'),
|
||||
],
|
||||
plugins: [require('@babel/plugin-syntax-flow'), require('../index')],
|
||||
}).code;
|
||||
|
||||
describe('Babel plugin inline view configs', () => {
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @noflow
|
||||
* @format
|
||||
*/
|
||||
|
||||
@@ -24,19 +23,16 @@ try {
|
||||
} catch (e) {
|
||||
// Fallback to lib when source doesn't exit (e.g. when installed as a dev dependency)
|
||||
FlowParser =
|
||||
// $FlowIgnore[cannot-resolve-module]
|
||||
require('@react-native/codegen/lib/parsers/flow/parser').FlowParser;
|
||||
TypeScriptParser =
|
||||
// $FlowIgnore[cannot-resolve-module]
|
||||
require('@react-native/codegen/lib/parsers/typescript/parser').TypeScriptParser;
|
||||
// $FlowIgnore[cannot-resolve-module]
|
||||
RNCodegen = require('@react-native/codegen/lib/generators/RNCodegen');
|
||||
}
|
||||
|
||||
const flowParser = new FlowParser();
|
||||
const typeScriptParser = new TypeScriptParser();
|
||||
|
||||
function parseFile(filename /*: string */, code /*: string */) {
|
||||
function parseFile(filename, code) {
|
||||
if (filename.endsWith('js')) {
|
||||
return flowParser.parseString(code);
|
||||
}
|
||||
@@ -50,7 +46,7 @@ function parseFile(filename /*: string */, code /*: string */) {
|
||||
);
|
||||
}
|
||||
|
||||
function generateViewConfig(filename /*: string */, code /*: string */) {
|
||||
function generateViewConfig(filename, code) {
|
||||
const schema = parseFile(filename, code);
|
||||
|
||||
const libraryName = basename(filename).replace(
|
||||
@@ -58,8 +54,8 @@ function generateViewConfig(filename /*: string */, code /*: string */) {
|
||||
'',
|
||||
);
|
||||
return RNCodegen.generateViewConfig({
|
||||
libraryName,
|
||||
schema,
|
||||
libraryName,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/babel-plugin-codegen",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.80.2",
|
||||
"description": "Babel plugin to generate native module and view manager code for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -19,14 +19,14 @@
|
||||
],
|
||||
"bugs": "https://github.com/facebook/react-native/issues",
|
||||
"engines": {
|
||||
"node": ">= 20.19.4"
|
||||
"node": ">=18"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/traverse": "^7.25.3",
|
||||
"@react-native/codegen": "0.81.0-main"
|
||||
"@react-native/codegen": "0.80.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.25.2"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/community-cli-plugin",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.80.2",
|
||||
"description": "Core CLI commands for React Native",
|
||||
"keywords": [
|
||||
"react-native",
|
||||
@@ -22,20 +22,20 @@
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"@react-native/dev-middleware": "0.81.0-main",
|
||||
"@react-native/dev-middleware": "0.80.2",
|
||||
"chalk": "^4.0.0",
|
||||
"debug": "^4.4.0",
|
||||
"invariant": "^2.2.4",
|
||||
"metro": "^0.83.0",
|
||||
"metro-config": "^0.83.0",
|
||||
"metro-core": "^0.83.0",
|
||||
"metro": "^0.82.2",
|
||||
"metro-config": "^0.82.2",
|
||||
"metro-core": "^0.82.2",
|
||||
"semver": "^7.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"metro-resolver": "^0.83.0"
|
||||
"metro-resolver": "^0.82.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@react-native-community/cli": "*",
|
||||
"@react-native/metro-config": "*"
|
||||
"@react-native-community/cli": "*"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@react-native-community/cli": {
|
||||
@@ -43,6 +43,6 @@
|
||||
}
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 20.19.4"
|
||||
"node": ">=18"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
function sign(source: string): string {
|
||||
function sign(source) {
|
||||
return source;
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -6,6 +6,7 @@
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
import filterPlatformAssetScales from '../filterPlatformAssetScales';
|
||||
|
||||
+1
@@ -6,6 +6,7 @@
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
import getAssetDestPathAndroid from '../getAssetDestPathAndroid';
|
||||
|
||||
+1
@@ -6,6 +6,7 @@
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
import getAssetDestPathIOS from '../getAssetDestPathIOS';
|
||||
|
||||
@@ -6,9 +6,10 @@
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
import type {AssetData} from 'metro';
|
||||
import type {AssetData} from 'metro/src/Assets';
|
||||
|
||||
import assetPathUtils from './assetPathUtils';
|
||||
import fs from 'fs';
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
export type PackagerAsset = $ReadOnly<{
|
||||
|
||||
@@ -6,19 +6,22 @@
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
import type {Config} from '@react-native-community/cli-types';
|
||||
import type {RunBuildOptions} from 'metro';
|
||||
import type {ConfigT} from 'metro-config';
|
||||
import type {RequestOptions} from 'metro/src/shared/types.flow';
|
||||
|
||||
import loadMetroConfig from '../../utils/loadMetroConfig';
|
||||
import parseKeyValueParamArray from '../../utils/parseKeyValueParamArray';
|
||||
import saveAssets from './saveAssets';
|
||||
import chalk from 'chalk';
|
||||
import {promises as fs} from 'fs';
|
||||
import {runBuild} from 'metro';
|
||||
import Server from 'metro/src/Server';
|
||||
import metroBundle from 'metro/src/shared/output/bundle';
|
||||
import metroRamBundle from 'metro/src/shared/output/RamBundle';
|
||||
import path from 'path';
|
||||
import {styleText} from 'util';
|
||||
|
||||
export type BundleCommandArgs = {
|
||||
assetsDest?: string,
|
||||
@@ -38,7 +41,7 @@ export type BundleCommandArgs = {
|
||||
sourcemapSourcesRoot?: string,
|
||||
sourcemapUseAbsolutePath: boolean,
|
||||
verbose: boolean,
|
||||
unstableTransformProfile: 'hermes-stable' | 'hermes-canary' | 'default',
|
||||
unstableTransformProfile: string,
|
||||
indexedRamBundle?: boolean,
|
||||
resolverOption?: Array<string>,
|
||||
};
|
||||
@@ -47,7 +50,7 @@ async function buildBundle(
|
||||
_argv: Array<string>,
|
||||
ctx: Config,
|
||||
args: BundleCommandArgs,
|
||||
bundleImpl?: RunBuildOptions['output'],
|
||||
bundleImpl: typeof metroBundle | typeof metroRamBundle = metroBundle,
|
||||
): Promise<void> {
|
||||
const config = await loadMetroConfig(ctx, {
|
||||
maxWorkers: args.maxWorkers,
|
||||
@@ -61,7 +64,7 @@ async function buildBundle(
|
||||
async function buildBundleWithConfig(
|
||||
args: BundleCommandArgs,
|
||||
config: ConfigT,
|
||||
bundleImpl?: RunBuildOptions['output'],
|
||||
bundleImpl: typeof metroBundle | typeof metroRamBundle = metroBundle,
|
||||
): Promise<void> {
|
||||
const customResolverOptions = parseKeyValueParamArray(
|
||||
args.resolverOption ?? [],
|
||||
@@ -69,14 +72,14 @@ async function buildBundleWithConfig(
|
||||
|
||||
if (config.resolver.platforms.indexOf(args.platform) === -1) {
|
||||
console.error(
|
||||
`${styleText('red', 'error')}: Invalid platform ${
|
||||
args.platform ? `"${styleText('bold', args.platform)}" ` : ''
|
||||
`${chalk.red('error')}: Invalid platform ${
|
||||
args.platform ? `"${chalk.bold(args.platform)}" ` : ''
|
||||
}selected.`,
|
||||
);
|
||||
|
||||
console.info(
|
||||
`Available platforms are: ${config.resolver.platforms
|
||||
.map(x => `"${styleText('bold', x)}"`)
|
||||
.map(x => `"${chalk.bold(x)}"`)
|
||||
.join(
|
||||
', ',
|
||||
)}. If you are trying to bundle for an out-of-tree platform, it may not be installed.`,
|
||||
@@ -94,48 +97,52 @@ async function buildBundleWithConfig(
|
||||
sourceMapUrl = path.basename(sourceMapUrl);
|
||||
}
|
||||
|
||||
const runBuildOptions: RunBuildOptions = {
|
||||
assets: args.assetsDest != null,
|
||||
bundleOut: args.bundleOutput,
|
||||
customResolverOptions,
|
||||
dev: args.dev,
|
||||
entry: args.entryFile,
|
||||
minify: args.minify !== undefined ? args.minify : !args.dev,
|
||||
output: bundleImpl,
|
||||
platform: args.platform,
|
||||
sourceMap: args.sourcemapOutput != null,
|
||||
sourceMapOut: args.sourcemapOutput,
|
||||
// $FlowIgnore[prop-missing]
|
||||
const requestOpts: RequestOptions & {...} = {
|
||||
entryFile: args.entryFile,
|
||||
sourceMapUrl,
|
||||
dev: args.dev,
|
||||
minify: args.minify !== undefined ? args.minify : !args.dev,
|
||||
platform: args.platform,
|
||||
// $FlowFixMe[incompatible-type] Remove suppression after Metro 0.82.3
|
||||
unstable_transformProfile: args.unstableTransformProfile,
|
||||
customResolverOptions,
|
||||
};
|
||||
const server = new Server(config);
|
||||
|
||||
// Ensure destination directory exists before running the build
|
||||
await fs.mkdir(path.dirname(args.bundleOutput), {
|
||||
recursive: true,
|
||||
mode: 0o755,
|
||||
});
|
||||
try {
|
||||
const bundle = await bundleImpl.build(server, requestOpts);
|
||||
|
||||
const result = await runBuild(config, runBuildOptions);
|
||||
// Ensure destination directory exists before saving the bundle
|
||||
await fs.mkdir(path.dirname(args.bundleOutput), {
|
||||
recursive: true,
|
||||
mode: 0o755,
|
||||
});
|
||||
|
||||
if (args.assetsDest == null) {
|
||||
console.warn('Warning: Assets destination folder is not set, skipping...');
|
||||
return;
|
||||
// $FlowIgnore[class-object-subtyping]
|
||||
// $FlowIgnore[incompatible-call]
|
||||
// $FlowIgnore[prop-missing]
|
||||
// $FlowIgnore[incompatible-exact]
|
||||
await bundleImpl.save(bundle, args, console.info);
|
||||
|
||||
// Save the assets of the bundle
|
||||
// $FlowFixMe[prop-missing] Remove suppression after Metro 0.82.3
|
||||
const outputAssets = await server.getAssets({
|
||||
...Server.DEFAULT_BUNDLE_OPTIONS,
|
||||
...requestOpts,
|
||||
bundleType: 'todo',
|
||||
});
|
||||
|
||||
// When we're done saving bundle output and the assets, we're done.
|
||||
return await saveAssets(
|
||||
outputAssets,
|
||||
args.platform,
|
||||
args.assetsDest,
|
||||
args.assetCatalogDest,
|
||||
);
|
||||
} finally {
|
||||
await server.end();
|
||||
}
|
||||
|
||||
// Save the assets of the bundle
|
||||
if (result.assets == null) {
|
||||
throw new Error("Assets missing from Metro's runBuild result");
|
||||
}
|
||||
|
||||
const outputAssets = result.assets;
|
||||
|
||||
// When we're done saving bundle output and the assets, we're done.
|
||||
await saveAssets(
|
||||
outputAssets,
|
||||
args.platform,
|
||||
args.assetsDest,
|
||||
args.assetCatalogDest,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,9 +6,10 @@
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
import type {AssetData} from 'metro';
|
||||
import type {AssetData} from 'metro/src/Assets';
|
||||
|
||||
import assetPathUtils from './assetPathUtils';
|
||||
import fs from 'fs';
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
const ALLOWED_SCALES: {[key: string]: number[]} = {
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
import type {PackagerAsset} from './assetPathUtils';
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
import type {PackagerAsset} from './assetPathUtils';
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
import type {Command} from '@react-native-community/cli-types';
|
||||
|
||||
@@ -6,9 +6,10 @@
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
import type {AssetData} from 'metro';
|
||||
import type {AssetData} from 'metro/src/Assets';
|
||||
|
||||
import {
|
||||
cleanAssetCatalog,
|
||||
@@ -20,9 +21,9 @@ import createKeepFileAsync from './createKeepFileAsync';
|
||||
import filterPlatformAssetScales from './filterPlatformAssetScales';
|
||||
import getAssetDestPathAndroid from './getAssetDestPathAndroid';
|
||||
import getAssetDestPathIOS from './getAssetDestPathIOS';
|
||||
import chalk from 'chalk';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import {styleText} from 'util';
|
||||
|
||||
type CopiedFiles = {
|
||||
[src: string]: string,
|
||||
@@ -65,7 +66,7 @@ async function saveAssets(
|
||||
const catalogDir = path.join(assetCatalogDest, 'RNAssets.xcassets');
|
||||
if (!fs.existsSync(catalogDir)) {
|
||||
console.error(
|
||||
`${styleText('red', 'error')}: Could not find asset catalog 'RNAssets.xcassets' in ${assetCatalogDest}. Make sure to create it if it does not exist.`,
|
||||
`${chalk.red('error')}: Could not find asset catalog 'RNAssets.xcassets' in ${assetCatalogDest}. Make sure to create it if it does not exist.`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user